Tags,Input
"['quantum-gate', 'unitarity']"," Title: Why are quantum gates unitary and not special unitary?Body: Given that the global phases of states cannot be physically discerned, why is it that quantum circuits are phrased in terms of unitaries and not special unitaries? One answer I got was that it is just for convenience but I'm still unsure.
A related question is this: are there any differences in the physical implementation of a unitary $U$ (mathematical matrix) and $ V: =e^{i\alpha}U$, say in terms of some elementary gates? Suppose there isn't (which is my understanding). Then the physical implementation of $c\text{-}U$ and $c\text{-}V$ should be the same (just add controls to the elementary gates). But then I get into the contradiction that $c\text{-}U$ and $c\text{-}V$ of these two unitaries may not be equivalent up to phase (as mathematical matrices), so it seems plausible they correspond to different physical implementations.
What have I done wrong in my reasoning here, because it suggests now that $U$ and $V$ must be implemented differently even though they are equivalent up to phase?
Another related question (in fact the origin of my confusion, I'd be extra grateful for an answer to this one): it seems that one can use a quantum circuit to estimate both the modulus and phase of the complex overlap $\langle\psi|U|\psi\rangle$ (see https://arxiv.org/abs/quant-ph/0203016). But doesn't this imply again that $U$ and $e^{i\alpha}U$ are measurably different?
"
"['circuit-construction', 'universal-gates', 'gate-synthesis']"," Title: Shortest sequence of universal quantum gates that correspond to a given unitaryBody: Question: Given a unitary matrix acting on $n$ qubits, can we find the shortest sequence of Clifford + T gates that correspond to that unitary?
For background on the question, two important references:
- Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates by Kliuchnikov, Maslov, and Mosca
- Exact synthesis of multiqubit Clifford+T circuits by Giles and Selinger.
"
"['entanglement', 'state-distillation']"," Title: Entanglement distillation by local operations and post-selection using one entanglement pairBody:
- Consider the state $|X\rangle = \sqrt{0.9} |00\rangle + \sqrt{0.1} |11\rangle$, shared between Alice and Bob, who are located far apart.
- Alice brings in an ancilla qubit at her location (left-most qubit in the kets): $|X\rangle = \sqrt{0.9} |000\rangle + \sqrt{0.1} |011\rangle$.
- Now Alice performs a CNOT gate with the control being her entangled qubit, and the target being the ancilla: $|X\rangle = \sqrt{0.9} |000\rangle + \sqrt{0.1} |111\rangle$.
- Then Alice measures the ancilla in the basis $\{\sqrt{0.1} |0\rangle + \sqrt{0.9} |1\rangle , \sqrt{0.9} |0\rangle - \sqrt{0.1} |1\rangle\}$. Supposing the measurement outcome is $+1$, i.e., the ancilla collapsed to the state $\sqrt{0.1} |0\rangle + \sqrt{0.9} |1\rangle$ , the remaining state of the initial $2$ qubits will be $|X\rangle = \sqrt{0.1 \times 0.9} |00\rangle + \sqrt{0.9 \times 0.1} |11\rangle$, which is the maximally entangled state up to a normalization factor.
- We started from a state that was not maximally entangled, and we were able to boost the entanglement by doing a local measurement and post-selecting on the outcome.
Is entanglement distillation using post-selection as I have described above feasible?
"
"['quantum-gate', 'textbook-and-exercises', 'quantum-operation', 'kraus-representation']"," Title: Is the Kraus representation of a quantum channel equivalent to a unitary evolution in an enlarged space?Body: I understand that there are two ways to think about 'general quantum operators'.
Way 1
We can think of them as trace-preserving completely positive operators. These can be written in the form
$$\rho'=\sum_k A_k \rho A_k^\dagger \tag{1}$$
where $A_k$ are called Kraus operators.
Way 2
As given in (An Introduction to Quantum Computing by Kaye, Laflamme and Mosca, 2010; pg59) we have a
$$\rho'=\mathrm{Tr}_B\left\{ U(\rho \otimes \left| 00\ldots 0\right>\left<00\ldots 0 \right|) U^\dagger \right\} \tag{2}$$
where $U$ i s a unitary matrix and the ancilla $\left|00 \ldots 0\right>$ has at most size $N^2$.
Question
Exercise 3.5.7 (in Kaye, Laflamme and Mosca, 2010; pg60) gets you to prove that operators defined in (2) are completely positive and trace preserving (i.e. can be written as (1)). My question is the natural inverse of this; can we show that any completely positive, trace preserving map can be written as (2)? I.e. are (1) and (2) equivalent definitions of a 'general quantum operator'?
"
"['error-correction', 'stabilizer-code']"," Title: Degeneracy of Quantum Error Correction CodesBody: The feature of quantum error correcting codes called degeneracy is that they can sometimes be used to correct more errors than they can uniquely identify. It seems that codes exhibiting such characteristic are able to overcome the performance of quantum error correction codes that are nondegenerate.
I am wondering if there exists some kind of measure, or classification method in order to determine how degenerate is a quantum code, and so if there has been any study trying to determine the error correction abilities of quantum codes depending on the degeneracy of them.
Apart from that, it would be interesting to give reference or some intuition about how to construct good degenerate codes, or just reference about the current state of the art of those issues.
"
"['programming', 'qiskit']"," Title: Why does job.running in QISKit output False, even if the job is still running?Body: I submitted a job in the 0.5.0 version of QISKit using
job = execute(qc, 'ibmqx5', shots=shots)
This just submits the job, and does not wait for a result.
I then immediately tested whether the job was still running using
print(job.running)
This gave the result False. However, when I requested the result using
job.result()
This still took a while to get the result, suggesting that the job actually was still running after all. What is going on here?
"
"['experiment', 'topological-quantum-computing', 'anyons']"," Title: What is the status of confirming the existence of anyons?Body: In a comment on my answer to the question: What exactly are anyons and how are they relevant to topological quantum computing? I was asked to give specific examples of occurrence of anyons in nature. I've spent 3 days searching, but every article refers to either "proposed experiments" or "nearly definitive evidence".
Abelian anyons:
Fractional charges have been measured directly since 1995, but in my search, all articles pointing to evidence of fractional statistics or an exchange factor $e^{i\theta}\ne\pm1$, point to this nearly 7-year old pre-print, where they say in the abstract that they "confirm" detecting the theoretically predicted phase of $\theta =2\pi/3$ in the $\nu=7/3$ state of a quantum Hall system. However, the paper seems to have never passed a journal's peer review. There is no link to a journal DOI on arXiv. On Google Scholar I clicked "see all 5 versions", but all 5 were arXiv versions. I then suspected the article's name might have changed at the time of publication so went hunting for it on the authors' websites. The last author has Princeton University's Department of Electrical Engineering listed as affiliation, but does not show up on that department's list of people (after clicking on "People", I clicked on "Faculty", "Technical", "Graduate Students", "Administrative", and "Research Staff" but nothing showed up). The same happened for the second-last author! The third-last author does have a lab website with a publication list, but nothing like this paper appears in the "Selected Publications out of more than 800" page. The fourth-last author is at a different university, but his website's publication list is given as a link to his arXiv page (still no published version visible). The 5th last, 6th last, and 7th last authors have an affiliation of James Franck Institute and Department of Physics at the University of Chicago, but none of their three names shows up on either website's People pages. One of the authors also has affiliation at a university in Taiwan, and her website there lists publications co-authored with some of the people from the pre-print in question, but never anything with a similar title or with a similar enough author list. Interestingly, even her automatically generated but manually adjustable Google Scholar page does not have even the arXiv version but does have earlier papers (with completely different titles and no mention of anyons) with some of the co-authors. That covers all authors. No correspondence emails were made available.
1. Is this pre-print the only claim of confirming an exchange factor $\ne\pm1$ ?
2. If yes, what is wrong with their claimed confirmation of this? (It appears to have not passed any journal's peer review, and it also appears that an author has even taken down the arXiv version from her Google Scholar page).
Non-abelian anyons:
I found here this quote: "Experimental evidence of non-abelian anyons, although not yet conclusive and currently contested [12] was presented in October 2013 [13]." The abstract of [12] says that the experiment in [13] is inconsistent with a plausible model and that the authors of [13] may have measured "Coulomb effects" rather than non-Abelian braiding. Interestingly the author list of [13] overlaps with the pre-print mentioned in the Abelian section of this question, though that pre-print was from 2 years earlier and said in the abstract "Our results provide compelling support for the existence of non-Abelian anyons" which is a much weaker statement than what they say in the same abstract for the Abelian case: "We confirm the Abelian anyonic braiding statistics in the $\nu=7/3$ FQH state through detection of the predicted statistical phase angle of $2\pi/3$, consistent with a change of the anyonic particle number by one."
"
"['optimization', 'neural-network', 'nisq']"," Title: Devising ""structured initial guesses"" for random parametrized quantum circuits to avoid getting stuck in a flat plateauBody: The recent McClean et al. paper Barren plateaus in quantum neural network training landscapes shows that for a wide class of reasonable parameterized quantum circuits, the probability that the gradient along any reasonable direction is non-zero to some fixed precision is exponentially small as a function of the number of qubits.
This seems to affect Noisy Intermediate-Scale Quantum (NISQ) programs (as proposed by e.g. John Preskill) since they involve hybrid quantum-classical algorithms, ie training a parameterized quantum circuit with a classical optimization loop.
My question: How do you avoid getting stranded on those barren plateaus? Concretely, how would one go about building one's Ansatz Haar states to avoid getting stuck in those plateaus? The paper proposes but does not elaborate:
One approach to avoid these landscapes in the quantum setting is to
use structured initial guesses, such as those adopted in quantum
simulation.
"
"['algorithm', 'annealing', 'programming', 'machine-learning']"," Title: Gradient boosting akin to XGBoost using a quantum deviceBody: I am currently trying to implement a boosting algorithm akin to XGBoost with a quantum device. The reason is that I want to make use of a quantum device to train weak classifiers. However, as far as I know, the current quantum device can only be used for binary variables including both input variables and outputs.
Is it possible to use all binary variables to implement the additive training as it does in the XGBoost?
XGBoost GitHub Project
"
"['quantum-gate', 'quantum-state', 'mathematics', 'quantum-operation', 'partial-transpose']"," Title: Is acting with a positive map on a state not part of a larger system allowed?Body: In the comments to a question I asked recently, there is a discussion between user1271772 and myself on positive operators.
I know that for a positive trace-preserving operator $\Lambda$ (e.g. the partial transpose) if acting on a mixed state $\rho$ then although $\Lambda(\rho)$ is a valid density matrix it mucks up the density matrix of the system it is entangled to - hence this is not a valid operator.
This and user1271772's comments, however, got me thinking. $\Lambda$ acting on a state which is not part of a larger system does indeed give a valid density matrix and there is no associated entangled system to muck it up.
My question is, therefore: Is such an operation allowed (i.e. the action of a positive map on a state which is not part of a larger system). If not, why not? And if so, is it true that any positive map can be extended to a completely positive map (perhaps nontrivially)?
"
"['entanglement', 'topological-quantum-computing']"," Title: Are there connections between long-range entanglement and topological quantum computation?Body: Long-range entanglement is characterized by topological order (some kinds of global entanglement properties), and the ""modern"" definition of topological order is the ground state of the system cannot be prepared by a constant-depth circuit from a product state, instead of ground states dependency and boundary excitations in traditional. Essentially, a quantum state which can be prepared by a constant-depth circuit is called trivial state.
On the other hand, quantum states with long-range entanglement are ""robust"". One of the most famous corollaries of quantum PCP conjecture which proposed by Matt Hastings is the No Low-energy Trivial States conjecture, and the weaker case proved by Eldar and Harrow two years ago (i.e. NLETS theorem: https://arxiv.org/abs/1510.02082). Intuitively, the probability of a series of the random errors are exactly some log-depth quantum circuit are very small, so it makes sense that the entanglement here is ""robust"".
It seems that this phenomenon is some kinds of similar to topological quantum computation. Topological quantum computation is robust for any local error since the quantum gate here is implemented by braiding operators which is connected to some global topological properties. However, it needs to point that ""robust entanglement"" in the NLTS conjecture setting only involved the amount of entanglement, so the quantum state itself maybe changed -- it does not deduce a quantum error-correction code from non-trivial states automatically.
Definitely, long-range entanglement is related to homological quantum error-correction codes, such as the Toric code (it seems that it is related to abelian anyons). However, my question is that are there some connections between long-range entanglement (or ""robust entanglement"" in the NLTS conjecture setting) and topological quantum computation?
Perhaps there exists some conditions regarding when the correspondent Hamiltonian can deduce a quantum error-correction code.
"
"['error-correction', 'information-theory']"," Title: Violation of the Quantum Hamming boundBody: The quantum Hamming bound for a non-degenerate $[[N,k,d]]$ quantum error correction code is defined as:
\begin{equation}
2^{N-k}\geq\sum_{n=0}^{\lfloor d/2\rfloor}3^n\begin{pmatrix}N \\ n\end{pmatrix}.
\end{equation}
However, there is no proof stating that degenerate codes should obey such bound. I wonder if there exists any example of a degenerate code violating the quantum Hamming bound, or if there have been some advances in proving similar bounds for degenerate codes.
"
"['programming', 'qiskit']"," Title: What is Qconfig in QISKit and how do I set it up?Body: To use certain things in QISKIt, such as acessing the real quantum processors, it seems that there is a file 'Qconfig.py'. That needs to be set up.
How do I do this?
"
"['annealing', 'adiabatic-model']"," Title: Adiabatic Quantum Computing vs Adiabatic Quantum Optimization vs Quantum AnnealingBody: I am aware that of the difference of Adiabatic Quantum Computing (AQC) and Quantum Annealing (QA) as explained here. However, another term which came up in some papers was Adiabatic Quantum Optimization (AQO). Where does AQO fit in among AQC and QA?
It seems that it is another name for QA and is restricted to solving the Ising model, just like D-Wave's QA? I would think AQO is more general than QA where QA is a form of AQO where its Hamiltonian can be any algebraic function of spin variables without restrictions on the interaction, unlike the Ising model.
Anyone mind clarifying this? Thank you!
"
"['measurement', 'cryptography', 'terminology']"," Title: 'Rectilinear' and 'Diagonal' Basis in BB84 ProtocolBody: A lot of the tutorials on BB84 protocol talks about these two measurement bases, 'Rectilinear' or 'Vertical-Horizontal' and 'Diagonal'. I understand that it is possible to create a physical device that would be able to measure a qubit in both vertical and horizontal direction, or in other words, in 'Rectilinear' basis, but what would be the matrix representation of it?
For example, we can use $\lvert 0 \rangle \langle 0 \lvert$ to measure a qubit in the $\lvert 0 \rangle$ basis and $\lvert 1 \rangle \langle 1 \lvert$ to measure in the $\lvert 1 \rangle$ basis.
But what would be the combined measurement basis which we could call 'rectilinear' or 'vertical-horizontal'?
"
"['density-matrix', 'decoherence', 'dynamics', 'open-quantum-systems', 'partial-trace']"," Title: Only assuming the universe evolves according to a positive trace-preserving map, is there a proof that all subsystem evolution must be CPTP?Body: If we only assume that the wavefunction of the universe evolves according to $e^{-iHt}$, is there any proof that all subsystems of the universe (partial traces over parts of the universe) must evolve according to a completely positive, trace-preserving (CPTP) map?
An example of a perfectly valid quantum map that is not completely positive is given in the paragraph containing Eq. 6 of the paper: Who's afraid of not completely positive maps?. This was possible because they made the system and its environment entangled at the time $t=0$. So my question is whether such a proof exists for the case where there is no initial entanglement.
"
"['algorithm', 'complexity-theory', 'simulation', 'bqp', 'hamiltonian-simulation']"," Title: What are examples of Hamiltonian simulation problems that are BQP-complete?Body: Many papers assert that Hamiltonian simulation is BQP-complete
(e.g.,
Hamiltonian simulation with nearly optimal dependence on all parameters and Hamiltonian Simulation by Qubitization).
It is easy to see that Hamiltonian simulation is BQP-hard because any quantum algorithm can be reduced to Hamiltonian simulation, but how is Hamiltonian simulation in BQP?
i.e., what precisely is the Hamiltonian simulation decision problem in BQP and under what conditions on the Hamiltonian?
"
['resource-request']," Title: Are there any organised resources available from where I can begin my quantum computing studies?Body: I am a computer science student and am currently searching for resources from where I can learn about quantum computers, quantum computing models, their working principles, their gates and some simple quantum algorithms.
"
"['architecture', 'bell-experiment', 'non-locality']"," Title: How would a Quantum Computer (network) perform loophole-free Bell tests?Body: In a simple form, Bell's theorem states that:
No physical theory of local hidden variables can ever reproduce all of the predictions of quantum mechanics.
Bell developed a series of inequalities to provide specific experimental examples to distinguish between the predictions of any theory relying on local hidden variables and those of quantum mechanics. As such, Bell test inequality experiments are of fundamental interest in quantum mechanics. However, if one wants to do things properly, one realizes that there are a number of loopholes that affects, in different degrees, all experiments trying to perform Bell tests.[1] Experiments trying to close these loopholes tend to be unique rather than routine. One of the results of having general-purpose quantum computers, or networks thereof, would be the ability to routinely perform sophisticated quantum experiments.
Question: What requirements would have to fulfill a general-purpose quantum computer (network) to be able to implement Bell tests that are at least as loophole-free as the best realization that has been done so far?
For clarity: ideally the best answer will take a quantum computing approach and contain close-to-engineering details, or at least close-to-architecture. For example, writing the experiment as a simple quantum circuit, one of the current architectures can be chosen and from that one would make some realistic order-of-magnitude estimates to the required times of the different quantum gates / measurements and of the required physical distance between the different qubits.
[1] As commented by @kludg, it has been argued that ""..no experiment, as ideal as it is, can be said to be totally loophole-free."", see Viewpoint: Closing the Door on Einstein and Bohr’s Quantum Debate
"
"['entanglement', 'terminology', 'history']"," Title: When was the first use of the word Entanglement?Body: Schrödinger wrote a letter to Einstein after the 1935 EPR paper, and in that letter Schrödinger used the German word ""Verschränkung"" which translates into ""entanglement"", but when was the word first used in English?
Schrödinger's 1935 paper written in English, called Discussion of Probability Relations between Separated Systems, says (according to Wikipedia) ""I would not call [entanglement] one but rather the characteristic trait of quantum mechanics, the one that enforces its entire departure from classical lines of thought"" which means the concept was there but it whatever word he used for it was not entanglement (hence the square brackets). Unfortunately I do not have access to the full paper.
"
"['error-correction', 'architecture', 'fault-tolerance', 'topological-quantum-computing', 'toric-code']"," Title: How does the size of a toric code torus affect its ability to protect qubits?Body: The Toric code Hamiltonian is:
$\sum_{x,y}\left( \prod_{i\in p(x,y)} Z_{ixy} + \prod_{i\in v(x,y)} X_{ixy} \right),$
where the $v$ and $p$ are defined according to this picture (courtesy of James Wooton's contribution to Wikipedia):
At the moment we have an infinite 2D lattice:
$x\rightarrow \pm \infty$
$y\rightarrow \pm \infty$.
But if we set periodic boundary conditions such that (and feel free to edit the question if I am incorrect about this):
$p(x+10,y)=p(x,y)$
$v(x,y+10)=v(x,y)$,
We get the follownig torus (image courtesy of James Wooton's contribution to Wikipedia) :
Now in my periodic boundary conditions, I chose to add $+10$ but could have added some other number instead. How does this ""size of the torus"" affect the function of the toric code?
"
"['terminology', 'qudit']"," Title: Do any specific types of qudits other than qubits and qutrits have a name?Body: For example, has anyone seen something like:
""quqrit"" for a 4-level system[1], or
""qupit"" for a 5-level system[2] ?
1 From ""quad"" or ""quart"" since ""tetra"" would be qutrit, which is already a 3-level system.
2 From ""penta"" since ""quint"" would interfere with quqrit for 4-level system.
I understand that we could call a quqrit a ""spin-3/2 particle"" which would be overloading the meaning of spin, but I wonder if these terms have ever been used. I have searched ""quqrit"" and ""qupit"" on Google but what if it's not called ""quqrit"" but something else? Also, perhaps no one had the bravery to publish something with these words written down but have been used orally at conferences. Surprisingly, after asking this question I found one paper using the term ""qupit"" but the word only appears in the title and nowhere else, so it's not clear what their definition of qupit is!
"
"['quantum-gate', 'circuit-construction', 'quirk']"," Title: How to avoid error when applying certain combinations of degree of freedom rotations using a quantum circuit?Body: When applying each of the six degree of freedom rotations (or certain combinations of them) in an SO(4) using quantum gates, the results I expected are produced. For example, the following circuit in Craig Gidney's Quirk tool demonstrates rotations in three degrees of freedom, along with some displays of the resulting matrices expressed as percentages:
However, when applying some combinations of rotations, such as the following, results I didn't expect are produced in the final matrix:
In contrast, the results I am expecting are the following:
$$
\begin{bmatrix}
.73 & .07 & .13 & .07 \\
.00 & .73 & .15 & .13 \\
.13 & .07 & .73 & .07 \\
.15 & .13 & .00 & .73
\end{bmatrix}
$$
For convenience, here is a link to the Quirk circuit with all six degree of freedom rotations, albeit with an unexpected final result. The results I expect are the following:
$$
\begin{bmatrix}
.62 & .01 & .08 & .29 \\
.11 & .80 & .01 & .08 \\
.13 & .07 & .80 & .01 \\
.15 & .13 & .11 & .62
\end{bmatrix}
$$
I don't know enough about using ancilla bits and uncomputation techniques to apply them to this, but I suspect that it might explain part of the unexpected results. Any advice would be greatly appreciated.
"
"['error-correction', 'terminology', 'surface-code']"," Title: What is the ""surface code"" in the context of quantum error correction?Body: I am studying Quantum Computing and Information, and have come across the term "surface code", but I can't find a brief explanation of what it is and how it works. Hopefully you guys can help me with this.
"
"['ibm-q-experience', 'qiskit']"," Title: How to delete pending jobs on IBM Quantum Computer to retrieve units?Body: I am trying to run some code using qiskit, but I get the error message, that I have run out of necessary Experiment Units. I tried to remove pending jobs using the API with the following code
for job in api.get_jobs():
if job[""status""] == ""RUNNING"":
api.cancel_job(id_job=job[""id""], hub=None, group=None, project=None,
access_token=None, user_id=None)
but it didn't work.
Am I even going in the right direction or is there some other way to retrieve these used Experiment Units? I have read, that they normally are given back just after the execution of program is finished or after 24 hours (depending on which one ends earlier), but I am waiting now for over than two days and nothing happens.
"
"['measurement', 'initialization']"," Title: Projective measurements: aftermath and restorationBody: I have some practical difficulties with projective measurements, so I'd welcome inspiration from others. This is beyond the question ""Are true Projective Measurements possible experimentally?"" in that I'm not aiming for perfection but for something practical. In particular, I care about the case where we want to keep computing after a measurement.
Let us say we try to effect an upwards transition between two energy levels, by illuminating the sample with the appropriate wavelength. The transition is only possible if the initial state is occupied, since the final state is outside of out computational basis. For this to be a projective measurement rather than an unitary operation in a larger basis, we need to irreversibly detect this, say by a radiative spontaneous relaxation of this ""final"" state of the transition to a third energy level. If we were subsequently able to go back to the original level (coherently and rapidly), then I assume we'd have a messy work-around for an ideal projective measurement.
The question is: can this be done, or is this scheme fundamentally flawed? If it can be done, please illustrate with examples where this works.
"
['grovers-algorithm']," Title: What's the point of Grover's algorithm if we have to search the list of elements to build the oracle?Body: Grover's algorithm is used, among other things, to search an item $\mathbf{y}$ in an unordered list of items $[\mathbf{x}_0, \mathbf{x}_1, ..., \mathbf{x}_{n-1}]$ of length $n$. Even though there are plenty of questions here regarding this topic, I still miss the point.
Searching in a list, the classical way
Normally, I would design a search function this way
$$ \mathrm{search}([\mathbf{x}_0, \mathbf{x}_1, ..., \mathbf{x}_{n-1}], \mathbf{y}) = i \in \mathbb{N} \quad \text{such that } \mathbf{x}_i = \mathbf{y} $$
So I give the list and the wanted item as inputs, and I receive the position of the item in the list as output. I think I have understood that the information about $\mathbf{y}$ is embedded in the algorithm through the oracle gate $O$, so our function becomes
$$ \mathrm{search}_\mathbf{y}([\mathbf{x}_1, \mathbf{x}_2, ..., \mathbf{x}_n] ) = i \in \mathbb{N} \quad \text{such that } \mathbf{x}_i = \mathbf{y} $$
Let's make a practical example. Consider searching the ace of spades $1\spadesuit$ in a sequence of 8 cards from a standard 52-card deck:
The list of length $8$ is $[
\mathbf{x}_0 = J\clubsuit,$ $
\mathbf{x}_1 = 10\diamondsuit,$ $
\mathbf{x}_2 = 4\heartsuit,$ $
\mathbf{x}_3 = Q\clubsuit,$ $
\mathbf{x}_4 = 3\spadesuit,$ $
\mathbf{x}_5 = 1\spadesuit,$ $
\mathbf{x}_6 = 6\spadesuit, $ $
\mathbf{x}_7 = 6\clubsuit]$.
The wanted element is $\mathbf{x}_5$. I should obtain $\mathrm{search}_{\spadesuit}(cards) = 5$. Each card can be encoded with $\lceil{\log_2 52}\rceil = 6$bits, the list has $8$ elements so we need $6\times 8 = 48$ bits to encode the list. In this case, the oracle $O$ will implement the function:
$$f(\mathbf{x}) = \begin{cases} 1, & \mathbf{x} = 1\spadesuit \\ 0, & \text{otherwise} \end{cases}$$
However, the input of Grover's algorithm is not a state of $48$qubits.
(NB: Image of shuffled deck is taken from here)
Grover and its oracle
Several sources (eg. here - graphically explained) say that the input of the algorithm is different: the input is a state taken from the search space $S = \{ 0, 1, 2, ..., N \} = \{0, 1, 2, ..., 7 \} $ where $N$ is the number of elements of the list. Each number corresponds to the position of an element in the list.
The input of $\mathrm{search}_{\spadesuit}(\cdot)$ is now a $\lceil \log_2 8 \rceil = 3$qubit vector $|\psi\rangle$, which must be a superposition of all the items in the search space $S$.
We know
- $|0_{3\text{qubits}}\rangle = |000\rangle$ corresponds to $J\clubsuit$;
- $|1_{3\text{qubits}}\rangle = |001\rangle$ corresponds to $10\diamondsuit$;
- $|2_{3\text{qubits}}\rangle = |010\rangle$ corresponds to $4\heartsuit$;
- $|5_{3\text{qubits}}\rangle = |101\rangle$ corresponds to $1\spadesuit$ which is the wanted element;
- and so on...
In this case we have
$$\mathrm{search}_{\spadesuit}(|\psi\rangle) = |5_{3\text{qubits}}\rangle$$
But in this case, our oracle would have to implement the function
$$f(|\psi\rangle) = \begin{cases} 1, & |\psi\rangle = |5_{3\text{qubits}}\rangle \\ 0, & \text{otherwise} \end{cases}$$
Building the oracle requires us to know that $\spadesuit$ is at position 5. What's the point to execute the algorithm if we have already searched for the element in order to build the oracle?
"
['shors-algorithm']," Title: What integers have been factored with Shor's algorithm?Body: Shor's algorithm is expected to enable us to factor integers far larger than could be feasibly done on modern classical computers.
At current, only smaller integers have been factored. For example, this paper discusses factorizing $15=5{\times}3$.
What is in this sense the state-of-art in research? Is there any recent paper in which it says some bigger numbers have been factorized?
"
"['algorithm', 'simons-algorithm']"," Title: Clarification needed regarding quantum ""black-box"" circuitsBody: $\newcommand{\Ket}[1]{\left|#1\right>}$
I understand that in general quantum black box algorithms (such as the ones which play a part in Simon's & Deutsch's algorithm) implement a quantum circuit to compute some function $f\left(x\right)$ in such a way that the input is fed with trailing zero qubits, and the result is the input followed by the output, e.g:
$$\Ket{x}\Ket{0} \rightarrow \Ket{x}\Ket{f(x)}\,.$$
My question is, since basically one can write the above more explicitly as:$$
\Ket{x}\otimes\Ket{0} \rightarrow \Ket{x}\otimes\Ket{f(x)}
\,,$$whether it is possible, in case $\Ket{x}$ is not a pure state but a superposition, to get an output which ""mixes"" inputs with the wrong outputs.
To clarify what I mean I'll give an example:
Suppose our input is the one qubit superposition:
$$\Ket{x} = \frac{\Ket{0}+\Ket{1}}{\sqrt{2}}$$
Will the result of the black-box circuit be the following tensor product:
$$
\left\lbrack\frac{\Ket{0}+\Ket{1}}{\sqrt{2}}\right\rbrack
\otimes
\left\lbrack\frac{\Ket{f(0)}+\Ket{f(1)}}{\sqrt{2}}\right\rbrack
$$
(Which I find confusing and unlikely)
Or, the other option which seems to be more natural:
$$\frac{\Ket{0}\Ket{f(0)}+\Ket{1}\Ket{f(1)}}{\sqrt{2}}$$
(Or perhaps both are wrong? :))
"
"['entanglement', 'shors-algorithm']"," Title: Where exactly does entanglement appear in Shor's algorithm?Body: One deals with the notion of superposition when studying Shor's algorithm, but how about entanglement? Where exactly does it appear in this particular circuit?
I assume it is not yet present in the initial state $\left|0\right>\left|0\right>$, but how about in further process, after applying Hadamard gates, the controlled-U gates and the inverse Fourier transform?
I understand that the first and second registers have to be entangled, otherwise, the final measurement on one of them wouldn't collapse the other one, which gives us the period (well, kind of, we need to use continuous fractions to infer it).
"
"['error-correction', 'quantum-operation']"," Title: What quantum channels are considered in quantum communication, and how does this choice affect the construction of error correction codes?Body: The so-called depolarizing channel is the channel model that is mostly used when constructing quantum error correction codes. The action of such channel over a quantum state $\rho$ is
$$\rho\rightarrow(1-p_x-p_y-p_z)\rho+p_xX\rho X+p_yY\rho Y+p_zZ\rho Z$$
I was wondering which other channel models are considered in quantum communications, and how the construction of error correction codes is affected by considering such other channels.
"
['entanglement']," Title: Is entanglement transitive?Body: Is entanglement transitive, in a mathematical sense?
More concretely, my question is this:
Consider 3 qubits $q_1, q_2$ and $q_3$. Assume that
- $q_1$ and $q_2$ are entangled, and that
- $q_2$ and $q_3$ are entangled
Then, are $q_1$ and $q_3$ entangled? If so, why? If not, is there a concrete counterexample?
On my notion of entanglement:
- qubits $q_1$ and $q_2$ are entangled, if after tracing out $q_3$, the qbits $q_1$ and $q_2$ are entangled (tracing out $q_3$ corresponds to measuring $q_3$ and discarding the result).
- qubits $q_2$ and $q_3$ are entangled, if after tracing out $q_1$, the qbits $q_2$ and $q_3$ are entangled.
- qubits $q_1$ and $q_3$ are entangled, if after tracing out $q_2$, the qbits $q_1$ and $q_3$ are entangled.
Feel free to use any other reasonable notion of entanglement (not necessarily the one above), as long as you clearly state that notion.
"
"['error-correction', 'stabilizer-code']"," Title: Why do we use ancilla qubits for error syndrome measurements?Body: Consider the measurement of the syndrome for the standard 3-qubit code to correct bit flips:
$$
\def\place#1#2#3{\smash{\rlap{\hskip{#1px}\raise{#2px}{#3}}}}
\def\hline#1#2#3{\place{#1}{#2}{\rule{#3px}{1px}}}
\def\vline#1#2#3{\place{#1}{#2}{\rule{1px}{#3px}}}
%
\hline{30}{30}{210}
\hline{30}{60}{210}
\hline{30}{150}{210}
\hline{30}{180}{210}
\hline{30}{210}{210}
%
\vline{60}{60}{150}
\vline{90}{60}{120}
\vline{120}{30}{150}
\vline{150}{30}{120}
%
\place{46}{51}{\huge{\oplus}}
\place{76}{51}{\huge{\oplus}}
\place{106}{21}{\huge{\oplus}}
\place{136}{21}{\huge{\oplus}}
%
\place{30}{205}{\llap{Z_1}}
\place{30}{175}{\llap{Z_2}}
\place{30}{145}{\llap{Z_3}}
%
\place{241}{41}{\left. \rule{0px}{22.5px} \right\} M}
%
\phantom{\rule{280px}{225px}}_{\Large{.}}
$$
Here $M$ is a measurement in the computational basis. This circuit measures $Z_1Z_2$ and $Z_2Z_3$ of the encoded block (i.e. the top three). My question is why measure these using ancilla qubits - why not just measure the 3 encoded qubits directly? Such a setup would mean you would not have to use c-not gates which from what I have heard are hard to implement.
(Note I have only given this 3-qubit code as an example I am interested in general syndrome measurements on general codes).
"
"['algorithm', 'simons-algorithm']"," Title: Simon's Algorithm Probability of IndependenceBody: In this pdf for the Simon's algorithm we need $n-1$ independent $\mathbf y$ such that:
$$ \mathbf y \cdot \mathbf s=0$$
to find $\mathbf s$. On page 6 of the pdf the author writes that the probability of getting $n-1$ independent values of $\mathbf y$ in $n-1$ attempts is:
$$P_{\text{ind}}=(1-1/N(\mathbf s))(1-2/N(\mathbf s))\cdots (1-2^{n-1}/N(\mathbf s))\tag{1}$$
where $N(\mathbf s)=2^{n-1}$ if $\mathbf s \ne 0$ and $2^n$ if $\mathbf s=0$. Clearly then $P_{\text{ind}}=0$ for $\mathbf{s}\ne 0$ - which I believe to be wrong.
My question is, therefore: Is formula (1) wrong and if so what is the correct version. If it is not wrong how do we interpret
$P_{\text{ind}}=0$ .
"
"['gate-synthesis', 'ibm-q-experience', 'quantum-gate']"," Title: How can a controlled-Ry be made from CNOTs and rotations?Body: I want to be able to applied controlled versions of the $R_y$ gate (rotation around the Y axis) for real devices on the IBM Q Experience. Can this be done? If so, how?
"
"['algorithm', 'grovers-algorithm']"," Title: Why is an oracle qubit necessary in Grover's algorithm?Body: I am a bit confused about the necessity of an oracle qubit in Grover's algorithm.
My question is, does it depend on how you implement your oracle whether you need an oracle qubit or not? Or, it there any reason for an oracle qubit? (such as, there exist some problems that cannot be solved without an oracle qubit, or it's easier to think about the problem with an oracle qubit, or it's a convention, etc)
Many resources introduce Grover's algorithm with an oracle qubit, but I found there are some cases that you do not need an oracle qubit.
For example, here are two implementations of Grover's algorithm in IBM Q simulator. One is using an oracle qubit, and the other is not. In both cases, I would like to find |11> from a space of |00>, |01>, |10>, and |11>. In both cases, oracle successfully flips |11> to -|11>.
・With an oracle qubit (Link to IBM Q simulator)
・Without an oracle qubit (Link to IBM Q simulator)
"
"['quantum-operation', 'information-theory', 'entropy']"," Title: Proof of an Holevo information inequality for a classical-classical-quantum channelBody: Suppose I have a classical-classical-quantum channel $W : \mathcal{X}\times\mathcal{Y} \rightarrow \mathcal{D}(\mathcal{H})$, where $\mathcal{X},\mathcal{Y}$ are finite sets and $\mathcal{D}(\mathcal{H})$ is the set of density matrices on finite dimensional, complex Hilbert space $\mathcal{H}$.
Suppose $p_x$ is the uniform distribution on $\mathcal{X}$ and $p_y$ is the uniform distribution on $\mathcal{Y}$. Further, define for distributions $p_1$ on $\mathcal{X}$ and $p_2$ on $\mathcal{Y}$, the Holevo information
$$\chi(p_1, p_2, W) := H\left(\sum_{x,y}p_1(x)p_2(y)W(x,y)\right) - \sum_{x,y}p_1(x)p_2(y)H(W(x,y))$$
where $H$ is the von Neumann entropy.
I would like to show, for
$$ p_1 := \sup_{p}\left\{ \chi(p, p_y, W)\right\}, p_2 := \sup_{p}\left\{ \chi(p_x, p, W)\right\}$$
that,
$$\chi(p_1, p_2, W) \geq \chi(p_1, p_y, W) \text{ and } \chi(p_1, p_2, W)\geq \chi(p_x, p_2, W).$$
So far, I'm not yet convinced that the statement is true in the first place. I haven't made much progress in proving this, but it seems like some sort of triangle inequality could verify the claim.
Thanks for any suggestions regarding if the statement should hold and tips on how to prove it.
"
"['algorithm', 'grovers-algorithm', 'oracles']"," Title: Grover's algorithm: what to input to Oracle?Body: I am confused about what to input to Oracle in Grover's algorithm.
Don't we need to input what we are looking for and where to find what we are looking for to Oracle, in addition to the superpositioned quantum states?
For example, assume we have a list of people's names {""Alice"", ""Bob"", ""Corey"", ""Dio""}, and we want to find if ""Dio"" is on the list. Then, Oracle should take $1/2(|00\rangle + |01\rangle + |10\rangle + |11\rangle)$ as an input and output $1/2(|00\rangle + |01\rangle + |10\rangle - |11\rangle)$. I kind of understand that.
But don't we also need to input the word ""Dio"" and the list {""Alice"", ""Bob"", ""Corey"", ""Dio""} to Oracle? Otherwise, how can Oracle return output? Is it not explicitly mentioned since Oracle is a black box and we do not have to think about how to implement it?
My understanding about Oracle is,
- Oracle has the ability to recognize if the word ""Dio"" is in the list.
- To do so, Oracle takes the superpositioned quantum states as an input, where each quantum state represents the index of the list.
- So, input $|00\rangle$ to Oracle means, check if the word ""Dio"" is in the index 0 of the list and return $-|00\rangle$ if yes and return $|00\rangle$ otherwise.
- In our case, Oracle returns $1/2(|00\rangle + |01\rangle + |10\rangle - |11\rangle)$.
- But what about the list and the word?
"
"['algorithm', 'resource-request', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Introductory material for quantum machine learningBody: In the past few days, I have been trying to collect material (mostly research papers) related to Quantum machine learning and its applications, for a summer project. Here are a few which I found interesting (from a superficial reading):
However, coming from the more physics-y end of the spectrum, I don't have much
background knowledge in this area and am finding most of the specialized materials impenetrable. Ciliberto et al.'s paper: Quantum machine learning: a classical perspective somewhat helped me to grasp some of the basic concepts. I'm looking for similar but more elaborate introductory material. It would be very helpful if you could recommend textbooks, video lectures, etc. which provide a good introduction to the field of quantum machine learning.
For instance, Nielsen and Chuang's textbook is a great introduction to the quantum computing and quantum algorithms in general and goes quite far in terms of introductory material (although it begins at a very basic level and covers all the necessary portions of quantum mechanics and linear algebra and even the basics of computational complexity!). Is there anything similar for quantum machine learning?
P.S: I do realize that quantum machine learning is a vast area. In case there is any confusion, I would like to point out that I'm mainly looking for textbooks/introductory papers/lectures which cover the details of the quantum analogues of classical machine learning algorithms.
"
"['entanglement', 'bell-experiment']"," Title: References examining Bell inequality violations at large distancesBody: Could anyone point to some references examining Bell inequality violations at large distances please?
I see many times, in pop science articles and research literature alike, that the quantum information of the entangled state is transmitted instantaneously to all components of the state. Strictly speaking, we must say that this is a theoretical prediction and provide an lower bound on the speed of information transfer from an experiment, right?
"
"['quantum-gate', 'gate-synthesis', 'qutrit', 'pauli-gates']"," Title: Why is the decomposition of a qubit-qutrit Hamiltonian in terms of Pauli and Gell-Mann matrices not unique?Body: If I have the $X$ gate acting on a qubit and the $\lambda_6$ gate acting on a qutrit, where $\lambda_6$ is a Gell-Mann matrix, the system is subjected to the Hamiltonian:
$\lambda_6X=
\begin{pmatrix}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
\end{pmatrix}
$
In case anyone doubts this matrix, it can be generated with the following script (MATLAB/octave):
lambda6=[0 0 0; 0 0 1; 0 1 0];
X= [0 1; 1 0 ];
kron(lambda6,X)
However consider the alternative Hamiltonian:
$-\frac{1}{2}Z\lambda_1 + \frac{1}{2}\lambda_1 - \frac{1}{\sqrt{3}}X\lambda_8+\frac{1}{3}X$.
This is the exact same Hamiltonian!
The following script proves it:
lambda1=[0 1 0;1 0 0;0 0 0];
lambda8=[1 0 0;0 1 0;0 0 -2]/sqrt(3);
Z= [1 0; 0 -1 ];
round(-0.5*kron(Z,lambda1)+0.5*kron(eye(2),lambda1)-(1/sqrt(3))*kron(X,lambda8)+(1/3)*kron(X,eye(3)))
The "round" in the last line of code can be removed, but the format will be uglier because some of the 0's end up being around $10^{-16}$.
I thought the Pauli decomposition for two qubits is unique, why would the Pauli-GellMann decomposition of a qubit-qutrit be non-unique, and how would the decomposition $\lambda_6X$ from the above 6x6 matrix be obtained?
"
"['experiment', 'complexity-theory', 'postbqp']"," Title: Is PostBQP experimentally relevant?Body: Far from my expertise, but sheer curiosity. I've read that PostBQP (""a complexity class consisting of all of the computational problems solvable in polynomial time on a quantum Turing machine with postselection and bounded error"") is very powerful. Still, I don't understand the practical sense of assuming you can decide the value an output qubit takes.
My question: Have post-selection quantum computing experiments been implemented (or is it possible that they will be implemented)?
(And, if the answer is yes: how does post-selection take place in a way that practically enhances your computing power?)
"
['stabilizer-code']," Title: Maximum number of Stabilizer Generators?Body: The Pauli group, $P_n$, is given by
$$P_n=\{ \pm 1, \pm i\}\otimes \{ I,\sigma_x,\sigma_y,\sigma_z\}^{\otimes n}$$
Abelian subgroups of this which do not contain the element $(-1)*I$ correspond to a stabilizer group. If there are $r$ generators of one such subgroup, $\mathcal{G}$, then the $+1$ eigenstate has $2^{n-r}$ basis elements.
This then leads to the natural question of whether we have that $r\le n$ and how can it be proved (either way)?
I guess a (valid?) proof would be along the lines of that if $r \gt n$ we would have a bias of fractional dimension - this is not allowed so $r\lt n$. But if one exists I would prefer a proof considering only the group properties and not the space which it acts on.
"
"['quantum-state', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Embedding classical information into norm of a quantum stateBody: According to An introduction to quantum machine learning (Schuld, Sinayskiy & Petruccione, 2014), Seth Lloyd et al. say in their paper: Quantum algorithms for supervised and unsupervised machine learning that classical information can be encoded into the norm of a quantum state $\langle x|x \rangle = |\vec{x}|^{-1}\vec{x}$. I'm not sure I understand their notation.
Let's take a simple example. Say I want to store this array: $V = \{3,2,1,2,3,3,5,4\}$ of size $2^{3}$ in the state of an $3$-qubit quantum system.
I can represent the state of an $3$-qubit system as:
$|\psi\rangle = a_1|000\rangle + a_2|001\rangle + a_3|010\rangle + a_4|011\rangle + a_5|100\rangle + a_6|101\rangle + a_7|110\rangle + a_8|111\rangle$ (using standard basis) where $a_i\in \Bbb C \ \forall \ 1 \leq i\leq 8$.
I could represent $V$ as a vector $\vec{V} = 3 \hat{x}_1 + 2 \hat{x}_2 +... + 4 \hat{x}_8$ where $\{\hat{x}_1,\hat{x}_2,...,\hat{x}_8\}$ forms an orthonormal basis in $\Bbb R^{8}$, and write the standard Euclidean norm for it as $|\vec{V}|=\sqrt{3^2+2^2+...+4^2}$.
After this, I'm confused as to how I'd get the coefficients $a_1,a_2,..,a_8$. Should I just assign $3$ to $a_1$, $2$ to $a_2$ and so on?
But, then again:
Consider the vector $N=2^{n}$ dimensional complex vector $\vec{v}$
with components $\{v_i=|v_i|e^{i\phi_i}\}$. Assume that
$\{|v_i|,\phi_i\}$ are stored as floating point numbers in quantum
random access memory. Constructing the $\log_2 N$ qubit quantum state
$|v\rangle = |\vec{v}|^{-1/2}\vec{v}$ then takes $\mathcal{O}(\log_2
N)$ steps as long as the sub-norms are also given in the qRAM in which
case any state can be constructed in $\mathcal{O}(\log N)$ steps.
Firstly, I don't understand their notion of a $2^n$ dimensional complex vector. If each of the components of their classical data array has two floating point numbers, wouldn't encoding that into a $n$-qubit quantum state be equivalent to storing a $2\times 2^{n}$ size classical array in a $n$-qubit system? Yes, I do know that $a_1,a_2,..,a_{2^n}$ are complex numbers having both magnitude and direction, and hence can store $2\times 2^{n}$ amount of classical information. But they don't mention anywhere how they will convert classical data (say in form of a $2\times 2^{n}$ array) into that form. Moreover, there seems to be a restriction that phase of a complex number $a_i$ can only range from $-\pi$ to $+\pi$.
Secondly, let us assume that the initial data array we wanted to store in our quantum system was actually $V=\{\{3,\phi_1\},\{2,\phi_2\},...,\{4,\phi_8\}\}$.
If they define $|v\rangle$ as $|\vec{v}|^{-1/2}\vec{v}$ then $|V\rangle$ in our example would look something like $(\sqrt{3^2+2^2+...+4^2})^{-1/2}(|3e^{i\phi_1}||000\rangle + |2e^{i\phi_2}||001\rangle + ... + |4e^{i\phi_8}||111\rangle)$. But then we're losing all the information about the phases $\phi_i$, isn't it? So what was the use of starting with a complex vector (having both a phase and magnitude) in the first place, when we're losing that information when converting to $|V\rangle$ anyway? Or are we writing supposed to consider $|V\rangle$ as $(\sqrt{3^2+2^2+...+4^2})^{-1/2}(3e^{i\phi_1}|000\rangle + 2e^{i\phi_2}|001\rangle + ... + 4e^{i\phi_8}|111\rangle)$?
It would be really helpful if someone could explain where I am going wrong using some concrete examples regarding storage of classical data in an $n$-qubit system.
"
"['complexity-theory', 'grovers-algorithm']"," Title: Grover's Algorithm and its relation to complexity classes?Body: I am getting confused about Grover's algorithm and it's connection to complexity classes.
The Grover's algorithm finds and element $k$ in a database of $N=2^n$ (such that $f(k)=1$) of elements with $$\sim \sqrt{N}=2^{n/2}$$
calls to the oracle.
So we have the following problem:
Problem: Find a $k$ in the database such that $f(k)=1$
Now I am aware that this is not a desision problem and thus our normal definitions of complexity class $\text{P}$, $\text{NP}$ etc don't really apply. But I am curious to know how we would define the complexity class in such a case - and weather it is done with respect to $N$ or $n$?
Furthermore the Grover's algorithm can be used as a subroutine. I have read in several places that the Grover's algorithm does not change the complexity class a problem - is there a heuristic way to see this.
"
"['algorithm', 'cryptography', 'communication']"," Title: BB84 Protocol Alice Choice to BobBody: The image is taken from this link.
Here Alice is using random bases to encode 0 or 1. After the process is completed, Bob has similarly polarized photons as Alice. These polarization can be any of the $\lvert 0 \rangle , \lvert 1 \rangle, \lvert + \rangle$ or $\lvert - \rangle$. However, how would Bob know what Alice meant for which two of these bases? Meaning, Alice might choose ${\lvert 0 \rangle, \lvert + \rangle}$ to encode a 0 and ${\lvert 1 \rangle, \lvert - \rangle}$ to encode a 1 or vice versa. How do they determine which polarization encodes which bits?
"
['grovers-algorithm']," Title: Example of Grover's Algorithm applied to a decision problem?Body: I recently asked this question on Grover's algorithm, and I am still fairly confused about the whole thing. Consider the following snippet from this post (written by DIDIx13) which for convenience I will reproduce here:
If you throw away the problem structure, and just consider the space of $2^n$ possible solutions, then even a quantum computer needs about $\sqrt{2^n}$ steps to find the correct one (using Grover's algorithm)
If a quantum polynomial time algorithm for a $\text{NP}$-complete problem is ever found, it must exploit the problem structure in some way.
The first line emphasis one place where I am confused: Grover's algorithm finds a solution amongst $2^n$ solutions to a problem - this is not a decisions problem alone and as mentioned in my question linked above means we cannot assign it a complexity class.
That said Grover's algorithm can be used to solve decision problems (there seems to be a lot of talk on related questions about ""SAT"") - but I have yet seen a simple example of such an application.
Thus my question is: Does there exist a simple example of Grover's algorithm solving a decision problem? (even better if you can provide one where the classical search is in $NP$ and another in $P$)
"
"['quantum-gate', 'experiment', 'superconducting-quantum-computing']"," Title: Conditional Phase Gate Superconducting QubitsBody: In the paper ""Demonstration of two-qubit algorithms with a superconducting quantum processor"" (L. DiCarlo et al., Nature 460, 240 (2009), arXiv) they demonstrate how to realize conditional phase gates with superconducting qubits.
Specifically, they use the $|{1,1}\rangle \leftrightarrow |0, 2\rangle$ to create a conditional phase gate. I quote ""his method of realizing a
C-Phase gate by adiabatically using the avoided crossing between
computational and non-computational states is generally applicable
to qubit implementations with finite anharmonicity, such as trans-
mons or phase qubits"".
My question is how this technique works, especially why it is a controlled gate.
"
"['quantum-gate', 'programming', 'qiskit']"," Title: How can I implement an n-bit Toffoli gate?Body: I want to create a Toffoli gate controlled by n qubits, and implement it in QISKit. Can this be done? If so, how?
"
"['algorithm', 'resource-request', 'machine-learning', 'neural-network']"," Title: What are some of the interesting problems whose solutions have been proposed using quantum neural networks?Body: I know there are some ""quantum versions"" of hand-writing recognition algorithms which have been proposed using quantum neural networks. Example: ""Recognition of handwritten numerals by Quantum Neural Network with fuzzy features"" (J Zhou, 1999). Also, recently by Rebentrost et al.: ""A Quantum Hopfield Neural Network"" presents an application of their method as a genetic sequence recognizer.
What are some other proposed applications of quantum neural networks whose given solutions provide considerable improvement over the corresponding classical version of the neural network in terms of accuracy? Also, have any of those proposed solutions been programmed/simulated?
Please note that I'm looking for research papers which specifically demonstrate some applications of quantum neural networks and which provide a significant improvement over the corresponding classical neural networks.
"
"['grovers-algorithm', 'superposition']"," Title: How to obtain arbitrary distribution in quantum databaseBody: I was working on the Grover's algorithm and the most common example is for a unitary distribution in a quantum database, for example:
$|\psi\rangle = \frac{1}{2}|00\rangle + \frac{1}{2}|01\rangle + \frac{1}{2}|10\rangle + \frac{1}{2}|11\rangle.$
Is there a way to obtain arbitrary distribution (the above one is achieved by applying $H^{\otimes n}$ gates), e.g.
$|\psi\rangle = \frac{1}{3}|00\rangle + \frac{1}{4}|01\rangle + \sqrt{\frac{83}{144}}|10\rangle + \frac{1}{2}|11\rangle$
? Does the structure of Grover's algorithm differ in such a case?
"
"['error-correction', 'physical-realization', 'stabilizer-code']"," Title: Allowed CNOT gates for IBM Q 5 quantum computerBody: I trying to do some tests in the IBM Q5 computer of IBM quantm experience for some simple error correction protocols, but as I can see, some operations between the qubits are not allowed.
For example, it is not possible to perform a CNOT operation with the fourth qubit or when selecting one for as the target qubit for the operation, it does not allow to use any of the other qubits as control qubits.
I have been thinking about the fact that maybe it is because of the physical implementation of such computer, but as I do not know much about the construction of quantum computers I do not know if that might be the cause. So I am wondering if that is actually the issue, or otherwise why those operations are not allowed.
"
['measurement']," Title: How is the number of measurement outcomes linked to the rank of the observable?Body: I am thinking about the following question:
Assuming that we have some given state $\rho$ and we perform a
measurement with $k$ outcomes on this state. Then we can describe the
measurement in outcomes as eigenvalues of the measurable, i.e., the
Hermitian operator that I denote by $D$, with probabilities
$\mathrm{Tr}[D_i\rho]$, where $D_i$ are the projectors in the $i^{th}$
eigenspace of $D$, i.e. for the eigendecomposition $D = \sum_i
\lambda_i s_i s_i^T = \sum_i \lambda_i D_i$.
I was wondering if my assumption is true. If the number of (distinguishable?) outcomes for any Hermitian operator is given by $k$ i.e. then we have only $k$ non-zero eigenvalues and hence $D$ must be of rank $\leq k$?
"
"['programming', 'qiskit']"," Title: Visualization of Quantum Circuits when using IBM QISKitBody: I have followed the installation steps, regarding QISKit working environment. For circuit visualization, I've installed latex as in addition to poppler to convert from PDF to images. Afterwards, I followed the example given here.
I wrote the code and after running, the program run but I didn't get the circuit visualization. I don't know what is the problem, even I have not received any error messages.
So any ideas?
"
['quantum-fourier-transform']," Title: Example of Quantum Fourier Computation for three qubitsBody: I am currently going through Nielsen's QC bible and having still some foundational / conceptual problems with the matter.
I have tried to retrieve this $8 {\times} 8$ matrix describing the QFT of 3 qubits via Kronecker product in various attempts.
Hadamard transform can be decomposed into $H \otimes 1 \otimes 1$, and the others are fundamentally kronecker products of the 4x4 matrices of S resp. T with the 2x2 identity.
Whats wrong with my approach?
EDIT:
$T\text{=}\left(
\begin{array}{cccccccc}
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 & e^{\frac{\pi i}{4}} & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & e^{\frac{\pi i}{4}} \\
\end{array}
\right)$
which is derived from $R_k = \left(
\begin{array}{cc}
1 & 0 \\
0 & e^{2 i \pi /2^k} \\
\end{array}
\right)$, being $S$ for $k=1$ and $T$ for $k=2$.
EDIT 2:
The controlled T-operation can be represented in computational basis as
$\left(
\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & e^{2 \pi i / 2^k } \\
\end{array}
\right)$.
EDIT 3:
In mathematica, one faulty calculation of mine is:
$\text{SWAP}\text{=}\left(
\begin{array}{cccccccc}
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{array}
\right)$
SWAP*KroneckerProduct[IdentityMatrix[2], IdentityMatrix[2], H]KroneckerProduct[IdentityMatrix[2], S]
KroneckerProduct[ IdentityMatrix[2], H, IdentityMatrix[2]] * T KroneckerProduct[S, IdentityMatrix[2]]
KroneckerProduct[H, IdentityMatrix[2],
IdentityMatrix[2]] // MatrixForm
which gives:
$\left(
\begin{array}{cccccccc}
\frac{1}{2 \sqrt{2}} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & -\frac{1}{2 \sqrt{2}} & 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 & \frac{e^{\frac{i \pi }{2}}}{2 \sqrt{2}} & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & -\frac{e^{\frac{i \pi }{2}} i^2}{2 \sqrt{2}} \\
\end{array}
\right)$
"
"['models', 'machine-learning']"," Title: Where can I find example circuits to learn from?Body: I'm relatively new to quantum computing and my goal is to learn how to implement algorithms that I read in papers. While I have found many circuit snippets I have yet to find a repository of examples on GitHub or other places where I would go to find machine learning code. Does an analogous quantum computing repository exist?
"
"['quantum-gate', 'grovers-algorithm', 'gate-synthesis', 'ibm-q-experience']"," Title: Implementation of the oracle of Grover's algorithm on IBM Q using three qubitsBody: I am trying to get used to IBM Q by implementing three qubits Grover's algorithm but having difficulty to implement the oracle.
Could you show how to do that or suggest some good resources to get used to IBM Q circuit programming?
What I want to do is to mark one arbitrary state by flipping its sign as the oracle supposed to do.
For example, I have
$1/\sqrt8(|000\rangle+|001\rangle+|010\rangle+|011\rangle+|100\rangle+|101\rangle+|110\rangle+|111\rangle)$.
and I want to mark $|111\rangle$ by flipping its sign to $-|111\rangle$. I somehow understand that CCZ gate would solve the problem but we do not have CCZ gate in IBM Q. The combination of some gates will act the same as CCZ but I am not sure how to do that yet. And I am also struggling for the other cases not only for $|111\rangle$.
Two qubits case is simple enough for me to implement, but three qubits care is still confusing to me.
"
['neural-network']," Title: How did the authors manage to simulate and get the error estimate for a neural network with greater than 7840 qubits?Body: In the paper A quantum-implementable neural network model (Chen, Wang & Charbon, 2017), on page 18 they mention that ""There are 784 qurons in the input layer, where each quron is comprised of ten qubits.""
That seems like a misprint to me. After reading the first few pages I was under the impression that they were trying to use $10$ qubits to replicate the $784$ classical neurons in the input layer. Since $2^{10}=1024>784$, such that each sub-state's coefficient's square is proportional to the activity of a neuron. Say the square of the coefficient of $|0000000010\rangle$ could be proportional to the activation of the $2$-nd classical neuron (considering all the $784$ neurons were labelled fom $0$ to $783$).
But if what they wrote is true: ""There are 784 qurons in the input layer"" it would mean there are $7840$ qubits in the input layer, then I'm not sure how they managed to implement their model experimentally. As of now we can properly simulate only ~$50$ qubits.
However, they managed to give an error rate for $>7840$ qubits (see Page 21: ""Proposed two-layer QPNN, ten hidden qurons, five select qurons - 2.38""). No idea how's they managed to get that value. Could someone please explain?
"
"['error-correction', 'fault-tolerance']"," Title: Reference on MITxPRO Applications of Quantum Computing Professional Certificate ProgramBody: Recently I found out the Applications of Quantum Computing Professional Certificate Program that MITxPRO is offering for people interested in quantum computing. I saw that it is consisted of four courses that can be done independently or as a whole program. This is the link for the course.
I am especially interested in just the last one of such four courses, but I do not know if it would be necessary to take the other ones so that I could do such course.
That's why I was wondering if someone here has started this course, and so if there is someone, if he could give an insight about which is the level required for taking such courses, the time required in order to complete the homework and his opinion about the course in general. Also it would be interesting to hear if you think that taking all courses should be necessary (although I am aware of the fact that just one of the courses has been given, so this would be a subjective opininon).
"
"['error-correction', 'fidelity']"," Title: How to find the fidelity between two state when one is an operator?Body: I am going through Nielsen and Chuang and am finding the chapter on error-correction particularly confusing. At the moment I am stuck on exercise 10.12 which states
Show that the fidelity between the state $|0 \rangle$ and $\varepsilon(|0\rangle\langle0|)$ is $\sqrt{1-2p\backslash3}$, and use this to argue that the minimum fidelity for the depolarizing channel is $\sqrt{1-2p\backslash3}$.
As I understand $\varepsilon$ is a quantum operation and could be whatever we want as long as it fits the definition, do I assume $\varepsilon$ is the depolarizing channel or is there some general operation I don't know about.
Thanks!
"
['algorithm']," Title: How to create a quantum algorithm that produces 2 n-bit sequences with equal number of 1-bits?Body: I am interested in a quantum algorithm that has the following characteristics:
- output = 2n bits OR 2 sets of n bits (e.g. 2 x 3 bits)
- the number of 1-bits in the first set of n-bits must be equal to the number of 1-bits in the second set. E.g. correct output =
0,0,0, 0,0,0 (both 3-bit sets have zero 1-bits); 1,0,0, 0,1,0 (both 3-bit sets have one 1-bit); 1,1,0, 0,1,1 (both 3-bit sets have two 1-bit)
- Each time the quantum algorithm runs it must randomly return one of the possible solutions.
Any idea how I can best implement such an algorithm on a quantum computer ?
FYI I have tried the following algorithm (where n = 2 ) but it missed the 2 answers 0110 and 1001:
"
"['quantum-operation', 'tensor-product', 'partial-trace', 'kraus-representation']"," Title: Tensor product properties used to obtain Kraus operator decomposition of a channelBody: I work on a Quantum Information Science II: Quantum states, noise and error correction MOOC by Prof. Aram Harrow, and I do not understand which property of tensor products is used in one of the transitions in the videos.
Let's consider an isometry $V: A \to B \otimes E$ ($E$ is a subspace to be thrown away at the end).
Let's fix and orthonormal basis $\{ |e\rangle \}$ in $E$ and partially expand the isometry $V$ as $V = \sum_e V_e \otimes |e\rangle$, where each $V_e$ is a linear operator from $A$ to $B$.
The Stinespring form of a quantum operation is a partial trace applied after an isometry: $N(\rho) = \mathrm{tr}_E [V \rho V^\dagger]$.
Now, if we expand that with our representation of $V$, we get
$$
N(\rho) = \mathrm{tr}_E \left[
\sum_{e_1} \sum_{e_2}
\left( V_{e_1} \otimes |e_1\rangle \right)
\rho
\left( V_{e_2}^\dagger \otimes \langle e_2| \right)
\right].
$$
My question is how to get from here to the next step
$$
N(\rho) = \mathrm{tr}_E \left[
\sum_{e_1} \sum_{e_2}
(V_{e_1} \rho V_{e_2}^\dagger) \otimes |e_1 \rangle \langle e_2|
\right]?
$$
(BTW, eventually, we end up with the Kraus operator decomposition of a channel: $N(\rho) = \sum_e V_e \rho V_e^\dagger$.)
"
"['quantum-gate', 'bloch-sphere']"," Title: How to think about the Z gate in a Bloch sphere?Body: I am confused about how to understand the $Z$ gate in a Bloch sphere.
Considering the matrix $Z = \begin{pmatrix}
1 & 0 \\
0 & -1
\end{pmatrix}$ it is understandable that $Z|0\rangle = |0\rangle$ and $Z|1\rangle = -|1\rangle$.
It is explained here that $Z$ gate is $\pi$ rotation around the $Z$ axis. Then, how should I understand $Z|1\rangle = -|1\rangle$? Since $|1\rangle$ is the south pole, I feel it is natural to think that $\pi$ rotation around the $Z$ axis does not do anything.
"
['algorithm']," Title: Algorithm to allocate tasks and tools fairly to 2 playersBody: Puzzle
I have the following puzzle for which I would like to create a quantum algorithm.
- There are 2 players that need to complete 3 tasks as fast as possible.
- There are 3 different types of tasks (
A, B, C )
- There are 3 different types of tools (
a, b, c)
- Each player will only get 2 tools (they might get the same tool twice)
- Tool a will make that the player can finish task
A 10 minutes faster than without tool a.
- Tool
b will make that the player can finish task B 10 minutes faster than without tool b.
- Tool
c will make that the player can finish task C 10 minutes faster than without tool c.
- The output of the quantum algorithm must be (a) a random combination of the 3 tasks (the same task might appear multiple times) and (b) a random assignment of 2 tools to each of the 2 players but it should also remain a fair competition (in other words one player will not gain more time in total thanks to the set of tools he got).
So a possible outcome of the quantum algorithm:
- Tasks
A, A, C (note that same task can appear multiple times) and
- Player one gets tools
a,b
- Player two gets tools
a,a (although he gets 2 a tools - he can only use one tool at a time - so the 2nd a tool would not give any benefits)
So, in this case, both players will equally benefit (= 20 minutes) thanks to tool a and the 2 tasks A, A.
So how would you implement such a problem in a quantum algorithm?
Generalized Puzzle
Of course this puzzle can be further generalized as:
- each player has to complete
n tasks (and not 3)
- instead of 3 different types of tasks (
A, B, C) and 3 corresponding different types of tools (a, b, c), there are t different types of tasks with corresponding tools giving them a 10 minute performance benefit.
- each player gets
k tools instead of 2.
I don't need an answer on this generalized puzzle ! I am more than happy to get an answer on the simple puzzle.
"
['algorithm']," Title: How to permute (reshuffle) an n-bit input?Body: I am interested in a quantum algorithm that gets as input an n-bit sequence and that produces as output a reshuffled (permuted) version of this n-bit sequence.
E.g. if the input is 0,0,1,1 (so n=4 in this case) then the possible answers are:
- 0,0,1,1
- 0,1,0,1
- 0,1,1,0
- 1,0,0,1
- 1,0,1,0
- 1,1,0,0
Note that only one output should be generated which is randomly chosen among all possible valid outputs.
How can this best be implemented in a quantum algorithm ?
A solution for this is already proposed as part of one of the answers for How to create a quantum algorithm that produces 2 n-bit sequences with equal number of 1-bits?. But the problem with this solution is that this requires about $\binom{n}2$ help qubits which becomes rapidly huge if n is big.
Note:
- Please, do not provide a classical algorithm without any explanation of how the steps of the classical algorithm can be mapped to a universal quantum computer.
- for me there are 2 good ways to interpret ""randomly chosen among all possible good outputs"": (1) each possible good output has equal chance of being chosen. (2) every possible good output has a chance > 0 of being chosen.
"
"['algorithm', 'simons-algorithm']"," Title: Simon's algorithm: Number of equationsBody: During the classical pre-processing stage of Simon's algorithm, we repeat the quantum operations $n-1$ times to get
$$
\begin{alignat}{7}
y_{1} \cdot s & \phantom{\vdots} =~ && 0 \\ y_{2} \cdot s & \phantom{\vdots}=~ && 0 \\ & \phantom{=} \vdots \\ y_{n-1} \cdot s & \phantom{\vdots}=~ && 0 ~,
\end{alignat}
$$
where $s$ is the period while $y_{i}$ are the linearly independent measurement outcomes of the quantum process. But, shouldn't we be requiring $n$ equations to get the value of $s$ as it is an unknown with $n$ variables? I wonder if this is because a system of $n$ equations will admit only the trivial solution of all $0$s. Is there a mathematical reasoning to elucidate this? How exactly would we uniquely solve for $n$ variables with $n-1$ equations?
"
['physical-qubit']," Title: What's the difference between a set of qubits and a capacitor with a subdivided plate?Body: This is probably just a misunderstanding on my part, but everything I've seen on what quantum computers do thus far seems to suggest that the actual process of reading the entangled qubits would be equivalent to reading the value of a plate opposing a subdivided plate in a plate capacitor while the setting of initial qubits would be the equivalent of assigning a voltage to each subdivided plate. E.g. in this image:
You would be able to read the voltage on the red plate after setting independent voltages from a known range representing 0 at the low and 1 at the high on the 4 separate subdivisions of the opposing plate, then rounding off at some particular voltage to get a zero or one out of it for those 4 bits.
Is this wrong? If so, how does it differ from actual quantum computing?
"
"['machine-learning', 'neural-network', 'multiplexer', 'quantum-parallelism']"," Title: What do ""$i$-th basic network"", ""quantum multiplexers"" and ""quantum parallelism"" mean in this context? How are they beneficial?Body: I have been reading the paper A quantum-implementable neural network model (Chen et al., 2017) for a few days now, but failed to understand how exactly their algorithm offers a speedup over the classical neural network models.
In particular I'm confused about what they mean by and what they are trying to do with quantum multiplexers. They haven't even defined it properly.
Here's the relevant paragraph:
One of the most interesting points of QPNN is that we can use quantum parallelism to combine several basic networks at the same time. To achieve this purpose, only $n$ qubits are needed in a control layer to perform the following quantum multiplexer as shown in Fig. $5$.
$$\left( \begin{array}{ccc} U_1 \\ & \ddots \\ && U_{2^n} \end{array} \right) \tag{13}$$
where $U_i$ represents the dynamics of the $i$th basic network. Moreover $2^{n}$ different quantum gates $\left\{P^{(i)}|i=1, \dots ,2^{n}\right\}$ can also be applied on the output layer of each basic network respectively.
Questions:
- What does $i^{\text{th}}$ basic network mean in this context?
- What is quantum multiplexer and how exactly is it helping in this context? What is meant by the matrix shown in $(13)$? (I read a few papers on quantum multiplexers which say that they are basically used to transfer information contained by several qubits as information in a qudit. But no idea how that is relevant here.)
- What do they mean by "we can use quantum
parallelism to combine several basic networks at the same time"?
"
"['quantum-gate', 'gate-synthesis', 'ibm-q-experience']"," Title: How to implement the ""Square root of Swap gate"" on the IBM Q (composer)?Body: I would like to simulate a quantum algorithm where one of the steps is ""Square root of Swap gate"" between 2 qubits.
How can I implement this step using the IBM composer?
"
"['quantum-gate', 'experiment', 'superconducting-quantum-computing', 'bloch-sphere']"," Title: Rotating about the y- or z-axis of the Bloch sphereBody: In order to rotate about an axis of the Bloch sphere we ususally use pulses e.g. in trapped ion quantum computing or superconducting qubits. Let's say we have rotation around the x-axis. What do I have to change in order to be able to rotate around the y-axis or the z-axis? I assume it has something to do with the phase but I could not find a good reference for how this works.
"
"['error-correction', 'resource-request', 'ibm-q-experience']"," Title: Practical Implementations of QECCs in IBM Q ExperienceBody: I am learning how to program the IBM Q Experience quantum computers in order to learn more about how does it work and in order to perform some experiments in it. By doing so I was wondering what are the most advanced things that have been done in such computers that actually are an advance for quantum technologies.
More specfically, I am interested in what have been done in quantum error correction code implementation and testing in those, and if some papers about those implementations and techniques used are available.
"
"['algorithm', 'programming', 'qiskit']"," Title: Composing multiple quantum circuits in single quantum program in QiskitBody: I was wondering if there is a way to compose a program with multiple quantum circuits without having the register reinitialized at $0$ for each circuit.
Specifically, I would like run a second quantum circuit after running the first one, as in this example:
qp = QuantumProgram()
qr = qp.create_quantum_register('qr',2)
cr = qp.create_classical_register('cr',2)
qc1 = qp.create_circuit('B1',[qr],[cr])
qc1.x(qr)
qc1.measure(qr[0], cr[0])
qc1.measure(qr[1], cr[1])
qc2 = qp.create_circuit('B2', [qr], [cr])
qc2.x(qr)
qc2.measure(qr[0], cr[0])
qc2.measure(qr[1], cr[1])
#qp.add_circuit('B1', qc1)
#qp.add_circuit('B2', qc2)
pprint(qp.get_qasms())
result = qp.execute()
print(result.get_counts('B1'))
print(result.get_counts('B2'))
Unfortunately, what I get is the same result for the two runs (i.e. a count of 11 for the B1 and B2 instead of 11 and 00 for the second, as if B2 is run on a completely new state initialized on 00 after B1.
"
"['classical-computing', 'photonics', 'optical-quantum-computing', 'boson-sampling']"," Title: Is it possible to ""calculate"" the absolute value of a permanent using Boson Sampling?Body: In boson sampling, if we start with 1 photon in each of the first $M$ modes of an interferometer, the probability of detecting 1 photon in each output mode is: $|\textrm{Perm}(A)|^2$, where the columns and rows of $A$ are the first $M$ columns of the interferometer's unitary matrix $U$, and all of its rows.
This makes it look like for any unitary $U$, we can construct the appropriate interferometer, construct the matrix $A$, and calculate the absolute value of the permanent of $A$ by taking the square root of the probability of detecting one photon in each mode (which we get from the boson sampling experiment). Is this true, or is there some catch? People have told me that you can't actually get information about a permanent from boson sampling.
Also, what happens to the rest of the columns of $U$: How exactly is it that the experimental outcome only depends on the first $M$ columns of $U$ and all of its rows, but not at all on the other columns of $U$? Those columns of $U$ do not affect the outcome of the experiment in the first $M$ modes at all?
"
"['architecture', 'd-wave', 'chimera']"," Title: Why did D-Wave choose the Chimera graph the way they did?Body: D-Wave makes use of a $(n,k=4)$-Chimera structured graph in their computers. Meaning a $n\times n$ grid of unit cells, with each unit cell consisting of a complete bipartite graph on $2k=8$ nodes ($4$ for each side), also called $K_{4,4}$.
Why did D-Wave chose $k=4$? An argument given is that this non-planar structure allows for an embedding of many interesting problems. However, $K_{3,3}$ is also a non-planar graph. So why not choose $k=3$? Additionally, increasing $k$ seems to me as one of the easiest ways to increase the number of qubits your problem has. So why not use $k=5,6,\dots$?
"
['quantum-state']," Title: How to check if 2 quantum bits are orthogonal?Body: How would you check if 2 qubits are orthogonal with respect to each other?
I need to know this to solve this problem:
You are given $2$ quantum bits:$$
\begin{align}
|u_1\rangle &= \cos\left(\frac{x}{2}\right) |0\rangle + \sin\left(\frac{x}{2}\right)e^{in} |1\rangle \tag{1} \\[2.5px]
|u_2\rangle &= \cos\left(\frac{y}{2}\right) |0\rangle + \sin\left(\frac{y}{2}\right)e^{im} |1\rangle \tag{2}
\end{align}
$$where $m-n = \pi$ and $x+y=\pi$.
"
"['quantum-state', 'no-cloning-theorem']"," Title: No-cloning theorem and distinguishing between two non-orthogonal quantum statesBody: I'm currently reading Nielsen and Chuang's Quantum Computation and Quantum Information and I'm not sure if I correctly understand this exercise (on page 57) :
Exercise 1.2: Explain how a device which, upon input of one of two non-orthogonal quantum states $\left|\psi\right>$ or $\left|\phi\right>$ correctly identified the state, could be used to build a device which cloned the states $\left|\psi\right>$ and $\left|\phi\right>$, 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 seems fairly straightforward to me : once the state has been identified as $|\psi\rangle$ or $|\phi\rangle$, just prepare an identical state through whatever means we have available, effectively cloning the original state.
For the converse, I've not been able to achieve better than this :
- Clone the state to be identified $n$ times
- Perform a measurement on each of the copies in the basis $(|\psi\rangle, |\psi'\rangle)$, where $|\psi'\rangle$ is a state orthogonal to $|\psi\rangle$
- If one of the measurements yields $|\psi'\rangle$, then we know for certain that the original state is $|\phi\rangle$
- If all of the measurements yield $|\psi\rangle$, we can claim that the original state is $|\psi\rangle$ with a probability of error equal to : $|\langle\psi|\phi\rangle|^{2n}$, which can be made arbitrarily small by increasing $n$
However, the way the exercise is worded makes me think that there must be some deterministic way of distinguishing between $|\psi\rangle$ and $|\phi\rangle$ given a cloning machine. Is this indeed the case?
"
"['quantum-gate', 'entanglement', 'ibm-q-experience']"," Title: How to implement the 4 Bell states on the IBM Q (composer)?Body: I would like to simulate the 4 ""Bell States"" on the IBM composer?
How can I best implement those 4 Bell states using the existing set of gates ?
Here below you see the definition of the 4 Bell states.
The first bell state can be easily implemented on the composer through a Hadamard gate and a CNOT gate as follows:
but how can I implement the other 3 bell states ?
"
"['algorithm', 'physical-qubit', 'programming', 'resource-request']"," Title: Resources for quantum algorithm basicsBody: I have just started to learn about quantum computing, and I know a little bit about qubits. What is a resource where I can learn a basic quantum algorithm and the concepts behind how it works?
"
"['entanglement', 'tensor-product']"," Title: How do I show that a two-qubit state is an entangled state?Body: The Bell state $|\Phi^{+}\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle )$ is an entangled state. But why is that the case? How do I mathematically prove that?
"
"['algorithm', 'quantum-gate', 'ibm-q-experience']"," Title: How to implement a Square root of Swap gate that swaps 2n-qubits on the IBM Q (composer)?Body: I am looking for an implementation using the quantum gates provided by the IBM composer of the following quantum function:
- input $2n$ qubits
- output $2n$ qubits wherein $50\%$ of the cases the state of the $2$ sets of $n$ qubits are swapped and in the other $50\%$ of the cases the state of the $2n$ qubits remain unchanged. With swapped I mean that qubit $q[i]$ will get the state of qubit $q[n+i]$ and qubit $q[n+i]$ will get the state of $q[i]$. Note also that all the qubits must be swapped or not.
E.g. $n=3$: If input $|000111\rangle$ then output in 50% of the cases is $|000111\rangle$ and in the other 50% of the cases is $|111000\rangle$
We have already a solution when $n=1$ in the following StackOverflow question:
but how can we do that when $n>1$?
"
['quantum-state']," Title: How to calculate the state given by two qubits?Body: Let's say two qubits are both in $|+\rangle$ state. We need to find $a_1$, $a_2$, $a_3$, and $a_4$ in $|\phi\rangle = a_1|00\rangle + a_2|01\rangle + a_3|10\rangle + a_4|11\rangle$, how do we find these amplitudes? How do we do it in general case, when each of the qubits are not necessarily in $|+\rangle$ state, but in some $|?\rangle$ state?
"
"['quantum-gate', 'quantum-state']"," Title: How to input 2 qubits in 2 Hadamard gates?Body: Let's say we have a circuit with $2$ Hadamard gates:
Let's take the $|00\rangle$ state as input. The vector representation of $|00\rangle$ state is $[1 \ 0 \ 0 \ 0]$, but this is the representation of $2$ qubits and H accepts just $1$ qubit, so should we apply the first H gate to $[1 \ 0]$ and the second H gate to $[0 \ 0]$? Or should we input $[1 \ 0]$ in each H gate, because we are applying H gates to just one qubit of state $|0\rangle$ each time?
"
"['tensor-product', 'qutrit', 'projection-operator']"," Title: Confusion regarding projection operatorBody: Suppose we have a qutrit with the state vector $|\psi\rangle = a_0|0\rangle + a_1|1\rangle + a_2|2\rangle$, and we want to project its state onto the subspace having the basis $\{|0\rangle,|2\rangle\}$, I know the projection operator would be written like: $1|0\rangle \langle0| + 0|1\rangle\langle 1| + 1|2\rangle\langle2|$.
I'm having a few confusions here. Does $|0\rangle \langle 0|$ represent a tensor product between $[1 \ 0 \ 0]^{T}$ and $[1 \ 0 \ 0]$ ? Or is it just matrix multiplication? Also, I thought that we must always be able to write a projection operator in the form $|\phi\rangle \langle \phi|$ where $|\phi\rangle$ is a possible state of a qutrit. But how to represent $1|0\rangle \langle0| + 0|1\rangle\langle 1| + 1|2\rangle\langle2|$ in the form $|\phi\rangle \langle \phi|$?
"
"['quantum-gate', 'quantum-state']"," Title: How to apply single and two qubit gates to 2 qubits multiple times?Body: Let's say we have the following quantum circuit:
Let's say we input the state $|00\rangle$ . Both of the $H$ gates produce the output $1/\sqrt{2}$, but which one of the following $2$ vectors is the input of $\operatorname{CNOT}$ gate:
$1: [1/\sqrt{2}, \ 1/\sqrt{2}, \ 1/\sqrt{2}, \ 1/\sqrt{2}]$ or
$2: [1/2, \ 1/2, \ 1/2, \ 1/2]$?
Also, after applying a $2$ qubit gate (in this case $\operatorname{CNOT}$) how do we find out what to input in the following single qubit gates (in this case two $H$ gates)?
Note that I gave this example for simplicity, a general answer will also be accepted.
"
"['quantum-gate', 'bloch-sphere']"," Title: How to prove that Z operator rotates points on Bloch sphere about Z axis through 180°?Body: My idea was to apply $Z$ operator 𝐭𝐰𝐢𝐜𝐞, which leads us back to the point where we started from, and also show that after applying the $Z$ operator just 𝐨𝐧𝐜𝐞 we are not at the same point where we started (this is for showing that we are not rotating by a multiple of $360^{\circ}$). Is this the correct proof? What about the general case, where we want to find out through how many degrees a given operator rotates the points?
"
"['physical-realization', 'classical-computing']"," Title: Why is it harder to build quantum computers than classical computers?Body: Is it because we don't know exactly how to create quantum computers (and how they must work), or do we know how to create it in theory, but don't have the tools to execute it in practice? Is it a mix of the above two? Any other reasons?
"
"['error-correction', 'stabilizer-code']"," Title: Zero-distance self-dual GF(4) quantum codes and constructing k > 0 codes from themBody: During a description of zero-dimensional self-dual $\text{GF}(4)$ quantum codes in ""On self-dual quantum codes, graphs, and Boolean functions"" by L.E. Danielsen, it states:
A zero-dimensional stabilizer code with high distance represents a single quantum state which is robust to error, sometimes called a stabilizer state. Codes of higher dimension can be constructed from zero-dimensional quantum codes...
My question has two parts:
Firstly, I am confused by what is meant here by a ""single quantum state"". To my understanding, the passage seems to confuse the encoded 0-dimensional qubit state (which is robust to Pauli error), i.e. a single ""qubit"" state, with the single ""stabilizer"" state which is represented by the generators of the code (which is not robust to error, as a single Hadamard on any qubit would be sufficient to take it to a completely different stabilizer state). Is this the case, or am I misunderstanding something here?
Secondly, what form do these constructions take in practice? Is this simply achieved by not enforcing one of the stabilizer's generators, or are there other more general methods? Furthermore, if there are multiple construction methods, what are their advantages or disadvantages (both in the codes they create and/or the complexity of the construction)?
"
"['quantum-state', 'entanglement']"," Title: How to check if 2 qubits are entangled?Body: I know that 2 qubits are entangled if it is impossible to represent their joint state as a tensor product. But when we are given a joint state, how can we tell if it is possible to represent it as a tensor product?
For example, I am asked to tell if the qubits are entangled for each of the following situations:
$$\begin{align}
\left| 01 \right>\\
\frac 12(\left| 00 \right> + i\left| 01 \right> - i\left| 10 \right> + i\left| 11 \right> )\\
\frac 12(\left| 00 \right> - \left| 11 \right>)\\
\frac 12(\left| 00 \right> + \left| 01 \right> +i\left| 10 \right> + \left| 11 \right> ) \end{align}$$
"
['algorithm']," Title: How does this parallel computation scheme fail?Body: I've accidentally written a procedure which appears to compute both outputs of a long-running function $f: \{0,1\} \to \{1...n\}$ using one run of $f$ plus $\mathcal{O}(n)$ time. I thought this couldn't be done. Where's the bug in my ""perpetuum mobile""? If I'm wrong, what's the name of this technique?
- Initialize with $\sum_ic_i|i\rangle_x$, with $c_0$ initially, say, $\sqrt½$, and the invariant $\sum_ic_i^2 = 1$.
- Compute $f(x)$, producing: $\sum_ic_i|i\rangle_x|f_i\rangle$ (1). We never evaluate $f$ again, and our goal is to extract these $f_i$.
- Produce:
$$
\sqrt½\sum_ic_i|i\rangle_x|f_i\rangle(|i^{|a|}\rangle_a|f_i\rangle_b+2^{-|a+b|/2}\sum_{rs}|r\rangle_a|s\rangle_b)
$$
- Measure and discard the $a$ and $b$ registers, getting (1) with $c_0^2 \in \{1/(2+2^{|a|+|b|}), ½, 1-1/(2+2^{|a|+|b|})\}$, and in all probability we know which.
- Use amplitude amplification, where the good and bad subspaces are distinguished using the $x$ qubit, to get $c_0^2$ between ⅛ and ⅞.
- Repeat the last 3 *s a bunch of times.
- In all probability, we've measured $f_0$ and $f_1$.
"
"['algorithm', 'circuit-construction', 'bqp']"," Title: Jones PolynomialBody: There are many fairly standard quantum algorithms that can all be understood within a very similar framework, from Deutsch's algorithm Simon's problem, Grover's search, Shor's algorithm and so on.
One algorithm that seems to be completely different is the algorithm for evaluating the Jones Polynomial. Moreover, it seems like this is a crucial algorithm to understand in the sense that it is a BQP-complete problem: it exhibits the full power of a quantum computer. Also, for a variant of the problem, it's DQC-1 complete, i.e. it exhibits the full power of one clean qubit.
The Jones Polynomial algorithm paper presents the algorithm in a very different way to the other quantum algorithms. Is there a more similar/familiar way that I can understand the algorithm (specifically, the unitary $U$ in the DQC-1 variant, or just the whole circuit in the BQP-complete variant)?
"
"['error-correction', 'stabilizer-code']"," Title: What does ""conjugation of coordinates"" mean with respect to GF(4) (quantum) codesBody: In On the classification of all self-dual additive codes over $\textrm{GF}(4)$ of length up to 12 by Danielsen and Parker, they state:
Two self-dual additive codes over $\textrm{GF}(4)$, $C$ and $C^\prime$, are equivalent if and only if the codewords of $C$ can be mapped onto the codewords of $C^\prime$ by a map that preserves self-duality. Such a map must consist of a permutation of coordinates (columns of the generator matrix), followed by multiplication of coordinates by nonzero elements from $\textrm{GF}(4)$, followed by possible conjugation of coordinates.
with the previous definition
Conjugation of $x \in \textrm{GF}(4)$ is defined by $\bar{x} = x^2$.
I am confused what ""conjugation of coordinates"" means in this context. To me ""coordinates"" would normally refers to the code matrix's columns, or equivalently the quantum code's qubits. However, here it seems to be referring to the alphabet of the code, or equivalently the Pauli operators of the code's stabilizer generators. If this is the case, what operation does ""conjugation of coordinates"" represent with respect to the code's stabilizer generators?
"
"['quantum-state', 'tensor-product']"," Title: What is the $\left| 22\right>$ state?Body: I came across with a problem that involves $2$ quantum trits in state $\left| 22 \right>.$ What is it's tensor product interpretation and a matrix interpretation?
"
['quantum-memory']," Title: Are bucket-brigate (q)RAM architectures also advantageous in the classical case?Body: One of the main ideas introduced in Giovannetti et al. 2007
(0708.1879) is the so-called bucket-brigade (q)RAM architecture.
The authors state (first paragraph, second column, first page, in v2) that this new (at the time) (q)RAM architecture reduces the number of switches that must be thrown during a RAM call, quantum or classical, from $O(N^{1/d})$ to $O(\log N)$, where $N=2^n$ is the number of memory slots in the RAM and $d$ is the dimension of the lattice that, according to the authors, conventional RAM architectures use for memory retrieval.
The conventional architecture they have in mind essentially consists in retrieving the information using a tree structure, like the one they present in their Fig. 1 (here reproduced):
They say that this scheme requires to throw $O(N)$ switches for each memory call, but I don't understand why is this the case.
From the above, it would seem that one just needs to throw $O(\log_2(N))$
switches, one per bifurcation, to get from the top to the bottom.
I understand that in the quantum case, with this protocol, we would end up with a state correlated with all of the $N$ switches, but they seem to be stating that even in the classical case one needs to activate them all.
In other words, is the advantage of the bucket-brigade approach only in the higher error resilience in the quantum case, or would it also be classically advantageous, compared with the conventional approaches?
"
"['quantum-gate', 'matrix-representation']"," Title: How to interpret a quantum circuit as a matrix?Body: If a circuit takes more than one qubit as its input and has quantum gates which take different numbers of qubits as their input, how would we interpret this circuit as a matrix?
Here is a toy example:
"
"['quantum-state', 'measurement']"," Title: Measuring in standard basis meaningBody: What does it mean to measure a qubit (or multiple qubits) in standard basis?
"
"['speedup', 'optimization', 'qaoa', 'neural-network', 'quantum-enhanced-machine-learning']"," Title: Barren plateaus in quantum neural network training landscapesBody: Here the authors argue that the efforts of creating a scalable quantum neural network using a set of parameterized gates are deemed to fail for a large number of qubits. This is due to the fact that, due to the Levy's Lemma, the gradient of a function in high dimensional spaces is almost zero everywhere.
I was wondering if this argument can be also applied to other hybrid quantum-classical optimization methods, like VQE (Variational Quantum Eigensolver) or QAOA (Quantum Approximate Optimization Algorithm).
What do you think?
"
"['quantum-state', 'measurement', 'circuit-construction', 'superposition']"," Title: How can I build a circuit to generate an equal superposition of 3 outcomes for 2 qubits?Body: Given a $2$ qubit-system and thus $4$ possible measurements results in the basis $\{|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle\}$, how can I prepare the state, where:
- only $3$ of these $4$ measurement results are possible (say, $|00\rangle$, $|01\rangle$, $|10\rangle$)?
- these measurements are equally likely? (like Bell state but for $3$ outcomes)
"
['simulation']," Title: Why does (almost) every pair of Hamiltonians generate, through repeated commutation, the whole space of Hermitian matrices?Body: In [1], the problem of simulating a Hamiltonian using repeated applications of a different set of Hamiltonians is discussed.
In particular, let $A$ and $B$ be a pair of Hermitian operators, and let $\mathcal L$ be the algebra generated from $A, B$ through repeated commutation $^{\mathbf{(\dagger)}}$.
The author then asks (first paragraph of third page) what is $\mathcal L$ for an arbitrary pair of observables $A$ and $B$, and argues that $\mathcal L$ is the space of all Hermitian matrices, unless (quoting from the paper) both $e^{iA t}$ and $e^{iB t}$ lie in an $n$-dimensional unitary representation of some Lie group other than $U(n)$.
I'm not too familiar with the theory of Lie algebras, so this statement is quite cryptic for me.
How can this be shown more explicitly?
Equivalently, is there a more direct way to show this fact?
$(\dagger)$: More explicitly, this is the vector space spanned by $A, B, i[A,B], [A,[A,B]], ...$
[1] Lloyd 1995, Almost Any Quantum Logic Gate is Universal, Link to PRL.
"
"['speedup', 'applications']"," Title: Are Genetic Programming runtimes faster on QCs than on classical computers?Body: If this isn't known, would they theoretically be? I'm particularly interested in knowing whether a QC would be faster at evaluating the fitness function of the possible solutions than a classical machine
"
"['entanglement', 'superdense-coding']"," Title: What is the applicability of quantum network coding?Body: As the title suggests, I want to know what the applicability of quantum network coding is, besides the EPR pair construction between distant pairs of 'Users-Targets'.
Can quantum network coding be used for computation?
"
"['algorithm', 'speedup', 'complexity-theory']"," Title: What is the actual power of Quantum Phase Estimation?Body: I have some perplexity concerning the concept of phase estimation: by definition, given a unitary operator $U$ and an eigenvector $|u\rangle$ with related eigenvalue $\text{exp}(2\pi i \phi)$, the phase estimation allows to find the value of $\phi$.
This would mean that I would be able to determine an eigenvalue of a certain matrix given that I know already one of its eigenvectors? But isn't the fact that needing an eigenvector beforehand would quite reduce the usefulness of the phase estimation itself?
"
"['algorithm', 'annealing', 'adiabatic-model']"," Title: Can quantum annealing find excited states?Body: If we start with a Hamiltonian $H(t_i)$, and with our qubits prepared in the ground state of this, and then slowly change this to a Hamiltonian $H(t_i)$, the final state of our qubits should be the ground state of the new Hamiltonian. This is due to the adiabatic theorem, and is the basis of quantum annealing.
But what if it's not the ground state we want? Suppose we start with the first excited state of $H(t_i)$. Does the process give us the first excited state of $H(t_f)$? What about for other states?
"
"['universal-gates', 'gate-synthesis', 'quantum-gate']"," Title: Quantum XNOR Gate ConstructionBody: Tried asking here first, since a similar question had been asked on that site. Seems more relevant for this site however.
It is my current understanding that a quantum XOR gate is the CNOT gate. Is the quantum XNOR gate a CCNOT gate?
"
"['quantum-state', 'density-matrix']"," Title: How to check if a matrix is a valid density matrix?Body: What conditions must a matrix hold to be considered a valid density matrix?
"
"['quantum-state', 'density-matrix']"," Title: How to find a density matrix of a qubit?Body: If we are given a state of a qubit, how do we construct its density matrix?
"
"['algorithm', 'complexity-theory', 'quantum-walks']"," Title: Quantum Walk: Why the need of adding ""tail"" nodes to the root?Body: As stated in the question, I have found in several papers (e.g. 1, 2) that in order to perform a quantum walk on a given tree it is necessary to add some nodes to the root $r$, say $r^{'}$ and $r^{""}$. Why are they needed?
References:
- Farhi E., ""Quantum computation and decision trees"".
https://arxiv.org/abs/quant-ph/9706062
- Ambainis A., ""Any AND-OR formula of size N can be evaluated in time $N^{1/2+o(1)}$ on a quantum computer"". http://www.ucw.cz/~robert/papers/andor-siamjc.pdf
"
"['algorithm', 'cryptography', 'classical-computing']"," Title: Is quantum cryptography safer than classical cryptography?Body: Quantum computing allows us to encrypt information in a different way compared to what we use today, but quantum computers are much more powerful than today's computers. So if we manage to build quantum computers (hence use quantum cryptography), will the so-called ""hackers"" have more or fewer chances of ""hacking"" into the systems? Or is it impossible to determine it?
"
"['universal-gates', 'gate-synthesis', 'quantum-gate']"," Title: Quantum Ripple Carry Adder ConstructionBody: There is an excellent answer to How do I add 1+1 using a quantum computer? that shows constructions of the half and full adders. In the answer, there is a source for the QRCA. I have also looked at this presentation.
I am still left with these questions:
- What does a truth table for a QRCA look like?
- What would a unitary matrix for a QRCA be?
- What would a circuit diagram for a QRCA look like? (There is an example of a 6-bit circuit in the arXiv paper)
"
"['quantum-state', 'density-matrix']"," Title: Density matrices for pure states and mixed statesBody: What is the motivation behind density matrices? And, what is the difference between the density matrices of pure states and density matrices of mixed states?
This is a self-answered sequel to What's the difference between a pure and mixed quantum state? & How to find a density matrix of a qubit? You're welcome to write alternate answers.
"
"['universal-gates', 'gate-synthesis', 'quantum-gate']"," Title: Quantum XOR Linked List ConstructionBody: After getting help here with XNOR & RCA gates I decided to dive into XOR Swaps & XOR linked lists. I was able to find this explanation for quantum XOR Swapping which seems sufficient for the time being. I am not able to find any information on quantum XOR linked lists however (Google returns ""no results"").
How would a quantum XOR linked list be expressed?
"
"['algorithm', 'quantum-gate', 'ibm-q-experience']"," Title: How to implement a random selection of one of the 3 qubits on the IBM Q (composer)?Body: I would like to implement a quantum program on the IBM Composer with following characteristics:
- The output is the observed value of 3 qubits
- Only one of the 3 qubits should be observed as $1$, the 2 others should be $0$
- The probability that a qubit is observed as $1$ is $1/3$
So the 3 possible outputs of this circuit are: $|100\rangle$,$|010\rangle$,$|001\rangle$ (all 3 having equality probability of being outputted)
So how can we best implement such a circuit on the IBM Composer ?
"
"['programming', 'qiskit']"," Title: Changing indices of qubits in QISKitBody: I was wondering if something like this is possible in QISKit: let's say we have two registers containing target and ancilla qubits:
$a_0$ -------------------
$a_1$--------------------
$\vdots$
$a_4$ ------------------
$t_0$ ------------------
$t_1$ ------------------
$\vdots$
$t_4$ ------------------
These two registers are stored in one quantum register qr. So to access $a_0$ we would type qr[0], to access $a_1$ - qr[1], ..., for $t_5$ - qr[9]. We can pass this quantum register as an argument to some function:
foo(qr, ...)
What I want to do is to interleave the ancilla and target qubits:
$a_0$ -------------------
$t_0$--------------------
$\vdots$
$a_i$ ------------------
$t_i$ ------------------
$\vdots$
$a_4$ ------------------
$t_4$ ------------------
so to access $a_0$ I would type qr[0], for $t_1$ - qr[1] and so on. Finally, I would like to pass such changed quantum register qr' again as an argument to some function
foo(qr', ...)
and in this function I would like to use these changed indices. Is this possible? Other solution I figured out was to pass array of indices for ancilla and target qubits, but I would like to avoid that. Another option would be to use swap gates on these qubits
"
"['grovers-algorithm', 'adiabatic-model']"," Title: Can adiabatic quantum computing be faster than Grover's algorithm?Body: It has been proven that adiabatic quantum computing is equivalent to ""standard"", or gate-model quantum computing. Adiabatic computing, however, shows promises for optimisation problems, where the objective is to minimise (or maximise) a function which is in some way related to the problem – that is, finding the instance that minimises (or maximises) this function immediately solves the problem.
Now, it seems to me that Grover's algorithm can essentially do the same: by searching over the solution space, it will find one solution (possibly out of many solutions) that satisfies the oracle criterion, which in this case equates to the optimality condition, in time $O(\sqrt N)$, where $N$ is the size of the solution space.
This algorithm has been shown to be optimal: as Bennett et al. (1997) put it, ""the class $\rm NP$ cannot be solved on a quantum Turing machine in time $o(2^{n/2})$"". In my understanding, this means there is no way to construct any quantum algorithm that finds a solution by searching through the space faster than $O(\sqrt N)$, where $N$ scales with the problem size.
So my question is: while adiabatic quantum computing is often presented as being superior when it comes to optimisation problems, can it really be faster than $O(\sqrt N)$? If yes, this seems to contradict the optimality of Grover's algorithm, since any adiabatic algorithm can be simulated by a quantum circuit. If not, what is the point of developing adiabatic algorithms, if they are never going to be faster than something we can systematically construct with circuits? Or is there something wrong with my understanding?
"
"['classical-computing', 'experiment', 'scalability']"," Title: Will Moore's Law be no longer effective once quantum computers are created?Body: Moore's law states that computer power doubles in every 18 months (more formally: ""the number of transistors in a dense integrated circuit doubles about every two years.""). Statistics suggest that this observation should be correct, but aren't quantum computers much more powerful than just double-powered classical computers? More interesting question is, is there even a way to improve the power of quantum computers?
"
"['algorithm', 'cryptography', 'cryptocurrency']"," Title: Time Entangled Quantum BlockchainBody: This answer cites a paper[$\dagger$] which purposes a quantum blockchain using entanglement in time.
""The weakness is that the research only presents a conceptual design."" - QComp2018
How could a quantum blockchain which leverages time entanglement be realized?
Resources:
- Quantum Secured Blockchain
- Quantum Bitcoin: An Anonymous and Distributed Currency Secured by the No-Cloning Theorem of Quantum Mechanics
[$\dagger$]: Quantum Blockchain using entanglement in time Rajan & Visser (2018)
"
['non-locality']," Title: What is the relationship between the Toffoli gate and the Popescu-Rohrlich box?Body: Background
The Toffoli gate is a 3-input, 3-output classical logic gate. It sends $(x, y, a)$ to $(x, y, a \oplus (x \cdot y))$. It is significant in that it is universal for reversible (classical) computation.
The Popescu-Rohrlich box is the simplest example of a non-signaling correlation. It takes a pair of inputs $(x, y)$ and outputs $(a, b)$ satisfying $x \cdot y = a \oplus b$ such that $a$ and $b$ are both uniform random variables. It is universal for a certain class of (but not all) non-signaling correlations.
To my eye, these two objects look extremely similar, especially if we augment the PR box by having it output $(x, y, a, b) = (x, y, a, a \oplus (x \cdot y))$. This 2-input, 4-output PR box ""is"" the 3-input, 3-output Toffoli gate but with the third input replaced by a random output. But I've been unable to locate any references that relate them.
Question
What is the relationship between the Toffoli gate and the Popescu-Rohrlich box? Is there something like a correspondence between reversible classical circuits and (a certain class of?) non-signaling correlations that maps one to the other?
Observations
- Specifying a non-signaling correlation requires not just a function but also an assignment of each input and output to a party that controls it. A PR box is no longer non-signaling if we allow Alice to enter both inputs and Bob to read both outputs. Or in our ""augmented"" PR-box, if Alice inputs $x$, she must also be the one who reads the copy of $x$. So it seems nontrivial to determine, for a general circuit (with some inputs possibly replaced by random outputs), all the ways inputs and outputs can be assigned to parties such that communication is not possible.
- We can apply the above procedure any logic gate, including irreversible ones. For instance, we can take AND and replace one of the inputs by a random output, and get a function one input $x$ and a pair $(a, x \cdot a)$ where $a$ is a uniform random variable. However, $x \cdot a$ is $0$ conditioned on $x = 0$, so the only way this can be non-signaling is if Alice, who inputs $x$, receives $x \cdot a$. But this procedure can already be reproduced classically with a shared source of randomness. So I would expect that including irreversible gates does not expand the class of non-signaling correlations one can construct.
"
"['algorithm', 'architecture', 'many-body-systems', 'quantum-networks', 'communication']"," Title: How could a quantum network be constructed to handle 10,000 clients concurrently?Body: The C10k Problem is a classical computing problem whose name (C10k) is a numeronym for concurrently handling ten thousand connections.
How could a quantum network be constructed to handle 10,000 clients concurrently?
"
['grovers-algorithm']," Title: Grover's algorithm: a real life example?Body: I'm fairly confused about how Grover's algorithm could be used in practice and I'd like to ask help on clarification through an example.
Let's assume an $N=8$ element database that contains colors Red, Orange, Yellow, Green, Cyan, Blue, Indigo and Violet, and not necessarily in this order. My goal is to find Red in the database.
The input for Grover's algorithm is $n = \log_2(N=8) = 3$ qubits, where the 3 qubits encode the indices of the dataset. My confusion comes here (might be confused about the premises so rather say confusion strikes here) that, as I understand, the oracle actually searches for one of the indices of the dataset (represented by the superposition of the 3 qubits), and furthermore, the oracle is ""hardcoded"" for which index it should look for.
My questions are:
- What do I get wrong here?
- If the oracle is really looking for one of the indices of the database, that would mean we know already which index we are looking for, so why searching?
- Given the above conditions with the colors, could someone point it out if it is possible with Grover's to look for Red in an unstructured dataset?
There are implementations for Grover's algorithm with an oracle for $n=3$ searching for |111>, e.g. (or see an R implementation of the same oracle below):
https://quantumcomputing.stackexchange.com/a/2205
Again, my confusion is, given I do not know the position of $N$ elements in a dataset, the algorithm requires me to search for a string that encodes the position of $N$ elements. How do I know which position I should look for when the dataset is unstructured?
R code:
#START
a = TensorProd(TensorProd(Hadamard(I2),Hadamard(I2)),Hadamard(I2))
# 1st CNOT
a1= CNOT3_12(a)
# 2nd composite
# I x I x T1Gate
b = TensorProd(TensorProd(I2,I2),T1Gate(I2))
b1 = DotProduct(b,a1)
c = CNOT3_02(b1)
# 3rd composite
# I x I x TGate
d = TensorProd(TensorProd(I2,I2),TGate(I2))
d1 = DotProduct(d,c)
e = CNOT3_12(d1)
# 4th composite
# I x I x T1Gate
f = TensorProd(TensorProd(I2,I2),T1Gate(I2))
f1 = DotProduct(f,e)
g = CNOT3_02(f1)
#5th composite
# I x T x T
h = TensorProd(TensorProd(I2,TGate(I2)),TGate(I2))
h1 = DotProduct(h,g)
i = CNOT3_01(h1)
#6th composite
j = TensorProd(TensorProd(I2,T1Gate(I2)),I2)
j1 = DotProduct(j,i)
k = CNOT3_01(j1)
#7th composite
l = TensorProd(TensorProd(TGate(I2),I2),I2)
l1 = DotProduct(l,k)
#8th composite
n = TensorProd(TensorProd(Hadamard(I2),Hadamard(I2)),Hadamard(I2))
n1 = DotProduct(n,l1)
n2 = TensorProd(TensorProd(PauliX(I2),PauliX(I2)),PauliX(I2))
a = DotProduct(n2,n1)
#repeat the same from 2st not gate
a1= CNOT3_12(a)
# 2nd composite
# I x I x T1Gate
b = TensorProd(TensorProd(I2,I2),T1Gate(I2))
b1 = DotProduct(b,a1)
c = CNOT3_02(b1)
# 3rd composite
# I x I x TGate
d = TensorProd(TensorProd(I2,I2),TGate(I2))
d1 = DotProduct(d,c)
e = CNOT3_12(d1)
# 4th composite
# I x I x T1Gate
f = TensorProd(TensorProd(I2,I2),T1Gate(I2))
f1 = DotProduct(f,e)
g = CNOT3_02(f1)
#5th composite
# I x T x T
h = TensorProd(TensorProd(I2,TGate(I2)),TGate(I2))
h1 = DotProduct(h,g)
i = CNOT3_01(h1)
#6th composite
j = TensorProd(TensorProd(I2,T1Gate(I2)),I2)
j1 = DotProduct(j,i)
k = CNOT3_01(j1)
#7th composite
l = TensorProd(TensorProd(TGate(I2),I2),I2)
l1 = DotProduct(l,k)
#8th composite
n = TensorProd(TensorProd(PauliX(I2),PauliX(I2)),PauliX(I2))
n1 = DotProduct(n,l1)
n2 = TensorProd(TensorProd(Hadamard(I2),Hadamard(I2)),Hadamard(I2))
n3 = DotProduct(n2,n1)
result=measurement(n3)
plotMeasurement(result)
"
"['algorithm', 'neural-network']"," Title: Is it possible to speed up the generation of the weighting matrix using a quantum algorithm?Body: In this[1] paper, on page 2, they mention that they are generating the weighting matrix as follows:
$$W = \frac{1}{Md}[\sum_{m=1}^{m=M} \mathbf{x}^{(m)}\left(\mathbf{x}^{(m)}\right)^{T}] - \frac{\Bbb I_d}{d}$$
where $\mathbf{x}^{(m)}$'s are the $d$-dimensional training samples (i.e. $\mathbf{x} := \{x_1,x_2,...,x_d\}^{T}$ where $x_i \in \{1,-1\} \ \forall \ i\in \{1,2,...,d\}$) and there are $M$ training samples in total. This generation of weighting matrix using matrix multiplication followed by a sum over $M$ terms seems to be a costly operation in terms of time complexity i.e. I guess around $O(Md)$ (?).
Does there exist any quantum algorithm which can offer a substantial speed-up for generation of the weighting matrix? I think in the paper their main speedup comes from the quantum matrix inversion algorithm (which is mentioned later on the paper), but they don't seem to have taken into account this aspect of the weighting matrix generation.
[1]: A Quantum Hopfield Neural Network Lloyd et al. (2018)
"
"['quantum-state', 'physical-qubit']"," Title: What is a qubit?Body: What is a ""qubit""? Google tells me that it's another term for a ""quantum bit"". What is a ""quantum bit"" physically? How is it ""quantum""? What purpose does it serve in quantum computing?
Note: I'd prefer an explanation that is easily understood by laypeople; terms specific to quantum computing should preferably be explained, in relatively simple terms.
"
"['algorithm', 'quantum-gate']"," Title: What are some open sources projects on quantum computing?Body: I am looking to collaborate on open source simulation efforts.
"
"['algorithm', 'hhl-algorithm', 'phase-estimation']"," Title: Quantum algorithm for linear systems of equations (HHL09): Step 1 - Confusion regarding the usage of phase estimation algorithmBody: I have been trying to get my head around the famous(?) paper Quantum algorithm for linear systems of equations (Harrow, Hassidim & Lloyd, 2009) (more popularly known as the HHL09 algorithm paper) for some time, now.
On the very first page, they say:
We sketch here the basic idea of our algorithm and then discuss it in
more detail in the next section. Given a Hermitian $N\times N$ matrix
$A$, and a unit vector $\vec{b}$, suppose we would like to find
$\vec{x}$ satisfying $A\vec{x} = \vec{b}$. (We discuss later questions
of efficiency as well as how the assumptions we have made about $A$
and $\vec{b}$ can be relaxed.) First, the algorithm represents
$\vec{b}$ as a quantum state $|b\rangle = \sum_{i=1}^{N}b_i|i\rangle$.
Next, we use techniques of Hamiltonian simulation [3, 4] to apply
$e^{iAt}$ to $|b_i\rangle$ for a superposition of different times $t$.
This ability to exponentiate $A$ translates, via the well-known
technique of phase-estimation [5–7] into the ability to decompose $|b\rangle$
in the eigenbasis of $A$ and to find the corresponding eigenvalues
$\lambda_j$ Informally, the state of the system after
this stage is close to $\sum_{j=1}^{j=N} \beta_j
|u_j\rangle|\lambda_j\rangle$, where $u_j$ is the eigenvector basis of
$A$ and $|b\rangle = \sum_{j=1}^{j=N} \beta_j|u_j\rangle$.
So far so good. As described in Nielsen & Chuang in the chapter ""The quantum Fourier transform and its applications"", the phase estimation algorithm is used to estimate $\varphi$ in $e^{i2\pi \varphi}$ which is the eigenvalue corresponding to an eigenvector $|u\rangle$ of the unitary operator $U$.
Here's the relevant portion from Nielsen & Chuang:
The phase estimation algorithm uses two registers. The first register
contains $t$ qubits initially in the state $|0\rangle$. How we choose
$t$ depends on two things: the number of digits of accuracy we wish to
have in our estimate for $\varphi$, and with what probability we wish the
phase estimation procedure to be successful. The dependence of $t$ on
these quantities emerges naturally from the following analysis.
The second register begins in the state $|u\rangle$ and contains as
many qubits as is necessary to store $|u\rangle$. Phase estimation is
performed in two stages. First, we apply the circuit shown in Figure
5.2. The circuit begins by applying a Hadamard transform to the first register, followed by application of controlled - $U$ operations on
the second register, with $U$ raised to successive powers of two. The
final state of the first register is easily seen to be:
$$\frac{1}{2^{t/2}}\left(|0\rangle+\text{exp}(2\pi i
2^{t-1}\varphi)|1\rangle)(|0\rangle+\text{exp}(2\pi i
2^{t-2}\varphi)|1\rangle)...(|0\rangle+\text{exp}(2\pi i
2^{0}\varphi)|1\rangle\right)=
\frac{1}{2^{t/2}}\sum_{k=0}^{2^{t}-1}\text{exp}(2\pi i \varphi
k)|k\rangle$$
The second stage of phase estimation is to apply the inverse quantum
Fourier transform on the first register. This is obtained by reversing
the circuit for the quantum Fourier transform in the previous section
(Exercise 5.5) and can be done in $\Theta (t^2)$ steps. The third and
final stage of phase estimation is to read out the state of the first
register by doing a measurement in the computational basis. We will
show that this provides a pretty good estimate of $\varphi$. An
overall schematic of the algorithm is shown in Figure 5.3.
To sharpen our intuition as to why phase estimation works, suppose $\varphi$
may be expressed exactly int bits, as $\varphi = 0.\varphi_1 ...
\varphi_t$. Then the state (5.20) resulting from the first stage of
phase estimation may be rewritten
$$\frac{1}{2^{t/2}}(|0\rangle + \exp(2\pi i
0.\varphi_t|1\rangle)(|0\rangle + \exp(2\pi i 0.\varphi_{t-1}\varphi_t|1\rangle)...(|0\rangle + \exp(2\pi i 0.\varphi_1...\varphi_t|1\rangle)$$
The second stage of phase estimation is to apply the inverse quantum
Fourier transform. But comparing the previous equation with the
product form for the Fourier transform, Equation (5.4), we see that
the output state from the second stage is the product state
$|\varphi_1 ...\varphi_t\rangle$. A measurement in the computational
basis, therefore, gives us $\varphi$ exactly!
Summarizing, the phase estimation algorithm allows one to estimate the
phase $\varphi$ of an eigenvalue of a unitary operator $U$, given the
corresponding eigenvector $|u\rangle$. An essential feature at the
heart of this procedure is the ability of the inverse Fourier
transform to perform the transformation
$$\frac{1}{2^{t/2}}\sum_{j = 0}^{2^t-1}\exp(2\pi i \varphi j)|j\rangle |u\rangle \to |\tilde \varphi \rangle |u\rangle$$
Let's proceed from here. I found a nice circuit diagram for the HHL09 algorithm here[$\dagger$]:
Step 1 (Phase Estimation):
In the first step of the HHL09 algorithm the same concept (of the standard Quantum Phase Estimation algorithm as described in Nielsen and Chuang) is used. However, we must keep in mind that $A$ by itself isn't a unitary operator. However, if we assume that $A$ is Hermitian then the exponential $e^{iAt}$ is unitary (no worries, there's exists a workaround in case $A$ isn't Hermitian!).
Here, we can write $U=e^{iAt}$. There's another subtle point involved here. We do not know the eigenvectors $|u_j\rangle$ of $U$ beforehand (but we do know that for any unitary matrix of size $N\times N$ there exist $N$ orthonormal eigenvectors). Moreover, we need to remind ourselves that if the eigenvalues of $A$ are $\lambda_j$ then the eigenvalues of $e^{iAt}$ will be $e^{i \lambda_j t}$. If we compare this with the form of eigenvalues given in Nielsen and Chuang for $U$ i.e. if $e^{2\pi i \varphi} \equiv e^{ i \lambda_j t}$, we'd find $\varphi = \frac{\lambda_j t}{2\pi}$. In this case, we begin in the state $|b\rangle$ (which can be written as a superposition of the eigenvectors of $U$ i.e. $\sum_{j=1}^{j=N}\beta_j|u_j\rangle$) rather than any particular eigenvector $|u_j\rangle$ of $U$, as far as the second register of qubits is concerned. If we had begun in the state $|u\rangle \otimes (|0\rangle)^{\otimes t}$ we would have ended up with $|u\rangle \otimes |\tilde\varphi\rangle$ i.e. $|u_j\rangle \otimes |\tilde{\frac{\lambda_j t}{2\pi}}\rangle$ (considering that $\lambda_j$ is the eigenvalue associated with the eigenvector $|u_j\rangle$ of $A$). Now, instead if we begin in the superposition of eigenvectors $\sum_{j=1}^{j=N}\beta_j|u_j\rangle$ we should end up with $\sum_{j=1}^{j=N}\beta_j|u_j\rangle\otimes |\tilde{\frac{\lambda_j t}{2\pi}}\rangle$.
Question:
Part 1: In the HHL09 paper, they wrote about the state of the system after this Phase Estimation step is $\sum_{j=1}^{j=N}\beta_j|u_j\rangle\otimes |\tilde\lambda_j\rangle$. However, from what I wrote above it seems to me that the state of the system should rather be $\sum_{j=1}^{j=N}\beta_j|u_j\rangle\otimes |\tilde{\frac{\lambda_j t}{2\pi}}\rangle$.
What am I missing here? Where did the factor of $\frac{t}{2\pi}$ vanish in their algorithm?
Edit: Part 2 has been asked here to make the individual questions more focused.
I also have several confusions regarding Step 2 and Step 3 of the HHL09 algorithm too, but I decided to post them as separate question threads, as this one is becoming too long. I'll add the links to those question threads, on this post, once they are created.
[$\dagger$]: Homomorphic Encryption Experiments on IBM's Cloud Quantum Computing Platform Huang et al. (2016)
"
"['algorithm', 'hhl-algorithm', 'neural-network']"," Title: Quantum algorithm for linear systems of equations (HHL09): Step 1 - Number of qubits neededBody: This is a continuation of Quantum algorithm for linear systems of equations (HHL09): Step 1 - Confusion regarding the usage of phase estimation algorithm
Questions (contd.):
Part 2: I'm not exactly sure how many qubits will be needed for the Step 1 of the HHL09.
In Nielsen and Chuang (section 5.2.1, 10th anniversary edition) they say:
Thus to successfully obtain $\varphi$ accurate to $n$-bits with
probability of sucess at least $1-\epsilon$ we choose
$$t=n+\lceil { \log(2+\frac{1}{2\epsilon})\rceil}$$
So, say we want an accuracy of $90\%$ i.e. $1-\epsilon = 0.9 \implies \epsilon = 0.1$ and a precision of $3$-bits for $\frac{\lambda_j t}{2\pi}$ or $\lambda_j$ we'd need
$$t = 3 + \lceil { \log_2(2+\frac{1}{2 (0.1)})\rceil} = 3 + 3 = 6$$
Apart from that, since $|b\rangle$ can be represented as a sum of $N$ linearly independent eigenvectors of a $N\times N$ dimensional matrix $A$, we'd need minimum $\lceil{\log_2(N)\rceil}$ qubits to produce a vector space having at least $N$ - dimensions. So, we need $\lceil{\log_2(N)\rceil}$ for the second register.
Now, for the first register we not only $\lceil{\log_2(N)\rceil}$ qubits won't be sufficient to represent the $N$ eigenvalues $|\lambda_j\rangle$, that is because we'll need more bits for representing each $|\lambda_j\rangle$ precisely upto $n$-bits.
I guess we should again use the formula $$n+\lceil { \log(2+\frac{1}{2\epsilon})\rceil}$$ in this case. If we want each eigenvalue $|\lambda_i\rangle$ to be represented with a $3$-bit precision and $90\%$ accuracy then we'd need $6\times \lceil{\log_2(N)\rceil}$ for the first register. Plus, one more qubit which is needed for the ancilla.
So, we should need a total of $(6+1)\lceil{\log_2(N)\rceil}+1$ qubits for Step 1 of the HHL09 algorithm. That's quite a lot!
Say we want to solve a $2\times 2$ linear equation system such that $A$ is Hermitian that itself would require $7\lceil{\log_2(2)\rceil}+1 = 8$ qubits! In case $A$ is not Hermitian we'd need even more qubits. Am I right?
However, in this[$\dagger\dagger$] paper on page 6 they claim that they used the HHL09 algorithm to estimate the pseudoinverse of $A$ which of size ~$200\times 200$. In that paper, $A$ is defined as:
$$A := \begin{pmatrix} W - \gamma \Bbb I_d & P \\ P & 0 \end{pmatrix}$$
where $P$,$W$ and $\Bbb I_d$ are all $d\times d$ matrices.
In the H1N1 related simulated Lloyd et al. have claimed to have made, $d = 100$. And they further claim that they used the HHL09 algorithm to estimate the pseudo-inverse of $A$ (which is of size $200\times 200$). That would need a minimum of $7\lceil{\log_2(200)\rceil}+1 = 7(8)+1 = 57$ qubits to simulate. I have no idea how they could possibly do that using the current quantum computers or quantum computer simulations. As far as I know, IBM Q Experience at present supports ~$15$ qubits (that too it isn't as versatile as their $5$-qubit version).
Am I missing something here? Does this Step 1 actually require a lesser number of qubits than what I have estimated?
[$\dagger\dagger$]: A Quantum Hopfield Neural Network Lloyd et al. (2018)
"
"['mathematics', 'quantum-control']"," Title: How do you produce an algebra from a set $\{H, H_i\}$ via commutation?Body: In a paper I am reading, it states:
For open-loop coherent controllability a quantum system with Hamiltonian $H$ is open-loop controllable by a coherent controller if and only if the algebra $\mathcal{A}$ generated from $\{ H, H_i \}$ by commutation is the full algebra of Hermitian operators for the system.
How would you produce an algebra from the set $\{ H, H_i \}$ using commutation? What is the basic idea in this regard?
"
"['algorithm', 'hhl-algorithm', 'hamiltonian-simulation']"," Title: Quantum algorithm for linear systems of equations (HHL09): Step 2 - What is $|\Psi_0\rangle$?Body: This is a sequel to Quantum algorithm for linear systems of equations (HHL09): Step 1 - Confusion regarding the usage of phase estimation algorithm and Quantum algorithm for linear systems of equations (HHL09): Step 1 - Number of qubits needed.
In the paper: Quantum algorithm for linear systems of equations (Harrow, Hassidim & Lloyd, 2009), what's written up to the portion
The next step is to decompose $|b\rangle$ in the eigenvector basis,
using phase estimation [5–7]. Denote by $|u_j\rangle$ the eigenvectors
of $A$ (or equivalently, of $e^{iAt}$), and by $\lambda_j$ the
corresponding eigenvalues.
on page $2$ makes some sense to me (the confusions up till there have been addressed in the previous posts linked above). However, the next portion i.e. the $R(\lambda^{-1})$ rotation seems a bit cryptic.
Let $$|\Psi_0\rangle := \sqrt{\frac{2}{T}}\sum_{\tau =0}^{T-1} \sin
\frac{\pi(\tau+\frac{1}{2})}{T}|\tau\rangle$$
for some large $T$. The coefficients of $|\Psi_0\rangle$ are chosen
(following [5-7]) to minimize a certain quadratic loss function which
appears in our error analysis (see [13] for details).
Next, we apply the conditional Hamiltonian evolution $\sum_{\tau =
0}^{T-1}|\tau\rangle \langle \tau|^{C}\otimes e^{iA\tau t_0/T}$ on
$|\Psi_0\rangle^{C}\otimes |b\rangle$, where $t_0 =
\mathcal{O}(\kappa/\epsilon)$.
Questions:
1. What exactly is $|\Psi_0\rangle$? What do $T$ and $\tau$ stand for? I've no idea from where this gigantic expression $$\sqrt{\frac{2}{T}}\sum_{\tau =0}^{T-1} \sin
\frac{\pi(\tau+\frac{1}{2})}{T}|\tau\rangle$$ suddenly comes from and what its use is.
2. After the phase estimation step, the state of our system is apparently:
$$\left(\sum_{j=1}^{j=N}\beta_j|u_j\rangle\otimes |\tilde\lambda_j\rangle\right)\otimes |0\rangle_{\text{ancilla}}$$
This surely cannot be written as $$\left(\sum_{j=1}^{j=N}\beta_j|u_j\rangle\right)\otimes \left(\sum_{j=1}^{j=N}|\tilde\lambda_j\rangle\right)\otimes |0\rangle_{\text{ancilla}}$$ i.e.
$$|b\rangle\otimes \left(\sum_{j=1}^{j=N}|\tilde\lambda_j\rangle\right)\otimes |0\rangle_{\text{ancilla}}$$
So, it is clear that $|b\rangle$ is not available separately in the second register. So I've no idea how they're preparing a state like $|\Psi_0\rangle^{C}\otimes |b\rangle$ in the first place! Also, what does that $C$ in the superscript of $|\Psi_0\rangle^{C}$ denote?
3. Where does this expression $\sum_{\tau =
0}^{T-1}|\tau\rangle \langle \tau|^{C}\otimes e^{iA\tau t_0/T}$ suddenly appear from ? What's the use of simulating it? And what is $\kappa$ in $\mathcal{O}(\kappa/\epsilon)$ ?
"
"['quantum-gate', 'gate-synthesis']"," Title: Implementing a CCCNOT gate using only Toffoli gatesBody: A CCCNOT gate is a four-bit reversible gate that flips its fourth bit if and only if the first three bits are all in the state $1$.
How would I implement a CCCNOT gate using Toffoli gates? Assume that bits in the workspace start with a particular value, either 0 or 1, provided you return them to that value.
"
"['algorithm', 'applications']"," Title: What kind of real-world problems (excluding cryptography) can be solved efficiently by a quantum algorithm?Body: This question is very similar as Is there any general statement about what kinds of problems can be solved more efficiently using a quantum computer?
But the answers provided to that questions mainly looked at it from a theoretical/mathematical point of view.
For this question, I am more interested in the practical/engineering point of view. So I would like to understand what kind of problems can be more efficiently solved by a quantum algorithm than you would currently be able to do with a classical algorithm. So I am really assuming that you do not have all knowledge about all possible classical algorithms that could optimally solve the same problem!
I am aware that the quantum zoo expresses a whole collection of problems for which there exists a quantum algorithm that runs more efficiently than a classical algorithm but I fail to link these algorithms to real-world problems.
I understand that Shor's factoring algorithm is very important in the world of cryptography but I have deliberately excluded cryptography from the scope of this question as the world of cryptography is a very specific world which deserves his own questions.
In efficient quantum algorithms, I mean that there must at least be one step in the algorithm that must be translated to a quantum circuit on a n-qubit quantum computer. So basically this quantum circuit is creating a $2^n$ x $2^n$ matrix and its execution will give one of the $2^n$ possibilities with a certain possibility (so different runs might give different results - where the likely hood of each of the $2^n$ possibilities is determined by the constructed $2^n$ x $2^n$ Hermitian matrix.)
So I think to answer my question there must be some aspect/characteristic of the real world problem that can be mapped to a $2^n \times 2^n$ Hermitian matrix.
So what kind of aspects/characteristics of a real-world problem can be mapped to such a matrix?
With real-world problem I mean an actual problem that might be solved by a quantum algorithm, I don't mean a domain where there might be a potential use of the quantum algorithm.
"
"['algorithm', 'physical-realization', 'complexity-theory']"," Title: How many operations can a quantum computer perform per second?Body: I want to know what time complexity is considered efficient/inefficient for quantum computers. For this, I need to know how many operations a quantum computer can perform per second. Can anyone tell me how to calculate it and what factors it depends on (implementation details or number of qubits etc.)?
"
['physical-realization']," Title: When can we expect the first (universal) quantum computer being able to do something useful outside the academic world?Body: The governments, big companies (list of quantum processors) and smaller ones are in the competition of building bigger and bigger quantum computers.
Not unexpectedly the number of qubits of those quantum computers seem to double every year but those qubits are noisy qubits. What is a more meaningful metric is the number of error corrected qubits and some sources say that we need 100 noisy qubits to simulate one error corrected qubit.
Besides the error corrected qubits there are other substantial hurdles that need to be passed to come to a universal quantum computer that can do something useful (see Why Will Quantum Computers be Slow?)
I read quotes like (source GOOGLE, ALIBABA SPAR OVER TIMELINE FOR 'QUANTUM SUPREMACY):
Intel CTO Mike Mayberry told WIRED this week that he sees broad
commercialization of the technology as a 10-year project. IBM has said
it can be “mainstream” in five.
So when might we actually expect the first universal quantum computer that can do something useful outside the academic world ?
With useful I mean that brings real value (e.g. commercial application) and that cannot be done with same efficiency using existing classical computing algorithms/models.
I have deliberately mentioned outside the academic world as obviously currently pure by their existence the current quantum computers are useful for the theoretical computer scientist, quantum physicist, quantum specialist, ...
What currently interests me more is the usefulness of the outcome of this quantum algorithm for real world problems (e.g. cracking an actual key, designing a new molecule with specific characteristics, finding the optimal solution of an actual problem, recognizing real images, ....)
"
"['quantum-state', 'mathematics', 'density-matrix']"," Title: What does it mean for a density matrix to ""act on a Hilbert space $\mathcal{H}""$?Body: For a Hilbert space $\mathcal{H}_A$, I have seen the phrase
density matrices acting on $\mathcal{H}_A$
multiple times, e.g. here.
It is clear to me that if $\mathcal{H}_A$ has finite Hilbert dimension $n$, then this makes sense mathematically, because a density matrix $\rho$ can be written as $\rho \in \mathbb{C}^{n \times n}$ and elements $\phi$ of $\mathcal{H}_A$ can be written as $\phi \in \mathbb{C}^n$, so I can write down $\rho \phi \in \mathbb{C}^n$.
However, it is unclear what this means? The density matrix $\rho$ describes a (possibly mixed) state of a quantum system. But I can also interpret $\phi$ as a single state vector, describing a quantum system in a pure state.
So, what does $\rho\phi$ refer to (where $\rho \in \mathbb{C}^{n \times n}$ is a density matrix, and $\phi \in \mathbb{C}^n$ is an element of $\mathcal{H}_A$)? Can I interpret it? How can a density matrix (i.e., the representation of a state) act on states (on single state vectors)? Why do we interpret density matrices (which represent states) as operators?
"
"['error-correction', 'stabilizer-code']"," Title: Are all $[[n, k, d]]$ quantum codes equivalent to additive self-orthogonal $GF(4)^n$ classical codes?Body: Theorem 2 of [1] states:
Suppose $C$ is an additive self-orthogonal sub-code of $\textrm{GF}(4)^n$, containing $2^{n-k}$ vectors, such that there are no vectors of weight $<d$ in $C^\perp/C$. Then any eigenspace of $\phi^{-1}(C)$ is an additive quantum-error-correcting code with parameters $[[n, k, d]]$.
where here $\phi: \mathbb{Z}_2^{2n} \rightarrow \textrm{GF}(4)^n$ is the map between the binary representation of $n$-fold Pauli operators and their associated codeword, and $C$ is self-orthogonal if $C \subseteq C^\perp$ where $C^\perp$ is the dual of $C$.
This tells us that each additive self-orthogonal $\textrm{GF}(4)^n$ classical code represents a $[[n, k, d]]$ quantum code.
My question is whether the reverse is also true, that is: is every $[[n, k, d]]$ quantum code represented by an additive self-orthogonal $\textrm{GF}(4)^n$ classical code?
Or equivalently: Are there any $[[n, k, d]]$ quantum codes that are not represented by an additive self-orthogonal $\textrm{GF}(4)^n$ classical code?
[1]: Calderbank, A. Robert, et al. ""Quantum error correction via codes over GF (4)."" IEEE Transactions on Information Theory 44.4 (1998): 1369-1387.
"
"['mathematics', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.1 - ""Linear dependence: example""Body: Reproduced from Exercise 2.1 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition):
Show that $(1, −1)$, $(1, 2)$ and $(2, 1)$ are linearly dependent.
Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.
"
"['entanglement', 'qudit']"," Title: What are the differences between ""$n$-th level e-bits"" and ""$n$-th level qunits""?Body: I have seen qubits, qutrits & entangled bits (e-bits) a decent amount. I have also seen qunits/qudits for n-th level qubits. What I am trying to wrap my head around is the differences between n-th level e-bits vs n-th level qunits. What are the similarities? Differences?
What generalizations exist about n-th level e-bits / qunits?
"
"['entanglement', 'quantum-state', 'qudit']"," Title: How to show that an n-level system is entangled?Body: ""How do I show that a two-qubit state is an entangled state?"" includes an answer which references the Peres–Horodecki criterion. This works for $2\times 2$ and $2\times3$ dimensional cases; however, in higher dimensions, it is ""inconclusive."" It is suggested to supplement with more advanced tests, such as those based on entanglement witness. How would this be done? Are there alternative ways to go about this?
"
"['experiment', 'optical-quantum-computing', 'continuous-variable']"," Title: Is ""probabilitistic,universal, fault tolerant quantum computation"" possible with continuous values?Body: It seems to be a widely held belief within the scientific community that it is possible to do ""universal, fault-tolerant"" quantum computation using optical means by following what is called ""linear optical quantum computing (LOQC)"" pioneered by KLM (Knill, Laflamme, Milburn). However, LOQC uses only modes of light that contain either zero or one photon, not more.
Continuous modes of light contain, by definition, much more than one photon. The paper Probabilistic Fault-Tolerant Universal Quantum Computation and Sampling Problems in Continuous Variables Douce et al. (2018) [quant-ph arXiv:1806.06618v1] claims ""probabilistic universal fault-tolerant"" quantum computation can also be done using continuous modes of squeezed light. The paper goes even further and claims it is possible to demonstrate quantum supremacy using continuous modes. In fact, the paper's abstract says:
Furthermore, we show that this model can be adapted to yield sampling
problems that cannot be simulated efficiently with a classical
computer, unless the polynomial hierarchy collapses.
A quantum computing startup called Xanadu that has some credibility because it has written several papers with Seth Lloyd, seems to be claiming that they too will ultimately be able to do quantum computation with continuous modes of light, and perform some tasks better than a classical computer.
And yet, what they are doing seems to me to be analog computing (is fault tolerant error correction possible for analog computing?). Also, they use squeezing and displacement operations. Such operations do not conserve energy (squeezing or displacing a mode can change its energy), so such operations seem to require exchanges of macroscopic amounts (not quantized amounts) of energy with an external environment, which probably can introduce a lot of noise into the qc. Furthermore, squeezing has only been achieved in the lab for limited small values, and a claim of universality might require arbitrary large squeezing as a resource.
So, my question is, are these people being too optimistic or not? What kind of computing can be done realistically in the lab with continuous modes of light?
"
"['entanglement', 'qudit', 'qutrit', 'matrix-representation']"," Title: Difference between 3 qubits, 2 qutrits & 1 six level qunitBody: What is the difference between 3 qubits, 2 qutrits and a 6th level qunit? Are they equivalent? Why / why not?
Can 6 classical bits be super-densely coded into each?
"
"['communication', 'applications', 'quantum-networks']"," Title: How could a global quantum network be realized?Body: This article from 2017 predicts the quantum internet by 2030. What are the biggest bottlenecks in the realization of a global quantum network (ie quantum internet)?
"
"['mathematics', 'matrix-representation', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.2 - “Matrix representations: example”Body: Reproduced from Exercise 2.2 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition):
Suppose $V$ is a vector space with basis vectors $|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$. Give a matrix representation for $A$, with respect to the input basis $|0\rangle, |1\rangle$, and the output basis $|0\rangle, |1\rangle$. Find input and output bases which give rise to a different matrix representation of $A$.
Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.
"
"['entanglement', 'quantum-state']"," Title: Are Absolutely Maximally Entangled states maximally entangled under all entanglement monotones?Body: In Ref. [1] absolutely maximally entangled (AME) states are defined as:
An $\textrm{AME}(n,d)$ state (absolutely maximally entangled state) of $n$ qudits of dimension $d$, $|\psi\rangle \in \mathbb{C}^{\otimes n}_d$, is a pure state for which every bipartition of the system into the sets $B$ and $A$,
with $m = |B| \leq |A| = n − m$, is strictly maximally entangled such that
$$
S(\rho_B) = m \log_2 d.
$$
As the name would have you believe, does this mean that an $\textrm{AME}(n,d)$ state is maximally entangled across all entanglement monotones (for fixed $n$ and $d$)?
[1]: Helwig, Wolfram, et al. ""Absolute maximal entanglement and quantum secret sharing."" Physical Review A 86.5 (2012): 052335.
"
['quantum-networks']," Title: Does the no-cloning theorem impose limits on the capabilities of quantum networks?Body: Quantum networks or quantum internet are terms that can be found when reading about quantum computation and information nowadys, but still I they are pretty vague concepts that are still in development.
I was wondering about the fact that this networks or internet would be pretty limited in communications between several computers as sending redundant information to several of them would be prohibited because of the no-cloning theorem. That would mean that only point-to-point communications could be done in quantum network. Moreover, once sent the information cannot be sent again as no copies of it are remaining, and so the communication could be done just once or the state should be created again by doing the same computations as before each time we want to send it. This sounds pretty inefficient coparing to the classical networks and internet.
Am I right about this thought or am I missing something?
"
"['decoherence', 'solid-state']"," Title: What's the Difference between T2 and T2*?Body: $T_2$ generally refers to the measurement of the coherence of the qubit with respect to its dephasing (that's a rotation through the $|0\rangle$ - $|1\rangle$ axis of the Bloch sphere for those of us visualizing). But sometime in the literature, it's called $T_2$ and other times it's referred to as $T_2^*$. The fact that it is never explained leads me to believe the distinction is very simple. What's the distinction between these two concepts?
I assert that this nomenclature is very common in the literature (at least regarding solid-state QC). Here is one example: Ultralong spin coherence time in isotopically engineered diamond.
My internet search for an explanation has come up dry. Please help.
"
"['algorithm', 'ibm-q-experience', 'qiskit', 'hhl-algorithm']"," Title: Quantum algorithm for linear systems of equations (HHL09): Step 2 - Preparation of the initial states $|\Psi_0\rangle$ and $|b\rangle$Body: This is a continuation of Quantum algorithm for linear systems of equations (HHL09): Step 2 - What is $|\Psi_0\rangle$?
In the paper: Quantum algorithm for linear systems of equations (Harrow, Hassidim & Lloyd, 2009), the details of the actual implementation of the algorithm is not given. How exactly the states $|\Psi_0\rangle$ and $|b\rangle$ are created, is sort of a ""black-box"" (see pages 2-3).
$$|\Psi_0\rangle = \sqrt{\frac{2}{T}}\sum_{\tau = 0}^{T-1}\sin \frac{\pi (\tau+\frac{1}{2})}{T}|\tau\rangle$$
and $$|b\rangle = \sum_{1}^{N}b_i|i\rangle$$
where $|\Psi_0\rangle$ is the initial state of the clock register and $|b\rangle$ is the initial state of the Input register.
(Say) I want to carry out their algorithm on the IBM $16$-qubit quantum computer. And I want to solve a certain equation $\mathbf{Ax=b}$ where $\mathbf{A}$ is a $4\times 4$ Hermitian matrix with real entries and $\mathbf{b}$ is a $4\times 1$ column vector with real entries.
Let's take an example:
$$\mathbf{A} = \begin{bmatrix} 1 & 2 & 3 & 4 \\ 2 & 1 & 5 & 6 \\ 3 & 5 & 1 & 7 \\ 4 & 6 & 7 & 1 \end{bmatrix}$$
and
$$\mathbf{b}=\begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix}$$
Given the dimensions of $\mathbf{A}$ and $\mathbf{b}$, we should need $\lceil{\log_2 4\rceil}=2$ qubits for the input register and another $6$ qubits for the clock register assuming we want the eigenvalues to be represented with $90\%$ accuracy and up to $3$-bit precision for the eigenvalues (this has been discussed here previously). So total $2+6+1=9$ qubits will be needed for this purpose (the extra $1$ qubit is the ancilla).
Questions:
- Using this information, is it possible to create the initial states $|\Psi_0\rangle$ and $|b\rangle$ on the IBM $16$ qubit version?
- If you think $4\times 4$ is too large to be implemented on the IBM quantum computers you could even show an example of initial state preparation for a $2\times 2$ Hermitian matrix $\mathbf{A}$ (or just give a reference to such an example).
I simply want to get a general idea about whether this can be done (i.e. whether it is possible) on the IBM 16-qubit quantum computer, and for that which gates will be necessary. If not the IBM 16-qubit quantum computer, can the QISKit simulator used for recreating the initial state preparation of $|\Psi_0\rangle$ and $|b\rangle$ in the HHL algorithm? Is there any other better alternative to go about this?
"
"['algorithm', 'quantum-gate', 'quantum-state', 'measurement']"," Title: Use of change of phase gatesBody: As explained in this this answer, when we have different (relative) phases between two states, those two states will yield the same probabilities when measured in the same basis but different probabilities when measured in different bases.
My question is why would we need to do measurement in different bases?
I'm asking from a quantum programming point of view. Why would I need to change the (relative) phase of two states when writing a program?
One constraint though: I don't understand how to read a Bloch sphere so the matrix and circuit formalisms are preferred.
"
"['physical-qubit', 'quantum-state']"," Title: How is a single qubit fundamentally different from a classical coin spinning in the air?Body: I had asked this question earlier in the comment section of the post: What is a qubit? but none of the answers there seem to address it at a satisfactory level.
The question basically is:
How is a single qubit in a Bell state
$\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ any different from a
classical coin spinning in the air (on being tossed)?
The one-word answer for difference between a system of 2 qubits and a system of 2 classical coins is ""entanglement"". For instance, you cannot have a system of two coins in the state $\frac{1}{\sqrt 2}|00\rangle+\frac{1}{\sqrt 2}|11\rangle$. The reason is simple: when two ""fair"" coins are spinning in air, there is always some finite probability that the first coin lands heads-up while the second coin lands tails-up, and also the vice versa is true. In the combined Bell state $\frac{1}{\sqrt 2}|00\rangle+\frac{1}{\sqrt 2}|11\rangle$ that is not possible. If the first qubit turns out to be $|0\rangle$, the second qubit will necessarily be $|1\rangle$. Similarly, if the first qubit turns out to be $|1\rangle$, the second qubit will necessarily turn out to be $|1\rangle$. At, this point someone might point out that if we use $2$ ""biased"" coins then it might be possible to recreate the combined Bell state. The answer is still no (it's possible to mathematically prove it...try it yourself!). That's because the Bell state cannot be decomposed into a tensor product of two individual qubit states i.e. the two qubits are entangled.
While the reasoning for the 2-qubit case is understandable from there, I'm not sure what fundamental reason distinguishes a single qubit from a single ""fair"" coin spinning in the air.
This answer by @Jay Gambetta somewhat gets at it (but is still not satisfactory):
This is a good question and in my view gets at the heart of a qubit.
Like the comment by
@blue,
it's not that it can be an equal superposition as this is the same as
a classical probability distribution. It is that it can have negative
signs.
Take this example. Imagine you have a bit in the $0$ state and then
you apply a coin flipping operation by some stochastic matrix
$\begin{bmatrix}0.5 & 0.5 \\0.5 & 0.5 \end{bmatrix}$ this will make a
classical mixture. If you apply this twice it will still be a
classical mixture.
Now lets got to the quantum case and start with a qubit in the $0$
state and apply a coin flipping operation by some unitary matrix
$\begin{bmatrix}\sqrt{0.5} & \sqrt{0.5} \\\sqrt{0.5} & -\sqrt{0.5}
\end{bmatrix}$. This makes an equal superposition and you get random
outcomes like above. Now applying this twice you get back the state
you started with. The negative sign cancels due to interference which
cannot be explained by probability theory.
Extending this to n qubits gives you a theory that has an exponential
that we can't find efficient ways to simulate.
This is not just my view. I have seen it shown in talks of Scott
Aaronson and I think its best to say quantum is like “Probability
theory with Minus Signs” (this is a quote I seen Scott make).
I'm not exactly sure how they're getting the unitary matrix $\begin{bmatrix}\sqrt{0.5} & \sqrt{0.5} \\\sqrt{0.5} & -\sqrt{0.5} \end{bmatrix}$ and what the motivation behind that is. Also, they say: ""The negative sign cancels due to interference which can not be explained by probability theory."" The way they've used the word interference seems very vague to me. It would be useful if someone can elaborate on the logic used in that answer and explain what they actually mean by interference and why exactly it cannot be explained by classical probability. Is it some extension of Bell's inequality for 1-qubit systems (doesn't seem so based on my conversations with the folks in the main chat though)?
"
"['physical-realization', 'classical-computing']"," Title: Are we certain that quantum computers are more efficient than classical computers can be built?Body: I mean are we certain that they will be able to provide us a huge improvements (in some tasks) compared to clasical computers?
"
"['algorithm', 'entanglement', 'measurement']"," Title: Realization of Quantum ShadowgraphyBody: I recently found out about shadowgraphy and was wondering if a technique like this could be used to:
- Visually show entanglement
- Suffice as a measure (e.g. continous partial trace)
- Most useful applications
Resources
"
"['measurement', 'shors-algorithm']"," Title: Measuring ancillas in Shor's algorithmBody: When considering Shor's algorithm, we use ancilla qubits to effectively obtain the state
$$\sum_x \left|x,f(x)\right>$$
for the function $f(x) = a^x \mod N$.
As I have learned it, we then measure the ancilla qubits, to obtain, say $f(x) = b$ and get the state
$$\sum_{x\mid f(x) = b} \left|x,f(x)\right>.$$
Then applying a QFT will give the period. However, I think that the measurement of the ancilla qubits is not necessary, in order to be able to apply the QFT (or its inverse for that matter) and do a measurement to obtain the period.
Is that correct? Is it necessary to measure the ancilla qubits in Shor's algorithm?
"
"['quantum-gate', 'quantum-state', 'programming', 'qiskit']"," Title: One-qubit gate results in QISKitBody: I found it odd that the result of the action of identity gate (namely a $2\times2$ identity matrix) on a pure state $|0\rangle$ (namely the vector corresponding to the $2\times1$ matrix $\begin{bmatrix} 1\\0 \end{bmatrix}$) becomes a $2\times2$ matrix $\begin{bmatrix} 1+0\cdot i&0+0\cdot i\\0+0\cdot i&1+0\cdot i \end{bmatrix}=\begin{bmatrix} 1&0\\0&1 \end{bmatrix}$ as I found it HERE (QISKit tutorial page):
Also, when one lets for more precision, the result gets odd:
Why is this? The same thing happens for other gates listed on the page referenced above.
"
"['entanglement', 'qudit']"," Title: How to represent a qubyte?Body: I was not able to locate any visuals online. The visual I have in my head is a cube w/ bloch spheres as the eight vertices.
I am also curious about a matrix representation, although I am not sure how feasible this is as a qubyte has $2^8$ (256) states.
What is the best way to represent a qubyte?
"
"['algorithm', 'mathematics', 'randomised-benchmarking']"," Title: Quantum algorithm to evaluate numbers in fast growing hierarchyBody: What quantum technologies and/or techniques (if any) could be used to evaluate the value of large numbers in the fast growing hierarchy such as Tree(3) or SCG(13)?
"
"['quantum-gate', 'gate-synthesis']"," Title: Expressing ""Square root of Swap"" gate in terms of CNOTBody: How could a $\sqrt{SWAP}$ circuit be expressed in terms of CNOT gates & single qubit rotations?
- CNOT & $\sqrt{SWAP}$ Gates
Any quantum circuit can be simulated to an arbitrary degree of accuracy using a combination of CNOT gates and single qubit rotations.
Both CNOT and $\sqrt{SWAP}$ are universal two-qubit gates and can be transformed into each other.
Edit
The questions are not identical, and are likely to attract different audiences. -DaftWullie
Can the difference be regarded as applied vs theoretic?
"
"['quantum-gate', 'programming', 'qiskit', 'gate-synthesis', 'qasm']"," Title: Construct Controlled-$G^{\dagger}$ from known Controlled-$G$Body: Let there be a known a scheme (quantum circuit) of Controlled-G, where unitary gate G has G$^†$ such that G≠G$^†$ and GG$^†$=I (for example S and S$^†$, T and T$^†$, V and V$^†$, but not Pauli and H gates).
My question for the experts is:
How is correct that new scheme of Controlled-G$^†$ gate may be constructed from this known scheme of Controlled-G gate by reversing the order of used gates (U) and each U in this scheme changes to the corresponding U$^†$
(if U≠U$^†$ of course)?
For example, see below my OPENQASM-program (note that suffix 'dg' for gate name is used instead '$^†$'in OPENQASM), where it is used well-known scheme of Controlled-S gate and my scheme of Controlled-S$^†$ gate, constructed from this well-known scheme by the above method.
So far I have only received successful results of applying this method and have not found any obvious contradictions with the known theory [*], but suddenly I didn't take something into account.
My program in OPENQASM for example:
//Name of Experiment: Amy Matthew controlled-s and my controlled-sdg gates v7
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[3];
creg c[3];
gate cs a,b {
// a is control, b is target
// see https//uwspace.uwaterloo.ca/bitstream/handle/10012/7818/AmyMatthew.pdf
// fig.4.6b
cx b,a;
tdg a;
cx b,a;
t a;
t b;
}
gate csdg a,b {
// a is control, b is target
// my controlled-sdg (I hope that is reverse of controlled-s)
tdg b;
tdg a;
cx b,a;
t a;
cx b,a;
}
h q[0];
cx q[0],q[1]
;
x q[2];
h q[2];
barrier q;
cs q[0],q[2];
cs q[1],q[2];
barrier q;
csdg q[0],q[2];
csdg q[1]
,q[2];
barrier q;
h q[2];
measure q -> c;
[*]: Elementary gates for quantum computation Barenco et al. (1995)
"
"['mathematics', 'matrix-representation', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.3 - “Matrix representation for operator products”Body: Reproduced from Exercise 2.3 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition):
Suppose $A$ is a linear operator from vector space $V$ to vector space $W$, and $B$ is a linear operator from vector space $W$ to vector space $X$. Let $|v_i⟩$, $|w_j⟩$, and $|x_k⟩$ be bases for the vector spaces $V$, $W$, and $X$, respectively. Show that the matrix representation for the linear transformation $BA$ is the matrix product of the matrix representations for $B$ and $A$, with respect to the appropriate bases.
Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.
"
"['quantum-gate', 'ibm-q-experience']"," Title: Controlled-U operation in IBMQBody: Suppose we have any matrix in $\mathrm U(2)$ and we need to construct a Controlled-$U$ operation with the $H,T,S$ gates. Then I am aware of the construction given in N&C of decomposing $U$ into $e^{ia}AXBXC$. My question is how to implement gates $A,B,C$ using the gates from library set $\left\lbrace H,T,S,X,Y,Z\right\rbrace$.
Also, any sequence of the gates induces some phase to the matrix (while $A,B,C \in \mathrm{SU}(2)$), so how is that phase removed from the circuit?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Phase-Shift Gate in QiskitBody: How to implement the phase shift gate in qiskit or ibmq?
Phase Shift Gate : $$\begin{pmatrix}e^{ia} && 0 \\ 0 && e^{ia}\end{pmatrix} = e^{ia}I$$
"
"['quantum-gate', 'gate-synthesis', 'photonics']"," Title: What components are needed to realize a photonic CNOT gate?Body: In Realization of a photonic CNOT gate sufficient for quantum computation FIG. 1 there is a "scheme to obtain a photonic realization of a CNOT gate with two independent qubits."
What components are needed to realize a photonic CNOT gate?
"
"['algorithm', 'quantum-gate', 'gate-synthesis', 'hamiltonian-simulation']"," Title: How to implement a matrix exponential in a quantum circuit?Body: Maybe it is a naive question, but I cannot figure out how to actually exponentiate a matrix in a quantum circuit.
Assuming to have a generic square matrix A, if I want to obtain its exponential, $e^{A}$, i can use the series
$$e^{A} \simeq I+ A+\frac{A^2}{2!}+\frac{A^3}{3!}+...$$
To have its approximation. I do not get how to do the same using quantum gates then apply it for instance to perform an Hamiltonian simulation. Some help?
"
"['mathematics', 'matrix-representation', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.4 - “Matrix representation for identity”Body: Reproduced from Exercise 2.4 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition):
Show that the identity operator on a vector space $V$ has a matrix representation which is one along the diagonal and zero everywhere else, if the matrix representation is taken with respect to the same input and output bases. This matrix is known as the identity matrix.
Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.
"
"['algorithm', 'quantum-advantage', 'randomised-benchmarking']"," Title: How to benchmark a quantum computer?Body: Using a simple puzzle game to benchmark quantum computers is the most clever approach I have seen so far.
The author of the aforementioned article, James, makes a nice analogy to buying a laptop (""more than just a single number when comparing"") in an answer to How should different quantum computing devices be compared?.
Another answer by whurley to the same question mentions the IEEE Standard for Quantum Computing Performance Metrics & Performance Benchmarking.
In When will we know that quantum supremacy has been reached? there is an answer by Niel which includes this snippet:
But the bottom line is that, yes, ""quantum supremacy"" is precisely about ""not being able to simulate quantum computers of certain sizes"", or at least not being able to simulate certain specific processes that you can have them perform, and this benchmark depends not only on quantum technology but on the best available classical technology and the best available classical techniques. It is a blurry boundary which, if we are being serious about things, we will only be confident that we have passed a year or two after the fact. But it is an important boundary to cross.
My question is bipartite:
- What will be the primary metrics for quantum computers? (Clasical examples include processor speed, RAM & hard drive space)
- Best tools / strategies for benchmarking above metrics? (Existing or proposed)
"
"['quantum-gate', 'circuit-construction', 'hamiltonian-simulation']"," Title: How are two different registers being used as ""control""?Body: On page 2 of the paper Quantum Circuit Design for Solving Linear Systems of Equations (Cao et al.,2012) there's this circuit:
It further says:
After the inverse Fourier transform is executed on register $C$, we
use its $|\lambda_j\rangle$ states stored in register $C$ as a
control for a Hamiltonian simulation $\exp(iH_0t_0)$ that is applied
on register $M$.
But then again:
We further establish the control relation between Register $L$ and
$\exp[-ip\left(\dfrac{\lambda_j}{2^m}\dfrac{1}{2^{l-k_l}}\right)t_0]$
simulation that acts on register $M$. The values of the binary numbers
stored in register $L$ are then able to determine the time parameter
$t$ in overall Hamiltonian simulation $\exp(-iH_0t)$.
From here, I'm a bit confused which register of qubits is being used to control the Hamiltonian simulation $\exp(-iH_0t)$. Are both registers: $L$ and $C$ being used as ""control""? How does control by multiple registers work? (I only know how control by a single register of qubits works, as of now)
"
"['error-correction', 'stabilizer-code']"," Title: What is a Bacon-Shor code and what is its significance?Body: I'm at the AQC conference at NASA and everybody seems to suddenly be talking about the Bacon-Shor code but there is no Wikipedia page and the pdf that I gave a link to does not really explain what it is and how it works.
How does it compare to the Shor code ?
"
"['programming', 'q#', 'density-matrix', 'bloch-sphere']"," Title: From Q# measurements to Bloch sphereBody: I would like to represent the state of a qubit on a Bloch sphere from the measurements made with Q#.
According the documentation, it is possible to measure a qubit in the different Pauli bases (PauliX, PauliY, PauliZ). This returns Zero if the +1 eigenvalue is observed, and One if the −1 eigenvalue is observed.
I can repeat this several times to find the probabilities for each base. Unfortunately, from there, I don't know how to calculate the density matrix or the X, Y, Z coordinates needed to plot the Bloch sphere.
Is it possible to find the density matrix or the X, Y, Z coordinates from these measurements? If yes, how ?
"
"['classical-computing', 'applications', 'history']"," Title: Is quantum computing just pie in the sky?Body: I have a computer science degree. I work in IT, and have done so for many years. In that period ""classical"" computers have advanced by leaps and bounds. I now have a terabyte disk drive in my bedroom drawer amongst my socks, my phone has phenomenal processing power, and computers have revolutionized our lives.
But as far as I know, quantum computing hasn't done anything. Moreover it looks like it's going to stay that way. Quantum computing has been around now for the thick end of forty years, and real computing has left it in the dust. See the timeline on Wikipedia, and ask yourself where's the parallel adder? Where's the equivalent of Atlas, or the MU5? I went to Manchester University, see the history on the Manchester Computers article on Wikipedia. Quantum computers don't show similar progress. Au contraire, it looks like they haven't even got off the ground. You won't be buying one in PC World any time soon.
Will you ever be able to? Is it all hype and hot air? Is quantum computing just pie in the sky? Is it all just jam-tomorrow woo peddled by quantum quacks to a gullible public? If not, why not?
"
"['quantum-gate', 'quantum-state']"," Title: What are the P(0) and P(1) probabilities for the T transformation in quantum computing?Body: I'm just starting of on quantum computing, specifically following the IBM Q Experience documentation [1]. In here, they are explaining the following experiment:
$T|+\rangle$
The expected outcomes according to the document:
- Phase angle: $\pi/4$
- Gates: $T$
- Prob 0: 0.8535533
- Prob 1: 0.1464466
- X-length: 0.7071067
I'm trying to deduce this with math.
$T |+\rangle = \begin{bmatrix}1 & 0 \\ 0 & e^{i\pi/4}\end{bmatrix} {1\over\sqrt 2} \begin{bmatrix} 1 \\ 1 \end{bmatrix} = {1\over\sqrt 2} \begin{bmatrix}1\\e^{i\pi/4}\end{bmatrix}$
I think I now need to split this out in $|0\rangle$ and $|1\rangle$ so that I get the quantum amplitudes:
$ = {1\over\sqrt 2} \begin{bmatrix}1\\0\end{bmatrix} + {1\over\sqrt 2} e^{i\pi/4} \begin{bmatrix}0 \\1 \end{bmatrix}$
Here things are falling apart, as
$ P(0) = |{1\over\sqrt 2}|^2 = 0.5 $
$ P(1) = |{1\over\sqrt 2} e^{i\pi/4}|^2 = 0.5 $
So my question: How do I correctly calculate the probabilities and the X-length?
[1]: IBM Q: User Guide / The Weird and Wonderful World of the Qubit / Introducing Qubit Phase
"
"['mathematics', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.5 - Inner products of complex vectorsBody: Reproduced from Exercise 2.5 of Nielsen & Chuang’s Quantum Computation and Quantum Information (10th Anniversary Edition):
A function $(\cdot, \cdot)$ from $V × V$ to $C$ is an inner product if it satisfies the requirements:
(1) $(\cdot, \cdot)$ is linear in the second argument,
$$
\left(|v⟩, \sum_iλ_i|w_i⟩\right) = \sum_i λ_i (|v⟩, |w_i⟩).
$$
(2) $(|v⟩,|w⟩)=(|w⟩,|v⟩)^∗$.
(3) $(|v⟩, |v⟩) ≥ 0$ with equality if and only if $|v⟩ = 0$.
For example, $C^n$ has an inner product defined by
$$
((y_1,...,y_n),(z_1,...,z_n)) ≡ \sum_i y_i^* z_i = \begin{bmatrix} y_1 & \ldots & y_n\end{bmatrix}\begin{bmatrix} z_1 \\ \vdots \\ z_n\end{bmatrix}.
$$
Verify that $(·, ·)$ just defined is an inner product on $C^n$.
Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.
"
"['quantum-gate', 'bloch-sphere']"," Title: What is the relation between these two forms of a single-qubit unitary operation?Body: I want to understand the relation between the following two ways of deriving a (unitary) matrix that corresponds to the action of a gate on a single qubit:
1) HERE, in IBM's tutorial, they represent the general unitary matrix acting on a qubit as:
$$
U = \begin{pmatrix}
\cos(\theta/2) & -e^{i\lambda}\sin(\theta/2) \\
e^{i\phi}\sin(\theta/2) & e^{i\lambda+i\phi}\cos(\theta/2)
\end{pmatrix},
$$
where $0\leq\theta\leq\pi$, $0\leq \phi<2\pi$, and $0\leq \lambda<2\pi$.
This is derived algebraically using the definition of a unitary operator $U$ to be: $UU^{\dagger}=I$.
2) HERE (pdf), similar to Kaye's book An Introduction Quantum Computing, the same operator is calculated to be:
$$U=e^{i\gamma}\,R_{\hat n}(\alpha).$$
Here, $R_{\hat n}(\alpha)$ is the rotation matrix around an arbitrary unit vector (a vector on the Bloch sphere) as the axis of rotation for an angle $\alpha$. Also, $e^{i\gamma}$ gives the global phase factor to the formula(which is not observable after all). The matrix corresponding to this way of deriving $U$ is: $$e^{i\gamma}\cdot\begin{pmatrix} cos\frac{\alpha}{2}-i\,sin\frac{\alpha}{2}\,cos\frac{\theta}{2}&-i\,sin\frac{\alpha}{2}\,e^{-i\phi}\\ -i\,sin \frac{\alpha}{2}e^{i\phi}&cos\frac{\alpha}{2}+i\,sin\frac{\alpha}{2}\,cos\theta\end{pmatrix}.$$
This derivation is clearer to me since it gives a picture of these gates in terms of rotating the qubits on the Bloch sphere, rather than just algebraic calculations as in 1.
Question: How do these angles correlate in 1 and 2? I was expecting these two matrix to be equal to each other up to a global phase factor.
P.S.: This correspondence seems instrumental to me for understanding the U-gates defined in the tutorial (IBM).
"
['cryptography']," Title: How to justify post quantum encryption security?Body: Is there some definition or theorem about what a quantum computer can achieve from which post-quantum cryptographic schemes (eg lattice cryptography, but not quantum cryptography) can justify their security? I know the period finding function is capable of breaking RSA and discrete logs, but is it the only algorithm relevant to breaking encryption schemes? Can I say that if a scheme is not susceptible to the period finding function it is not susceptible to quantum computing? If not, is there some similar, alternative statement of the form ""if an encryption scheme cannot be broken by algorithm X, it cannot be broken by quantum computing""?
For example, is it sufficient to prove that an encryption scheme can only be broken by trying all possible keys, and the best that quantum computing can do in this regard is square root search time with Grover's algorithm?
"
"['complexity-theory', 'classical-computing', 'cryptography', 'qma']"," Title: What classical public key cryptography protocols exist for which hacking is QMA complete or QMA hard?Body: Such a public key cryptosystem would be ""quantum safe"" in the sense that quantum computers cannot efficiently solve QMA hard problems.
"
"['quantum-operation', 'communication', 'channel-capacity']"," Title: Advances in Quantum Channel CapacityBody: I have been reading about the Quantum Channel Capacity and it seems to be an open problem to find such capacity in general. Quantum capacity is the highest rate at which quantum information can be communicated over many independent uses of a noisy quantum channel from a sender to a receiver.
Known results on the field are the Hashing bound, which is a lower bound on such quantum capacity and which is given by the LSD (Lloyd-Shor-Devetak) theorem; or the HSW (Holevo-Schumacher-Westmoreland) theorem for classical capacity over quantum channels.
I was wondering if there have been any advances in what a general expression for the quantum capacity since the release of those theorems. A glimpse on the advance in such field is enough for me, or references to papers where such task is developed.
"
['density-matrix']," Title: Modeling energy relaxation effects with density matrix formalismBody: I know there are measures that can be taken to mitigate the effects of dephasing (I'm referring here to Dynamic Decoupling and the other ideas it led to). I find it surprising that there is no equivalent procedure to mitigate the effects of energy leakage. In principle, it seems like if you add energy to the system at the rate it leaves (due to interactions with the measurement equipment, etc) you could keep a qubit at the same energy level indefinitely. That is, $T_1 \to \infty$.
I know that just have the qubit at the correct energy probably isn't enough to ensure that it is in a pure state, so I want to try to formulate this idea using the density matrix formalism and try to see if there is any clever way to add the energy in such a way to keep the qubit in an initial .
I can't get started, so I'm asking for help. How would you model a system at constant energy, with energy leaving and entering at the same rate?
"
['measurement']," Title: How to check states?Body: I don't know much about physics so maybe the question is stupid, but I wonder how engineers detect that the state function did not collapse due to the environment while a calculation is performed? Theoretically, a measurement will break the system. Related is also the next question, how to detect that a calculation is finished? A measurement should also break the state function and thus break an ongoing calculation.
If one thinks further, how is it even possible to check whether the experimenter produced a certain quantum state? Maybe all the bits have a totally different state right from the start and you just know about that afterwards.
I seem to miss something because if this would be true, quantum computers would be in-practical. Is it like this: The experimenter takes a measurement periodically and hopes that the operation was successful?
"
['qudit']," Title: Are qudit graph states well-defined for non-prime dimension?Body: Qudit graph states are $d$-dimension generalisations of qubit graph states such that each state is represented by a weighted graph $G$ (with no self-loops) such that each edge $(i, j)$ is assigned a weight $A_{i, j} = 0,\ldots,d-1$.
The graph state associated with $G$ is then given by
$$
|G⟩ = \prod_{i>j} \textrm{CZ}_{i,j}^{A_{i,j}} |+⟩^{\otimes n},
$$
where $|+⟩ = F^\dagger|0⟩$ and $F$ is the Fourier gate
$$
F = \frac{1}{\sqrt{d}}\sum_{k=0}^{d-1} \omega^{kl}|k⟩⟨l|.
$$
In the literature on qudit graph states, there does not seem to be a consistency as to whether such states are defined only for $d$ prime or not.
For example, some sources only give the above definition for $d$ prime, such as
whereas some do not specify any such restriction, such as
So which is correct?
Are qudit graph states (well-)defined when the dimension is non-prime?
Also, if so, are they uniquely defined?
"
"['algorithm', 'circuit-construction']"," Title: Implementation of quantum adderBody: I'm looking at this paper and try to implement the Quantum adders they define myself.
Suppose we have a number $b=b_{n-1}\dots b_1b_0$ and they want to add a constant number $a=a_{n-1}\dots a_1a_0$.
They define
$$A_j = \Pi_{k=1}^{j+1} R_k^{a_{j+1-k}}, \quad R_k = \begin{pmatrix}1&0\\0&e^{i2\pi/2^k}\end{pmatrix}$$
The result can be obtained by first applying a QFT on all qubits, then apply $A_j$ on qubit $j$ and then apply an inverse QFT.
However, if I try to work this out for the simple case where $b=0$ and $a=1$, I end up with a quantum state
$$0.5\left|01\right> + (0.5+0.5i)\left|10\right> - 0.5i \left|11\right>.$$
Note in this case, $A_0 = Z$ and $A_1 = S$.
Is there an error in my calculation, or is the definition in the article not correct?
"
"['measurement', 'mathematics', 'technical-standards']"," Title: What are the standard eigenvalues in $\mathbb{C^2}\otimes\mathbb{C^2}$?Body: In $\mathbb{C^2}$, we generally take $+1$ and $-1$ as the standard eigenvalues, that's what Pauli-X, Pauli-Z measurements, etc will give us.
Is there a similar standard while measuring in the Bell basis and the computational basis in $\mathbb{C^2}\otimes\mathbb{C^2}$?
Of course, the actual eigenvalues don't matter, as long as we are talking about the same resolution of identity, but I was just wondering if there was a convention.
"
"['measurement', 'qudit']"," Title: Reverse Quantum Computing: How to unmeasure a qunitBody: After taking some measure, how can a qunit be ""unmeasured""? Is unmeasurement (ie reverse quantum computing) possible?
"
"['architecture', 'physical-realization', 'd-wave', 'chimera', 'pegasus']"," Title: What is D-Wave's ""Pegasus"" architecture?Body: How is D-Wave's Pegasus architecture different from the Chimera architecture?
"
"['quantum-gate', 'universal-gates']"," Title: How to prove/disprove universality for a set of gates?Body: A universal set of gates are able to mimic the operation of any other gate type, given enough gates. For example, a universal set of quantum gates are the Hadamard ( $H$ ), the $\pi/8$ phase shift ( $T$ ), and the $\mathrm{CNOT}$ gate. How would one disprove or prove universality of a set of gates such as $\{H,T\}$, $\{\mathrm{CNOT},T\}$, or $\{\mathrm{CNOT}, H\}$?
"
"['circuit-construction', 'photonics']"," Title: Photonic Circuit Idea (Does this already exist?)Body: I have had a few ideas for circuits that I would like to get feedback on (do such things already exist, what utility they serve, etc).
Any suggestions on how I might graphically render these?
Example:
Here i is the input & o is the output. The slash directly to the right of the input is a 50/50 beam splitter. The remaining slashes are mirrors.
If a pulse were directed in, the output would first recieve 50% of the beam. The other half of the beam would pass through into the reflective chamber. Upon completion of the loop, the beam would again reach the splitter. Again, half the beam (25%) would pass to the output while the other half (25%) looped thru the circuit.
This process could be run thru $n$ times until some desired outcome is reached.
Does this already exist? What is the utility (if any)?
"
"['programming', 'q#']"," Title: How do you send an array of qubits to an operation in Q#?Body: I have the following operation in my .qs files:
operation myOp(qubits: Qubit[]) : () {
// uses elements from the qubit array
}
How do I send an array of qubits to this in the driver file?
The following did not work:
Qubit[] qubits = new Qubit[2];
myOp.Run(sim, qubits);
I got the following error:
Driver.cs(13,32): error CS1503: Argument 2: cannot convert from 'Microsoft.Quantum.Simulation.Core.Qubit[]' to 'Microsoft.Quantum.Simulation.Core.QArray<Microsoft.Quantum.Simulation.Core.Qubit>' [/home/tinkidinki/Quantum/Warmup_Contest/BellState/BellState.csproj]
The build failed. Please fix the build errors and run again.
Also, as an aside: Would such a question be more suitable for this site, or for stack overflow?
"
['cryptography']," Title: What measures can be taken against attacks on cryptosystems by quantum computers other than just classifying research?Body: If quantum computers advance to the point where they can defeat RSA, DSA, SHA (and really all existing classical public key encryption or and authentication) then it appears that it would be impossible to make secure transactions on the internet.
It would be impossible to maintain the security of user accounts for social media, amazon, eBay, online banking, etc. It seems that the economic repercussions of this would be catastrophic on a global scale.
What measures can be taken against attacks on cryptosystems by quantum computers?
At lest for now, I see a big problem with giving an answer that involves saying we could just use quantum encryption algorithms. The main reason is that in order for the encryption to be effective the end users would have to be in possession of a quantum encrypt/decrypt device. Not a problem for a bank or Amazon on their end, but a big problem for a guy trying to order a pizza on his smart phone.
If end users were not actually in possession of a small quantum computer, and instead used a cloud based service to access a quantum device an attacker could just target the last segment of the transaction (between a cloud service and their device).
For end users to possess quantum crypto devices one would need to bring the cost down to a few hundred dollars max or the average person would not be able to afford it. Right now most quantum systems are priced in the hundreds of thousands or millions of dollars range.
Also, all of the viable quantum systems I have seen run near absolute zero. I don't know of anyone who makes a dilution refrigerator the size of a AA battery. So you couldn't perform transactions on portable devices.
Is the only option then to classify all quantum crypto research until these problems can be solved?
"
"['quantum-gate', 'mathematics', 'matrix-representation']"," Title: Projection operator on Time evolution OperatorBody: From a 9×9 Hamiltonian lying 9D space, I choose a certain subspace of 4D for designing a two qubit gate. Now the original unitary time evolution operator also lies in 9D space and it's a 9×9 size matrix. For action of unitary time evolution operator on the two qubit gate made out of 4D subspace it is required to project the unitary time evolution operator in the 4D subspace. After reviewing literature, I came across an article doing same thing with the use of projection operator.
My question- How to find the projection operator on the subspace?
Also I guess projection operator will be 4×4 matrix, so how will it act on the unitary time evolution operator which is a 9×9 matrix.
P.S.- I took the definition of projection operator from ""Quantum Computation and Quantum Information, Isaac Chuang and Michael Nielsen"".
"
"['programming', 'qiskit', 'q#']"," Title: Checking value of variable using quantum approachBody: A beginner question after watching few videos.
Say, var=a; var can be either of two values, a or b. Check what is the value of var, using Q#, QISKit or similar.
Any help/idea?
"
"['entanglement', 'qudit', 'graph-states']"," Title: Does local Clifford equivalence have a direct graphical representation for qudit graph states of non-prime dimension?Body: This question is a follow-up to the previous QCSE question: ""Are qudit graph states well-defined for non-prime dimension?"". From the question's answer, it appears that there is nothing wrong in defining graph states using $d$-dimensional qudits, however, it seems that other definitional aspects of graph-states do not similarly extend to non-prime dimension.
Specifically, for qubit graph states, one key aspect to their prevalence and use is the fact that: any two graph states are local Clifford equivalent if and only if there is some sequence of local complementations that takes one graph to the other (for simple, undirected graphs). Needless to say, this is an incredibly useful tool in analyses of quantum error correction, entanglement and network architectures.
When considering $n$-qudit graph states, the equivalent graph is now weighted with adjacency matrix $A \in \mathbb{Z}_d^{n \times n}$, where $A_{ij}$ is the weight of edge $(i,j)$ (with $A_{ij}=0$ indicating no edge exists).
In the qudit case, it was shown that LC equivalence can similarly be extended by the generalisation of local complementation ($\ast_a v$) and inclusion of an edge multiplication operation ($\circ_b v$), where:
\begin{align}
\ast_a v &: A_{ij} \mapsto A_{ij} + aA_{vi}A_{vj} \quad \forall\;\; i,j \in N_G(v), \;i \neq j \\
\circ_b v &: A_{vi} \mapsto bA_{vi} \quad\forall\;\; i \in N_G(v),
\end{align}
where $a, b = 1, \ldots, d-1$ and all arithmetic is performed modulo $p$.
Graphically, this is represented by the following operations (reproduced from Ref. 2):
However, if the graph state is defined on qudits of non-prime dimension, then we can see these operations (seem to) fail to represent LC-equivalence.
For example, take the qudit state $|G\rangle$ depicted the graph $G$ in Fig. 1, defined for qudit dimension $d=4$, and let $x=y=z=2$, such that $A_{12}=A_{13}=A_{14}=2$.
In this case performing $\circ_2 1$ then $A_{1i} \mapsto 2 \times 2 = 4 \equiv 0 \bmod 4 \;\forall\; i$, and hence qudit $1$ is disentangled from all other qudits using only local operations.
Clearly this is wrong and occurs because of the problem of zero divisors as mentioned in the previous questions' answer.
My question is: is there any set of graph operations that properly represent local Clifford equivalence for qudit graph states of non-prime dimension?
Note: I am primarily interested in operations that directly apply to a state's representation as a single weighted graph, rather than possible decompositions into multiple prime-dimensional graph states, as suggested in Sec. 4.3 of ""Absolutely Maximally Entangled Qudit Graph States"".
"
"['algorithm', 'quantum-gate', 'quantum-state', 'circuit-construction', 'hhl-algorithm']"," Title: How exactly is the stated composite state of the two registers being produced using the $R_{zz}$ controlled rotations?Body: This is a sequel to How are two different registers being used as "control"?
I found the following quantum circuit given in Fig 5 (page 6) of the same paper i.e. Quantum Circuit Design for Solving Linear Systems of Equations (Cao et al.,2012).
In the above circuit $R_{zz}(\theta)$ is $\left(\begin{matrix}e^{i\theta} & 0 \\ 0 & e^{i\theta}\end{matrix}\right)$
As @DaftWullie mentions here:
Frankly, I've no chance of getting there because there's an earlier
step that I don't understand: the output on registers $L, M$ after Figure
5. The circuit diagram and the claimed output don't match up (the claimed output being separable between the $L$ and $M$ registers, when
qubit $l−1$ of register $L$ should be entangled with those of register M.
I understand that after the Walsh-Hadamard transforms the state of register $L$ is $$\frac{1}{\sqrt{2^l}}\sum_{s=0}^{2^l-1}|s\rangle$$
and that of register $M$ is
$$\frac{1}{\sqrt{2^m}}\sum_{p=0}^{2^m-1}|p\rangle$$
But after that, I'm not exactly sure how they're applying the $R_{zz}$ rotation gates to get to $$\sum_s\sum_p|p\rangle \exp(i p/2^m t_0)|s\rangle$$
Firstly, are all the $R_{zz}$ gates acting on a single qubit i.e. the $l-1$th qubit in the register $L$? (Seems so from the diagram, but I'm not sure).
Secondly, it would be very helpful if some can write down the steps for how're they're getting to $\sum_s\sum_p|p\rangle \exp(i p/2^m t_0)|s\rangle$ using the controlled rotation gates.
"
"['quantum-state', 'quantum-fourier-transform', 'phase-estimation', 'phase-kickback']"," Title: Why does the ""Phase Kickback"" mechanism work in the Quantum phase estimation algorithm?Body: I've probably read the chapter The quantum Fourier transform and its applications from Nielsen and Chuang (10 th anniversary edition) a couple of times before and this took this thing for granted, but today, when I looked at it again, it doesn't seem obvious to me at all!
Here's the circuit diagram for the Phase estimation algorithm:
The first register having $t$ qubits is supposedly the ""control register"". If any of the qubit in the first register is in state $|1\rangle$ the corresponding controlled unitary gate gets applied to the second register. If it is in a state $|0\rangle$ then it doesn't get applied to the second register. If it is in a superposition of the two states $|0\rangle$ and $|1\rangle$ the action of the corresponding unitary on the second register can be determined by ""linearity"". Notice, that all the gates are acting only on the second register and none on the first register. The first register is supposed to be only a control.
However, they show that the final state of the first register as:
$$\frac{1}{2^{t/2}}\left(|0\rangle+\text{exp}(2\pi i
2^{t-1}\varphi)|1\rangle)(|0\rangle+\text{exp}(2\pi i
2^{t-2}\varphi)|1\rangle)...(|0\rangle+\text{exp}(2\pi i
2^{0}\varphi)|1\rangle\right)$$
I'm surprised as to why we consider there to be a change in the state of the first register of qubits at all, after the action of the Hadamard gates. The final state of the first register should just have been
$$\left(\frac{|0\rangle+|1\rangle}{\sqrt 2}\right)^{\otimes t}$$
isn't it? I say this because the first register is supposed to be a control only. I don't understand how or why the state of the first register should change when acting as a control.
I initially thought that considering the exponential factors to be part of the first register qubit states was only a mathematical convenience, but then it didn't make sense. State of a qubit or a system of qubits shouldn't depend upon what is mathematically convenient to us!
So, could someone please explain why exactly the state of the first register of qubits changes, even when it simply acts as a ""control"" for the second register? Is it just a mathematical convenience or is there something deeper?
"
"['error-correction', 'qudit', 'emulation']"," Title: Computing with Logical QunitsBody: What exactly is a logical (non-physical? error corrected?) qunit?
Can quantum systems be built exclusively w/ logical qunits?
"
['physical-realization']," Title: Scale for Quantum ComputingBody: Does something like Mohs' scale exist for quantum computing? (eg. classical = 0, hybrid = 5, pure quantum = 10)
Mohs' scale: a scale of hardness used in classifying minerals. It runs from 1 to 10 using a series of reference minerals, and a position on the scale depends on the ability to scratch minerals rated lower.
The idea came from seeing this answer which mentions ""Mohs' scale of Sci-fi hardness.""
"
"['non-locality', 'games']"," Title: Has anyone analyzed multi-round nonlocal games?Body: The traditional definition of a nonlocal game is restricted to having two players and one round (e.g., here), but it is natural to consider a more general class of games that may have more than two players and more than one round of questions. While there has been a lot of work dealing with games with more than two players, I have found very little on multi-round games. For instance, there is a recent preprent of Crépeau and Yang that gives a definition of a multi-party, multi-round non-signaling distribution and seems to describe a multi-round game (although the paper is written in the language of commitment schemes rather than games, so I'm not entirely sure my interpretation is correct).
Has there been any other work dealing with multi-round games? And is there a reason so much of the literature has focused on single-round games? Are multi-round games inherently ""no more interesting"" than single-round games from the perspective of understanding nonlocality?
"
"['algorithm', 'cryptography', 'cryptocurrency', 'quantum-money']"," Title: Can quantum money be reliably ""burned?""Body: One of the novel features of Bitcoin and other cryptocurrencies is that coins can be irrefutably "burned" or destroyed, by creating a transaction to send the money to a junk burn address.
Thinking similarly about quantum money - from knots, or hidden subspaces, Wiesner's currency, BBBW, etc. - has an "obvious" way to be destroyed. For example, given a legitimate Wiesner coin, by measuring in the "wrong" basis, the currency would be destroyed.
But it's not clear how to irrefutably prove that the coin was destroyed.
For example, if I have a Wiesner coin, and I tell the world that I've burned it, is there a way that I can do it so that others will believe me? Even if I'm the bank?
Edit
I think I first heard of this question in a fascinating and stimulating lecture by Or Sattath.
As an answer has suggested, clearly measuring a coin in a "burn basis" will burn it. That burn basis can even be orthogonal to the valid basis, maximally destroying the coin, I think.
Another option that comes to mind is for the bank to publish and broadcast, on a public classical channel, the correct basis for a serial number $s$. Thus, the secret is released, enabling anyone to clone the coin at will, and effectively destroying the unclonability, and hence uniqueness and value, of the coin.
Such an option (on a classical channel) is viable for Wiesner's currency, and the Hidden Subspaces currency, but I don't think for the Quantum Knots currency - there's no secret to be released on the Knots coin.
"
"['algorithm', 'resource-request']"," Title: Phononic Quantum ComputingBody: Google returns ""About 1 results"" for Quantum Computing with Sound.
The sole result links to an article entitled ""Physicists have designed the building blocks of quantum computer that works using sound""
From the abstract:
Sound can be just as quantum as light. But our toolbox for single quanta of sound, i.e. phonons, is currently insufficient.
Has anyone seen something like this before? Sounds interesting to me & am curious to find out more about ""phononic quantum computing"" & what advantages / disadvantages it has to offer.
"
"['quantum-state', 'photonics', 'contextuality', 'wigner-function']"," Title: What does negative probability represent?Body:
""Negative energies and probabilities should not be considered as nonsense. They are well-defined concepts mathematically, like a negative of money."" -Paul Dirac
The abstract from Photon-phonon-photon transfer in optomechanics states:
the Wigner function of the recovered state can have negative values at the origin, which is a manifest of nonclassicality of the quantum state
I recently learned about the Wigner function from this answer to a question I had asked about quantum shadowgraphy in which Ernesto says:
there are quantum states for which the Wigner function may be negative in some phase-space regions! This is an indication of non-classicality
... this negativity has been linked to contextuality
From an answer by Rob:
experimental schemes to reconstruct the generalized Wigner representation of a given density operator (representing mixed or pure quantum states)
The abstract from Negativity and contextuality are equivalent notions of nonclassicality states
We also demonstrate the impossibility of noncontextuality or nonnegativity in quantum theory
What is negative probability? Non-classicality? (Non)contextuality? Quasiprobability? Arbitrary multispin quantum states?
"
"['quantum-gate', 'matrix-representation']"," Title: What is the matrix of the iSwap gate?Body: Mostly I'm confused over whether the common convention is to use +$i$ or -$i$ along the anti-diagonal of the middle $2\times 2$ block.
"
['classical-computing']," Title: If quantum speed-up is due to the wave-like nature of quantum mechanics, why not just use regular waves?Body: The intuition I have for why quantum computing can perform better than classical computing is that the wavelike nature of wavefunctions allow you to interfere multiple states of information with a single operation, which theoretically could allow for exponential speedup.
But if it really is just constructive interference of complicated states, why not just perform this interference with classical waves?
And on that matter, if the figure-of-merit is simply how few steps something can be calculated in, why not start with a complicated dynamical system that has the desired computation embedded in it. (ie, why not just create ""analog simulators"" for specific problems?)
"
"['algorithm', 'quantum-walks']"," Title: Quantum walk with binary treeBody: I’m trying to grok quantum walks, and would like to create an example that walks a perfect binary tree to find the one and only marked leaf node. Is this possible? If so, suppose the depth of the tree is five. Would that require a circuit with five wires? Would it best be realized with a Discrete Time Quantum Walk, flipping a Hadamard Coin five times? Regardless of whether these questions are on the right track, and although I’ve read a lot of papers on the subject, I’m currently at a loss for how to implement what I’ve described. Any concrete pointers?
"
"['technologies', 'applications', 'nisq']"," Title: What use has quantum computing been?Body: Most of us on this site believe that quantum computing will work. However, let's play devil's advocate. Imagine that we suddenly hit some fundamental stumbling block that prevented further development towards a universal quantum computer. Perhaps we're limited to a NISQ device (Noisy, Intermediate Scale Quantum) of 50-200 qubits, for the sake of argument. The study of (experimental) quantum computing suddenly stops and no further progress is made.
What good has already come out of the study of quantum computers?
By this, I mean realisable quantum technologies, the most obvious candidate being Quantum Key Distribution, but also technical results that feed into other fields. Rather than simply a list of items, a brief description of each would be appreciated.
"
"['algorithm', 'hhl-algorithm', 'phase-estimation']"," Title: Quantum phase estimation and HHL algorithm - knowledge of eigenvalues required?Body: The quantum phase estimation algorithm (QPE) computes an approximation of the eigenvalue associated to a given eigenvector of a quantum gate $U$.
Formally, let $\left|\psi\right>$ be an eigenvector of $U$, QPE allows us to find $\vert\tilde\theta\rangle$, the best $m$ bit approximation of $\lfloor2^m\theta\rfloor$ such that $\theta \in [0,1)$ and
$$U\vert\psi\rangle = e^{2\pi i \theta} \vert\psi\rangle.$$
The HHL algorithm (original paper) takes as input a matrix $A$ that satisfy $$e^{iAt} \text{ is unitary } $$ and a quantum state $\vert b \rangle$ and computes $\vert x \rangle$ that encodes the solution of the linear system $Ax = b$.
Remark: Every hermitian matrix statisfy the condition on $A$.
To do so, HHL algorithm uses the QPE on the quantum gate represented by $U = e^{iAt}$. Thanks to linear algebra results, we know that if $\left\{\lambda_j\right\}_j$ are the eigenvalues of $A$ then $\left\{e^{i\lambda_j t}\right\}_j$ are the eigenvalues of $U$. This result is also stated in Quantum linear systems algorithms: a primer (Dervovic, Herbster, Mountney, Severini, Usher & Wossnig, 2018) (page 29, between equations 68 and 69).
With the help of QPE, the first step of HLL algorithm will try to estimate $\theta \in [0,1)$ such that $e^{i2\pi \theta} = e^{i\lambda_j t}$. This lead us to the equation
$$2\pi \theta = \lambda_j t + 2k\pi, \qquad k\in \mathbb{Z}, \ \theta \in [0,1)$$
i.e.
$$\theta = \frac{\lambda_j t}{2\pi} + k, \qquad k\in \mathbb{Z}, \ \theta \in [0,1)$$
By analysing a little the implications of the conditions $k\in \mathbb{Z}$ and $\theta \in [0,1)$, I ended up with the conclusion that if $\frac{\lambda_j t}{2\pi} \notin [0,1)$ (i.e. $k \neq 0$), the phase estimation algorithm fails to predict the right eigenvalue.
But as $A$ can be any hermitian matrix, we can choose freely its eigenvalues and particularly we could choose arbitrarily large eigenvalues for $A$ such that the QPE will fail ($\frac{\lambda_j t}{2\pi} \notin [0,1)$).
In Quantum Circuit Design for Solving Linear Systems of Equations (Cao, Daskin, Frankel & Kais, 2012) they solve this problem by simulating $e^{\frac{iAt}{16}}$, knowing that the eigenvalues of $A$ are $\left\{ 1, 2, 4, 8 \right\}$. They normalised the matrix (and its eigenvalues) to avoid the case where $\frac{\lambda_j t}{2\pi} \notin [0,1)$.
On the other side, it seems like parameter $t$ could be used to do this normalisation.
Question: Do we need to know a upper-bound of the eigenvalues of $A$ to normalise the matrix and be sure that the QPE part of the HHL algorithm will succeed? If not, how can we ensure that the QPE will succeed (i.e. $\frac{\lambda_j t}{2\pi} \in [0,1)$)?
"
"['shors-algorithm', 'quantum-fourier-transform']"," Title: Simplified explanation of Shor/QFT transformation as thumbtackBody: As a non-mathematician/software programmer I'm trying to grasp how QFT (Quantum Fourier Transformation) works.
Following this YouTube video: https://www.youtube.com/watch?v=wUwZZaI5u0c
And this blogpost: https://www.scottaaronson.com/blog/?p=208
I've got a basic understanding on how you can calculate/construct the period using interference. But while trying to explain this to a colleague I ran into a problem. I used the following examples, N=15, a=7, so the period I'll need to find is r=4.
The pattern is:
7, 4, 13, 1, 7, 4, 13, 1, 7, 4, 13, 1 (etc)
If I imagine the wheel (like in the YouTube video) or a clock (like the blogpost) I can see that the circle with 4 dots/clock with 4 hours creates a constructive pattern and the others do not.
But what happens with a circle with 2 dots, or a clock with 2 hours, those will have get the same magnitude/constructive pattern as 4? It loops twice as fast, but other than that, same result?
How does the QFT cope with this?
(Bonus: Can you explain in laymans terms without too much complicated math?)
"
"['quantum-gate', 'gate-synthesis']"," Title: Square root of NOT as a time-dependent unitary matrixBody: I want to express the square root of NOT as a time-dependent unitary matrix such that each $n$ units of time, the square root of NOT is produced.
More precisely, I want to find a $U(t_0,t_1)$ such that $U(t_0,t_1) = \sqrt{\text{NOT}}$, if $t_1-t_0=n$ for some $n$.
One possible solution is to express $\sqrt{\text{NOT}}$ as a product of rotation matrices, and then, parametrize the angles in a clever way to depend on the time. But I do not know how to express $\sqrt{\text{NOT}}$ as a product of rotation matrices.
Any help?
"
"['algorithm', 'speedup', 'hhl-algorithm']"," Title: HHL algorithm -- why isn't the required knowledge on eigenspectrum a major drawback?Body: This question is a continuation of Quantum phase estimation and HHL algorithm - knowledge on eigenvalues required?.
In the question linked above, I asked about the necessity for HHL to have information on the eigenspectrum of the matrix $A$ considered.
It came out that the HHL algorithm needs a matrix with eigenvalues $\lambda_j \in [0,1)$ to work correctly.
Following this condition, given a matrix $A$, in order to apply the HHL algorithm we need to check one of the condition below:
- The eigenvalues of the matrix are all within $[0,1)$.
- A pair $(L,M) \in \mathbb{R}^2$ that bound (from below for $L$ and from above for $M$) the eigenvalues $\lambda_j$ of the matrix $A$. These bounds can be then used to rescale the matrix $A$ such that condition 1. is validated.
First group of questions: I read plenty of papers on HHL and none of them even mentioned this restriction. Why? Is this restriction known but considered weak (i.e. it's easy to have this kind of information)? Or the restriction was not known? Is there any research paper that mention this restriction?
Let's talk now about the complexity analysis of HHL. From Quantum linear systems algorithms: a primer (Dervovic, Herbster, Mountney, Severini, Usher & Wossnig, 2018), the complexity of HHL (and several improvements) is written in the image below.
The complexity analysis does not take into account (at least I did not find it) the necessary knowledge on the eigenspectrum.
The case where the considered matrix has sufficiently good properties to estimate its eigenvalues analytically is uncommon (at least for real-world matrices) and is ignored.
In this answer, @DaftWullie uses the Gershgorin's circle theorem to estimate the upper and lower bounds of the eigenspectrum. The problem with this approach is that it takes $\mathcal{O}(N)$ operations ($\mathcal{O}(\sqrt{N})$ if amplitude amplification is applicable). This number of operation destroys the logarithmic complexity of HHL (and it's only advantage over classical algorithms in the same time).
Second group of questions: Is there a better algorithm in term of complexity? If not, then why is the HHL algorithm still presented as an exponential improvement over classical algorithms?
"
"['algorithm', 'gate-synthesis', 'solovay-kitaev-algorithm']"," Title: Basic approximation in Solovay-Kitaev algorithmBody: I read the Solovay-Kitaev algorithm for approximation of arbitrary single-qubit unitaries. However, while implementing the algorithm, I got stuck with the basic approximation of depth 0 of the recursion.
Can someone help me on how to implement the basic approximation such that, given any $2 {\times} 2$ matrix in $\operatorname{SU}\left(2\right)$, it will return the sequence of gates from the set $\left\{H,T,S\right\}$ which approximate to about 0.00001 trace-norm distance of the arbitrary matrix?
Also, if I am using brute-force or kd trees, up to what gate length $l_0$ should I consider to obtain initial approximation of $0.00001$ for any arbitrary matrix in $\operatorname{SU}\left(2\right)$?
"
"['algorithm', 'physical-realization', 'speedup']"," Title: Is running a large random brute force on quantum computer possible at the moment?Body: I want to run a experiment like this:
- Generate a bunch of random 12-character passwords like $``\texttt{<Bb\{Q,r2Qp8`}"".$
- Write an algorithm to randomly generate & compare value on quantum computer.
- If the value was found, return number of time it take to generate, let's say $6102111820800.$
The only available quantum computer I know of is IBM's quantum computing cloud service.
Questions:
- Is it possible to run this program on existing quantum computers?
- If so, how fast would it be?
"
"['entanglement', 'quantum-state']"," Title: What are the possible ways to visualise large, entangled states?Body: What are the prominent visualizations used to depict large, entangled states and in what context are they most commonly applied?
What are their advantages and disadvantages?
"
"['classical-computing', 'programming', 'adiabatic-model', 'technologies']"," Title: Are quantum computers just a variant on Analog computers of the 50's & 60's that many have never seen nor used?Body: In the recent Question ""Is Quantum Computing just Pie in the Sky"" there are many responses regarding the improvements in quantum capabilities, however all are focussed on the current 'digital' computing view of the world.
Analog computers of old could simulate and compute many complex problems that fitted their operating modes that were not suitable for digital computing for many many years (and some are still 'difficult'). Before the wars (~I & II) everything was considered to be 'clockwork' with mechanical Turk brains. Have we fallen into the same 'everything digital' bandwagon trap that keeps recurring (there are no tags related to 'analog')?
What work has been done on the mapping of quantum phenomena to analog computing, and learning from that analogy? Or is it all a problem of folk having no real idea how to program the beasts.
"
"['d-wave', 'superconducting-quantum-computing', 'dilution-refrigerator']"," Title: What methods exist for cooling superconducting quantum computers?Body: Existing superconducting quantum computers need to be cooled near absolute zero. For example, some of D-Wave's machines are cooled to about $20 \ \mathrm {mK}$. Their design uses a dilution refrigerator.
Are there any other cooling methods for superconducting quantum computers besides dilution refrigerators which are capable of achieving such low temperatures?
Are there any specific commercial quantum computer designs or research projects using these other cooling methods?
"
"['bloch-sphere', 'majorana-particle', 'qutip']"," Title: Computing Majorana ""Stars""Body: I'm trying to implement Majorana's ""stellar representation"" of a spin-$j$ system as $2j$ points on the $2$-sphere in python. Consulting papers including Extremal quantum states and their Majorana constellations (Bjork et al., 2015), I convert a complex state vector (nominally indexed from -$j$ to $j$) to its corresponding polynomial with:
def vector_to_polynomial(vector):
components = vector.tolist()
j = (len(components)-1.)/2.
coeffs = []
i = 0
for m in numpy.arange(-1*j, j+1, 1):
coeff = math.sqrt(math.factorial(2*j)/(math.factorial(j-m)*math.factorial(j+m)))*components[i]
coeffs.append(coeff)
i += 1
return coeffs[::-1]
I use a polynomial solver to determine the roots, and stereographically project them to the $2$-sphere, taking into account when the degree of the polynomial is less than $2j$ by adjoining some poles (latter code not included).
def root_to_xyz(root):
if root == float('inf'):
return [0,0,1]
x = root.real
y = root.imag
return [(2*x)/(1.+(x**2)+(y**2)),\
(2*y)/(1.+(x**2)+(y**2)),\
(-1.+(x**2)+(y**2))/(1.+(x**2)+(y**2))]
See Wikipedia. Now QuTiP has an implementation of the Husimi Q function aka qutip.spin_q_function(state, theta, phi), evaluated at points on the sphere. The zeros of Husimi Q coincide with the Majorana stars. Comparing the results of the above with the QuTiP implementation, however, I find that they only match for integer spins, but not half-integer spins, aka for odd-dimensional systems, but not even dimensional systems. I've tried to code up a few other versions of the Majorana polynomial given in other papers, but the same problem seems to recur. Am I missing something more fundamental? Any advice is welcome!
"
['entanglement']," Title: How is entanglement achieved between two particles in quantum computing?Body: Many texts (especially meant for public consumption) discussing quantum mechanics tend to skim over exactly how entanglement is achieved. Even the Wikipedia article on quantum entanglement describes the phenomenon as follows:
""Quantum entanglement is a physical phenomenon which occurs when pairs or groups of particles are generated, interact, or share spatial proximity in ways such that the quantum state of each particle cannot be described independently of the state of the other(s)...""
This doesn't explain how the process actually comes into being. How are these particles ""generated,"" ""interact,"" or ""share spatial-proximity"" such that we can claim that two particles are entangled? What is the process?
"
"['quantum-gate', 'quantum-state', 'tensor-product', 'teleportation', 'communication']"," Title: How is the joint state of these qubits derived?Body: Can someone show to me the steps to derive the joint state at the bottom of this image, please?
I tried to follow his explanation but I didn't get the same results…
This is taken from the lecture notes of Ronald de Wolf in case it may help
"
['resource-request']," Title: Currently, what are the best structured courses available online on quantum computing?Body: As we make inroads into Machine Learning, there seem to be plenty of respectable courses available online via Coursera, edX, etc. on the topic. As quantum computing is still in its infancy, not to mention, incredibly daunting, it is vital that easy to understand, introductory courses are made available.
I was able to find these courses:
Quantum Information Science I, Part 1
Quantum Optics 1 : Single Photons
However, I am not certain how relevant the second course might be.
Obviously, this question may benefit from receiving answers in the near future as the topic steadily becomes mainstream.
"
"['algorithm', 'entanglement', 'teleportation']"," Title: When you act on a multi-qubit system with a 2-qubit gate, what happens to the third qubit?Body: I am learning to manipulate Qbits and recently I saw the teleportation algorithm. I read about it in two places: Wikipedia and Lecture Notes from Ronald de Wolf (Page 7, 1.5 Example: Quantum Teleportation).
I'd like to understand how to operate with Qbits using linear algebra when an entanglement is present. In this case, we have 3 Qbits.
- Qbit 1: in possession of Alice and is going to be teleported to Bob
- Qbit 2: in possession of Alice
- Qbit 3: in possession of Bob
Qbit 2 and 3 are in Bell state: $\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$.
The full state of three Qbits 1, 2, 3 is $(\alpha_0 |0\rangle+\alpha_1|1\rangle) \otimes \frac{1}{\sqrt2}(|00\rangle+|11\rangle)$. In an extended (more painful) notation it would be:
$$\frac{\alpha_0}{\sqrt2}|000\rangle + 0 \cdot |001\rangle + 0 \cdot|010\rangle+ \frac{\alpha_0}{\sqrt2}|011\rangle + $$
$$\frac{\alpha_1}{\sqrt2}|100\rangle + 0 \cdot|101\rangle + 0 \cdot|110\rangle+ \frac{\alpha_1}{\sqrt2}|111\rangle + $$
Now I'd like to apply a CNOT gate (Controlled Not) to Qbits 1 and 2, and finally H gate (Hadamard transform) to Qbit 1. I know how CNOT operation affects Qbit 1 and 2, but it's not completely clear how does it affect Qbit 3. I'm wondering what is the $8 \times 8$ Matrix that is applied to the state (in extended notation) when is applied CNOT on Qbit 1 and 2.
"
"['entanglement', 'speedup']"," Title: Is entanglement necessary for quantum computation?Body: Entanglement is often discussed as being one of the essential components that makes quantum different from classical. But is entanglement really necessary to achieve a speed-up in quantum computation?
"
"['algorithm', 'hhl-algorithm', 'quantum-enhanced-machine-learning']"," Title: HHL algorithm -- controlled-by-eigenvalues rotationsBody: All the references in this question refer to Quantum algorithm for solving linear systems of equations (Harrow, Hassidim & Lloyd, 2009).
The question I have is about the step where they apply controlled-rotations to transfer the eigenvalue encoded in a quantum register to the amplitudes of a state:
After the quantum phase estimation, the state of the quantum registers is (see page 3):
$$
\sum_{j=1}^{N} \sum_{k=0}^{T-1} \alpha_{k|j}\beta_j \vert \tilde\lambda_k\rangle \vert u_j \rangle
$$
Then, the HHL algorithm consists in applying rotations controlled by $\vert\tilde\lambda_k\rangle$ to produce the state
$$
\sum_{j=1}^{N} \sum_{k=0}^{T-1} \alpha_{k|j}\beta_j \vert \tilde\lambda_k\rangle \vert u_j \rangle \left( \sqrt{1 - \frac{C^2}{\tilde\lambda_k^2}} \vert 0 \rangle + \frac{C}{\tilde\lambda_k}\vert 1 \rangle \right)
$$
where ""$C = O(1/\kappa)$"" (still page 3).
My question: why do they introduce $C$? Isn't $C=1$ valid?
"
"['algorithm', 'hhl-algorithm', 'postselection']"," Title: HHL algorithm -- problem with the outcome of postselectionBody: See edit at the end of the question
All the references in this question refer to Quantum algorithm for solving linear systems of equations (Harrow, Hassidim & Lloyd, 2009).
HHL algorithm consists in an application of the quantum phase estimation algorithm (QPE), followed by rotations on an ancilla qubit controlled by the eigenvalues obtained as output of the QPE. The state of the quantum registers after the rotations is
$$
\sum_{j=1}^{N} \sum_{k=0}^{T-1} \alpha_{k|j}\beta_j \vert \tilde\lambda_k\rangle \vert u_j \rangle \left( \sqrt{1 - \frac{C^2}{\tilde\lambda_k^2}} \vert 0 \rangle + \frac{C}{\tilde\lambda_k}\vert 1 \rangle \right).
$$
Then, the algorithm just uncomputes the first register containing the eigenvalues ($\vert \tilde\lambda_k \rangle$) to give the state
$$
\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).
$$
Here, the notation used assumes that the QPE was perfect, i.e. the approximations were the exact values.
The next step of the algorithm is to measure the ancilla qubit (the right-most one in the sum above) and to select the output only when the ancilla qubit is measured to be $\vert 1 \rangle$. This process is also called ""post-selection"".
The state of the system after post-selecting (i.e. after ensuring that the measurement returned $\vert 1 \rangle$) is written
$$
\frac{1}{D}\sum_{j=1}^{N}\beta_j \frac{C}{\lambda_j} \vert u_j \rangle
$$
where $D$ is a normalisation constant (the exact expression can be found in the HHL paper, page 3).
My question: Why is the $\frac{C}{\lambda_j}$ coefficient still in the expression? From what I understood, measuring
$$
\left( \sqrt{1 - \frac{C^2}{\lambda_j^2}} \vert 0 \rangle + \frac{C}{\lambda_j}\vert 1 \rangle \right)
$$
should output $\vert 0 \rangle$ or $\vert 1 \rangle$ and destroy the amplitudes in front of those states.
EDIT: Specifying the question.
Following @glS' answer, here is the updated question:
Why does the post-selection works like described by @glS' answer and not like above?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: In amplitude amplification, how are the amplitudes of qubits changed?Body: I am relatively new to quantum computing and I feel like I don't fully understand the power of quantum computing due to a lack of understanding of how amplitude amplification works.
What is confusing me is that the amplitude of the qubit is the square root of the probability and so in amplitude amplification, how is the amplitude of the ""correct answer"" changed to negative (before then being reflected across the average)?
I understand that it is a gate and the gate is a series of complex operations but at the same time I fail to understand physically how do the gates change the amplitude of the qubit. I am referencing this in response to the webpage: IBM Q Experience Documentation - Grover's algorithm. Any help is greatly appreciated. Thank you!
"
['models']," Title: Chrononic Computing (Time Evolution Systems)Body: In a recent question about quantum speed-up @DaftWullie says:
My research, for example, is very much about "how do we design Hamiltonians $H$ so that their time evolution $e^{-iHt_0}$ creates the operations that we want?", aiming to do everything we can in a language that is "natural" for a given quantum system, rather than having to coerce it into performing a whole weird sequence of quantum gates.
This makes me think of chronons, which are a proposed quantum of time.
"There are physical limits that prevent the distinction of arbitrarily close successive states in the time evolution of a quantum system.
If a discretization is to be introduced in the description of a quantum system, it cannot possess a universal value, since those limitations depend on the characteristics of the particular system under consideration. In other words, the value of the fundamental interval of time has to change a priori from system to system."
Introduction of a Quantum of Time ("chronon"), and its Consequences for Quantum Mechanics
Is universal chrononic computing possible?
"
"['experiment', 'anyons', 'technologies']"," Title: Breakthroughs in quantum computing using non-standard quantaBody: It seems that quantum computers can be classified by the type of quantum they operate on. Not entirely sure what category most common current systems fall into (eg. D-Wave, Google, IBM, Microsoft). Photonic computing seems to be one of the more 'popular' alternative methods. Curious about other forms of unconventional quantum computing.
Quasi interested in a few different cases:
- Phonon - sound based
- Roton - vortex based
- Dropleton - quantum droplet*
- Fracton - fractal analog of phonons*
- Plasmon - plasma based
Also curious about chronons & virtual particles.
Have significant breakthroughs in quantum computing been made using non-standard quanta?
"
"['algorithm', 'entanglement', 'quantum-state', 'speedup', 'superposition']"," Title: Compact encoding of Boolean formula as oracleBody: As in the title, I have a doubt regarding the implementation of a boolean formula used as an oracle for a quantum algorithm.
The problem is that so far I could reproduce the formula as a quantum circuit relatively easily and then solve the related SAT using Grover search. However, if for instance I have 8 variables, I would need more or less twice the number of qubits to reproduce the formula (8 for introducing the variables, the others as workspace to perform the logic operations). Even though Grover search allows a quadratic speed up, I feel that implementing the oracle in this classical way is still a big hindrance in terms of qubits needed, given the fact that they are limited to small amounts.
I am trying to see if it is possible to encapsulate the 8 variables in 3 qubits so that using a Walsh-Hadamard transform I would have a superposition with $2^3=8$ possible states. 2 problems arise:
1) How could i perform the logical operations needed to represent the boolean formula?
2) Given a single qubit, I can look at it as a variable and assign true and false values to the states $\left|1\right>$ and $\left|0\right>$ respectively; however, if I use multiple qubits and put all of them in a superposition, when assigning each state to a specific variable I can no longer see if they are true or false by looking at the output states! How could I decide a true/false output in this case?
Do you guys think this is something feasible? I feel I am missing a key point in the process.
For instance $\left(x_1\cdot x_2\right)+\left(x_3\cdot x_1\cdot x_4\right)+\left(x_5\cdot x_6\right)$, where every variable $x_i \in \left\lbrace 0,1\right\rbrace$ and "" $\cdot$ "" stands for the logic AND operation and ""$+$"" for the logic OR.
"
"['algorithm', 'hhl-algorithm', 'applications']"," Title: What could be the possible future applications for HHL algorithm?Body: Note on the vocabulary: the word ""hamiltonian"" is used in this question to speak about hermitian matrices.
The HHL algorithm seems to be an active subject of research in the field of quantum computing, mostly because it solve a very important problem which is finding the solution of a linear system of equations.
According to the original paper Quantum algorithm for solving linear systems of equations (Harrow, Hassidim & Lloyd, 2009) and some questions asked on this site
the HHL algorithm is limited to some specific cases. Here is a summary (that may be incomplete!) of the characteristics of the HHL algorithm:
HHL algorithm
The HHL algorithm solves a linear system of equation
$$A \vert x \rangle = \vert b \rangle$$
with the following limitations:
Limitations on $A$:
Limitations on $\vert b \rangle$:
Limitations on $\vert x \rangle$ (output):
- $\vert x \rangle$ cannot be recovered fully by measurement. The only information we can recover from $\vert x \rangle$ is a ""general information"" (""expectation value"" is the term employed in the original HHL paper) such as $$\langle x\vert M\vert x \rangle$$
Question:
Taking into account all of these limitations and imagining we are in 2050 (or maybe in 2025, who knows?) with fault-tolerant large-scale quantum chips (i.e. we are not limited by the hardware), what real-world problems could HHL algorithm solve (including problems where HHL is only used as a subroutine)?
I am aware of the paper Concrete resource analysis of the quantum linear system algorithm used to compute the electromagnetic scattering cross section of a 2D target (Scherer, Valiron, Mau, Alexander, van den Berg & Chapuran, 2016) and of the corresponding implementation in the Quipper programming language and I am searching for other real-world examples where HHL would be applicable in practice. I do not require a published paper, not even an unpublished paper, I just want to have some examples of real-world use-cases.
EDIT:
Even if I am interested in every use-case, I would prefer some examples where HHL is directly used, i.e. not used as a subroutine of an other algorithm.
I am even more interested in examples of linear systems resulting of the discretisation of a differential operator that could be solved with HHL.
But let me emphasise one more time I'm interested by every use-case (subroutines or not) you know about.
"
"['algorithm', 'hhl-algorithm']"," Title: Why does the quantum linear inversion algorithm allow to implement $e^{-ig(\rho)}$ efficiently using multiple copies of $\rho$?Body: In (Lloyd et al. 2013), the authors write (beginning of page 3) that the quantum matrix inversion techniques presented by some of the same authors in (Harrow et al. 2008) allow to efficiently implement $e^{-ig(\rho)}$ for any simply computable function $g(x)$, using multiple copies of the density matrix $\rho$ (see (1) below for a bit more context).
Given that (Harrow et al. 2008) presents a quantum algorithm to obtain a state $|x\rangle$ proportional to $A^{-1}|b\rangle$ for a given $A$ and $|b\rangle$, it doesn't seem obvious to me how this can be used to compute $e^{-ig(\rho)}$.
To which techniques exactly are the authors referring to? And how are they applied to get the stated result?
(1)
More precisely, in the (Lloyd et al. 2013) paper, before making the statement that is the object of this question, the authors describe a method to construct $e^{-i\rho t}$, to accuracy $\epsilon$, using $n$ copies of $\rho$ with $n=O(t^2 \epsilon^{-1})$.
Moreover, what is meant by simply computable function does not seem to be explained in the paper.
"
"['mathematics', 'error-correction', 'pauli-gates']"," Title: Is the Pauli group for $n$-qubits a basis for $\mathbb{C}^{2^n\times 2^n}$?Body: The $n$-fold Pauli operator set is defined as $G_n=\{I,X,Y,Z \}^{\otimes n}$, that is as the set containing all the possible tensor products between $n$ Pauli matrices. It is clear that the Pauli matrices form a basis for the $2\times 2$ complex matrix vector spaces, that is $\mathbb{C}^{2\times 2}$. Apart from it, from the definition of the tensor product, it is known that the $n$-qubit Pauli group will form a basis for the tensor product space $(\mathbb{C}^{2\times 2})^{\otimes n}$.
I am wondering if the such set forms a basis for the complex vector space where the elements of this tensor product space act, that is $\mathbb{C}^{2^n\times 2^n}$. Summarizing, the question would be, is $(\mathbb{C}^{2\times 2})^{\otimes n}=\mathbb{C}^{2^n\times 2^n}$ true?
I have been trying to prove it using arguments about the dimensions of both spaces, but I have not been able to get anything yet.
"
"['quantum-gate', 'qiskit', 'matrix-representation']"," Title: 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?Body: I was reading the documentation for qiskit.QuantumCircuit and came across the functions cu1(theta, ctl, tgt) and cu3(theta, phi, lam, ctl, tgt). Looking at the names they seem to be controlled rotations. ctrl represents the controlled qubit and tgt represents the target qubit. However, what are theta, lambda and phi? They're rotations about which axes? Also, which rotation matrices are being used for cu1 and cu3?
"
"['programming', 'qiskit']"," Title: Is there a common set of modules for user-defining-quantum-gate for QISKitBody: I am wondering if there exists a common library or a set of modules for user-defining-quantum-gate for QISKit.
If it does, could you tell me?
By referring to Define Quantum Gates and How to define user's quantum gates?, I have created 6 modules for IBM Q simulator such as CZ gate and CCZ gate (uploaded here) since they were not built in QISKit standard gates.
However, since the gates such as CZ gate and CCZ gate seems pretty common to use, I am wondering if anybody already opens their gates to the public.
"
"['cryptocurrency', 'quantum-money']"," Title: Can a merchant who accepts a knot-based quantum coin mint her own knot-based coin?Body: Referring to Farhi, Gosset, Hassidim, Lutomirski, and Shor's ""Quantum Money from Knots,"" a mint $\mathcal{M}$ generates a run of coins, including, say, $(s,|\$\rangle)$, using a quantum computer to mint $|\$\rangle$ while publishing the public serial number $s$. A merchant $\mathcal{V}$ is able to verify that $|\$\rangle$ corresponds to $s$, and is a valid money state.
The merchant $\mathcal{V}$ is required to perform quantum operations on $|\$\rangle$ to make sure that $|\$\rangle$ corresponds to $s$ and is a valid money state.
But if the merchant $\mathcal{V}$ is capable of performing the verification, then would she not have all quantum capability to mint her own coin in the first place?
The barrier to entry to minting quantum coins does not seem that much different to verifying quantum coins. Thus, we have a situation wherein anyone with a quantum computer capable of verifying such quantum coins can mint their own coins.
If so, a question becomes, how would the market determine the value of a quantum coin, potentially from different merchants or minters? Would the ""oldest"" quantum coin be valued more than newer coins? Or would a coin with an interesting serial number $s$ be valued more? Or the coin used in some famous transaction?
I would imagine a number of publicly available lists of serial numbers, one for each mint/verifier. If I have a quantum computer, I would be motivated to mint my own coin and publish the serial number. The market can decide that ""this coin from this mint is worth more than that coin from that mint,"" but how would the market decide? It seems interesting.
"
"['algorithm', 'physical-realization']"," Title: Does a fully working quantum computer solve a specific problem at varying speeds every time?Body: Lets say we have a fully working quantum computer. I give it a problem to solve and measure how long it takes to solve it. I repeat the process. Would it take the exact same time to solve the same problem?
I have read that a quantum computer's solution process could be seen as all the potential answers are already calculated but to get it out of an entangled state without changing the result, you would use Grover's algorithm that reduces the answer set. You then repeat Grover's algorithm to keep on reducing the answer set. Now you could repeat Grover's algorithm to get a single answer or just start up classical computing to test answers once the answer set is small enough.
This could possibly mean that the same problem could have a different answer set on first iteration of Grover's algorithm which could cascade on how many times it needs to run to get to a reasonably small answer set to test with classical computing.
Did I misunderstand something or is it reasonable that same problem could have varying calculation time on same hardware?
"
['error-correction']," Title: Shor code: phase flip errorBody: For Shor's error correcting code, what is the intuition behind saying that the following circuit corrects the phase flip error?
I realize that the circuit is trying to compare phases of the three 3-qubit blocks, two at a time. But I don't understand how the Hadamards and CNOTs help in that task. It seems different from the general method followed for phase error correction with three qubits encoded in the Hadamard basis. It also seems to entangle the two ancillas at the end with the encoded 9 qubit code.
"
"['quantum-gate', 'matrix-representation', 'continuous-variable']"," Title: Matrix representation of continuous-variable gatesBody: In the introduction to continuous-variable quantum computing by Strawberry Fields (Xanadu), it lists the primary CV gates (rotation, displacement, squeezing, beamsplitter, cubic phase) along with their unitary:
What are the matrix representations of these gates?
"
"['quantum-gate', 'circuit-construction', 'qiskit', 'hhl-algorithm', 'phase-estimation']"," Title: SWAP gate(s) in the $R(\lambda^{-1})$ step of the HHL circuit for $4\times 4$ systemsBody: Context:
On the 5th page of the paper Quantum circuit design for solving linear systems of equations (Cao et al, 2012) there's this circuit:
Schematic:
A brief schematic of what's actually happening in the circuit is:
Question:
Cao et al.'s circuit (in Figure 4) is specifically made for the matrix:
$$A = \frac{1}{4} \left(\begin{matrix} 15 & 9 & 5 & -3 \\ 9 & 15 & 3 & -5 \\ 5 & 3 & 15 & -9 \\ -3 & -5 & -9 & 15 \end{matrix}\right)$$
whose eigenvalues are $\lambda_1 = 2^{1-1}=1,\lambda_2 = 2^{2-1}=2,\lambda_3 = 2^{3-1}=4$ and $\lambda_4 = 2^{4-1} = 8$ and corresponding eigenvectors are $|u_i\rangle = \frac{1}{2}\sum_{j=1}^{4}(-1)^{\delta_{ij}}|j\rangle^C$. In this case since there are $4$ qubits in the clock register, the $4$ eigenvalues can be represented as states of the clock register itself (no approximation involved) i.e. as $|0001\rangle$ (binary representation of $1$), $|0010\rangle$ (binary representation of $2$), $|0100\rangle$ (binary representation of $4$) and $|1000\rangle$ (binary representation of $8$).
After the first Quantum phase estimation step, the circuit's (in Fig. 4) state is
$$|0\rangle_{\text{ancilla}} \otimes \sum_{j=1}^{j=4} \beta_j |\lambda_j\rangle |u_j\rangle$$
Everything is fine till here. However, after this, to produce the state
$$\sum_{j=1}^{j=4} \beta_j |u_j\rangle_I |\lambda_j\rangle^C ((1-C^2/\lambda_j^2)^{1/2}|0\rangle + C/\lambda_j|1\rangle)$$
it seems necessary to get to the state $$\sum_{j=1}^{j=4} \beta_j |u_j\rangle_I |\frac{2^{3}}{\lambda_j}\rangle^C\otimes |0\rangle_{\text{ancilla}}$$
That is, the following mappings seem necessary in the $R(\lambda^{-1})$ rotation step:
$$|0001\rangle \mapsto |1000\rangle, |0010\rangle \mapsto |0100\rangle, |0100\rangle \mapsto |0010\rangle \ \& \ |1000\rangle \mapsto |0001\rangle$$
which implies that the middle two qubits in the clock register need to be swapped as well as the two end qubits.
But, in the circuit diagram they seem to be swapping the first and third qubit in the clock register! That doesn't seem reasonable to me. In the paper (Cao et al.) claim that the transformation they're doing using their SWAP gate is
$$\sum_{j=1}^{j=4} \beta_j |u_j\rangle_I |\lambda_j\rangle^C\otimes |0\rangle_{\text{ancilla}} \mapsto \sum_{j=1}^{j=4} \beta_j |u_j\rangle_I |\frac{2^{4}}{\lambda_j}\rangle^C\otimes |0\rangle_{\text{ancilla}}$$
According to their scheme, $|1000\rangle \to |0010\rangle$ (see the third page). This scheme doesn't make sense to me because the state $|0001\rangle$ (representing the eigenvalue $1$) would have to be transformed to $|2^4/1\rangle$. But the decimal representation of $16$ would be $|10000\rangle$ which is a 5-qubit state! However, our clock register has only $4$ qubits in total.
So, basically I think that their SWAP gates are wrong. The SWAPs should actually have been applied between the middle qubits and the two end qubits. Could someone verify?
Supplementary question:
This is not a compulsory part of the question. Answers addressing only the previous question are also welcome.
@Nelimee wrote a program (4x4_system.py in HHL) in QISKit to simulate the circuit (Figure 4) in Cao et al's paper. Strangely, his program works only if the SWAP gate is applied between the middle two qubits but not in between the two end qubits.
The output of his program is as follows:
<class 'numpy.ndarray'>
Exact solution: [-1 7 11 13]
Experimental solution: [-0.84245754+0.j 6.96035067+0.j 10.99804383+0.j 13.03406367+0.j]
Error in found solution: 0.16599956439346453
That is, in his program only the mapping $|0100\rangle \mapsto |0010\rangle$ takes place in the clock register in the $R(\lambda^{-1})$ step. There's no mapping $|1000\rangle \mapsto |0001\rangle$ taking place.
Just in case anyone figures out why this is happening please let me know in the comments (or in an answer).
"
"['mathematics', 'cryptography', 'quantum-money']"," Title: Do we have to trust the bank in ""Quantum Money from Hidden Subspaces?""Body:
What level of trust in the bank is needed in ""Quantum Money from Hidden Subspaces"" of Aaronson and Christiano?
The bank's mint works by first generating a uniformly random classical secret string $r$, and then generating a banknote $\$_r=(S_r,\rho_r)$. The authors state that the bank can generate many identical banknotes by simply reusing the secret $r$.
- But after the currency is distributed, is $r$ needed, either by the bank or by the users, ever again? If so, does the bank need to keep it safe and secure? If not, should the bank ""forget"" or destroy the secret $r$ used in the mini-scheme, lest it fall into a forger's hand?
- Can the mint use $r$ to produce many coins with a specific serial number $S_r$, potentially targeting a specific holder of currency for devaluation?
- Can the users of the currency know how many coins are actively in circulation, without having to trust the mint?
The authors of Hidden Subspaces note that in ""Quantum Money from Knots"" of Farhi, Gosset, Hassidim, Lutomirski, and Shor, not even the mint is likely able to generate two identical banknotes.
But I think that the inability of banks to copy their own currency is a feature, not a bug, of ""Quantum Money from Knots"", because the actions of the mint are public and known. The total amount of currency is known; no secret $r$ is needed to be kept safe or destroyed; the mint can ""destroy"" a coin by removing it from the public list of serial numbers (Alexander polynomials,) but cannot target a coin for devaluation by minting many copies.
"
['resource-request']," Title: What would be an informative introduction to quantum computing software?Body: I am new to Stack Exchange and am working on a quantum learning platform for minority youth groups (LGBTQ, low-income, at risk, etc).
In the question below they are looking for courses on the subject, which I am also interested in, and do plan on checking those links out for ideas.
Introductory material for quantum machine learning
What I am looking for are simple videos, articles, or even games, that cover basic quantum theory at an introductory level.
There are some games I have looked into and played.
Hello Quantum! was fun and informative, though on my end there was still a lack of comprehension on how the quantum computer (or anything else ""quantum"") would actually function and play out.
My focus for the educational platform is more directed towards the software side of quantum computing. Is there anything on software that gives a good introduction to the functions and uses a quantum computer will have? As well as what language would be best to program one? Also, would there be a way to program a quantum computer through a classical computer? And, is there a simple introduction to any of this already existing?
"
['mathematics']," Title: How can surreal maths be used in quantum computing?Body:
The question whether surreal or hyperreal numbers (that both contain the reals, even if they have the same cardinality) could be useful to provide a more satisfactory theory of QM is maybe more interesting. -yuggib
Background
I indirectly ended up on this stack, much to my surprise. Little by little I have been working to piece the puzzle together.
I have been pondering this question for a while now, but was not able to formulate it so succinctly until I saw the above quote.
I still don't feel able to properly convey my intuition around why this is a good approach..
Abstract
Star
is not zero, but neither positive nor negative, and is therefore said to be fuzzy and confused with (a fourth alternative that means neither ""less than"", ""equal to"", nor ""greater than"") 0
Fuzzy logic
is a form of many-valued logic in which the truth values of variables may be any real number between 0 and 1. It is employed to handle the concept of partial truth, where the truth value may range between completely true and completely false. By contrast, in Boolean logic, the truth values of variables may only be the integer values 0 or 1
Qubit
—usually taken to have the value “0” and “1”, like a bit. However, whereas the state of a bit can only be either 0 or 1, the general state of a qubit according to quantum mechanics can be a superposition of both.
Motivation
""It is likely to be a fresh research question, and you the person one most interested in the entire world in finding an answer --- in which case it is most probably up to you (and your opportunity!) to obtain the answer first."" -Niel
While the motivation to wanting to make this work may not be apparent at first, a big piece of what I'm wanting to accomplish is creating a quantum algorithm based on surreal constructions for a quantum intelligence that can use game theory for computation.
I have placed a couple different bounties in an attempt to push along this research.
Question
How can surreal maths be used in quantum computing?
"
"['quantum-state', 'notation', 'unitarity', 'mathematics']"," Title: Quantum states are unit vectors... with respect to which norm?Body: The most general definition of a quantum state I found is (rephrasing the definition from Wikipedia)
Quantum states are represented by a ray in a finite- or infinite-dimensional Hilbert space over the complex numbers.
Moreover, we know that in order to have a useful representation we need to ensure that the vector representing the quantum state is a unit vector.
But in the definition above, they don't precise the norm (or the scalar product) associated with the Hilbert space considered. At first glance I though that the norm was not really important, but I realised yesterday that the norm was everywhere chosen to be the Euclidian norm (2-norm).
Even the bra-ket notation seems to be made specifically for the euclidian norm.
My question: Why is the Euclidian norm used everywhere? Why not using an other norm? Does the Euclidian norm has useful properties that can be used in quantum mechanics that others don't?
"
"['entanglement', 'ppt-criterion', 'metrics']"," Title: Estimate/determine Bures separability probabilities making use of corresponding Hilbert-Schmidt probabilitiesBody: For two-qubit states, represented by a $4\times 4$ density matrix, the generic state is described by 15 real parameters. For ease of calculation, it can help to consider restricted families of states, such as the ""$X$""-states, where any matrix elements not on either the main diagonal or anti-diagonal are 0 (requiring 7 real parameters), or rebits, where the matrix elements are all real (requiring 9 real parameters).
For any given density matrix of two qubits, it is easy to tell if it's entangled: we just test the partial transpose criterion, and the presence of negative eigenvalues. One might like to measure the fraction of the space that is entangled, and for that, one must pick a particular measure.
The probability with respect to Hilbert-Schmidt measure that generic two-qubit $X$-states are separable has been shown to be $\frac{2}{5}$ (arXiv:1408.3666v2, arXiv:1501.02289v2). Additionally, Lovas and Andai have demonstrated that the corresponding probability for the two-rebit density matrices is $\frac{29}{64}$ (https://arxiv.org/abs/1610.01410). Additionally, a strong body of various forms of evidence (though yet no formal proof) has been developed that the probabilities
for the arbitrary two-qubit and (27-dimensional) two-``quater”[nionic]bit'' density matrices
are $\frac{8}{33}$ and $\frac{26}{323}$, respectively (arXiv:1701.01973).
However, analogous results with respect to the important Bures (minimal monotone) measure are presently unknown.
Now, in what manner, if any, might these known Hilbert-Schmidt results be employed to assist in the further estimation/determination of their Bures counterparts?
Perhaps useful in such an undertaking would be the procedures for the generation of random density matrices with respect to
Bures and Hilbert-Schmidt measure outlined in arXiv:0909.5094v1. Further, Chapter 14 of ""Geometry of Quantum States"" of Bengtsson and Zyczkowski presents formulas for the two measures, among a wide literature of related analyses.
It seems a particularly compelling conjecture that the two-qubit Bures separability probability assumes some yet unknown simple, elegant form ($\approx 0.073321$), as has been demonstrated do its counterparts, also based on fundamental quantum information-theoretic measures. A value of $\frac{11}{150} =\frac{11}{2 \cdots 3 \cdots 5^2} \approx 0.07333...$ is an interesting candidate in this matter.
"
"['circuit-construction', 'simulation', 'hhl-algorithm', 'quirk']"," Title: Error: Simulation of ""Quantum algorithm for linear systems of equations"" for $4\times 4$ systems on Quirk (without SWAP) - Global phaseBody: Following @DaftWullie's answer I tried to simulate the circuit given in Fig. 4 of the paper (arXiv pre-print): Quantum circuit design for solving linear systems of equations (Cao et al, 2012), on Quirk.
The relevant circuit in the arXiv pre-print by Cao et al is:
Please note that (I think) the $e^{-iAt_0/2^s}$ (s.t. $1\leq s \leq 4$) gates in the circuit should actually be $e^{+iAt_0/2^s}$ gates instead. That's probably a misprint in the paper.
You will find the equivalent Quirk simulated circuit here. The labellings of the gates (along with the matrix entries) can be seen from the dashboard by hovering over them. The matrix entries may also be obtained from the JSON code in the URL. You might want to use a JSON formatter for that purpose.
The rotation gates used in the paper are $R(8\pi/2^{r-1}),R(4\pi/2^{r-1}),R(2\pi/2^{r-1}),R(\pi/2^{r-1})$. On page 4 they mentioned that higher the value of $r$ they greater is the accuracy. So I took $r=7$.
I created the custom gates $R_y(8\pi/2^{r-1})$, $R_y(4\pi/2^{r-1})$, $R_y(2\pi/2^{r-1})$ & $R_y(\pi/2^{r-1})$, using the definition of the $R_y$ matrices as:
$$R_y(\theta) = \left(\begin{matrix}\cos(\theta/2) & \sin(\theta/2) \\ -\sin(\theta/2) & \cos(\theta/2) \end{matrix}\right)$$
Now, the output state of the ""input register"" should have been
$$\frac{-|00\rangle + 7|01\rangle + 11|10\rangle + 13|11\rangle}{\sqrt{340}}$$
i.e. $$-0.0542326|00\rangle + 0.379628|01\rangle + 0.596559|10\rangle + 0.705024|11\rangle$$
However, I'm getting the output state of the input register as
$$-(-0.05220|00\rangle+0.37913|01\rangle+0.59635|10\rangle+0.70562|11\rangle)$$
That is, there's a extraneous global phase of $-1$ in the final output. I'm not sure whether I have made a mistake in the implementation of the circuit OR whether the output of the circuit actually supposed to be accompanied with the global phase.
@DaftWullie mentions:
If it's a global phase, what does it matter? Everything is always ""up
to a global phase""
That sure is logical! However, I want to be sure that I'm not making any silly error in the implementation itself. I wonder that if there's actually supposed to be a global phase of $-1$, why they didn't explicitly mention it in the paper? I find that a bit surprising. (Indeed, yes, I should perhaps directly contact the authors, but maybe someone here might be able to spot the silly mistake (on my part) quicker! :)
In case you have any questions about my simulation, please feel free to ask in the comments. I'll be happy to clarify.
"
['mathematics']," Title: What kind of mathematics is common in quantum computing?Body: From what I have seen so far, there is a lot of linear algebra. Curious what other kinds of maths are used in QC & the specific fields in which they are most predominately invoked.
"
['error-correction']," Title: Quantum error correction: necessary and sufficient conditionBody: For quantum error correction, the necessary and sufficient condition is given in standard texts as:
$\langle \phi| E^{\dagger}_{a} E_{b} |\psi \rangle = C_{ab} \langle \phi|\psi \rangle $
$|\psi\rangle$ and $|\phi\rangle$ are codewords. $E_{a}$ and $E_b$ are arbitrary errors that can occur.
My queries would be:
- Why is $C_{ab}$ independent of the codewords and only dependant on the errors? Intuitively, I realize this is because otherwise, we gain some information about the codeword by detecting the error and run the risk of disturbing the superposition of the codeword. Is there a more formal mathematical explanation for the same?
- I realize that $C$ is a Hermitian matrix which can be diagonalized. What does it mean in terms of the codewords and the errors to diagonalize the matrix $C$?
- Why is it the case that the state $|\psi\rangle$ is always an eigenstate of $ E^{\dagger}_{a} E_{b}$ with $C_{ab}$ as an eigenvalue? It doesn't seem intuitive to me.
"
['circuit-construction']," Title: Showing the equivalence of two simple {NOT, CNOT} circuitsBody: As a beginner, for exercise purpose, I’ve studied this two quantum circuits. They are equivalent, and for 2 qubits it’s easy to write the unitary transformation matrix.
Looking for another method I wrote what follows, but I’m not sure about notation and, particularly, the last passage.
So, I’m asking here if what I’ve written is admissible (maybe with some correction?).
There are other methods?
"
"['mathematics', 'resource-request', 'zx-calculus']"," Title: Graphical Calculus for Quantum CircuitsBody: So far I have read a little bit about zx-calculus & y-calculus.
From Reversible Computation:
The zx-calculus is a graphical language for describing quantum systems.
The zx-calculus is an equational theory, based on rewriting the diagrams
which comprise its syntax. Re-writing can be automated by means of the quantomatic software.
This method seems very interesting, however I am not able to find much introductory information on the subject. Any insight into the subject or additional resources would be greatly appreciated.
Current Resources:
"
"['quantum-gate', 'quirk', 'cloning']"," Title: Toffoli gate as FANOUTBody: I was searching for examples of quantum circuits to exercise with Q# programming and I stumbled on this circuit:
From: Examples of Quantum Circuit Diagrams
- Michal Charemza
During my introductory courses in quantum computation, we were taught that the cloning of a state is forbidden by the laws of QM, while in this case the first contol qubit is copied on the third, target, qubit.
I quickly tried to simulate the circuit on Quirk, something like this, that sort of confirms the cloning of the state in output on the first qubit. Measuring the qubit before the Toffoli gate shows that is in fact no real cloning, but instead a change on the first control qubit, and an equal output on the first and third qubit.
By making simple math, it can be shown that the ""cloning"" happens only if the third qubit is in initial state 0, and that only if on the first qubit is not performed a ""spinning operation"" (as indicated on Quirk) on Y or X.
I tried writing a program in Q# that only confirmed which is aforesaid.
I struggle in understanding how the first qubit is changed by this operation, and how something similar to a cloning is possible.
Thank you in advance!
"
"['quantum-gate', 'gate-synthesis', 'mathematics']"," Title: Doing maths with controlled-half NOTsBody: In Quantum Computation with the simplest maths possible there is a section titled ""Doing maths with a controlled-half NOT"" which covers a reversible-(N)AND circuit with controlled-half NOTs.
- What would the unitary matrix for a controlled-half NOT be?
- How could a reversible-XNOR gate be constructed with controlled-half NOTs?
- How would a half-adders, full adders & ripple carry adders be constructed from controlled-half NOTs?
"
"['models', 'topological-quantum-computing', 'anyons']"," Title: Anyon alternatives in topological quantum computingBody:
A topological quantum computer is a theoretical quantum computer that employs two-dimensional quasiparticles called anyons. -Wikipedia
Are there other instances of topological quantum computing models that do not use anyons?
Are there alternative forms of anyons besides Fibonacci anyons?
"
"['circuit-construction', 'topological-quantum-computing', 'quirk']"," Title: Topological Circuit SimulatorBody: Does something like Quirk exist for topological (eg. braided) circuits?
Alternatively, any ideas on how @CraigGidney is getting these circuits (or something similar)?
"
"['quantum-gate', 'entanglement', 'quantum-state']"," Title: CNOT Gate on Entangled QubitsBody: I was trying to generate Greenberger-Horne-Zeilinger (GHZ) state for $N$ states using quantum computing, starting with $|000...000\rangle$ (N times)
The proposed solution is to first apply Hadamard Transformation on the first qubit, and then start a loop of CNOT gates with the first qubit of all the others.
I am unable to understand how I can perform CNOT($q_1,q_2$) if $q_1$ is a part of an entangled pair, like the Bell state $B_0$ which forms here after the Hadamard transformation.
I know how to write the code for it, but algebraically why is this method correct and how is it done? Thanks.
"
"['algorithm', 'programming', 'qiskit']"," Title: Quantum SVM Algorithm Error on importBody: I am experimenting with some Qiskit ACQUA AI algorithms which require the following import statement:
from datasets import *
However, import statement is throwing an error:
ModuleNotFoundError
Traceback (most recent call last) in
from datasets import *
ModuleNotFoundError: No module named 'datasets'
I am unable to determine the package that this import is from. Clearly, Qiskit ACQUA installation doesn't have to all required packages for the algorithm code to run. I asked the question at the IBM QE forum but the traffic on it is very low. I have not had the answer from anyone yet.
Any help would be most appreciated!
"
['algorithm']," Title: Are there sites that allow to learn about quantum computing?Body: So, I wanted to learn about quantum computing.
What should I learn and where do I start?
"
"['quantum-gate', 'gate-synthesis']"," Title: Is it possible to realize CNOT gate in 3 dimension?Body: CNOT gates have been realized for states living in 2-dimensional spaces (qubits).
What about higher-dimensional (qudit) states? Can CNOT gates be defined in such case? In particular, is this possible for three-dimensional states, for example, using orbital angular momentum?
"
"['quantum-gate', 'gate-synthesis']"," Title: Arbitrary powers of NOT and SWAPBody: The square-root of not and square-root of swap gates are often singled out for discussion of gates displaying important properties relating to quantum computers.
- How do I define arbitrary (non-integer) powers of the square-root of NOT or square-root of SWAP?
- How do I find their unitary matrices?
- How might I implement these gates?
"
"['bristlecone', 'rigetti', 'cirq']"," Title: What are physically allowed CNOTs for Rigetti's 19 qubit chip and Google's 72 qubit BristleCone chip?Body: For each IBM quantum chip, one can write a dictionary mapping each control qubit j to a list of its physically allowed targets, assuming j is the control of a CNOT. For example,
ibmqx4_c_to_tars = {
0: [],
1: [0],
2: [0, 1, 4],
3: [2, 4],
4: []} # 6 edges
for their ibmqx4 chip.
What would be that dict for Google's 72 qubit Bristlecone chip. You can write the dict as a comprehension. Same question for Rigetti's 19 qubit chip.
"
"['architecture', 'physical-realization']"," Title: Is it possible to make our own quantum computer? If yes, what will it take?Body: I am thinking as quantum computing is just a new word in tech, so let to explore it by building it or a prototype based on it so I am just wanted help in setting up and initial steps which should I keep in mind. Please tell me about each implementation step.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: What is the purpose of the TDG gate in QISKit?Body: The QISKIT documentation doesn't explain what a TDG gate does and I can't find it anywhere else online.
"
"['algorithm', 'amplitude-amplification']"," Title: Computing of the action of the amplification operator $\mathbf Q$ over $|\Psi_i\rangle$ in the quantum amplitude amplification algorithmBody: $\newcommand{\Q}{\mathbf{Q}}\newcommand{\S}{\mathbf{S}}\newcommand{\A}{{\mathcal A}}\newcommand{\H}{\mathcal H}$In the quantum amplitude amplification algorithm, as explained in Brassard et al. 2000 (quant-ph/0005055), the unitary performing the amplification is defined as (using the notation found in pag 5 of the above paper):
$$\Q=-\A\S_0\A^{-1}\S_\chi,$$
where $\A$ is a unitary,
$\chi:\mathbb Z\to\{0,1\}$ is a Boolean function, and $\S_\chi$ and $\S_0$ are unitaries defined as
$$\S_\chi\equiv I-2\Pi_1,\quad \S_0\equiv I-|0\rangle\langle0|,$$
where $\Pi_i$ is the projector over the states $|x\rangle$ for which $\chi(x)=i$:
$$\Pi_i\equiv\Pi_{\chi(x)=i}\equiv\sum_{x:\,\chi(x)=i}|x\rangle\langle x|.$$
Given the state $|\Psi\rangle\equiv\A|0\rangle$, the authors define the states $|\Psi_i\rangle$, for $i=0,1$, as
$$|\Psi_i\rangle\equiv\Pi_i|\Psi\rangle=\Pi_i\A|0\rangle.$$
The first lemma in the paper, at the end of page 5, states that
\begin{align}
\Q|\Psi_1\rangle&=(1-2a)|\Psi_1\rangle-2a|\Psi_0\rangle, \\
\Q|\Psi_0\rangle&=2(1-a)|\Psi_1\rangle+(1-2a)|\Psi_0\rangle,
\end{align}
where $a=\langle\Psi_1|\Psi_1\rangle$.
The action of $\Q$ over $|\Psi_i\rangle$ does not seem obvious. For example,
$$\Q|\Psi_0\rangle=-\A\S_0\A^{-1}\S_\chi|\Psi_0\rangle
=-\A\S_0\A^{-1}|\Psi_0\rangle,$$
but then already $\A^{-1}$ acts nontrivially on $|\Psi_0\rangle$.
How is $\Q|\Psi_i\rangle$ computed?
"
"['quantum-gate', 'qiskit', 'superposition']"," Title: Does conditional gate collapse controller's superposition?Body: I've created a simple circuit in Q-Kit to understand conditional gates and outputted states on each step:
- In the beginning there is clear 00 state, which is the input
- The first qubit is passed through the Hadamard gate, it gets into superposition, 00 and 10 become equally possible
- The first qubit CNOTs the second one, probability of 00 is unchanged, but 10 and 11 are swapped
- The first qubit passes Hadamard again and probability of 00 is splited between 00 and 10, and 11 between 01 and 11 as if first qubit stepped into superposition from a fixed state
Shouldn't the result be equally distributed 00 and 01? The first qubit passes Hadamard twice, which should put it into superposition and back to initial 0. The CNOT gate does not affect controller qubit, so its existence shouldn't affect first qubit at all, but in fact it makes it act like it wasn't in superposition any more. Does usage of qubit as a controller collapse its superposition?
"
['simulation']," Title: What are some good quantum computing simulator and visualiser?Body: I am looking for some good software to simulate quantum computing, visually if possible.
I know about quirk (http://algassert.com/quirk)
and IBM Q Experience (https://quantumexperience.ng.bluemix.net)
I just saw this question ( Does conditional gate collapse controller's superposition? ) and the asker uses something that looks really neat : https://i.stack.imgur.com/dIari.png
Does someone knows what this is?
And does someone knos other good software like these?
Thank you!!
"
"['algorithm', 'quantum-gate', 'hhl-algorithm', 'hamiltonian-simulation']"," Title: Practical implementation of Hamiltonian EvolutionBody: Following from this question, I tried to look at the cited article in order to simulate and solve that same problem... without success. Mainly, I still fail to understand how the authors managed to simulate the Hamiltonian evolution through the circuit shown at the bottom of Fig.4. Even exponentiating classically the matrix I do not get values of the gates shown in the Quirk circuit that @Blue linked along his question.
I tried to look at the paper in which the Group Leader Optimization algorithm is explained, but I still have troubles understanding how do they assign the rotation angles to the different gates.
"
"['error-correction', 'resource-request']"," Title: What are reliable references on analytical and/or numerical studies of threshold theorems under faulty quantum error correction?Body: By ""faulty"", I mean that you can have errors on the ancilla qubits, you can have faulty syndrome extraction, etc.
"
"['error-correction', 'resource-request']"," Title: topological error correction conceptsBody: Reading about quantum topological error correction I’ve found some information, but I don’t have already clear the link with the topological concept (trivial and not trivial paths, how they are related with the error).
Can I have explanations or some link where conceptual meaning is explained?
Thanks.
"
"['complexity-theory', 'bqp']"," Title: Query regarding BQP belonging to PPBody: I found the following proof of BQP belonging to PP (the original document is here). There is a part of the proof that I have trouble understanding. First, the structure is given below.
We try to simulate a polynomial-time generated quantum circuit
(which encodes our problem) using a PP machine. We start with a
universal set of gates.
We have a Hadamard gate and a Toffoli gate. We also include a $i$-phase shift gate ($|0 \rangle$
$\rightarrow |0 \rangle, |1 \rangle \rightarrow i|1 \rangle$). However,
we simulate the action of this gate by considering an additional qubit
and performing the following transformations:
$$|00 \rangle → |00 \rangle $$ $$|01 \rangle → |01 \rangle $$
$$|10\rangle→ |11 \rangle $$ $$|11 \rangle → −|10 \rangle $$
The first qubit is viewed as the original qubit and the additional
qubit acts as the ""real/imaginary part"".
There is a register $B \leftarrow 0$ to store the phase. A register $Z$
$\leftarrow 0^n$ stores the initial state of the machine. We simulate
the circuit as follows:
$\bullet$ If the gate is a Toffoli gate, simply modify $Z$
accordingly.
$\bullet$ If the gate is a Hadamard gate, flip a coin to determine the
new state of the corresponding bit of $Z$. If the induced
transformation was $1 \rightarrow 1$, toggle the sign bit.
$\bullet$ If the gate is the two-qubit gate we used to replace the
$i$-phase shift gate, modify $Z$ appropriately and toggle the sign bit
if the transformation induced was $11 \rightarrow 10$.
The steps above are repeated a second time, using variables $B'$ and
$Z'$ in place of $B$ and $Z$. Finally, the following operations are
performed:
$\bullet$ If $Z = Z'$ and the first bit of $Z$ and $Z'$ is a $0$, then
output $B ⊕ B'$.
$\bullet$ If $Z = Z'$ and the first bit of $Z$ and $Z'$ is a $1$, then
output $\bar B ⊕ B'$.
$\bullet$ If $Z \neq Z'$, then “give up”. This means: flip a fair coin
and output $0$ or $1$ accordingly.
The claim is that the algorithm above simulates a BQP circuit on a PP machine faithfully as the probability the algorithm outputs $1$ minus the probability that the algorithm outputs $0$ is proportional to $\langle 1 | Q_x |1 \rangle - \langle 0 | Q_x |0 \rangle$ (where $Q_x$ is the quantum circuit for a given encoding $x$ from a polynomial-time generated uniform family of quantum circuits). I do not understand why the terms are proportional.
"
"['physical-qubit', 'continuous-variable']"," Title: Are qubits preferred over qumode, and if so, why?Body: Qubit and qumode are different forms of quantum computation. But most existing quantum computers/chips seems to be of discrete variables. I heard that a group chose qubit for a quantum optical frequency comb experiment relating to quantum computing because the environment noise of continuous variable is much higher. Is this a reason for preferring qubit to qumode at present (if people do prefer it)?
"
['algorithm']," Title: Does ""quantum registers with $n$ qubits are able to hold $2^n$ values and therefore scale exponentially"" actually hold that straightforwardly?Body: A lot of people claim that quantum provides exponential speedup whereas classical computers scale linearly. I have seen examples (such as Shor's algorithm and Simon's) that I believe, but the layman's explanation appears to boil down to ""quantum registers with n qubits are able to hold $2^n$ values."" To me, this sounds a lot like having a SIMD (Single Instruction Multiple Data) CPU where I can load two times $2^n$ variables, and
a) get the correct outcomes, and only these outcomes
b) trace back which answer is to which questions
When trying to do this in quantum computing, I think this is definitely not the case. Let me try to evaluate this with an example:
Say I have two 2-qubit registers , and I want to add two sets of values (2+1 and 1+2):
$a|10\rangle + b|01\rangle$
$a|01\rangle + b|10\rangle$
where a denotes values in register a, and b denotes values in register b. Aka a and b are not scalars
If we now look at the cubits, we see that all are once 0, and once 1. This implies a superposition of all qubits in our input. If we now were to do an addition on the two registers that both hold 2 qubits in superposition, and repeat this experiment sufficient enough times to create a probability distribution, I believe we would end up with a probability distribution for all outcomes as follows:
$P(0) = 1/16 $
$P(1) = 2/16 $
$P(2) = 3/16 $
$P(3) = 4/16 $
$P(4) = 3/16 $
$P(5) = 2/16 $
$P(6) = 1/16 $
If we look at what we wanted to calculate, 2+1 and 1+2, we see that both our answers (two times the answer 3) are indeed present in the set of outcomes. However,
a) there are a lot of other answers
b) we can not trace which answer corresponds to 2+1, and which to 1+2
So my questions:
a) Is it correct that for the addition of two sets of randomly chosen variables, we are not guaranteed to see exponential scaling (unless we want to add all values 0 to 2^n with themselves)
b) Is it correct that, when doing simple classical addition, we loose track of the mapping from input to output
And as a bonus, does the following hold:
When performing the computation as above, the usability would be the same (or worse, as the mapping from input to output is lost) as a lookup table with the same number of input values, as when we have two registers in superposition, we will always receive the same output distribution
"
['programming']," Title: Is there something like GitHub for quantum programming?Body: I'm just learning about quantum computer but some of it has been available for people to research & practice so I'd like to study it myself. The only kind of quantum computing I found so far is IBM cloud service and Q# quantum simulator but the sources and examples are limited, and I only found a bunch of display emoji & a card-guessing mini-game in quantum programming. Are there any main sources like GitHub but for quantum computing programming?
"
['algorithm']," Title: Can a qubit register hold any subset of values, or only specific subsets?Body: Say I have a quantum register containing 1 qubit. A qubit can hold either 0, 1 or both 0 and 1. In Dirac, one would write
0: $|0\rangle=\begin{bmatrix}1\\0\end{bmatrix}$
1: $|1\rangle=\begin{bmatrix}0\\1\end{bmatrix}$
0 and 1: $|+\rangle={1\over\sqrt 2}\begin{bmatrix}1\\1\end{bmatrix}$
If we were to extend our register to 2 qubits:
0: $|00\rangle = |0\rangle \otimes |0\rangle = \begin{bmatrix}1\\0\end{bmatrix} \otimes \begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix}1\\0\\0\\0\end{bmatrix}$
1: $|01\rangle = |0\rangle \otimes |1\rangle = \begin{bmatrix}1\\0\end{bmatrix} \otimes \begin{bmatrix}0\\1\end{bmatrix} = \begin{bmatrix}0\\1\\0\\0\end{bmatrix}$
0 and 1: $|0+\rangle = |0\rangle \otimes |+\rangle = \begin{bmatrix}1\\0\end{bmatrix} \otimes {1\over\sqrt 2}\begin{bmatrix}1\\1\end{bmatrix} = {1\over\sqrt 2}\begin{bmatrix}1\\1\\0\\0\end{bmatrix}$
2: $|10\rangle = |1\rangle \otimes |0\rangle = \begin{bmatrix}0\\1\end{bmatrix} \otimes \begin{bmatrix}1\\0\end{bmatrix} = \begin{bmatrix}0\\0\\1\\0\end{bmatrix}$
3: $|11\rangle = |1\rangle \otimes |1\rangle = \begin{bmatrix}0\\1\end{bmatrix} \otimes \begin{bmatrix}0\\1\end{bmatrix} = \begin{bmatrix}0\\0\\0\\1\end{bmatrix}$
Now if I would want to load the decimal values 1 and 2 in the quantum register, I have two ways of reasoning, of which one appears to be flawed:
a)
This is in line with the reasoning above for 1 qubit, section ""0 and 1"":
I want to add values $|01\rangle$ and $|10\rangle$. My first qubit is a 0 for the decimal value 1, and my first qubit is a 1 for the decimal value 2. This means my first qubit is both 0 and 1, and therefor $|+\rangle$. My second qubit is a 1 for decimal value 1, and a zero for decimal value 2, which also implies $|+\rangle$. Hence, I need to load
$|++\rangle =
|+\rangle \otimes |+\rangle =
{1\over\sqrt 2}\begin{bmatrix}1\\1\end{bmatrix} \otimes {1\over\sqrt 2}\begin{bmatrix}1\\1\end{bmatrix} =
{1\over\sqrt 4}\begin{bmatrix}1\\1\\1\\1\end{bmatrix}$
Which provides me with 1 and 2, but also 0 and 3.
b)
$c ( |01\rangle + |10\rangle) = c( \begin{bmatrix}0\\1\\0\\0\end{bmatrix} + \begin{bmatrix}0\\0\\1\\0\end{bmatrix}) = c \begin{bmatrix}0\\1\\1\\0\end{bmatrix}$, where $c$ is likely ${1\over\sqrt 2}$
Which provides me with 1 and 2 and only 1 and 2, and works out in mathematics, but fails in my current common sense.
My questions: Even though I see with math that b) holds and a) fails, can someone explain to me why this fails? Specifically, why is it that both individual qubits appear to be both 0 and 1, hence in superposition, but they are able to distinguish that as a total, only the decimal values 1 and 2 are present, and not 0,1,2 and 3 (which you would expect from 2 qubits in superposition).
"
"['programming', 'cirq']"," Title: List of qubit locations with cirqBody: As far I understand, qubits in cirq are labelled by their positions on chip. For example
print( cirq.google.Foxtail.qubits )
yields
frozenset({GridQubit(0, 1), GridQubit(1, 9), GridQubit(0, 2), ...
I would like to get a simpler version of the above, namely a simple array of tuples for the positions of all qubits
[ (0,1), (0,2), (0,3), ..., (1,1), (1,2), (1,3), ... ]
What is the easiest way to obtain this for a given known device in cirq?
"
"['architecture', 'physical-realization']"," Title: Is it possible to purchase quantum computing hardware?Body: Are there schematics and/or diagrams out there to build a very basic quantum system?
"
"['algorithm', 'cryptography', 'cryptocurrency', 'quantum-money']"," Title: Are non-secret-based quantum money mini-schemes susceptable to Jogenfors' ""reuse attack?""Body: Aaronson and Christiano call public-key or private-key quantum mini-schemes $\mathcal M$ secret-based if a mint works by first uniformly generating a secret random classical strings $r$, and then generating a banknote $\$:=(s_r,\rho_r)$, where $s_r$ is a (classical) serial number corresponding to the quantum state $\rho_r$.
They state:
Intuitively, in a secret-based scheme, the bank can generate many identical banknotes $s$ by simply reusing $r$, while in a non-secret-based scheme, not even the bank might be able to generate two identical banknotes. (emphasis in original).
In characterizing a putative distributed quantum currency based on Aaronson and Christiano's secret-based scheme, Jogenfors describes a ""reuse attack."" For example he colorfully envisions someone, say Alice, who has minted and distributed a coin $\$_r$, and learns that the coin is in possession of a political rival Bob; she uses her secret knowledge of $r$ to mint and distribute a large number of identical coins $\$_r$, thus devaluing the coins in Bob's possession. Jogenfors describes a novel approach to prevent this attack, for example as discussed here.
However, would the above attack even work with a non-secret-based scheme?
If not even Alice can produce copies of her own coins that she's minted, then she has no way devaluing any others that have been distributed.
"
['simulation']," Title: How many qubits are simulable with a normal computer and freely accessible simulators?Body: I want to simulate an arbitrary isolated quantum circuit acting on $n$ qubits (i.e. a pure state of $n$ qubits).
As I know RAM is the bottleneck for quantum simulators, you can consider a ""normal"" computer to have between $4$ and $8$ Gio of RAM, all the other components are considered sufficiently powerful to not be the bottleneck.
With this definition of a ""normal"" computer,
What is the maximum value of $n$ (the number of qubits) for which an arbitrary quantum circuit is simulable in a reasonable time ($<1\text{h}$) with a normal computer and freely accessible simulators?
"
"['quantum-state', 'stabilizer-state']"," Title: How to verify whether a state is a stabilizer state?Body: Given an arbitrary $n$-qudit state vector $|\psi\rangle =\sum_i c_i| i \rangle \in \mathbb{C}_d^n$ for some orthonormal basis $\{|i\rangle\}$, what is the most efficient way one can:
- Verify whether the state is a stabilizer state (i.e. can be defined by $n \leq m \leq 2n$ stabilizer generators, with equality for $d=2$), and if so,
- Find the state's stabilizer generators (in the form of some tensor product of local Pauli matrices).
"
"['programming', 'simulation', 'hamiltonian-simulation', 'pyquil']"," Title: Hamiltonian simulation with complex coefficientsBody: As part of a variational algorithm, I would like to construct a quantum circuit (ideally with pyQuil) that simulates a Hamiltonian of the form:
$H = 0.3 \cdot Z_3Z_4 + 0.12\cdot Z_1Z_3 + [...] +
- 11.03 \cdot Z_3 - 10.92 \cdot Z_4 + \mathbf{0.12i \cdot Z_1 Y_5 X_4}$
When it comes to the last term, the problem is that pyQuil throws the following error:
TypeError: PauliTerm coefficient must be real
I started diving into the literature and it seems like a non-trivial problem. I came across this paper on universal quantum Hamiltonians where complex-to-real encodings as well as local encodings are discussed. However, it is still not clear to me how one would practically implement something like this. Can anyone give me some practical advice how to solve this problem?
"
"['simulation', 'optimization']"," Title: Application of classical approximate optimization algorithm to bottlenecks of quantum computingBody: According to J. Gough, one of the bottlenecks in the current development of large-scale quantum computing may be the lack of our ability to simulate large scale quantum system, which is a NP-hard problem and also requires exponential memory with classical hardware if I understand correctly.
I'm currently developing a certain powerful discrete approximate algorithm. In principle, it can, for example, find an approximate solution for a given quantum Ising model efficiently or optimize the configuration of quantum gates to minimize the error a la U. Las Heras et. al. by replacing its GA with mine.
1) Can we reduce digital/analog quantum simulation to a NP-hard discrete optimization problem (like solving Ising model), so that it can be approximately solved by a classical algorithm using classical device?
2) What are some other crucial bottlenecks? Do they need discrete optimization?
Edit: I guess one of other bottlenecks is quantum error correction, which was already mentioned above.
"
['resource-request']," Title: Any tips on where to start learning quantum computing?Body: I am very interested in this field right now, due to the quantum advantage
and would like some helpful nudges in the right direction i.e. where should I start from.
P.S: I have some background in software engineering and subpar knowledge in math and physics.
"
"['physical-qubit', 'superconducting-quantum-computing', 'models', 'majorana-particle', 'nv-centers']"," Title: What are the pros/cons of Trapped Ion Qubits, Superconducting Qubits and Si Spin Qubits?Body: Among available qubit technologies for universal quantum computing these 3 come up as promising. NV centers and Majorana qubits also underway but relatively new.
I find superconducting qubits and Trapped Ion qubits very hard to scale. Also T1(decoherence) and T2 (dephasing) for superconducting qubits is very less (us).
Being a non-physicist, I am not able to exactly locate good sources to convince myself why is one technology preferred over the other? I would really appreciate if you can direct me to relavant literature available on this topic.
"
"['physical-qubit', 'physical-realization', 'classical-computing', 'communication']"," Title: The process for transferring qubits between locationsBody: I understand that right now qubits are physical entities in a Quantum Computer and I am playing around on the IBM Quantum Computer as well as the Q# language and dipping my toes into the Quantum world for the first time.
I have read a lot of the Alice and Bob style scenarios where it often mentions transporting a qubit from Alice to Bob. I am inferring that as physically transporting it but I haven't found a discussion on what this looks like from a computing sense. As in how it could be theoretically achieved to ""package"" a qubit, or even a representation of a qubit (state or values) for transportation via a Classical or Quantum channel? I am assuming the only way this is possible is via entanglement and teleportation. Is it possible for non-entangled, ordinary qubits, to be represented in some format and transferred logically between two points, whereby the receiving point can decode and interpret the information contained within. That receiving point could be a computer service in a Classical computer architecture or another Quantum machine.
I ask this in the sense of Classical Computing, where we can encode bits onto a chip but logically represent a bit (or series of bits) in numerous formats and transfer them for manipulation. As a software engineer that's where my thought process is coming from. This might not be a practical thing to want to do in Quantum but in theory, is it something that could be achieved? Any guidance would be welcome.
EDIT:
Thank you for the really comprehensive answers, it has filled in a lot of gaps and I did not realise the strong link between photons & fiber which brings a potential bridge in theory. I'm working my way through the basic hello world applications and was trying to mentally bridge my software knowledge of Classical into this world at a basic transfer and representation level. I'm trying to build some small apps that bridge both worlds and my mental block right now is representing the characteristics of a qubit in traditional programming notations. Have you any thoughts on what would need to be modelled to create a logical representation of a qubit? What I am getting at is something similar to a specification that would allow a programmer represent a type (like a String e.g. https://en.wikipedia.org/wiki/String_(computer_science)). In the Quantum programming languages the qubit is it's own type, drilling down a level can the characteristics be captured in a very basic manner so that potentially they could be represented in something like a vector array to capture key characteristics e.g.
state (notwithstanding the difficulty of superposition!), spin etc.
"
"['quantum-gate', 'gate-synthesis', 'solovay-kitaev-algorithm']"," Title: Number of gates required to approximate arbitrary unitariesBody: If I understand correctly, there must exist unitary operations that can be approximated to a distance $\epsilon$ only by an exponential number of quantum gates and no less.
However, by the Solovay-Kitaev theorem, any arbitrary unitary operation in $n$ qubits, with $n$ fixed, can be approximated to a distance of $\epsilon$ using poly(log(1/$\epsilon$)) universal gates.
Don't these two statements appear contradictory? What am I missing?
"
"['algorithm', 'matrix-representation', 'hamiltonian-simulation']"," Title: Advantage of simulating sparse HamiltoniansBody: In @DaftWullie's answer to this question he showed how to represent in terms of quantum gates the matrix used as example in this article. However, I believe it to be unlikely to have such well structured matrices in real life examples, therefore I was trying to look at other methods to simulate an Hamiltonian.
I have found in several articles a reference to this one by Aharonov and Ta-Shma in which, among other things they state that it is possible to have some advantage in simulating sparse hamiltonians. After reading the article, however, I haven't understood how the simulation of sparse hamiltonians could be performed. The problem is usually presented as one of graph coloring, however also looking at the presentation that @Nelimee suggested to read to study matrix exponentiation, this all falls down the silmulation through product formula.
To make an example, let's take a random matrix like:
$$
A = \left[\begin{matrix}
2 & 0 & 0 & 0\\
8 & 5 & 0 & 6\\
0 & 0 & 7 & 0\\
0 & 5 & 3 & 4
\end{matrix}\right];
$$
this is not hermitian, but using the suggestion from Harrow,Hassidim and Lloyd we can construct an hermitian matrix starting from it:
$$
C = \left[ \begin{matrix}
0 & A\\
A^{\dagger} & 0
\end{matrix} \right]
= \left[\begin{matrix}
0 & 0 & 0 & 0 & 2 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 8 & 5 & 0 & 6\\
0 & 0 & 0 & 0 & 0 & 0 & 7 & 0\\
0 & 0 & 0 & 0 & 0 & 5 & 3 & 4\\
2 & 8 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 5 & 0 & 5 & 0 & 0 & 0 & 0\\
0 & 0 & 7 & 3 & 0 & 0 & 0 & 0 \\
0 & 6 & 0 & 4 & 0 & 0 & 0 & 0 \\
\end{matrix}\right].
$$
Now that I have an 8x8, 2-sparse hermitian matrix:
- Can I simulate its evolution in other ways than the product formula method?
- Even if I use the product formula, how do I exploit the fact that it is sparse? Is it just because there are less non-zero entries and therefore it should be easier to find the product of basic gates?
"
"['quantum-state', 'hhl-algorithm', 'matrix-representation']"," Title: Solving linear systems represented by NxN matrices with N not power of 2Body: As far as I have seen, when it comes to solving linear systems of equations it is assumed to have a matrix with a number of rows and columns equal to a power of two, but what if it is not the case?
If for instance I have the equation $Ax=b$ where A is a 4x4 matrix and x and b 4x1 vectors, I expect to find the solution in terms of amplitudes of the 4 basis states considered for the problem. What if instead of 4 there is 5?
My idea would be to choose an Hilbert space of smallest dimension that it includes 5 i.e. 8, and then make it so that 3 basis states will have amplitude 0. Is it correct to reason in this way, or am i making problems for nothing?
"
"['topological-quantum-computing', 'technologies']"," Title: Are there any other companies besides Microsoft pursuing topological QC?Body: Also, why is Microsoft placing such an emphasis on topological qubits when most other companies seem to be focusing on other qubit technologies?
I know topological qubits could handle noise far better than other systems, so they are appealing, but they are also new and seemingly only theoretical so far.
"
"['quantum-gate', 'pauli-gates']"," Title: Shorthand notation for the sign flip gateBody: I need to use the following matrix gate in a quantum circuit:
$$\text{Sign Flip}=\left[\begin{matrix}0 & -1 \\ -1 & 0\end{matrix}\right]$$
$\text{Sign Flip}$ can be decomposed as (in terms of Pauli-$X$,$Y$,$Z$):
$$\begin{bmatrix} 0 & -1\\ -1 & 0\end{bmatrix} = \begin{bmatrix} 0 & 1\\ 1 & 0\end{bmatrix} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix}$$
Is there any standard shorthand notation for the $\text{Sign Flip}$ gate? I don't really want to replace one simple custom gate by $5$ quantum gates in my circuit.
"
['entanglement']," Title: Is entanglement an operation or a stored state for qubits?Body: I am going through this video of Quantum Computing for Computer Scientists. I am not able to understand the entanglement state of qubits.
Is entanglement just an operation, or is it a state which can be stored. If it's a state which is stored then how can we send two qubits far apart?
But if it is just an operation then isn't the operation somehow affected the probability from 50% to 100% to superimposed states of qubits.
Also, what if the operation has 50% chance of assigning the probability. So when measuring multiple times we tend to get 50% probability of qubits collapsing to one of the states.
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises']"," Title: How do you represent the output of a quantum gate in terms of its basis vectors?Body: I'm stuck while trying to understand the Hadamard Gate in a more linear algebra understanding. (I understand the algebraic way). This is because I want to program a simulation of a quantum computer. To apply a gate you multiply each ket by the unitary matrix.
So, the Hadamard gate maps the state $\alpha |0\rangle + \beta|1\rangle$ to $\frac{\alpha}{\sqrt{2}}\begin{bmatrix}1\\1\\\end{bmatrix}+\frac{\beta}{\sqrt{2}}\begin{bmatrix}1\\-1\\\end{bmatrix}$ right?
But the outputs are not basis vectors. I know this is hard to understand but how do I make it back to the basis vector form so I can write it in ket form. I know you can do it algebraically but how to in linear algebra?
So put it in the form:
$$\alpha\begin{bmatrix}1\\0\\\end{bmatrix}+\beta\begin{bmatrix}0\\1\\\end{bmatrix}$$
If you understand what I mean, can you explain it in a general matrix form?
"
"['algorithm', 'resource-request', 'communication-complexity']"," Title: Resources for Quantum Communication ComplexityBody: I recently came to know about this interesting topic of ""communication complexity"". In simple words, Wikipedia defines it as:
In theoretical computer science, communication complexity studies the
amount of communication required to solve a problem when the input to
the problem is distributed among two or more parties. It was
introduced by Andrew Yao in 1979, who investigated the following
problem involving two separated parties, traditionally called Alice
and Bob. Alice receives an n-bit string $x$ and Bob another $n$-bit
string $y$, and the goal is for one of them (say Bob) to compute a
certain function $f(x,y)$ with the least amount of communication
between them. Of course, they can always succeed by having Alice send
her whole n-bit string to Bob, who then computes the function $f$, but
the idea here is to find clever ways of calculating $f$ with fewer than
n bits of communication. Note that in communication complexity, we are
not concerned with the amount of computation performed by Alice or
Bob, or the size of the memory used.
Now, I was going through the first couple of pages of this paper: ""Quantum Communication Complexity (A Survey) - Brassard"". Apparently, it seems that if the non-communicating parties are previously entangled then more bits of information may be communicated than in the classical case. The paper looks nice, and so I'll read further. However, are there any other important papers or texts which are ""must-reads"" when learning about ""quantum communication complexity""? (I'm mostly interested in the theoretical/algorithmic side)
"
"['simulation', 'dynamics']"," Title: What are the preferred numerical methods to simulate the evolution of a state through a time-dependent Hamiltonian?Body: Under the influence of a time-independent Hamiltonian $H$, a state $|\psi\rangle$ will evolve after a time $t$ to the final state $|\psi(t)\rangle=e^{-iH t}|\psi\rangle$, while in the most general case of a time-dependent Hamiltonian $H(t)$, the final state can be formally written as
$$|\psi(t)\rangle=T\exp\left(-i\int_{t_0}^{t}dt\,H(t)\right) |\psi\rangle.$$
What are the preferred numerical methods to compute $|\psi(t)\rangle$, given $H$, $t$ and $|\psi\rangle$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Comparing run times on IBM Quantum ExperienceBody: I have run this program -
# Import the QISKit SDK
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute, register
# Set your API Token.
# You can get it from https://quantumexperience.ng.bluemix.net/qx/account,
# looking for ""Personal Access Token"" section.
QX_TOKEN = ""....""
QX_URL = ""https://quantumexperience.ng.bluemix.net/api""
# Authenticate with the IBM Q API in order to use online devices.
# You need the API Token and the QX URL.
register(QX_TOKEN, QX_URL)
# Create a Quantum Register with 2 qubits.
q = QuantumRegister(2)
# Create a Classical Register with 2 bits.
c = ClassicalRegister(2)
# Create a Quantum Circuit
qc = QuantumCircuit(q, c)
# Add a H gate on qubit 0, putting this qubit in superposition.
qc.h(q[0])
# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
# the qubits in a Bell state.
qc.cx(q[0], q[1])
# Add a Measure gate to see the state.
qc.measure(q, c)
# Compile and run the Quantum Program on a real device backend
job_exp = execute(qc, 'ibmqx4', shots=1024, max_credits=10)
result = job_exp.result()
# Show the results
print(result)
print(result.get_data())
Output -
COMPLETED {'time': 19.799431085586548, 'counts': {'00': 445, '01': 62,
'10': 67, '11': 450}, 'date': '2018-07-30T14:56:23.330Z'}
But when I was running this, it was no very fast. Is this due to queuing on the machine?
"
['classical-computing']," Title: Are classical bits quantum?Body: A bit is a binary digit, typically 0 or 1.
Until a value is assigned (or a measurement is made) a bit is in a superposition of the entangled binary pair, is it not?
"
"['quantum-gate', 'programming']"," Title: Possibility of a ""reset"" quantum gateBody: I wish to have a ""reset"" gate. This gate would have an effect to bring a qubit to the $\mid0\rangle$ state.
Clearly, such a gate is not unitary (and so I'm unable to find any reliable implementation in terms of universal gates).
Now for my particular needs, I need this ability to reset a qubit or a quantum register to that state so users can always start from $\mid0\rangle$. I'm making a small programming language that transpiles to QASM, and when a function is exited, I want all local (quantum) variables (qubits) reset to $\mid0\rangle$ so they can be reused. QASM reset instruction does not work on the real processor.
I think that something to this effect may be achieved with quantum phase estimation but I'm wondering if there is another way.
"
['d-wave']," Title: How would D-Wave be used for complex optimization problems?Body: We are interested in solving an optimization problem, and specifically, the design of efficient yacht hulls.
In designing an efficient yacht hull, one must consider water-hull resistance, wave generation, near-field and far-field wake, side pressure, velocity prediction, and stability. The design is typically done with simple computational fluid dynamics. Sail design complicated the problem.
Thus, there are hundreds of equations to optimize to find a good yacht.
Is this a question which today's DWave can develop answers?
I read DWave gives too many answers for equation systems. My boat designs will be optimized for one speed and free curves and they will be very beautiful.
I want to get a good computation in short time.
What do you think, what would be the time taken to do this using a DWave machine?
"
['complexity-theory']," Title: Good metaphors for n-level quantum systemsBody: It seems that a coin flip game is a decent metaphor for a 2-level system. Until 1 of the 2 players picks heads or tails, even if the coin has already been flipped, the win/loss wave form has not yet collapsed.
Would rock paper scissors be a good metaphor for qutrits? Where the number of players corresponds w/ the number of qutrits (eg. $3^n$ possible states).
Would a standard pack of 52 cards be a good metaphor for a 52-level quantum system (the game being guessing correctly a card selected from the deck at random)?
Particularly interested in game based metaphors because of the easy correlation to combinitorial game theory & computation complexity.
"
"['programming', 'simulation', 'q#']"," Title: Can we perform quantum mechanical simulations using a quantum computer?Body: I'm a computer science major who's really keen on physics and quantum mechanics. I have started learning about Q# and D-Wave, but I just wanted to know if it's possible to test quantum mechanical theories using quantum computers.
If so, then what all different things should I look into? For example, Q# allows us about 30 qubits for free developing. What kind of simulations can I do with that many qubits?
"
"['quantum-state', 'simulation', 'quirk']"," Title: Incorrectly Calculating Probability Amplitudes for 3-qbit CircuitBody: I’m trying to calculate the probability amplitudes for this circuit:
My Octave code is:
sys = kron([1; 0], [1;0], [1;0])
h = 1/sqrt(2) * [1 1; 1 -1];
c = [1 0 0 0; 0 1 0 0; 0 0 0 1; 0 0 1 0];
op1 = kron(h, eye(2), eye(2));
op2 = kron(c, eye(2));
op3 = kron(eye(2), c);
op4 = kron(h, eye(2), eye(2));
op4*op3*op2*op1 * sys
The output is:
ans =
0.50000
0.00000
0.00000
0.50000
0.50000
0.00000
0.00000
-0.50000
This differs from the results the quantum circuit simulator gives me, where have I gone wrong?
"
['algorithm']," Title: Can a quantum computer easily determine the mixing time of the Rubik's cube group?Body: Officials in Rubik's cube tournaments have used two different ways of scrambling a cube. Presently, they break a cube apart and reassemble the cubies in a random order $\pi\in G$ of the Rubik's cube group $G$. Previously, they would apply a random sequence $g$ of Singmaster moves $\langle U,D, F, B, L, R\rangle$.
However, the length $t$ of the word $g$ - the number of random moves needed in order to fully scramble the cube such that each of the $\Vert G\Vert=43,252,003,274,489,856,000$ permutations is roughly equally likely to occur - is presently unknown, but must be at least $20$. This length $t$ can be called the mixing time of a random walk on the Cayley graph of the Rubik's cube group generated by the Singmaster moves $\langle U,D, F, B, L, R\rangle$.
Would a quantum computer have any advantages to determining the mixing time $t$ of the Rubik's cube group?
I think we can have some clever sequence of Hadamard moves to create a register $\vert A \rangle$ as a uniform superposition over all $\Vert G\Vert$ such configurations; thus applying any sequence of Singmaster moves to $\vert A \rangle$ doesn't change $\vert A \rangle$.
If we have a guess $t'$ as to what the mixing time $t$ is, we can also create another register $\vert B \rangle$ as a uniform superposition of all Singmaster words of length $t'$, and conditionally apply each such word to a solved state $\vert A'\rangle$, to hopefully get a state $\vert B\rangle \vert A\rangle$ such that, if we measure $\vert A \rangle$, each of the $\Vert G \Vert$ configurations are equally likely to be measured. If $t'\lt t$, then we won't have walked along the Cayley graph of $G$ for long enough, and if we were to measure $\vert A \rangle$, configurations that are ""closer"" to the solved state would be more likely. Some clever Fourier-like transform on $\vert B \rangle$ might be able to measure how uniformly distributed $\vert A \rangle$ is.
To me this feels like something a quantum computer may be good at. For example, if $\vert A \rangle$ hasn't been uniformly mixed by all of the words in $\vert B\rangle$, then some configurations are more likely than others, e.g. $\vert A \rangle$ is more ""constant""; whereas if $\vert A \rangle$ has been fully mixed by all of the walks, then $\vert A \rangle$ is more ""balanced"". But my inuition about both quantum algorithms and Markov chains is not strong enough to get very far.
EDIT
Contrast this question with the quantum knot verification problem.
In the quantum knot verification, a merchant is given a quantum coin as a state $\vert K \rangle$ of all knots that have a particular invariant. In order to verify the quantum coin, she applies a Markov chain $M$ to transition $\vert K \rangle$ to itself (if it's a valid coin.) She must apply this Markov chain and measure the result at least $t$ times, but otherwise she has no way to construct $\vert K \rangle$ on her own (lest she could forge the coin.) So if she's given a valid coin, she's given a state that she can't produce on her own, along with a Markov chain as a matrix $M$, and she presumably knows the mixing time $t$; she's required to test that $\vert K \rangle$ is valid.
In the present question, it's probably pretty easy to generate $\vert RC \rangle$ of all Rubik's cube permutations. The quantum circuit corresponding to the Markov chain, call it $S$, of Singmaster moves, is also probably pretty easy to build. However, the mixing time $t$ is unknown, and is the one thing to be determined.
"
"['decoherence', 'biology', 'biocomputing']"," Title: Does the quantum coherence in the FMO complex have any significance to quantum computing (on a biological substrate)?Body: The quantum effects of the FMO complex (photosynthetic light harvesting complex found in green sulfur bacteria) have been well studied as well as the quantum effects in other photosynthetic systems. One of the most common hypotheses for explaining these phenomenon (focusing on FMO complex) is Environment-Assisted Quantum Transport (ENAQT) originally described by Rebentrost et al.. This mechanism describes how certain quantum networks can ""use"" decoherence and environment effects to improve the efficiency of quantum transport. Note that the quantum effectss arise from the transport of excitons from one pigment (chlorophyll) in the complex to another. (There is a question that discusses the quantum effects of the FMO complex in a little more detail).
Given that this mechanism allows for quantum effects to take place at room temperatures without the negative effects of decoherence, are their any applications for quantum computing? There are some examples of artificial systems that utilize ENAQT and related quantum effects. However, they present biomimetic solar cells as a potential application and do not focus on the applications in quantum computing.
Originally, it was hypothesized that the FMO complex performs a Grover's search algorithm, however, from what I understand, it has now since been showed that this is not true.
There have been a couple studies that use chromophores and substrates not found in biology (will add references later). However, I would like to focus on systems that use a biological substrate.
Even for biological substrates there are a couple examples of engineered systems that use ENAQT. For example, a virus-based system was developed using genetic engineering. A DNA-based excitonic circuit was also developed. However, most of these examples present photovoltaics as a main example and not quantum computing.
Vattay and Kauffman was (AFAIK) the first to study the quantum effects as quantum biological computing, and proposed a method of engineering a system similar to the FMO complex for quantum computing.
How could we use this mechanism to build new types of computers? In
the light harvesting case the task of the system is to transport the
exciton the fastest possible way to the reaction center whose position
is known. In a computational task we usually would like to find the
minimum of some complex function $f_n$. For the simplicity let this
function have only discrete values from 0 to K. If we are able to map
the values of this function to the electrostatic site energies of the
chromophores $H_{nn} = \epsilon_0 f_n$ and we deploy reaction centers
near to them trapping the excitons with some rate $κ$ and can access
the current at each reaction center it will be proportional with the
probability to find the exciton on the chromophore $j_n ∼ κ\rho_{nn}$.
How can the quantum effects of the FMO complex be used on a biological substrate for quantum computing? Given that the quantum effects occur due to the transport of excitons on network structures, could ENAQT provide more efficient implementations of network-based algorithms (ex: shortest path, traveling salesman, etc.)?
P.S. I will add more relevant references if needed. Also, feel free to add relevant references as well.
"
"['quantum-gate', 'programming', 'gate-synthesis']"," Title: How do we code the matrix for a controlled operation knowing the control qubit, the target qubit and the $2\times 2$ unitary?Body: Having n qubits, I want to have the unitary described a controlled operation.
Say for example you get as input a unitary, an index for a controlled qubit and another for a target.
How would you code this unitary operation?
"
"['resource-request', 'matrix-representation']"," Title: Is there a tool that can give you the unitary representing a quantum circuit from just a string?Body: Say I have a string representing the operations of a quantum circuit.
I want to have the unitary operator representing it.
Is there a tool for doing so in Python or else?
"
"['algorithm', 'quantum-gate', 'gate-synthesis']"," Title: How do you implement the Toffoli gate using only single-qubit and CNOT gates?Body: I've been reading through ""Quantum Computing: A Gentle Introduction"", and I've been struggling with this particular problem. How would you create the circuit diagram, and what kind of reasoning would lead you to it?
"
"['quantum-gate', 'superposition']"," Title: Advantage of Hadamard gate over rotation about the X axis for creating superpositionsBody: When I look at most circuits (admittedly small sample as I'm a beginner), the Hadamard gate is used a lot to prepare a superposition from say the $\mid0\rangle$ state.
But upon a little reflection, we can prepare a superposition using a $\dfrac{\pi}{2}$ rotation about the X axis.
I do know that a successive application of the Hadamard gate yields the initial state back (for any state).
If we have one of $\mid0\rangle$ or $\mid1\rangle$, we can recover them using a succession of said rotation followed by a NOT gate (Pauli-X).
So why is the Hadamard gate preferred to create superpositions when it uses more gates (rotation about Z then rotation about X then rotation about Z again)?
If it is because the Hadamard gate allows recovery of any initial state, why is that property so important? (Even when not actually used when I look at the examples I see.)
"
"['complexity-theory', 'mathematics', 'qudit', 'many-body-systems']"," Title: Hilbert space to accurately represent 3x3 Rubik's CubeBody: What Hilbert space of dimension greater than 4.3e19 would be most convenient for working with the Rubik's Cube verse one qudit?
The cardinality of the Rubik's Cube group is given by:
Examples
66 Qubits yields ~7.378697629484e19 states (almost more than double the number of states needed)
42 Qutrits yields ~1.094189891315e20 states (more than double the needed states)
"
"['resource-request', 'quantum-biology']"," Title: Resources for quantum biologyBody: Are there any books, courses, tutorials, etc. for studying quantum biology?
Preferably they provide some introduction/primer on the relevant quantum aspects of the quantum biological systems being described.
"
"['algorithm', 'classical-computing', 'speedup', 'models']"," Title: What is the simplest algorithm to demonstrate intuitively quantum speed-up?Body: What's the simplest algorithm (like Deutsch's algorithm and Grover's Algorithm) for intuitively demonstrating quantum speed-up? And can this algorithm be explained intuitively?
Ideally this would be also illustrate clear how quantum interference is being utilized, and why it is not possible or useful using just interference of classical waves.
"
"['circuit-construction', 'gate-synthesis', 'optimization']"," Title: Minimum number of CNOTs for Toffoli with non-adjacent controlsBody: I want to decompose a Toffoli gate into CNOTs and arbitrary single-qubit gates. I want to minimize the number of CNOTs. I have a locality constraint: because the Toffoli is occurring in a linear array, the two controls are not adjacent to each other (so no CNOTs directly between the controls).
What is the minimum number of CNOTs required to perform this task? What is an example of a circuit which achieves this minimum?
To be specific, this is the layout I have in mind:
1 ---@---
|
2 ---X---
|
3 ---@---
Each control is adjacent to the target, but the controls are not adjacent to each other.
"
"['algorithm', 'speedup', 'complexity-theory', 'mathematics', 'quantum-walks']"," Title: Quantum Algorithm for God's NumberBody: God's number is the worst case of God's algorithm which is
a notion originating in discussions of ways to solve the Rubik's Cube puzzle, but which can also be applied to other combinatorial puzzles and mathematical games. It refers to any algorithm which produces a solution having the fewest possible moves, the idea being that an omniscient being would know an optimal step from any given configuration.
Calculating God's number to be 20 took ""35 CPU-years of idle (classical) computer time.""
What kind of speed up could be achieved with a quantum approach?
"
['quantum-gate']," Title: Just want to confirm: Do two CNOT gates cancel each other?Body: I see somewhere that this happens:
But I wonder if this is just identity.
"
['simulation']," Title: Can a Turing machine simulate a quantum computer?Body: I know that a Turing machine1 can theoretically simulate ""anything"", but I don't know whether it could simulate something as fundamentally different as a quantum-based computer. Are there any attempts to do this, or has anybody proved it possible/not possible?
I've googled around, but I'm not an expert on this topic, so I'm not sure where to look. I've found the Wikipedia article on quantum Turing machine, but I'm not certain how exactly it differs from a classical TM. I also found the paper Deutsch's Universal Quantum Turing Machine, by
W. Fouché et al., but it is rather difficult to understand for me.
1. In case it is not clear, by Turing machine I mean the theoretical concept, not a physical machine (i.e. an implementation of the theoretical concept).
"
"['complexity-theory', 'cryptography']"," Title: Is it possible for an encryption method to exist which is impossible to crack, even using quantum computers?Body: Quantum computers are known to be able to crack in polynomial time a broad range of cryptographic algorithms which were previously thought to be solvable only by resources increasing exponentially with the bit size of the key. An example for that is Shor's algorithm.
But, as far I know, not all problems fall into this category. On Making Hard Problems for Quantum Computers, we can read
Researchers have developed a computer algorithm that doesn’t solve problems but instead creates them for the purpose of evaluating quantum computers.
Can we still expect a new cryptographic algorithm which will be hard to crack using even a quantum computer?
For clarity: the question refers to specifically to the design of new algorithms.
"
"['quantum-gate', 'quantum-state']"," Title: How do the probabilities of each state change after a transformation of a quantum gate?Body: Quantum gates are represented by matrices, which represent the transformations applied to qubits (states).
Suppose we have some quantum gate which operates on $2$ qubits.
How does the quantum gate affect (not necessarily change it) the result of measuring the state of the qubits (as the measurement result is affected greatly by the probabilities of each possible state)? More specifically, is it possible to know, in advance, how the probabilities of each state change due to the quantum gate?
"
"['simulation', 'memory-space', 'interpretations']"," Title: Simulating a system inside a systemBody:
The minimum size of a computer that could simulate the universe would
be the universe itself.
This is quite a pretty big theory in classical computing and physics because to contain the information of the whole universe, you require a minimum information storage space that is of the size of the universe itself.
But, quantum computing computes and stores data in parallel to other data and thus while being efficient is actually more compact. We are talking ideal systems, so cooling mechanisms don't count as part of the computer.
Then, could such a system simulate the whole universe?
(I thought of a solution that I don't know how to actually prove. My logic is mostly based on the many worlds interpretation of quantum mechanics and that a quantum computer actually uses different universes to compute in parallel, thus increasing memory space and speed).
Any inputs will be gladly received and are highly appreciated.
"
['cryptography']," Title: How is quantum cryptography different from cryptography used nowadays?Body: Recent researches indicate that quantum algorithms are able to solve typical cryptology problems much faster than classic algorithms.
Have any quantum algorithms for encryption been developed?
I'm aware about BB84, but it only seems to be a partial solution for solving the networking.
"
['applications']," Title: Does quantum computing have an essential advantage in analyzing/controlling chaotic systems?Body:
- The enthusiast-level, inaccurate knowledge about quantum computers is that they can solve many exponentially solvable problems in polynomial time.
- The enthusiast-level, inaccurate knowledge about chaotic systems is that being highly sensitive to initial conditions, their prediction and control is very hard above a - typically, not enough - accuracy.
Today, one of the most famous practical usage of chaotic systems is the problem of modeling the weather of the Earth.
Putting (1) and (2) together, I think using quantum computers, we may have a significant (polynomial to exponential) step to handle them. Is it correct?
Do we have any essential advantage to handle chaos even more than this?
"
['emulation']," Title: Are there emulators for quantum computers?Body: Is there any way to emulate a quantum computer in my normal computer, so that I will be able to test and try quantum programming languages (such as Q#)? I mean something that I can really test my hypothesis and gets the most accurate results.
Update: I'm not really looking for simulating a quantum computer, but I'm not sure if its possible to efficiently emulate one on a normal non-quantum based PC.
"
"['simulation', 'many-body-systems']"," Title: Can we synthesize quantum many body systems with quantum computers quickly in the general case?Body: Quantum computing can be used to efficiently simulate quantum many-body systems.
Solving such a problem is classically hard because its complexity grows exponentially with the problem size (roughly with the degree of freedoms), which is an inherent consequence of the Schroedinger-equation.
My intuitive understanding of this fact is that using quantum computers, we can essentially simulate the quantum many-body system, thus making the theoretical calculation essentially an experiment.
What about the reverse problem?
More specifically, consider the situation in which
- we have a description of a quantum many-body system, i.e. we know a formalized set of requirements whose behavior it should follow,
- and we are trying to find the actual system for this description?
In a practical example, we have the required properties of a chemical compound. The goal is to find a chemical formula which fulfills the requirements.
This looks for me a harder task as to calculate the physical properties of a known compound (which is, in essence, ""only"" a solution of the Schroedinger-equation).
For example, such a description of a practical problem in human language would be this:
I want a room temperature superconductor.
And the output would be:
The formula is: ...
Extension:
We have the dynamics, or some type of behavior of the system. In the case of chemical compounds, it could be, for example, excitation spectrum or superconductivity transition temperature. The important thing is that we have here a different direction: not from a given QM system do we want to calculate the behavior (= Schroedinger equation), but we have a wanted behavior (now: superconductivity transition temperature), we have a nearly-infinite set of possible compounds, and we are looking for the compound which fulfills the selection criteria ($T_c \geq 300K$).
"
"['entanglement', 'communication']"," Title: Quantum entanglement for faster-than-light (FTL) network communication?Body: Quantum entanglement is 2 atoms that are paired together and when you stop one from spinning the other also stops with the same spin. Can you use these pairs to have faster-than-light (FTL) communication between 2 computers?
"
"['simulation', 'classical-computing']"," Title: Can a quantum computer simulate a normal computer?Body: Similar to the question Could a Turing Machine simulate a quantum computer?: given a 'classical' algorithm, is it always possible to formulate an equivalent algorithm which can be performed on a quantum computer? If yes, is there some kind of procedure we can follow for this? The resulting algorithm will probably not take full advantage of the possibilities of quantum computing, it's more of a theoretical question.
"
"['error-correction', 'fault-tolerance']"," Title: What level of ""confidence"" of the result from a quantum computer is possible?Body: At a very basic level, reading or measuring a qubit forces it to be in one state or the other, so the operation of a quantum computer to gain a result collapses the state into one of many possibilities.
But as the state of each qubit is probabilistic, surely this means the result can actually be any of those possibilities, with varying likelihood. If I re-run the programme - should I expect to see different results?
How can I be sure I have the ""best"" result? What provides that confidence? I assume it cannot be the interim measurements as described in this question as they do not collapse the output.
"
"['physical-realization', 'architecture', 'physical-qubit', 'superconducting-quantum-computing', 'dilution-refrigerator']"," Title: What cryogenic systems are suitable for superconducting qubits?Body: Is a dilution refrigerator the only way to cool superconducting qubits down to 10 millikelvin? If not, what other methods are there, and why is dilution refrigeration the primary method?
"
"['physical-realization', 'performance', 'annealing', 'd-wave']"," Title: How much faster is “D-Wave Two” compared to its predecessor?Body: I don't have any specific task or algorithm in mind, so depending on how they were tested – Is there any research which shows just how the D-Wave Two computer was faster (in terms of computation performance) than its predecessor (D-Wave One)?
"
"['simulation', 'classical-computing', 'memory-space']"," Title: How much memory is required to simulate a 48-qubit circuit?Body: This CDMTCS Report 514, 2017 entitled ""The Road to Quantum Computational Supremacy"" states (in Section 6) that the amount of memory needed to simulate random quantum circuits on classical computers increases rapidly with the number of qubits of the circuit. A circuit on 48 qubits would require a huge amount of memory to be stored.
How much is it exactly? And how can you calculate it?
"
"['cryptography', 'blind-quantum-computing']"," Title: Blind quantum computing — generic structure variable selectionBody: Background
Recently I came upon a research article entitled Experimental Demonstration of Blind Quantum Computing. Within this research article, the scientists claimed that - through the proper choice of a generic structure - a data engineer can hide the information about how the data was calculated.
Question
If a scientist were to use a BQC (Blind Quantum Computation) protocol to calculate private measurements, what types of variables would they have to use to formulate a generic structure for the blind quantum state?
Thoughts
I would like to understand what types of variables could go into the generic structure in order to help keep the data calculations hidden from the server. If you select certain known generic variables, I do not understand why the selection of other known generic variables would prevent the data calculations from being hidden.
"
"['physical-qubit', 'optical-quantum-computing', 'spdc', 'quantum-state']"," Title: State produced by spontaneous parametric down-conversion (SPDC)Body: I'm researching SPDC's efficacy for use in an optical quantum computing model and I've been trying to figure out exactly what state the photons are in when they come out (as represented by a vector, for example), if I'm using type 1 SPDC and I'm looking at the polarization of the photons.
Please provide any references used =)
"
"['physical-qubit', 'noise']"," Title: How to make qubits more stable towards noise?Body: In this paper and this paper, the ""Noise Stability of Qubits"" (the stability of qubits to external noise) has been discussed. In the first one, Gil Kalai states that it is difficult to create a quantum computer since the noise produced in creating a few qubits is enough to reach the threshold for corrupting the entire system of qubits. What can be done to reduce the noise and increase stability of the qubits?
EDIT: To clarify the doubts mentioned in the comments, I want to add that IBM, Rigetti and some other companies have already started manufacturing Quantum Computers with 4-6 qubits. How have they overcome or what are they working on to face this problem of noise sensitivity?
"
['alibaba-cloud']," Title: How to get started with the Alibaba Cloud Quantum Computing Service?Body: According to this press announcement from March 1st 2018, the Alibaba Cloud offers access to an 11 qubit quantum computer via their cloud services. Quote:
Alibaba Cloud, [...] and Chinese Academy of Sciences (CAS) [...] have launched the superconducting quantum computing cloud, featuring a quantum processor with 11 quantum bits (qubits) of power. [...]
Users can now access the superconducting quantum computing cloud through Alibaba Cloud’s quantum computing cloud platform to efficiently run and test custom built quantum codes and download the results.
However, I have been unable to find any mention of this service anywhere else on their site than in the press announcement. No documentation. No mention in the "Products" overview. Nothing. Does anyone know, how to get started here?
"
"['speedup', 'quantum-advantage']"," Title: When will we know that quantum supremacy has been reached?Body: The term ""quantum supremacy"" - to my understanding - means that one can create and run algorithms to solve problems on quantum computers that can't be solved in realistic times on binary computers. However, that is a rather vague definition - what would count as ""realistic time"" in this context? Does it have to be the same algorithm or just the same problem? Not being able to simulate quantum computers of certain sizes surely can't be the best measure.
"
['noise']," Title: What exactly is meant by ""noise"" in the following context?Body: The strengthened version of the Church-Turing thesis states that:
Any algorithmic process can be simulated efficiently using a Turing machine.
Now, on page 5 (chapter 1), the book Quantum Computation and Quantum Information: 10th Anniversary Edition By Michael A. Nielsen, Isaac L. Chuang goes on to say that:
One class of challenge to the the strong Church Turing thesis comes
from the field of analog computation. In the years since Turing,
many different teams of researchers have noticed that certain types of
analog computers can efficiently solve problems believed to have no
efficient solution on a Turing machine. At the first glance these
analog computers appear to violate the strong form of the
Church-Turing thesis. Unfortunately for analog computation it turns
out that when realistic assumptions about the presence of noise in
analog computers are made, their power disappears in all known
instances; they cannot efficiently solve problems which are not
solvable on a Turing machine. This lesson – that the effects of
realistic noise must be taken into account in evaluating the
efficiency of a computational model – was one of the great early
challenges of quantum computation and quantum information, a challenge
successfully met by the development of a theory of quantum
error-correcting codes and fault-tolerant quantum computation. Thus,
unlike analog computation, quantum computation can in principle
tolerate a finite amount of noise and still retain its computational
advantages.
What exactly is meant by noise in this context? Do they mean thermal noise? It's strange that the authors did not define or clarify what they mean by noise in the previous pages of the textbook.
I was wondering if they were referring to noise in a more generalized setting. Like, even if we get rid of the conventional noise - like industrial noise, vibrational noise, thermal noise (or reduce them to negligible levels), noise could still refer to the uncertainties in amplitude, phase, etc, which arise due to the underlying quantum mechanical nature of the system.
"
"['complexity-theory', 'postselection', 'bqp', 'terminology']"," Title: What is postselection in quantum computing?Body: A quantum computer can efficiently solve problems lying in the complexity class BQP. I have seen a claim the one can (potentially, because we don't know whether BQP is a proper subset or equal to PP) increase the efficiency of a quantum computer by applying postselection and that the class of efficiently solvable problems becomes now postBQP = PP.
What does postselection mean here?
"
['models']," Title: What are the models of quantum computation?Body: It seems that quantum computing is often taken to mean the quantum circuit method of computation, where a register of qubits is acted on by a circuit of quantum gates and measured at the output (and possibly at some intermediate steps). Quantum annealing at least seems to be an altogether different method to computing with quantum resources1, as it does not involve quantum gates.
What different models of quantum computation are there? What makes them different?
To clarify, I am not asking what different physical implementations qubits have, I mean the description of different ideas of how to compute outputs from inputs2 using quantum resources.
1. Anything that is inherently non-classical, like entanglement and coherence.
2. A process which transforms the inputs (such as qubits) to outputs (results of the computation).
"
"['error-correction', 'noise', 'fault-tolerance']"," Title: Which quantum error correction code has the highest threshold (as proven at the time of writing this)?Body: Which quantum error correction code currently holds the record in terms of the highest threshold for fault-tolerance? I know that the surface code is pretty good ($\approx10^{-2}$?), but finding exact numbers is difficult. I also read about some generalizations of the surface code to 3D clusters (topological quantum error correction). I guess the main motivation for this research was to increase the threshold for calculations of arbitrary length.
My question is: Which quantum error correction code has the highest threshold (as proven at the time of writing this)?
In order to judge this value it would be nice to know what threshold is theoretically achievable. So if you know of (non-trivial) upper bounds on thresholds for arbitrary quantum error correction codes that would be nice.
"
['notation']," Title: How does bra-ket notation work?Body: Quantum algorithms frequently use bra-ket notation in their description. What do all of these brackets and vertical lines mean? For example: $|ψ⟩=α|0⟩+β|1⟩$
While this is arguably a question about mathematics, this type of notation appears to be used frequently when dealing with quantum computation specifically. I'm not sure I have ever seen it used in any other contexts.
Edit
By the last part, I mean that it is possible to denote vectors and inner products using standard notation for linear algebra, and some other fields that use these objects and operators do so without the use of bra-ket notation.
This leads me to conclude that there is some difference/reason why bra-ket is especially handy for denoting quantum algorithms. It is not an assertion of fact, I meant it as an observation. ""I'm not sure I have seen it used elsewhere"" is not the same statement as ""It is not used in any other contexts"".
"
"['error-correction', 'noise']"," Title: Is error correction necessary?Body: Why do you need error correction? My understanding is that error correction removes errors from noise, but noise should average itself out. To make clear what I'm asking, why can't you, instead of involving error correction, simply run the operations, say, a hundred times, and pick the average/most common answer?
"
"['physical-realization', 'architecture', 'experiment']"," Title: Why must quantum computers be kept near absolute zero?Body: Online descriptions of quantum computers often discuss how they must be kept near absolute zero $\left(0~\mathrm{K}~\text{or}~-273.15~{\left. {}^{\circ}\mathrm{C} \right.}\right)$.
Questions:
- Why must quantum computers operate under such extreme temperature conditions?
- Is the need for extremely low temperatures the same for all quantum computers, or does it vary by architecture?
- What happens if they overheat?
Sources : Youtube, D-Wave
"
['physical-qubit']," Title: What is the difference between a qubit and classical bit?Body: As I understand it, the main difference between quantum and non-quantum computers is that quantum computers use qubits while non-quantum computers use (classical) bits.
What is the difference between qubits and classical bits?
"
['quantum-memory']," Title: What protocols have been proposed to implement quantum RAMs?Body: The crucial role of random access memories (RAMs) in the context of classical computation makes it natural to wonder how one can generalise such a concept to the quantum domain.
Arguably the most notable (and first?) work proposing an efficient QRAM architecture is Giovannetti et al. 2007.
In this work it was shown that their ""bucket brigate"" approach allows access to the content of the memory with $\mathcal O(\log N)$ operations, where $N$ is the number of memory slots. This is an exponential improvement with respect to alternative approaches, which require $\mathcal O(N^{\alpha})$ operations.
Implementing this architecture is however highly nontrivial from an experimental point of view.
Is the above the only known way to implement a QRAM? Or have there been other theoretical works in this direction? If so, how do they compare (pros and cons) with the Giovannetti et al. proposal?
"
"['physical-realization', 'optical-quantum-computing', 'architecture', 'superconducting-quantum-computing']"," Title: Why do optical quantum computers not have to be kept near absolute zero while superconducting quantum computers do?Body: This is a follow-up question to @heather's answer to the question : Why must quantum computers be kept near absolute zero?
What I know:
- Superconducting quantum computing: It is an implementation of a quantum computer in a superconducting electronic circuit.
- Optical quantum computing: It uses photons as information carriers, and linear optical elements to process quantum information, and uses photon detectors and quantum memories to detect and store quantum information.
Next, this is what Wikipedia goes on to say about superconducting quantum computing:
Classical computation models rely on physical implementations
consistent with the laws of classical mechanics. It is known, however,
that the classical description is only accurate for specific cases,
while the more general description of nature is given by the quantum
mechanics. Quantum computation studies the application of quantum
phenomena, that are beyond the scope of classical approximation, for
information processing and communication. Various models of quantum
computation exist, however the most popular models incorporate the
concepts of qubits and quantum gates. A qubit is a generalization of a
bit - a system with two possible states, that can be in a quantum
superposition of both. A quantum gate is a generalization of a logic
gate: it describes the transformation that one or more qubits will
experience after the gate is applied on them, given their initial
state. The physical implementation of qubits and gates is difficult,
for the same reasons that quantum phenomena are hard to observe in
everyday life. One approach is to implement the quantum computers in
superconductors, where the quantum effects become macroscopic, though
at a price of extremely low operation temperatures.
This does make some sense! However, I was looking for why optical quantum computers don't need ""extremely low temperatures"" unlike superconducting quantum computers. Don't they suffer from the same problem i.e. aren't the quantum phenomena in optical quantum computers difficult to observe just as for superconducting quantum computers? Are the quantum effects already macroscopic at room temperatures, in such computers? Why so?
I was going through the description of Linear optical quantum computing on Wikipedia, but found no reference to ""temperature"" as such.
"
"['measurement', 'research', 'non-locality', 'contextuality']"," Title: Are there any experimental groups currently measuring quantum contextuality?Body: I work as a theorist with my current research interests in ""quantum contextuality"". For those perusing the question, this is essentially a generalization of non-locality where we can show a quantum system does not admit a hidden-variable model. So in some sense, it's impossible to look at the problem classically.
For further background, contextuality can often be formulated as a resource for quantum computation-- which is the reason why we're interested in it. Our talking points to people are that contextuality is the right way of characterizing what's essentially quantum about a system (many would debate us on that, but that's perhaps for another thread).
What I've found so far is a proposed experiment for testing contextuality:
Cabello-2016-Experiment and a description of the implications of a successful contextuality experiment:
Winter-2014-Implications.
Most experimentalists tend to focus on entanglement (understandably; it's a lot easier to measure and more concrete to think about) - but are there any experimental groups currently working on contextuality experiments?
"
"['d-wave', 'models', 'annealing']"," Title: Why can't quantum annealing be described by a gate model?Body: This is a question I was inspired to ask based on this question, which notes that quantum annealing is an entirely different model for computation than the usual circuit model. I've heard this before, and it's my understanding that the gate-model does not apply to quantum-annealing, but I've never quite understood why that is, or how to parse the computations that an annealer can do. As I understand from several talks (some by D-wave themselves!) the fact that the annealers are confined to a specific Hamiltonian plays into it.
"
"['annealing', 'speedup', 'algorithm']"," Title: Level of advantage provided by annealing for traveling salesmanBody: My understanding is that there seems to be some confidence that quantum annealing will provide a speedup for problems like the traveling salesman, due to the efficiency provided by, ex, quantum tunneling. Do we know, however, around how much of a speedup is provided?
"
"['quantum-gate', 'unitarity']"," Title: If quantum gates are reversible how can they possibly perform irreversible classical AND and OR operations?Body: Quantum gates are said to be unitary and reversible. However, classical gates can be irreversible, like the logical AND and logical OR gates. Then, how is it possible to model irreversible classical AND and OR gates using quantum gates?
"
"['speedup', 'annealing']"," Title: How long does quantum annealing take to find the solution to a given problem?Body: Quantum annealing is an optimization protocol that, thanks to quantum tunneling, allows in given circumstances to maximize/minimize a given function more efficiently than classical optimization algorithms.
A crucial point of quantum annealing is the adiabaticity of the algorithm, which is required for the state to stay in the ground state of the time-dependent Hamiltonian.
This is however also a problem, as it means that find a solution can require very long times.
How long do these times have to be for a given Hamiltonian?
More precisely, given a problem Hamiltonian $\mathcal H$ of which we want to find the ground state, are there results saying how long would it take a quantum annealer to reach the solution?
"
"['complexity-theory', 'speedup', 'quantum-advantage']"," Title: Are there problems in which quantum computers are known to provide an exponential advantage?Body: It is generally believed and claimed that quantum computers can outperform classical devices in at least some tasks.
One of the most commonly cited examples of a problem in which quantum computers would outperform classical devices is $\text{Factoring}$, but then again, it is also not known whether $\text{Factoring}$ is also efficiently solvable with a classical computer (that is, whether $\text{Factoring}\in \text{P}$).
For other commonly cited problems in which quantum computers are known to provide an advantage, such as database search, the speedup is only polynomial.
Are there known instances of problems in which it can be shown (either proved or proved under strong computational complexity assumptions) that quantum computers would provide an exponential advantage?
"
"['quantum-gate', 'measurement', 'unitarity', 'quantum-operation']"," Title: If all quantum gates must be unitary, what about measurement?Body: All quantum operations must be unitary to allow reversibility, but what about measurement? Measurement can be represented as a matrix, and that matrix is applied to qubits, so that seems equivalent to the operation of a quantum gate. That's definitively not reversible. Are there any situations where non-unitary gates might be allowed?
"
"['speedup', 'complexity-theory', 'cryptography']"," Title: Are there any encryption suites which can be cracked by classical computers but not quantum computers?Body: Are there any encryption suites that can be cracked by usual computers or super computers, but not quantum computers?
If that's possible, what assumptions will it depend on? (Factorizing big numbers, $a^b\pmod d$ $a^c\pmod d$ $a^{bc}\pmod d$ etc...)
"
"['cryptography', 'key-distribution']"," Title: Advantage of quantum key distribution over post-quantum cryptographyBody: Post-quantum cryptography like lattice-based cryptography is designed to be secure even if quantum computers are available. It resembles currently employed encryptions, but is based on problems which are most likely not efficiently solvable by a quantum computer.
Obviously research on quantum key distribution (QKD) continues. But what exactly are advantages of quantum key distribution over post-quantum cryptography?
The development of a new technology like QKD can have great side effects, and maybe QKD will be more cost-efficient or faster in the very long term, but I doubt that this is the main reason.
"
"['fidelity', 'randomised-benchmarking']"," Title: Purpose of using Fidelity in Randomised BenchmarkingBody: Often, when comparing two density matrices, $\rho$ and $\sigma$ (such as when $\rho$ is an experimental implementation of an ideal $\sigma$), the closeness of these two states is given by the quantum state fidelity $$F = tr\left(\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right),$$ with infidelity defined as $1-F$.
Similarly, when comparing how close an implementation of a gate is with an ideal version, the fidelity becomes $$F\left( U, \tilde U\right) = \int\left[tr\left(\sqrt{\sqrt{U\left|\psi\rangle\langle\psi\right|U^\dagger}\tilde U\left|\psi\rangle\langle\psi\right|\tilde U^\dagger\sqrt{U\left|\psi\rangle\langle\psi\right|U^\dagger}}\right)\right]^2\,d\psi,$$ where $d\psi$ is the Haar measure over pure states. Unsurprisingly, this can get relatively unpleasant to work with.
Now, let's define a matrix $M = \rho - \sigma$ in the case of density matrices, or $M = U - \tilde U$ when working with gates. Then, the Schatten norms1, such as $\| M\|_1 = tr\left(\sqrt{M^\dagger M}\right)$, $\| M\|_2^2 = tr\left(M^\dagger M\right)$, or other norms, such as the diamond norm can be computed.
These norms are often easier to compute2 than the above Fidelity. What makes matters worse is that in randomised benchmarking calculations, infidelity doesn't even appear to be a great measure, yet is the number that's used every time that I've seen when looking at benchmarking values for quantum processors.3
So, Why is (in)fidelity the go-to value for calculating gate errors in quantum processors (using randomised benchmarking), when it doesn't seem to have a helpful meaning and other methods, such as Schatten norms, are easier to calculate on a classical computer?
1 The Schatten p-norm of $M$ is $\| M\|_p^p = tr\left(\sqrt{M^\dagger M}^p\right)$
2 i.e. plug in a noise model on a (classical) computer and simulate
3 Such as IBM's QMX5
"
"['simulation', 'performance']"," Title: Building a quantum computer in simulationBody: If one wants to start building a quantum computer from scratch inside simulations (like how people get to build a classical computer from scratch in the Nand2Tetris course), is it possible?
If yes, what would be some possible approaches?
Also, what will be the limits of such a simulated machine, given a specific amount of classical computing power? For instance, if we were to pick your average desktop/laptop, what will be the limit? If we take a supercomputer (like Titan) then what would be the limit?
"
"['performance', 'annealing', 'd-wave', 'classical-computing', 'experiment']"," Title: Is there proof that the D-wave (one) is a quantum computer and is effective?Body: I'm admittedly a novice in this field, but I have read that, while the D-wave (one) is an interesting device, there is some skepticism regarding it being 1) useful and 2) actually a 'quantum computer'.
For example, Scott Aaronson has expressed multiple times that he is skeptical about whether the 'quantum' parts in the D-wave are actually useful:
It remains true, as I’ve reiterated here for years, that we have no direct evidence that quantum coherence is playing a role in the observed speedup, or indeed that entanglement between qubits is ever present in the system.
Exerpt from this blog.
Additionally, the relevant Wikipedia section on skepticism against the D-wave is a mess.
So, I ask:
- I know that D-wave claims to use some sort of quantum annealing. Is there (dis)proof of the D-wave actually using quantum annealing (with effect) in its computations?
- Has it been conclusively shown that the D-wave is (in)effective? If not, is there a clear overview of the work to attempt this?
"
"['algorithm', 'circuit-construction', 'grovers-algorithm', 'complexity-theory', 'oracles']"," Title: How is the oracle in Grover's search algorithm implemented?Body: Grover's search algorithm provides a provable quadratic speed-up for unsorted database search.
The algorithm is usually expressed by the following quantum circuit:
In most representations, a crucial part of the protocol is the ""oracle gate"" $U_\omega$, which ""magically"" performs the operation $|x\rangle\mapsto(-1)^{f(x)}|x\rangle$.
It is however often left unsaid how difficult realizing such a gate would actually be.
Indeed, it could seem like this use of an ""oracle"" is just a way to sweep the difficulties under the carpet.
How do we know whether such an oracular operation is indeed realizable?
And if so, what is its complexity (for example in terms of complexity of gate decomposition)?
"
"['quantum-gate', 'quantum-fourier-transform', 'fourier-sampling']"," Title: How does Fourier sampling actually work (and solve the parity problem)?Body: I'm writing with respect to part I and part II of the Fourier sampling video lectures by Professor Umesh Vazirani.
In part I they start with:
In the Hadamard Transform:
$$|0...0\rangle \to \sum_{\{0,1\}^n}\frac{1}{2^{n/2}}|x\rangle$$
$$|u\rangle =|u_1...u_n\rangle \to \sum_{\{0,1\}^n}\frac{(-1)^{u.x}}{2^{n/2}}|x\rangle \quad \text{(where $u.x=u_1x_1+u_2x_2+...+u_nx_n$)}$$
In Fourier Sampling:
$$|\psi\rangle=\sum_{\{0,1\}}^{n}\alpha_x|x\rangle \to \sum_{x}\hat{\alpha_x}|x\rangle=|\hat{\psi}\rangle$$
When $|\hat{\psi}\rangle$ is measured we see $x$ with probability $|\hat{\alpha_x}|^2$.
In part II:
The Parity Problem:
We are given a function $f:\{0,1\}^n\to\{0,1\}$ as a black box. We
know that $f(x)=u.x$ (i.e. $u_1x_1+u_2x_2+...+u_nx_n (\text{mod 2})$) for some hidden $u\in\{0,1\}^{n}$. How do we
figure out $u$ with as few queries to $f$ as possible?
They say that we need to follow a two step procedure for figuring out $u$ in minimum possible number of steps.
- Set up a superposition $\frac{1}{2^{n/2}}\sum_{x}(-1)^{f(x)}|x\rangle$
- Fourier sample to obtain $u$.
This is where I got lost. I don't understand what exactly they mean by ""set up a superposition..."". Why should we do it? And how does Fourier sampling (as described) help to determine $u$ ?
They further build a quantum gate like this:
Even this doesn't make sense to me. They're performing Hadamard transforms on a set of n-qubits having state $|0\rangle$ and then bit flip and again Hadamard transform. So we get back to where we were initially. How does an extra $|-\rangle$ state input help by outputting $- \oplus f(0...0)$? I'm not even sure what operation $\oplus$ stand for, here.
"
"['physical-realization', 'architecture']"," Title: Dependency of architecture on hardwareBody: How much of a role does the type of hardware used to implement the building blocks (like qubits, the circuits, the communication channels,quantum RAM etc.) have to play when designing the architecture for a full scale quantum computer?
My own thoughts on the matter: Architecture should not depend on the way the hardware is realised. Because if it did, then every time someone came up with a novel design for the hardware, it would require rethinking the architecture - not a bad idea if you are looking to improve your architecture but that rethinking should be born out of a desire to improve the computer in general and not simply accommodate some new RAM implementation.
"
"['quantum-state', 'simulation']"," Title: How to compactly represent multiple qubit states?Body: Since access to quantum devices capable of quantum computing is still extremely limited, it is of interest to simulate quantum computations on a classical computer. Representing the state of $n$ qubits as a vector takes $2^n$ elements, which greatly restricts the number of qubits one can consider in such simulations.
Can one use a representation1 that is more compact, in the sense that it uses less memory and/or computational power than the simple vector representation? How does it work?
While easy to implement, it is clear that the vector representation is wasteful for states that exhibit sparsity and/or redundancy in their vector representation. For a concrete example, consider the 3-qubit state $(1/\sqrt{3}, 1/\sqrt{3},0,0,0,-1/\sqrt{3}, 0,0)^T$. It has $2^3$ elements but they only assume $3$ possible values, with most of the elements being $0$. Of course, to be useful in simulating a quantum computation we would also need to consider how to represent gates and the action of gates on qubits, and including something about these would be welcome, but I would be happy to hear just about qubits too.
1. Notice that I am asking about the representations, not software, libraries or articles that might utilize/present such representations. If you present and explain a representation you are very welcome to mention where it is already used though.
"
"['quantum-gate', 'circuit-construction']"," Title: Why is it important to eliminate the garbage qubits?Body: Most reversible quantum algorithms use standard gates like Toffoli gate (CCNOT) or Fredkin gate (CSWAP). Since some operations require a constant $\left|0\right>$ as input and the number of inputs and outputs is equal, garbage qubits (or junk qubits) appear in the course of the computation.
So, a principal circuit like $\left|x\right>\mapsto\left|f(x)\right>$ actually becomes $\left|x\right>\left|0\right>\mapsto\left|f(x)\right>\left|g\right>$,
where $\left|g\right>$ stands for the garbage qubit(s).
Circuits that preserve the original value ends up with $\left|x\right>\left|0\right>\left|0\right>\mapsto\left|x\right>\left|f(x)\right>\left|g\right>$
I understand that garbage qubits are inevitable if we want the circuit to stay reversible, but many sources${}^1$ claim that it is important to eliminate them. Why is it so?
${}^1$ Due to requests for sources, see for example this arXiv paper, pg 8, which says
However, each of these simple operations contains a number of additional, auxiliary qubits, which serve to store the intermediate results, but are not relevant at the end. In order not to waste any unneccesary [sic] space, it is therefore important to reset these qubits to 0 so that we are able to re–use them
or this arXiv paper which says
The removal of garbage qubits and ancilla qubits are essential in designing an efficient quantum circuit.
or the many other sources - a google search produces many hits.
"
"['algorithm', 'performance', 'classical-computing']"," Title: Is the common Computer Science usage of 'ignoring constants' useful when comparing classical computing with quantum computing?Body: Daniel Sank mentioned in a comment, responding to (my) opinion that the constant speed-up of $10^8$ on a problem admitting a polynomial time algorithm is meager, that
Complexity theory is way too obsessed with infinite size scaling limits. What matters in real life is how fast you get the answer to your problem.
In Computer Science, it is common to ignore constants in algorithms, and all in all, this has turned out to work rather well. (I mean, there are good and practical algorithms. I hope you will grant me (theoretical) algorithms researchers have had a rather large hand in this!)
But, I do understand that this is a slightly different situation as now we are:
- Not comparing two algorithms running on the same computer, but two (slightly) different algorithms on two very different computers.
- We now are working with quantum computers, for which perhaps traditional perfomance measurements may be insufficient.
In particular, the methods of algorithm analysis are merely methods. I think radically new computing methods calls for a critical review of our current performance evaluation methods!
So, my question is:
When comparing the performance of algorithms on a quantum computer versus algorithms on a classical computer, is the practice of 'ignoring' constants a good practice?
"
['quantum-memory']," Title: State of the art in quantum memoryBody: Presently, how much information can a quantum computer store, in how many qubits? What restrictions are there and how does it vary across realizations (efficiency of data storage, ease of reading and writing, etc)?
"
"['error-correction', 'speedup', 'state-distillation', 'state-injection-model']"," Title: How does magic state distillation overhead scale compare to quantum advantages?Body: I'm interested in the model of quantum computation by magic state injection, that is where we have access to the Clifford gates, a cheap supply of ancilla qubits in the computational basis, and a few expensive-to-distill magic states (usually those that implement S, T gates). I've found that the best scaling is logarithmic in the accuracy $\varepsilon$, specifically $O(\log^{1.6}(1/\varepsilon)$ is what a 2012 paper offers to get the accuracy we need in the $S,T$ states.
Is this enough to calculate most of the problems we're interested in? Are there any problems that specifically resist QCSI (Quantum Computation by State Injection) because of high overhead, but are more solvable in other models of computation?
"
"['quantum-state', 'measurement']"," Title: How does measurement of one qubit affect the others?Body: To represent a quantum computer's state, all the qubits contribute to one state vector (this is one of the major differences between quantum and classical computing as I understand it). My understanding is that it's possible to measure only one qubit out of a system of multiple qubits. How does measuring that one qubit affect the whole system (specifically, how does it affect the state vector)?
"
"['machine-learning', 'quantum-enhanced-machine-learning', 'artificial-intelligence']"," Title: Is there any potential application of quantum computers in machine learning or AI?Body: A lot of people believe that quantum computers can prove to be a pivotal step in creating new machine learning and AI algorithms that can give a huge boost to the field. There have even been studies that our brain may be a quantum computer, but so far there is no consensus among the researchers.
Given that I am completely new to the field, I wanted to know if there has been some research done in the application of quantum computers in AI that, theoretically speaking, may perform better at some task or converge faster than modern deep learning algorithms.
"
"['gate-synthesis', 'universal-gates', 'fault-tolerance', 'noise', 'solovay-kitaev-algorithm']"," Title: How does approximating gates via universal gates scale with the length of the computation?Body: I understand that there is a constructive proof that arbitrary gates can be approximated by a finite universal gate set, which is the Solovay–Kitaev Theorem.
However, the approximation introduces an error, which would spread and accumulate in a long computation. This would presumably scale badly with the length of the calculation? Possibly one might apply the approximation algorithm to the complete circuit as a whole, not to a single gate. But how does this scale with the length of the computation (i.e. how does the approximation scale with the dimension of the gates)? How does the gate approximation relate to gate synthesis? Because I could imagine that this affects the final length of the computation?
Even more disturbing to me: What happens if the length of the calculation is not known at the time when the gate sequence is compiled?
"
"['quantum-state', 'measurement']"," Title: What makes quantum computations different from randomized classical computations?Body: One of the many thing that confuse me in the field of QC is what makes the measurement of a qubit in a quantum computer any different than just choosing at random (in a classical computer) (that's not my actual question)
Suppose I have $n$ qubits, and my state is a vector of their amplitudes $(a_1,a_2,\dots,a_n)^\mathrm{T}$.1
If I pass that state through some gates and do all sorts of quantum operations (except for measurement), and then I measure the state. I'll only get one of the options (with varying probabilities).
So where's the difference between doing that, and generating a number randomly from some convoluted/complicated distribution? What makes quantum computations essentially different from randomized classical ones?
- I hope I didn't misunderstand how states are represented. Confused about that, as well...
"
['speedup']," Title: What are the implications of Bremermann's limit for quantum computing?Body: The title says most of it: What are the implications of Bremermann's limit for quantum computing?
The Wikipedia page says that the limit applies to any self-contained system, but in the last few lines they also claim that ""access to quantum memory enables computational algorithms that require arbitrarily small amount of energy/time per one elementary computation step"".
These statements seem contradictory (unless requiring arbitrarily small amount of energy/time also requires the amount of mass going to infinity). So how does the Bremermann's limit actually affect quantum computing?
"
"['algorithm', 'quantum-gate', 'simulation', 'speedup']"," Title: New algorithm for faster QC simulation by IBMBody: This new algorithm for QC calculation was introduced recently (2017 4Q) by IBM/ Pednault et al. to great fanfare. The paper seems more couched in the language of physics.
Are there any basic overview/analyses of this by computer scientists about the general ""design pattern"" utilized, vs the prior algorithmic techniques for the problem, or can someone provide one? What about the complexity analysis of the techniques?
""Breaking the 49-Qubit Barrier in the Simulation of Quantum Circuits""
"
"['error-correction', 'architecture', 'fault-tolerance']"," Title: What is the leading edge technology for creating a quantum computer with the fewest errors?Body: Which technological path seems most promising to produce a quantum processor with a greater quantum volume (preferring fewer errors per qubit over more qubits), than Majorana fermions?
The preferred format for the answer would be similar to:
""Group ABC's method DEF has demonstrated better QV than using MF; as proven independently in paper G on page x, paper H on page y, and paper I on page z"".
On Majorana fermions Landry Bretheau says:
These particles could be the elementary brick of topological quantum computers, with very strong protection against errors. Our work is an initial step in this direction.
Example of an insufficient (but interesting) answer:
In their paper ""Robust quantum metrological schemes based on protection of quantum Fisher information"", Xiao-Ming Lu, Sixia Yu, and C.H. Oh construct a family of $2t+1$ qubits metrological schemes being immune to $t$-qubit errors after the signal sensing. In comparison at least five qubits are required for correcting arbitrary 1-qubit errors in standard quantum error correction.
[Note: This theory of robust metrological schemes preserves the quantum Fisher information instead of the quantum states themselves against noise. That results in a good effective volume if they can construct a device utilizing their techniques and show that it scales.
While that might seem like one promising answer it's a single link (without multiple concurring sources) and there's no device built to show scalability. A low qubit device that's error free and unscalable or a device with many error-prone qubits has a low volume (and thus is ""Not An Answer"").]
Additional references:
Paper explaining Quantum Volume.
After doing some research it looks like Graphene sandwiched between superconductors to produce Majorana fermions is the leading edge - is there something better? [""better"" means currently possible, not theoretically possible or ridiculously expensive]. The graphic illustrates that over a hundred qubits with less 0.0001 error rate is wonderful, lesser answers are acceptable.
"
"['simulation', 'automata-theory']"," Title: Is the universe indistinguishable from a giant quantum computer?Body: Seth Lloyd, a professor of mechanical engineering and physics at MIT, published a paper and a book in which he shows that the universe can be
regarded as a giant quantum computer. According to him, all observed phenomena are consistent with the model in which the universe is indistinguishable from a quantum computer, e.g., a quantum cellular automaton.
He considers the following two statements to be true:
- The universe allows quantum computation.
- A quantum computer efficiently simulates the dynamics of the universe.
To conclude with:
Finally, we can quantize question three: (Q3) ‘Is the universe a quantum
cellular automaton?’ While we cannot unequivocally answer this question
in the affirmative, we note that the proofs that show that a quantum computer
can simulate any local quantum system efficiently immediately imply
that any homogeneous, local quantum dynamics, such as that given by the
standard model and (presumably) by quantum gravity, can be directly reproduced
by a quantum cellular automaton. Indeed, lattice gauge theories,
in Hamiltonian form, map directly onto quantum cellular automata. Accordingly,
all current physical observations are consistent with the theory that
the universe is indeed a quantum cellular automaton.
Does this theory hold up?
"
['history']," Title: Who first proposed the idea of quantum computing using qubits?Body: As I understand it, the field of quantum mechanics was started in the early 20th century when Max Planck solved the black-body radiation problem. But I don't know when the idea of computers using quantum effects spread out.
What is the earliest source that proposes the idea of quantum computers using qubits?
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: How does evolving a two-qubit state through a CNOT gate entangle them?Body: Reading into CNOT gate I understand that, mathematically, such a gate entangles the control qubit and the target. (the resulting state is $\frac{1}{\sqrt 2}(|00\rangle+|11\rangle)$)
However, looking at the ""truth table"" of the gate, it seems as though the result is not entangled: If I measure the target after passing the gate, the state of the control can still be either option.
Am I missing something, or did I misunderstand the truth table?
"
"['quantum-memory', 'memory-space']"," Title: Can quantum computers handle 'big' data?Body: While there are many interesting questions that a computer can solve with barely any data (such as factorization, which requires ""only"" a single integer), most real-world applications, such as machine learning or AI, will require large amounts of data.
Can quantum computers handle this massive stream of data, in theory or in practice? Is it a good idea to store the data in a ""quantum memory"", or is it better to store it in a ""classical memory""?
"
"['programming', 'qiskit']"," Title: There was an error in the circuit!. Error = 'QISkit Time Out'Body: I've got the following quantum code using QISKit (based on hello_quantum.py):
import sys, os
from qiskit import QuantumProgram, QISKitError, RegisterSizeError
# Create a QuantumProgram object instance.
Q_program = QuantumProgram()
try:
import Qconfig
Q_program.set_api(Qconfig.APItoken, Qconfig.config[""url""])
except:
offline = True
print(""WARNING: There's no connection with IBMQuantumExperience servers."");
print(""The backends available for use are: {}\n"".format("","".join(Q_program.available_backends())))
backend = 'ibmqx5'
try:
# Create a Quantum Register called ""qr"" with 2 qubits.
qr = Q_program.create_quantum_register(""qr"", 2)
# Create a Classical Register called ""cr"" with 2 bits.
cr = Q_program.create_classical_register(""cr"", 2)
# Create a Quantum Circuit called ""qc"". involving the Quantum Register ""qr""
# and the Classical Register ""cr"".
qc = Q_program.create_circuit(""bell"", [qr], [cr])
# Add the H gate in the Qubit 0, putting this qubit in superposition.
qc.h(qr[0])
# Add the CX gate on control qubit 0 and target qubit 1, putting
# the qubits in a Bell state
qc.cx(qr[0], qr[1])
# Add a Measure gate to see the state.
qc.measure(qr, cr)
# Compile and execute the Quantum Program.
result = Q_program.execute([""bell""], backend=backend, shots=1024, seed=1)
# Show the results.
print(result)
print(result.get_data(""bell""))
except QISKitError as ex:
print('There was an error in the circuit!. Error = {}'.format(ex))
except RegisterSizeError as ex:
print('Error in the number of registers!. Error = {}'.format(ex))
I set my APItoken in Qconfig.py as:
APItoken = 'XXX'
config = {
'url': 'https://quantumexperience.ng.bluemix.net/api',
}
However, the code fails with the following error:
The backends available for use are: ibmqx2,ibmqx5,ibmqx4,ibmqx_hpc_qasm_simulator,ibmqx_qasm_simulator,local_qasm_simulator,local_clifford_simulator,local_qiskit_simulator,local_unitary_simulator
ERROR
There was an error in the circuit!. Error = 'QISkit Time Out'
I've tested both ibmqx4 and ibmqx5, the same issue. I can see that they're active at /qx/devices.
What does it mean? Does it mean the IBM Q server is down, or the program is too big to execute? Or there is something else going on? In other words, what should I do to run a simple Hello Quantum program on IBM quantum server?
"
"['architecture', 'technical-standards', 'nisq']"," Title: How should different quantum computing devices be compared?Body: In the last years, there has been a spur of demonstrations of devices able to perform proof of principle, small-scale, non-fault-tolerant quantum computation (or Noisy Intermediate-Scale Quantum technologies, how they have been referred to).
With this I'm mostly referring to the superconducting and ion trap devices demonstrated by groups such as Google, Microsoft, Rigetti Computing, Blatt's group (and probably others that I'm forgetting now).
These devices, as well as the ones that will follow them, are often radically different from each other (in terms of architecture, gates that are easier/harder to implement, number of qubit, connectivity between the qubits, coherence and gate times, generation and readout capabilities, gate fidelities, to name the most obvious factors).
On the other hand, it is very common in press releases and non-technical news to just say ""the new X device has Y more qubits than the one before, therefore it is so much more powerful"".
Is the number of qubits really such an important factor to assess these devices? Or should we instead use different metrics? More generally, are there ""simple"" metrics that can be used to qualitatively, but meaningfully, compare different devices?
"
"['quantum-gate', 'architecture', 'physical-realization', 'hamiltonian-simulation', 'dynamics']"," Title: How are quantum gates realised, in terms of the dynamic?Body: When expressing computations in terms of a quantum circuit, one makes use of gates, that is, (typically) unitary evolutions.
In some sense, these are rather mysterious objects, in that they perform ""magic"" discrete operations on the states.
They are essentially black boxes, whose inner workings are not often dealt with while studying quantum algorithms.
However, that is not how quantum mechanics works: states evolve in a continuous fashion following Schrödinger's equation.
In other words, when talking about quantum gates and operations, one neglects the dynamic (that is, the Hamiltonian) realising said evolution, which is how the gates are actually implemented in experimental architectures.
One method is to decompose the gate in terms of elementary (in a given experimental architecture) ones. Is this the only way? What about such ""elementary"" gates? How are the dynamics implementing those typically found?
"
['physical-realization']," Title: What are some popular myths or common misconceptions about quantum computing?Body: The most down-voted question at the moment is about using entanglement for faster-than-light communication.
Much like how the word “laser” replaced “magic” in the vernacular not too long ago, what are some things that people outside the field think quantum computers, qubits, entanglement, tunneling, or superposition do that people might need to be educated about? Or what are some popular myths about these things should be dispelled?
One question I’m asked frequently is the reason for the difference in the number of qubits between the D Wave and IBM QX. D Wave has more so it must be better. So in this case, people need to be educated on the different implementations of quantum devices.
"
"['algorithm', 'complexity-theory', 'speedup']"," Title: What can we learn from 'quantum bogosort'?Body: Recently, I've read about 'quantum bogosort' on some wiki. The basic idea is, that like bogosort, we just shuffle our array and hope it gets sorted 'by accident' and retry on failure.
The difference is that now, we have 'magic quantum', so we can simply try all permutations at once in 'parallel universes' and 'destroy all bad universes' where the sort is bad.
Now, obviously, this doesn't work. Quantum is physics, not magic. The main problems are
- 'Parallel universes' is merely an interpretation of quantum effects, not something that quantum computing exploits. I mean, we could use hard numbers here, interpretation will only confuse matters here, I think.
- 'Destroying all bad universes' is a bit like qubit error correction, a very hard problem in quantum computing.
- Bogo sort remains stupid. If we can speed-up sorting via quantum, why not base it on a good sorting algorithm? (But we need randomness, my neighbour protests! Yes, but can't you think of a better classical algorithm that relies on randomness?)
While this algorithm is mostly a joke, it could be an 'educational joke', like the 'classical' bogosort as the difference between best case, worst case and average case complexity for randomized algorithms is easy and very clear here. (for the record, best case is $\Theta(n)$, we are very lucky but still must check that our answer is correct by scanning the array, expected time is simply awful (IIRC, proportional to the number of permutations, so $O(n!)$) and worst case is we never finish)
So, what can we learn from 'quantum bogosort'? In particular, are there real quantum algorithms that are similar or is this a theoretical or practical impossibility?
Furthermore, has there been research into 'quantum sorting algorithms'? If not, why?
"
"['physical-realization', 'd-wave', 'performance', 'ibm']"," Title: How to explain in layman’s terms the significance of the difference of qubits of the D-Wave and IBM QX?Body: So, @AndrewO mentioned recently that he has had 'encounters' with people wondering why D-Wave has a lot more qubits than IBM. Of course, this comparison is faulty, since the IBM and D-Wave's machine may both exploit quantum effects to a certain degree, IBM's machine matches the thing the TCS people call a 'Quantum computer' a bit more than D-Waves's alleged quantum annealer.
How do you explain to a novice why IBM is still reaching important milesstones, even though the D-Wave has a lot more 'qubits'. I understand that an easy answer is, 'well, you're comparing apples and pears', but that is merely relying on your possible authority and simply doesn't explain anything!
How can you explain that those devices are different, how can you dispell the myth that the number of qubits is not the only metric to judge quantum devices? (preferably to a layman, but assuming basic (undergrad?) physics knowledge is ok, if needed)
"
"['physical-realization', 'architecture', 'quantum-turing-machine']"," Title: Can quantum computers design quantum computers autonomously better than other methods?Body: We've seen people use computers to design computers, AI to write computer programs, robots teach themselves, and even robots build themselves. I understand that conventional computers can be used to emulate quantum computers.
Robotic arm builds more robotic arms.
My question is: Will quantum computers be inherently able to design better quantum computers (which presumably robots could then build) or is that task better suited to Deep Learning / AI and conventional computers (with human intervention)?
Perhaps another way to ask the question, though I'm fairly certain that this won't make it clearer: ""Do conventional computers limit us to quantum Darwinism while quantum computers might enable universal Darwinism with respect to the evolution of quantum computer design?"".
Oversimplified (not the question): Could they understand (design) themselves better than classical computers, Deep Learning / AI, or mankind - IE: they do not suffer from what Zurek calls “pointer states”.
"
"['algorithm', 'complexity-theory', 'speedup']"," Title: What is the current state of the art in quantum sorting algorithms?Body: As a result of an excellent answer to my question on quantum bogosort, I was wondering what is the current state of the art in quantum algorithms for sorting.
To be precise, sorting is here defined as the following problem:
Given an array $A$ of integers (feel free to choose your representation of $A$, but be clear about this, I think this already is non-trivial!) of size $n$, we wish to transform this array into the array $A_s$ such that the arrays 'are reshufflings of each other's and $A_s$ is sorted, i.e. $A_s[i]\leq A_s[j]$ for all $i\leq j$.
What is known about this? Are there complexity bounds or conjectures for certain models? Are there practical algorithms? Can we beat classical sorting (even the bucket or radix sort at their own game? (i.e. in the cases where they work well?))
"
"['quantum-gate', 'physical-realization']"," Title: How are quantum gates implemented in reality?Body: Quantum gates seem to be like black boxes. Although we know what kind of operation they will perform, we don't know if it's actually possible to implement in reality (or, do we?). In classical computers, we use AND, NOT, OR, XOR, NAND, NOR, etc which are mostly implemented using semiconductor devices like diodes and transistors. Are there similar experimental implementations of quantum gates? Is there any ""universal gate"" in quantum computing (like the NAND gate is universal in classical computing)?
"
"['quantum-gate', 'universal-gates', 'gate-synthesis']"," Title: What is the mathematical justification for the ""universality"" of the universal set of quantum gates (CNOT, H, Z, X and π/8)?Body: In this answer I mentioned that the CNOT, H, X, Z and $\pi/8$ gates form a universal set of gates, which given in sufficient number of gates can get arbitrarily close to replicating any unitary quantum gate (I came to know about this fact from Professor Umesh Vazirani's EdX lectures). But, is there any mathematical justification for this? There should be! I tried searching for relevant papers but couldn't find much.
"
"['architecture', 'physical-realization', 'superconducting-quantum-computing']"," Title: How does a quantum computer do basic math at the hardware level?Body: On reading this Reddit thread I realized that even after a couple months of learning about quantum computing I've absolutely no clue about how a quantum computer actually works.
To make the question more precise, let's say we have a superconducting qubit based 5-qubit quantum computer (like the 5-qubit IBM Quantum Computer). I type in $2+3$ using a keyboard onto a monitor (say in a basic calculator app the quantum computer might have). After that it should return me $5$. But is going on at the hardware level? Are some sort of electrical signals corresponding to the inputs $2$,$3$ and $+$ going to the processing unit of the computer? Does that somehow ""initialize"" the Cooper pair electrons? What happens to the Cooper pair electron qubits after that (guess they'd be worked on by some quantum-gates, which are in turn again black boxes)? How does it finally return me the output $5$ ?
I am surprised as to how little I could come up with about the basic working of a quantum computer by searching on the net.
"
"['physical-realization', 'models', 'experiment', 'history']"," Title: Who built the first quantum computer using at least two qubits?Body: In my previous question I asked who invented a quantum computer using qubits.
As a follow-up to this question I want to ask who built the first quantum computer using at least two qubits.
During my research I have discovered that in 1998, Jonathan A. Jones and Michele Mosca developed a quantum computer using two qubits specifically to solve Deutsch's problem. Have there been other working quantum computers before to solve other problems or general attempts not specifically bound to one problem?
"
"['quantum-state', 'measurement', 'technical-standards']"," Title: Representation of real numbers in quantum computersBody: In classical binary computers, real numbers are often represented using the IEEE 754 standard. With quantum computers you can of course do this as well - and for measurements this (or a similar standard) will probably be necessary since the result of any measurement is binary. But could real numbers be modeled more easily and / or more precisely within the qubits using different methods before the measurement happens? If so, are there any use cases where this is actually useful, seeing that (I'm assuming) any additional precision will be lost when measurements are performed?
To be clear, I'm not (necessarily) looking for existing standards, just for ideas or suggestions on how to represent those numbers. If there's any research into it, that would be useful too of course.
"
"['quantum-gate', 'quantum-state', 'tensor-product']"," Title: Symmetry of tensor product w.r.t. Vazirani 2-qubit videoBody: Quantum Computing (QC) pioneer Vazirani has graciously long provided some nice videos on an intro to QC. E.g. in ""2 qubit gates + tensor product"" (2014) he introduces the tensor product w.r.t. QC gates. I was generally able to follow this video but think there was one subtle point glossed over and I would like an expert to expand on it. We were discussing the tensor product in a QC meetup and the question came up if its commutative. As Wikipedia states, the tensor product is not commutative. But when combining two qubits in a gate operation, Vazirani however does not mention whether order makes any difference. In his diagrams, there is total visual symmetry across the 2 qubits. Or maybe the tensor product is commutative over unitary matrices which QC is limited to? Can someone sort out/ unpack some of these ideas?
"
"['algorithm', 'cryptography', 'cryptocurrency', 'quantum-money']"," Title: Quantum Bitcoin SubdivisionBody: Background
Recently I was reading the article ""Quantum Bitcoin: An Anonymous and Distributed Currency Secured by the No-Cloning Theorem of Quantum Mechanics"" which demonstrates how a quantum bitcoin could function. The article's conclusion states that:
quantum bitcoins are atomic and there is currently no way to subdivide quantum bitcoin into smaller denominations, or merge them into larger ones.
As there is currently no way to subdivide or merge quantum bitcoins, you can not make change in a transaction. However, I could not understand why subdivision of a quantum bitcoin is not possible.
Question
Why can you not subdivide a quantum bitcoin?
Definitions
A quantum bitcoin - like a regular bitcoin - is a currency with no central authority.
The main idea behind the implementation of a quantum bitcoin is the no-cloning theorem. The no-cloning theorem demonstrates how it is impossible to copy the arbitrary quantum state $ \left| \varphi \right> $.
"
"['quantum-memory', 'classical-computing']"," Title: Quantum memory assisting classical memoryBody: Consider a classical computer, one making, say, a calculation involving a large amount of data. Would quantum memory allow it to store that information (in the short term) more efficiently, or better handle that quantity of data?
My thought would be it isn't possible, due to the advantage of quantum information storage being in the superpositions, and the data from a classical computer being very much not in a superposition, but I'd like to see if this is correct.
Either way, citations for further reading would be much appreciated.
"
"['optical-quantum-computing', 'experiment', 'spdc']"," Title: Improving probability of spontaneous parametric down conversionBody: As mentioned in an earlier question of mine, I am interested in using type one spontaneous down conversion (SPDC) in optical quantum computing. However, SPDC is a somewhat low probability occurrence - most of the photons pass straight through the crystals unentangled. What methods, if any, are there to improve the probability of down conversion occurring, and therefore entanglement between photons?
"
"['physical-qubit', 'architecture', 'noise', 'measurement']"," Title: Does Barkhausen noise affect the measurement of magnetic particle based qubits?Body: Q1: I've tried to find out if Barkhausen noise affects the measurement of spin-wave excitations in magnetic particle material based qubits.
I prefer implementations such as those described in "Magnetic qubits as hardware for quantum computers", rather than a true hybrid system such as described in "Coherent coupling between a ferromagnetic magnon and a superconducting qubit" or "Resolving quanta of collective spin excitations in a millimeter-sized ferromagnet"; which relies on the coherent coupling between a single-magnon excitation in a millimeter-sized ferromagnetic sphere and a superconducting qubit.
I'm asking about the situation where the magnetic particle is the qubit and not simply part of a magnon-qubit coupling scheme.
Q2: Is Barkhausen noise a factor that is not considered relevant?
After several hours of research the closest search I could find, for a paper of quantum computing hardware, Mesoscale and Nanoscale Physics, and Barkhausen noise, was this paper: "The Theory of Spin Noise Spectroscopy: A Review".
"Barkhausen noise
Studies of fluctuations in magnetic systems take roots in the work of Heinrich Barkhausen who proved already in 1919 that the magnetic hysteresis curve is not continuous, but is made up of small random steps caused when the magnetic domains move under an applied magnetic field. This noise can be characterized by placing a coil of a conducting wire near the sample. The motion of ferromagnetic domain walls produces changes in the magnetization that induces noisy electrical signals in the coil. Studies of Barkhausen noise have been used in practice as a nondemolition tool to characterize the distribution of elastic stresses and the microstructure of magnetic samples".
It would seem that Barkhausen noise can affect even very small magnetic particles subjected to an external magnetizing field, as might be encountered during measurement, but nowhere (it would seem) is there research on it's effect on quantum noise of the system.
It appears to be a difficult or unanswered question.
An answer was offered stating:
The Barkhausen effect has to do with domain wall motion. The magnetic qubit discussed in the first reference is based on nm sized magnetic particle, which we can assume to be single domain, and therefore would not exhibit Barkhausen noise. This paper by Kittel [Theory of the Structure of Ferromagnetic Domains - 1946] discusses domains in magnetic particles.
There are different limits stated as to what constitutes a single-domain magnetic particle, I've found upper limits ranging from 30-100 nm, with lower limits somewhat more consistent around 10 nm.
While it's not precisely stated what the exact size of the particles are in that paper, and we might assume others using similar methods could utilize particles of a different size, let's assume for the sake of that one answer only that the particles in question are single domain.
There are five main mechanisms due to which magnetic Barkhausen emissions occur [Jiles (1988)]:
- Discontinuous, irreversible domain wall motion
- Discontinuous rotation of magnetic moments within a domain
- Appearance and disappearance of domain walls (Bloch or Neel). Domain
walls are narrow transition regions between magnetic domains. They
only differ in the plane of rotation of magnetization. For Bloch
walls the magnetization rotates through the plane of the domain wall
whereas for Neel walls the magnetization rotates within the plane of
the domain wall.
- Inversion of magnetization in single-domain particles
- Displacement of Bloch or Neel lines in two 180$°$ walls with
oppositely directed magnetizations
There are a number of papers on the measurement of Barkhausen noise in single-domain magnetic particles:
"The fundamental Barkhausen noise generated by the magnetization reversal of individual particles within a particulate magnetic medium has been observed using the anomalous Hall effect (AHE) as a sensitive magnetization probe. This is the first time the reversal of individual interacting single or nearly single domain particles has been detected. The jumps correspond to magnetic switching volumes of ~3×10$^{-15}$ cm$^3$ with moments around 10$^{-12}$ emu.".
"These observations thereby demonstrate that nucleation becomes increasingly more dominant as the particles become smaller, a manifestation of the random distribution of active nucleation sites. Nucleation may therefore account for much of the magnitude and grain size dependence of hysteresis parameters in the PSD range as well as resulting in a gradual transition between multidomain and PSD behavior. Fine particles completely controlled by nucleation during hysteresis behave in a strikingly parallel manner to classical single domains and are therefore quite appropriately described as being pseudo‐single‐domain.".
That paper goes as far as to state:
"We will show that here Barkhausen Noise has nothing to do with the movement of domain walls nor with Self Organized Criticality nor with fractal domains nor with thermodynamic criteria."
"
"['speedup', 'classical-computing']"," Title: Why do classical bits perform calculations at a scale that expands linearly and qubits at exponential scale in the number of (qu)bits?Body: What does one mean by saying that classical bits perform operations at the scale of $2n$ and quantum computers perform operations at the scale of $2^n$? In both cases, $n$ = Number of bits/qubits.
"
"['quantum-gate', 'circuit-construction', 'universal-gates', 'gate-synthesis']"," Title: Given a decomposition for a unitary $U$, how do you decompose the corresponding controlled unitary gate $C(U)$?Body: Suppose we have a circuit decomposition of a unitary $U$ using some universal gate set (for example CNOT-gates and single qubit unitaries). Is there a direct way to write down the circuit of the corresponding controlled unitary $C_U$ using the same universal gate set?
For example take $U=i Y = H X H X$, as a circuit:
We can replace the $X$ gates by $C_X$ (CNOT) gates to obtain $C_U$:
This works because if the control qubit is in state $|0\rangle$ the action on the target is $H^2=\mathbb{I}$, while for $|1\rangle$ it applies the circuit for $U$. For different $U$, in particular if it acts on several qubits, coming up with such a circuit might be cumbersome. Is there a recipe to obtain the circuit of $C_U$ given that you know how to build $U$?
"
"['speedup', 'algorithm', 'performance', 'classical-computing']"," Title: Can classical algorithms be improved by using quantum simulation as an intermediary step?Body: I'm wondering whether even if we cannot create a fast quantum computer, simulating quantum algorithms can be a reasonable method for classical algorithms.
In particular, I'd like to see any results of classical algorithms that have been sped up by using a quantum simulation as a subroutine. Second, the next logical step would be to 'cut out the middleman' and see if we can remove the simulator. Perhaps this can even be done semi-automatically!
So, is there any result or research on this? Suggestions are welcome.
To be clear, I'm asking whether there exists any problem such that running a simulation of a quantum computer, on a classical computer, can offer any improvement (time or memory) over (trying to) solve the same problem on a classical computer without running any sort of simulation of a quantum computer.
Second, I am wondering how one then would attempt to adapt this algorithm such that all 'useless' parts of the quantum algorithm and the simulation are removed, hopefully improving the method even further.
"
"['error-correction', 'fault-tolerance']"," Title: Why do error correction protocols only work when the error rates are already significantly low to begin with?Body: Quantum error correction is a fundamental aspect of quantum computation, without which large-scale quantum computations are practically unfeasible.
One aspect of fault-tolerant quantum computing that is often mentioned is that each error-correction protocol has associated an error rate threshold.
Basically, for a given computation to be protectable against errors via a given protocol, the error rate of the gates must be below a certain threshold.
In other words, if the error rates of single gates are not low enough, then it is not possible to apply error-correction protocols to make the computation more reliable.
Why is this? Why is it not possible to reduce error rates that are not already very low to begin with?
"
"['speedup', 'complexity-theory', 'bqp']"," Title: Why is a quantum computer in some ways more powerful than a nondeterministic Turing machine?Body: The standard popular-news account of quantum computing is that a quantum computer (QC) would work by splitting into exponentially many noninteracting parallel copies of itself in different universes and having each one attempt to verify a different certificate, then at the end of the calculation, the single copy that found a valid certificate ""announces"" its solution and the other branches magically vanish.
People who know anything about theoretical quantum computation know that this story is absolute nonsense, and that the rough idea described above more closely corresponds to a nondeterministic Turing machine (NTM) than to a quantum computer. Moreover, the compexity class of problems efficiently solvable by NTMs is NP and by QCs is BQP, and these classes are not believed to be equal.
People trying to correct the popular presentation rightfully point out that the simplistic ""many-worlds"" narrative greatly overstates the power of QCs, which are not believed to be able to solve (say) NP-complete problems. They focus on the misrepresentation of the measurement process: in quantum mechanics, which outcome you measure is determined by the Born rule, and in most situations the probability of measuring an incorrect answer completely swamps the probability of measuring the right one. (And in some cases, such as black-box search, we can prove that no clever quantum circuit can beat the Born rule and deliver an exponential speedup.) If we could magically ""decide what to measure"", then we would be able to efficiently solve all problems in the complexity class PostBQP, which is believed to be much large than BQP.
But I've never seen anyone explicitly point out that there is another way in which the popular characterization is wrong, which goes in the other direction. BQP is believed to be not a strict subset of NP, but instead incomparable to it. There exist problems like Fourier checking which are believed to not only lie outside of NP, but in fact outside of the entire polynomial hierarchy PH. So with respect to problems like these, the popular narrative actually understates rather than overstates the power of QCs.
My naive intuition is that if we could ""choose what to measure"", then the popular narrative would be more or less correct, which would imply that these super-quantum-computers would be able to efficiently solve exactly the class NP. But we believe that this is wrong; in fact PostBQP=PP, which we believe to be a strict superset of NP.
Is there any intuition for what's going on behind the scenes that allows a quantum computer to be (in some respects) more powerful than a nondeterministic Turing machine? Presumably this ""inherently quantum"" power, when combined with postselection (which in a sense NTMs already have) is what makes a super-QC so much more powerful than a NTM. (Note that I'm looking for some intuition that directly contrasts NTMs and QCs with postselection, without ""passing through"" the classical complexity class PP.)
"
['models']," Title: Which theoretical models for quantum computing are polynomial-time equivalent?Body: There are different theoretical models for quantum computing like the circuit model or the model of adiabatic quantum computers.
Between which of these models exist polynomial-time reductions?
Note that this question does not aim to cover physical implementations of quantum computers which are already discussed here.
"
['cryptography']," Title: Will post quantum crypto come soon enough?Body: The main reason to start with Post Quantum Crypto (PQC) right now is because creating strong crypto, good implementation and accepted standards takes very long. Right now, most PQC is in the 'crypto' stage or starting to enter 'implementation' stage.
I'm wondering whether, given recent advances in constructing quantum computers, the PQC initiative will be 'fast enough'.
In particular, I'd like to know if PQC resistant against breaking factoring is widely deployed in practice before...:
- Government agencies can efficiently factor using Shor's algorithm
- Serious hackers and medium sized companies can factor using Shor.
- Script kiddies can run Shor's algorithm
To clarify, I am looking for literature or analyses based on history about deployment speed of cryptographical defenses and compare this with current analysis on the predicted power of quantum computers.
For instance, when will a good lattice based cryptosystem have a 'mainstream' implementation?
"
['quantum-state']," Title: What's the difference between a pure and mixed quantum state?Body: As per my limited understanding, a pure state is the quantum state where we have exact information about the quantum system. And the mixed state is the combination of probabilities of the information about the quantum state of the quantum system.
However, it is mentioned that different distributions of pure states can generate equivalent mixed states. So how a combination of exact information can result in the combination of probabilities?
"
"['physical-realization', 'simulation']"," Title: Do real commercial quantum computers exist?Body: We have been reading about quantum computers being developed and tested in labs.
And also, we have quantum simulator programs that use limited virtual qubits (up to 30-40 qubits if cloud-based).
And we have also started learning new quantum computing languages like Q#.
But do we really have actual commercial quantum computers ready with physical qubits?
"
"['resource-request', 'programming']"," Title: Programming quantum computers for non-physics majorsBody: I come from a non-physics background and I am very much interested in pursuing Quantum Computing - especially how to program them. Any guidance on how to get started will be very helpful.
"
['decoherence']," Title: How can quantum decoherence be managed?Body: I've stumbled myself upon this article on Wikipedia, which says:
Decoherence can be viewed as the loss of information from a system into the environment (often modeled as a heat bath), since every system is loosely coupled with the energetic state of its surroundings.
<...>
Decoherence represents a challenge for the practical realization of quantum computers, since such machines are expected to rely heavily on the undisturbed evolution of quantum coherences. Simply put, they require that coherent states be preserved and that decoherence is managed, in order to actually perform quantum computation.
(emphasis mine)
So I am wondering how can this loss of information be managed? Does this mean that it should be prevented completely, or is it necessary for quantum computing to actually allow some information loss in order to compute?
"
"['cryptography', 'cryptocurrency']"," Title: How would Blockchain technologies change to survive a post-quantum world?Body: Reading this entertaining piece of a QC enthusiast mining bitcoins with a Quantum Computer (although efficiently mining bitcoins with the current state of QCs is far-fetched, it is quite possible to be done in the next few years), I wonder how exactly will technologies already using Blockchain adapt to the change?
Are they currently being worked upon? How would post-quantum cryptography integrate with existing tech secured using today's cryptography algorithms?
"
"['speedup', 'classical-computing']"," Title: What makes quantum computers so good at computing prime factors?Body: One of the common claims about quantum computers is their ability to ""break"" conventional cryptography. This is because conventional cryptography is based on prime factors, something which is computationally expensive for conventional computers to calculate, but which is a supposedly trivial problem for a quantum computer.
What property of quantum computers makes them so capable of this task where conventional computers fail and how are qubits applied to the problem of calculating prime factors?
"
"['algorithm', 'complexity-theory', 'grovers-algorithm']"," Title: Is there a layman's explanation for why Grover's algorithm works?Body: This blogpost by Scott Aaronson is a very useful and simple explanation of Shor's algorithm.
I'm wondering if there is such an explanation for the second most famous quantum algorithm: Grover's algorithm to search an unordered database of size $O(n)$ in $O(\sqrt{n})$ time.
In particular, I'd like to see some understandable intuition for the initially surprising result of the running time!
"
"['physical-qubit', 'architecture']"," Title: What is the physical representation of a qubit?Body: In regular computers, bits may be physically represented using a wide variety of two-state devices, such as polarity of magnetization of a certain area of a ferromagnetic film or two levels of electric charge in a capacitor.
But qubits have a property that they can be in a superposition of both states at the same time. I've seen this question's answers, which explain how can a qubit be represented, or modeled using a regular computer.
So I want to know what can be used (and is used by companies like D-Wave) to represent a qubit in a real physical quantum computer?
"
"['algorithm', 'machine-learning', 'neural-network', 'quantum-enhanced-machine-learning']"," Title: Will deep learning neural networks run on quantum computers?Body: Deep Learning (multiple layers of artificial neural networks used in supervised and unsupervised machine learning tasks) is an incredibly powerful tool for many of the most difficult machine learning tasks: image recognition, video recognition, speech recognition, etc. Given that it is currently one of the most powerful machine learning algorithms, and Quantum Computing is generally regarded as a game changer for certain very difficult computation tasks, I'm wondering if there has been any movement on combining the two.
- Could a deep learning algorithm run on a quantum computer?
- Does it make sense to try?
- Are there other quantum algorithms that would make deep learning irrelevant?
"
"['quantum-state', 'terminology']"," Title: What is meant by the term ""computational basis""?Body: What is meant by the term ""computational basis"" in the context of quantum computing and quantum algorithms?
"
"['programming', 'qiskit']"," Title: How to create an arbitrary state in QISKit for a local_qasm_simulator?Body: I would like to play with a quantum circuit local_qasm_simulator in QISKit, but I do not want to implement a separate quantum circuit that would prepare an initial state.
The way I do it now is by falling back to NumPy. Specifically, first, I extract matrix u from a quantum program qp:
cname = 'circuit name'
results = qp.execute(cname, backend='local_unitary_simulator', shots=1)
data = results.get_data(cname)
u = data['unitary']
Then, I explicitly create the state I need (e.g., $|\psi\rangle = \frac{1}{2}(|00\rangle + |01\rangle + |10\rangle - |11\rangle)$):
num_qubits = 2
psi = np.ones(2**num_qubits) / 2.0
psi[3] = -psi[3]
Finally, I apply u to psi with NumPy:
u @ psi
The advantage of this approach is that I can explicitly obtain the state $U |\psi\rangle$. However, I cannot use local_qasm_simulator and the measure() function.
So, how could I prepare an arbitrary state, and supply it to a circuit, and run a local_qasm_simulator?
"
"['algorithm', 'architecture', 'shors-algorithm', 'noise']"," Title: How do quantum computers prevent ""quantum noise""?Body: On the Wikipedia page for Shor's algorithm, it is stated that Shor's algorithm is not currently feasible to use to factor RSA-sized numbers, because a quantum computer has not been built with enough qubits due to things such as quantum noise. How do modern quantum computers prevent interference with computations from this noise? Can they prevent it at all?
"
"['algorithm', 'grovers-algorithm']"," Title: Does the oracle in Grover's algorithm need to contain information about the entirety of the database?Body: Grover's algorithm is often described as a way to search a database in $O(\sqrt{N})$ time. For using it we need an oracle gate that represents some function $f$ such that $f^{-1}(1)$ is the answer. But how do you actually make such a “database oracle”?
Suppose I have an array of numbers $a$ that contains $w$ exactly once and I need to find $w$'s index. On a classical computer, I would load the array into memory and iterate through it until I find $w$.
For example, if $a = [3, 2, 0, 1, 2, 3]$ and $w = 0$, I expect to get 2 as the answer (or 3 in 1-indexing).
How do I represent this array in a quantum computer and make a gate that returns $a_x$ for some $x$?
In particular, do you need to have the entirety of the “database” within quantum memory (assuming there are some ways to access classical registers from quantum gates)?
"
"['physical-realization', 'architecture', 'experiment', 'ion-trap-quantum-computing', 'scalability']"," Title: Scalability of ion trap quantum computersBody: My understanding is that the magnetic fields needed to hold the ions in place in ion trap quantum computers are very complex, and for that reason, currently, only 1-D computers are possible, therefore reducing the ease of communication between qubits. There does seem to be a proposition for a 2-d system using a Paul trap in this preprint but I can't seem to find if this has actually been tested.
Does the scalability of ion trap quantum computers depend upon this alone (whether or not the ions can be arranged in configurations other than a straight line) or are other factors entailed? If the former, what progress has been made? If the latter, what are the other factors?
"
"['physical-realization', 'physical-qubit', 'performance', 'd-wave']"," Title: Is Google's 72 qubit device better than D-Wave's machines, which feature more than 2000 qubits?Body: Google recently announced the Bristlecone 72 qubit quantum computer.
However, D-Wave already announced quantum computers featuring more than $2000$ qubits.
Why is Google's new device newsworthy then? Is it better than D-Wave's machine in some respects? If so, how?
"
"['models', 'topological-quantum-computing']"," Title: How does topological quantum computing differ from other models of quantum computing?Body: I've heard the term Topological Quantum Computer a few times now and know that it is equivalent to quantum computers using circuits with respect to some polynomial-time reduction.
However, it is totally unclear to me how such a quantum computer differs from others, how it works, and what its strengths are.
In short: how is a topological quantum computer different than other models, such as gate-based quantum computers and what are the specific use cases for that it is better suited than other models?
"
"['physical-realization', 'd-wave']"," Title: Is it important for a quantum computer to be shielded by the magnetic field?Body: I've been browsing The D-Wave 2000Q site when I bumped into this aspect of their quantum computers:
A Unique Processor Environment
Shielded to 50,000× less than Earth’s magnetic field
Why is that relevant? What would happen if it would be much less than 50.000x?
"
"['architecture', 'd-wave', 'annealing']"," Title: Hardware wise, how does D-Wave achieve quantum annealing?Body: Quantum computers have shown a new way to compute old problems. D-Wave has a quantum annealer, and Wikipedia describes the D-Wave quantum computer and its use of quantum annealing properties. Hardware wise, how does D-Wave achieve quantum annealing?
There may be many ways to achieve quantum annealing. D-Wave, being first on the market with quantum annealing hardware, therefore is open to more scrutiny (is their hardware open to such scrutiny?) Does D-Wave use a specific type of annealing at the atomic level (there could be one of many ways to achieve quantum annealing), or (in other words) are there many ways to achieve quantum annealing?
"
"['simulation', 'ibm-q-experience', 'programming']"," Title: What would a very simple quantum program look like?Body: After reading the ""first programmable quantum photonic chip"". I was wondering just what software for a computer that uses quantum entanglement would be like.
Is there any example of code for specific quantum programming? Like pseudocode or high-level language? Specifically, what's the shortest program that can be used to create a Bell state $$\left|\psi\right> = \frac{1}{\sqrt 2} \left(\left|00\right> + \left|11\right> \right)$$ starting from a state initialised to $\left|\psi_0\right> = \left|00\right>$ using both a simulation and one of IBM's Quantum Experience processors, such as the ibmqx4?
Making the conceptual jump from traditional programming to entanglement isn't that easy.
I've found C's libquantum too.
"
"['algorithm', 'mathematics', 'cryptography', 'cryptocurrency', 'quantum-money']"," Title: Rigorous security proof for Wiesner's quantum moneyBody: In his celebrated paper ""Conjugate Coding"" (written around 1970), Stephen Wiesner proposed a scheme for quantum money that is unconditionally impossible to counterfeit, assuming that the issuing bank has access to a giant table of random numbers and that banknotes can be brought back to the bank for verification. In Wiesner's scheme, each banknote consists of a classical ""serial number"" $s$, together with a quantum money state $|\psi_s\rangle$ consisting of $n$ unentangled qubits, each one either
$$|0\rangle,\ |1\rangle,\ |+\rangle=(|0\rangle+|1\rangle)/\sqrt{2},\ \text{or}\ |-\rangle=(|0\rangle-|1\rangle)/\sqrt{2}.$$
The bank remembers a classical description of $|\psi_s\rangle$ for every $s$. And therefore, when $|\psi_s\rangle$ is brought back to the bank for verification, the bank can measure each qubit of $|\psi_s\rangle$ in the correct basis (either $\{|0\rangle,|1\rangle\}$ or $\{|+\rangle,|-\rangle\}$), and check that it gets the correct outcomes.
On the other hand, because of the uncertainty relation (or alternatively, the No-Cloning Theorem), it's ""intuitively obvious"" that, if a counterfeiter who doesn't know the correct bases tries to copy $|\psi_s\rangle$, then the probability that both of the counterfeiter's output states pass the bank's verification test can be at most $c^n$, for some constant $c<1$. Furthermore, this should be true regardless of what strategy the counterfeiter uses, consistent with quantum mechanics (e.g., even if the counterfeiter uses fancy entangled measurements on $|\psi_s\rangle$).
However, while writing a paper about other quantum money schemes, my coauthor and I realized that we'd never seen a rigorous proof of the above claim anywhere or an explicit upper bound on $c$: neither in Wiesner's original paper nor in any later one.
So, has such a proof (with an upper bound on $c$) been published? If not, then can one derive such a proof in a more-or-less straightforward way from (say) approximate versions of the No-Cloning Theorem, or results about the security of the BB84 quantum key distribution scheme?
I should maybe clarify that I'm looking for more than just a reduction from the security of BB84. Rather, I'm looking for an explicit upper bound on the probability of successful counterfeiting (i.e., on $c$)---and ideally, also some understanding of what the optimal counterfeiting strategy looks like. I.e., does the optimal strategy simply measure each qubit of $|\psi_s\rangle$ independently, say on the basis
$$\{ \cos(\pi/8)|0\rangle+\sin(\pi/8)|1\rangle, \sin(\pi/8)|0\rangle-\cos(\pi/8)|1\rangle \}?$$
Or is there an entangled counterfeiting strategy that does better?
Right now, the best counterfeiting strategies that I know are (a) the strategy above, and (b) the strategy that simply measures each qubit in the $\{|0\rangle,|1\rangle\}$ basis and ""hopes for the best."" Interestingly, both of these strategies turn out to achieve a success probability of $(5/8)$$n$. So, my conjecture of the moment is that $(5/8)$$n$ might be the right answer. In any case, the fact that $5/8$ is a lower bound on c rules out any security argument for Wiesner's scheme that's ""too"" simple (for example, any argument to the effect that there's nothing nontrivial that a counterfeiter can do, and therefore the right answer is $c=1/2$).
"
['algorithm']," Title: Are there numerical differences between classical and quantum solutions of problems such as the Born-Jordan quantization?Body: Consider an implementation of the Born-Jordan quantization or an arbitrary Cohen class time-frequency analysis algorithm.
Are there any numerical differences between classical and quantum solutions? Would our visualizations of the data output change in any way? (Or perhaps, would we have to change the way we visualize the data?)
"
"['d-wave', 'programming']"," Title: How do you write a simple program for a D-Wave device?Body: I would like to know how a job for a D-Wave device is written in code and submitted to the device.
In the answer it would be best to see a specific example of this for a simple problem. I guess that the ""Hello World"" of a D-Wave device would be something like finding the ground states of a simple 2D Ising model, since this is the kind of problem directly realized by the hardware. So perhaps this would be a nice example to see. But if those with expertise thing an alternative example would be suitable, I'd be happy to see an alternative.
"
"['physical-realization', 'architecture', 'experiment', 'ion-trap-quantum-computing']"," Title: What kinds of ions do trapped ion quantum computers use?Body: Trapped ion quantum computers are among the most promising approaches to achieve large-scale quantum computation.
The general idea is to encode the qubits into the electronic states of each ion, and then control the ions via electromagnetic forces.
In this context, I often see that experimental realisation of trapped ion systems use ${}^{40}\!\operatorname{Ca}^+$ ions (see e.g. 1803.10238).
Is this always the case? If not, what other kinds of ions are or can be used to build these kinds of trapped ion systems?
What are the main characteristics that the ions must have to be conveniently used to build trapped ion devices?
"
"['superposition', 'quantum-state']"," Title: What is the difference between superpositions and mixed states?Body: My understanding so far is: a pure state is a basic state of a system, and a mixed state represents uncertainty about the system, i.e. the system is in one of a set of states with some (classical) probability. However, superpositions seem to be a kind of mix of states as well, so how do they fit into this picture?
For example, consider a fair coin flip. You can represent it as a mixed state of “heads” $\left|0\right>$ and “tails” $\left|1\right>$: $$ \rho_1 = \sum_j \frac{1}{2} \left|\psi_j\right> \left<\psi_j\right| = \frac{1}{2} \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} $$
However, we can also use the superposition of “heads” and “tails”: specific state $\psi = \frac{1}{\sqrt{2}}\left( \left|0\right> + \left|1\right> \right)$ with density
$$ \rho_2 = \left|\psi\right> \left<\psi\right| = \frac{1}{2} \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} $$
If we measure in the computational basis, we will get the same result. What is the difference between a superposed and a mixed state?
"
"['decoherence', 'qudit', 'qutrit']"," Title: Are qutrits more robust to decoherence?Body: A string of $n$ qutrits has a state-space spanned by the $3^n$ different states $\lvert x \rangle $ for strings $x \in \{0,1,2\}^n$ (or $x \in \{-1,0,+1\}^n$, equivalently), while $n $ qubits can only represent $2^n$ computational basis states.
According to the Wikipedia article on qutrits, ""qutrits ... are more robust to decoherence under certain environmental interactions"".
Does the increase of possible simultaneous states represented, result in robustness to decoherence?
"
['qudit']," Title: Is quantum computing limited to a superposition of only two states?Body: From Wikipedia:
A qubit is a two-state quantum system [...]
There are two possible
outcomes for the measurement of a qubit — usually $0$ and $1$, like a bit.
The difference is that whereas the state of a bit is either $0$ or $1$,
the state of a qubit can also be a superposition of both.
Is it true that quantum computing must be based on qubits, limiting it to only a two-state quantum system? Is it physically possible to build a $n$-state quantum-system (where $n>2$)?
This is 'repost' of a ("legitimate") question was deleted by the OP, here. I decided to repost it along with the answer which I started writing.
"
"['error-correction', 'majorana-particle']"," Title: How could Majorana particles be used to improve quantum computers?Body: This recent press release claiming that Improved measurements bring final proof of Majorana particles closer than ever, which summarizes the results of a recent paper in Nature simply entitled ""Quantized Majorana conductance"" claims that
Thanks to their unique physical characteristics, Majorana particles are much more stable than most other qubits.
Why would this be the case (in theory, at least). Is the approach to qubits with Majorana particles considered to be valid, or are they surrounded by skepticism?
"
"['physical-realization', 'quantum-advantage']"," Title: What countries are leading this ""Global Quantum Computing Race""?Body: The terms Quantum Computing Race and Global Quantum Computing Race have been used in the press and research communities lately in an effort to describe countries making investments into a ""battle"" to create the first universal quantum computer.
What countries are leading this ""Global Quantum Computing Race""?
"
['programming']," Title: What programming languages are available for quantum computers?Body: From this question, I gathered that the main quantum computing programming languages are Q# and QISKit.
What other programming languages are available for programming quantum computers? Are there certain benefits to choosing particular ones?
EDIT: I am looking for programming languages, not emulators. Emulators simulate things. Programming languages are a method of writing instructions (either for real objects or for emulators). There may be a single language that works for multiple emulators and vice versa.
"
"['algorithm', 'simulation', 'resource-request']"," Title: Is there any source which tabulates quantum computing algorithms for simulating physical systems?Body: I was wondering if there is a source (online or review article) which tabulates recent algorithms, and their complexities, used in simulating various physical systems. Something along the lines of:
Physical System 1: Quantum Field Theory (scattering)
Complexity: Polynomial in number of particles, energy, and precision
Source: Quantum Algorithms for Quantum Field Theories (Jordan, Lee & Preskill, 2011)
Physical System 2: Atomic Energy levels
And so on.
"
"['machine-learning', 'bayesian-learning']"," Title: Can quantum computing speed up Bayesian learning?Body: One of the biggest drawbacks of Bayesian learning against deep learning is runtime: applying Bayes' theorem requires knowledge on how the data is distributed, and this usually requires either expensive integrals or some sampling mechanism (with the corresponding drawbacks).
Since at the end of the day is all about distribution propagations, and this is (as far as I understand) the nature of quantum computing, is there a way to perform these efficiently? If yes, what limitations do apply?
Edit (directly related links):
"
"['physical-realization', 'architecture', 'performance']"," Title: How power-efficient are quantum computers?Body: Quantum algorithms scale faster than classical ones (at least for certain problem clases), meaning quantum computers would require a much smaller number of logical operations for inputs above a given size.
However, it is not so commonly discussed how quantum computers compare to regular computers (a normal PC today) in terms of power consumption per logical operation. (Has this not been talked about much, because the main focus of quantum computers is how fast they can compute data?)
Can someone explain why quantum computing would be more or less power-efficient than classical computing, per logical operation?
"
['classical-computing']," Title: What impact would have introducing the quantum switch effect in classical computing?Body: This divulgation article by Prof. Brukner talks about the possibility of creating a situation where
""A causing B"" and ""B causing A"" which we call a quantum switch. Such a setup is similar to some predator–prey relationships, in which predator numbers influence prey numbers, yet prey numbers also influence predator numbers. Following work that Ognyan Oreshkov, Fabio Costa, and I published in 2012, we now know that the quantum switch is just one example of an indefinite causal structure, in which it is not defined whether event A is a cause or an effect of event B, or whether the two are independent.
The work link leads to a paper that explains with great detail how to achieve that, and it also includes some applications, like to prove that two no-signalling channels that are not perfectly distinguishable in any ordinary quantum circuit can become perfectly distinguishable through the quantum superposition of circuits with different causal structures
I am a regular programmer without a background in quantum computing and don't quite understand the implications of such articles. What I get, and find very exciting is the possibility of having such expanded causality models as a tool. My question is: how/where could quantum switch fit in the classical computing landscape? Be it low-level hardware design or the (surely upcoming) else-then-if software pattern
"
['cryptography']," Title: How can we reliably know if a key size is still safe to use as new quantum computers are created?Body: I've heard that quantum computers pose a major threat to 1024 bit and possibly even 2048 bit RSA public-private key cryptography. In the future however, bigger size keys will probably become at risk at one point or another, as newer, faster quantum computers are created, for lots of (if not, all) algorithms. How can I reliably know if a key size, or even an algorithm itself is secure and safe to use at the current time? Is there a reliable resource/website that calculates which key sizes are currently at risk, based on how fast the newest quantum computers are? Or possibly, will new algorithms be created which try to prevent quantum computers from being able to crack them easily? The goal here is to keep the UX positive by not making a product slow due to encryption, but slower apps are worth it to guarantee a safe transfer of data.
"
"['classical-computing', 'programming']"," Title: How does the Curry-Howard correspondence apply to quantum programs?Body: In words of Wikipedia,
The Curry–Howard correspondence is the observation that two families of seemingly unrelated formalisms—namely, the proof systems on one hand, and the models of computation on the other—are in fact the same kind of mathematical objects [...] a proof is a program, and the formula it proves is the type for the program.
Further, under General Formulation, it provides the following table and the statement that bears my question:
In its more general formulation, the Curry–Howard correspondence is a correspondence between formal proof calculi and type systems for models of computation. In particular, it splits into two correspondences. One at the level of formulas and types that is independent of which particular proof system or model of computation is considered, and one at the level of proofs and programs which, this time, is specific to the particular choice of proof system and model of computation considered.
Is quantum computing in this hindsight equivalent to classical computing, or is it a different ""model of computation"" (i.e. does it have a different set of elements in the Programming side)? Would it still correspond to the exact same Logic side?
"
['terminology']," Title: Is qsphere an actual term representing 5 qubits?Body: I'm a total beginner, I've been brought here by the featured stackoverflow blog post so I started studying.
Watching this youtube video (A Beginner’s Guide To Quantum Computing (3:58), I saw this slide where it talks about superposition:
At first I thought that, besides qubits, which can be in a superposition of 0s and 1s, there's also a qsphere, which can be in a superposition of 5 zeros and 5 ones, when in fact it's just 5 qubits.
So when we say a qsphere, it's known to be 5 qubits?
"
"['physical-realization', 'architecture', 'd-wave']"," Title: Why D-Wave 2000Q requires such a low pressure?Body: On the D-Wave 2000Q website, it is stated that the processor environment is kept ""in a high vacuum: pressure is 10 billion times lower than atmospheric pressure"".
Why the pressure has to be such low? What would happen to the computer if the pressure increases?
"
"['classical-computing', 'models', 'quantum-turing-machine']"," Title: In a Quantum Turing Machine, how is the decision to move along the memory tape made?Body: Let, for a Quantum Turing machine (QTM), the state set be $Q$, and the alphabet of symbols be $\sum=\{0,1\}$, which appear at the tape head. Then, as per my understanding, at any given time while the QTM is calculating, the qubit that appears at its head will hold an arbitrary vector $V_\sum = a|1\rangle+b|0\rangle$. Also, if $|q_0\rangle , |q_1\rangle, ... \in Q$, then the state vector at that instance will also be an arbitrary vector $V_q=b_0|q_0\rangle + b_1 |q_1\rangle+ ...$.
Now, after the instruction cycle is complete, the vectors $V_\sum$ and $V_q$ will decide whether the QTM will move left or right along the Qubit tape. My question is- since Hilbert space formed by $Q \otimes \sum$ is an uncountable infinite set and $\{\text{Left,Right}\}$ is a discrete set, the mapping between them will be difficult to create.
So how is the decision to move left or right made? Does the QTM move both left and right at the same time, meaning that the set $\{\text{Left,Right}\}$ also forms a different Hilbert space, and hence the motion of the QTM becomes something like $a|\text{Left}\rangle+b|\text{Right}\rangle$.
Or, just like a Classical Turing machine, the QTM moves either left or right, but not both at the same time?
"
"['quantum-gate', 'quantum-control']"," Title: What is the difference between quantum control and quantum optimal control?Body: In the context of quantum control theory, it is common to see references to both quantum control and quantum optimal control (e.g. 0910.2350 or the guide on qutip quantrum control functions).
Sometimes it seems like the two terms are used interchangeably, while sometimes they are treated as different things.
For example, from the above link, it seems that quantum optimal control is (unsurprisingly) a special kind of quantum control.
It is however not too clear what the exact difference is between the two.
For example, are both approaches used to tackle the same classes of problems? Is the only difference in quantum optimal control theory looking for optimal solutions, while quantum control techniques have less strict requirements?
"
"['algorithm', 'speedup']"," Title: Does quantum computing provide any speedup in evaluation of transcendental functions?Body: With the integer factorisation problem, Shor's algorithm is known to provide a substantial (exponential?) speedup compared to classical algorithms. Are there similar results regarding more basic maths, such as evaluating transcendental functions?
Let's say I want to calculate $\sin2$, $\ln{5}$ or $\cosh10$. In the classical world, I might use an expansion like the Taylor series or some iterative algorithm. Are there quantum algorithms that can be faster than what a classical computer can do, be it asymptotically better, fewer iterations to the same precision, or faster by wall clock time?
"
"['physical-realization', 'architecture', 'd-wave', 'superconducting-quantum-computing']"," Title: Do the latest D-Wave computers use Helium compounds for cooling?Body: Do the latest D-Wave machines use compounds of $\require{\mhchem}\ce{^{3}He}$ and $\ce{^{4}He}$ for cooling? If not, how does D-Wave approach cooling its plates low enough to achieve superconductivity? What compounds does DWave use for the plates in their fridge, and at what temperature do its plates reach superconductivity?
"
"['quantum-operation', 'terminology', 'correlations']"," Title: What is the difference between signaling and non-signaling quantum correlations, and what is a signaling channel?Body: This article talks about correlation and causality in quantum mechanics. In the abstract, under Framework for local quantum mechanics, it says (emphasis mine):
The most studied, almost epitomical, quantum correlations are the non-signalling ones, such as those obtained when Alice and Bob perform measurements on two entangled systems. Signalling quantum correlations exist as well, such as those arising when Alice operates on a system that is subsequently sent through a quantum channel to Bob who operates on it after that.
Basically, what is the difference between signalling and non-signalling, and what role does the channel play on that?
"
"['programming', 'models']"," Title: Does the Curry-Howard correspondence have a quantum-specific type system?Body: In Wikipedia we can read that
the Curry–Howard correspondence is a correspondence between formal proof calculi and type systems for models of computation. In particular, it splits into two correspondences. One at the level of formulas and types that is independent of which particular proof system or model of computation is considered, and one at the level of proofs and programs which, this time, is specific to the particular choice of proof system and model of computation considered.
In this other related question I asked about the relation between the C-H correspondence as it was conceived and quantum computing. Here the questions are:
- Does this theory have to be updated to embrace quantum-specific phenomena like extended causality?
- If yes, what are the changes made?
"
"['architecture', 'quantum-gate', 'universal-gates', 'continuous-variable']"," Title: How are gates implemented in a continuous-variable quantum computer?Body: I've mostly worked with superconducting quantum computers I am not really familiar with the experimental details of photonic quantum computers that use photons to create continuous-variable cluster states such as the one that the Canadian startup Xanadu is building. How are gate operations implemented in these types of quantum computers? And what is the universal quantum gate set in this case?
"
"['circuit-construction', 'notation']"," Title: What do double wires mean in quantum circuits, and how do they relate to if statements?Body: The circuit
can be translated to the following code:
operation Teleport(msg, there) {
let register = AllocateRegister();
let here = register;
H(here);
CNOT(here, there);
CNOT(msg, here);
H(msg);
// Measure out the entanglement.
if (M(msg) == One) { Z(there); }
if (M(here) == One) { X(there); }
}
}
How do the if-statements come about? Why are double-lines used after measurements?
"
"['physical-qubit', 'architecture', 'superconducting-quantum-computing']"," Title: What is the difference between transmon and Xmon qubits?Body: Transmon and Xmon qubits are two types of superconducting charge qubits that seem to be often used in superconducting quantum devices.
However, I wasn't able to easily find direct comparisons between them.
The Xmon architecture seems (1304.2322) to have been introduced by Martinis' group, as an alternative to the transmon qubit, so I would expect the former architecture to be better in at least some respects.
On the other hand, it also seems (cond-mat/0703002 and 0712.3581 seem to be the relevant references) that the devices from IBM use transmon qubits.
What are the main differences between the two, from a practical point of view (in other words, when and why does one prefer one over the other)?
"
"['quantum-gate', 'quantum-control']"," Title: Does quantum control allow to implement any gate?Body: Using quantum control techniques it is possible to control quantum systems in a wide range of different scenarios (e.g. 0910.2350 and 1406.5260).
In particular, it was shown that using these techniques it is possible to implement gates like the (quantum) Toffoli gate (1501.04676) with good fidelities.
More precisely, they show that given the Toffoli gate $\newcommand{\on}[1]{\operatorname{#1}}\mathcal{U}_{\on{Toff}}$, defined as the C-CNOT gate
$$
\newcommand{\ketbra}[2]{\lvert#1\rangle\langle#2\rvert}
\newcommand{\ket}[1]{\lvert#1\rangle}
\newcommand{\bra}[1]{\langle#1\rvert}
\mathcal{U}_{\on{Toff}}\equiv \ket{0}_1\!\bra{0}\otimes \on{CNOT}
+ \ket{1}_1\!\bra{1}\otimes I,
$$
and a time-dependent Hamiltonian $H(t)$ containing a specific set of interactions, one can find a set of (time-dependent) parameters of $H(t)$ such that
$$
\mathcal T \exp\left(-i \int_0^\Theta H(\tau)d\tau\right) \simeq \mathcal U_{\on{Toff}}.
$$
Are there known results on the universality of such an approach?
In other words, do the tools provided by quantum control theory allow to say when, given set of constraints on the allowed Hamiltonian parameters, a given target gate can be realized? (1)
More precisely, the problem is the following: fix a target gate $\mathcal U$ acting over a set of qubits (or more generally qudits), and a parametrised Hamiltonian of the form $H(t)=\sum_k c_k(t) \sigma_k$, where $\{\sigma_k\}_k$ is a fixed set of (Hermitian) operators, and $c_k(t)$ are time-dependent parameters to be determined.
Is there a way to tell whether there are coefficients $\{c_k(t)\}_k$ such that
$$
\mathcal T\exp\left(-i\int_0^{\Theta} H(\tau)d\tau\right) \stackrel{?}{=} \mathcal U.
$$
(1) Note that I here talk of quantum control only because that is the term used in the paper. If this is not the most suitable term to use to refer to this kind of problems please let me know.
Moreover, note also that the problem solved in the paper is slightly different than the one I stated here. In particular, the Hamiltonian they consider actually acts in the space of three four-dimensional qudits, and the Toffoli is only implemented as an effective dynamics in the lower levels of each ququart.
I'm also ok with results of this sort of course.
"
"['algorithm', 'speedup', 'annealing', 'optimization', 'qaoa']"," Title: What is the difference between QAOA and Quantum Annealing?Body: Edward Farhi's paper on the Quantum Approximate Optimization Algorithm
introduces a way for gate model quantum computers to solve combinatorial optimization algorithms. However, D-Wave style quantum annealers have focused on combinatorial optimization algorithms for some time now. What is gained by using QAOA on a gate model quantum computer instead of using a Quantum Annealer?
"
"['quantum-gate', 'quantum-state', 'physical-realization', 'physical-qubit']"," Title: Processing density capabilities in a quantum processorBody: Given the theoretical infinite quantum states that a qbit can be expressed as is there any practical limit to the processing density in any given quantum processor as compared to the absolute limits imparted in a binary system such as our current binary processors ?
By this I mean with current binary processors each gate can only have one of two states, and yet in quantum theory it appears as though every single gate can have an infinite number of states, what sort of practical limit, if any would we see in quantum processing, and given this infinite state capability wouldn't we then be in the position that largely every single quantum processor could be expressed as a single qbit with every qbit in effect acting as its own quantum processor with infinite states stand alone from other parallel qbits?
"
"['entanglement', 'error-correction']"," Title: What is quantum entanglement, and what role does it play in quantum error correction?Body: I want to understand what quantum entanglement is and what role does it play in quantum error correction.
NOTE:
As per the suggestions of @JamesWootton and @NielDeBeaudrap, I have asked a separate question for the classical analogy here.
"
['error-correction']," Title: Why does the surface (quantum error correction) code have such a high threshold for errors?Body: Is there an intuitive explanation why the surface code fares so much better than older quantum error correction codes in terms of its high error threshold, with thresholds of up to a few percent rather than some ppm? If so, what is it?
I am particularly interested in having it clarified if such a comparison is a fair (apples to apples) comparison. I understand that the results for older quantum error correction are usually analytic results whilst those for surface codes tend to be numeric. Could it be that the analytic solutions indeed take into account the worst possible (coherent) errors whilst numerical solutions perhaps do not capture the worst possible errors because they can only explore a subset of all possible errors?
"
"['physical-realization', 'physical-qubit', 'architecture', 'decoherence', 'quantum-memory']"," Title: How to store qubits while preserving Heisenberg's uncertainty principle?Body: I know that qubits are represented by quantum particles (for example photons) and that their state is given by one property (for example spin).
My question is about the quantum memory: how are the qubits stored in a quantum computer. I suppose we require a kind of black box for Heisenberg's uncertainty principle to work. If I understand this correctly this principle is relevant for the superposition of the qubit.
How is this kind of black box implemented in real quantum computers?
"
"['algorithm', 'speedup', 'complexity-theory']"," Title: How to compare a quantum algorithm with its classical version?Body: The Quantum Algorithm Zoo includes a host of algorithms for which Quantum Computing offers speedups (exponential, polynomial, etc). However, those speedups are based on asymptotic computational complexity (Big-O complexity).
For a realistic implementation on a quantum computer (or even a simulator), the algorithm might require other add-ons to get a satisfiable result. For e.g., for multiple quantum state tomography trials, or probabilistic cloning.
I am not considering an ideal quantum computer, thus, overheads of physical to logical qubit mapping for Quantum Error Correction; overheads of nearest neighbour mapping; or experimental environmental errors are not considered. I am only considering the effect of projective measurement and no-cloning.
How can I compare a quantum algorithm taking into account such factors? The overheads might be polynomial, linear, or even constant, so asymptotically it will outperform the corresponding classical algorithm. But, asymptotically means, for a large enough problem size. I am interested in determining if that cross-over point (quantum supremacy problem size) is realistic for my case.
The specific algorithm I am currently working with is an improvement of Grover's search as proposed by Biham et. al, where the initial amplitude distribution is not uniform, and there are multiple solutions.
"
['entanglement']," Title: Is there any classical analogy for quantum entanglement?Body: I want to know if there is any classical analogy for understanding quantum entanglement.
"
"['algorithm', 'speedup', 'annealing', 'classical-computing']"," Title: Assessing speed-up via Quantum-Stochastic correspondenceBody: You can make a natural correspondence between a quantum state vector and a classical probability vector, and between a quantum unitary operator and a classical stochastic matrix. There is also a correspondence between the quantum annealing algorithm and the classical simulated annealing algorithm. I am wondering whether it is possible to write down simulated annealing in the language of probability vectors and stochastic matrices, and then see what additional power is obtained by changing to the quantum counterparts.
More generally, I would like to bridge the language gaps between probabilistic algorithms and quantum algorithms, and I am wondering whether recasting probabilistic algorithms in terms of probability vectors and stochastic matrices has been tried before.
"
"['algorithm', 'speedup']"," Title: Can we use quantum parallelism to calculate many functions at once?Body: It is well-known that by utilizing quantum parallelism we can calculate a function $f(x)$ for many different values of $x$ simultaneously. However, some clever manipulations is needed to extract the information of each value, i.e. with Deutsch's algorithm.
Consider the reverse case: can we use quantum parallelism to calculate many functions (say $f(x),g(x),\dots$) simultaneously for a single value $x_0$?
"
"['algorithm', 'quantum-gate', 'circuit-construction']"," Title: What is the quantum circuit equivalent of a (delayed choice) quantum eraser?Body: Quantum computers are efficiently able to simulate any other quantum system. Hence there must be some sort of equivalent of a (possibly simulated) quantum eraser setup. I would like to see such an equivalent drawn as a quantum circuit, ideally in the variant of a delayed choice quantum eraser.
One (quantum) experimental realization of a quantum eraser is this: You create a double slit interference experiment where you obtain which-way information by ""doubling"" photons in front of each slit using spontaneous parametric down conversion (the physics of which are not important for my argument, the point being that we have a new photon we can measure to obtain which-way information). The interference pattern naturally disappears, unless we build a quantum eraser: If the two ""doubled"" photons carrying the which-way information are superimposed via a 50-50 beamsplitter in such a manner that the which-way information can no longer be measured, the interference pattern reappears. Curiously, this is experimentally the case even if this superimposing happens after the interference pattern is recorded.
I seem to be unable to find a convincing equivalence for the interference pattern and for the quantum eraser in simple qubit gates. But I would love to make the thought (and ideally, the real) experiment on a quantum computer, too. What program (quantum circuit) would I need to run on a quantum computer to do that?
"
"['resource-request', 'physical-realization']"," Title: What real quantum computers are available for students to use?Body: I am aware that IBM, Rigetti, and Google have built some small-scale devices. Which of them are available for access by an undergraduate student? For how long? With how many qubits?
"
"['annealing', 'models', 'adiabatic-model']"," Title: What is the difference between quantum annealing and adiabatic quantum computation models?Body: From what I understood, there seems to be a difference between quantum annealing and adiabatic quantum computation models but the only thing I found on this subject implies some strange results (see below).
My question is the following: what is exactly the difference/relation between quantum annealing and adiabatic quantum computation?
The observations that leads to a ""strange"" result:
- On Wikipedia, adiabatic quantum computation is depicted as ""a subclass of quantum annealing"".
- On the other hand we know that:
- Adiabatic quantum computation is equivalent to quantum circuit model (arXiv:quant-ph/0405098v2)
- DWave computers use quantum annealing.
So by using the 3 facts above, DWave quantum computers should be universal quantum computers. But from what I know, DWave computers are restricted to a very specific kind of problem so they cannot be universal (DWave's engineers confirm this in this video).
As a side question, what is the problem with the reasoning above?
"
"['architecture', 'universal-gates', 'models', 'superconducting-quantum-computing']"," Title: What are the fundamental differences between trapped ion quantum computers and other architectures?Body: There are many different ways to build quantum computers, such as superconducting qubits, quantum dots, and ion traps.
What I would like to understand is why some universities and research organizations have chosen to study trapped ion quantum computers.
I understand that it is better in some respects, but what are the fundamental differences?
Source: Youtube video
Domain of Science
Dominic Walliman
"
"['quantum-gate', 'history', 'technical-standards']"," Title: Why do we use the standard gate set that we do?Body: The typically used gate set for quantum computation is composed of the single qubits Cliffords (Paulis, H and S) and the controlled-NOT and/or controlled-Z.
To go beyond Clifford we like to have full single qubit rotations. But if we are being minimal, we just go for T (the fourth root of Z).
This particular form of the gate set pops up everything. Such as IBM’s Quantum Experiment p, for example.
Why these gates, exactly? For example, H does the job of mapping between X and Z. S similarly does the job of mapping between Y and X, but a factor of $-1$ also gets introduced. Why don’t we use a Hadamard-like unitary $(X+Y)/\sqrt{2}$ instead of S? Or why don’t we use the square root of Y instead of H? It would be equivalent mathematically, of course, but it would just seem a bit more consistent as a convention.
And why is our go-to non-Clifford gate the fourth root of Z? Why not the fourth root of X or Y?
What historical conventions led to this particular choice of gate set?
"
"['algorithm', 'speedup', 'complexity-theory']"," Title: Is there any general statement about what kinds of problems can be solved more efficiently using a quantum computer?Body: Is there a general statement about what kinds of problems can be solved more efficiently using quantum computers (quantum gate model only)? Do the problems for which an algorithm is known today have a common property?
As far as i understand quantum computing helps with the hidden subgroup problem (Shor); Grover's algorithm helps speedup search problems. I have read that quantum algorithms can provide speed-up if you look for a 'global property' of a function (Grover/Deutsch).
- Is there a more concise and correct statement about where quantum computing can help?
- Is it possible to give an explanation why quantum physics can help there (preferably something deeper that 'interference can be exploited')? And why it possibly will not help for other problems (e.g. for NP-complete problems)?
Are there relevant papers that discuss just that?
I had asked this question before over on cstheory.stackexchange.com but it may be more suitable here.
"
"['quantum-gate', 'circuit-construction', 'measurement']"," Title: Do multi-qubit measurements make a difference in quantum circuits?Body: Consider the unitary circuit model of quantum computation. If we need to generate entanglement between the input qubits with the circuit, it must have multi-qubit gates such as CNOT, as entanglement cannot increase under local operations and classical communication. Consequently, we can say that quantum computing with multi-qubit gates is inherently different from quantum computing with just local gates. But what about measurements?
Does including simultaneous measurements of multiple qubits make a difference in quantum computing or can we perhaps emulate this with local measurements with some overhead? EDIT: by ""emulate with local measurements"", I mean have the same effect with local measurements + any unitary gates.
Please notice that I am not merely asking how measuring one qubit changes the others, which has already been asked and answered, or if such measurements are possible. I am interested to know whether including such measurements could bring something new to the table.
"
"['annealing', 'adiabatic-model']"," Title: What precisely is quantum annealing?Body: Many people are interested in the subject of quantum annealing, as an application of quantum technologies, not least because of D-WAVE's work on the subject. The Wikipedia article on quantum annealing implies that if one performs the 'annealing' slowly enough, one realises (a specific form of) adiabatic quantum computation. Quantum annealing seems to differ mostly in that it does not seem to presuppose doing evolution in the adiabatic regime — it allows for the possibility of diabatic transitions.
Still, there seems to be more intuition at play with quantum annealing than just ""adiabatic computation done hastily"". It seems that one specifically chooses an initial Hamiltonian consisting of a transverse field, and that this is specifically meant to allow for tunnelling effects in the energy landscape (as described in the standard basis, one presumes). This is said to be analogous to (possibly even to formally generalise?) the temperature in classical simulated annealing. This raises the question of whether quantum annealing pre-supposes features such as specifically an initial transverse field, linear interpolation between Hamiltonians, and so forth; and whether these conditions may be fixed in order to be able to make precise comparisons with classical annealing.
- Is there a more-or-less formal notion of what quantum annealing consists of, which would allow one to point to something and say ""this is quantum annealing"" or ""this is not precisely quantum annealing because [it involves some additional feature or lacks some essential feature]""?
- Alternatively: can quantum annealing be described in reference to some canonical
framework — possibly in reference to one of the originating
papers, such as Phys. Rev. E 58 (5355),
1998
[freely available PDF
here]
— together with some typical variations which are accepted as
also being examples of quantum annealing?
- Is there at least a description which is precise enough that we can say that quantum annealing properly generalises classical simulated annealing, not by ""working better in practise"", or ""working better under conditions X, Y, and Z"", but in the specific sense in that any classical simulated annealing procedure can be efficiently simulated or provably surpassed by a noiseless quantum annealing procedure (just as unitary circuits can simulate randomised algorithms)?
"
"['algorithm', 'complexity-theory', 'optimization']"," Title: Is there any general statement about what kinds of problems can be approximated more efficiently using a quantum computer?Body: As the name already suggests, this question is a follow-up of this other. I was delighted with the quality of the answers, but I felt it would be immensely interesting if insights regarding optimization and approximation techniques were added, but might fall off-topic, hence this question.
From Blue's answer:
the rule of thumb in complexity theory is that if a quantum computer ""can help"" in terms of solving in polynomial time (with an error bound) iff the class of problem it can solve lies in BQP but not in P or BPP
How does this apply to approximation classes? Is there any specific topological, numerical, etc property of quantum computing that can be leveraged?
As an example of what could I be asking (but definitely not restricted to that!), take the Christofides algorithm: it exploits specific geometrical properties of the graph that it optimizes on (symmetry, triangle inequality): the salesman travels on a feasible world. But salesmen have also huge mass, and we can know their position and momentum at the same time with great precision. Maybe a quantum model could work as well for other kind of metrics with more relaxed restrictions, like the K-L divergence? In that case solving it would still be NP complete, but the optimization would apply for a broader topology. This example is maybe a long shot, but I hope you get what I mean. I don't really know if it makes sense at all, but the answer could also address it in that case :)
RELATED:
"
"['architecture', 'qudit', 'topological-quantum-computing', 'performance', 'anyons']"," Title: What is the most economical and preferred basis for the qudit?Body: In Classical Simulation of Quantum Error Correction in a Fibonacci Anyon Code, the authors state on page 2 in section I. Background, A. Topological model:
We consider a system supporting nonabelian Fibonacci anyon excitations, denoted by $\tau$. Two such anyons can have total charge that is either $\tau$ or $ \mathbb I$ (vacuum), or any superposition of these, and so the fusion space in this case is 2-dimensional. We can represent basis states for this space using diagrams of definite total charge for the Wilson loops, and arbitrary states as linear combinations of these diagrams:
For $n$ anyons of type $\tau$, the dimension of the fusion space grows asymptotically as $\varphi^n$, where $\varphi$ = $\frac{1+\sqrt 5}{2}$ is the golden ratio.
Observables associated with non-intersecting loops commute, and so a basis for the space can be built from a maximal set of disjoint, nested loops.
Finally, in "Coherence Frame, Entanglement Conservation, and Einselection" the authors state on page 3:
Preferred basis problem. From the method of CF, we discuss the preferred basis problem (PBP), which has been studied via the einselection approach [7, 8]. We will show, yet, the method of einselection is incomplete.
This method is described via the Stern-Gerlach experiment, as shown in the Fig. 1 of Ref. 7. The system is represented by the spin states (up and down) along some directions. One atom is put near one channel to serve
as the apparatus to interact with the spin, causing entanglement. In this measurement, the PBP means that there is no physical difference between states
We also demonstrated that the preferred basis problem can be resolved more naturally by the method of coherence frame than the einselection method.
Question: Are there different bases for each part of the model. Is there a preferred basis for a qudit or does it depend upon the underlying technology used to implement the qudits. How is the basis integral to the control and measurement?
Note: This may be related to, but is not a duplicate of: What is meant by the term "computational basis"?, nor is one of the answers currently offered there an answer to this question.
Initially, efforts where made to address some comments but this only succeeded in making the question longer and less clear, I've stripped it down but the edits can be reviewed by the curious in the edit history.
"
"['algorithm', 'complexity-theory']"," Title: Can the analysis or design of quantum algorithms benefit from parameterised algorithmics?Body: In the last decades, the field of parameterised algorithms, with fixed parameter tractibility (FPT) as its main tool has been provided new methods to analyse old algorithms and design techniques for new algorithms.
The basic idea of parameterised algorithms is that we 'pick' another parameter of our input other than the size (such as treewidth) and design algorithms that are efficient under the assumption that the chosen parameter is a (small) constant.
I wonder if the analysis and design of quantum algorithms can benefit from this approach. Has this been done, or are there good reasons why this is likely ineffective or ignored so far?
"
"['speedup', 'complexity-theory', 'classical-computing']"," Title: Empirical Algorithmics for Near-Term Quantum ComputingBody: In Empirical Algorithmics, researchers aim to understand the performance of algorithms through analyzing their empirical performance. This is quite common in machine learning and optimization. Right now, we would like to know something about the relative performance of quantum algorithms and their classical counterparts based on preliminary data from quantum computer emulators. My concern is that we might see encouraging empirical data that shows quantum computers with better scaling using simulators up to about 35 qubits, but then this advantage will disappear in the future once we have more data. What are the best practices for analyzing relative performance of classical and quantum algorithms in a robust way that gives insight about scaling? Or is this simply not yet possible?
"
"['algorithm', 'grovers-algorithm']"," Title: How does the Grover diffusion operator work and why is it optimal?Body: In this answer, Grover's algorithm is explained. The explanation indicates that the algorithm relies heavily on the Grover Diffusion Operator, but does not give details on the inner workings of this operator.
Briefly, the Grover Diffusion Operator creates an 'inversion about the mean' to iteratively make the tiny differences in earlier steps large enough to be measurable.
The questions are now:
- How does the Grover diffusion operator achieve this?
- Why is the resulting $O(\sqrt{n})$ in total time to search an unordered database optimal?
"
"['simulation', 'performance', 'many-body-systems']"," Title: Explicit Lieb-Robinson Velocity BoundsBody: Lieb-Robinson bounds describe how effects are propagated through a system due to a local Hamiltonian. They are often described in the form
$$
\left|[A,B(t)]\right|\leq Ce^{vt-l},
$$
where $A$ and $B$ are operators that are separated by a distance $l$ on a lattice where the Hamiltonian has local (e.g. nearest neighbour) interactions on that lattice, bounded by some strength $J$. The proofs of the Lieb Robinson bound typically show the existence of a velocity $v$ (that depends on $J$). This is often really useful for bounding properties in these systems. For example, there were some really nice results here regarding how long it takes to generate a GHZ state using a nearest-neighbour Hamiltonian.
The problem that I've had is that the proofs are sufficiently generic that it is difficult to get a tight value on what the velocity actually is for any given system.
To be specific, imagine a one dimensional chain of qubits coupled by a Hamiltonian
$$
H=\sum_{n=1}^N\frac{B_n}{2}Z_n+\sum_{n=1}^{N-1}\frac{J_n}{2}(X_nX_{n+1}+Y_nY_{n+1}), \tag{1}
$$
where $J_n\leq J$ for all $n$. Here $X_n$, $Y_n$ and $Z_n$ represent a Pauli operator being applied to a given qubit $n$, and $\mathbb{I}$ everywhere else. Can you give a good (i.e. as tight as possible) upper bound for the Lieb-Robinson velocity $v$ for the system in Eq. (1)?
This question can be asked under two different assumptions:
- The $J_n$ and $B_n$ are all fixed in time
- The $J_n$ and $B_n$ are allowed to vary in time.
The former is a stronger assumption which may make proofs easier, while the latter is usually included in the statement of Lieb-Robinson bounds.
Motivation
Quantum computation, and more generally quantum information, comes down to making interesting quantum states. Through works such as this, we see that information takes a certain amount of time to propagate from one place to another in a quantum system undergoing evolution due to a Hamiltonian such as in Eq. (1), and that quantum states, such as GHZ states, or states with a topological order, take a certain amount of time to produce. What the result currently shows is a scaling relation, e.g. the time required is $\Omega(N)$.
So, let's say I come up with a scheme that does information transfer, or produces a GHZ state etc. in a way that scales linearly in $N$. How good is that scheme actually? If I have an explicit velocity, I can see how closely matched the scaling coefficient is in my scheme compared to the lower bound.
If I think that one day what I want to see is a protocol implemented in the lab, then I very much care about optimising these scaling coefficients, not just the broad scaling functionality, because the faster I can implement a protocol, the less chance there is for noise to come along and mess everything up.
Further Information
$\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}\newcommand{\proj}[1]{\left|#1\right>\left<#1\right|}$There are some nice features of this Hamiltonian which I assume make calculation easier. In particular, the Hamiltonian has a subspace structure based on the number of 1s in the standard basis (it is said to be excitation preserving) and, even better, the Jordan-Wigner transformation shows that all the properties of higher excitation subspaces can be derived from the 1-excitation subspace. This essentially means we only have to do the maths on an $N\times N$ matrix $h$ instead of the full $2^N\times 2^N$ matrix $H$, where
$$
h=\sum_{n=1}^NB_n\proj{n}+\sum_{n=1}^{N-1}J_n(\ket{n}\bra{n+1}+\ket{n+1}\bra{n}).
$$
There is some evidence that the Lieb-Robinson velocity is $v=2J$, such as here and here, but these all use a close to uniformly coupled chain, which has a group velocity $2J$ (and I assume the group velocity is closely connected to the Lieb-Robinson velocity). It doesn't prove that all possible choices of coupling strength have a velocity that is so bounded.
I can add a bit further to the motivation. Consider the time evolution of a single excitation starting at one end of the chain, $\ket{1}$, and what its amplitude is for arriving at the other end of the chain $\ket{N}$, a short time $\delta t$ later. To first order in $\delta t$, this is
$$
\bra{N}e^{-ih\delta t}\ket{1}=\frac{\delta t^{N-1}}{(N-1)!}\prod_{n=1}^{N-1}J_n+O(\delta t^{N}).
$$
You can see the exponential functionality that you would expect being outside the 'light cone' defined by a Lieb-Robinson system, but more importantly, if you wanted to maximise that amplitude, you'd set all the $J_n=J$. So, at short times, the uniformly coupled system leads to the most rapid transfer. Trying to push this further, you can ask, as a bit of a fudge, when can
$$
\frac{t^{N-1}}{(N-1)!}\prod_{n=1}^{N-1}J_n\sim 1
$$
Taking the large $N$ limit, and using Stirling's formula on the factorial leads to
$$
\frac{etJ}{N-1}\sim 1,
$$
which suggests a maximum velocity of about $eJ$. Close, but hardly rigorous (as the higher order terms are non-negligible)!
$$
\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}\newcommand{\proj}[1]{\left|#1\right>\left<#1\right|}
$$
"
['quantum-memory']," Title: What is the purpose of a quantum RAM in quantum algorithms?Body: I see many papers (e.g. Quantum principal component analysis) in which the existence of qRAM is necessary. What's the actual purpose of qRAM in quantum algorithms?
"
"['physical-realization', 'architecture']"," Title: What is the argument that practical quantum computers cannot be built?Body: An answer to another question mentions that
There are arguments that suggests that such machines [""quantum Turing machines""] cannot even be built...
I'm not sure I fully understand the problem, so perhaps I'm not asking the right question, but here's what I could gather.
The slides are presented in a lecture (from 2013) by Professor Gil Kalai (Hebrew University of Jerusalem and Yale University). I watched most of the lecture, and it seems his claim is that there is a barrier to creating fault-tolerant quantum computers (FTCQ), and this barrier probably lies around creating logical qubits from physical components. (timestamp 26:20):
It sounds like the reason for such a barrier is due to the problem of noise and error-correction. And even though current research takes into account noise, it doesn't do so in the right manner (this is the part I don't understand).
I know many people (e.g., Scott Aaronson) are skeptical of this claim of impossibility, but I'm just trying to better understand the argument:
What is the reason for suggesting that practical quantum computers cannot be built (as presented by Professor Gil Kalai, and has anything changed since 2013)?
"
['quantum-state']," Title: Alternative to Bloch sphere to represent a single qubitBody: In order to represent the single qubit $|\psi\rangle$ we use an unitary vector in a $\mathbb{C}^2$ Hilbert space whose (one of the) orthonormal base is $(|0\rangle, |1\rangle)$.
We can draw $|\psi\rangle$ using a Bloch ball. However, I found this notation quite confusing, because orthogonal vectors are spatially antiparallel (brief explanation in this Physics Stackexchange question).
Do you know any different graphical representation for a single qubit?
"
"['physical-qubit', 'entanglement']"," Title: What does it mean for two qubits to be entangled?Body: I have done some sort of online research on qubits and the factors making them infamous i.e allowing qubits to hold 1 and 0 at the same time and another is that qubits can be entangled somehow so that they can have related data in them no matter how far they are (even at opposite sides of the galaxies).
While reading about this on Wikipedia I have seen some equation which is still difficult for me to comprehend. Here's the link to Wikipedia.
Questions:
- How are they entangled in the first place?
- How do they relate their data?
"
"['algorithm', 'architecture', 'experiment', 'decoherence']"," Title: Can one interrogate black boxes for quantum coherence?Body: This question is based on a scenario that is partly hypothetical and partly based on the experimental features of molecule-based quantum devices, which often present a quantum evolution and have some potential to be scalable, but are generally extremely challenging to characterize in detail (a relevant but not unique example is a series of works related to this electrical control of nuclear spin qubits in single molecules).
The scenario: Let us say we have a variety of black boxes, each of which is are able to process information. We don't control the quantum evolution of the boxes; in the language of the quantum circuit model, we do not control the sequence of quantum gates. We know each black box is hardwired to a different algorithm, or, more realistically, to a different time-dependent Hamiltonian, including some incoherent evolution. We don't know the details of each black box. In particular, we don't know whether their quantum dynamics are coherent enough to produce a useful implementation of a quantum algorithm (let us herein call this ""quantumness""; the lower bound for this would be ""it's distinguishable from a classical map""). To work with our black boxes towards this goal, we only know how to feed them classical inputs and obtain classical outputs. Let us here distinguish between two sub-scenarios:
- We cannot perform entanglement ourselves: we employ product states as
inputs, and single qubit measurements on the outputs. However, we can choose the basis of our input preparation and of our measurements (at minimum, between two orthogonal bases).
- As above, but we cannot choose the bases and have to worked on some fixed, ""natural"" base.
The goal: to check, for a given black box, the quantumness of its dynamics. At least, for 2 or 3 qubits, as a proof-of-concept, and ideally also for larger input sizes.
The question: in this scenario, is there a series of correlation tests, in the style of Bell's inequalities, which can achieve this goal?
"
"['d-wave', 'annealing', 'bayesian-learning']"," Title: How can a D-Wave style Annealing QPU help sampling?Body: This question is a follow-up on this one, with the hope of getting more specific clues, and was motivated by this answer by user Rob.
Also please note this posts that handle the topic of QA in much more detail:
https://quantumcomputing.stackexchange.com/a/1596
https://quantumcomputing.stackexchange.com/a/4228
In D-Wave Systems' webpage, we can read a description of how an annealing QPU like their 2000Q flagship is able perform optimization on a given distribution by regarding many paths simultaneously, which makes the optimization process more robust against local minima and such.
After that, they claim that ""it is best suited to tackling complex optimization problems that exist across many domains"", and they cite (among others), optimization, machine learning and sampling / Monte Carlo
Furthermore, in Wikipedia, we see that
Quantum annealing (QA) is a metaheuristic for finding the global minimum of a given objective function over a given set of candidate solutions [...]. Quantum annealing starts from a quantum-mechanical superposition of all possible states (candidate states) with equal weights. Then the system evolves [...] The transverse field is finally switched off, and the system is expected to have reached the ground state.
At this point, we see that both explanations (with different detail levels) address the question of how annealing can help non-convex optimization (among other things). And that isn't even specifically related to quantum computing since simulated annealing stands on its own. But it is D-Wave claiming their hardware can help to perform sampling.
Maybe the connection is obvious and I'm missing it, but I think sampling is a distinct enough task from optimization to require its own explanation. The specific questions that I have are:
- Given some data following a possibly unknown distribution, how can the D-Wave be used to perform sampling on it? What are the constraints?
- To what extent is it advantageous against other SoTA classical sampling algorithms like, say, Gibbs?
- Are the possible advantages specific to annealing QPUs, to any QPUs or a general property of simulated annealing?
"
"['architecture', 'error-correction', 'fault-tolerance', 'chemistry']"," Title: What set of quantum logical operations can one use to benchmark spin Hamiltonians?Body: Chemistry background: In magnetic molecules, it is sometimes the case that one can adjust the time-independent Hamiltonian by chemical design. This means there is freedom to adjust parameters in the time-independent Hamiltonian during the design phase, but when the device is prepared these parameters cannot be adjusted further. An example would be molecules containing magnetic ions with a well-defined spin anisotropy and which communicate with each other via dipolar interactions: if it is chemically possible to position the spins in 3D space and to orient their magnetization axes, one has a certain control over the final form of the time-independent Hamiltonian. (For a state-of-the-art example, see A modular design of molecular qubits to implement universal quantum gates).
Operational problem: In a given experimental setup aiming to implement quantum computing, there will be a collection of physical operations (described by a time-dependent Hamiltonian) which in principle allow for arbitrary quantum logical operations. In practice, the number of physical operations needed to implement a certain quantum algorithm (or even an elementary logical quantum gate) also depends on the details of the time-independent Hamiltonian. (See for example Spin qubits with electrically gated polyoxometalate molecules, where sqrt(SWAP) is spontaneously ""implemented"" by a simple waiting time).
Goal + question: Whenever one aims for a certain quantum logical manipulation (such as a Quantum Fourier Transform), it seems obvious that there will be some time-independent Hamiltonians that will require a smaller number of physical operations than others. Our goal would be to find design criteria; to find the parameters that we can adjust by chemical design that makes the number of operations small, not in a particular case but for a typical collection of quantum transformations. In the form of a question: is there a reasonable set of quantum logical operations that could be used in this context to benchmark the typical efficiency of time-dependent spin Hamiltonians?
"
"['architecture', 'solid-state', 'biocomputing']"," Title: Is Quantum Biocomputing ahead of us?Body: Now that we know of bio/molecular tools that allow living organisms to deal with quantum computations e.g. the fancy proteins that allow birds to handle quantum coherence (e.g. The quantum needle of the avian magnetic compass or Double-Cone Localization and Seasonal Expression Pattern Suggest a Role in Magnetoreception for European Robin Cryptochrome 4) I wonder:
- Are these tools already solving problems you (quantum computing researchers) have?
- Is there any specific issue these tools 'must' be solving somehow that you are struggling with at your labs?
- Could we use them (although this will imply a paradigm shift towards biotechnology)?
"
"['quantum-gate', 'circuit-construction', 'physical-realization']"," Title: How do I add 1+1 using a quantum computer?Body: This can be seen as the software complement to How does a quantum computer do basic math at the hardware level?
The question was asked by a member of the audience at the 4th network of the Spanish Network on Quantum Information and Quantum Technologies. The context the person gave was: ""I'm a materials scientist. You are introducing advanced sophisticated theoretical concepts, but I have trouble picturing the practical operation of a quantum computer for a simple task. If I was using diodes, transistors etc I could easily figure out myself the classical operations I need to run to add 1+1. How would you do that, in detail, on a quantum computer? "".
"
"['quantum-state', 'quantum-operation', 'terminology']"," Title: Significance of The Church of the Higher Hilbert spaceBody: The term ""Church of the Higher Hilbert Space"" is used in quantum information frequently when analysing quantum channels and quantum states.
What does this term mean (or, alternately, what does the term ""Going to To the Church of the Higher Hilbert Space"" mean)?
"
"['algorithm', 'complexity-theory', 'bqp']"," Title: Consequences of SAT ∈ BQPBody:
""Quantum magic won't be enough"" (Bennett et al. 1997)
If you throw away the problem structure, and just consider the space of $2^n$ possible solutions, then even a quantum computer needs about $\sqrt{2^n}$ steps to find the correct one (using Grover's algorithm)
If a quantum polynomial time algorithm for an $\text{NP}$-complete problem is ever found, it must exploit the problem structure in some way.
(...)
I've some (basic) questions that no one seems to have asked so far on this site (maybe because they are basic). Suppose someone finds a bounded error quantum polynomial time algorithm for $\text{SAT}$ (or any other $\text{NP}$-complete problem), thus placing $\text{SAT}$ in $\text{BQP}$, and implying $\text{NP} \subseteq \text{BQP}$.
Questions
Which would be the theoretical consequences of such a discovery? How would the overall picture of complexity classes be affected? Which classes would become equal to which others?
Source
"
"['algorithm', 'entanglement', 'quantum-state', 'correlations']"," Title: How are EPR Pairs used in quantum computing?Body: Context
Lately, I have been reading a scholarly paper entitled An Introduction to Quantum Computing for Non-Physicists which discusses the EPR Paradox.
The paper states that:
Einstein, Podolsky and Rosen proposed a gedanken experiment that uses entangled particles in a manner that seemed to violate fundamental principles of relativity.
It concludes that the paradox is resolved as the symmetry shown by changing observers indicates that they cannot use their EPR pair to communicate faster than the speed of light. However, the paper fails to adequately explain what an EPR pair is used for and does not even define the term. The best definition I could find is referenced to in the Wikipedia article, Bell state.
An EPR pair is a pair of qubits (or quantum bits) that are in a Bell state together.
This definition doesn't provide much detail beyond the basics of what an EPR pair is.
The Question
How are EPR Pairs used in quantum computing?
"
"['algorithm', 'complexity-theory']"," Title: Quantum Algorithm SAT structureBody:
"Quantum magic won't be enough" (Bennett et al. 1997)
If you throw away the problem structure, and just consider the space of $2^n$ possible solutions, then even a quantum computer needs about $\sqrt{2^n}$ steps to find the correct one (using Grover's algorithm)
If a quantum polynomial time algorithm for a $\text{NP}$-complete problem is ever found, it must exploit the problem structure in some way.
I've some (basic) questions that no one seems to have asked so far on this site (maybe because they are basic). Suppose someone finds a bounded error quantum polynomial time algorithm for $\text{SAT}$ (or any other $\text{NP}$-complete problem), thus placing $\text{SAT}$ in $\text{BQP}$, and implying $\text{NP} \subseteq \text{BQP}$.
Questions
The possibility (or not) to exploit the problem structure in a general enough (i.e. specific-instance independent) manner seems to be the very core of the $\text{P = NP}$ question. Now if a bounded error polynomial-time quantum algorithm for $\text{SAT}$ is found, and it must exploit the problem structure, wouldn't its structure-exploitation-strategy be usable also in the classical scenario? Is there any evidence indicating that such a structure-exploitation may be possible for quantum computers, while remaining impossible for classical ones?
Sources
Related
"
"['quantum-state', 'notation', 'pauli-gates']"," Title: How to compute the average value $\langle X_1 Z_2\rangle$ for a two-qubit system?Body:
- Show that the average value of the observable $X_1Z_2$ in a two-qubit system measured in the state $(|00\rangle + |11\rangle)/\sqrt{2}$ is zero.
How would we approach this question? I understand that $X_1$ means $\sigma_1$ acting on the first qubit, and $Z_2$ means $\sigma_3$ acting on the second qubit. I also know that the average value is given by $\left<\psi\vert M\vert \psi\right>$ (the inner product of $\psi$ with $M \psi$). I know how to solve similar problems for a single qubit system, however what confuses me here is what is the vector representation of the states $\left| 00\right>$ and $\left| 11\right>$ and how is this related to the vector representation of $\left| 0\right>$ and $\left| 1\right>$? Also, what is the matrix form of $M$ in this case? Is it the tensor product of $\sigma_1$ applied to the first qubit and $\sigma_3$ applied to the second qubit?
Source of the question
"
"['d-wave', 'circuit-construction', 'universal-gates']"," Title: What would be the simplest addition that would make the D-Wave architecture universal?Body: The D-Wave system, as I understand it, allows us to program Ising models and to find their ground states. In this form, it is not universal for quantum computation: it can not simulate a circuit model quantum computer.
What would be the simplest thing that could be done to make it universal? What are the reasons why such a thing has not been implemented?
"
"['algorithm', 'speedup', 'd-wave', 'universal-gates']"," Title: Requirements for Achieving a Quantum SpeedupBody: We usually talk about the power of a quantum computer by examining the separation between sets of gates that we know we can efficiently simulate on a classical computer (i.e. problems in the class BPP), and universal gate sets which, by definition, can implement any quantum algorithm, including BQP-complete algorithms. So, assuming a separation between BPP and BQP, there is a separation in the power of the algorithms that can be implemented with these gate sets, and the separation between these gate sets can be as simple as the availability of one gate (two classic examples are the Clifford gates + the $\pi/8$ phase gate, and Toffoli+Hadamard). In effect, you need a universal gate set in order to gain a computational speed-up. However, this is specifically about algorithms with polynomial running times.
What are the requirements that distinguish the power of a quantum computer which is intended solely to provide a polynomial speed-up on a problem outside BPP? For example, a device built solely for the purpose of implementing a Grover's search. Presumably the D-Wave machines fall into this category.
To be clear, I require a speed-up that changes the scaling relation. If there's a classical algorithm that requires time $O(2^n)$, then obviously there are many different ways of physically implementing it which have different running times, but all will be $O(2^n)$. I'm interested in identifying what it is in a quantum computer that permits a better scaling (but not a reduction to polynomial time running).
Asked another way: think about the D-wave machine (although I am not aiming to be limited to just talking about this case), which we believe is doing something coherent, and for a given problem size, seems to be quite speedy, but we don't know how it scales. Can we know a priori, from details of its architecture, that it at least has the potential to provide a speed-up over classical? If it were universal for quantum computation, then it certainly would have that potential, but universality probably isn't necessary in this context.
Part of what I'm struggling to get my head around, even in terms of defining the question properly, is that we don't have to have a universal gate set because it doesn't necessarily matter if the gate set can be efficiently simulated on a classical computer, just so long as the overhead in performing the simulation is similar or worse than the speedup itself.
"
"['algorithm', 'resource-request', 'programming']"," Title: A sample quantum algorithm, useful for demonstrating languagesBody: I'm looking for a quantum algorithm which I can use to demonstrate the syntax of different quantum-languages. My question is similar to this, however, for me, ""good"" means:
- What it does could be described in 1-2 paragraphs, and should be easy to understand.
- Should use more elements of the ""quantum-programming-world"" (I mean that the algorithm should use some classical constants, measurements, conditions, qregisters, operators etc., as many as possible).
- The algorithm should be small (at most 15-25 pseudocode-lines long).
Useful algorithms are often too long/hard, but Deutsch's algorithm doesn't use that many elements. Can someone suggest me a good-for-demo algorithm?
"
['cryptography']," Title: Does quantum computing threaten blockchain?Body: As per Wikipedia, blockchains are a way to maintain ""a continuously growing list of records, called blocks, which are linked and secured using cryptography [... and] inherently resistant to modification of the data.""
Blockchains are in current practical use, for example in the cryptocurrency bitcoin. These implementations must make use of some particular approach to cryptography, which will involve assumptions intended to underwrite their security.
Are the current implementations of blockchain resistant to attacks using quantum computation?
"
"['complexity-theory', 'resource-request']"," Title: Good introductory material on quantum computational complexity classesBody: I wish to learn more about computational complexity classes in the context of quantum computing.
The medium is not so important; it could be a book, online lecture notes or the like. What matters the most are the contents.
The material should cover the basics of quantum computational complexity classes and discuss the similarities, differences and relationships between them and perhaps also with classical computational complexity classes.
I would prefer a rigorous treatment over an intuitive one. The author's style doesn't matter.
As for prerequisites, I know next to nothing about the topic, so maybe more self-contained material would be better. That being said, I probably would not read a 1000 page book unless it was phenomenally good, anything in the range of 1-500 pages might work.
As for availability, I would of course prefer material that is not behind a paywall of some sort and can be found online, but this is not a strict requirement.
What do you recommend?
"
"['physical-qubit', 'experiment', 'fidelity']"," Title: What is the longest time a qubit has survived with 0.9999 fidelity?Body: I am pretty intrigued by the record time that a qubit has survived.
"
"['architecture', 'experiment']"," Title: Any few-qubit versions of Lloyd's ""weakly-coupled-array"" quantum computing?Body: On 1993, Seth Lloyd published in Science a proposal for A Potentially Realizable Quantum Computer. In a nutshell, this consists in a long chain of weakly coupled qubits which are operated with (almost) no need for the operator to differentially address the different memory positions (i.e. no spatial addressing is required), and at the same time it does not require every qubit to present a different energy. Instead, all qubits are equivalent, with the exceptions of
- the two extremes of the chain are distinguishable from the bulk (and this feature is used to introduce new information) and
- a qubit is sensitive to its immediate neighbours, so at any given time you effect the same simultaneous operation on all qubits with certain surroundings, while leaving those with differing ones unperturbed (this feature allows operating in a manner of cellular automata)
My question is: have few-qubit versions of Lloyd's proposal been proposed, or implemented? (If yes: under what architecture(s), and if not, what would be required to do it?)
"
['technologies']," Title: Do the 'fundamental circuit elements' have a correspondence in quantum technologies?Body: Capacitors, Inductors and Resistors are well-known circuit components. Since the proposal of Leon Chua in 1971, the Memristor joined them as a fundamental component.
I am wondering whether these elements would be somehow imitated by the means of quantum technologies and what would be the requirements to achieve them.
"
"['architecture', 'entanglement', 'quantum-memory', 'solid-state']"," Title: Entanglement transfer of spin-entangled triplet-pair states between flying qubits and stationary qubitsBody: The context: We are in the solid state. After a photon absortion by a system with a singlet ground state, the system undergoes the spin-conserving fission of one spin singlet exciton into two spin triplet excitons (for context, see The entangled triplet pair state in acene and heteroacene materials). These spin triplet pair propagates in the solid, still entangled. The quantum-computing-related goal of all this operation would be to transfer the entanglement of the two flying qubits to two positions that are fixed in space and are also well protected from decoherence (low-energy excitations of nuclear spins in a paramagnetic ion, for example).
The problem at hand (1), and the question: What would be the requirements to favour said quantum information transfer between the flying qubits and the stationary qubits?
(I know flying vs stationary qubit scenarios have been explored, but I have no experience in that field).
"
"['architecture', 'entanglement', 'decoherence', 'solid-state']"," Title: Decoherence of spin-entangled triplet-pair states in the solid state: local vs delocalized vibrationsBody: The context: We are in the solid state. After a photon absortion by a system with a singlet ground state, the system undergoes the spin-conserving fission of one spin singlet exciton into two spin triplet excitons (for context, see The entangled triplet pair state in acene and heteroacene materials). These spin triplet pair propagates in the solid, still entangled. The quantum-computing-related goal of all this operation would be to transfer the entanglement of the two flying qubits to two positions that are fixed in space and are also well protected from decoherence (low-energy excitations of nuclear spins in a paramagnetic ion, for example).
The problem at hand (2), and the question: Eventually, the entanglement between the two triplets is lost, and moreover inevitably the triplets find a way to relax back to the singlet ground state, emitting energy in form of photons. I would like to calculate how these processes are affected by vibrations. I assume the independent relaxation of each of the two triplets can be calculated mostly considering local vibrations, e.g. following a procedure similar to the one we employed here (Determining key local vibrations in the relaxation of molecular spin qubits and single-molecule magnets). Would the calculation of the loss of entanglement be necessarily related to delocalized vibrational modes that simultaneously involve the local environment of both triplets?
"
"['algorithm', 'circuit-construction', 'simons-algorithm']"," Title: How exactly does Simon's algorithm solve the Simon's problem?Body: Problem Statement: We are given a $2-1$ function $f:\{0,1\}^{n}\to\{0,1\}^{n}$ such that: there is a secret string $s\in\{0,1\}^{n}$ such that: $f(x)=f(x\oplus s)$. Challenge: find $s$.
Simon's algorithm says:
- Set up a random superposition $$\frac{1}{\sqrt{2}}|r\rangle + \frac{1}{\sqrt{2}}|r\oplus s\rangle$$
- Fourier sample to get a random $y$: $$y.s=0\ (\text{mod 2})$$
- Repeat steps $n-1$ times to generate $n-1$ linear equations in $s$.
Solve for $s$.
I don't understand steps (1) and (2). Why and how exactly do we set up the random superposition? How does it help? Also, in step (2), what does the dot operator (in $y.s$) stand for? Bit-wise multiplication?
"
"['architecture', 'physical-qubit', 'optical-quantum-computing']"," Title: What is the relation between single photon qubits and squeezed light qubits?Body: In my constant thrill to know more about Quantum Computing I wanna know what is this relation. Additionally: Can one use squeezed light to effect multi-qubit operations on single photon qubits, or are these completely independent approaches?
"
"['classical-computing', 'research']"," Title: Can the theory of quantum computation assist in the miniaturization of transistors?Body: In his inaugural lecture, Ronald de Wolf states
People are working with quantum objects, but trying to make them behave as classical as possible. (...) Instead of suppressing them to make systems behave as classically as possible, why not try to
benefit from them?
While he goes on to state that looking at fully exploiting the quantum effects is more interesting, I do wonder if and how the 'naturally occurring' quantum effects on extremely small transistors could be used to get better classical (or perhaps some classical/quantum hybrid) computation.
Obviously, the design of those transistors needs to use quantum mechanics, but not necessarily quantum information or quantum computation theory.
Has there been any promising research or results in this direction? Or are the good reasons why this wouldn't work?
"
"['architecture', 'entanglement', 'experiment']"," Title: What are the current solutions to generate entangled qubits in the solid state?Body: Pairs of entangled qubits (or Bell pairs, or EPR pairs) are a fundamental resource for quantum computing, in the sense that any computational platform that cannot generate entanglement will also be unable to provide a computational advantage.[1] In two recent questions, Decoherence of spin-entangled triplet-pair states in the solid state: local vs delocalized vibrations and Entanglement transfer of spin-entangled triplet-pair states between flying qubits and stationary qubits, I asked about a physical scenario with the goal of generating entangled qubits pairs in the solid state. I know of this result of 2013, Heralded entanglement between solid-state qubits separated by 3 meters, which used photons and NV-centers in diamond, so this can be achieved in practice. Hoewever, I am not up-to-date on what is currently the best option.
My question is: What is the current technological status for the generation of entangled qubit pairs in the solid state? In particular, which options are currently fastest and/or most reliable?
[1] Thanks to Niel de Beaudrap who pointed that out in a comment.
"
['algorithm']," Title: Bernstein–Vazirani problem in book as exerciseBody: I´ve solved the Exercise 7.1.1 (Bernstein–Vazirani problem) of the book ""An introduction to quantum computing"" (Mosca et altri). The problem is the following:
Show how to find $a \in Z_2^n$ given one application of a black box that maps $|x\rangle|b\rangle \to |x\rangle |b \oplus x · a\rangle$ for some $b\in \{0, 1\}$.
I´d say we can do it like this:
- First i go from $|0|0\rangle \to \sum_{i \in \{0,1\}^n}|i\rangle| + \rangle$ using QFT and Hadamard
- Then I apply the oracle:
$$ \sum_{i \in \{0,1\}^n}(-1)^{(i,a)} |i\rangle| + \rangle $$
- Then I read the pase with an Hadamard (since we are in $Z_2^n$ our QFT is an Hadamard)
$$ |a\rangle |+ \rangle $$
I think is correct. Do you agree?
"
"['quantum-gate', 'quantum-state']"," Title: How do you rotate a Fock state qubit?Body: I read that a qubit can be encoded in a Fock state, such as the presence or absence of a photon. How do you perform single qubit rotations on Fock states?
"
"['error-correction', 'topological-quantum-computing']"," Title: Is Gil Kalai's argument against topological quantum computers sound?Body: In a lecture, recorded on Youtube, Gil Kalai presents a 'deduction' for why topological quantum computers will not work. The interesting part is that he claims this is a stronger argument than the argument against fault tolerant computing in general.
If I understand his argument correctly, he states that
- A (hypothetical) quantum computer without quantum error correction can simulate the system of anyons representing the qubit in a topological quantum computer.
- Therefore, any quantum computer based on these anyons must have at least as much noise as a quantum computer without quantum error correction. As we know that our noisy quantum computer is insufficient for universal quantum computation, topological quantum computers based on anyons cannot provide universal quantum computation either.
I think step 2 is sound, but I have some doubts on step 1 and why it implies 2. In particular:
- Why can a quantum computer without error correction simulate the system of anyons?
- If it can simulate the system of anyons, is it possible that it can only do so with low probability and hence cannot simulate the topological quantum computer with the same fault tolerance as the system of anyons?
"
"['algorithm', 'experiment']"," Title: Which is the highest number factorized by QC in a non-specific experiment?Body: Since the original experimental contribution using the Shor's factoring algorithm to factorize the integer 15 some experiments have been performed in order to calculate the largest factorized number. But most of the experiments are particularly designed for a specific number ($N$) and not a general approach which could be used for any $<N$ integer. Example.
I am wondering which is, at the moment, the largest number that has been experimentally factorized in a general procedure by a quantum algorithm.
"
"['notation', 'error-correction']"," Title: What does quantum error correction code notation stand for?Body: I understand the notation for classical error correcting codes. E.g., ""Hamming(7,4)"" stands for a Hamming code that uses 7 bits to encode blocks of 4 bits.
What does the notation for quantum error correcting codes mean? E.g., there is a paper that deals with a [[4,2,2]]-code. What are these three numbers? What do double brackets stand for?
"
"['circuit-construction', 'simulation']"," Title: Simulating Clifford + few-T circuitsBody: I want to simulate large stabilizer circuits (H/S/CNOT/MEASURE/feedforward) with a small number of T gates mixed in. How can I do this in a way that scales exponentially only in the number of T gates? Are there existing implementations?
"
"['classical-computing', 'history', 'scalability']"," Title: Does Moore's law apply to quantum computing?Body: Plain and simple. Does Moore's law apply to quantum computing, or is it similar but with the numbers adjusted (ex. triples every 2 years). Also, if Moore's law doesn't apply, why do qubits change it?
"
"['quantum-gate', 'teleportation']"," Title: What is quantum gate teleportation?Body: Quantum state teleportation is the quantum information protocol where a qubit is transferred between two parties using an initial shared entangled state, Bell measurement, classical communication and local rotation. Apparently, there is also something called quantum gate teleportation.
What is quantum gate teleportation and what is it used for?
I am particularly interested in possible applications in simulating quantum circuits.
"
"['quantum-gate', 'physical-qubit', 'optical-quantum-computing']"," Title: How do you apply a CNOT on polarization qubits?Body: I read that a qubit can be encoded in a polarization state (horizontal or vertical polarization of a photon). How do you perform two-qubit operations on a polarization qubit?
"
"['algorithm', 'shors-algorithm']"," Title: Shor's algorithm caveats when $a^{r/2} =-1 \mod N$Body: For an integer, $N$, to be factorised, with $a$ (uniformly) chosen at random between $1$ and $N$, with $r$ the order of $a\mod N$ (that is, the smallest $r$ with $a^r\equiv 1\mod N$):
Why is that in Shor's algorithm we have to discard the scenario in which $a^{r/2} =-1 \mod N$? Also, why shouldn't we discard the scenario when $a^{r/2} = 1 \mod N$?
"
"['algorithm', 'speedup']"," Title: What is the minimum integer value to make quantum factorization to be worthwhile?Body: Let us assume that we have quantum and classical computers such that, experimentally, each elementary logical operation of mathematical factorization is equally time-costing in classical and in quantum factorization:
Which is the lowest integer value for which the quantum proceeding is faster than the classical one?
"
"['error-correction', 'stabilizer-code']"," Title: Why is the Pauli group used for stabilizers?Body: When it comes to error correction, we take our stabilizers to be members of the Pauli group. Why is the Pauli group used for this and not, say, the group of all unitary matrices?
"
"['error-correction', 'terminology', 'stabilizer-code', 'nielsen-and-chuang']"," Title: What is the difference between ""code space"", ""code word"" and ""stabilizer code""?Body: I keep reading (e.g. Nielsen and Chuang, 2010; pg. 456 and 465) the following three phases; ""code space"", ""code word"" and ""stabilizer code"" - but am having a difficult time finding definitions of them and more importantly how they differ from one another.
My question is therefore; how are these three terms defined and how are they related?
"
"['entanglement', 'locc-operation']"," Title: How is the measurement described in the LOCC wikipedia a measurement on the product state $\mathbb C^2\otimes\mathbb C^n$?Body: I'm currently busy learning about the basics of quantum information theory. Does anyone know how the measurement described in the wiki link LOCC is a measurement on the product space $\mathbb{C}^2 \otimes \mathbb{C}^n$ as stated?
"
['key-distribution']," Title: Why is the efficiency of Ekert 91 Protocol 25%?Body: In Cabello's paper Quantum key distribution without alternative measurements, the author said ""the number of useful random bits shared by Alice and Bob by transmitted qubit, before checking for eavesdropping, is 0.5 bits by transmitted qubit, both in BB84 and B92 (and 0.25 in E91)"" (see here, page 2).
In E91 protocol, Alice and Bob each chooses independently and randomly from three measurement bases, so there are 9 situations and only 2 of them can yeild correct bits. Does that mean the efficiency of E91 is $\frac 2 9$ ? Why does the useful random bits is 0.25 bits by transmitted qubits in E91?
"
"['algorithm', 'complexity-theory', 'bqp']"," Title: Is BQP only about time? Is this meaningful?Body: The complexity class BQP (bounded-error quantum polynomial time) seems to be defined only considering the time factor. Is this always meaningful? Do algorithms exist where computational time scales polynomially with the input size but other resources such as memory scale exponentially?
"
"['algorithm', 'architecture', 'neural-network']"," Title: Can quantum computing provide advantages related to Hardware-Neural Networks?Body: The following question is related to this one: Will deep learning neural networks run on quantum computers?. I found it complementary and necessary because the previous answers are not completely related with my concerns.
Primarily, my question is related to hardware-based neural networks. As proposed by Precioso et al. in 'Training and operation of an integrated neuromorphic network based on metal-oxide memristors' the use of solid-state or even molecular memristors can be a hardware proposal to implement efficient and non-volatile neural networks.
Thus, the question is: Is there a quantum logic operation which can be used to improve the algorithms present in neural networks? Can quantum logic add any possible strategy in order to increase the efficiency of such networks?
"
"['entanglement', 'decoherence', 'teleportation']"," Title: What is the maximum separation between two entangled qubits that has been achieved experimentally?Body: Considering two entangled flying qubits, as far as I know, there is no physical limit for separating them without losing quantum information.
See: Is there any theoretical limit to the distance at which particles can remain entangled?
Question
- What is the actual record in such distance using photons? I have found a previous record in 143 km (Physicists break quantum teleportation distance)
- What about using solid-state based qubits?
- Can this suppose a limitation when constructing a solid-state quantum computer?
"
"['quantum-gate', 'entanglement']"," Title: What happens if two separately entangled qubits are passed through a C-NOT gate?Body: Suppose I transform a state as follows:
- I start with the state $\lvert 0\rangle \otimes \lvert0\rangle \otimes \lvert0\rangle \otimes \lvert 0 \rangle$.
- I entangle the 1st and 2nd qubits (with an H gate and C-NOT).
- I then then entangle the 3rd and 4th qubits the same way.
If I try to apply H gate and C-NOT to the 2nd and 3rd qubits afterwords, will the whole system become entangled? What happens to the 1st and 4th qubits in that case?
(Cross-posted from Physics.SE)
"
"['architecture', 'solid-state']"," Title: What is the most optimistic perspective of room-temperature solid-state QC?Body: I've read the ""trend"" article entitled Is a room-temperature, solid-state quantum computer mere fantasy? from almost 10 years ago, and was wondering if things have really changed: What is the current consensus on the viability of a room-temperature solid-state quantum computer?
"
['error-correction']," Title: Intuition for Shor code failure probabilityBody: Consider the 9 qubit Shor code. This can detect and correct arbitrary single qubit errors, but if there are 2 or more single qubit errors before a correction round, the correction will fail. (In the sense that it won't reproduce the original logical state.) Hence the probability of failure of the Shor code is the probability of there being 2 or more single qubit errors. If we assume that single qubit errors occur independently with probability $p$, then we can calculate this probability as
$$
P(\mathrm{failure}) = 1 - \left[(1-p)^{9} + 9p(1-p)^{8}\right].
$$
We can write this probability as a series in $p$ as
$$
P(\mathrm{failure}) = \sum_{m=2}^{9} (-1)^{m} (m-1) \binom{9}{m} p^{m}.
$$
My question is about the intuition for the coefficients of each term in this sum.
The $\binom{9}{m} p^{m}$ part seems natural. We can interpret it as the probability that $m$ single qubit errors occur multiplied by the number of groups of $m$ qubits these errors could act on.
Question: What I am confused by is the $(-1)^{m} (m-1)$ part of the coefficient. Why should some of the higher order terms lead to a suppression of the failure probability, and why should the weighting of these terms beyond the binomial coefficient increase with order? Is there some intuition for these coefficients?
Note 1: I realise that the $m=2$ case is the most important, since we typically assume $p \ll 1$. Indeed, most treatments truncate the series at $m=2$, where $(-1)^{m} (m-1) = 1$, so even if the higher-order terms do have an effect, that effect should be fairly negligible.
Note 2: Though I have specified the Shor code for concreteness, this behaviour is not specific to the Shor code. For example, if we restrict ourselves to bit-flip errors, then the failure probability of the bit-flip code will exhibit similar coefficients.
"
['cryptography']," Title: Quantum computing and blockchain technologyBody: It is popularly stated that quantum computing could destroy and disrupt blockchain technology completely. How is quantum computing a threat to blockchain technology?
"
"['entanglement', 'complexity-theory', 'qma']"," Title: Upper Bounds for QMA Quantum Merlin Arthur, and QMA(k)Body: QMA (Quantum Merlin Arthur), is the quantum analog of NP, and QMA(k) is the class with $k$ Merlins. These are important classes when studying Quantum Complexity theory. QMA(k) is QMA with $k$ unentangled provers ($k$ Merlins), or BQP verfiers. These classes enable us to formally study the complexity of Entanglement. For instance the class QMA(2) could help us to study the separability of quantum states, and resources required for telling whether these states are separable or far from separable.
A natural question arises - What are the upper bounds for these classes (QMA, QMA(k))- do these classes have nontrivial upper bounds(could they have upper bounds such as PSPACE?
"
"['architecture', 'experiment', 'decoherence', 'quantum-walks', 'biology']"," Title: Quantum simulation of environment-assisted quantum walks in photosynthetic energy transferBody: This question is related to Can the theory of quantum computation assist in the miniaturization of transistors? and Is Quantum Biocomputing ahead of us?
About 10 years ago, several papers discussed the environment-assisted quantum walks in photosynthetic energy transfer (Mohseni, Rebentrost, Lloyd, Aspuru-Guzik, The Journal of Chemical Physics, 2008) and the dephasing-assisted transport: quantum networks and biomolecules (Plenio, Huelga, New Journal of Physics 2008). One major idea there seems to be that the ""environment"" (quantum decoherence) assists or optimizes the transport of a signal that is also fundamentally quantum coherent in nature.
My question is: beyond the theoretical interpretation of processes happening in natural systems, have physical processes of this kind already been explored in artificial systems, either as quantum computation (perhaps as quantum-enhanced mixed classical-quantum transistors) or in a quantum simulator? Or, if this has not happened yet, could one in principle do it?
Edit after obtaining an answer: Note the lax sense of optimize above. In a biological rather than mathematical context, optimization needs not be absolute but can refer to any significant improvement, like enzimes have been optimized via evolution to increase the speed of reactions.
"
['terminology']," Title: What counts as an ""ancilla"" qubit?Body: I am getting confused about the meaning of the term ""ancilla"" qubit. It's use seems to vary a lot in different situations. I have read (in numerous places) that an ancilla is a constant input - but in nearly all of the algorithms I know (Simion's, Grover's, Deutsch etc) all the qubits are of constant input and therefore would be considered ancilla. Given that this does not seem to be the case - what is the general meaning of an ""ancilla"" qubit in quantum computers?
"
['fault-tolerance']," Title: Why or how is 'cat' state preparation via a C-not-not operation not fault tolerant?Body: On p490 of Nielsen and Chuang, 2010 the authors say that the preparation of the 'cat' state ($|000\ldots 0\rangle+|111\ldots 1\rangle$) is not Fault Tolerant. Below is my mock up of the diagram they draw for the preparation ($H$ and $C$-not-not *) and one part of the verification (the next two C-nots):
They then explain that this is not fault tolerant because a $Z$ error in the 'extra qubit' (i.e. that at the bottom of the diagram) propagates into two Z-errors in the ancilla qubits (the top three).
They they go onto say that this will not affect the Encoded data (I have not shown this in my diagram).
There are a couple of things that confuse me here. Firstly I cannot see how we get two $Z$-errors on the axillary qubits, Secondly even if we did get two $Z$-errors, surely this is a good thing as it will take our cat state back to the cat state? More the the crux of the issue - I cannot see what criterion they are using for fault tolerance here (I know what it means in the general case - i.e. unrecoverable error with probability no greater then $Cp^2$) and how there example violates it - Please can someone explain this to me.
*Not technical name - I couldn't find what it was actually called.
"
['qudit']," Title: What is the difference between a qudit system with d=4 and a two-qubit system?Body: I understand that a qudit is a quantum $d$-state system. If $d=4$, is this exactly the same as a two-qubit system, which also presents $4$ quantum states? The Hilbert space is the same, right? Are there any theoretical or practical differences?
"
"['noise', 'measurement']"," Title: Is it true that observing a quantum state will end the superposition of states? How can I not observe?Body: I have no background in quantum physics, and no understanding of most formulas used in this context. I'm not looking for an in depth answer, i'd just like to vaguely understand the concept.
The way i heard it, a superposition is [real/a neccessary assumption/a concept not even wrong/whatever] and will end as soon as the object in superposition is observed. I always took that ""observed"" part to mean ""interacted with in a way that allows to make a decision on the state"" and i further supposed there was no cheating a la ""oh but i entangled A and B and now i just observed A, so B will be alright"" and suchlike .
So now we have quantum computation, which seems to rely on the superpositions of objects somehow covering a whole lot of bases at once and then [something something] which produces an answer - my question is about the i/o process: How can i input something so a superposition is achieved that encompasses the information i input, without automatically destroying the relevant superposition? How can i be sure my input was put in without looking? how can i look without destroying the very thing i wanted?
"
"['experiment', 'terminology', 'qudit']"," Title: In qubit/qudit terms, where is the experimental limit between S=3/2 and 2·S=1/2?Body: This question is inspired by ""What is the difference between a qudit system with d=4 and a two-qubit system?"", as an experimental follow-up.
Consider for illustration these two particular cases:
In general I'm referring to experimental cases where in practice there is an always-on-but-sometimes-weak coupling between two two-state systems, producing a ground quadruplet.
My question is: in experiments such as these, are 2·qubit and d=4 qudit (a) strictly distinguishable beasts, or (b) theoretical idealizations which are more or less adequate depending on practical considerations?
"
"['quantum-gate', 'quantum-state', 'mathematics']"," Title: What can I deduce about $f(x)$ if $f$ is balanced or constant?Body: $\newcommand{\qr}[1]{|#1\rangle}$Question. Can you check whether this is correct? Also, given the analysis below, what is the domain of and co-domain of $f(\qr{x})$? I think it is $V^4 \to W^4 : f$ because
$$\qr{00} = \qr{0}\otimes\qr{0} = \left[\begin{matrix}1\\0\\0\\0\end{matrix}\right].$$
Analysis. Let
$$\qr{x} = a_{00}\qr{00} + a_{01}\qr{01} + a_{10}\qr{10} + a_{11}\qr{11}$$
and let $U_f$ implement some constant or balanced function $f(x)$. Then I claim the following holds given the linear function nature of $U_f$.
\begin{align*}
f(\qr{x}) &= U_f\qr{x}\\
&= U_f(a_{00}\qr{00} + a_{01}\qr{01} + a_{10}\qr{10} + a_{11}\qr{11})\\
&= U_f(a_{00}\qr{00}) + U_f(a_{01}\qr{01}) + U_f(a_{10}\qr{10}) + U_f(a_{11}\qr{11})\\
&= a_{00}U_f(\qr{00}) + a_{01}U_f(\qr{01}) + a_{10}U_f(\qr{10}) + a_{11}U_f(\qr{11}),
\end{align*}
Now if $f$ is constant --- with $f(\qr{x}) = \qr{00}$ for all $\qr{x}$ ---, then we would have
\begin{align*}
f(\qr{x}) &= a_{00}U_f(\qr{00}) + a_{01}U_f(\qr{01}) + a_{10}U_f(\qr{10}) + a_{11}U_f(\qr{11})\\
&= a_{00}\qr{00} + a_{01}\qr{00} + a_{10}\qr{00} + a_{11}\qr{00}\\
&= (a_{00} + a_{01} + a_{10} + a_{11})\qr{00}.
\end{align*}
If, on the other hand, $f$ is balanced then with probability $1/2$, we have
\begin{align*}
f(\qr{x}) &= a_{00}U_f(\qr{00}) + a_{01}U_f(\qr{01}) + a_{10}U_f(\qr{10}) + a_{11}U_f(\qr{11})\\
&= (a_{00} + a_{01} + a_{10} + a_{11})\qr{00}
\end{align*}
and with probability $1/2$ as well
\begin{align*}
f(\qr{x}) &= a_{00}U_f(\qr{00}) + a_{01}U_f(\qr{01}) + a_{10}U_f(\qr{10}) + a_{11}U_f(\qr{11})\\
&= (a_{00} + a_{01} + a_{10} + a_{11})\qr{11}.
\end{align*}
"
"['measurement', 'textbook-and-exercises', 'terminology']"," Title: What does ""measurement in a certain basis"" mean?Body: In the Wikipedia article about Bell states it is written:
Independent measurements made on two qubits that are entangled in Bell states positively correlate perfectly, if each qubit is measured in the relevant basis.
What does it even mean to perform a measurement in a certain basis?
You can answer by using the example of the Bell states of the Wikipedia article.
"
"['quantum-gate', 'gate-synthesis', 'simulation', 'hamiltonian-simulation', 'pauli-gates']"," Title: Obtaining gate $e^{-i\Delta t Z}$ from elementary gatesBody: I am currently reading ""Quantum Computation and Quantum Information"" by Nielsen and Chuang. In the section about Quantum Simulation, they give an illustrative example (section 4.7.3), which I don't quite understand:
Suppose we have the Hamiltonian
$$ H = Z_1 ⊗ Z_2 ⊗ \cdots ⊗ Z_n,\tag{4.113}$$
which acts on an $n$ qubit system. Despite this being an interaction involving all of the system, indeed, it can be simulated efficiently. What we desire is a simple quantum circuit which implements $e^{-iH\Delta t}$, for arbitrary values of $\Delta t$. A circuit doing precisely this, for $n = 3$, is shown in Figure 4.19. The main insight is that although the Hamiltonian involves all the qubits in the system, it does so in a classical manner: the phase shift applied to the system is $e^{-i\Delta t}$ if the parity of the $n$ qubits in the computational basis is even; otherwise, the phase shift should be $e^{i\Delta t}$. Thus, simple simulation of $H$ is possible by first classically computing the parity (storing the result in an ancilla qubit), then applying the appropriate phase shift conditioned on the parity, then uncomputing the parity (to erase the ancilla).
Furthermore, extending the same procedure allows us to simulate more complicated extended Hamiltonians. Specifically, we can efficiently simulate any Hamiltonian of the form $$H = \bigotimes_{k=1}^n\sigma_{c\left(k\right)}^k,$$ where $\sigma_{c(k)}^k$ is a Pauli matrix (or the identity) acting on the $k$th qubit, with $c(k) \in \{0, 1, 2, 3\}$ specifying one of $\{I, X, Y, Z\}$. The qubits upon which the identity operation is performed can be disregarded, and $X$ or $Y$ terms can be transformed by single qubit gates to $Z$ operations. This leaves us with Hamiltonian of the form of (4.113), which is simulated as described above.
How can we obtain gate $e^{-i\Delta t Z}$ from elementary gates (for example from Toffoli gates)?
"
"['simulation', 'terminology']"," Title: What do we mean by parity of qubits?Body: I am currently reading ""Quantum Computation and Quantum Information"" by Nielsen and Chuang. In the section about Quantum Simulation, they give an illustrative example (section 4.7.3), which I don't quite understand:
Suppose we have the Hamiltonian
$$ H = Z_1 ⊗ Z_2 ⊗ \cdots ⊗ Z_n, \tag{4.113}$$
which acts on an $n$ qubit system. Despite this being an interaction involving all of the system, indeed, it can be simulated efficiently. What we desire is a simple quantum circuit which implements $e^{-iH\Delta t}$, for arbitrary values of $\Delta t$. A circuit doing precisely this, for $n = 3$, is shown in Figure 4.19. The main insight is that although the Hamiltonian involves all the qubits in the system, it does so in a classical manner: the phase shift applied to the system is $e^{-i\Delta t}$ if the parity of the $n$ qubits in the computational basis is even; otherwise, the phase shift should be $e^{i\Delta t}$. Thus, simple simulation of $H$ is possible by first classically computing the parity (storing the result in an ancilla qubit), then applying the appropriate phase shift conditioned on the parity, then uncomputing the parity (to erase the ancilla).
Furthermore, extending the same procedure allows us to ismulate more complicated extended Hamiltonians. Speciffically, we can efficiently simulate any Hamiltonian of the form $$H = \bigotimes_{k=1}^n\sigma_{c\left(k\right)}^k,$$ where $\sigma_{c(k)}^k$ is a Pauli matrix (or the identity) acting on the $k$th qubit, with $c(k) \in \{0, 1, 2, 3\}$ specifying one of $\{I, X, Y, Z\}$. The qubits upon which the identity operation is performed can be disregarded, and $X$ or $Y$ terms can be transformed by single qubit gates to $Z$ operations. This leaves us with Hamiltonian of the form of (4.113), which is simulated as described above.
What do we mean by the parity of the qubits here? Is it the number of qubits in the state $\lvert 1 \rangle$, and can it be even or odd?
"
"['architecture', 'experiment', 'decoherence', 'solid-state', 'nv-centers']"," Title: Passive improving of nanodiamond surfaces for NV centers?Body: Nitrogen-Vacancy centers (NVs) have astonishing quantum properties, which make them interesting as potential hardware both for quantum computing in particular and for quantum technologies in general. In part this results from the center being protected by the diamond structure, which is at the same time very rigid and practically free from nuclear spins.
However, their properties change in unpractical ways with their proximity to the surface:
- The closer they are to the surface, the better they interact with whatever is just beyond the surface. This is very important for quantum metrology but also in general for input/output in a quantum computing context, see for example A molecular quantum spin network controlled by a single qubit (arXiv version).
- However, the closer the are to the surface, the more they are affected by all kinds of noise also just beyond the surface. This results from the fact that while the bulk is perfect diamond the surface is full of defects/impurities/rubbish.
My question is practical and is about cleaning and/or chemically modifying the diamond surface in order to passivate it: up to which point has this been experimentally demonstrated? What is the current state of the art, how much can quantum coherence on NV centers be improved by a detailed control of the diamond surface?
"
"['terminology', 'simons-algorithm']"," Title: Use of the term ""dimension"" in this description of Simon's algorithm?Body: In Kaye, Laflamme and Mosca (2007) pg106 they write the following (in the context of Simon's algorithm):
...where $S=\{\mathbf{0},\mathbf{s}\}$ is a $2$-dimensional vector space spanned by $\mathbf{s}$.
this is not the only place I have seen this vector space referred to as ""2-dimensional"". But surely the fact that it is only spanned by one vector, $\mathbf{s}$, means (by definition) that it is only ""1-dimensional""?
Am I missing something here or is the use of the term ""dimension"" different in this area?
More Context
As mentioned above the context is Simon's Algorithm. I.e. there exists a oracle $f:\{0,1\}^n\rightarrow \{0,1\}^n$ such that $f(x)=f(y)$ if and only if $x=y\oplus \mathbf{s}$ where $\mathbf{s}\in \{0,1\}^n$ and $\oplus$ is addition in $\Bbb{Z}_2^n$ (i.e. bit-wise). The aim of the algorithm is to find $\mathbf{s}$.
After applying a relevant circuit the output is a uniform distribution of $\mathbf{z}\in \{0,1\}^n$ such that $\mathbf{z}\cdot\mathbf{s}=z_1s_1+z_2s_2\cdots+ z_ns_n=0$. The statement I have quoted above is refering to the fact that since $\mathbf{0}$ and $\mathbf{s}$ are are solution to this problem you only need $n-1$ linearly independent vectors $\mathbf{z}$ to find $\mathbf{s}$.
Edit
The term is also used in the same context at the end of Pg 4 of this pdf (Wayback Machine version).
"
"['terminology', 'nisq']"," Title: What is meant by ""Noisy Intermediate-Scale Quantum"" (NISQ) technology?Body: Preskill introduced recently this term, see for example Quantum Computing in the NISQ era and beyond (arXiv). I think the term (and the concept behind it) is of sufficient importance that it deserves to be explained here in a pedagogical manner. Probably it actually merits more than one question, but the first one needs to be:
What are Noisy Intermediate-Scale Quantum (NISQ) technologies?
"
"['algorithm', 'biology', 'biocomputing']"," Title: Can biological quantum processes be used to guide optimized quantum algorithms?Body: My question is a continuation from the previous question:Is Quantum Biocomputing ahead of us?. Considering that there exist many biological processes with a quantum nature present (Photosynthesis, Electron transport chain, etc). And, since this biological quantum processes are quite optimal in terms of efficiency and yield:
I am wondering if these could be mimicked by engineers/scientists to improve the actual possibilities in quantum computation. Let me explain a bit deeper my question: Nature is extremely efficient. Especially intracellular processes are well optimized in both time and space this, with their high yield, can be studied in order to check the properties/structural features that contribute to such efficiency. Please note that I am not suggesting or asking about the possibility of using directly biological molecules or processes but to try to extract what makes them ultra-efficient and used such knowledge in the design of particular architectures.
My question is related to this, is that an actual field of research? are we now dealing with the 'natural quantum processes imitation'?
"
"['physical-qubit', 'quantum-state', 'technical-standards']"," Title: Are there measuring standards (and units) for the identification of qubits?Body: The representation of bits in different technological areas:
- Normal digital bits are mere abstractions of the underlying electric current through wires. Different standards, like CMOS or TTL, assign different thresholds to such signals: ""if the voltage goes above this level, then the bit is 1; if it goes below this level, then the bit is 0; discard in any other case"".
- In genetics, we usually consider a signal as a 1 if it is ""enough"" to trigger the target response; 0 otherwise. In this scenario, the thresholding is qualitative.
From the point of view of quantum information, qubits also abstractions, but in practice measurements will need standards to be comparable.
Question: From the point of view of quantum engineering, is there any standard technique/method to identify their value e.g. based on detection thresholds or fidelity verification like Bell inequalities violation? Are there units for that hidden signals?
The best possible answer would probably contain specific details for different architectures (e.g. superconductors vs photons) or contexts (e.g. quantum computing vs quantum communications).
"
"['physical-qubit', 'terminology', 'quantum-state']"," Title: What is the difference between a qubit and a quantum state?Body: In general, a qubit is mathematically represented as a quantum state of the form $\lvert \psi\rangle = \alpha \lvert 0\rangle + \beta \lvert 1\rangle$, using the basis $\{ \lvert 0\rangle, \lvert 1\rangle \}$. It seems to me that a qubit is just a term used in quantum computing and information to denote a quantum state (i.e. a vector) of a system.
Is there any fundamental difference between a qubit and a quantum state? What's more to a qubit than the quantum state it represents?
"
"['terminology', 'measurement']"," Title: What does it mean for a result of a measurement to be known/unknown?Body: Let me start the question with two examples.
First, I am reading Nielsen & Chuang section ""8.3.3 Bit flip and phase flip channels"". There is a description of a quantum operation
$\rho \to \mathcal{E}(\rho) = P_0 \rho P_0 + P_1 \rho P_1$, where $P_0 = |0 \rangle \langle 0|$, $P_1 = |1 \rangle \langle 1|$, which corresponds to a measurement of the qubit in the $|0 \rangle$, $|1 \rangle$ basis, with the result of the measurement unknown. [Italics is mine - A.P.]
Second, in the edX course ""Quantum Information Science I, Part 3"" there is a question that looks like this:
After quantum measurement <...>, if the measurement result is known, <...>. [Italics is mine - A.P.]
So, I do not understand what does that mean for a result of a measurement to be known/unknown? Moreover, how could that knowledge or an absense of knowledge further affect the quantum system once the measurement is performed? Would anything change in the examples if we replace ""known"" with ""unknown"" and vice versa? Is there a mathematical formalism for the ""is known/unknown"" expression?
I believe, the source of my confusion comes from the Schrödinger's cat paradox solution. My understanding is that the cat is strictly alive or dead once the ""measurement"" by a detector happens, regardless of whether we know the fact (i.e., result of the ""measurement"") or not. That is a knowledge of an experimenter, and it has no relation to the ""measurement"".
"
['entanglement']," Title: Markov Chain expressed in Density Matrix formalismBody: Suppose we have two states of a system where I tell you that there is a probability $p_1$ of being in state $1$, and probability $p_2$ of being in state $2$. The total state can be written as a vector in $L^1$ normed space:
$$p=\begin{pmatrix}p_1 \\ p_2 \end{pmatrix}, ||p||=p_1+p_2=1$$
If we define a transition matrix for a Markov process:
$$T=\begin{pmatrix}t_{11}&t_{12} \\ t_{21}&t_{22}\end{pmatrix}$$
Then the next state would be:
$$p'=Tp=\begin{pmatrix}t_{11}p_1+t_{12}p_2 \\ t_{21}p_1+t_{22}p_2\end{pmatrix}$$
Now my understanding of density matrices and quantum mechanics is that it should contain classical probability theory in addition to strictly quantum phenomena.
Classical probabilities in the density matrix formalism are mapped as:
$$p=\begin{pmatrix}p_1 \\ p_2 \end{pmatrix} \rightarrow \rho=\begin{pmatrix}p_1&0 \\ 0&p_2 \end{pmatrix}$$
And I want to obtain:
$$p'=\begin{pmatrix}t_{11}p_1+t_{12}p_2 \\ t_{21}p_1+t_{22}p_2\end{pmatrix} \rightarrow \rho'=\begin{pmatrix}t_{11}p_1+t_{12}p_2&0 \\ 0&t_{21}p_1+t_{22}p_2\end{pmatrix}$$
My attempt:
Define an operator $U$ such that:
$$\rho'=U\rho U^\dagger$$
$$\implies \begin{pmatrix}t_{11}p_1+t_{12}p_2&0 \\ 0&t_{21}p_1+t_{22}p_2\end{pmatrix}=\begin{pmatrix}u_{11}&u_{12} \\ u_{21}&u_{22}\end{pmatrix}\begin{pmatrix}p_1&0 \\ 0&p_2\end{pmatrix}\begin{pmatrix}u_{11}^*&u_{21}^* \\ u_{12}^*&u_{22}^*\end{pmatrix}$$
$$=\begin{pmatrix}|u_{11}|^2p_1+|u_{12}|^2p_2&u_{11}u_{21}^*p_1+u_{12}u_{22}^*p_2 \\
u_{21}u_{11}^*p_1+u_{12}^*u_{22}p_2 & |u_{21}|^2p_1+|u_{22}|^2p_2 \end{pmatrix}$$
Evidently, $|u_{ij}|^2=t_{ij}$, but the off diagonal terms aren't easily made zero, (I've wrestled with the algebra and applied all the proper normalizations of probability theory).
What would be the correct way to apply a Markov process in the density matrix formalism? It seems really basic and something that this formalism should be able to naturally handle.
Edit: Repost of : repost
"
"['algorithm', 'qma', 'chemistry']"," Title: Quantum Chemistry and Quantum ComputingBody: Predicting the energy of molecules to high accuracy during the course of a chemical reaction, which in turn allows us to predict reaction rates, equilibrium geometries, transition states among others is a Quantum Chemical problem.
Quantum Computing could help Quantum Chemistry by solving the Schrodinger equation for large systems. An example of a problem that is intractable but has applications to Quantum Chemistry is the Hartree-Fock method, a method to approximate the wave function and energy of a quantum many-body system (in stationary state). This problem is known to be NP-complete (see On the NP-completeness of the Hartree-Fock method for translationally invariant systems). Other examples of Quantum Computation to Quantum chemistry are 2-local-Hamiltonians (QMA-complete), Fermionic Local Hamiltonian (QMA-hard).
Quantum Computing could give yes/no answers to questions to specific problems such as showing certain molecules have dipole moment. Also, NMR, Trapped Ions, and Superconducting qubits could be used to to simulate such chemical systems too. Noise being, a factor approaches such as NISQ could play a part in simulating quantum chemical systems. What Quantum Computing approaches have been successful to solving Quantum chemistry problems such as predicting reaction rates, transition rates (or even show promise)?
"
"['resource-request', 'chemistry']"," Title: Quantum chemistry: referencesBody: I have heard about Quantum chemistry as one of the main applications of quantum computers. However, I have not found concrete related articles with circuit-implementations for these applications.
Does anyone have articles on simulating molecules (such as for instance hydrogen or helium) with a circuit implementation to run it?
"
"['quantum-gate', 'quantum-state']"," Title: What exactly is a phase vector?Body: The following $2\times 2$ matrix
$$
P =
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
$$
represents a quantum gate because it's a unitary matrix.
If we multiply $P$ by the quantum state $\lvert \psi\rangle = \alpha \lvert 0\rangle + \beta \lvert 1\rangle$, we obtain ${\lvert \psi\rangle}_P = \alpha e^{i\theta} \lvert 0 \rangle + \beta e^{i\phi} \lvert 1\rangle $, which can be derived as follows
\begin{align}
{\lvert \psi\rangle}_P
&=
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
\alpha \lvert 0\rangle + \beta \lvert 1\rangle
\\
&=
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
\alpha \lvert 0\rangle +
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
\beta \lvert 1\rangle
\\
&=
\alpha
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
\begin{bmatrix} 1 \\ 0 \end{bmatrix} +
\beta
\begin{bmatrix}
e^{i\theta} & 0 \\
0 & e^{i\phi}
\end{bmatrix}
\begin{bmatrix} 0 \\ 1 \end{bmatrix}
\\
&=
\alpha
\begin{bmatrix} e^{i\theta} \\ 0 \end{bmatrix} +
\beta
\begin{bmatrix} 0 \\ e^{i\phi} \end{bmatrix}
\\
&=
\alpha
e^{i\theta}
\begin{bmatrix} 1 \\ 0 \end{bmatrix} +
\beta
e^{i\phi}
\begin{bmatrix} 0 \\ 1 \end{bmatrix}
\\
&=
\alpha e^{i\theta} \lvert 0 \rangle + \beta e^{i\phi} \lvert 1\rangle
\end{align}
If we tried to measure ${\lvert \psi\rangle}_P$, we would obtain the computational basis state $\lvert 0 \rangle$ with probability $|\alpha|^2$ and the computational basis state $\lvert 1 \rangle$ with probability $|\beta |^2$. So, there's no difference between measuring ${\lvert \psi\rangle}_P$ or $\lvert \psi\rangle$, in terms of probabilities of obtaining one rather than the other computational basis state.
The reason to obtain same probabilities is because $e^{i\theta}$ and $e^{i\phi}$ are phase vectors, so they do not affect the probabilities.
$e^{i\theta}$ and $e^{i\phi}$ represent complex numbers, as vectors, in the complex plane. This can be easily visualized from the following picture
But what's the intuitive meaning of multiplying the ""vectors"" $e^{i\phi}$ by a computational basis state? In general, what is a phase and a phase vector in this context and how does it affect the mathematics and the basis vectors? What's the relation between $\lvert \psi\rangle$ and ${\lvert \psi\rangle}_P$?
"
['entanglement']," Title: Density operators and separable statesBody: I know that a density operator is separable if it can be written in the form:
$$ \rho =\sum_k a_k \rho^A_k \otimes \rho^B_k\tag{1}$$
where
$$a_k \ge 0,\quad \sum_k a_k=1\tag{2}$$
My question is will any set of $\rho_k^A \otimes \rho_k^B$ work? I.e. I am asking if the following statement is true (if so how do we prove it and if not - why not):
A density matrix $\rho$ is separable if and only if when written as the sum of ""factorized"" states $\rho_K^A \otimes \rho_k^B$ (independent of which factorized states are used) the relations (1) and (2) hold.
This is clearly a stronger statement then saying it can be written as (1) and (2) - and if true leads to a quick way to test entanglement.
"
['quantum-state']," Title: How does using a superposition of 0 and 1 improve the processing capabilities of a quantum computer compared to classical computers?Body: Whenever I learn about quantum computing and qubits, it always talks about the superposition principle and that the qubits can be in both states 0 and 1 simultaneously, thus claiming that quantum computers have processing capability way more than modern conventional computers.
But here is what I don't understand:
- How can a superposition of 0 and 1 represent any discrete information at all?
- What about the logic gates?
- How can a discrete decision be taken by leveraging this superposition principle?
- Combination of 0 and 1 is basically important for computing. How can this third state of qubits be leveraged to give a boost in computing?
"
"['architecture', 'experiment', 'solid-state', 'nv-centers']"," Title: Active improving of nanodiamond surfaces for NV centers?Body: This question is related (and complementary) to ""Passive improving of nanodiamond surfaces for NV centers?"".
Nitrogen-Vacancy centers (NVs) have astonishing quantum properties, which make them interesting as potential hardware both for quantum computing in particular and for quantum technologies in general. In part this results from the center being protected by the diamond structure, which is at the same time very rigid and practically free from nuclear spins.
However, their surfaces tend to be far from controlled. Neither in chemical terms (composition, structure) not in terms of what it contributes to the physical properties of the bulk. For example, in experiments of diamond levitation using lasers, at high powers of irradiation, the diamonds typically get noticeably lighter (and thus oscillate further in their potential wells) as they suddenly (and uncontrolledly lose the external rubbish.
Coming closer to the question: in these same experiments, even though diamonds are essentially transparent to the lasers employed for the levitation, eventually at high laser power and low pressure diamonds overheat and essentially evaporate. Since these conditions are useful to fix the diamonds in place and reduce noise, this is a problem for the control of NV centers as qubits for quantum computing purposes. One reason for the poor thermal dissipation in diamonds -which in absence of gas that can carry convection necessarily happens via black body radiation- is the fact that the phonon spectrum of diamond is essentially empty: covalent bonds are too strong, everything is fix in its place, and there is nothing available that can vibrate.
My question is, since heat release is often governed by surface properties, what is the current status of efforts to alter diamond surface with the goal of obtaining spectrally selective thermal emittance properties, meaning emitting preferentially at energies below the evaporation of the diamond starts?
"
"['resource-request', 'programming']"," Title: Does a complete list of open quantum software projects exist?Body: An answer to
Is there any source which tabulates quantum computing algorithms for simulating physical systems? mentions the Quantum Algorithm Zoo, a list of quantum algorithms. Several answers to Programming quantum computers for non-physics majors include links to different kinds of development kits. Likewise, What programming languages are available for quantum computers? gathers a couple of good attempts at listing those.
The present question is related to the above, and yet it's not answered by the above resources.
Does a complete list of open quantum software projects exist?
Ideal answers would be: if it exists, the link to said list, and if it doesn't, a (well-formatted) as-exhaustive-as-possible compilation of open quantum software projects.
Related question: Are there any quantum software startups?
"
"['quantum-advantage', 'superdense-coding']"," Title: What are the real advantages of superdense coding?Body: In superdense coding, two qubits are prepared by Eve in an entangled state; one of them is sent to Alice and the other is sent to Bob. Alice is the one who wants to send (to Bob) two classical bits of information. Depending on what pair of classical bits Alice wants to send (i.e. one of $00$, $01$, $10$ and $11$), Alice applies a certain quantum operation or gate to her qubit, and sends the result to Bob, which then applies other operations to retrieve the ""classical message"".
It doesn't seem to me that superdense coding provides any advantage over classical communication techniques. Two qubits (the one sent to Alice and the one sent to Bob by Eve) and bits (the two sent to Bob by Alice) are sent, two qubits (one is received by Alice and the other by Bob) and bits (the two sent by Alice to Bob) are received. Furthermore, I read that if someone has access to the qubit sent to Bob, then the communication seems not to be secure (anyway).
What are the real advantages of superdense coding compared to just sending two bits of information from Alice to Bob?
"
['solid-state']," Title: Which temperature has been the highest to achieve a quantum logic operation?Body: My question is somehow related with a previous one: What is the most optimistic perspective of room-temperature solid-state QC?.
Regarding solid-state qubits,
- What is the highest temperature at which the simplest quantum logic operation has been performed? Let's say: initialization, arbitrary rotation and measuring, repeated to have enough statistics in order to verify a good fidelity. In which solid-state system has this happened?
"
"['algorithm', 'programming', 'resource-request']"," Title: Does a study guide exist that starts from a ""purely CS background"" and advances towards ""making a new quantum programming language""?Body: I am from a computer science background and I find it difficult to decide on the resources I should focus on while learning quantum computing, since there is so much to read/watch. My ultimate goal is to make a programming language acting as an interface between quantum computers and the person similar to 1972 when C was made. As a realistic intermediate stage, I would like to get to the point of writing programs on IBM's QISKit.
For that, I would need a schematic study guide in order to acquire the necessary background in Physics and the related fields required to dive into the field of quantum computing. Does this already exist: an ordered list of indispensable concepts and abilities to master, which if possible also mentions adequate material to acquire each of them?
Assume a high school level physics knowledge. Provide a study guide i.e. from beginner to expert kind of guide. Try to list video/book resources that one should follow in a chronological order so as to become an expert in the field of quantum computing to the level I can write my own quantum computing language (assuming already have other CS skills to write the language).
"
"['quantum-state', 'tensor-product', 'notation']"," Title: What do we mean by the notation $\lvert \mathbf{x}, 0\rangle$?Body: In quantum computation, a common operation performed between two quantum states is the tensor product, which allows us to create a new and higher-dimensional state from two lower-dimensional states. The tensor product is usually denoted by the symbol $\otimes$. So, if $\lvert \psi\rangle = \alpha \lvert 0\rangle + \beta \lvert 1\rangle \in \mathbb{C}^n$ and $\lvert \phi\rangle = \gamma \lvert 0\rangle + \delta \lvert 1\rangle \in \mathbb{C}^n$ are the states of two qubits, then $\lvert \psi\rangle \otimes \lvert \phi\rangle \in \mathbb{C}^{n^2}$ is their tensor product.
I have just come across the notation $\lvert \mathbf{x}, 0\rangle$ while reading section $1$ of this paper. What does it mean? I understood $\mathbf{x}$ is a (classical) bit string of length $n$ (and I think this the reason it's in bold).
I am aware of the fact that the tensor product of two vectors $\lvert \psi\rangle$ and $\lvert \phi\rangle$ can be shortened as follows $\lvert \psi\rangle \lvert \phi\rangle$. So, I don't think $\lvert \mathbf{x}, 0\rangle$ is also a shorthand for $\lvert \mathbf{x} \rangle \otimes\lvert 0\rangle$.
"
"['notation', 'quantum-state']"," Title: What does the notation $\lvert \underline{x} \rangle$ mean?Body: I recently read hand-written notes about the ""secret mask"" or ""secret string"" algorithm (which I can't share here) with the following notation $\lvert \underline{x} \rangle$, i.e. a letter with a line under it. What could it mean?
"
"['annealing', 'adiabatic-model']"," Title: Why is it crucial that the initial Hamiltonian does not commute with the final Hamiltonian in adiabatic quantum computation?Body: I've read in many sources and books on adiabatic quantum computation (AQC) that it is crucial for the initial Hamiltonian $\hat{H}_i$ to not commute with the final Hamiltonian $\hat{H}_f$, i.e. $\left[\hat{H}_i,\hat{H}_f\right]\neq 0$. But I've never seen an argument to why it's so important.
If we assume a linear time dependence the Hamiltonian of the AQC is
$$
\hat{H}\left(t\right)~=~\left(1-\frac{t}{\tau}\right)\hat{H}_i+\frac{t}{\tau}\hat{H}_f,
\qquad \left(0\leq t\leq \tau \right)
$$
where $\tau$ is the adiabatic time scale.
So my question is: Why is it crucial that the initial Hamiltonian does not commute with the final Hamiltonian?
"
['grovers-algorithm']," Title: In Grover's Algorithm, why does the optimal number of iterations involve a floor?Body: On page 157 of Kaye, Laflamme and Mosca they write that in Grover's algorithm we need to apply Grover's iterate a total of:
$$\Big\lfloor \frac{\pi}{4} \sqrt{N}\Big\rfloor$$
(They actually wrote $\Big\lfloor \frac{\pi}{4} \frac{1}{\sqrt{N}}\Big\rfloor$ but I assume the above is what is intended.)
My question is why the floor? Would it not be better to go to the nearest integer - since if e.g. $ \frac{\pi}{4} \sqrt{N}=5.9999$ it would seem a bit silly to do $5$ rather then $6$ iterations.
"
"['algorithm', 'complexity-theory']"," Title: Are there results from quantum algorithms or complexity that lead to advances on the P vs NP problem?Body: On the surface, quantum algorithms have little to do with classical computing and P vs NP in particular: Solving problems from NP with quantum computers tells us nothing about the relations of these classical complexity classes1.
On the other hand, the 'alternative description' of the classical complexity class PP as the class PostBQP presented in this paper is, as far as I'm aware, considered as an important result for 'classical complexity', by 'quantum complexity'.
In fact, Scott Aaronson, the author of the paper, writes at the end of the abstract:
This illustrates that quantum computing can yield new and simpler proofs of major results about classical computation.
Hence, my question is: are there results from the field of quantum complexity that 'simplify' the P vs NP problem, similar to the quantum description of PP? If there are no such results, is there a good reason to not expect these results, despite the 'success' for PP?
1: Take the answer to this question, for example: Would the P vs. NP problem become trivial as a result of the development of universal quantum computers?
"
"['measurement', 'information-theory', 'entropy']"," Title: Accessible information of system vs system, apparatus and environmentBody: Suppose we have a quantum system $Q$ with an initial state $\rho^{(Q)}$. The measurement process will involve two additional quantum systems: an apparatus system $A$ and an environment system $E$. We suppose that the system $Q$ is initially prepared in the state $\rho_{k}^{(Q)}$ with a priori probability $p_k$. The state of the apparatus $A$ and environment $E$ is $\rho_{0}^{(AE)}$, independent of the preparation of $Q$. The initial state of the entire system given the $k$th preparation for $Q$ is $$\rho_{k}^{(AEQ)} = \rho_{0}^{(AE)} \otimes \rho_{k}^{(Q)}.$$ Averaging over the possible preparations, we obtain $$\rho^{(AEQ)} = \sum_{k} p_{k} \rho_{k}^{(AEQ)}. $$
In quantum information theory, the accessible information of a quantum system is given by $$\chi := S(\rho) - \sum_{j}P_{j}S(\rho_{j}),$$ where $S$ is the von Neumann entropy of the quantum state. How can we show that if $\rho_{0}^{(AE)}$ is independent of the preparation $k$, that $$\chi^{(AEQ)} = \chi^{(Q)}?$$
Thanks for any assistance.
"
"['d-wave', 'annealing', 'adiabatic-model']"," Title: What precisely is Reverse Annealing?Body: Quantum Annealing, (related questions Quantum Annealing, or hamiltonian related) is the process used in D-Waves' Quantum Annealer, in which the energy landscapes are explored, for different solutions, and by tuning a suitable Hamiltonian, zero in to a possible optimal solution to a problem. The process of Quantum Annealing reduces ""transverse magnetic fields"" in the Hamiltonian, in addition to other quantum effects like quantum tunnelling, entanglement, and superposition, which in turn all play a part in zeroing to a ""valley"" of a quantum mechanical wave function, where the ""most likely"" solution lies.
The process of Reverse Annealing, very briefly, is to use classical methods such as Simulated Annealing, to find a solution, and hone into a valley using Quantum Annealing. If the Hamiltonian used by the Quantum Annealer is already in a ""valley"", as it is being passed a solution in the first place -Does the D-Wave machine reach another ""valley""( a better solution?) using the Hamiltonian passed to it, in the first place?
"
"['entanglement', 'tensor-product', 'emulation']"," Title: How to keep track of entanglements when emulating quantum computation?Body: I am trying to build a quantum computation library as my university project. I am still learning all the aspects of the Quantum Computing field. I know there are efficient libraries already for quantum emulation. I just want to make my own, which will help me to grasp some of the core concepts of Quantum Computing.
I know that $n$ qubits can be stored with a $2^n$ element complex array. Also, a $n$ qubit gate is a $2^n \times 2^n$ 2D array. So, the following are my doubts (mostly related to entanglement):
- When do I need to find the tensor product of gates (like $I \otimes H \otimes I$, for a $3$ qubit system)? Is it always necessary to compute the tensor product of order $2^n \times 2^n$, even if the qubits are not entangled?
- With only a $2^n$ element array (which I store the coefficients), can I actually somehow calculate which qubits are entangled? Or do I need to make another data structure to store the entanglement information of my $n$ qubits (about which qubits are entangled)?
- Is my 2nd question actually relevant? Do I need to keep track of the entanglement information at all? I mean, I don't know whether multiplying gates with coefficients is enough (even if the system is entangled). Maybe it is relevant at the time of measurement only.
"
['measurement']," Title: Are true Projective Measurements possible experimentally?Body: I have heard various talks at my institution from experimentalists (who all happened to be working on superconducting qubits) that the textbook idea of true ""Projective"" measurement is not what happens in real-life experiments. Each time I asked them to elaborate, and they say that ""weak"" measurements are what happen in reality.
I assume that by ""projective"" measurements they mean a measurement on a quantum state like the following:
$$P\vert\psi\rangle=P(a\vert\uparrow\rangle+ b\vert\downarrow\rangle)=\vert\uparrow\rangle \,\mathrm{or}\, \vert\downarrow\rangle$$
In other words, a measurement which fully collapses the qubit.
However, if I take the experimentalist's statement that real measurements are more like strong ""weak""-measurements, then I run into Busch's theorem, which says roughly that you only get as much information as how strongly you measure. In other words, I can't get around not doing a full projective measurement, I need to do so to get the state information
So, I have two main questions:
- Why is it thought that projective measurements cannot be performed experimentally? What happens instead?
- What is the appropriate framework to think about experimental measurement in quantum computing systems that is actually realistic? Both a qualitative and quantitative picture would be appreciated.
"
['error-correction']," Title: Lower bound for Degenerate Codes?Body: According to (Macchiavello, Palma, Zeilinger, 2001; pg82) a lower bound of the encoding Hilbert space of a non degenerate code is given by the quantum version of the Hamming bound:
$$2^k \sum_{i=0}^t 3^i \begin{pmatrix} n \\ i\end{pmatrix}\le 2^n$$
where we are looking at a $[n,k,2t+1]$ code. Does such a bound exist for a degenerate code? and why is it different (if it indeed is)?
"
['algorithm']," Title: HHL algorithm, how to decide n qubits to prepare for expressing eigenvalue of A?Body: I am trying to understand the HHL algorithm for solving linear systems of equations (Harrow, Hassidim, Lloyd; presented in arXiv:0811.3171 and explained on page 17 of arXiv:1804.03719). By reading some papers, I think I got rough idea but there are many things I still do not understand. Let me ask some.
When applying Quantum Phase Estimation, in page 49 of the same article, it says ""Prepare $n$ register qubits in $|0\rangle^{\bigotimes n}$ state with the vector $|b\rangle$"", so that, by applying QPE to $|b\rangle |0\rangle^{\bigotimes n}$, we can get
$\sum_j \beta_j |u_j\rangle |\lambda_j\rangle$.
And $|\lambda_j\rangle$ is the $j^{th}$ eigenvalue of matrix $A$ and $0 < \lambda_j < 1$, and $\left|u_j\right>$ is the corresponding eigenvector.
I also understand $|\lambda_j\rangle$ is the binary representation for fraction of $j^{th}$ eigenvalue of $A$. (i.e. $\left|01\right>$ for $\left|\lambda\right>=1/4$)
My questions are,
Q1: How to decide $n$, how many qubits to prepare? I assume it is related to the precision of expressing the eigenvalue, but not sure.
Q2: What to do if $\lambda_j$ of $A$ is $≤ 0$ or $≥ 1$?
"
"['quantum-state', 'noise', 'technical-standards', 'initialization']"," Title: Threshold and practical requirements for initial state preparation?Body: At the beginning of a quantum computational process we generally want to start in a perfectly known initial state, and evolve from there. This cannot be done perfectly, for fundamental reasons, but I strongly suspect there has to be a practical limit below which you are in a garbage-in-garbage-out situation.
My full question is not on this input fidelity threshold per se (although feel free to provide that too), but rather on the factors to consider and minimum set(s) of requirements one needs to prepare a good-enough initial state (maybe Di-Vincenzo-list style, but preferrably with some example numbers). Presumably the perfect answer has different sections, for example depending on whether one employs thermal initialization or algorithmic cooling.
For a little more context, this question is related with certain aspects of previous ones:
"
"['algorithm', 'grovers-algorithm']"," Title: How is Grover's algorithm used to estimate the mean and median of a set of numbers?Body: On the Wikipedia page for Grover's algorithm, it is mentioned that:
""Grover's algorithm can also be used for estimating the mean and median of a set of numbers""
So far I only knew how it can be used to search a database. But not sure how to implement that technique to estimate the mean and median of a set of numbers. Moreover, there's no citation (as far as I noticed) on that page which explains the technique.
"
['programming']," Title: Are there any quantum software startups?Body: I am aware of the quantum hardware startup Rigetti and I wonder if there are any quantum startups that build software on top of current quantum computer hardware for commercial applications?
Related question: Does a complete list of open quantum software projects exist?
"
['algorithm']," Title: What is the relation between this CGI device and a quantum sorting algorithm?Body: I just came across this (apparently) entropy-reversing video. It is in fact nothing more than a computer-generated animation: first rendering the physical simulation of a bean machine (often seen in statistical mechanics educational experiments) using color-neutral balls and then assigning color by their destination bin.
I find this amusing from a computational perspective, and hence my questions:
- If it was possible to achieve the portrayed effect physically, a spontaneous sorting based on pairwise interactions between the objects, what would be the computational implications of such effect?
- Are there any quantum algorithms described/implemented that achieve some kind of spontaneous sorting based on interference between the objects to be sorted?
"
"['quantum-state', 'superdense-coding']"," Title: Does superdense coding allow to double the information capacity of a set of qubits?Body: I read the basic introductory information about qubits on Wikipedia:
There are two possible outcomes for the measurement of a qubit—usually
0 and 1, like a bit. The difference is that whereas the state of a bit
is either 0 or 1, the state of a qubit can also be a superposition of
both. [1]
and
The state of a three-qubit quantum computer is similarly described by
an eight-dimensional vector
$(a_{0},a_{1},a_{2},a_{3},a_{4},a_{5},a_{6},a_{7})$ (or a one
dimensional vector with each vector node holding the amplitude and the
state as the bit string of qubits). [2]
Hence does it mean that qubit using superdense coding can achieve a double capacity with the possible number of combinations of $2^{2^n}$?
"
"['foundations', 'category-theory']"," Title: What is the use of categorical quantum mechanics?Body: I recently noticed that Oxford's computer science department has started offering a grad course on categorical quantum mechanics. Apparently they say that it is relevant for the study of quantum foundations and quantum information, and that it uses paradigms from category theory.
Questions:
- How exactly does it help in the study of quantum information?
- Has this formulation actually produced any new results or predictions apart from what our general formulation of quantum mechanics has already done? If so, what are those?
"
"['algorithm', 'speedup', 'quantum-fourier-transform']"," Title: Why can the Discrete Fourier Transform be implemented efficiently as a quantum circuit?Body: It is a well known result that the Discrete Fourier Transform (DFT) of $N=2^n$ numbers has complexity $\mathcal O(n2^n)$ with the best known algorithm, while performing the Fourier transform of the amplitudes of a quantum state, with the classical QFT algorithm, only requires $\mathcal O(n^2)$ elementary gates.
Is there any known reason why this is the case? By this I mean whether there are known characteristics of the DFT that make it possible to implement an efficient ""quantum version"" of it.
Indeed, a DFT over $N$-dimensional vectors can be thought of as the linear operation
$$\vec y=\operatorname{DFT} \vec x, \qquad \text{DFT}_{jk}\equiv \frac{1}{\sqrt N}\exp\left(\frac{2\pi i}{N}jk\right).$$
The ""quantum version"" of this problem is the task of, given a quantum state $|\boldsymbol x\rangle\equiv\sum_{k=1}^N x_k|k\rangle$, obtaining the output state $|\boldsymbol y\rangle\equiv\sum_{k=1}^N y_k |k\rangle$ such that
$$|\boldsymbol y\rangle=\operatorname{DFT}|\boldsymbol x\rangle=\operatorname{QFT}|\boldsymbol x\rangle.$$
- A first simplification seems to come from the fact that, due to the linearity of QM, we can focus on the basis states $|j\rangle, \,\,j=1,...,N$, with the evolution of general vectors $|\boldsymbol x\rangle$ then coming for free.
- If $N=2^n$, one can express $|j\rangle$ in base two, having $|j\rangle=|j_1,...,j_n\rangle$.
- In the standard QFT algorithm one then exploits the fact that the transformation can be written as
$$|j_1,...,j_n\rangle\to2^{-n/2}\bigotimes_{l=1}^n\big[|0\rangle+\exp(2\pi i (0.j_{n-l+1}\cdots j_{n}))|1\rangle\big],$$
which can then be implemented as a quantum circuit of the form
$$\operatorname{QFT}|j_1,...,j_n\rangle=\Big(\prod_{k=1}^n \mathcal U_k\Big)|j_1,...,j_n\rangle,$$
where $\mathcal U_k$ is implemented with $\mathcal O(n)$ elementary gates.
Suppose we have now some unitary transformation $A$, and we want to find a circuit implementing efficiently the equivalent quantum transformation
$$|\boldsymbol y\rangle=A|\boldsymbol x\rangle.$$
The first two tricks mentioned above can always be applied, but it is then nontrivial when and how the other point can be used to obtain efficiency results like we have for the QFT.
Are there known criteria for this to be true? Or in other words, is it possible to precisely pin down what are the characteristics of the DFT that make it possible to efficiently implement the associated quantum transformation?
"
"['algorithm', 'grovers-algorithm']"," Title: What applications does Grover's Search Algorithm have?Body: Grover's Search algorithm is usually talked about in terms of finding a marked entry in an unsorted database. This is a natural formalism that lets it be applied directly to searching for solutions to NP problems (where a good solution is easily recognised).
I was interested to learn about other applications of Grover's search to finding the minimum, mean and median of a set of numbers. That leaves me wondering if there are any other less-obvious applications of Grover's search (or applications of its generalisations such as amplitude amplification) which are already known? Any brief insight about how this is done would be appreciated.
"
"['simulation', 'models']"," Title: Is it possible to simulate a quantum computer in Virtual Reality? If yes, how?Body: There have been a couple of simulations already made and I recently saw this high performance, hardware accelerated quantum computer simulator QCGPU and started to wonder about how to simulate quantum computing in VR. I would like to look at demonstrating the theory behind it. As a teaching experience. Then afterwards simulating the algorithms that could run on it.
The motivation is that VR doesn't have similar limitations we have in the physical world. Essentially it will graphically illustrate the quantum physics behind this computer and to show Mesoscopic physics at work. The VR will illustrate experiments of quantum physics and theory behind this computer but it will also illustrate speed and algorithm execution. For example, this is like showing the mainframe generation how a 7'th Gen CPU would function. From hardware to software, theoretically. It would simulate how algorithms would work on this machine.
Superposition and entanglement would be the main focus. For instance to show entanglement the player would interact with a photon, electron , molecule, or laser (polarization) .The distance between electrons can be scaled to show qubits that are separated by incredible distances interacting with each other instantaneously.
Is it possible to build such a research environment for enthusiast and professionals to refer to with authenticity?
"
"['algorithm', 'shors-algorithm']"," Title: Confusion about random sampling of integers in Shor's algorithmBody: My understanding of Shor's algorithm is that you have to carry out the following steps if you are trying to factor $N$:
- Chose a random number less than $N$. Let's call it $a$.
- Calculate the period of $a^x \ \text{mod} \ N$. Let's call the period $r$.
- One of the factors is the GCD of $a^{r/2}+1$ and $N$. The other is the GCD of $a^{r/2}-1$ and $N$.
However this does not work in some cases such as if $N=35$ and $a=10$. You should be getting $5$ and $7$ as the prime factors of $35$, but this is not the case. The period of $10^x \ \text{mod} \ 35$ is $6$. The GCD of $10^{6/2}+1$, $1001$ and $35$ is $7$, which is one of the factors. But the GCD of $10^{6/2}-1$, $999$ and $35$ is $1$, which is not what you should be getting. Why doesn't Shor's algorithm work in this case?
"
"['architecture', 'experiment', 'solid-state', 'error-correction']"," Title: Translation of color/toric code to a small network of solid-state spinsBody: Within Quantum Error Correction and stabilizer codes, toric codes/surface codes are very tempting, mainly for their high error threshold. For more background please check up, in our Physics sister (aunt?) site: Quantum Error Correction: Surface code vs. color code.
However, these codes require fairly specific measurements in specific bases, which I find hard to translate in practice, especially into my language of interest which is spin states in a solid-state few-spin collection. To see my motivation, here is a not-quite successful attept from a few years ago, using a more naïve QEC scheme: ""Quantum Error Correction with magnetic molecules"".
So, the problem:
Related: How does the size of a toric code torus affect its ability to protect qubits?
"
"['entanglement', 'resource-request', 'teleportation']"," Title: Using a fractional number of classical bits within quantum teleportationBody: Recently, I heard that there can be transfer of rational classical bits (for example 1.5 cbits) from one party to another via quantum teleportation. In the Standard Teleportation Protocol, 2 classical bits and 1 maximally entangled shared resource state is required for perfect teleportation of the unknown state. But I do not understand how $1.x$ bits can be sent over in the classical channel.
- Is that possible? If yes, could you give a brief explanation?
- It'd be helpful if you could point me to some papers in which perfect teleportation is possible using fractional bits (and possibly extra quantum resources).
Some people might be wondering as to how this may be relevant to quantum computing. D. Gottesman and I.L. Chuang suggested that quantum teleportation will play an important role as a primitive subroutine in quantum computation. G. Brassard, S.L. Braunstein and R. Cleve showed that quantum teleportation can be understood as quantum computation.
"
['architecture']," Title: Are there any estimates on how complexity of quantum engineering scales with size?Body: It seems to me that an extremely relevant question for the prospects of quantum computing would be how the engineering complexity of quantum systems scales with size. Meaning, it's easier to build $n$ $1$-qubit computers than one $n$-qubit computer. In my mind, this is roughly analogous to the fact that it's easier to analytically solve $n$ $1$-body problems than one $n$-body problem, since entanglement is the primary motivating factor behind quantum computing in the first place.
My question is the following: It seems that we should really care about how the 'difficulty' of building and controlling an $n$-body quantum system grows with $n$. Fix a gate architecture, or even an algorithm--is there a difficulty in principle arising from the fact that an $n$-qubit computer is a quantum many-body problem? And that mathematically speaking, our understanding of how quantum phenomena scale up into classical phenomena is quite poor? Here difficulty could be defined in any number of ways, and the question we would care about, roughly is, is controlling a $1000$-qubit machine (that is, preserving the coherence of its wavefunctions) 'merely' $100$x harder than controlling a $10$-qubit machine, or $100^2$, or $100!$ or $100^{100}$? Do we have any reasons for believing that it is more or less the former, and not the latter?
"
"['technologies', 'optical-quantum-computing']"," Title: What is the status of quantum computing compared with other (photonic) quantum technologies?Body: There is a number of emerging quantum technologies, among which we find the category of photon-based quantum technologies, including quantum key distribution or quantum random number generators.
The question is: what is the short-term viability of photon-based quantum computation and simulation, compared with other photon-based quantum technologies?
"
"['entanglement', 'quantum-state', 'bayesian-learning', 'non-locality', 'contextuality']"," Title: Is it true to say that one qubit in an entangled state can instantaneously affect all others?Body: When a qubit is measured, there is a ‘collapse of the wave-function’ as a result is randomly chosen.
If the qubit is entangled with others, this collapse will also effect them. And the way it affects them depends on the way we chose to measure our qubits.
From this it seems as though things we do on one qubit have instantaneous effects on another. Is this the case, or is the apparent effect more like a Bayesian update of our knowledge about the qubits?
"
"['topological-quantum-computing', 'anyons']"," Title: What exactly are anyons and how are they relevant to topological quantum computing?Body: I have been trying to get a basic idea of what anyons are for the past couple of days. However, the online articles (including Wikipedia) seem unusually vague and impenetrable as far as explaining topological quantum computing and anyons goes.
The Wiki page on Topological quantum computer says:
A topological quantum computer is a theoretical quantum computer that
employs two-dimensional quasiparticles called anyons, whose world
lines pass around one another to form braids in a three-dimensional
spacetime (i.e., one temporal plus two spatial dimensions). These braids
form the logic gates that make up the computer. The advantage of a
quantum computer based on quantum braids over using trapped quantum
particles is that the former is much more stable. Small, cumulative
perturbations can cause quantum states to decohere and introduce
errors in the computation, but such small perturbations do not change
the braids' topological properties.
This sounded interesting. So, on seeing this definition I tried to look up what anyons are:
In physics, an anyon is a type of quasiparticle that occurs only in
two-dimensional systems, with properties much less restricted than
fermions and bosons. In general, the operation of exchanging two
identical particles may cause a global phase shift but cannot affect
observables.
Okay, I do have some idea about what quasiparticles are. For example, as an electron travels through a semiconductor, its motion is disturbed in a complex way by its interactions with all of the other electrons and nuclei; however, it approximately behaves like an electron with a different mass (effective mass) travelling unperturbed through free space. This ""electron"" with a different mass is called an ""electron quasiparticle"". So I tend to assume that a quasiparticle, in general, is an approximation for the complex particle or wave phenomenon that may occur in matter, which would be difficult to mathematically deal with otherwise.
However, I could not follow what they were saying after that. I do know that bosons are particles which follow the Bose-Einstein statistics and fermions follow the Fermi-Dirac statistics.
Questions:
- However, what do they mean by ""much less restricted than fermions and bosons""? Do ""anyons"" follow a different kind of statistical distribution than what bosons or fermions follow?
- In the next line, they say that exchanging two identical particles may cause a global phase shift but cannot affect the observables. What is meant by global phase shift in this context? Moreover, which observables are they actually talking about here?
- How are these quasiparticles i.e. anyons actually relevant to quantum computing? I keep hearing vague things likes ""The world-lines of anyons form braids/knots in 3-dimensions (2 spatial and 1 temporal). These knots help form stable forms of matter, which aren't easily susceptible to decoherence"". I think that this Ted-Ed video gives some idea, but it seems to deal with restricting electrons (rather than ""anyons"") to move on a certain closed path inside a material.
I would be glad if someone could help me to connect the dots and understand the meaning and significance of ""anyons"" at an intuitive level. I think a layman-level explanation would be more helpful for me, initially, rather than a full-blown mathematical explanation. However, I do know basic undergraduate level quantum mechanics, so you may use that in your explanation.
"
"['physical-qubit', 'noise', 'solid-state', 'fidelity']"," Title: Do avoided crossings / CTs /ZEFOZs optimize quantum fidelity in practice?Body: CTs / ZEFOZs: Energy level structures that include avoided crossings at accessible energies tend to be resilient to noise and therefore present high coherence times, at least in the case of spin qubits and magnetic noise: as the at first order effect of the magnetic field on the qubit energy vanishes, so does effectively most magnetic noise. Different people call these Atomic Clock Transitions (CTs or ACTs) or Zero First-Order-Zeeman (ZEFOZ) shift, but it's essentially the same phenomenon. This is experimentally expressed as high spin-spin $T_2$ relaxation times, even in presence of relatively high sources of noise.
However, in a quantum computing scenario, what we want is typically not a qubit surviving for long periods of inactivity (high $T_2$) but rather to obtain a high fidelity after a series of quantum gates, which can in general be rather complicated and involve entanglement with other qubits.
My question: Do CTs / ZEFOZs with their high relaxation times generally also translate into a high fidelity after a complicated series of quantum gates?
For context, the examples I have in mind are solid-state, mainly these two:
As well as this more refined variation, with electric field:
"
"['algorithm', 'quantum-state', 'mathematics', 'fidelity']"," Title: How can I calculate the inner product of two quantum registers of different sizes?Body: I found an algorithm that can compute the distance of two quantum states. It is based on a subroutine known as swap test (a fidelity estimator or inner product of two state, btw I don't understand what fidelity mean).
My question is about inner product. How can I calculate the inner product of two quantum registers which contains different number of qubits?
The description of the algorithm is found in this paper. Based on the 3rd step that appear on the image, I want to prove it by giving an example.
Let:
$|a| = 5$, $|b| = 5 $, and $ Z = 50 $
$$|a\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle$$ $$|b\rangle = \frac{4}{5}|0\rangle + \frac{3}{5}|1\rangle
$$
All we want is the fidelity of the following two states $|\psi\rangle$ and $|\phi\rangle$ and to calculate the distance between $|a\rangle$ and $|b\rangle$is given as:
$ {|a-b|}^2 = 2Z|\langle\phi|\psi\rangle|^2$
so
$$|\psi\rangle = \frac{3}{5\sqrt{2}}|00\rangle + \frac{4}{5\sqrt{2}}|01\rangle+ + \frac{4}{5\sqrt{2}}|10\rangle + + \frac{3}{5\sqrt{2}}|11\rangle$$
$$|\phi\rangle = \frac{5}{\sqrt{50}} (|0\rangle + |1\rangle) $$
then how to compute
$$\langle\phi|\psi\rangle = ??$$
"
"['resource-request', 'qudit', 'many-body-systems']"," Title: Combining Different QunitsBody: Has any work been done on quantum systems which use a combination of types of qunits (eg. using qubits & qutrits simultaneously)?
If work has been done, what kind of work has been done? (eg. in quantum information in general? in quantum computing? in physical implementations?)
"
['resource-request']," Title: Is quantum computing mature enough for a computer scientist with no physics background?Body: Sligthly related to this question, but not the same.
Traditional computer science requires no physics knowledge for a computer scientist to be able to research and make progress in the field. Of course, you do need to know about the underlying physical layer when your research is related to that, but in many cases you can ignore it (e.g. when designing an algorithm). Even when architectural details are important (e.g. cache layout), oftentimes it is not necessary to know all the details about them, or how they're implemented at the physical level.
Has quantum computing reached this level of ""maturity""? Can you design a quantum algorithm, or do actual research in the field, as a computer scientist that doesn't know anything about quantum physics? In other words, can you ""learn"" quantum computing ignoring the physical side, and is it worth it (in terms of scientific career)?
"
"['optimization', 'nisq']"," Title: Minimum number of CNOTs for a 4-qubit increment on a planar gridBody: Recently I've been wondering how high NISQ machines will be able to ""count"". What I mean by that is, given the most optimized increment circuit you can make, how many times can you physically apply that circuit to qubits in a secret initial state before there's a more than 50% chance that the output is the wrong value.
To that end, I need a good increment circuit that would actually run on a NISQ machine! E.g. this means respecting locality constrains, and costing the circuit based on how many 2-qubit operations are performed (since those are the noisiest). For simplicity, I will say that the gate set is ""any single qubit operation + local CNOTs on a grid"".
It seems clear to me that a NISQ machine should be able to apply a 3-qubit incrementer at least 8 times (so it wraps back to 0 and loses count), but I think wrapping a 4-qubit counter is much more challenging. Thus this question's focus on that size specifically.
A 4-qubit incrementer is a circuit which effects the state permutation $|k\rangle \rightarrow |k + 1\pmod{16}\rangle$. The value $k$ must be stored as a 2s complement binary integer in four qubits. If the value is under superposition, it must still be coherent after applying the incrementer (i.e. no entangling with other qubits except as temporary workspace). You may place the qubits wherever you want on the grid.
"
"['algorithm', 'quantum-fourier-transform']"," Title: Quantum Algorithms for ConvolutionBody: I was looking into applications of Quantum Computing for machine learning and encountered the following pre-print from 2003. Quantum Convolution and Correlation Algorithms are Physically Impossible. The article doesn't appear to have been published in any journals, but it has been cited a few dozen times.
The article author makes the case that it is impossible to compute discrete convolution over quantum states. Intuitively this seems incorrect to me, since I know we can perform quantum matrix multiplication, and I know that discrete convolution can be framed simply as multiplication with a Toeplitz (or circulant) matrix.
The crux of his argument seems to be that there is no realizable composition of unitary operators for the elementwise (Hadamard) product of two vectors.
Where is my disconnect? Is there any reason we cannot in general construct a Toeplitz matrix for discrete convolution in a quantum computer?
Or is the article simply incorrect? I have worked through the contradiction that the author presents in his proof of Lemma 14, and it seems to make sense to me.
"
"['quantum-state', 'decoherence']"," Title: What is the difference between $\vert 0 \rangle + \vert 1 \rangle$ and $\vert 0 \rangle \langle 0 \vert + \vert 1 \rangle \langle 1 \vert$?Body: In a discussion with Jay Gambetta on the QISKit Slack channel, Jay told me that ""T2 is the time that $\vert 0 \rangle + \vert 1 \rangle$ goes to $\vert 0 \rangle \langle 0 \vert + \vert 1 \rangle \langle 1 \vert$"".
My question is: what is the difference between those two states?
"
"['physical-realization', 'architecture', 'quantum-volume']"," Title: Is the ""Quantum Volume"" a fair metric for future, elaborate, high value quantum computations?Body: A metric called the ""quantum volume"" has been proposed to somehow compare the utility of different quantum computing hardware. Roughly speaking, it measures their worth by the square of the maximum depth of quantum computations it permits but limits its value to the square of the qubits involved. This limit is justified by wanting to forestall ""gaming"" of the system by optimizing towards few qubits. One reference is https://arxiv.org/abs/1710.01022.
I am concerned that this measure, as good as it may be for noisy near-term quantum computing devices, hides the actual quality advances for more advanced quantum computers (those with high quantum gate fidelity). The question is: Is this concern justified?
The argument behind my concern is the assumption that potential killer applications for quantum computers, for example quantum chemical calculations, will require computations with a gate depth much larger than the (potentially modest) number of qubits required. In this case, the ""quantum volume"" would be limited to the square of the number of qubits, regardless of whether one quantum computer (with particularly high fidelity) permits an essentially unlimited depth or whether it only allows the bare minimum gate depth to achieve the limitation of the ""quantum volume"" to the square of the number of qubits. One aspect of my question is: Is this argument correct?
"
"['error-correction', 'resource-request', 'decoherence']"," Title: Quantum Belief Propagation decodingBody: I have been reading about a family of quantum error correction codes called Quantum Turbo Codes, which are the quantum analog of the well-known classical Turbo codes. This codes were introduced in quantum serial turbo codes and the entanglement-assisted version of those was presented in entanglement-assisted quantum turbo codes.
In such papers, the decoding algorithm presented for is a modification of the classical belief propagation algorithms that are used for obtaining the most probable codeword received based on the channel information and the syndromes read from the information received. The difference in the quantum paradigm is that the belief propagation algorithm here is used to detect the most probable error that happened in the channel and so the recovery operation can be applied to the received quantum states. This modified algorithm is purely classical, and so it would be executed in a classical computer before feeding the decoded information back to the quantum computer.
The fact that it is a classical algorithm presents some problems, such as the fact that if the belief propagation takes more time than the decoherence time of the qubits, then the recovery would be unsuccesfull as more errors would have happened before correction is applied.
That's why I wonder if there are quantum versions of the belief propagation algorithms that use the parallel nature of quantum computers to obtain substantial speedups in the decoding process. I am seeking for reference respect to this topic, or to know if there are research groups concerned about this kind of problem.
"
"['algorithm', 'measurement']"," Title: Does the need of many quantum algorithms to be repeated several times impair the efficiency gains?Body: As I understand so far, in some algorithms such as Simon's algorithm, swap-test algorithm or quantum k-means algorithm, we repetitively perform a measurement yielding a classical result. Consequently, this pushes us to run the whole algorithm again and again (starting from initialization of the system).
My question is:
do we lose the complexity as the number of repetitions of the algorithm increases?
"
"['physical-realization', 'simulation']"," Title: Are quantum simulators like Microsoft Q# actually using quantum mechanics in their chips?Body: Unlike Google's Bristlecone or IBM's Qbit computer, do simulators like Q# or Alibaba really use quantum mechanics anywhere in their physical chips? Are they just defining properties using a classical computer and trying to achieve quantum simulations ?
"
"['algorithm', 'hhl-algorithm', 'terminology']"," Title: What exactly is ""matrix sparsity"" $s$?Body: In many sources (like on Page 30 here), I found that the complexity of the original Harrow Hassidim Lloyd is stated as $\mathcal{O}(\log (N) s^2 \kappa^2/\epsilon)$ where $s$ is said to be the ""matrix sparsity"". What is a precise definition of the term ""matrix sparsity""? I couldn't find it stated anywhere.
"
"['speedup', 'quantum-advantage', 'random-quantum-circuit']"," Title: What exactly is ""Random Circuit Sampling""?Body: Many people have suggested using ""Random Circuit Sampling"" to demonstrate quantum supremacy. But what is the precise definition of the ""Random Circuit Sampling"" problem? I've seen statements like ""the task
is to take a random (efficient) quantum circuit of a specific form and generate samples from its output distribution"". But it is not clear to me what the terms ""random (efficient) quantum circuit"" mean precisely. Also, do we know anything about the classical computational complexity of this problem?
"
"['programming', 'resource-request', 'q#']"," Title: Q# factorization Method ProgramBody: Is there a method to calculate prime factorization in Q# of Visual Studio of Microsoft Quantum Development Kit?
In the Python language, it is the sympy.factorint method.
Or else is there any Q# sample program?
It is like Shor's algorithm calling Q# from C#.
"
"['speedup', 'fault-tolerance']"," Title: How are magic states defined in the context of quantum computation?Body: Quoting from this blog post by Earl T. Campbell:
Magic states are a special ingredient, or resource, that allows quantum computers to run faster than traditional computers.
One interesting example that is mentioned in that blog post is that, in the case of a single qubit, any state apart from the eigenstates of the Pauli matrices is magic.
How are these magic states more generally defined? Is it really just any state that is not a stabilizer state, or is it something else?
"
"['measurement', 'density-matrix']"," Title: How to calculate the off-diagonal elements of a density matrix using the measurement result?Body: For example, one have measured some states like $|0\rangle$ in the computational basis for many times and got the approximate probability of getting 0 and 1 ($P(0)$ and $P(1)$). Then how does he calculate the off-diagonal elements of the density of the initial quantum state?
The system is open and with noise.
"
"['photonics', 'boson-sampling']"," Title: What about BosonSampling can be publicly verified?Body: Boson Sampling, sometimes stylized as BosonSampling, is an attractive candidate problem to establish quantum supremacy; the engineering problems appear more surmountable than those associated with a Turing-complete quantum computer.
However, Boson Sampling has a downside, in that the output of a photonic quantum computer capable of executing Boson Sampling with only a handful ($\le 100$ or so) of qubits may not even be able to be clasically simulated. This is, of course, unlike $\mathsf{NP}$ problems such as factoring, the engineering aspects of which are significantly harder.
Thus, we may establish the results of Boson Sampling on $100$ or so photons, but in order to verify the results, we need to calculate the permanent of a $100\times100$ matrix. This is famously computationally hard to verify.
Maybe a supercomputer powerful enough to calculate the permanent can do the trick. But then everyone would have to believe both the supercomputer's results and the Boson Sampling results.
Is there anything about Boson Sampling that can be easily verified?
I've had a flight of fancy to maybe put the resources of a cryptocurrency mining network to use to calculate such a permanent, and relying on some $\mathsf{\#P}$ / $\mathsf{IP}$ tricks for public verification, but I haven't gotten very far.
EDIT
I like @gIS's answer.
Compare Boson Sampling with Appel and Franken's computer-assisted proof of the Four Color Theorem. The original proof of the 4CT was allegedly controversial, precisely because the proof was too long to be publicly verified by a human reader. We've moved so far from the '70's with our trust of computers, wherein I think now most people accept the proof of the 4CT without much controversy. But thinking about how to make things like a proof of the 4CT human-verifiable may lead to interesting ideas like the $\mathsf{PCP}$ theorem.
"
"['algorithm', 'hamiltonian-simulation']"," Title: Is there a Hamiltonian simulation technique implemented somewhere?Body: I was wondering if there was some code available for Hamiltonian simulation for sparse matrix. And also if they exist, they correspond to a divide and conquer approach or a Quantum walk approach?
"
"['tensor-product', 'quantum-fourier-transform']"," Title: Simplifying Quantum Tensor products with coefficientsBody: $\newcommand{\ket}[1]{\lvert#1\rangle}$I am trying to show equality of two intermediate steps in the rearrangement of the Quantum Fourier transform definition, but I do not know how to rearrange the coefficients of a tensor product.
The text claims that $$ \frac{1}{2^{n/2}}\sum_{k_1=0}^{1}\sum_{k_2=0}^{1} \cdots \sum_{k_n=0}^{1}e^{2\pi ij \left( \sum_{l=1}^n{k_l 2^{-l}} \right)} \ket{k_1 \ldots k_n} = \frac{1}{2^{n/2}}\sum_{k_1=0}^{1}\sum_{k_2=0}^{1} \cdots \sum_{k_n=0}^{1}{ \bigotimes_{l=1}^n e^{2\pi ijk_l 2^{-l}} \ket{k_l}} $$
Isolating the parts that change leaves us with $$ e^{2\pi ij \left( \sum_{l=1}^n{k_l 2^{-l}} \right)} |k_1 \ldots k_n \rangle = \bigotimes_{l=1}^n e^{2\pi ijk_l 2^{-l}} |k_l \rangle. $$ If I were to look at a small case letting $ n = 3. $ I would get the following on the left hand side, $$ e^{2\pi i j \left( k_12^{-1} + k_22^{-2} + k_32^{-3} \right) } |k_1k_2k_3 \rangle, $$ and the following on the right hand side, $$ e^{2 \pi i jk_12^{-1}} |k_1\rangle \otimes e^{2 \pi i jk_22^{-2}}|k_2\rangle \otimes e^{2 \pi i jk_32^{-3}}|k_3\rangle. $$ Is there a rule that is similar to $$ a |k_1\rangle \otimes b |k_2\rangle = ab|k_1k_2\rangle$$ that will allow me to rewrite the RHS to be equal to the LHS as desired.
I would also like to ask for reference suggestions to strengthen my understanding of tensor product algebra as well.
"
"['resource-request', 'models']"," Title: What exactly are ""quantum rotors""?Body: The Wikipedia entry on the subject is rather short. I am also curious about generalizations of quantum rotors in n-dimensions. An introductory explanation with at least one resource for further reading would be greatly appreciated.
"
"['programming', 'simulation', 'q#']"," Title: Finding the maximum number of Q# simulatable qubitsBody: I'm new to Q# and I was curious on how one would find the number of Q# simulatable qubits for a specific machine. I know Microsoft has an approximation of 16GB ~ 30 qubits but I wanted a better estimation for my own machines.
I wrote this quick program that runs a loop which allocates a register of increasing size. When I get a std::bad_alloc error I then have an estimate. I'm guessing there is a better way either through a tool or some pre-written code.
"
['algorithm']," Title: How would a quantum computer be used to solve Partial Differential Equations?Body: Say you have a PDE you want to solve.
What kind of quantum algorithms would you use to solve it?
How do we input our problem on a quantum computer?
What will be the output and in what form?
I know that quantum algorithms for solving linear systems (often named HHL but actually this is a bad name as other versions are not from the HHL authors) were listed before but maybe other methods are out there.
Also as it is considered as a subroutine, the output is quantum and then unless you want statistics from it or use it as an input of another quantum algorithm, it is limiting.
"
"['error-correction', 'stabilizer-code']"," Title: Significance of Clifford operations from quantum error correction perspectiveBody: In the literature on QECC, Clifford gates occupy an elevated status.
Consider the following examples which attest to this:
- When you study stabilizer codes, you separately study how to perform encoded Clifford gates (even if these aren't applicable transversally). All introductory material on QECC emphasize on performing encoded Clifford operations on quantum codes. And otherwise too, emphasize on Clifford gates (i.e., even when not performing encoded Clifford gates in quantum codes).
- The entire topic of magic state distillation* is based on the classification of certain operations (including the performance of Clifford gates) as low-cost operations, while, for instance, performing the toffoli-gate or the $\pi/8$-gate, as higher-cost operations.
Possible answers:
- This has been justified in certain places in the literature ,for e.g., Gottesman's PhD dissertation and many papers by him, and also in https://arxiv.org/abs/quant-ph/0403025. The reason given in these places is that it is possible to perform some Clifford gates transversally (a prototypical Fault-tolerant operation) on certain stabilizer codes. On the other hand, it is not easy to find a transversal application of non-Clifford gates on quantum codes. I haven't verified this myself, but am just going by statements which Gottesman makes in his PhD. dissertation and some review articles.
Not being able to perform an encoded gate transversally on a quantum code immediately increases the cost of performing said gate on the code. And hence performing Clifford gates goes into the low-cost category, while non-Clifford gates goes into the high-cost category.
- From an engineering perspective, it is important to decide on a standardized list of basic units of quantum computation (state preparation, gates, measurement-observables/basis), etc. Performing Clifford gates makes for a convenient choice on that list because of multiple reasons (most well-known sets of universal quantum gates include many Clifford gates in them ,Gottesman-Knill theorem**, etc).
These are the only two reasons I could think of for why the Clifford group has such an elevated status in the study of QECC (particularly when you're studying stabilizer codes). Both reasons stem from an engineering perspective.
So the question is can one identify other reasons, which don't stem from an engineering perspective? Is there some other major role that the Clifford gates play, which I've missed out?
Possible other reason: I know that the Clifford group is the normaliser of the Pauli group in the Unitary group (on $n$ qubit systems). Also, that it has a semidirect product structure (actually a projective representation of of semidirect product group). Does these relations/properties by themselves give another reason why one ought to study the Clifford group in association with Stabilizer codes?
*Feel free to correct this.
**Which states that restricted to certain operations, you can't obtain the quantum advantage, and hence you need a little-bit more than the set of operations you initially restricted yourself to.
"
"['matrix-representation', 'mathematics']"," Title: Can we process infinite matrices with a quantum computer?Body: Can we process infinite matrices with a quantum computer?
If then, how can we do that?
"
"['physical-realization', 'physical-qubit']"," Title: What does it mean for a quantum computer to have $X$ qubits?Body: I want to preface with a disclaimer that I am a physicist with minimal knowledge of computer hardware. I have a solid understanding of quantum information from a theoretical standpoint but zero knowledge of how it is implemented. Here goes...
When a company boasts that there newest chip has $X$ qubits, what exactly does that mean? Should I think of $X$ as being analogous with 32 or 64 bits on a conventional processor, meaning that the quantum computer can hold and process data types of size $X$? Or is $X$ something physical, like the number of Josephson junctions on the chip? should I think of $X$ as being equivalent to the number of transistors on a conventional processor? The benchmark of a conventional microprocessor is the number of transistors, so it is tempting to make the equivalence between transistor and qubit but I don't think that is correct because qubit is a unit of information and a transistor is a hardware thing. And furthermore I would not understand how quantum supremacy could be achieved with only ~50 qubits when conventional processors have billions of transistors. It just seems strange to say that a chip has $X$ 'qubits', because from a theoretical standpoint a qubit is information and not hardware.
EDIT:
I am realizing that my confusion boils down to memory vs processing power. I get that in order to store $2^X$ states, I would need $X$ physical qubits (Josephson junctions, spin states, etc). But then where does the processing power come from? On a conventional chip, you have registers to store the information to be processed, but then a ton of transistors to perform the computation. My question is how this processing power is measured in a quantum computer? Do the number of quantum gates on the chip really not matter as much as the number of qubits they are capable of operating on?
"
"['circuit-construction', 'qiskit']"," Title: Why do we need a Classical Register for carrying out Quantum Computations?Body: I've just started to mess about with QISKit on Python and one thing is confusing me a fair bit.
Given that we are building Quantum Circuits what is the need for a classical register ?
Is it because the collapsed state must be classical ?
"
"['algorithm', 'simulation']"," Title: Classical Memory enough to store states up to 40 qubits quantum system?Body: As a part of a discussion with my 'classical' friend, he insisted that making a a state machine for calculating the outcome of quantum computer is possible; so, simply calculate the outcomes of (known) algorithms on supercomputers and store their results in a Look-up table. (Something like storing the truth table).
So, why do people work on quantum simulators (say, capable up to 40 qubits); which calculate the result every time?! Simply (hypothetically) use the supercomputers of the world (say capable up to 60 qubits); calculate the result for $2^{60}$ input cases, store their result and use it as reference? How can I convince him it's not possible?
Note: this is for known quantum algorithms and their known circuit implementations.
"
"['entanglement', 'concurrence']"," Title: Can two states with the same entanglement be transformed into each other using local unitaries?Body: Take two pure bi-partite states $\psi$ and $\phi$ that have the same amount of entanglement in them as quantified by concurrence (does the measure make a difference?). Can any such states be transformed into each other using local unitaries?
"
"['physical-qubit', 'models', 'continuous-variable']"," Title: What is continuous quantum register and how it relates to qubits?Body: I would like to understand what is a continuous quantum register.
I know the direct definition is a quantum register that stores a real number defined by an observable with a spectrum consisting of $\mathbb{R}$ but that seems really abstract to me.
Also how it relates to qubits? Is a set of qubits used for simulating discretely a continuous quantum register? If yes how?
"
['hhl-algorithm']," Title: What does $||A|| = 1$ mean in the definition of QLSP?Body: In their 2017 paper, Childs et al. gave the definition of QLSP beginning with : ""Let $A$ be an $N\times N$ Hermitian matrix with known condition numbers $\kappa$, $||A|| = 1$ and at most $d$ non-zero entries in any row or column...""
I initially thought that by $||A|| = 1$ they meant that QLSP requires spectral norm (largest eigenvalue) of $A$ to be $1$, which sounds reasonable to me as even the original HHL paper they needed the eigenvalues of $A$ to lie in between $1/\kappa$ and $1$.
But, the paper: Quantum linear systems algorithms: a primer seems to have interpreted is as ""the determinant of $A$ needs to be $1$"" in page 28 definition 6.
Which interpretation is correct and why? In case the latter is correct, I'm not sure why it is so. I don't see why the restriction that $\text{det}(A)$ needs to be $1$ even make sense. It (the unit determinant condition) doesn't even guarantee that the eigenvalues of $A$ will be less than or equal to $1$, which is necessary for HHL to work.
"
"['resource-request', 'circuit-construction', 'qasm2circ']"," Title: How to re-create the following circuit image?Body: What would be the best way to re-create the following image of the HHL quantum circuit without compromising on image quality (the image is from this review paper)?
Using qasm2circ I can create the basic circuit. But I don't know any good program/software which will help to produce the labels of the various components and also the nice transparent boxes emphasizing the 3 main steps.
FWIW, I had contacted the corresponding author last week asking about the software they used to generate the image (and also whether the image has any associated copyright license), but haven't received any response so far, which is why I am asking here.
"
"['error-correction', 'randomised-benchmarking', 't-designs']"," Title: What is the intuition behind quantum t-designs?Body: I started reading about Randomized Benchmarking (this paper, arxiv version) and came across "unitary 2 design."
After some googling, I found that the Clifford group being a unitary 2 design is a specific case of "Quantum t-design."
I read the wikipedia page and a few other references (this one for example, non pdf link to the website that links to the pdf).
I would like to have some intuitive understanding of the difference between different t designs and what makes the Clifford group a 2 design.
"
['research']," Title: Ethics: Publishing a corrected version of a moderately cited paper having several minor errorsBody: This is the QCSE version of What should you do if you spotted a non-trivial error in a highly cited paper? (maybe replace ""highly cited"" with ""moderately cited"" and ""a non-trivial"" with ""several minor"").
While going through the pre-print v2 as well as the published version of the paper `Quantum Circuit Design for Solving Linear Systems of Equations' by Cao et al., I found several errors in the paper:
- In the published version the connections of the $e^{iAt/2^i}$ gates are connected to clock register in the wrong order (Figure 4).
- In the pre-print the gates $e^{-iAt/2^i}$ should actually have been $e^{iAt/2^i}$ (Figure 4).
- In the pre-print the gate decomposition of $e^{iAt/2^i}$ is wrong. The last $Z$ gate must have been a controlled $Z$.
- The $5$ coefficients of the gate decompositions are wrong in both the pre-print and published version. Only the coefficients given for $e^{iAt/16}$ are fine but the rest they have to be found by some method of multivariable optimization (this was implemented by @Nelimee in QISKit and I had verified it)
- No SWAP gate is required in the circuit, as explained by @DaftWullie here.
- They skipped most explanations of why they chose the specific form of matrix $A$ in the paper, and everything about the scaling required.
Anyhow, this paper was essentially what I worked on, through the summer and I need to write a report on what I did, which might be put up on arXiv (and maybe for publishing, probably in QIP, later on, if I can think of sufficiently original material).
Now, I'm not sure how the quantum computing academic community looks at these type of ""correction papers"". So, basically, is it ethical to write up a correction paper like this (which doesn't correct a ""huge"" mistake in a ""highly cited"" paper but rather several small mistakes in a ""moderately cited"" paper) or are they highly frowned upon? In case the latter is true, I'll probably avoid putting it up on arXiv and wait till I can come up with sufficiently original additions to the paper (like extending it to higher dimensions and making the circuit more general).
"
['algorithm']," Title: Is there an intuition built on ansatz in VQE algorithm or is it more a trial and error approach?Body: Variational Quantum Eigensolver is a popular algorithm in Quantum Computing. But the ansatz part is very tricky. I do not really understand if they are built on some intuition, according to hardware or something else; or if it was just a trial and error approach.
What do you think about it?
"
"['quantum-gate', 'gate-synthesis']"," Title: How to construct a multi-qubit controlled-Z from elementary gates?Body: For the implementation of a certain quantum algorithm, I need to construct a multi-qubit (in this case, a three-qubit) controlled-Z gate from a set of elementary gates, as shown in the figure below.
.
The gates that I can use are
- the Pauli gates $\rm X, Y, Z$ and all their powers (i.e. all Pauli rotations up to a phase factor),
- ${\rm exp}(i\theta|11\rangle\langle11|)$ (rotation about $|11\rangle\langle11|$ projector),
- $\rm H$ (Hadamard),
- $\rm C_X$ (single-qubit controlled-X or CNOT),
- $\rm C_Z$ (single-qubit controlled-Z), and
- $\rm S$ (SWAP).
How can I go about building this three-qubit controlled-Z from these gates? I have read several papers on circuit decompositions, but none of them could give me a clear and concise answer.
"
"['continuous-variable', 'wigner-function']"," Title: Does a Wigner function uniquely determine a quantum state?Body: We know that the Wigner function of a Gaussian quantum state is (up to a constant) a Gaussian distribution. The first moment and the covariance of this distribution uniquely specify a quantum state. Therefore a Wigner function uniquely determines a Gaussian state.
Are there any similar statements applying to non-Gaussian states?
"
"['error-correction', 'randomised-benchmarking']"," Title: Physical meaning of twirling in Randomized BenchmarkingBody: I was reading papers on Randomized Benchmarking, such as this and this.
(more specifically, equation 30 in the second paper)
It appears to be some kind of averaging but I would like to have a more intuitive and physical picture of what it actually represents in terms of measurements.
(I know very little math, especially in terms of group representation)
"
"['quantum-gate', 'circuit-construction', 'programming', 'gate-synthesis', 'mathematics']"," Title: Automatic compilation of quantum circuitsBody: A recent question here asked how to compile the 4-qubit gate CCCZ (controlled-controlled-controlled-Z) into simple 1-qubit and 2-qubit gates, and the only answer given so far requires 63 gates!
The first step was to use the C$^n$U construction given by Nielsen & Chuang:
With $n=3$ this means 4 CCNOT gates and 3 simple gates (1 CNOT and 2 Hadamards is enough to do the final CZ on the target qubit and the last work qubit).
Theorem 1 of this paper, says that in general the CCNOT requires 9 one-qubit and 6 two-qubit gates (15 total):
This means:
(4 CCNOTs) x (15 gates per CCNOT) + (1 CNOT) + (2 Hadamards) = 63 total gates.
In a comment, it has been suggested the 63 gates can be then further compiled using an ""automatic procedure"", for example from the theory of automatic groups.
How can this ""automatic compilation"" be done, and how much would it reduce the number of 1-qubit and 2-qubit gates in this case?
"
"['circuit-construction', 'quantum-state', 'unitarity']"," Title: What is the smallest quantum circuit to produce two-qubit state (a,b,b,b)?Body: How can I synthesis a two-qubit quantum state of the state vector (a,b,b,b) using basic quantum-gate circuit (arbitrary single-qubit rotation and controlled $Z$ gate)? And further, can I know a given circuit is the simplest?
"
"['quantum-gate', 'architecture', 'resource-request', 'experiment', 'decoherence']"," Title: State of the art gate speeds and decoherence timesBody: I am interested in the state of the art gate speeds and decoherence times for the qubit types I know are being pursued by companies presently:
- superconducting qubits,
- ion trap qubits,
- photonic qubits.
Where can I find these, and is there a place where these are updated regularly?
There have been various published tables depicting these times for various types of qubits over the years (including the famous Los Alamos National Lab QC Roadmap), but the numbers always change while the published papers don't.
I needed these numbers to answer this question because I wanted to compare the 1ps decoherence time in the FMO to state-of-the-art decoherence times and gate times in popular candidates for QCs, so I went searching for some reasonable values for roughly this time period, but I don't anymore know where to look.
The longest coherence time ever measured was given in this answer, but no gate times were given: What is the longest time a qubit has survived with 0.9999 fidelity?
James Wootton talked about the advantages and disadvantages of the above three qubit types, but not the gate/decoherence times, in this answer: What is the leading edge technology for creating a quantum computer with the fewest errors?
"
"['no-cloning-theorem', 'cloning']"," Title: Cloning classical data encoded into qubitsBody: How is it possible to maintain classical data encoded into qubits, which often contains copies of information, given that the no cloning theorem prevents cloning information?
"
"['quantum-advantage', 'research', 'tensor-networks']"," Title: What can tensor networks mean for quantum computing?Body: I am trying to understand what the importance of tensor networks is (or will/could be) for quantum computing.
Does it make sense to study tensor networks deeply and develop them further to help pave the way towards quantum supremacy? If so, how could they help and what are the current most pressing research questions?
"
"['matrix-representation', 'tensor-product']"," Title: How to calculate tensor product for the magic squareBody: The magic square game is a two-player pseudo-telepathy game that was presented by Padmanabhan Aravind, who built on work by Mermin. In the magic square we have ones in columns (odd number) and rows (even number).
According to https://arxiv.org/abs/quant-ph/0407221v3
$$
A2=
\frac12\left[ {\begin{array}{ccccc}
i & 1 & 1 & i \\-i & 1 & -1 & i\\i & 1 & -1 & -i\\-i & 1 & 1 & -i \end{array} } \right]
$$
$$
B3=
\frac1{\sqrt{2}}\left[ {\begin{array}{ccccc}
1 & 0 & 0 & 1 \\-1 & 0 & 0 & 1\\0 & 1 & 1 & 0\\0 & 1 & -1 & 0 \end{array} } \right]
$$
We have an input the entangled state shared by Alice and Bob
$ \mid \psi \rangle = \frac{1}{2}\mid0011 \rangle -\frac{1}{2}\mid0110 \rangle -\frac{1}{2}\mid1001 \rangle +\frac{1}{2}\mid1100 \rangle$
Consider for example inputs x =2 and y =3. After Alice and Bob apply A2 and B3 respectively, the state evolves to
$$
A2 \otimes B3 \mid \psi\rangle = \frac{1}{2\sqrt{2}} \left[\mid0000\rangle -\mid0010\rangle -\mid0101\rangle +\mid 0111\rangle +\mid 1001\rangle +\mid 1011\rangle -\mid 1100\rangle -\mid 1110\rangle \right]
$$
Question is how to obtain this result. I did multiplication of the matrices
$ +(A2 \otimes B3) \mid 00 \rangle \otimes \mid 11 \rangle $
$ -(A2 \otimes B3) \mid 01 \rangle \otimes \mid 10 \rangle $
$ -(A2 \otimes B3) \mid 10 \rangle \otimes \mid 01 \rangle $
$ +(A2 \otimes B3) \mid 11 \rangle \otimes \mid 00 \rangle $
Calculate the tensor product
$ +(A2 \mid 00 \rangle \otimes B3\mid 11 \rangle $ part 1
$ -(A2 \mid 01 \rangle \otimes B3\mid 10 \rangle $ part 2
$ -(A2 \mid 10 \rangle \otimes B3\mid 01 \rangle $ part 3
$ +(A2 \mid 11 \rangle \otimes B3\mid 00 \rangle $ part 4
Let's calculate part 2 with step 1 and step 2
$$
step 1 = A2 | 01 \rangle =
\left[ {\begin{array}{ccccc}
i & 1 & 1 & 1 \\-i & 1 & -1 & 1\\i & 1 & -1 & -i\\-i & 1 & 1 & -i \end{array} } \right] \left[ {\begin{array}{c} 0 \\ 1 \\ 0 \\ 0\end{array}} \right] = \left[ {\begin{array}{c} 1 \\ 1 \\ 1 \\ 1\end{array}} \right]
$$
$$
step 2 = B3 | 10 \rangle =
\left[ {\begin{array}{ccccc}
1 & 0 & 0 & 1 \\-1 & 0 & 0 & 1\\0 & 1 & 1 & 0\\0 & 1 & -1 & 0 \end{array} } \right] \left[ {\begin{array}{c} 0 \\ 0 \\ 1 \\ 0\end{array}} \right] = \left[ {\begin{array}{c} 0 \\ 0 \\ 1 \\ -1\end{array}} \right]
$$
$ step1 \otimes step2 = \left[ {\begin{array}{c} 0 \\ 0 \\ 1 \\ -1 \\ 0 \\ 0 \\ 1 \\ -1 \\ 0 \\ 0 \\ 1 \\ -1 \\0 \\ 0\\ 1 \\ -1 \end{array}} \right] $
Is this the way to go?
"
"['algorithm', 'hamiltonian-simulation']"," Title: Example of Hamiltonian Simulation solving interesting problem?Body: Hamiltionian Simulation (= simulation of quantum mechanical systems) is claimed to be one of the most promising applications of a quantum computer in the future.
One of the earliest – and most important – applications of a quantum
computer is likely to be the simulation of quantum mechanical systems.
There are quantum systems for which no efficient classical simulation
is known, but which we can simulate on a universal quantum computer.
What does it mean to “simulate” a physical system? According to the
OED, simulation is “the technique of imitating the behaviour of some
situation or process (whether economic, military, mechanical, etc.) by
means of a suitably analogous situation or apparatus”. What we will
take simulation to mean here is approximating the dynamics of a
physical system. Rather than tailoring our simulator to simulate only
one type of physical system (which is sometimes called analogue
simulation), we seek a general simulation algorithm which can simulate
many different types of system (sometimes called digital simulation)
For the details, check chapter 7 of the lecture notes by Ashley Montaro.
Question:
Assuming tomorrow we have such a powerful universal quantum computer: which interesting problem (1) based on simulating a quantum system (2) for which a quantum algorithm is known, can we solve ?
Note that it is important that a quantum algorithm is already known to solve this problem or at least that there is good evidence supporting that such quantum algorithm can be found.
With interesting I mean that it should have substantial impact beyond the field of quantum computing and quantum chemistry.
Note that interesting problem definitely includes finding molecules that can cure diseases, designing materials with specific characteristics.
"
"['physical-realization', 'physical-qubit', 'architecture', 'superconducting-quantum-computing']"," Title: Transmons and cooper pair box qubits: two islands or a single island and a reservoirBody: In scientific literature, one typically describes Cooper pair boxes as a small superconducting island coupled to a superconducting reservoir (say, a large ground plane of superconducting metal, or a large piece in any case) via a Josephson junction. This is for example illustrated in panel c below, taken from here
The main innovation of the transmon over the Cooper pair box was (if I am not mistaken) to shunt the island with a large capacitance, so as to decrease the sensitivity to charge. One can do this while maintaining the geometry of having an island and a large reservoir; see for example figure 1a of Anharmonicity of a Gatemon Qubit with a Few-Mode Josephson Junction by Kringhoj et al. (2017), where their Josephson junction (in this case an SNS junction made from a nanowire) shunts a T shaped island to the ground plane, the reservoir in this case. The large capacitance here is to ground. I apologise for using an exotic transmon here, I couldn't find a nice picture of a standard one; Studying Light-Harvesting Models with Superconducting Circuits by Potocnik et al. (2017) has grounded $\require{\mhchem}\ce{AlOx}$ transmons in figure 1b, but the level of zoom is a little low.
But something that I often see in modern transmon designs is that it is not a shunted island coupled to a reservoir; it is instead two coupled islands; take this figure from here. The capacitance here is between the two plates themselves.
Optically and intuitively, I would say that this is a rather different device; instead of having a small, isolated (up to Josephson coupling) island coupled to a large reservoir with a very large number of charges (which might even be grounded), one now has two such small, isolated islands with a small number of charges, galvanically isolated from the rest of the circuit. Moreover, the capacitance is now not to ground, but between the islands.
Now, I know that the Hamiltonian of these systems does not care about this difference; what matters is the number of Cooper pairs which have tunnelled across the junction, not the actual number of charges on the island(s). What my question is, is how in practice these devices do differ; why would one make their transmon in one way or the other? What constraints/considerations/findings have led modern designs to favour the two island version (if this is even true)? Do they have a better life and or coherence times, and if so, why? I've been trying to find literature that talks about the distinction between the two, but I have been unsuccessful.
Note: This has been cross posted on Physics SE.
"
"['algorithm', 'hhl-algorithm']"," Title: How to speed up the matrix multiplication steps in multi-linear regression?Body: Context and Motivation:
As discussed here, in multilinear regression, we can express the linear system as $AX = b$. This leads to $A^TA \hat{X} = A^T b$. From here, the estimated value of $X$ is calculated as $(A^TA)^{-1}A^Tb$. The whole process basically involves three steps:
- Matrix multiplication of $A$ and $A^T$: $\mathcal{O}(C^2N)$
- Matrix multiplication of $A^T$ and column matrix $b$: $\mathcal{O}(CN)$
- LU/Cholesky factorization of matrix $A^T A$ used to compute the product $(A^TA)^{-1}A^Tb$: $\mathcal{O}(C^3)$.
Note: $N$ is the number of training samples. $C$ is the number of features/variables.
Questions:
I guess we could speed up step $3$ by using the HHL although I guess that would be worth it only if $C$ is sufficiently large i.e. $C\lesssim N$. But is there any quantum algorithm to speed up steps 1 and 2 (which involve matrix multiplication)? The fastest classical matrix multiplication algorithms as of today have time complexities around $\mathcal{O}(N^{2.37})$.
So:
- Can we do better than that? What are state-of-the-art general purpose quantum algorithms as of today, as far as matrix
multiplication is concerned?
(By ""general purpose"" I mean that the
algorithm should have no specific restrictions on the elements of the
matrices. An user mentioned in the comments that there are different quantum matrix multiplication algorithms depending on sparsity, condition number, etc. which sounds reasonable to me. So any answer which lists and summarizes the best quantum algorithms for different such conditions/restrictions is also welcome.)
- Would the state-of-the-art quantum matrix multiplication algorithm(s) coupled with HHL help to produce an overall reduction in the time complexity
(considering all the three steps as a whole) of multilinear
regression? If yes, by how much?
(I'm looking for an asymptotic analysis as in here which states that the overall time complexity of classical multilinear regression at best is $\mathcal{O}(C^2N)$).
Note:
Please summarize any algorithm you mention (along with the constraints involved). It is practically impossible for people to read each and every paper referenced in order to check whether it suits their criteria!
"
['foundations']," Title: Equation for Quantum GyroscopesBody:
A quantum gyroscope is a very sensitive device to measure angular rotation based on quantum mechanical principles. The first of these has been built by Richard Packard and his colleagues at the University of California, Berkeley. The extreme sensitivity means that theoretically, a larger version could detect effects like minute changes in the rotational rate of the Earth.
There is a section on Wikipedia titled Equation with no information in it.
Can any one help fill in the blank?
"
['spintronics']," Title: Prerequisites for a career in spintronics based Quantum ComputingBody: I'm a bachelor in Mechanical Engineering, currently pursuing Masters in Nanotechnology. I am interested to pursue a career in the field of quantum computing. I have got a basic understanding of electronics and quantum mechanics. But poor understanding in the area of computer science.
What qualities/prerequisites are required to pursue a career in the above-mentioned field? Will my weakness in computer science pose any hurdles in the future?
"
"['quantum-state', 'bloch-sphere']"," Title: Why are half angles used in the Bloch sphere representation of qubits?Body: Suppose we have a single qubit with state $| \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle$. We know that $|\alpha|^2 + |\beta|^2 = 1$, so we can write $| \alpha | = \cos(\theta)$, $| \beta | = \sin(\theta)$ for some real number $\theta$. Then, since only the relative phase between $\alpha$ and $\beta$ is physical, we can take $\alpha$ to be real. So we can now write
$$| \psi \rangle = \cos(\theta) | 0 \rangle + e^{i \phi} \sin(\theta)| 1 \rangle$$
My Question: Why are points on the Bloch sphere usually associated to vectors written as
$$| \psi \rangle = \cos(\theta/2) | 0 \rangle + e^{i \phi} \sin(\theta/2)| 1 \rangle$$
instead of as I have written? Why use $\theta /2$ instead of just $\theta$?
"
['algorithm']," Title: Quantum XOR Cipher ConstructionBody: After getting help here with XNOR, RCA & XOR linked lists, I am now curious about quantum XOR ciphers (Google returns ""no results"").
In cryptography, the simple XOR cipher is a type of additive cipher, an encryption algorithm that operates according to the principles:
$A \oplus 0 = A$,
$A \oplus A = 0$,
$(A \oplus B) \oplus C = A \oplus (B \oplus C)$,
$(B \oplus A) \oplus A = B \oplus 0 = B$,
where $\oplus$ denotes the exclusive disjunction (XOR) operation.
-Wikipedia
How would a quantum XOR cipher be expressed?
"
"['quantum-gate', 'gate-synthesis', 'universal-gates']"," Title: Explicit Conversion Between Universal Gate SetsBody: I'm interested in the conversion between different sets of universal gates. For example, it is known that each of the following sets is universal for quantum computation:
- $\{T,H,\textrm{cNOT}\}$
- $\{H,\textrm{c}S\}$, where $S=T^2$ and $S^2=Z$, and $\mathrm{c}S = \lvert 0 \rangle\!\langle 0 \rvert {\,\otimes\,} \mathbf 1 + \lvert 1 \rangle\!\langle 1 \rvert {\,\otimes\,} S$.
- $\{H,\textrm{ccNOT}\}$, where $\textrm{ccNOT}$ is also known as the Toffoli gate. Note that this case requires the introduction of an extra ancilla bit that records whether each of the amplitudes is real or imaginary, so that the entire computation only uses real amplitudes.
Now, let's say I've proven that the first set is universal. How can I write this set in terms of gates from the other sets? (It is possible that it is not possible perfectly.) The problem is that the other two cases are proven using a denseness in a particular space argument (here and here, much as you would use between $H$ and $T$ to generate arbitrary single-qubit rotations for the first set), each using a different subspace, and not by converting from one set to another. Is there an exact, direct conversion?
The particular sticking points are:
- (2 to 1): creating $T$ from controlled-$S$ and $H$. I could also accept creating any single-qubit phase gate that is not $S$, $Z$ or $S^\dagger$.
- (3 to 1): creating a controlled-Hadamard from $H$ and Toffoli. (Controlled-Hadamard is the equivalent of $T$ if the target is the ancilla qubit.) Alternatively, Aharonov gives us a way to convert 3 to 2, so the (2 to 1) step would be sufficient.
For reference, section 4 of this paper seems to make some steps related to achieving the (3 to 1) case, but in aiming for generality, pedagogy has perhaps fallen by the wayside slightly.
Update
I recently came across this paper which essentially gives a necessary and sufficient condition for a given single-qubit unitary to be expressible in terms of a finite sequence of $H$ and $T$ gates. Building similar results for the other gate sets (e.g. necessary and sufficient condition for creating a two-qubit gate from $H$ and $cS$) would be a rigorous way of resolving this question one way or another.
"
"['measurement', 'density-matrix']"," Title: How is measurement modelled when using the density operator?Body: I've just learned about the density operator, and it seems like a fantastic way to represent the branching nature of measurement as simple algebraic manipulation. Unfortunately, I can't quite figure out how to do that.
Consider a simple example: the state $|+\rangle$, which we will measure in the computational basis (so with measurement operator $I_2$). The density operator of this state is as follows:
$\rho = |+\rangle\langle+| = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} ⊗ \begin{bmatrix} \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \end{bmatrix}
= \begin{bmatrix} \frac 1 2 & \frac 1 2 \\ \frac 1 2 & \frac 1 2 \end{bmatrix}$
Since measuring $|+\rangle$ in the computational basis collapses it to $|0\rangle$ or $|1\rangle$ with equal probability, I'm imagining there's some way of applying the measurement operator $I_2$ to $\rho$ such that we end up with the same density operator as when we don't know whether the state is $|0\rangle$ or $|1\rangle$:
$\rho = \frac 1 2 \begin{bmatrix} 1 \\ 0 \end{bmatrix} ⊗ \begin{bmatrix} 1, 0 \end{bmatrix}
+ \frac 1 2 \begin{bmatrix} 0 \\ 1 \end{bmatrix} ⊗ \begin{bmatrix} 0, 1 \end{bmatrix}
= \begin{bmatrix} \frac 1 2 & 0 \\ 0 & 0 \end{bmatrix}
+ \begin{bmatrix} 0 & 0 \\ 0 & \frac 1 2 \end{bmatrix}$
From there, we can continue applying unitary transformations to the density operator so as to model a measurement occurring mid-computation. What is the formula for applying a measurement operator to the density operator? Looking in the Mike & Ike textbook section on the density operator, I only see the density operator measurement formula for a specific measurement outcome. I'd like to know the density operator measurement formula which captures all possible results of the measurement.
As a followup question, I'm also curious as to the formula when measuring some subset of multiple qubits.
"
"['quantum-state', 'algorithm', 'entanglement', 'orbital-angular-momentum']"," Title: What do ""hyperparallel algorithm"" and ""hyperentangled state"" mean?Body: What do the terms ""hyperparallel algorithm"" and ""hyperentangled states"" mean? I found it mentioned here[1]. In the abstract they say: ""Hyperentangled states, entangled states with more than one degree of freedom, are considered as a promising resource in quantum computation"", but I'm not sure they mean by ""degree of freedom"" in this context.
[1]: Quantum hyperparallel algorithm for matrix multiplication (Zhang et al., 2016)
"
"['classical-computing', 'terminology', 'applications', 'history']"," Title: What is quantum computing vs. what is not quantum computingBody: That is to say,
- what are some common or popular misconceptions about what constitutes quantum computing?
and
- how are those things misconceptions?
It could help in explaining to frame this while imagining as if you were explaining for a layperson, such as Sophie (your meek-and-kindly-but-fox-news-informed great-aunt twice-removed), who has asked you out of genuine curiosity after hearing it referenced in passing multiple times on TV, radio, etc.
Sophie isn't looking for a career in computing, never-mind quantum computing (She's a darned good seamstress herself), but does grok basic maths and logic despite her technologically simpler lifestyle.
Sophie would like to know some mildly political things; such as how and why we fund studies in quantum-computing, why quantum-computing is studied, what we're actually using it for, as well as some mildly technical things; such as why her regular computer isn't "quantum" since it computes "quantities", how quantum-computers are any faster than her Athlon XP with Windows 2000, why doing things the way we've done them in traditional computing isn't satisfactory by itself, and when she can get that quantum-pocket-calculator that answers her questions before she asks them.
Of note: I am not Sophie nor do I have any aunt Sophie (to the best of my knowledge anyways; quantum-aunts notwithstanding!).
I asked this question because I've read and heard a lot of random snippets of information on the topic, from which I have my own basic comprehension, but not an understanding which is strongly communicable to other people.
Being slightly more computer-informed than other people around am also asked to try and explain the topic of quantum-computing for laypeople.
Obviously I'm hardly an ideal teacher on the subject, but truncating conversations on the topic to the likes of "I know its not what you just described but I can't tell you how it's not that" never sits well with me, hence the rather arbitrary framing I offered.
"
['density-matrix']," Title: How do we derive the density operator of a subsystem?Body: The density operator can be used to represent uncertainty of quantum state from some perspective, aka a subsystem of the full quantum system. For example, given a Bell state:
$|\psi\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}$
where Alice has one qbit and Bob has the other, Bob does not know whether Alice has already measured her qbit and thus collapsed his to $|0\rangle$ or $|1\rangle$ (or $|+\rangle$ or $|-\rangle$ or whatever other basis Alice used). Thus we can write a density operator for the subsystem of Bob's qbit, which I believe would just be the maximally-mixed state:
$\rho = \begin{bmatrix} 1/2 & 0 \\ 0 & 1/2 \end{bmatrix}$
Given a multi-qbit system, how do we derive the density operator of some subsystem of those qbits? I'm interested in the answer for both a subsystem consisting of a single qbit and one consisting of some arbitrary subset of the qbits.
"
"['physical-qubit', 'solid-state', 'density-matrix']"," Title: Difference between coherence transfer, polarization transfer and population transfer?Body: I asked a question on Physics Stack Exchange but no one answered the question and I didn't get enough views on it. I am asking it on QCSE because the question is related to experimental quantum computation realized through NMR.
For an ensemble of identical atoms in a superposition state $|\phi\rangle=\alpha|S_z^+\rangle+\beta|S_z^-\rangle$ where $|\alpha|^2$ and $|\beta|^2$ are not equal(although $|\alpha|^2 + |\beta|^2 = 1$) and gives the populations of $|S_z^+\rangle$ and $|S_z^-\rangle$ respectively, we can drive a transition between the two basis states and we call this phenomenon as population transfer(please correct me if I am wrong). Mathematically, the field induced transitions changes the values of $|\alpha|^2$ & $|\beta|^2$.
However, there can be one more phenomenon going on here called
polarization transfer which is distinct from population transfer because polarization really counts the total spin magnetization of a state in the context of NMR and EPR and maybe Quantum Optics too.
Now the third phenomenon i.e. coherence transfer(no
classical analogue) can't occur between two states but needs three
level system say $|1\rangle$, $|2\rangle$ and $|3\rangle$ and the field driven transitions between states $|1\rangle$ & $|2\rangle$ and states $|1\rangle$ &
$|3\rangle$ somehow creates transition of states $|2\rangle$ &
$|3\rangle$ even though there is no driving field of frequency corresponding to $|2\rangle$ & $|3\rangle$ transition.
The last two phenomena written in bold are what I do not understand. Any insight into them will be very helpful
and mathematics over them will be highly appreciated. This link
also tries to explain the difference between population transfer,
polarization transfer and coherence transfer through density
matrices but I cannot see much physical explanation over the
phenomenon.
"
"['simulation', 'programming', 'q#']"," Title: How does one obtain amplitude information in Q#?Body: Is it possible to obtain amplitude information (in lexicographic ordering) for a particular qubit register in Q#?
For example, in the following code:
operation GetProbabilityAmplitude() : Double[]
{
body
{
mutable result = new Double[4];
using (register = Qubit[2])
{
H(register[0]);
CNOT(register[0], register[1]);
// ...put the amplitude doubles in the result array
}
return result;
}
}
The doubles in result should be {0.5,0.0,0.0,0.5}. I looked quite a bit for it in the documentation but couldn't find anything about getting the amplitudes.
"
"['resource-request', 'tensor-networks']"," Title: What are Tensor Networks and which is the relationship they have with quantum computing?Body: I have been active in this community a while and I repeatedly see questions and answers referring to the so-called Tensor Networks. That makes me wonder what are those elements are and what the motivation behind their construction is. References about where to look for the motivation and construction of those is sought in this question.
Additionally, an insight into the importance of these elements in the quantum computing and/or quantum communication paradigms would be helpful too, as the concept is found in this site in several places.
"
"['algorithm', 'physical-realization']"," Title: Do we really know how a universal quantum computer can be used to revolutionize the design of new drugs or materials?Body: One of the most promising applications of a quantum computing is the design of new drugs and materials:
Quantum computers promise to run calculations far beyond the reach of
any conventional supercomputer. They might revolutionize the discovery
of new materials by making it possible to simulate the behavior of
matter down to the atomic level.
source: MIT Technology Review - Will Knight - February 21, 2018
At this moment quantum computers are not powerful enough to do these calculations / simulations. So we have not yet the proper hardware for this.
But assuming we have today quantum computers that are powerful enough, do we know how to use them to revolutionize the design of better drugs and materials in some domains ?
So is the current obstacle for this revolution that we do not have yet the proper hardware (= powerful quantum computer) or are there actually 2 obstacles:
- having powerful quantum computer (hardware)
- knowing which quantum algorithms are needed (software)
"
"['entanglement', 'resource-request', 'spdc']"," Title: Photon Entanglement using SPDCBody: Are there any good references where from I can learn about photon entanglement using spontaneous parametric down-conversion (SPDC)?
"
"['quantum-gate', 'circuit-construction']"," Title: Classical XOR gate in Quantum CircuitBody: Can we use classical XOR gate in a quantum circuit? Or are there any alternatives for XOR gate?
"
"['quantum-gate', 'physical-qubit', 'experiment']"," Title: What is the significance of recent demonstration of a passive photon–atom qubit swap operation?Body: In reference to this recent nature article: https://www.nature.com/articles/s41567-018-0241-6
Specifically, does this warrant a new type of gate?
"
['quantum-operation']," Title: Image of a sum of positive operators contains the images of each individual operator?Body: In the proof of Proposition 2.52 of John Watrous' QI book, there is the statement that $\text{im}(\eta(a))\subset\text{im}(\rho)$, where $\rho=\sum_{i=1}^{N}\eta(i)$ is a sum of positive operators and $\rho$ has trace one.
I don't see $\text{im}(\eta(a))\subset\text{im}(\rho)$, could someone please help explain. Thanks!
"
"['quantum-gate', 'quantum-state']"," Title: Symmetry in Conditional Phase Shift Gates and Realizing CNOT through HCZHBody: Why are conditional phase shift gates, such as CZ, symmetrical? Why do both the control and target qubit pick up a phase?
Furthermore, assuming that they are symmetrical, when using a CNOT gate as an H gate on the target qubit, a CZ gate, and another H gate on the target qubit, wouldn't the CZ gate cause the control qubit to pick up a phase?
For example, if the control qubit is an equal superposition of $|0\rangle$ and $|1\rangle$ i.e. $|+\rangle$ and then this version of the CNOT gate is implemented, wouldn't the control qubit end up with a phase?
"
"['measurement', 'decoherence', 'ion-trap-quantum-computing']"," Title: Is there a classical limit to quantum computing?Body: Why are quantum computers scalable?
With the subjects of spontaneous collapse models and decoherence in mind, it seems to me that the scalability of quantum computers is something which is not only physically difficult to achieve but also theoretically.
Measurement
When a measurement is made, a quantum state, whose probability amplitude is a Gaussian function, becomes an eigenstate, whose probability is definite. This change from quantum state to eigenstate on measurement happens also to qubits which change to classical bits in terms of information.
Measurement, decoherence & quantum Darwinism
From the work of Zurek one starts to see the environment as a valid observer and indeed one that makes measurments. Within this view, how can we have scalable quantum computers if many-qubit systems create more and more decoherence and as such, from my current understanding, inevitably reduce such a system of qubits to a system of eigenstates.
Is there an upper bound to quantum computing?
If the train of thought I am following is correct than shouldn't there be an upper bound to the number of qubits we can have without them (all, the whole system) being reduced to eigenstates, classical states.
I get the feeling that what I am saying is incorrect and I am fundamentally misunderstanding something. I'd really appreciate it if you could tell me why my argument is wrong and point me in the direction of understanding why quantum computers are theoretically scalable.
An example with ion trap quantum computers
Within this set up, the information is encoded within the energy levels of ions with a shared trap. Given that the ions are all within the shared trap then interactions are bound to occur given scaling within such a shared trap, or at least that's what my intuition says. Do we overcome this by having multiple traps working say in tandem?
1 - Zurek's Decoherence, einselection, and the quantum origins of the classical
"
"['physical-realization', 'performance', 'scalability']"," Title: How scalable are quantum computers when measurement operations are considered?Body: From a high-level point of view, given a quantum program, typically the last few operations are measurements.
In most cases, in order to extract a useful answer, it is necessary to run multiple times to reach a point where it is possible to estimate the probability distribution of the output q-bits with some level of statistical significance.
Even when ignoring noise, if the number of q-bits of the output increases, the number of required runs will increase too. In particular, for some output probability distributions it is likely that the number of required samples can be very high to obtain some sensible statistical power.
While increasing the number of q-bits seems to indicate an exponential growth, the number of measurements required (each run taking x nanoseconds) seem to limit how will quantum computation do scale.
Is this argument sensible or there is some critical concept that I am missing?
"
"['algorithm', 'measurement', 'error-correction', 'povm']"," Title: What is the Helstrom measurement?Body: I have been reading the paper Belief propagation decoding of quantum
channels by passing quantum messages by Joseph Renes for decoding Classical-Quantum channels and I have crossed with the concept of Helstrom Measurements.
I have some knowledge about quantum information theory and quantum error correction, but I had never read about such measurement until I worked on that paper. In such article, the author states that the measurement is optimal for this decoding procedure, so I would like to know what are such kind of measurements and how can they be done.
"
"['resource-request', 'models']"," Title: What good references would you recommend to understand the (continuous-variable) CV model of computation?Body: If you have good references about the CV model that are understandable from a computer science background, that would be great. If they include numerical examples, that would even be better.
"
"['algorithm', 'machine-learning', 'applications', 'quantum-enhanced-machine-learning']"," Title: Are there any examples of anyone applying quantum algorithms to problems in computational biology?Body: As the title suggests, I'm searching for published examples of quantum algorithms being applied to problems in computational biology. Clearly the odds are high that practical examples don't exist (yet) – what I'm interested in is any proof of concepts. Some examples of computational biology problems in this context would be:
- Protein Structure Prediction (Secondary, Tertiary)
- Drug-Ligand Binding
- Multiple Sequence Alignment
- De-novo Assembly
- Machine Learning Applications
I've found only one such reference that I think is illustrative of what I'm looking for. In this research, a D-Wave was used for transcription factor binding, however, it would be interesting to have examples outside the realm of adiabatic quantum computing.
There are several in terms of quantum simulation. While they clearly aren't simulations at a scale often considered to be biologically relevant, one could imagine that this line of research is a precursor to modeling larger molecules of biological significance (among many other things).
So, aside from transcription factor binding and quantum simulation, are there any other proof of concepts that exist and are relevant to biology?
Update I: I’ve accepted the best answer so far but I’ll be checking in to see if any more examples come up. Here's another I found, somewhat old (2010), that aimed at demonstrating identification of low energy protein conformations in lattice protein models – also a D-Wave publication.
Update II: A table in this paper covers some existing applications, most using quantum annealing hardware.
"
['superconducting-quantum-computing']," Title: Superconducting qubit researchers: Do your TLS's move?Body: I have a superconducting system with tens of qubits, each of which can be tuned using DC flux.
One of the main tasks for coherent manipulation of the qubits is to find good idling frequencies and operating points for entangling gates. This effort is confounded by two-level systems (TLS), which cause rapid energy relaxation, and wreak general havok on coherent manipulation.
I spent a long time finding a good set of idling frequencies and operating points, all the while considering the locations of the TLS's, and then one day I came in the the lab and they had moved around! I had to start all over again.
I want to learn more about how and why TLS's move, and whether it's possible to maybe control the movement. As part of my research, I want to poll the community and see what other people's experience with this problem is like.
"
['tensor-product']," Title: Tensor product between operatorsBody: If the state of one qubit can be described by a ray in $\mathbb{C}^2$, then the combined state of an $n$-qubit system can be described by a ray in $(\mathbb{C}^2)^{\otimes n}=\mathbb{C}^{2 n}$.
However, if $G_1$ is the Pauli group of one qubit, with the 16 elements
$$G_1=\{i,-1,-i,1\}\times\{I,X,Y,Z\}\,,$$
the Pauli group on $n$ qubits is defined by
$$G_n=\{i,-1,-i,1\}\times\{I,X,Y,Z\}^{\otimes n}$$
which not the tensor product of $n$ Pauli groups $G_1$ (because $G_n$ contains $4\cdot 4^n$ elements, which does not equal $16^n$). My question thus is: what kind of tensor product do we use on the space of operators on a Hilbert space $\mathbb{C}^2$, to define $G_n$ using $G_1$?
(I do understand intuitively that we should disregard global phase (and that therefore the number of operators in the $n$-qubit Pauli group is not $16^n$), and that this can be done by introducing the projective Hilbert space, but how do tensor products work on the space of operators on a projective Hilbert space?)
"
"['entanglement', 'density-matrix', 'non-locality']"," Title: Is there a relation between the factorisation of the joint conditional probability distribution and Bell inequality?Body: [I'm sorry, I've already posted the same question in the physics community, but I haven't received an answer yet.]
I'm approaching the study of Bell's inequalities and I understood the reasoning under the Bell theorem (ON THE EINSTEIN PODOLSKY ROSEN PARADOX (PDF)) and how the postulate of locality was assumed at the start of the demonstration.
However, I find problematic to arrive at the equivalence
$$ E(\vec{a},\vec{b}) = \int_{\Lambda}d\lambda \rho(\lambda)A(\vec{a},\lambda)B(\vec{b},\lambda),$$
starting from the point of view expressed by the Clauser and Horne definition of locality.
CH claimed that a system is local if there is a parameter $\lambda$ and a joint conditional probabilities that can be written as follows:
$$p(a,b|x,y,\lambda) = p(a|x,\lambda)p(b|y,\lambda),$$
and $$p(a,b|x,y) = \int_\Lambda d\lambda \rho(\lambda) p(a|x,\lambda)p(b|y,\lambda)$$
which make sense since it affirms that the probability of obtaining the value $a$ depends only on the measument $x = \vec{\sigma}\cdot\vec{x} $ and the value of $\lambda$.
However, if I use this expression to write down the expectation value of the products of the two components $\vec{\sigma}\cdot\vec{a}$ and $\vec{\sigma}\cdot\vec{b}$, I obtain as follows:
$$
E (\vec{a},\vec{b}) = \sum_{i,j}a_ib_jp(a,b|x,y) = \\
= \sum_{ij}a_ib_j \int_\Lambda d\lambda \rho(\lambda) p(a|x,\lambda)p(b|y,\lambda) \\
= \int_\Lambda d\lambda \rho(\lambda) (\sum_{i}a_ip(a|x,\lambda))(\sum_{i}b_ip(b|y,\lambda))
$$
where in the last equivalence I've used the fact that if the measument are independent their covariance must be equal to $0$.
At this point, the terms in the RHS in the brackets are equal to:
$$ (\sum_{i}a_ip(a|x,\lambda)) = E(a,\lambda) =? = A(\vec{a},\lambda)\quad \quad (\sum_{i}b_ip(b|y,\lambda)) = E(b,\lambda) =?= B(\vec{b},\lambda).$$
That is not the equivalence that I want to find.
In fact in the RHS of the first equation $A(\vec{a},\lambda)$ is, according to Bell original article, the result of measure $\vec{\sigma}\cdot\vec{a}$, and fixing both $\vec{a}$ and $\lambda$ it can assume only the values of $\pm1$. (The same is applied for $B(\vec{b},\lambda)$.)
Some of you knows, where I fail? How can I obtain the original equivalence (that then is proved to be violate in the case of an entangled system) starting from the CH definition of reality?
Edit #1:
I've noted that I obtain the wanted equivalence only if I assume that $p(ab|xy\lambda) = E(\vec{a}\vec{b})$, but is it possible? How can a conditional probability be linked to the mean value of the product of two components?
Edit #2:
Surfing the internet I found an article (https://arxiv.org/abs/1709.04260, page 2, right on the top) which reports the same CH's local condition (to be accurate, the article presents the discrete version) and then affirm that:
Blockquote
""The central realization of Bell’s theorem is the fact that there are quantum correlations obtained by local measurements ($M_a^x$ and $M_b^y$) on distant parts of a joint entangled state $\varrho$, that according to quantum theory are described as:
$$p_{Q}(a,b,|x,y) = \text{Tr}(\varrho(M_a^x\otimes M_b^y) $$
and cannot be decomposed in the LHV form (i.e. The CH condition for locality)""
So why $p_Q(a,b|x,y)$ is seen as a measure of quantum correlation (that for definition is the mean of the product of the possible output)? It isn't a joint probability distribution (as stating while obtaining the LHV form)?
Is there a link between the classical correlation ($E(\vec{a},\vec{b})$) and the joint probability distribution $p(a,b|x,y,\lambda)$?
"
"['physical-realization', 'architecture']"," Title: Randomness from deterministic machineBody: It is known that in a classical computer we can't generate a purely random number by deterministic process. I am taking a course in Quantum Computing, recently I learnt that using state we can generate a deterministic process which will produce random number $|0\rangle$ and $|1 \rangle $. But, I am not aware of the physical implementation and very excited to know about it. I have searched online and got this paper, but this needs knowledge of architecture inside QC I think.
Can anyone explain(from basic please) how we can develop a deterministic process to generate $|0\rangle$ and $|1 \rangle $ random-ly? Also explain please how that process is a deterministic one.
"
"['circuit-construction', 'resource-request', 'teleportation']"," Title: Generalization for $n$ quantum teleportationsBody: In Breaking Down the Quantum Swap, it is stated:
Thanks to the CNOT, we can implement a xor-swap on a quantum computer. All we need to do is chain three CNOTs back and forth.
In a comment to a previous question, the author of the aforementioned post states:
The quantum equivalent of the one time pad (i.e. xoring a message with a secret key) is quantum teleportation.
Near the end of the post there is this circuit graphic
& it is also stated:
I would go into detail about how this works, but honestly it's just two quantum teleportations shoved together and this post is already way too long.
Can someone provide more detail on just two quantum teleportations?
Is there a generalization for $n$ quantum teleportations?
"
['programming']," Title: Which programming language is suitable for a beginner?Body: I understand there are a lot of programming languages (e.g. Q#, Qiskit, etc.)
Which one is suitable for someone that just started learning programming and doesn't know anything about quantum mechanics?
"
"['cryptography', 'communication', 'bb84']"," Title: How many bits do Alice and Bob needs to compare to make sure the channel is secure in BB84?Body: I was trying to self-study qmc by reading the Quantum Computing A Gentle Introduction book, in section 2.4 it talks about the quantum key distribution protocol BB84. After (I thought) I understood it I went to work on exercise 2.9 and 2.10.
Ex. 2.9 is asking how many bits do Alice and Bob need to compare to be 90% confident that there is no Eve present in BB84. So if I understood correctly, BB84 is as follows:
- Alice randomly chooses a basis/polarization of photon from the two bases $\{ | 0 \rangle, | 1 \rangle \}$ and $\{ |+\rangle, |-\rangle \}$ to encode the bit information $0$ or $1$ (the encoding rule is known e.g. $|0\rangle$ represents $0$). Then she sends a sequence of such photons to Bob.
- Bob receives the sequence of photons and randomly chooses a basis from the two same bases and measures for each one of the photon.
- They then compare the bases they chose and discard the ones where they chose base differently. Bob should be able to figure out what bit Alice is trying to send. (e.g. if the base they use is $\{ |0\rangle, |1\rangle \}$ and Bob has measured using the basis $|1\rangle$ but got $0$ light intensity then he knows that Alice's polarization was $|0\rangle$ so the bit information is $0$).
- To be more secure, they also compare a subset of bits, if there is no interference then their bits should all agree. They discard these bits and what left is the key.
Eve, on the other hand, is trying to intercept the photon from Alice, measures it randomly from the two bases too, then she sends the basis she uses for measurement to Bob. After Alice & Bob publicly compare their bases, Eve can know $25%$ of the key for sure, although she inevitably changed the photon Bob would have received.
So to answer the first question ex. 2.9, I listed out different scenarios when Alice and Bob compare a subset of bits :
Suppose Alice sends a $|0\rangle$,
- There is $0.25$ probability Eve also measures with $|0\rangle$, then she would not get detected.
- $0.25$ - Eve measures using $|1\rangle$ then she would get detected for sure as Bob will get the opposite bit value as Alice.
- $0.25$ chance Eve measures using $|+\rangle$, Bob now will receive $|+\rangle$, then if Bob uses $|0\rangle$ and obtain the same with $0.5$ chance, else if he uses $|1\rangle$ to measure but still end up with the correct bit with $0.5$ chance. That is $0.25 \times (0.5 + 0.5) = 0.25$
- Same as 3, 0.25
So to sum up the probability Eve would go undetected, it's $0.25 + 0 + 0.25 + 0.25 = 3/4$, and we want the sequence of bits Eve goes undetected be less than $10%$, which yields $(\frac{3}{4})^n < 0.1$, approximately $n=8$.
The second question 2.10c, modifies the condition a little bit, instead of Eve chooses from the two known bases (the standard and the $+/-$), she does not know which to choose so she chooses randomly, then how many bits A&B needs to compare to have 90% confidence?
My approach is that, suppose Alice still uses standard base $\{|0\rangle |1\rangle \}$ and she sends a $|0\rangle$. Now Eve can measure it in her base $\{ |e_1\rangle, |e_2\rangle \}$ where
$|e_1\rangle = \cos\theta|0\rangle + \sin\theta|1\rangle$ and $|e_2\rangle = \sin\theta|0\rangle-\cos\theta|1\rangle$, then Eve sends off the basis she uses to Bob again. I'm again listing out the scenarios,
- If Eve measures with $|e_1\rangle$ (with 0.5 chance) then Bob receives $|e_1\rangle$, then if Bob measures with $|0\rangle$ then he gets correct bit with $|\cos\theta|^2$ probabiltity, if he measures in $|1\rangle$ then he gets correct bit with $1 - |\sin\theta|^2=|\cos\theta|^2$. Simiarly when Eve uses $|e_2\rangle$
sum up then I got $0.5\times(2|\cos\theta|^2)+0.5\times(2|\sin\theta|^2)=1$, this for sure is not correct!
Then I tried to search online and found a solution here, where it says the probability Bob gets correct bit is instead: $|\langle0|e_1\rangle\langle e_1|0\rangle|^2 + |\langle0|e_2\rangle\langle e_2|0\rangle|^2 =\cos^4\theta+\sin^4\theta$, then integrate over $[0, \frac{\pi}{2}]$ (normalized by $\pi/2$) is $\frac{3}{4}$ which is again same as in ex2.9.
Can someone explain why it's $\cos^4\theta+\sin^4\theta$ in both math details and high-level intuition (e.g. why even Eve does not know which base to use it still requires 8 bits comparison for A&B?)?
Thanks a lot!
"
['quantum-state']," Title: How is Quantum Mechanics (a Physics Concept) used in computing?Body: I've been taking a course on Quantum Mechanics in which, right now, I'm learning about its application in Computing to give Quantum Computing.
Quantum Mechanics is a concept that is applied to microscopic particles explaining their motion, behaviour etc. in the microscopic (quantum world). How is this correlated to computing? They seem entirely different things.
"
['quantum-state']," Title: What's the physical significance of |0⟩ and |1⟩?Body: The word 'state' makes sense in Quantum Mechanics. In classical computers, numbers are represented in binary as a series of 0s and 1s. It seems that the word 'state' extracted from QM and the 0s and 1s extracted from Computing are put together to make $\lvert 0\rangle$ and $\lvert 1\rangle$. This doesn't make sense. What's the physical significance behind that representation?
"
"['error-correction', 'stabilizer-code']"," Title: Compact way of describing the set of all stabilizer groups for fixed number of physical qubits and encoded logical qubitsBody: Fix $n$, the number of qubits and $k$, the number of encoded logical qubits. We can find a set of $(n-k)$ operators that all mutually commute and moreover form a group $S$. Let's assume that the group $S$ is a subgroup of the Pauli group. We can use these operators to fix a $2^{n-k}$ vector space.
Now consider all the stabilizer groups $S_i$ formed this way, encoding $k$ qubits in $n$, and consider the set $\mathcal{S}= \{S_i \, \vert\, i=1 \ldots N\}$, where $S_i$ is a specific stabilizer group that stabilizes some $2^{n-k}$ dimensional vector space. How can I explicitly parametrize this set? For example: for $n=3$ and $k=1$, we could have $S_1 = \langle Z_1Z_2, Z_2 Z_3\rangle $ and $S_2 = \langle X_1X_2, X_2 X_3\rangle $, and so forth for other distinct stabilizer groups.
One possible way to a solution is to consider the parity check matrix for a specific $S_i$, and then ask what group action we could define will on the parity check matrix of $S_i$ to produce the parity check matrix for any other stabilizer group of the same cardinality. But I don't know how such a group would act on the stabilizer group. In my example for $(n,k) = (3,1)$ above, for example, I can change $S_1$ to $S_2$ by conjugating by a Hadamard, and I think this corresponds to a right multiplication of some $2n \times 2n $ matrix on the parity check matrix.
Because of this example, I am tempted to think that what I require is conjugation by either the whole Clifford group or a subgroup of it to act by conjugation of the $S_i$, and that will correspond to a symplectic $(2n \times 2n)$ matrix acting on the parity check matrices. In that case, the set $\mathcal{S}$ is parametrized by fixing a specific stabilizer group $S_i$ and acting on it by conjugation by a unitary representation of the Clifford group or subgroup. Is this close?
"
"['physical-qubit', 'physical-realization', 'architecture']"," Title: Are qubits the only elements required to build a quantum computer?Body: The power of a quantum computer is often described in terms of how many qubits it has. Does that mean that quantum computers can be run using only qubits, and nothing more? Wouldn't we require some kind of quantum RAM or quantum hard drive for a fully functional quantum computer?
"
"['programming', 'qiskit']"," Title: How to install qiskit in spyder editor?Body: I am working in Anaconda using spyder editor.
Can anyone tell me how to install qiskit in spyder?
"
"['resource-request', 'research']"," Title: What is a list of research journals publishing quantum computing articles?Body: Can anyone give me a list of different research journals that has quantum computing articles that I can use.
"
['ibm-q-experience']," Title: How can I get access to IBM Q 20 Tokyo and IBM Q 20 Austin?Body: How can I get access to IBM Q 20 Tokyo and IBM Q 20 Austin?
In the Q- experience site there is written that the access is for IBM clients only and in the profile there is a ""promotional code"" that you need to put to gain access to those chips.
How I became a IBM Q client and get this promotional code?
"
"['programming', 'qiskit', 'error-correction', 'ibm-q-experience']"," Title: How to deal with -LookupError: backend ""ibmqx4"" is not found?Body: I am using Jupyter notebook to write and running my qiskit codes (python 3.6)
and every time I encounter the message: LookupError: backend ""ibmqx4"" is not found, right now the ibmqx4 computer is not in maintenance and it running well.
I tried to regenerate Apitoken in the advanced option and make correspondingly the file Qconfig.py but the message still appears.
look at the example for a code that I write:
import numpy as np
import matplotlib.pyplot as plt
import qiskit as qk
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, register
import Qconfig
batch = []
n=50
t=450
// we defining n similar quantum circuits
for j in range(1,n+1):
q = QuantumRegister(1)
c = ClassicalRegister(1)
qc = QuantumCircuit(q, c)
qc.x(q)
qc.barrier()
// we decide the pausing time of the system be t*Gate Time
for i in range(t):
qc.iden(q)
qc.measure(q,c)
//we append every circuit we create to batch so batch is like a list of n
circuits
batch.append(qc)
// we executing all the n circuits and for each we run 1024 shots
shots = 1024
job = execute(qc,'ibmqx4',shots=shots)
and I get the output from the last row:
---------------------------------------------------------------------------
LookupError Traceback (most recent call last)
<ipython-input-38-a89f2171589f> in <module>()
1 # we executing all the n circuits and for each we run 1024 shots
2 shots = 1024
----> 3 job = execute(qc,'ibmqx4',shots=shots)
~\Anaconda3\envs\QISKit\lib\site-packages\qiskit\wrapper\_wrapper.py in execute(circuits, backend, config, basis_gates, coupling_map, initial_layout, shots, max_credits, seed, qobj_id, hpc, skip_transpiler)
270 # pylint: disable=missing-param-doc, missing-type-doc
271 if isinstance(backend, str):
--> 272 backend = _DEFAULT_PROVIDER.get_backend(backend)
273 qobj = compile(circuits, backend,
274 config, basis_gates, coupling_map, initial_layout,
~\Anaconda3\envs\QISKit\lib\site-packages\qiskit\wrapper\defaultqiskitprovider.py in get_backend(self, name)
29
30 def get_backend(self, name):
---> 31 name = self.resolve_backend_name(name)
32 for provider in self.providers:
33 try:
~\Anaconda3\envs\QISKit\lib\site-packages\qiskit\wrapper\defaultqiskitprovider.py in resolve_backend_name(self, name)
218
219 if resolved_name not in available:
--> 220 raise LookupError('backend ""{}"" not found.'.format(name))
221
222 return resolved_name
LookupError: backend ""ibmqx4"" not found.
please help me to solve this repetitive bug...
"
"['entanglement', 'graph-states']"," Title: How to calculate the number of ebits in a graph state?Body: Given an arbitrary graph state $|G\rangle$ represented by the graph $G$, can one use the graphical structure to calculate the number of ebits (entanglement bits) present in the state?
If so, how?
"
"['unitarity', 'no-cloning-theorem']"," Title: What do they mean by ""qubit can't be copied""?Body: What does it mean by ''qubit can't be copied'' ?
In a note, it is saying that:
Copying a qubit means $$U|\psi\rangle_A|0\rangle_B=|\psi\rangle_A|\psi\rangle_B$$
i.e; applying a unitary transformation on the qubit state. It is explained as, if the copy operation is possible then there will be a unique unitary matrix $U$ which will work on all qubit state, and then shown that existence of such $U$ is not possible.
I am not getting how it can be written in such a way, unitary matrix $U$ will operate on $|\psi\rangle_A$ only I think, how it can copy it to second $|0\rangle$ state?
Secondly, why we are making the assumption that, "if such unitary matrix exists then that will be a unique unitary matrix which will work on all qubit states" why we can't use different unitary matrix to copy different qubit state(if possible, as $|+\rangle$ can't be copied)?
E.g, we can copy $|0\rangle_A$ to another state $|0\rangle_B$ $$U|0\rangle_A=|0\rangle_B\\U|1\rangle_A=|1\rangle_B$$
as classical bit can be copied, it is possible to find such $U$.
"
"['programming', 'measurement', 'q#']"," Title: How to measure in an arbitrary basis in Q#?Body: Q# has a measurement operator defined as follows according to the docs:
operation Measure (bases : Pauli[], qubits : Qubit[]) : Result
Where you give a Pauli gate $\{I, \sigma_x, \sigma_y, \sigma_z\}$ as a measurement operator and the qbit is projected onto its eigenvectors.
How can I measure in an arbitrary basis? I know conceptually what I have to do is first rotate my state vector by some amount then measure in one of the Pauli bases, but what are the actual primitive gates and parameters I would use to do that? For example, say I wanted to measure in the following basis:
$\begin{bmatrix} \frac{\sqrt{3}}{2} \\ \frac 1 2 \end{bmatrix}, \begin{bmatrix} \frac{-1}{2} \\ \frac{\sqrt{3}}{2} \end{bmatrix}$
So basically the computational basis but rotated $\pi/6$ radians counter-clockwise around the unit circle.
"
"['resource-request', 'research']"," Title: Quantum Computing Research Papers, on puzzles or game theoryBody: Are there any research papers focused on implementing a game/puzzle or game theory in Quantum Computing.
"
"['architecture', 'classical-computing', 'quantum-memory']"," Title: Can a stored programming model be applied to a Quantum Computer?Body: A stored programming computer model is that where a central memory is used to store both instructions and data that they operate on. Basically all the classical computers of today that follow the von Neumann architecture use the stored programming model. During program execution the CPU reads instructions or data from the RAM and places it in the various registers such as Instruction Register (IR) and other general purpose registers.
My question is whether such a stored programming model is applicable to a Quantum Computer or not, since because of the no-cloning theorem it is not possible to clone any arbitrary quantum state.
It means that if we have some qubits in some state stored in a memory register then because of the no-cloning theorem the Quantum Computer processor will not be able to read or copy those qubits from the memory to some internal registers.
"
"['algorithm', 'quantum-gate', 'circuit-construction', 'gate-synthesis']"," Title: Decomposition of arbitrary 2 qubit operatorBody: As you know, universal quantum computing is the ability to construct a circuit from a finite set of operations that can approximate to arbitrary accuracy any unitary operation.
There also exist some results proving that exact decompositions of particular unitary operations can be found. For instance, a method was provided here (see section V) to construct a quantum circuit for a general two-qubit gate, based on the method given by Kraus and Cirac to decompose any desired two-qubit gate.
I want to understand this method such that I learn how to find the
quantum circuit implementing any $4\times4$ unitary matrix. To help
with that, I devised the following challenge: You are given an unitary
matrix, $U$, over two qubits and asked to follow either the previously
mentioned methods or another method you know about to come up with
the quantum circuit implementing this unitarity. I know what one circuit
representation is because I built it myself to obtain this matrix.
Our goal should be to find the decomposition with the fewer number
of gates, however, other decomposition methods will also be useful to learn. Here's the matrix
$$
U\left(x\right)=\left(\begin{array}{cccc}
0 & \left(-\frac{1}{2}+\frac{i}{2}\right)e^{ix/2} & 0 & \left(\frac{1}{2}+\frac{i}{2}\right)e^{ix/2}\\
0 & \frac{ie^{-ix/2}}{\sqrt{2}} & 0 & -\frac{e^{-ix/2}}{\sqrt{2}}\\
\left(-\frac{1}{2}-\frac{i}{2}\right)e^{-ix/2} & 0 & \left(\frac{1}{2}-\frac{i}{2}\right)e^{-ix/2} & 0\\
-\frac{e^{ix/2}}{\sqrt{2}} & 0 & \frac{ie^{ix/2}}{\sqrt{2}} & 0
\end{array}\right)
$$
If you are aware of any numerical methods that can achieve this task
I also encourage you to post the solution you find and the steps to
find it. E.g., as answered at another question on this site, qubiter
has a module which apparently can decompose any n-qubit unitary into
cnots and single qubit rotations using the cosine-sine decomposition,
and this is probably not the only numerical method looking into this
problem.
I believe an exhaustive exploration of these methods will be a helpful
reference to a big audience, but let us start simple: can you give
a circuit decomposition for $U\left(x\right)$?
Universal gate set:
You may consider the following set of basic gates: hadamard ($H$), phase ($S$), $\pi/8$ rotation ($T$), $cX$, $S^{\dagger}$, $T^{\dagger}$, and rotations
$$
R_{x}\left(\theta\right)=\left(\begin{array}{cc}
\cos\left(\frac{\theta}{2}\right) & -i\sin\left(\frac{\theta}{2}\right)\\
-i\sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right)
\end{array}\right),\quad R_{y}\left(\theta\right)=\left(\begin{array}{cc}
\cos\left(\frac{\theta}{2}\right) & -\sin\left(\frac{\theta}{2}\right)\\
\sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right)
\end{array}\right),\quad R_{z}\left(\theta\right)=\left(\begin{array}{cc}
e^{-\frac{i\theta}{2}} & 0\\
0 & e^{\frac{i\theta}{2}}
\end{array}\right)
$$
With an eye on a real implementation, you may also consider IBM QX universal gate set made of a $cX$ together with one-qubit rotational and phase gates
$$
\begin{split}V_{1}(\lambda) & =\begin{pmatrix}1 & 0\\
0 & e^{i\lambda}
\end{pmatrix}\\
V_{2}(\phi,\lambda) & =\frac{1}{\sqrt{2}}\begin{pmatrix}1 & -e^{i\lambda}\\
e^{i\phi} & e^{i(\lambda+\phi)}
\end{pmatrix}\\
V_{3}(\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}
\end{split}
$$
Actually, $V_{1}$ and $V_{2}$ are just special cases of $V_{3}$, hence IBM's universal set can be reduced to just two gates.
Example:
Suppose you wanted to find the circuit implementation for an unitarity $U\left(x,y\right)$ given by the following matrix
$$
\left(\begin{array}{cccc}
e^{-\frac{1}{2}i\pi y}\cos\frac{x}{2} & 0 & 0 & -e^{-\frac{1}{2}i\pi y}\sin\frac{x}{2}\\
0 & -ie^{\frac{i\pi y}{2}}\sin\frac{x}{2} & -ie^{\frac{i\pi y}{2}}\cos\frac{x}{2} & 0\\
\sqrt[4]{-1}e^{-\frac{1}{2}i\pi y}\sin\frac{x}{2} & 0 & 0 & \sqrt[4]{-1}e^{-\frac{1}{2}i\pi y}\cos\frac{x}{2}\\
0 & -(-1)^{3/4}e^{\frac{i\pi y}{2}}\cos\frac{x}{2} & (-1)^{3/4}e^{\frac{i\pi y}{2}}\sin\frac{x}{2} & 0
\end{array}\right)
$$
You can check $U\left(x,y\right)$ can be decomposed into the following
product of operations
$$
U\left(x,y\right)=\left(T\otimes S^{\dagger}\right)\cdot CNOT_{01}\cdot\left(R_{y}\left(x\right)\otimes R_{z}\left(y\pi\right)\right)\cdot CNOT_{10}
$$
and the circuit representation is
"
"['algorithm', 'programming', 'q#']"," Title: How to add two integers in Q#?Body: I have programmed in C++, but I am interested in writing quantum programs. I have some experience with Microsoft's Q#, and I know about the canonical Shor's and Grover's algorithms.
Can anyone tell me how to write a quantum program to add two integers?
"
"['foundations', 'games']"," Title: What exactly are Quantum XOR Games?Body: I have done some research & found a few different papers that discuss xor games (classic & quantum). I am curious if someone could give a concise introductory explanation as to what exactly xor games are & how they are or could be used/useful in quantum computing.
"
"['error-correction', 'resource-request']"," Title: EA-Turbo simulation packageBody: I am working with the quantum turbo codes presented in this paper by Wilde, Hsieh and Babar, and it is claimed that a package to simulate such codes is available at ea-turbo. However, the hyperlink to such package appears to be broken, and so I have not been able to reach that.
I would like to know if anyone around knows another link to get such package, or it by any chance has the package, if he could share it so that other people can work with such codes in an easier way.
EDIT:
It looks like a package containing the version used by the authors for a previous paper on the topic where a simpler decoder is used can be downloaded from the link presented in the answer by user1271772. I discovered such fact by reading the README file that such file contains. It would be very useful to know if newer versions (looks like the broken link that I was talking about in the questions refers to a second version of the package) can be obtained too.
"
['quantum-fourier-transform']," Title: Quantum Fourier Transform on two qubits: Non orthogonal outputsBody: We know the QFT gives us a new orthogonal basis from the original one, however, when I apply it on two qubits, I am not getting the output vectors orthogonal.
$|out(k)\rangle = \Sigma^{N-1}_{j=0} e^{\frac{2\pi ij.k}{N}}|j\rangle$
Where $j.k$ is the bitwise 'AND' and then summed up.
Applying this on the basis:
$|00\rangle , |01\rangle , |10\rangle , |11\rangle$
I get the following vectors (ignore normalization factor):
$|00\rangle + |01\rangle + |10\rangle + |11\rangle$
$|00\rangle + i|01\rangle + |10\rangle + i|11\rangle$
$|00\rangle + |01\rangle - |10\rangle - |11\rangle$
$|00\rangle + i|01\rangle + |10\rangle -i|11\rangle$
However these are not orthogonal, as you can see, the dot product does not equal zero for the first and second vector.
Why is this the case?
"
"['quantum-state', 'physical-qubit']"," Title: How do we physically initialize qubits in a Quantum register?Body: In quantum algorithms we need to initialize the qubits at the start of our algorithm in some quantum register. Suppose that if we are working with a four qubit quantum register we can initialize the register into values such as $|0000\rangle$ or another value such as $|0101\rangle$, which means that the first and third qubits are in basis $|0\rangle$ state and the second and fourth qubits are in basis $|1\rangle$ state. Once we have initialized these qubits as such we can then proceed to apply various quantum gates on them.
My question is that in a physical quantum computer (not a simulator) where say we represent qubits with electron spin, how do we manupulate such electrons so that we can initialize a Quantum register, say with the value $|0101\rangle$?
"
"['programming', 'tensor-product']"," Title: Confusion over tensor products in sympy.physics.quantum.qubit (in Python)Body: I am working with sympy.physics.quantum.qubit to help teach myself more about quantum computing.
I'm confused about how best to simplify two ket expressions that appear to me to be identical. Seems to me that B and C below should be the same:
B = Qubit('01')
C = TensorProduct(Qubit('0'),Qubit('1'))
because their representation is identical, i.e.
B.represent() == C.represent() #returns True
it feels like they are the same qubit state. So far, so good.
But now when I print out B and C I get:
print(""B is"", B)
B is |01>
but
print(""C is"", C)
C is |0>x|1>
My question:
Is there some way I could get the Python library to use the output of B and C so that the equivalence between the two would be obvious? Basically, how do I get C to simplify it's output so that it exactly resembles B?
Am grateful for any help you could provide.
"
['gate-synthesis']," Title: Decomposition of an arbitrary 1-qubit gate into a specific gatesetBody: Any 1-qubit special gate can be decomposed into a sequence of rotation gates ($R_z$, $R_y$ and $R_z$). This allows us to have the general 1-qubit special gate in matrix form:
$$
U\left(\theta,\phi,\lambda\right)=\left(\begin{array}{cc}
e^{-i(\phi+\lambda)}\cos\left(\frac{\theta}{2}\right) & -e^{-i(\phi-\lambda)}\sin\left(\frac{\theta}{2}\right)\\
e^{i(\phi-\lambda)}\sin\left(\frac{\theta}{2}\right) & e^{i(\phi+\lambda)}\cos\left(\frac{\theta}{2}\right)
\end{array}\right)
$$
If given $U\left(\theta,\phi,\lambda\right)$, how do I decompose it into any arbitrary set of gates such as rotation gates, pauli gates, etc?
To make the question more concrete, here is my current situation: for my project, I am giving users the ability to apply $U\left(\theta,\phi,\lambda\right)$ for specific values of $\theta$, $\phi$ and $\lambda$ to qubits.
But I am targeting real machines that only offer specific gates. For instance, the Rigetti Agave quantum processor only offers $R_z$, $R_x\left(k\pi/2\right)$ and $CZ$ as primitive gates.
One can think of any $U\left(\theta,\phi,\lambda\right)$ as an intermediate form that needs to be transformed into a sequence of whatever is the native gateset of the target quantum processor.
Now, in that spirit, how do I transform any $U\left(\theta,\phi,\lambda\right)$ into say $R_z$ and $R_x\left(k\pi/2\right)$? Let us ignore $CZ$ since it is a 2-qubit gate.
Note: I'm writing a compiler so an algorithm and reference papers or book chapters that solve this exact problems are more than welcome!
"
"['resource-request', 'qutrit', 'state-space-geometry']"," Title: Geometry of qutrit and Gell-Mann matricesBody: I need some useful sources about the geometry of qutrit. Specifically related to the Gell-Mann matrix representation.
"
"['quantum-gate', 'mathematics', 'gate-synthesis']"," Title: How to derive the CNOT matrix for a 3-qubit system where the control & target qubits are not adjacent?Body: In a three-qubit system, it's easy to derive the CNOT operator when the control & target qubits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in the untouched qubit's position of significance:
$$C_{10}|\phi_2\phi_1\phi_0\rangle = (\mathbb{I}_2 \otimes C_{10})|\phi_2\phi_1\phi_0\rangle.$$
However, it isn't obvious how to derive the CNOT operator when the control & target qubits are not adjacent in significance:
$C_{20}|\phi_2\phi_1\phi_0\rangle.$
How is this done?
"
"['resource-request', 'quantum-operation', 'channel-capacity']"," Title: Experimental Realization of Superactivation of Quantum CapacityBody: The superactivation of quantum capacity is an effect that some quantum channels present such that is two of those channels with zero capacity are combined, a non-zero channel capacity can be achieved for the combined channel. This is obviously an effect that can only happen in the quantum world, as it is known that in classical communications two zero-capacity channels give a zero-capacity channel when combined.
This is one of the most surprising and weird effects known from quantum information theory, and so I am wondering if someone can give reference about an experimental realization of such effect.
"
"['algorithm', 'quantum-gate', 'qiskit', 'circuit-construction']"," Title: How to create a condition on only one classical bit when we have a total of 2 classic bits in the systemBody: I am trying to make a quantum circuit with one qubit and 2 classical bits for each measurment in the system below:
I want to make condition on the first bit: if the first collapse to zero so x operator is act on the circuit, else (one) nothing is acting on the circuit.
I am using qiskit language.
but when I try to create my circuit, there is always an error:
#definitions
q = QuantumRegister(1)
c = ClassicalRegister(2)
qc = QuantumCircuit(q,c)
# building the circuit
qc.h(q)
qc.measure(q[0],c[0])
qc.x(q[0]).c[0]_if(c[0], 0)
qc.measure(q[0],c[1])
circuit_drawer(qc)
and the error is:
File ""<ipython-input-4-66c70285946b>"", line 3
qc.x(q[0]).c[0]_if(c[0], 0)
^
SyntaxError: invalid syntax
how to write it correctly?
When I try to change
qc.x(q[0]).c[0]_if(c[0], 0)
with:
qc.x(q).c_if(c, 0)
I succeed in building my circuit but I get circuit that I don`t want to work with:
I wish for help, thanks.
"
"['speedup', 'grovers-algorithm', 'shors-algorithm']"," Title: Has there been any truly ground breaking advance in quantum algorithms since Grover and Shor?Body: (Sorry for a somewhat amateurish question)
I studied quantum computing from 2004 to 2007, but I've lost track of the field since then. At the time there was a lot of hype and talk of QC potentially solving all sorts of problems by outperforming classical computers, but in practice there were really only two theoretical breakthroughs:
- Shor's algorithm, which did show significant speed up, but which had limited applicability, and wasn't really useful outside of integer factorization.
- Grover's algorithm, which was applicable to a wider category of problems (since it could be used to solve NP-Complete problems), but which only showed polynomial speed-up compared to classical computers.
Quantum annealing was also discussed, but it wasn't clear whether it was really better than classical simulated annealing or not. Measurement based QC and the graph state representation of QC were also hot topics, but nothing definitive had been proved on that front either.
Has any progress in the field of quantum algorithms been made since then? In particular:
- Have there been any truly ground breaking algorithms besides Grover's and Shor's?
- Has there been any progress in defining BQP's relationship to P, BPP and NP?
- Have we made any progress in understanding the nature of quantum speed up other than saying that ""it must be because of entanglement""?
"
['photonics']," Title: Analyzing the three-polarizing-filter experiment as a quantum circuitBody: In the three-polarizing-filter experiment, two orthogonal polarizing filters block all light but then allow some amount when a third polarizing filter is placed oriented at a 45 degree angle between them.
Can we analyze this experiment through terms familiar to quantum computation? For example, representing photons as being in a superposition of horizontal & vertical polarization, being sent through unitary gates (the polarization filters) with some end measurement giving us a result with probability corresponding to the proportion of photons allowed through. Basically, reducing this experiment to a form which could be written as a quantum circuit!
I ask because it seems like quantum information processing is an ""easy"" path to reasoning about quantum phenomena, but I cannot see how exactly to apply it in this simple case.
"
"['programming', 'q#']"," Title: How to construct the ""Inversion About the Mean"" operator?Body: It seems like it should be simple, based on how Nielsen and Chuang talk about it, but I cannot seem to correctly implement the Inversion About the Mean operator ($2|\psi\rangle \langle\psi| - \mathcal{I}$) that is used in the Grover search algorithm, especially without using any ancilla bits.
I thought about performing a NOT operation on all the working qubits, then performing a controlled-NOT on a separate toggle qubit with the control being all the working qubits, then performing a controlled phase flip with control of the toggle bit, and finally flipping the phase of all the states. I'm not sure how I'd actually implement the controlled phase flipping, though, since, I believe, phase flipping one or all of the bits would not produce the desired effect.
Does anyone know how I can construct this? I am using Q#, by the way, if you'd like to answer in code.
"
"['quantum-gate', 'programming', 'qiskit']"," Title: How would one implement a quantum equivalent of a while loop in IBM QISkit?Body: I'm writing a simple multiplication algorithm that uses the Quantum Fourier Transform to repetitively add a number (the multiplicand) to itself and decrements another number (the multiplier). The repeated addition process is to be stopped once the multiplier hits the fundamental state (all qubits are in the zero state). Registers a, b, c hold the product, multiplicand and multiplier respectively. Classical register cl is used to store the final result:
def multiply(first, second, n, m):
a = QuantumRegister(m+n, ""a"")
b = QuantumRegister(m+n, ""b"")
c = QuantumRegister(m, ""c"")
d = QuantumRegister(m, ""d"")
cl = ClassicalRegister(m+n, ""cl"")
qc = QuantumCircuit(a, b, c, d, cl, name=""qc"")
for i in range(0, n):
if first[i] == ""1"":
qc.x(b[n-(i+1)])
if second[i] == ""1"":
qc.x(c[m-(i+1)])
qc.x(d[0])
for i in range(0, m+n):
createInputState(qc, a, m+n-(i+1))
for i in range(m):
createInputState(qc, c, m-(i+1))
At this point, however, I need to create a while loop of sorts that allows me to add the multiplicand to the accumulator (register a) until register c is in the fundamental state. Unfortunately the only method I could think of was using a for loop with range (0, (value of multiplier)), but I want to find out if there is a more 'quantum' alternative. The while loop would need to have work as below:
while (register c is not in the fundamental state):
for i in range(0, m+n):
evolveQFTState(qc, a, b, m+n-(i+1))
for i in range(0, m):
decrement(qc, c, d, m-(i+1))
for i in range(0, m):
inverseQFT(qc, c, i)
And then we wrap things up:
for i in range(0, m+n):
inverseQFT(qc, a, i)
for i in range(0, m+n):
qc.measure(a[i], cl[i])
So, in short, I am looking for a way to implement a set of statments that execute while a given condition holds true, i.e. a quantum register is not in the fundamental state. The problem I face is due to the fact that, to the best of my knowledge, we cannot use classical register bits in if statements, such as below:
if c[0] == 0: -------> not possible for QISkit classical register bits
#Do something
Another approach I tried was to perform the decrement operation in a different quantum circuit, but I got error messages.
Note: This is my first question here on QC SE, so please let me know if I have to rephrase it, change it or provide any additional information.
"
['programming']," Title: Where is the problem stored in a quantum computer?Body: I am trying to develop a more intuitive understanding of quantum computing -- I suppose Feynman would tell me that’s impossible! Let’s try: if we are trying to find the minimum of a surface or function, I can picture a grouping of qubits that would somehow consider the whole surface somewhat simultaneously, eventually finding the minimum. (Feel free to correct or improve upon that description, or tell me it’s completely useless.) My question is this: Where is the function specified, in the arrangement or connection of qubits, or in the classical programming of the inputs (and outputs?).
"
"['pauli-gates', 'clifford-group']"," Title: Is there a simple rule for the inverse of a Clifford circuit's stabilizer table?Body: In Improved Simulation of Stabilizer Circuits by Aaronson and Gottesman, it is explained how to compute a table describing which Pauli tensor products the X and Z observable of each qubit get mapped to as a Clifford circuit acts upon them.
Here as an example Clifford circuit:
0: -------@-----------X---
| |
1: ---@---|---@---@---@---
| | | |
2: ---|---|---@---|-------
| | |
3: ---@---@-------Y-------
And the table describing how it acts on the X and Z observables of each qubit:
+---------------------+-
| 0 1 2 3 |
+------+---------------------+-
| 0 | XZ X_ __ Z_ |
| 1 | ZZ YZ Z_ ZZ |
| 2 | __ Z_ XZ __ |
| 3 | Z_ X_ __ XZ |
+------+---------------------+-
| sign | ++ ++ ++ ++ |
+------+---------------------+-
Each column of the table describes how the circuit acts on the X observable (left half of column) and Z observable (right half of column) of each qubit. For example, the left side of column 3 is Z,Z,_,X meaning an X3 operation (Pauli X on qubit 3) at the right hand side of the circuit is equivalent to a Z1 * Z2 * X4 operation at the left hand side of the circuit. The 'sign' row indicates the sign of the product, which is important if you're going to simulate a measurement (it tells you whether or not to invert the result).
You can also compute the table for the inverse of a circuit. In the example case I've given, the inverse table is this:
+---------------------+-
| 0 1 2 3 |
+------+---------------------+-
| 0 | XZ Y_ __ Z_ |
| 1 | _Z YZ Z_ _Z |
| 2 | __ Z_ XZ __ |
| 3 | Z_ Y_ __ XZ |
+------+---------------------+-
| sign | ++ -+ ++ ++ |
+------+---------------------+-
The tables look almost the same if you transpose their rows and columns. But the entries aren't exactly identical. In addition to transposing, you have to encode the letters into bits (_=00, X=01, Z=10, Y=11) then swap the middle bits then decode. For example, ZZ encodes into 1010 which swaps into 1100 which decodes into Y_.
The question I have is: is there also a simple rule for the computing the inverse table's signs?
Currently I'm inverting these tables by decomposing them into circuits, inverting the circuits, then multiplying them back together. It's extremely inefficient compared to transpose+replace, but if I'm going to use transpose+replace I need a sign rule.
"
"['programming', 'qiskit']"," Title: How can I get the qiskit moduleBody: I have successfully installed qiskit. However, when I try to run a simulation I get the error ""No module named 'qiskit'
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
How can I get or enable this module?
"
['physical-realization']," Title: What's the current status of quantum computers?Body:
- Is it real now or not completed yet?
- Can I buy one? / How many quantum computers have been manufactured in the world?
- Is quantum computing independent (e.g Quantum+LCD+Keyboard) or it add-on for PC (e.g GPU)? / Can I use a quantum computer directly or must connect it to PC?
- Can a quantum computer process same CPU data? (e.g CPU can't process GPU graphics)
- Can quantum computers run high-end games?
- Can I program a quantum computer using C++? If not, why so?
"
"['programming', 'qiskit']"," Title: How can I resolve the error QISkit Error: The same provider has already been registered!Body: I am writing a small algorithm to multiply two numbers using IBM's QISkit. The code is below:
times_shell.py
import times
first = input(""Enter a number with less than 7 digits."")
l1 = len(first)
second = input(""Enter another number with less than "" + str(8-l1) + ""
digits."")
l2 = len(second)
if l1 > l2:
n = l1
m = l2
else:
first, second = second, first
n = l2
m = l1
prod = (""0"")*(m+n)
while int(second) is not 0:
second, prod = times.multiply(first, second, prod, n, m)
times.py
def multiply(first, second, product, n, m):
a = QuantumRegister(m+n, ""a"") #accumulator
b = QuantumRegister(m+n, ""b"") #holds multiplicand
c = QuantumRegister(m, ""c"") #hold multiplier
d = QuantumRegister(m, ""d"") #register with value 1
cl = ClassicalRegister(m+n, ""cl"") #used for final output
cl2 = ClassicalRegister(m, ""cl2"")
qc = QuantumCircuit(a, b, c, d, cl, cl2, name=""qc"")
for i in range(0, m+n):
if product[i] == ""1"":
qc.x(a[m+n-(i+1)])
for i in range(0, n):
if first[i] == ""1"":
qc.x(b[n-(i+1)])
for i in range(0, m):
if second[i] == ""1"":
qc.x(c[m-(i+1)])
qc.x(d[0])
for i in range(0, m+n):
createInputState(qc, a, m+n-(i+1), pie)
for i in range(m):
createInputState(qc, c, m-(i+1), pie)
for i in range(0, m+n):
evolveQFTState(qc, a, b, m+n-(i+1), pie)
for i in range(0, m):
decrement(qc, c, d, m-(i+1), pie)
for i in range(0, m):
inverseQFT(qc, c, i, pie)
for i in range(0, m+n):
inverseQFT(qc, a, i, pie)
for i in range(0, m+n):
qc.measure(a[i], cl[i])
for i in range(0, m):
qc.measure(c[i], cl2[i])
print(qc.qasm())
register(Qconfig['APItoken'], Qconfig['url'])
result = execute(qc, backend='ibmq_qasm_simulator',
shots=1024).result()
counts = result.get_counts(""qc"")
print(counts)
output = max(counts.items(), key=operator.itemgetter(1))[0]
multiplier, accumulator = str(output).split("" "")
print(multiplier)
print(accumulator)
return multiplier, accumulator
When I run it I get an error. The terminal output (the program output and the error) is as follows:
Traceback (most recent call last):
File ""times_shell.py"", line 18, in <module> second, prod =
times.multiply(first, second, prod, n, m)
File ""D:\Projects\Quantum_Computing\IBM_Python\times.py"", line 122, in
multiply
register(Qconfig['APItoken'], Qconfig['url'])
File ""C:\Users\ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-
packages\qiskit\wrapper\_wrapper.py"", line 56, in register
_DEFAULT_PROVIDER.add_provider(provider)
File ""C:\Users\ADMIN\AppData\Local\Programs\Python\Python37-32\lib\site-
packages\qiskit\wrapper\defaultqiskitprovider.py"", line 158, in
add_provider
raise QISKitError(""The same provider has already been registered!"")
qiskit._qiskiterror.QISKitError: 'The same provider has already been
registered!'
I'm not sure what the issue is here. Any help with this issue would be appreciated.
"
"['error-correction', 'communication']"," Title: Collective measurements: importance and realizationBody: I am reading the paper Polar codes for classical-quantum channels
by Wilde and Guha, and it is stated the fact that collective measurements are necessary in order to aciheve the Holevo symmetric information as it can be seen from the HSW theorem.
I am wondering what are such collective measurements and why are they different from the normal quantum measurements. Additionally, I was expecting to obtain some insight about some physical realization of such kind of measurements, as it seems that if applied in an optical-fiber link, the usage of such codes would be a way to obtain a tranmission rate equal to the Holevo symmetric information, which would be the ultimate capacity of such a channel.
"
['models']," Title: Quantum computing conceptsBody: I am trying to develop a feel for quantum computing at a basic level. I would very much appreciate someone will take a look at the statement below and fix it, since I assume it needs fixing.
“Problems to be solved by a quantum computer can be programmed by creating a set of qubit input registers and connecting them to a set of output registers through an assemblage of quantum logic gates that define the problem to be solved or computation to be done. When the computation is started the qubits traverse the logic gates according to the laws of quantum mechanics, not giving the same result measurement every time, but after a sufficient number of cases have been run and measured (no trivial matter) the answer is contained in the measurements. That method, connecting the input bits to the output bits so as to provide the solution, is suitable only for trivial problems. In practice, a considerable amount of classical programming must be done to set the input qubits in such a way that the quantum machine that is configured as required for the problem can process the qubits using their quantum mechanical properties. A typical problem requires that considerable classical manipulation of the output is required also.”
"
"['entanglement', 'qiskit']"," Title: Entanglement state preparation by using amplitude valuesBody: I have an algorithm that uses QRAM, after accessing the given QRAM that store M d-dimensional classical vectors, the state of the index register and the data register become entangled. But for now I don't have the QRAM black box, I just initialize the state of both systems by providing an array value to the registers at once using initialize function that exists in the qiskit module.
My question is I have assigned the value 0 for non-visible basis. Is that ok?
"
['quantum-gate']," Title: How to say ""apply CNOT on qubit 1 controlled by qubit 2""?Body: Say you have $2$ qubits, namely $q_1, q_2$. What's the right language for saying apply CNOT on $q_1$ and $q_2$ where $q_1$ is the control qubit and $q_2$ is the target?
For instance, can I say "apply CNOT on $q_2$ controlled by $q_1$"? What's the standard way of saying that?
"
"['programming', 'bloch-sphere']"," Title: Flying qubits compared with stationary qubitsBody: In a previous question I asked how stationary bits could be processed by logic gates. I casually mentioned that I could visualize qubits traversing stationary logic gates, and @DaftWullie said “It might help if you explain how you're visualising the flying qubit”, and I said to myself “Oops, I probably don’t have that right at at all!”. I simply visualize Bloch spheres moving in some constrained way from gate to gate, changing their vector angle according to the logic of the gate, with communication between the gates as programmed (like IBM Q makes it appear). If you can correct that image, maybe it would help me understand how stationary qubits (with moving gates?) work as well.
"
['simulation']," Title: Which QC platform is better to use on HPC cluster?Body: I have a HPC (High Performance Computing) cluster with NVIDIA GPU and Xeon CPU partitions.
Is this simulator list complete?
Which do you recommended to use on a HPC cluster?
Will it increase the performance (it has 512GB of memory).
"
"['quantum-state', 'density-matrix', 'hamiltonian-simulation']"," Title: Why is this Hamiltonian matrix diagonal?Body: I've only recently started using density matrices in my work but I am confused with the following code that I have whether I am getting the right matrix:
def Hamiltonian(alpha,h):
Sx = np.array([[0,1],[1,0]])
Sy = np.array([[0,-1j],[1j,0]])
Sz = np.array([[1,0],[0,-1]])
I = np.array([[1,0],[0,1]])
H = (alpha*np.kron(np.kron(Sx,Sx),I))
H =+ (alpha*np.kron(np.kron(Sy,Sy),I))
H =+ (alpha*np.kron(np.kron(I,Sx),Sx))
H =+ (alpha*np.kron(np.kron(I,Sy),Sy))
H =+ (h*np.kron(np.kron(I,Sz),I))
return H
So the above gives me my Hamiltonian Function, where alpha is a real number and h is a magnetization parameter acting on one of my qubits.
I have tried the following:
H = Hamiltonian(1,0.5)
print(H)
$$\begin{bmatrix}
0.5&0&0&0&0&0&0&0 \\
0&0.5&0&0&0&0&0&0 \\
0&0&-0.5&0&0&0&0&0 \\
0&0&0&-0.5&0&0&0&0 \\
0&0&0&0&0.5&0&0&0 \\
0&0&0&0&0&0.5&0&0 \\
0&0&0&0&0&0&-0.5&0 \\
0&0&0&0&0&0&0&-0.5
\end{bmatrix}$$
Why is it diagonal?
"
"['algorithm', 'quantum-gate', 'qutrit', 'teleportation']"," Title: Problem about qutrit teleportation protocolBody: I'm working through Scott Aaronson's Quantum Information Science problem sets, and I'm having trouble with a specific problem in ps5 (PDF). Specifically the following problem:
A “qutrit” has the form $a|0\rangle+b|1\rangle+c|2\rangle$, where $|a|^2+|b|^2+|c|^2=1$. Suppose Alice and Bob share the entangled state $(|00\rangle+|11\rangle+|22\rangle)/\sqrt 3$. Then consider the following protocol for teleporting a qutrit $|\psi〉=a|0\rangle+b|1\rangle+c|2\rangle$ from Alice to Bob: first Alice applies a CSUM gate from $|\psi〉$ onto her half of the entangled pair, where
$$\operatorname{CSUM}(|x\rangle\otimes|y\rangle) =|x\rangle\otimes|y+x \bmod 3\rangle$$
Next, Alice applies the unitary matrix $F$ to the $|\psi\rangle$ register, where
$$F=\frac{1}{\sqrt{3}}\begin{bmatrix}1&1&1\\1&\omega&\omega^2\\1&\omega^2&\omega^3\end{bmatrix}$$
and $\omega=e^{2i\pi/3}$ so that $\omega^3= 1$. She then measures both of her qutrits in the $\{|0\rangle,|1\rangle,|2\rangle\}$ basis, and sends the results to Bob over a classical channel. Show that Bob can recover a local copy of $|\psi\rangle$ given these measurement results.
This quantum circuit summarizes the protocol:
Here the double-lines represent classical ‘trits’ being sent from Alice to Bob. Depending on the value of 0, 1 or 2 Bob can apply a ? gate 0, 1, or 2 times. Prove that $|\psi〉=|\psi_\text{out}\rangle$ for appropriately chosen ? gates for all possible measurement results. Hint: You could explicitly work out all 9 possible cases, but you could also save time by noticing a general pattern that lets you handle all the cases in a unified way.
Here's what I've done: after applying the CSUM gate to the mixed state of three qutrits, Alice and Bob share the state:
\begin{align*}
& \frac{a}{\sqrt{3}}(|000 \rangle + |011 \rangle + |022 \rangle) \\
+ & \frac{b}{\sqrt{3}}(|110 \rangle + |121 \rangle + |102 \rangle) \\
+ & \frac{c}{\sqrt{3}}(|220 \rangle + |201 \rangle + |212 \rangle)
\end{align*}
After Alice applies $F$ to the first qutrit in the shared state, they're left with:
\begin{align*}
& \frac{|00 \rangle}{3}(a|0 \rangle + c|1 \rangle + b|2 \rangle)\\
+ & \frac{|01 \rangle}{3}(b|0 \rangle + a|1 \rangle + c|2 \rangle)\\
+ & \frac{|02 \rangle}{3}(c|0 \rangle + b|1 \rangle + a|2 \rangle) \\
+ & \frac{|10 \rangle}{3}(a|0 \rangle + w^2c|1 \rangle + wb|2 \rangle)\\
+ & \frac{|11 \rangle}{3}(wb|0 \rangle + a|1 \rangle + w^2c|2 \rangle)\\
+ & \frac{|12 \rangle}{3}(w^2c|0 \rangle + wb|1 \rangle + a|2 \rangle)\\
+ & \frac{|20 \rangle}{3}(a|0 \rangle + wc|1 \rangle + w^2b|2 \rangle) \\
+ & \frac{|21 \rangle}{3}(w^2b|0 \rangle + a|1 \rangle + wc|2 \rangle) \\
+ & \frac{|22 \rangle}{3}(wc|0 \rangle + w^2b|1 \rangle + a|2 \rangle) \\
\end{align*}
So after Alice measures her qutrits, whatever is inside the parenthesis is the state that Bob holds. However, I don't wee what operations can be used multiple times to "fix" the output.
It seems to me that Alice could communicate to Bob with one trit which two coefficients need to be transposed, and use one trit to tell Bob how to fix the remaining $w$'s. That doesn't seem to fit the desired protocol though, making me doubt the computations that I have performed above. If anyone could help me out (or point out a better approach), it would be appreciated. Thanks!
"
"['quantum-state', 'programming', 'density-matrix', 'hamiltonian-simulation']"," Title: How do I construct a Density Matrix corresponding to a Hamiltonian?Body: I have a Hamiltonian and I want to know the corresponding density matrix. The matrix I'm interested in is the one in this question.
"
"['quantum-gate', 'gate-synthesis', 'universal-gates']"," Title: How can I decompose a gate into $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$?Body: I am working with the set $\{\mathrm{CNOT}, \mathrm{H}, \mathrm{P}(\theta)\}$
where $\mathrm{H}$ is the Hadamard gate, and $\mathrm{P}(\theta)$ is the phase gate with angle $\theta$.
I want to build other gates with these gates, like $R_z(\theta)$, Control-$R_z(\theta)$, or Control-$P(\theta)$
How can I do this?
"
"['physical-realization', 'architecture', 'd-wave', 'superconducting-quantum-computing', 'adiabatic-model']"," Title: In D-Wave's universal quantum computer, why does the YY term have to be driven along with the linear X term?Body: D-Wave has a new prototype annealer that uses a Hamiltonian which, if there was enough qubits and sufficient control, would be able to simulate any universal circuit-based quantum computer with at most polynomial overhead. It was presented at the AQC 2018 conference at NASA:
The Hamiltonian on the slide contains both a ZZ term and a YY term.
Using the YY gadget of Section VI of this paper, the Hamiltonian becomes the classic ZZ + XX Hamiltonian, which is well known to be universal.
One issue with this design though, is that the YY term is part of the driver, not part of the problem Hamiltonian. Therefore the coefficient of the YY term has to change simultaneously with the linear X term.
Since I am not an expert in superconducting circuits, I wonder why the YY term, which makes it possible for the machine to do universal quantum computation, cannot change with the problem Hamiltonian, instead of the driving Hamiltonian?
"
"['gate-synthesis', 'universal-gates', 'quantum-gate', 'foundations']"," Title: What quantum gate is XNOR equivalent to?Body:
The standard way to implement a reversible XOR gate is by means of a controlled-NOT gate or CNOT; this is the ""standard quantum XOR operation"". Physics.Stackexchange
Is there a ""standard quantum XNOR operation""?
The XNOR gate (sometimes ENOR, EXNOR or NXOR and pronounced as Exclusive NOR) is a digital logic gate whose function is the logical complement of the exclusive OR (XOR) gate. Wikipedia
Alternatively, what is the logical complement of the CNOT gate?
"
['algorithm']," Title: What's an use case of the inner product between two qubits in a quantum algorithm?Body: $\newcommand{\q}[2]{\langle #1 | #2 \rangle}$
I know from linear algebra that the inner product of two vectors is 0 if the vectors are orthogonal. I also know the inner product is positive if the vectors more or less point in the same direction and I know it's negative if the vectors more or less point in opposite directions.
This is the same inner product as in $\q{x}{y}$, right? Can you show an example of the inner product being useful in a quantum algorithm? The simplest the better. It doesn't have to be a useful algorithm.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qiskit Python program cannot connect to QE APIBody: I am just getting started with Qiskit and IBM Quantum Experience, so please forgive my newby question.
I have a IBM Quantum Experience account and I generated an API token.
I used the generated token in the following tiny Python3 program:
import qiskit
QX_CONFIG = {
""APItoken"": ""<my-token-here>"",
""url"":""https://quantumexperience.ng.bluemix.net/api""}
qiskit.register(QX_CONFIG['APItoken'], QX_CONFIG['url'])
When I run this program qiskit.register throws the following exception:
Exception has occurred: qiskit._qiskiterror.QISKitError
""Couldn't instantiate provider! Error: Couldn't connect to IBMQuantumExperience server: error during login: HTTPSConnectionPool(host='quantumexperience.ng.bluemix.net', port=443): Max retries exceeded with url: /api/users/loginWithToken (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:645)'),))""
The API endpoint is reachable:
$ curl https://quantumexperience.ng.bluemix.net/api
{""error"":{""status"":400,""message"":""Generic error"",""code"":""GENERIC_ERROR""}}
Any suggestions on how to fix this issue?
PS:
api = IBMQuantumExperience(QX_API_TOKEN)
generates the same exception
"
"['quantum-state', 'measurement']"," Title: Let $\psi$ be a two-qubit state, $U \in \mathbb{C}^{2\times2}$ be a single-qubit unitary. Measure second qubit after applying U to the first qubit?Body: How can one show that measuring the second qubit of $\psi$ is the same as measuring the second qubit after applying $U \otimes I$ to $\psi$?
I know that $\psi = \Sigma_{ij} a_{ij}|i⟩|j⟩$, $(U \otimes I)|\psi⟩ = \Sigma_{ij}a_{ij}U|i⟩ \otimes |j⟩$, but I'm not sure what to do next
"
"['cryptography', 'grovers-algorithm', 'shors-algorithm']"," Title: How many qubits does it take to break a 10 characters password?Body: Let's assume we developed a hashcat-like programs for quantum computer. How many qubits we need to find the correct hash (WPA, MD5,...) from a 10 characters password make from upper, lower & numeric characters (about 604,661,760,000,000,000 combinations)
"
['mathematics']," Title: When would I consider using an outer product of quantum states, to describe aspects of a quantum algorithm?Body: I know the inner product has a relationship to the angle between two vectors and I know it can be used to quantify the distance between two vectors. Similarly, what's an use case for the outer product? You can exemplify with the simplest case. It doesn't have to be a useful algorithm.
I do know the outer product is a matrix and I know how to compute it, but I don't know how and where I'd use it.
"
['quantum-gate']," Title: How to apply the outer product operator?Body: $\newcommand{\q}[2]{\langle #1 | #2 \rangle}
\newcommand{\qr}[1]{|#1\rangle}
\newcommand{\ql}[1]{\langle #1|}
\renewcommand{\v}[2]{\langle #1,#2\rangle}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}$
Here's an application of the operator $\qr{\psi}\ql{\phi}$ to the vector $\qr{x}$. One writes $$
\begin{align}
(\qr{\psi}\ql{\phi})\qr{x} &= \qr{\psi}(\ql{\phi}\qr{x})\\
&= \qr{\psi}(\q{\phi}{x})\\
&= (\ql{\phi}\phi\qr{x})\qr{\psi}
\end{align}$$
The last equation totally loses me. First I don't understand what is the meaning of $\ql{\phi}\phi\qr{x}$ and I have no idea how it came about (moving $\qr{\psi}$ to the other end of the expression).
I know $\qr{\psi}\ql{\phi}$ is a matrix and I know how to get the matrix if I have two concrete vectors $\qr{\psi}$ and $\ql{\phi}$. I also know how to multiply a matrix by a vector, but I don't know how to apply the outer product as in those equations above. (They seem to be saying something important and I'm missing it.)
This is found in the very definition of outer product in the nice book by David McMahon: Quantum Computing Explained, ISBN 978-0-470-09699-4. The two relevant pages, including an example.
"
"['entanglement', 'communication']"," Title: Protocol for entaglement swappingBody: Suppose there are 3 parties, of which 2 pairs share an EPR pair and can communicate classically. What is a protocol that results in the third pair sharing an EPR pair?
That is the problem I'm given, I'm lost on how to do it, let alone what it means to ""share an EPR pair"" in the end.
"
['algorithm']," Title: Quantum Algorithm for MIMO ML detectionBody: I am reding the paper EXIT-Chart Aided Near-Capacity Quantum Turbo Code Design by Babar et al. and in the introduction, it is stated that due to the exponentially increasing complexity of the MIMO ML decoding, it is an idea to pass such problem to the quantum domain in order to make use of the inherent parallel nature of it, and so reduce the complexity of such problem.
I was wondering then if there has been any research on the topic of using quantum computing to solve such problem related with MIMO channels, and so if there has been, to reference some papers where such type of quantum algorithms are presented.
"
"['error-correction', 'stabilizer-code', 'nielsen-and-chuang']"," Title: Connection between stabilizer generators and parity check matrices in the Steane codeBody: I'm working through Mike and Ike (Nielsen and Chuang) for self-study, and I'm reading about stabilizer codes in Chapter 10. I'm an electrical engineer with somewhat of a background in classical information theory, but I'm by no means an expert in algebraic coding theory. My abstract algebra is essentially just a little more than what's in the appendix.
I think I totally understand the Calderbank-Shor-Steane construction, where two linear classical codes are used to construct a quantum code. The Steane code is constructed using $C_1$ (the code for qbit flips) as the [7,4,3] Hamming code, and $C_2^{\perp}$ (the code for phase flips) as the same code. The parity check matrix the [7,4,3] code is:
\begin{bmatrix}
0&0&0&1&1&1&1 \\
0&1&1&0&0&1&1 \\
1&0&1&0&1&0&1
\end{bmatrix}.
The stabilizer generators for the Steane code can be written as:
\begin{array} {|r|r|}
\hline
Name & Operator \\
\hline
g_1 & IIIXXXX \\
\hline
g_2 & IXXIIXX \\
\hline
g_3 & XIXIXIX \\
\hline
g_4 & IIIZZZZ \\
\hline
g_5 & IZZIIZZ \\
\hline
g_6 & ZIZIZIZ \\
\hline
\end{array} where for the sake of my sanity $IIIXXXX = I \otimes I\otimes I\otimes X \otimes X \otimes X \otimes X$ and so on.
It's pointed out in the book that the $X$s and $Z$s are in the same positions as the $1$s in the original parity check code. Exercise 10.32 asks to verify that the codewords for the Steane code are stabilized by this set. I could obviously plug this in and check it by hand. However, it's stated that with the observation of the similarities between the parity check matrix and the generator the exercise is ""self-evident"".
I've seen this fact noted in other places (http://www-bcf.usc.edu/~tbrun/Course/lecture21.pdf), but I'm missing some kind of (probably obvious) intuition. I think I'm missing some further connection from the classical codewords to the quantum codes other than how they're used in the indexing of basis elements in the construction of the code (i.e. Section 10.4.2).
"
"['measurement', 'circuit-construction', 'fault-tolerance']"," Title: Fault tolerant quantum measurement: how is implemented the ""majority vote""Body: As a fundamental component for a quantum computation, the measurement needs to be implemented in a fault tolerant way.
As indicated in Chuang and Nielsen Quantum Computation and Quantum Information, a quantum circuit that allows the implementation of a FT measurement is the one represented in Fig.1:
Quantum Circuit representation of a fault tolerant measurement.
However, three measurements are needed in order to make this implementation actually fault tolerant, due to the possible presence of errors in various part of the circuit (as it is said in the book, between two CNOT gates in a verification step for the cat state).
But how is it actually possible to execute three subsequent set of measurements? Isn't the data (the states on which the measured is performed) modified by the application of the measurement operation?
If that is the case, are the measurement operations applied on different data?
"
"['quantum-gate', 'entanglement', 'quantum-state', 'density-matrix', 'communication']"," Title: Applying CNOT with local operations and two EPR pairsBody: Suppose Alice and Bob hold one qubit each of an arbitrary two-qubit state $|\psi \rangle$ that is possibly entangled. They can apply local operations and are allowed classical communication. Their goal is to apply the CNOT gate to their state $| \psi \rangle$. How can they achieve this using two ebits of communication?
I'm pretty lost on where to start this problem. I would assume that if Alice has the control bit for the CNOT, I would need to follow a protocol something like:
- tensor $|\psi\rangle$ with the EPR pairs
- Alice applies some local operations and measures the EPR pairs
- Alice classically communicates something to Bob
- Bob applies some local operations with the information sent classically by Alice
- CNOT completed.
However, it is possible that Alice would only use one ebit, and Bob would use one as well to communicate something back. I'm not sure.
Really I just feel like I have no clue where to start this problem. Initially, some guidance on how to approach this would perfect, because right now i'm just poking around at a 6 qubit state.
A second idea I just had: might it be beneficial to instead of looking at the complete state, look at Alice and Bob's local density matrices?
"
['entanglement']," Title: Rotationally invariant maximally entangled states in higher dimensionsBody: Is there a straightforward generalization of the $\mathbb{C}^2$ Bell basis to $N$ dimensions? Is there a rotational invariant Bell state in higher dimensions? If yes, then what is the form of that state (how does it look like)? And, by rotational invariance, I mean that the state is invariant under applying the same unitary transformation $U$ to each qubit separately.
For example, $|\psi^-\rangle = \frac{|0\rangle|1\rangle - |1\rangle|0\rangle}{\sqrt{2}} = \frac{|\gamma\rangle|\gamma_\perp\rangle - |\gamma_\perp\rangle|\gamma\rangle}{\sqrt{2}}$, where $|\gamma\rangle$ is some quantum state in $\mathbb{C}^2$, and $|\gamma_\perp\rangle$ is orthogonal to $|\gamma\rangle$.
It would be helpful if I could see an example of the same, in say $\mathbb{C}^4$ space, perhaps in the computational basis {$|0\rangle, |1\rangle, |2\rangle, |3\rangle$} itself.
"
"['algorithm', 'entanglement', 'quantum-state']"," Title: General construction of $W_n$-stateBody: Two of the most well known entangled states are the GHZ-state $|\psi\rangle = 1/\sqrt{2}\left( |0\rangle^{\otimes n} + |1\rangle^{\otimes n}\right)$ and the $W_n$-state, with $W_3 = 1/\sqrt{3}\left(|100\rangle + |010\rangle + |001\rangle\right)$.
Constructing the GHZ-state is simple for arbitrary $n$. However, implementing the $W_n$-state is more difficult. For $n=2$ it is easy, and for $n=4$ we can use
H q[0,3]
X q[0,3]
Toffoli q[0],q[3],q[1]
X q[0,3]
Toffoli q[0],q[3],q[2]
CNOT q[2],q[0]
CNOT q[2],q[3]
Even for $n=3$ we have implementations, see this answer for instance. However, I have not found an algorithm that, given an $n$, outputs the circuit for constructing the $W_n$-state.
Does such an algorithm, defined by single- and two-qubit gates, exist? And if so, what is it?
"
"['algorithm', 'circuit-construction', 'gate-synthesis', 'mathematics']"," Title: Is there a general method to implement a 'greater than' quantum circuit?Body: I am interesting in finding a circuit to implement the operation $f(x) > y$ for an arbitrary value of $y$. Below is the circuit I would like to build:
I use the first three qubits to encode $|x⟩$, use the other three qubits to encode $|f(x) = x⟩$, and finally I want to filter out all of the solutions for which $f(x) \leq y$.
So, if we set $y = 5$, the states would be:
$$\Psi_{0} = |0⟩\otimes|0⟩ $$
$$\Psi_{1} = \frac{1}{\sqrt{8}}\sum_{i=0}^{7} (|i⟩\otimes|0⟩) $$
$$\Psi_{2} = \frac{1}{\sqrt{8}}\sum_{i=0}^{7} (|i⟩\otimes|i⟩) $$
$$\Psi_{3} = \frac{1}{\sqrt{2}}(|6⟩\otimes|6⟩ + |7⟩\otimes|7⟩)$$
Is there a general method to come up with such filter, or is this non-trivial?
"
"['d-wave', 'annealing', 'adiabatic-model']"," Title: What's a Qubit on D-Wave 2000Q?Body: From D-Wave flyer:
The D-Wave 2000Q system has up to 2048 qubits and 5600 couplers. To reach this scale, it uses 128,000
Josephson junctions, which makes the D-Wave 2000Q QPU by far the most complex superconducting
integrated circuit ever built.
How do they define Qubit? Do these qubits build an universal quantum computer? Does D-Wave's system satisfy DiVincenzo's criteria?
"
"['resource-request', 'hamiltonian-simulation']"," Title: Introductory resources for learning about quantum HamiltoniansBody: I am seeking introductory resources which will enable me to answer these questions (textbooks, lecture series, etc.):
- Given a simple quantum system, how do I derive its Hamiltonian?
- Given a Hamiltonian, what questions can I answer about the system it describes (and how?).
I am approaching this topic primarily from the computer science side. I am familiar with Newtonian classical mechanics as presented in first-year undergraduate physics courses, but never learned classical Hamiltonian mechanics.
"
"['physical-realization', 'architecture', 'd-wave', 'adiabatic-model', 'scalability']"," Title: Does the D-Wave 2000Q satisfy DiVincenzo's criteria?Body: DiVincenzo's criteria for quantum computation are the following:
- A scalable physical system with well characterized qubits.
- The ability to initialize the state of the qubits to a simple fiducial
state.
- Long relevant decoherence times.
- A “universal” set of quantum gates.
- A qubit-specific measurement capability.
Are they satisfied by the D-Wave 2000Q?
This was originally part of this question but is better suited to be a separate question.
"
"['ibm-q-experience', 'quantum-operation', 'noise']"," Title: Depolarizing channel implementation on IBM QBody: Given a single qubit in the computational basis, $|\psi\rangle =\alpha |0\rangle + \beta|1\rangle$, the density matrix is $\rho=|\psi\rangle\langle\psi|=\begin{pmatrix} \alpha^2 & \alpha \beta^*\\
\alpha^*\beta & \beta ^2\end{pmatrix}$.
Depolarizing channel is defined to be the super-operator $\mathcal{N}:\rho \rightarrow (1-p)\rho +p\pi$, where $\pi=I/2$. Therefore, here, $\mathcal{N} (\rho) = (1-p)\begin{pmatrix} \alpha^2 & \alpha \beta^*\\
\alpha^*\beta & \beta ^2\end{pmatrix}
+ \frac{p}{2} \begin{pmatrix} 1 & 0\\0 & 1\end{pmatrix}$.
How can one implement this evolution on IBM Q?
"
"['cryptography', 'key-distribution']"," Title: Lattice based cryptography vs BB84Body: Am I correct in thinking that post-quantum cryptography such as lattice-based solutions run on classical computers are resistant to quantum attacks (as opposed to RMS), whereas quantum key distribution schemes such as the BB84 are designed to run on quantum computers to communicate between them?
"
"['programming', 'qasm']"," Title: How to make ""random U3"" in QASM?Body: I want to make an operator:
$\mathrm{U3}(\arccos(\sqrt p),0,0)$, when $p$ is a random value between $0$ and $1$
How do I write code in QASM language of this ""random $\mathrm{U3}$"" operator?
"
"['algorithm', 'grovers-algorithm']"," Title: How significant are the variants of Grover's Algorithm?Body: I found a paper by Grover titled ""How significant are the known collision and element distinctness quantum algorithms?"", in which he expressed criticism to several famous algorithms, including Ambainis's algorithm for element distinctness. More precisely, he argues that all those algorithms use too much space, and there is a trivial way to obtain the same speedup(using same amount of memory) by separating the search space into several parts and search them on independent processors simultaneously. It seems Ambainis admitted this in another article.
My questions are:
1.Is Grover correct about those algorithms? That is, are they ""trivial"" in Grover's sense?
2.Have there been new algorithms obtaining the same speedup and using less space since then?
"
"['complexity-theory', 'qma']"," Title: Relation between $\mathrm{QMA}$ and $\mathrm{P^{QMA}}$Body: What is the relation between $\mathrm{QMA}$ and $\mathrm{P^{QMA}}$ and how do we prove it? Are these classes equal?
"
"['resource-request', 'photonics']"," Title: Do any educational quantum computing toys or devices exist?Body: Question inspired by this article from IEEE Spectrum on blocks containing different polarization filters for use in classrooms, and my previous question on representing the three-polarizing-filter experiment in quantum computing terms. Here I want to go the other way.
Do there exist any easily-purchasable educational quantum computing toys, such as those a physics teacher might use in a classroom? I am imagining here a set of polarizing filters or beam splitters with which you can (in conjunction with a laser) create very simple quantum circuits.
I am especially interested in ways to make a CNOT gate.
"
"['entanglement', 'information-theory', 'entropy', 'state-discrimination', 'min-entropy']"," Title: Relating min-entropy with conditional entropyBody: Suppose we have a classical quantum state $\sum_x |x\rangle \langle x|\otimes \rho_x$, one can define the smooth-min entropy $H_\min(A|B)_\rho$ as the best probability of guessing outcome $x$ given $\rho_x$. How does this quantity relate to $H(A|B)_\rho$ the standard conditional entropy? If not, how does it relate to the mutual information $I(A:B)_\rho$?
"
['phase-estimation']," Title: Are the squared absolute values of the eigenvalues of a unitary matrix always 1?Body: I'm going through the phase estimation algorithm, and wanted to sanity-check my calculations by making sure the state I'd calculated was still normalized. It is, assuming the square of the absolute value of the eigenvalue of the arbitrary unitary operator I'm analyzing equals 1. So, does it? Assuming that the eigenvector of the eigenvalue is normalized.
"
"['entanglement', 'density-matrix']"," Title: Suggest, partly based upon limited numerical results, possible “elegant” exact formulas for Bures two-qubit separability probabilityBody: Lovas and Andai (https://arxiv.org/abs/1610.01410) have recently established that the separability probability (ratio of separable volume to total volume) for the nine-dimensional convex set of two-re[al]bit states (representable by $4 \times 4$ “density matrices” with real entries) is $\frac{29}{64}$. The measure employed was the Hilbert-Schmidt one. Building upon this work of Lovas and Andai, strong evidence has been adduced that the corresponding result for the (standard) fifteen-dimensional convex set of two-qubit states (representable by density matrices with off-diagonal complex entries) is $\frac{8}{33}$ (https://arxiv.org/abs/1701.01973). (A density matrix is Hermitian, positive definite with unit trace.) Further, with respect to a different measure (one of the class of “monotone” ones), the two-qubit separability probability appears, quite strikingly, to be $1-\frac{256}{27 \pi^2}=1-\frac{2^8}{3^3 \pi^2}$. Further, exact values appear to have been found for higher-dimensional sets of states, endowed with Hilbert-Schmidt measure, such as $\frac{26}{323}$ for the 27-dimensional set of two-quater[nionic]bit states.
Now, perhaps the measure upon the quantum states of greatest interest is the Bures (minimal monotone) one (https://arxiv.org/abs/1410.6883). But exact computations pertaining to it appear to be more challenging. Lower-dimensional analyses (having set numbers of entries of the density matrices to zero) have yielded certain exact separability probabilities such as $\frac{1}{4}, \frac{1}{2}, \sqrt{2}-1$ (https://arxiv.org/abs/quant-ph/9911058).
Efforts to estimate/determine the (15-dimensional) two-qubit Bures separability probability have been reported in https://arxiv.org/abs/quant-ph/0308037.
Recently (https://arxiv.org/abs/1809.09040, secs. X.B, XI), we have undertaken large-scale numerical simulations—employing both random and quasi-random [low-discrepancy] sequences of points—in this matter. Based on 4,372,000,000 randomly-generated points, we have obtained an estimate of 0.0733181. Further based on ongoing quasi-randomly-generated (sixty-four-dimensional) points, for which convergence should be stronger, we have obtained independent estimates of 0.0733181 and (for a larger sample) 0.0733117.
One approach to the suggestion of possible associated exact formulas, is to feed the estimates into http://www.wolframalpha.com and/or https://isc.carma.newcastle.edu.au (the Inverse Symbolic Calculator) and let it issue candidate expressions.
Certainly, $\frac{8}{11 \pi^2} \approx 0.073688$ would qualify as “elegant”, as well as $\frac{11}{150} \approx 0.073333$, but they do not seem to have the precision required. Also, since in the two cases mentioned above, we have the “entanglement probabilities” of
$\frac{25}{33} =1 -\frac{8}{33}$ and $\frac{27}{256 \pi^2} =1-(1-\frac{27}{256 \pi^2})$, it might be insightful to think in such terms.
Bengtsson and Zyczkowski (p. 415 of “Geometry of quantum states: an introduction to quantum entanglement [2017]) ”have observed ``that the Bures volume of the set of mixed states is equal to the volume of an $(N^2-1)$-dimensional hemisphere of radius $R_B=\frac{1}{2}$''. It is also noted there that $R_B$ times the area-volume ratio asymptotically increases with the dimensionality $D=N^2-1$, which is typical for hemispheres. The Bures volume of the $N$-dimensional qubit density matrices is given by $\frac{2^{1-N^2} \pi ^{\frac{N^2}{2}}}{\Gamma \left(\frac{N^2}{2}\right)}$, which for $N=4$, gives $\frac{\pi ^8}{165150720}=\frac{\pi^8}{2^{19} \cdot 3^2 \cdot 5 \cdot 7}$.
Additionaly, we have similarly investigated the two-rebit Bures separability probability question with estimates being obtained of 0.1570934 and (larger sample) 0.1570971. But our level of confidence that some exact simple elegant formula exists for this probability is certainly not as high, based upon the Lovas-Andai two-rebit result for the particular monotone metric they studied.
Strongly related, with a slightly different focus, to this issue is my question Estimate/determine Bures separability probabilities making use of corresponding Hilbert-Schmidt probabilities
"
"['circuit-construction', 'quantum-memory']"," Title: Simulating Read only QRAM (constructing an oracle)Body: In many algorithms an array that stores a classical data or quantum data is crucial. The QRAM (quantum random access memory) that stores classical data in the circuit has been done. My question focuses on storing the given normalized d-dimensional vector using a quantum circuit. To do that I have used a generalized n-controlled phase shift gate between two Hadamard gates rotated in the specified angle. But when I try to measure the data register I couldn't find what I want, what shall I do?
"
"['quantum-state', 'entanglement', 'interpretations']"," Title: Many-Worlds Interpretation and GHZ StatesBody: I'm working through a problem set, and I've come across the following problem:
In this problem, you'll explore something that we said in class about the Many-Worlds Interpretation of quantum mechanics: namely, that ""two branches interfere with each other if and only if they produce an outcome that's identical in all respects."" Consider the n-qubit ""Schrodinger cat states""
$$\frac{|0\cdots 0 \rangle + |1 \cdots 1 \rangle}{\sqrt2}$$
a) What probability distribution over n-bit strings do we observe if we Hadamard the first $n-1$ qubits, then measure all n qubits in the $\{ |0 \rangle , |1 \rangle \}$ basis?
b) Is this the same distribution or a different one than if we had applied the same measurement to the state
$$\frac{|0 \cdots 0 \rangle \langle 0 \cdots 0 | + |1 \cdots 1 \rangle \langle 1 \cdots 1 |}{2}$$
c) What probability distribution over n-bit strings do we observe if we Hadamard all $n$ qubits, then measure all n qubits in the $\{ |0 \rangle , |1 \rangle \}$ basis?
d) Is this the same distribution or a different one than if we had applied the same measurement to the state
$$\frac{|0 \cdots 0 \rangle \langle 0 \cdots 0 | + |1 \cdots 1 \rangle \langle 1 \cdots 1 |}{2}$$
I have solved the problem as follows:
a) Equal probability of seeing any n-bit string of qubits.
b) Different: that mixed state has a 50/50 shot of seeing $|0 \cdots 0 \rangle$ or $|1 \cdots 1 \rangle$
c) Equal probability of seeing any n-bit string of qubits that have an even number of $|1\rangle$s
d) Different. Same state as b.
What I don't understand is what this has to do with the Many-Worlds Interpretation! Could someone explain the significance of this exercise? Thanks!
"
"['quantum-gate', 'matrix-representation', 'circuit-construction']"," Title: $R_z$ gate representationsBody: Why is the $R_z$ gate sometimes written as:
$$
R_{z}\left(\theta\right)=\begin{pmatrix}1 & 0\\
0 & e^{i\theta}
\end{pmatrix},
$$
while other times it is written as:
$$
R_{z}\left(\theta\right)=\begin{pmatrix}e^{-i\theta/2} & 0\\
0 & e^{i\theta/2}
\end{pmatrix},
$$
and even as:
$$
R_{z}\left(\theta\right)=\begin{pmatrix}e^{-i\theta} & 0\\
0 & e^{i\theta}
\end{pmatrix}?
$$
And when we see an algorithm diagram using this gate, does it always work the same regardless of what the $R_z$ representation is ? Do the papers not always say what their standard representation is?
"
"['cryptography', 'shors-algorithm']"," Title: How can Shor's algorithm be used to crack 32 bit RSA Encryption?Body: I have this as my minor project and plan to use Shor' Algorithm for factorization to figure out the $p$ and $q$ factors for cracking. Although I understand the theoretical part, I am having some problems in implementing it.
"
['error-correction']," Title: How is computation done in a 2D surface code array?Body: In a 2D surface code lattice, there are some data qubits and some measurement qubits. Suppose we want to do a 2-qubit computation, for example, let say, an X-gate on qubit-1 followed by a CNOT gate with qubit-1 as the control bit and qubit-2 as the target bit.
Q: How is this computation realized in a quantum computer with a 2D surface code arrangement of qubits? i.e. Which gates are applied and on which qubits?
"
['grovers-algorithm']," Title: Why does Grover's search invert about the mean?Body: Let $\vert s\rangle = \frac{1}{\sqrt{N}}\sum_{i=1}^N\vert x_i\rangle$ be an equal superposition over states from which we need to find one solution state $\vert w\rangle$.
The phase flip operator in Grover's search is $I - 2\vert w\rangle\langle w\vert$. Next, one inverts about the mean with the operator $2\vert s\rangle\langle s\vert - I$. We do this, say $\sqrt{N}$ times and then measure the state.
My question is why flip about the mean? What other options would one have that is still unitary and why are they less optimal than choosing the mean?
"
"['physical-realization', 'architecture']"," Title: Can quantum computers be clustered together?Body: I have been interested in the idea of computer clusting which is about making multiple pysical computer system to act as one whole logical computer system computing the same task at the same time, but what about this idea in the quantum computing world has it been done or proposed before?
"
"['programming', 'qiskit']"," Title: Qiskit SDK problemBody: So I am getting this error when I fire the command on Ipython or Jupyter Notebook
<ipython-input-14-8c9b14139f9d> in< module>()
from qiskit import IBMQ
ImportError: cannot import name 'IBMQ'
Does anyone know that kinda error?
If anyone has experienced such errors while using qiskit, please help here.
"
"['quantum-gate', 'gate-synthesis']"," Title: Simulation vs Construction of Fredkin gate with Toffoli gatesBody: I'm working my way through the book ""Quantum computation and quantum information"" by Nielsen and Chuang. (EDIT: the 10th anniversary edition).
On chapter 3 (talking about reversibility of the computation) exercise 3.32, it is possible to see that the minimum number of Toffoli gates required to simulate Fredkin gate is 4. See Andrew Landahl's notes for more details.
By the end of Chapter 3, it is also stated:
From the point of view of quantum computation and quantum information,
reversible computation is enormously important. To harness the full power of quantum computation, any classical subroutines in a quantum computation must be performed reversibly and without the production of garbage bits depending on the classical input.
On chapter 4 exercise 4.25, we construct the Fredkin gate using only 3 Toffoli gates.
The question is: what's the difference between simulation and construction of Fredkin gate using Toffoli gates?
"
"['programming', 'qiskit', 'ibm-q-experience', 'optimization']"," Title: How to run algorithms on IBMQ via Qiskit-Aqua?Body: I am trying to run an optimization problem on IBMQ. Running the same code on QASM simulator works fine. However, changing only the backend name to IBMQX takes long time. I am aware of the queues although, there is no way to track the status of my job. I have followed the same code structure given on qiskit-aqua partition example tutorial.
Any help would be really appreciated. Thanks.
"
"['quantum-fourier-transform', 'fourier-sampling']"," Title: Weak Fourier Sampling vs Strong Fourier Sampling?Body: I'm having trouble understanding the difference between weak fourier sampling and strong fourier sampling. From this paper:
...two important variants of the Fourier sampling paradigm have been
identified: the weak standard method, where only representation names
are measured, and the strong standard method, where full measurement
(i.e., the row and column of the representation, in a suitably chosen
basis, as well as its name) occurs.
Can someone explain like I'm 5 years old?
"
"['quantum-gate', 'quantum-state', 'measurement']"," Title: Calculating measurement result of quantum swap circuitBody: Consider the following circuit, where $F_n$ swaps two n-qubit states.
If the inital state is $|0\rangle \otimes |\psi\rangle \otimes |\phi\rangle = |0\rangle|\psi\rangle|\phi\rangle$, the state before measurement is (unless I'm wrong):
$$\frac{1}{2}\left(|0\rangle \left(|\psi\rangle|\phi\rangle + |\phi\rangle|\psi\rangle\right) + |1\rangle \left(|\psi\rangle|\phi\rangle - |\phi\rangle|\psi\rangle\right)\right)$$
How to calculate the post measurement distribution for the first qubit, in terms of $|\psi\rangle$ and $|\phi\rangle$?
"
"['algorithm', 'hhl-algorithm']"," Title: Efficiently performing controlled rotations in HHLBody: This question builds off of this question.
In the HHL algorithm, how do you efficiently do the $\tilde{\lambda}_k$-controlled rotations on the ancilla qubit? It seems to me that since you don't know the eigenvalues a priori, you would have to control on every single $\lambda$ within your eigenvalue bounds $[\lambda_{\text{min}},\lambda_{\text{max}}]$ (since every $\lambda$ requires a different rotation angle), requiring a potentially exponential number of controlled rotations.
I kind of get how you can avoid an exponential number of controls in Shor's algorithm, because we can split up the modular exponentiation $a^x\pmod N$ so that we can deal with each bit of $x$ separately, $a^{2^{k-1}x_{k-1}}a^{2^{k-2}x_{k-2}}...a^{2^0 x_0} \pmod N$, so you only need as many controls as the number of bits of $x$. But I'm not sure how you can do something similar in the case of HHL, because $\tilde{\lambda}_k$ is not only in the denominator, but nested inside an arcsin, e.g.
\begin{align}
\mathrm{Controlled\ Rotation}=\sum_{m \in [\lambda_{\text{min}},\lambda_{\text{max}}]}\underbrace{|m\rangle\langle m|}_{\text{control reg.}} \otimes \underbrace{R_y\left(\sin^{-1}(2C/m) \right)}_{\text{anc reg.}}
\end{align}
where the number of terms in the sum is exponential in the number of bits of precision in $\lambda$. Is there a way to do this more efficiently, and if not, wouldn't this severely eat into the exponential speedup of the algorithm?
"
"['algorithm', 'games']"," Title: Algorithm-based game project to introduce quantum computingBody: I am currently working on a quantum computing subject for my coding school, and I had some questions for you. My objective would be to introduce students to quantum computing with an algorithmic project. I had two games ideas for it, one of them being harder to implement than the other one.
The first (the hardest), would be to provide each of the two players a quantum byte, randomly initialized: to do that, we would apply a Hadamard gate to each qubit in the byte, measure it, use the result of the measurement as the initial state for the byte, and then apply a Hadamard gate to each of the qubits again. This way, the player really has no way to know what lies within the byte. Once the bytes are initialized, each player is given a model of 7 bits he has to reproduce over measurement. For instance, if you are given the string 01110110, you would have to obtain either 01110110 or 11110110 upon measurement, the first qubit being used as a register, allowing the players to apply multi-qubit gates to the byte without alienating the rest of their QuBits. The first player who measures his byte and obtains what he or she was asked to obtain wins. This way students are introduced to quantum state preparation, and might even produce a strToQuBit type of function.
The second idea would be similar, but instead of a model of byte they would have to reproduce, the game would be played by two players, one would have to fill their byte with 1s, the other with 0s, in other words, the string they would have to obtain upon measurement would always be either (00000000 or 10000000), or (11111111 or 01111111). The byte would of course still be randomly initialized before players can work with it.
Which idea do you think is the best, and is such a project even doable?
EDIT: I have omitted an important precision: players cannot change the states of the qubits once they have measured it, and all QuBits will be measured at once. Once the whole byte has been measured, either the result corresponds to the model byte and the player wins, or it does not and then a new model byte is assigned to the player who failed! ;)
Does this make it more complex?
"
"['algorithm', 'quantum-fourier-transform', 'shors-algorithm']"," Title: Do the probability amplitudes of the superposition state produced by the QFT transform convey useful information?Body: I have been studying on Quantum Fourier Transform (QFT) by myself, and I am little bit confused about how could QFT be used.
For example, if the QFT of three quantum bits is
$a_1|000\rangle + a_2|001\rangle + a_3|010\rangle + a_4|011\rangle + a_5|100\rangle + a_6|101\rangle + a_7|110\rangle+
a_8|111\rangle$
three questions arising in my mind:
- Whether or not the useful information is represented by the probability amplitude coefficients ($a_1,..., a_8$) of the superposition state? Are these coefficients the same as their counterparts in DFT?
- To my best knowledge, once a quantum system is measured, the superposition state will be destroyed, and the information represented by the probability coefficients ($a_1, ..., a_8$) will be lost. Then how could the coefficients be extracted from by measurements?
- How is QFT related with Shor’s Algorithm?
Thank you by advance for answers.
"
"['quantum-gate', 'circuit-construction', 'optimization']"," Title: Understanding the Group Leaders Optimization AlgorithmBody: Context:
I have been trying to understand the genetic algorithm discussed in the paper Decomposition of unitary matrices for finding quantum circuits: Application to molecular Hamiltonians (Daskin & Kais, 2011) (PDF here) and Group Leaders Optimization Algorithm (Daskin & Kais, 2010). I'll try to summarize what I understood so far, and then state my queries.
Let's consider the example of the Toffoli gate in section III-A in the first paper. We know from other sources such as this, that around 5 two-qubit quantum gates are needed to simulate the Toffoli gate. So we arbitrarily choose a set of gates like $\{V, Z, S, V^{\dagger}\}$. We restrict ourselves to a maximum of $5$ gates and allow ourselves to only use the gates from the gate set $\{V, Z, S, V^{\dagger}\}$. Now we generate $25$ groups of $15$ random strings like:
1 3 2 0.0; 2 3 1 0.0; 3 2 1 0.0; 4 3 2 0.0; 2 1 3
0.0
In the above string of numbers, the first numbers in bold are the index number of the gates (i.e. $V = 1, Z = 2, S = 3, Z^{\dagger} = 4$), the last numbers are the values of the angles in $[0,2\pi]$ and the middle integers are the target qubit and the control qubits respectively. There would be $374$ such other randomly generated strings.
Our groups now look like this (in the image above) with $n=25$ and $p=15$. The fitness of each string is proportional the trace fidelity $\mathcal{F} = \frac{1}{N}|\operatorname{Tr}(U_aU_t^{\dagger})|$ where $U_a$ is the unitary matrix representation corresponding to any string we generate and $U_t$ is the unitary matrix representation of the 3-qubit Toffoli gate. The group leader in any group is the one having the maximum value of $\mathcal{F}$.
Once we have the groups we'll follow the algorithm:
The Eq. (4) mentioned in the image is basically:
$$\text{new string} [i] = r_1 \times \text{old string}[i] + r_2 \times \text{leader string}[i] + r_3 \times \text{random string}[i]$$ (where $1 \leq i \leq 20$) s.t. $r_1+r_2+r_3 = 1$. The $[i]$ represents the $i$ th number in the string, for example in 1 3 2 0.0; 2 3 1 0.0; 3 2 1 0.0; 4 3 2 0.0; 2 1 3 0.0, the $6$-th element is 3. In this context, we take $r_1 = 0.8$ and $r_2,r_3 = 0.2$. That is, in each iteration, all the $375$ strings get mutated following the rule: for each string in each group, the individual elements (numbers) in the string gets modified following the Eq. (4).
Moreover,
In addition to the mutation, in each iteration for each group of the
population one-way-crossover (also called the parameter transfer) is
done between a chosen random member from the group and a random member
from a different random group. This operation is mainly replacing some
random part of a member with the equivalent part of a random member
from a different group. The amount of the transfer operation for each
group is defined by a parameter called transfer rate, here, which is
defined as $$\frac{4\times \text{max}_{\text{gates}}}{2} - 1$$ where
the numerator is the number of variables forming a numeric string in
the optimization.
Questions:
- When we are applying this algorithm to find the decomposition of a random gate, how do we know the number and type of elementary gates we need to take in our gate set? In the example above they took $\{V,Z,S,V^{\dagger}\}$. But I suspect that that choice was not completely arbitrary (?) Or could we have chosen something random like $\{X,Z,R_x,R_{zz},V\}$ too? Also, the fact that they used only $5$ gates in total, isn't arbitrary either (?) So, could someone explain the logical reasoning we need to follow when choosing the gates for our gate set and choosing the number of gates to use in total? (It is mentioned in the papers that the maximum possible value of the number of gates is restricted to $20$ in this algorithm)
- After the part (in ""Context"") discussing the selection of the gate set and number of gates,is my explanation/understanding (paragraph 3 onwards) of the algorithm correct?
- I didn't quite understand the meaning of ""parameter transfer rate"". They say that $4\times \text{max}_{\text{gates}} - 2$ is the number of variables forming a numeric string in the optimization. What is $\text{max}_{\text{gates}}$ in this context: $5$ or $20$? Also, what exactly do they mean by the portion I italicized (number of variables forming a numeric string in the optimization) ?
- How do we know when to terminate the program? Do we terminate it when any one of the group leaders cross a desired value of trace fidelity (say $0.99$)?
"
"['entanglement', 'communication', 'teleportation']"," Title: Quantum teleportation: second classical bit for removing entanglement?Body: I have read about how Alice can send Bob a qubit $\alpha |0\rangle + \beta|1\rangle$ if they share an EPR pair. This gives an initial state:
$(\alpha |0\rangle + \beta|1\rangle) \otimes (\frac{1}{\sqrt{2}}|00\rangle + \frac{1}{\sqrt{2}}|11\rangle)$
The first two qubits belong to Alice, the third belongs to Bob.
The first step is for Alice to apply a controlled not from first qubit onto her half of the EPR pair. This gives the result:
$\frac{1}{\sqrt{2}} \big(\alpha (|000\rangle + |011\rangle) + \beta (|110\rangle + |101\rangle)\big)$
Next, let us say that Alice measures her second qubit. This has a 50/50 chance of resulting in a zero or a one. That leaves the system in one of two states:
$\alpha |000\rangle + \beta |101\rangle \quad\text{OR}\quad \alpha |011\rangle + \beta |110\rangle$
If Alice measures the second qubit as zero, she is in the first state. She can tell Bob: ""Your half of the EPR is now the qubit I wanted to send you.""
If Alice measures the second qubit as one, she is in the second state. She can tell Bob: please apply the matrix
$
\begin{bmatrix}
0 & 1\\
1 & 0
\end{bmatrix}
$
to your qubit to flip the roles of zero and one.
Hasn't Alice teleported her qubit at this point?
The only problem I see is this: Alice must continue not to measure her original qubit. If her unmeasured qubit were to be measured, that would force Bob's qubit to collapse as well.
Is this therefore why Alice needs to apply a Hadamard matrix to her first qubit? Let us apply the Hadamard to the state
$\alpha |000\rangle + \beta |101\rangle$
(This is one of the two possibilities from above). We get:
$
\frac{1}{\sqrt{2}} \big(
(\alpha |000\rangle + \beta |001\rangle)
(\alpha |100\rangle - \beta |101\rangle)
\big)
$
Alice measures her first qubit now. If it is a zero, she can tell Bob: your qubit is fine. If it is one, she can tell Bob: you need to fix it from $\alpha |100\rangle - \beta |101\rangle$ (by an appropriate rotation).
Finally, my questions are:
- If Alice is okay with sharing an entangled copy of the transfered qubit with Bob, can she send just the first classical bit?
- Is the application of the Hadamard simply to separate Alice's first qubit from Bob's qubit?
- It is the application of the Hadamard to Alice's first qubit, followed by the measurement, which may disturb Bob's qubit, possibly necessitating a ""fixup."" The second classical bit is transferred to communicate whether the fixup is needed. Am I correct?
- The reason Alice wants Bob to have a qubit unentangled from her own is probably because it is burdensome for Alice to keep an entangled copy from being measured. Correct?
Sorry for the very long and rambly question. I think I understand, but maybe this writeup will help someone else.
"
"['programming', 'tensor-product', 'qcl']"," Title: How to compute the tensor product in QCL?Body: When I look at QCL (the documentation of the language begins in chapter 3) I don't see a way to compute the tensor product between two q-bits. Is the programming operator & doing the tensor product's job?
"
"['quantum-gate', 'quantum-state']"," Title: Why does a rotation of $\pi/2$ on $|1\rangle$ yield $i|1\rangle$?Body: It seems $V(\pi/2, \qr{1}) = i \qr{1}.$ I didn't expect that. To me $\qr{1}$ points up because $\qr{0}$ points to the right. So rotating $\qr{1}$ by $\pi/2$
should yield $-\qr{0}$. What am I missing here?
$\newcommand{\q}[2]{\langle #1 | #2 \rangle}
\newcommand{\qr}[1]{|#1\rangle}
\newcommand{\ql}[1]{\langle #1|}$
"
"['algorithm', 'quantum-fourier-transform', 'fourier-sampling', 'hidden-subgroup-problem']"," Title: Why does Fourier sampling allow to efficiently recover hidden subgroups?Body: The hidden subgroup problem is often cited as a generalisation of many problems for which efficient quantum algorithms are known, such as factoring/period finding, the discrete logarithm problem, and Simon's problem.
The problem is the following: given a function $f$ defined over a group $G$ such that, for some subgroup $H\le G$, $f$ is constant over the cosets of $H$ in $G$, find $H$ (through a generating set).
In this context, $f$ is given as an oracle, which means that we don't care about the cost of evaluating $f(x)$ for different $x$, but we only look at the number of times $f$ must be evaluated.
It is often stated that a quantum computer can solve the hidden subgroup problem efficiently when $G$ is abelian. The idea, as stated for example in the wiki page, is that one uses the oracle to get the state
$\lvert gH\rangle\equiv\sum_{h\in H} \lvert gh\rangle$
for some $g\in G$, and then the QFT is used to efficiently recover from $\lvert gH\rangle$ a generating set for $H$.
Does this mean that sampling from $\operatorname{QFT}\lvert gH\rangle$ is somehow sufficient to efficiently reconstruct $H$, for a generic subgroup $H$? If yes, is there an easy way to see how/why, in the general case?
"
['resource-request']," Title: Resources to keep a track on open Ph.D. positions in specific sub-fields/topics of quantum computingBody: I was wondering where to look for open Ph.D. positions for specific sub-fields/topics of quantum computing like error correction, optimization, quantum chemistry, etc. It is preferable if the offers/positions can be sorted subfield-wise or topic-wise.
"
['speedup']," Title: Physics World - Questioning quantum speedBody: My question is definitely regarding quantum-speedup but the quantum-speedup tag is confined to algorithms... and my question is definitely not on algorithms. So, this is just my best shot at tagging.
This article in Physics World discusses quantum speedup and makes some pretty provocative statements (examples below).
It also tells me that people in a forum like this one might feel as follows:
“Some feel that this debate about the “how” of quantum computation is a red herring. “Researchers attending most conferences in quantum computing never mention these issues, or only in discussions over beer”.
Here are some of those ""provocative statements"".
“None of the explanations for how quantum computers achieve speed-up is universally accepted.”
“If it’s not from the vastness of Hilbert space, not from entanglement and not interference, then what? “As far as I am aware, right now it’s pretty silent in the theatre where this question is played out – that’s because the main candidates are all dead...”
Here are two specific questions.
As a worker in this field, does the following statement from the 2014 Physics World article match your own perception here in 2018? If not, what are the favored candidates today? And again, this is not a question about speedups obtained via algorithmic refinement. Why exclude algorithmic refinement? See ""Footnote"".
""Deutsch’s notion of quantum parallelism has stuck – the standard explanation in popular descriptions of quantum-computing speed-up is still that massively parallel computation takes place...""
Footnote: Why exclude algorithmic refinements?
Again from that article:
“Designing good quantum algorithms is a very difficult task,” Van den Nest agrees. “I believe this task could be made lighter if we were to arrive at a systematic understanding of the possible ways to move from classical to quantum computing” – in other words, if we had a better grasp of which aspect of quantum physics the advantages ultimately stem from.""
I just noticed that link is going be unfamiliar (to me too). So I vetted it just a little. The home page says: ""Dr. Franco Nori is a RIKEN Chief Scientist, heading the “Theoretical Quantum Physics Laboratory” at the “Cluster for Pioneering Research” at Riken, Saitama, Japan. He is also at the University of Michigan, Ann Arbor, USA""
"
"['quantum-gate', 'circuit-construction']"," Title: What's an example of building a circuit $U_f$ that implements a simple function $f$?Body: I'd like to be able to program simple functions into simulators such as QCL. I read that any function $f$ can be implemented, but I don't know how to get say a unitary matrix that implements $f$.
$\newcommand{\qr}[1]{|#1\rangle}$
I think first I must figure out a function that mimics $f$ in a reversible way. I think that $$U_f\qr{x}\qr{0} = \qr{x}\qr{0 \oplus f(x)}$$ does it. However, how do I implement this as a circuit? Please give a simple example, if you would.
"
"['quantum-gate', 'matrix-representation']"," Title: What is the matrix for the operator that implements a function to tell the parity of its argument?Body: $\newcommand{\qr}[1]{|#1\rangle}$ I gave myself the task of building an operator that implements the following function: $f(0) = 0$, $f(1) = 1$, $f(2) = 1$, $f(3) = 0$. I restricted myself to $x$ up to 2 bits. That is, $f$ tells the parity of its argument.
I read that in order to be reversible, a circuit $U_f$ could be defined to have the following effect: $U_f\qr{x}_2 \qr{0}_1 \to \qr{x}_2\qr{0 \oplus f(x)}_1$. After doing my calculations, I think the following matrix represents $U_f$
$$\begin{bmatrix}
1 & 0 & 0 & 0\\
0 & 1 & 1 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{bmatrix} \otimes I_2$$
However, I'm really not sure. I once read that this definition isn't complete, that I should also define the behavior for the input $\qr{x}_2\qr{1}$. (I'm not too clear on that.)
So --- though confused ---, I went ahead and defined $$U_f\qr{x}_2 \qr{1}_1 \to \qr{x}_2\qr{1 \oplus f(x)}_1.$$ Doing my calculations again, I get the following matrix
$$\begin{bmatrix}
0 & 1 & 1 & 0\\
1 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{bmatrix} \otimes I_2$$
Now I don't know which should be my matrix.
"
"['quantum-gate', 'gate-synthesis', 'pauli-gates', 'cluster-states']"," Title: How does the stated Pauli decomposition for $\operatorname{CP\cdot A\cdot CP}$ arise?Body: I'm having a bit of trouble understand @DaftWullie's answer here.
I understood that the $4\times 4$ matrix $A$
$$ \frac{1}{4} \left[\begin{matrix}
15 & 9 & 5 & -3 \\
9 & 15 & 3 & -5 \\
5 & 3 & 15 & -9 \\
-3 & -5 & -9 & 15
\end{matrix}\right]$$
can be decomposed into Pauli matrices as:
$$A=15\mathbb{I}\otimes\mathbb{I}+9Z\otimes X+5X\otimes Z-3Y\otimes Y$$
So far so good.
Then he says:
Now, it is interesting to note that every one of these terms commutes.
So, that means that $$ e^{iA\theta}=e^{15i\theta}e^{9i\theta Z\otimes
X}e^{5i\theta X\otimes Z}e^{-3i\theta Y\otimes Y}. $$ You could work
out how to simulate each of these steps individually, but let me make
one further observation first: these commuting terms are the
stabilizers of the 2-qubit cluster state. That may or may not mean
anything to you, but it tells me that a smart thing to do is apply a
controlled-phase gate.
$$ CP\cdot A\cdot CP=15\mathbb{I}\otimes\mathbb{I}+9\mathbb{I}\otimes
X+5X\otimes \mathbb{I}-3X\otimes X. $$
Now, I hadn't heard of clusters states before, but Wikipedia gave me some idea (I'll probably need to through it a few more times though).
Anyhow, as far as I know, the controlled phase gate $CP$ is basically a controlled-$R_{\phi}$ gate where $R_{\phi}$ is:
$$\left[\begin{matrix}1 & 0 \\ 0 & e^{i\phi}\end{matrix}\right]$$
So, controlled $R_{\phi}$ would be
$$\left[\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & e^{i\phi}
\end{matrix}\right]$$
This is where I am confused. Shouldn't $(\text{controlled }R_{\phi})A(\text{controlled }R_{\phi})$ contain a $\phi$ term somewhere? I don't understand how its Pauli decomposition $15\mathbb{I}\otimes\mathbb{I}+9\mathbb{I}\otimes
X+5X\otimes \mathbb{I}-3X\otimes X$ contains no term containing the phase angle $\phi$. Wolfram Alpha also agrees that the matrix multiplication result of $\operatorname{CP\cdot A\cdot CP}$ must contain a phase term. So, I'm not quite sure how Pauli decomposition of $\operatorname{CP\cdot A\cdot CP}$ as stated by DaftWullie in his answer arises. Am I missing something?
"
['dynamics']," Title: Discrepancy regarding Husimi Probability distributionBody:
I am trying to simulate a system of j qubits and for visualization of the dynamics considering the Husimi distribution of the state.
To carry out the projection onto coherent states I have proceeded in the following manner
R=LA.expm(1j*theta*(Sx*np.sin(phi)-Sy*np.cos(phi)))
alpha=dot(R,psi0)
Where alpha represents the coherent state centered at (phi,theta), R is Rotation matrix, psi_0 spin state of |j,j> and Sx,Sy are spin operators along x and y direction respectively.
I am using scipy's linalg library to carry out exponentiation of matrix.
From all such alpha's I am able to construct the coherent distribution.
I am able to produce supposedly correct distribution for most cases but for some cases, I am getting negative values which should not be obtained for Husimi distribution, though the order of these are very less and might be related to an error in numerical approximation.
I am doubtful about my implementation and would like to clarify if the methodology that I have followed is correct or is there any better alternative for the same.
"
"['quantum-gate', 'circuit-construction', 'optimization']"," Title: Applying Group Leaders Optimization to Quantum Belief SystemsBody: Context: I am particularly interested in quantum cognition & would like to use a tool like pyZX to perform the following types of optimizations.
In Preparing a (quantum) belief system they ""establish a theoretical result showing that in the absence of constraints on measurements, any state can be obtained as the result of a suitable sequence of measurements.""
It is also stated in the paper that ""achieving the desired belief state may require a sequence of measurements that is not practically feasible.""
How could the Group Leaders Optimization Algorithm be applied in the above context to generate practically feasible sequences of measurements?
"
"['quantum-gate', 'matrix-representation', 'circuit-construction']"," Title: Solving a circuit implementing a two-level unitary operationBody: The circuit below implements the following two-level unitary transformation:
$\tilde{U}$ is a unitary matrix: $\tilde{U} = \left[\begin{matrix} a & c \\ b & d \end{matrix}\right]$
where $a, b, c, d$ are any complex numbers.
As we can see, $U$ acts non-trivially only on the states $\lvert 000 \rangle, \lvert 111 \rangle$.
How would you solve the circuit for the input state $\lvert 000 \rangle$ or $\lvert 111 \rangle$? My problem is figuring out how to deal with the state $\tilde{U}A$ in last two CNOT gates.
EDIT: to clarify what I want:
- I start with $\lvert \psi_{0} \rangle = \lvert 0, 0, 0 \rangle$
- after the first CNOT I get $\lvert \psi_{1} \rangle = \lvert 0, 0, 1 \rangle$
- after the second CNOT I get $\lvert \psi_{2} \rangle = \lvert 0, 1, 1 \rangle$
- ...
How would you write $\lvert \psi_{3} \rangle$, $\lvert \psi_{4} \rangle$, $\lvert \psi_{5} \rangle$? For this specific circuit, is it even possible to write the full steps like that?
"
"['quantum-gate', 'quantum-state']"," Title: What happens when I input two qubits starting at state $|00\rangle$ into a hadamard gate?Body: I was watching the following video https://www.youtube.com/watch?v=IrbJYsep45E
And around 3 minutes in, they do an example computation with two qubits. The qubits started off in the state $|00\rangle$, and then go through what I assume is a Hadamard gate which puts them in a superposition. Why is it a $50\%$ chance of being $|01\rangle$, and a fifty percent chance of being $|10\rangle$? Why is it not a quarter chance of being $|00\rangle$, $|10\rangle$, $|01\rangle$, and $|11\rangle$?
"
['entanglement']," Title: Does entanglement correlate qubits a $100\%$ of the time?Body: $\newcommand{\qr}[1]{|#1\rangle}$Say I begin with $4$ qubits $\qr{+}\qr{+}\qr{+}\qr{+}$ forming a register $B$. Name these qubits as $b_3, b_2, b_1, b_0$. Also, let $C$ be another register $\qr0\qr0\qr0\qr0$ whose qubit names are $c_3, c_2, c_1, c_0$.
Now apply $\operatorname{CNOT}(b_i, c_i)$, that is, entangle $b_3$ and $c_3$, $b_2$ and $c_2$ and so on. Suppose I measure $B$ and I obtain $\qr{0101} = \qr5$. What will I get if I measure $C$ now? I say I'll get precisely $\qr{5}$.
Does this happen a $100\%$ of the time?
"
['superposition']," Title: What's the meaning of applying $U_{\text{div}}$ to a register in superposition?Body: $\newcommand{\qr}[1]{|#1\rangle}$Say I begin with $10$ q-bits
$\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}$ forming
a register $B$. Name these q-bits as $b_9, ..., b_2, b_1, b_0$.
Apply a gate $U_{\operatorname{div}}$ to $B$. For clarity, assume
$U_\text{div}$ divides the number represented by q-bits $b_7 b_6 b_5 b_4 b_3
b_2 b_1 b_0$ by the number represented by $b_9 b_8$. The output of
$U_\text{div}$ is written as follows. It leaves $b_9 b_8$ alone, writes the
quotient of the division in $b_7 b_6 b_5 b_4 b_3 b_2$ and the rest is
written in $b_1 b_0$. (This makes sense: if only $2$ q-bits are
allowed for the divisor, the greatest divisor possible is $3$, so the
greatest rest possible is $2$, so $2$ q-bits for the rest is enough.)
Say now I measure $b_1 b_0$ getting the classical bits $01$, meaning
the rest of the division is $1$. Also I measure $b_7 b_6 b_5 b_4 b_3
b_2$ getting the classical bits $001110$, meaning my quotient is $14$.
Finally, say I measure $b_9 b_8$ getting the classical bits $10$.
This means I effectively had $a = 14\times 2 + 1 = 29$, where $a$
represents the dividend. But it seems to me impossible to talk about what $a$ had to be since $a$ would be written in q-bits $b_7 b_6 b_5 b_4 b_3
b_2 b_1 b_0$ which was $\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}\qr{+}$ at the start. It seems to me I could never infer the dividend in this experiment, though the only arithmetic that seems to make sense is $a = 14\times 2 + 1 = 29$.
What's going on here?
"
"['quantum-gate', 'gate-synthesis']"," Title: How to construct a quantum gate producing 1 if r divides x, 0 otherwise?Body: If you have two registers in the state $\frac{1}{2^{n/2}} \sum_{x = 0}^{2^{n/2} - 1} |x\rangle |0\rangle$, how could you construct a gate that produces a superposition of states $|x\rangle|1\rangle$ when some integer $r$ divides $x$, and $|x\rangle|0\rangle$ otherwise, for each input?
I.e. a unitary quantum gate that replicates the function $f(x) = \begin{cases} 1 \text{ if } r \text{ divides } x\\
0 \text{ otherwise}
\end{cases}$
"
"['architecture', 'd-wave', 'annealing', 'chimera', 'embedding']"," Title: When and where was the first use of the term Chimera?Body: This is along the same lines as the earlier question: When was the first use of the word Entanglement?
I was surprised to discover that when searching for ""chimera"" in both of Vicky Choi's minor-embedding papers:
https://arxiv.org/abs/0804.4884,
https://arxiv.org/abs/1001.3116,
no results came up!
This means that finding the first ""chimera"" paper is harder than I imagined and I don't know where to look anymore. When and where can I find the first use of the term?
"
"['algorithm', 'complexity-theory', 'solovay-kitaev-algorithm']"," Title: Does the GLOA have any advantage over the Solovay-Kitaev algorithm?Body: The Solvay Kitaev algorithm was discovered long before the Group Leaders Optimization algorithm and it has some nice theoretical properties. As far as I understand, both have exactly the same goals: given a finite dimensional unitary operator, they decompose the operator into basic quantum gates. I couldn't find any theoretical results about the time complexity or convergence time or error bounds for the GLOA as such. Does the latter (GLOA) have any practical advantage over the former at all, in terms of convergence time or anything?
P.S: For a detailed description of the GLOA, see: Understanding the Group Leaders Optimization Algorithm
"
"['complexity-theory', 'memory-space', 'space-complexity']"," Title: Can we use quantum machines to reduce space complexity of deterministic turing machines?Body: Can we convert every algorithm in $\text{P}$ (polynomial time complexity for deterministic machines) into a quantum algorithm with polynomial time and $O(\log n)$ quantum bit?
"
"['programming', 'q#']"," Title: Q# How to use a namespace in another project?Body: I have some utility operations that I'd like to use across projects. How can I import its namespace using Q# in Visual Studio 2017 in other projects?
"
"['matrix-representation', 'mathematics']"," Title: Simple proof that $(U \otimes V)(|x\rangle \otimes |y\rangle) = U|x\rangle \otimes V|y\rangle$?Body: This transformation comes up a lot during symbolic manipulation of quantum operations on state vectors. It's the reason why, for instance, $(X\otimes \mathbb{I}_2)|00\rangle = |10\rangle$ - it lets us operate on a single qbit by tensoring a unitary operation $U$ with identity operators where $U$ is at the same position of significance as the qbit to which we want to apply $U$.
I've been trying to write out a proof of why this transformation works, but I lack good notation for representing and reasoning about tensored matrices and vectors - it becomes very clunky very quickly. Is there a simple way to prove this transformation holds, or a convenient notation for representing tensored matrices/vectors?
Assume $U$ is a square complex unitary matrix of size $n$, $V$ a square complex unitary matrix of size $m$, $|x\rangle$ an $n$-element complex column vector where $\langle x|x\rangle=1$, and $|y\rangle$ an $m$-element complex column vector where $\langle y|y\rangle=1$.
"
"['quantum-gate', 'quantum-state']"," Title: Outcome of Hadamard transformation on a complex stateBody: I would like to calculate the state after a transformation using the Hadamard gate on a complex state. I get stuck mid-calculation, most likely due to not being able to dealing with the global state. Anybody who can tell me what the part on the question mark should be (and/or which other errors I made)?
$H {|0\rangle + i|1\rangle\over\sqrt 2} \equiv
{1\over\sqrt 2}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix} {1\over\sqrt 2} \begin{bmatrix} 1 \\ i \end{bmatrix} =
{1\over2} \begin{bmatrix}1+i\\1-i\end{bmatrix} =
? =
{1\over\sqrt 2} \begin{bmatrix}1\\-i\end{bmatrix}
\equiv
{|0\rangle - i|1\rangle\over\sqrt 2}
$
Update trying to use @DaftWullie his answer:
$H {|0\rangle + i|1\rangle\over\sqrt 2} \equiv
{1\over\sqrt 2}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix} {1\over\sqrt 2} \begin{bmatrix} 1 \\ i \end{bmatrix} =
{1\over2} \begin{bmatrix}1+i\\1-i\end{bmatrix} \neq
{1\over\sqrt 2} \begin{bmatrix}1+i\\1-i\end{bmatrix} =
\begin{bmatrix}{1\over\sqrt 2}+{1\over\sqrt 2}i\\{1\over\sqrt 2}-{1\over\sqrt 2}i\end{bmatrix} =
\begin{bmatrix}\cos(\pi/4)+i \cdot \sin(\pi/4)\\
(\cos(\pi/4)+i \cdot \sin(\pi/4))\cdot(\cos(\pi/2-i\cdot \sin(\pi/2))\end{bmatrix} =
\begin{bmatrix}e^{i\pi/4}\\e^{-i\pi/2}e^{i\pi/4}\end{bmatrix}=\\
e^{i\pi/4}\begin{bmatrix}1\\e^{-i\pi/2}\end{bmatrix}=
e^{i}e^{\pi/4}\begin{bmatrix}1\\e^{-i\pi/2}\end{bmatrix}\equiv
e^{\pi/4}\begin{bmatrix}1\\e^{-i\pi/2}\end{bmatrix} =
{1\over\sqrt 2}\begin{bmatrix}1\\-i\end{bmatrix}
\equiv
{|0\rangle - i|1\rangle\over\sqrt 2}
$
Here I still get partly stuck, as I was expecting to calculate using ${1\over 2}$ instead of ${1\over\sqrt 2}$. I see that this too falls into the category of ""multiplies the whole vector has no observable consequence"", but I wonder if I can calculate this ""cleaner"" (or did I simply make a mistake?).
Also, how do I indicate removing the global phase in an equation? Do I use the equivalence symbol? An equal symbol with a footnote above it?
"
['hamiltonian-simulation']," Title: Is there a way to express the general 4X4 Hamiltonian in some block diagonal form of 2X2 matrices that I can solve, knowing the exact solution of 2X2?Body: Is there a way to express the general $4 \times 4$ Hamiltonian in some block diagonal form of $2 \times 2$ matrices that I can solve, knowing the exact solution of $2\times 2$?
This is necessary for the treatment I am going to perform later, as I cannot go for general quartics solutions of this system. I need to see the action of the Hamiltonian to subspaces and the interaction between them.
"
"['entanglement', 'simulation']"," Title: How to simulate quantum entanglement variation in different quantum gates?Body: I'm trying to study quantum entanglement variation during quantum computation with 4 qubit systems comprising a variety of quantum gates.
How can I simulate this variation on MATLAB? Is there any other alternatives?
"
['resource-request']," Title: What are Grassmann-Plucker relations?Body: In Duality, matroids, qubits, twistors and surreal numbers (recently submitted!) they
show that via the Grassmann-Plucker relations, the various apparent unrelated concepts, such as duality, matroids, qubits, twistors and surreal numbers are, in fact, deeply connected.
The paper includes many interesting topics which I am not well versed in (Grassmannian, Plucker Embedding, Hopf Map, Matroids, etc) & am wondering if it might be possible that someone could explain Grassmann-Plucker relations & how they are used in a quantum context?
"
['cirq']," Title: How do I create my own unitary matrices that I can apply to a circuit in Cirq?Body: I am trying to simulate Deutsch's algorithm, and I need to apply the oracle function matrix to my circuit.
"
"['quantum-gate', 'matrix-representation']"," Title: Matrix representation and CX gateBody: I am having hard time figuring out how the CX (controlled-NOT) gate is represented in the matrix representation.
I understood that tensor product and the identity matrix are the keys, and I understood how the matrix representation works for single-qubit matrices. For example, if we have a circuit with a quantum register q composed of 3 qubits, the operation X q[1] has the matrix representation 1
$$I_2 \otimes X \otimes I_2 = \begin{pmatrix}
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&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}.$$
Obviously, I am aware of the matrix representation of the CX gate:
$$\begin{pmatrix}
1&0&0&0\\
0&1&0&0\\
0&0&0&1\\
0&0&1&0\\
\end{pmatrix}$$
Taking back our quantum register q, applying CX to the second (control) and third register (target) (CX q[1], q[2]) gives us the matrix representation 2
$$I_2 \otimes CX = \begin{pmatrix}
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&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}$$
The problem comes when we try to apply the CX gate to other pairs of qubits:
- I suspect the matrix representation of
CX q[2], q[1] (applying a CX gate with the third qubit of the system as control and the second qubit of the system as target) to be $I_2 \otimes CX^r$ where $$CX^r = \begin{pmatrix}
0&1&0&0\\
1&0&0&0\\
0&0&1&0\\
0&0&0&1\\
\end{pmatrix}$$
but I am not sure.
- I really don't know how
CX q[0], q[2] (applying a CX gate with the first qubit of the system as control and the third qubit of the system as target) would be represented.
To summarise, my question is ""how does the CX (or more generally multi-qubit gates) is represented as a matrix when there are more than 2 qubits in the system?"".
1 Computed with Python and numpy:
import numpy as np
X = np.array([[0, 1], [1, 0]])
ID2 = np.identity(2)
print(np.kron(np.kron(ID2, X), X))
2 Computed with Python and numpy:
import numpy as np
CX = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
ID2 = np.identity(2)
print(np.kron(ID2, CX))
"
"['applications', 'technologies']"," Title: Can quantum computing be profitable without quantum hardware?Body: What are the fields/business ideas that a new business can work on within quantum computing that can be profitable if this business has no access to onboard quantum setups but can access the cloud-based quantum computing platforms? What are the problems it can work on that can be valuable to industry?
"
"['quantum-state', 'resource-request', 'cloning']"," Title: Advances on imperfect quantum copyingBody: It is known by the no-cloning theorem that constructing a machine that is able to clone an arbitrary quantum state is impossible. However, if the copying is assumed not to be perfect, then universal quantum cloning machines can be generated, being able to create imperfect copies of arbitrary quantum states where the original state and the copy have a certain degree of fidelity that depends on the machine. I came across the paper Quantum copying: Beyond the no-cloning theorem by Buzek and Hillery where this kind of universal quantum cloning machine is presented. However, this paper is from 1996 and I am not aware if some advances in this kind of machines have been done yet.
Consequently, I would like to know if someone does know if any advances in such kind of cloning machines have been done since then, that is, machines whose fidelity is better than the one presented in such paper, or the methods are less complex ... Additionally, it would be also interesting to obtain references about any useful application that such machines present if there is any.
"
"['algorithm', 'complexity-theory', 'hhl-algorithm']"," Title: Why is there no $N$ in the time complexity of the QLSP algorithm by Childs et al.?Body: The paper Quantum linear systems algorithms: a primer by Dervovic et al has this table on page 3:
I'm not sure why there's no $N$ in the time complexity of the algorithm by Childs et al. i.e. $\mathcal{O}(s\kappa \ \text{polylog}(s\kappa/\epsilon))$. It's a bit hard to believe that the time complexity doesn't depend on the dimensions of the matrix involved. I also checked the original paper by Childs et al but I couldn't find the time complexity written in this form there. Any ideas?
"
"['classical-computing', 'grovers-algorithm', 'cryptography']"," Title: Can we speed up the Grover's Algorithm by running parallel processes?Body: In classical computing, we can run the key search (for example AES) by running parallel computing nodes as many as possible.
It is clear that we can run many Grover's algorithms, too.
My question is; it possible to have a speed up using more than one Grover's algorithm as in classical computing?
"
['quantum-gate']," Title: Why are oracles Hermitian by construction?Body: $\newcommand{\qr}[1]{|#1\rangle}$In this lecture, it is nicely explained how to define an operator that computes a function $f(x)$. I know how to implement such operators. (We just define $O\qr{x}\qr{y} = \qr{x}\qr{y \oplus f(x)}$.)
However, it it said in the lecture that this effectively proves $O = O^\dagger$ and I fail to see it so clearly. It says $O = O^\dagger$ by construction. How can I see that so clearly as it is implied?
"
"['algorithm', 'cryptography', 'grovers-algorithm']"," Title: Quantum attack on hash functionsBody: The line of questioning is inspired by the pick one trick in Section 4 of the PDF version of the paper
Quantum Attacks on Classical Proof Systems - The Hardness of Quantum Rewinding (Ambainis et al., 2014). Slides available here. I don't fully follow the argument there so maybe I missed something important but here is my interpretation of their trick.
Consider a classical hash function $x \rightarrow H(x)$ that is collision resistant i.e. it is computationally hard to find $H(x) = H(x') \land x\neq x'$. We wish to encode a commitment of a message using this hash function. That is, I take some message $m$ and concatenate some randomness $u$ at the end such that I generate a commitment $c = H(m\Vert u)$. When asked to prove my commitment, I cannot find a different pair $(m',u')$ such that $c = H(m'\Vert u')$ because of the collision-free nature of hashes. My only choice is to open the commitment to $(m,u)$.
Now, we attack this protocol with a quantum circuit of the hash function.
- Take a superposition over all possible inputs $x_i$ and query the hash function with this state to obtain the state $\vert\psi\rangle = \sum_{i}\vert x_i\rangle\vert H(x_i)\rangle$.
- Measure the second register to obtain a random commitment. The measurement randomly picks $c = H(x_i)$ for some $i$. The first register then has $\vert\phi\rangle = \sum_j \vert x_j\rangle$ such that $\forall j, c = H(x_j)$.
- I'd like to open the commitment to some $m'$ that is given to me by the opponent. Use Grover's search on the first register to find a $x_{\text{sol}}$ from the state $\vert\phi\rangle = \sum_j\vert x_j\rangle$ that satisfies some special property. Specifically, the special property is that the first $|m'|$ bits of $x_{\text{sol}}$ are $m'$. That is, I will search to find $x_{\text{sol}} = m'\Vert u'$.
Using the slides posted earlier (Slide 8) and their terminology, it is efficient to find a value $x$ from the intersection of two sets $S$ and $P$. Here $S$ is the set of all $x$ such that $H(x) = c$ and $P$ is the set of all $x$ where the first $|m'|$ bits of $x$ are exactly $m'$.
My questions regarding this attack are the following:
- Did I get the basic idea of the attack correct? If wrong, ignore the rest of the post!
- How many elements are there in the superposition $\vert\phi\rangle$ after we commit to a certain $c$? In order that I can open the commitment to any message, it seems like I should have $O(N)$ (the size of the hash function's range) elements. But this is too large.
- The speed of Grover search - this is related to the previous point - is the other thing. Wouldn't the computational complexity of searching over such a large superposition $\vert\phi\rangle$ be the same as trying to guess a pre-image for a given output of the hash function since one has to search over all the $u$? In this case, where is the advantage?
I'm looking for the intuition more than mathematical proofs so any help is greatly appreciated!
"
"['error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: Why is the $N$-qubit stabilizer group abelian?Body: In Devitt et al. 2013's introduction to quantum error correction, the authors mention (bottom of page 12) how the stabilizer group for $N$ qubits is abelian.
More specifically, here is the quote:
An $N$-qubit stabilizer state $\lvert\psi\rangle_N$ is then defined by the $N$ generators of an Abelian (all elements commute) subgroup $\mathcal G$ of the $N$-qubit Pauli group,
$$\mathcal G=\{K^i\,|\,K^i\lvert\psi\rangle=\lvert\psi\rangle,\,[K^i,K^j]=0,\forall (i,j)\}\subset \mathcal P_N.$$
I am confused by this. Is the stabilizer subgroup $\mathcal G$ defined as an abelian subgroup of elements of $\mathcal P_N$ that stabilizes $\lvert\psi\rangle$, or is it instead the case that the subgroup of elements of $\mathcal P_N$ that stabilize $\lvert\psi\rangle$ is abelian?
If the latter, doesn't this introduce ambiguity in the definition? There could be other elements that stabilize $\lvert\psi\rangle$ but not commute with $\mathcal G$.
If the former, how is this shown? I can see why the action of $K^i K^j$ and $K^j K^i$ is identical on $\lvert\psi\rangle$, but how do you show that $K^i=K^j$?
"
"['algorithm', 'quantum-gate', 'programming', 'circuit-construction', 'qiskit']"," Title: How can the state $\lvert0\rangle+M^{-1/2}\sum_{j=1}^M\lvert j\rangle$ be generated?Body: I was wondering if anybody to help me to generate the following state.
It would be preferable if you use only Hadamard, CNOT and T-gates, on $\lceil\log_2(M+1)\rceil$ qubits:
$$|\psi\rangle = \frac{1}{\sqrt{2}}\biggl(|0\rangle + \frac{1}{\sqrt{M}}\sum_{j=1}^M|j\rangle\biggr)$$
Assume M is a power of 2 value.
"
"['error-correction', 'surface-code']"," Title: Is the common depiction of a surface code to be taken literally as a real-space image of the actual hardware?Body: I'm currently reading the paper ""Surface codes: Towards practical large scale quantum computing"" and have a couple of very basic questions that if answered will help me contextualize and organize the information in this paper much better. I understand the requisite info for basic QC topics but have the sneaking feeling I'm missing/misunderstanding some implicit abstraction core to the topic of surface codes. And so, would like to double check my intuitions against someone's actual knowledge.
- Is a surface code an architecture onto which logical qubits, logical operations, and their connections are physically implemented? That is, is the common depiction of a surface code (the pattern of the measure qubits and data qubits) to be taken literally as a real-space image of the actual hardware or does it correspond to some abstraction in software that I'm not quite grasping?
- Are quantum computers currently designed to compile programs into a surface code implementation or are surface codes still a theoretical framework due to the massive amount of qubits that are needed?
Thank you.
"
"['quantum-gate', 'circuit-construction']"," Title: How to prevent future loops using a control qubit?Body: I am trying to construct a quantum multiplier using the method described here: https://arxiv.org/abs/quant-ph/0403048. However, it seems that the control qubit would only disable the following gates for one iteration. Afterward, the $|y\rangle$ would still be in the fundamental, so would flip $D$ again and enable the next iteration of gates. How do I prevent all future iterations (essentially break out of the loop) using a control qubit?
"
['quantum-gate']," Title: Why is the CNOT gate matrix a valid representation for two-qubit states?Body: Can anyone explain how the CNOT matrix below is a valid presentation for the four-qubit states that follow after?
|0 0> -> |0 0>
|0 1> -> |0 1>
|1 0> -> |1 1>
|1 1> -> |1 0>
Source: Wikipedia
"
"['quantum-gate', 'unitarity']"," Title: If a unitary is such that $U|0\rangle=a|0\rangle+b|1\rangle$, what is $U|1\rangle$?Body: If we have a $U$ (unitary with all real entries) such that:
$U|0\rangle =a|0\rangle +b|1\rangle$
What is $U|1\rangle=?$
I know: the definition of what it means to be unitary ie. $U^\dagger U=UU^\dagger =I$
I've worked out: for $U|1\rangle=c|0\rangle+d|1\rangle$ must satisfy $ac+bd=0$ (by taking it's dagger and multiplying it for the constants).
Is this the only information we can derive? How can I write $U|1\rangle$?
"
"['resource-request', 'games']"," Title: In which paper was the CHSH game first presented?Body: The CHSH inequality was presented in the paper Proposed Experiment to Test Local Hidden-Variable Theories published in 1969 by J.F. Clauser, M.A. Horne, A. Shimony, and R.A. Holt. I'm interested in which paper first presented their proposed experimental apparatus in nonlocal game format, presumably also introducing & defining the concept of nonlocal games in general.
"
"['entanglement', 'graph-states']"," Title: The classical simulation of 2D graph state and the measurement based quantum computationBody: In my former post on Physics SE I deduced a contradiction in the classical simulation of 2D graph state and the classical simulation of general measurement-based quantum computation.
In Norbert's answer, he mentioned that the serial measurements on the graph state cannot be classically simulated.
This might be the right answer if we admit that a general quantum computation cannot be efficiently simulated classically. Especially if the quantum computation is not measurement based but rather a normal quantum circuit based implementation, since even the initial state can be simulated classically, the evolution of the state may change the state and the entanglement pattern so that it does not fulfill a certain criterion for the classical simulation.
But for measurement based QC, the measurement is carried out on each individual qubit and the measurement on one qubit will not change the state of another qubit. So the sequential measurements on each qubit can all be classically simulated. Then the contradiction is still there.
I am sure there must be something wrong with my deduction. Please help me to find it.
"
"['entanglement', 'complexity-theory', 'information-theory']"," Title: Relation between quantum entanglement and quantum state complexityBody: Both quantum entanglement and quantum state complexity are important in quantum information processing. They are usually highly correlated, i.e., roughly a state with a higher entanglement corresponds to a higher quantum state complexity or a complex state is usually highly entangled. But of course this correspondence is not exact. There are some highly entangled states that are not complex quantum states, for example quantum states represented by branching MERA.
On the other hand, if we use the geometric measure of entanglement (defined as the minimal distance to the nearest separable state w.r.t. a certain distance metric in Hilbert space) to justify the entanglement, then it seems it's very similar with the definition of quantum state complexity (the minimal distance to a simple product state). If we only consider pure states and choose the same distance metric for them, for example, the Fubini-Study distance or Bures distance, then they are really almost identical.
Of course, when we are talking about state complexity, it's better to use the more physically motivated 'quantum circuit complexity' to measure the distance. But still, this distance can also be used to define the geometric measure of entanglement(maybe it's not a perfect distance measure for entanglement).
Then what's the relationship between entanglement and quantum state complexity? Are they essentially two different distance measures on Hilbert space? What should be the optimal metrics for them?
Or, if entanglement and complexity are both distance measures on the Hilbert space, can we find a transformation between these two metrics?
"
"['algorithm', 'entanglement', 'tensor-networks']"," Title: How can blackholes be fast information scramblers?Body: I noticed that there was already a post discussing the fast scrambling property of black holes. But it seems no satisfactory answer was given.
As mentioned by L. Susskind et. al, the fast scrambling property of BHs seems to say BHs are infinite dimensional systems so that every pair of qubits can directly interact 'locally' so that the fast scrambling can be implemented by BHs. He also mentioned that this is due to the effect of gravity during the collapse procedure.
I am wondering, how such a gravitational collapse can lead to such an 'infinite dimensional' geometry? If the geometry is related with tensor networks, then what's the correspondent tensor network of BHs? It sounds very strange for me.
An alternative is that maybe we do not need such an 'infinite dimensional' geometry, instead if the internal geometry of BHs is a manifold with a vanishing geodesic distance as discussed here, then the fast scrambling assumption may also be valid. But still, how such a geometry can be built inside a BH? Also, it seems that such a vanishing geodesic manifold should be an infinite dimensional manifold too.
"
"['entanglement', 'measurement', 'cryptography']"," Title: BB84 attack with entangled qubits exampleBody: BB84 attack with entangled qubits example
Hi, I'am interested in an attack for BB84 protocol with entangled quibits.
Lets say Alice sends a qubit $x$ in state $\left|1\right>_x$ to Bob and Eve takes the CNOT gate to
entangle the states. Therefore, Eve uses a qubit $e$ in state $\left|0\right>_e$. Using CNOT gate the result of this operation is
$$\left|1\right>_x\left|0\right>_e\rightarrow \left|1\right>\left|1\right>.$$
Let's say now Bob measures base B in 90° and 0° orientation (the $|0\rangle/|1\rangle basis). Alice and Bob communicate their choice of basis over the
classical channel. Eve now knows the orientation and therefore measures her entangled qubit in the right orientation.
That means Eve knows now the bit value of the key, lets say 1.
But what would be the case if Alice sends now a qubit in the state
$$\frac{1}{\sqrt{2}}(\left|0\right>_x-\left|1\right>_x)?$$
Eve would create the entangled state
$$\frac{1}{\sqrt{2}}(\left|00\right>-\left|11\right>)$$
There are two different cases depending on Bob's choice of basis:
- case 1: Alice sends the qubit to Bob and Bob measures in the wrong base B 90° and 0° orentation, therefore nothing happens, because Alice and Bob have different bases.
- case 2: But what if Bob measures in diagonal base 45° and -45° ($|\pm\rangle=(|0\rangle\pm|1\rangle)/\sqrt{2}$). Someone said that BB84 protocol covers this in 50% of cases. But why is it like that?
A measurement in 45° and -45° basis is equal to use the Hadamard transform and a measurement in base B (90°,0°).
So it results in something like this (Bob measures the first bit):
$$H(\left|x\right>)\left|e\right>=\frac{1}{\sqrt{2}}((H\left|0\right>)\left|0\right> - (H\left|1\right>)\left|1\right>)$$
this comes to
$$\frac{1}{2}(\left|00\right>-\left|01\right>+\left|10\right>+\left|11\right>)$$
But why does this result does not agree with Alice's bit?
Why does the BB84 protocol expose 50% of cases (in my example)?
I hope I made understandable what I wanted to ask.
I know that it is complicated. I would be very happy to receive an answer. Thank you!
"
"['quantum-state', 'simulation', 'classical-computing']"," Title: Could we use varying voltage with programmable gates?Body: One of the benefits I'm reading about qubits is that they can be in an infinite number of states. I'm aware of Holevo's bound (even though I don't fully understand it). However, it made me think of why we haven't tried varying voltage on classical computers and have programmable gates to control what passes in terms of a voltage. In that way, we could simulate quantum computing more closely.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qubits specification on IBMQ devicesBody: As it is shown here, CNOT gates between different qubits have different error rates. I have the following questions:
1) While defining a circuit on QISkit, does q[0] always correspond to the same qubit on a device (e.g. the qubit labeled q0 on the device manual)? If so, how can I only use for example qubit 12 and 13 of ibmq_16_melbourne (just as an example)?
2) If one job is being executed on a device, say for instance using 3 qubits, is any other job running on that device at the same time?
3) How many CNOT gates one circuit can have so that its error stays reasonable? Basically, how deep can a circuit be on any of the devices to get a reasonable result?
Thank you.
"
"['algorithm', 'simulation', 'deutsch-jozsa-algorithm', 'oracles']"," Title: How would I implement the quantum oracle in Deutsch's algorithm?Body: I am trying to simulate Deutsch's algorithm (elementary case of Deutsch-Jozsa algorithm), and I am not entirely sure how I would go about implementing the quantum oracle necessary for the algorithm to function, without defeating the purpose of the algorithm and "looking" at what the inputted function is, by evaluating the function.
"
['resource-request']," Title: Tools for creating quantum circuit diagramsBody: What tools exist for creating quantum circuit diagrams and exporting them as images? Preferably one which runs in Windows, or even better one which runs in the web browser.
"
['quantum-state']," Title: Transformation of a Bell stateBody: I am relatively new and interested in quantum computing.
Specifically, I am interested in transforming an equation that I found on Wikipedia. But I did not quite understand the transformation.
$ \frac{1}{\sqrt{2}}(\left|0\right>_x\left|0\right>_y-\left|1\right>_x\left|1\right>_y) = \frac{1}{\sqrt{2}}(|+\rangle_x|-\rangle_y+|-\rangle_x|+\rangle_y) $
My idea is so far to use Hadamard transform for the two qubits:
$ \frac{1}{\sqrt{2}}(H(\left|0\right>_x\left|0\right>_y)-H(\left|1\right>_x\left|1\right>_y)) $
I have used the Hadamard transformation and now come to this:
$ = \frac{1}{\sqrt{2}}(\frac{1}{2}[(\left|00\right>+\left|10\right>+\left|01\right>+\left|11\right>) -(\left|00\right>-\left|10\right>-\left|01\right>+\left|11\right>)]) $
If I simplify that a bit now then I have that as a result:
$ = \frac{1}{\sqrt{2}}(\left|1_x0_y\right>+\left|0_x1_y\right>) $
But the result looks different now than the equation I wrote down at the beginning:
$ = \frac{1}{\sqrt{2}}(\left|1_x0_y\right>+\left|0_x1_y\right>) = \frac{1}{\sqrt{2}}(|+\rangle_x|-\rangle_y+|-\rangle_x|+\rangle_y) $
I do not know if the forming is allowed that way. If somebody knows how the transformation of the equation works, so that I get what I wrote in the beginning, I would be very happy if somebody could explain it!
I hope that my question is understandable :)
"
"['programming', 'grovers-algorithm', 'q#']"," Title: Practical example of Grover's algorithm (in Q#)Body: Is there any real example for Grover's algorithm but with real database (generated from SQL or file)? I download the Q# development kit & its example, there was one call DatabaseSearchExample claim to use Grover's but it technically doesn't have any kind of database. May I ask a code for this if available?
"
"['entanglement', 'density-matrix', 'entropy']"," Title: Maximally mixed states for more than 1 qubitBody: For 1 qubit, the maximally mixed state is $\frac{\mathrm{I}}{2}$.
So, for two qubits, I assume the maximally mixed state is the maximally mixed state is $\frac{\mathrm{I}}{4}$?
Which is:
$\frac{1}{4} (|00\rangle \langle 00| + |01\rangle \langle 01| + |10\rangle \langle 10| + |11\rangle \langle 11|)$
Why is this state more mixed than the following, for instance?
$\frac{1}{2} (|00\rangle \langle 00| + |11\rangle \langle 11|)$
Also, does this generalize to higher dimensions similarly?
"
"['quantum-gate', 'quantum-state', 'gate-synthesis']"," Title: Circuit to construct a $n$-qubit state which is a superposition of states with only a single qubit being $\lvert1\rangle$Body: So the question came up in a book I am working through. Given a circuit with $n$ qubits, construct a state with only $n$ possible measurement results, each of which has only $1$ of $n$ qubits as $1$, such as $|0001\rangle$, $|0010\rangle$, $|0100\rangle$, $|1000\rangle$, obviously normalized.
The only way I can think to do this is to take the all $|0\rangle$ input state, apply $\operatorname{H}$ to each qubit and then used multiple-controlled $\operatorname{CNOT}$ gates to affect the change on each qubit, but I feel like this won't lead to the desired end state.
To be clear, I am enquiring how to create a $W_n$ state can be arbitrarily prepared, given $n$ qubits.
"
['cpt-symmetry']," Title: What is the ""CP"" operation in the context of anti-particles?Body: In this question on Quora: What is meant by ""the photon is its own antiparticle""?, an answer is given which states:
In quantum theory, we have a procedure for transforming the wave function of a particle into that of an antiparticle. It is called the ""CP"" operation.
Unfortunately, the author of the answer does not explain what the ""CP"" operation is.
What is the ""CP"" Operation in the context of anti-particles?
"
['error-correction']," Title: Why does this error correcting code not work?Body: I was thinking of an error correcting code to correct 1-qubit errors. I came up with the following, which I guess has to have a mistake somewhere, but I am not able to find it.
The code is the same as the 9 qubit Shor code with one small difference. As in the Shor code, first we encode our qubit using the 3-qubit phase code. Then, instead of further encoding the 3 qubits against bit-flip errors, we only encode one of them, namely, the one that contains the state that we want to protect. The resulting code would be the following $$\small{|0\rangle \rightarrow |00000\rangle + |00001\rangle + |00010\rangle + |11100\rangle + |00011\rangle + |11101\rangle + |11110\rangle + |11111\rangle}$$
$$\small{|1\rangle \rightarrow |00000\rangle - |00001\rangle - |00010\rangle - |11100\rangle + |00011\rangle + |11101\rangle + |11110\rangle - |11111\rangle}$$
Thank you!
"
"['communication', 'quantum-networks']"," Title: How to test with the ""Quantum Internet""?Body: I want to test some ideas using the quantum internet. I know that is not widely available now. Can it be simulated? Are there any simulation systems which allow -
- Entanglement
- Testing states
- Integration states in third-party systems (eg C++ programs)
The kind of tool would be useful, would basically confirm certain properties of the communications and how they could then be used in a classical layer e.g. for communications.
"
"['quantum-gate', 'complexity-theory', 'gate-synthesis']"," Title: Clarification needed: ""Simulation"" of $e^{-iHt}$ and its time complexityBody: On page 3 here it is mentioned that:
However, building on prior works [32, 36, 38] recently it has been
shown in [39] that to simulate $e^{−iHt}$ for an $s$-sparse Hamiltonian
requires only $\mathcal{O}(s^2||Ht||\text{poly}(\log N,
\log(1/\epsilon)))$, breaching the limitation of previous algorithms
on the scaling in terms of $1/\epsilon$.
Questions:
- What is meant by ""simulate"" in this context? Does it mean it takes $$\mathcal{O}(s^2||Ht||\text{poly}(\log N,
\log(1/\epsilon)))$$ time to decompose $e^{-iHt}$ into elementary quantum gates given we know $H$. Or does it mean we can compute the matrix form of $e^{-iHt}$ in $$\mathcal{O}(s^2||Ht||\text{poly}(\log N,\log(1/\epsilon)))$$ time given we know the matrix form of $H$?
- What does $||Ht||$ mean here? Determinant of $Ht$? Spectral norm of $Ht$? I checked the linked ppt and it seems to call $||H||$ the ""norm"" of $H$. Now I have no idea how they're defining ""norm"".
"
['topological-quantum-computing']," Title: Is there any tool or simulator for Topological quantum gates and circuits?Body: I am starting to step into the field of Topological Quantum Information and Computation and am in search of tools which I can use to directly simulate or realize these transformations in a textual or graphical manner.
"
"['algorithm', 'chemistry']"," Title: Electronic structure calculations and the Ising model: practical?Body: I was reading this paper which introduces a mapping from a qubit Hamiltonian to an Ising model. Firstly, the first step of the mapping seems to assume that we know an eigenstate of the system (correct me here because it seems unlikely in practice). Below, is the mention of the first step :
Secondly, such mapping seems extremely costly if we look at their complexity.
My question is: would this method be considered interesting for practice compared to classical methods and how can this be implemented on practical examples?
"
"['algorithm', 'simulation', 'quantum-turing-machine', 'deutsch-jozsa-algorithm']"," Title: Deutsch Algorithm on a Quantum Turing MachineBody: I understood how a Quantum Turing Machine works from this lecture.
It would be great if someone could give an example of how this machine could be used to solve a real problem though, for example, simulate the Deutsch algorithm on a Quantum Turing machine.
"
"['quantum-gate', 'circuit-construction']"," Title: Mapping Algebraic Normal Form of Exclusive Sum of Products to Toffoli NetworkBody: How does one map an ANF to a toffoli network? Is there a straight-forward procedure for doing this?
For example, given the ANF for the Sum function of an adder:
$$S = A \oplus B \oplus C \oplus ABC$$
I thought that mapping would be trivial following the process of
1) Perform $A \oplus B$ with two CNOT gates, storing the result in ancilla bit, call it $Anc_1$
2) Perform $Anc_1 \oplus C$ with two CNOT gates, storing the result in $Anc_2$
3) Perform $Anc_2 \oplus ABC$ using a CNOT and a 3-control bit toffoli, storing the result in the output, $S$
This process results in this circuit
Why does this not work? What is the process to map an ANF to a toffoli network?
Thank you
PS I apologize for not being able to find an appropriate tag.
"
"['teleportation', 'superdense-coding']"," Title: Why is super-dense coding called the inverse of quantum teleportation?Body: I am new to quantum computation and I recently came across the statement that super-dense coding can be called the inverse of quantum teleportation
"
"['terminology', 'oracles']"," Title: What exactly is an oracle?Body: What exactly is an ""oracle""? Wikipedia says that an oracle is a ""blackbox"", but I'm not sure what that means.
For example, in the Deutsch–Jozsa algorithm,
$\hspace{85px}$
,
is the oracle just the box labeled $`` U_f "" ,$ or is it everything between the measurement and the inputs (including the Hadamard gates)?
And to give the oracle, do I need to write $U_f$ in matrix form or the condensed form: $U_f$ gives $y \rightarrow y \oplus f(x)$ and $x \rightarrow x$ is enough with respect to the definition of an oracle?
"
['tensor-product']," Title: What role does the non-commutativity of the tensor product play in experimental quantum computation?Body: We know that $H_A\otimes H_B\neq H_B\otimes H_A$ (in general). Theoretically, we know the formalism and what observables to construct from the two compositions possible, but we never talk about both the possibilities. I wish to know that how experimentally the Measurements or Evolutions are done over such composite systems (let's just assume a bipartition as above).
How does the experimentalist know whether he is working in the $A\otimes B$ or $B\otimes A$ composite Hilbert Space?
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: How is the Deutsch-Jozsa algorithm faster than classical for practical implementation?Body: There is something I really misunderstand about the Deutsch-Jozsa algorithm.
To check if $f$ is balanced or constant, we use the following algorithm:
where $U_f$ gives $(x,y) \rightarrow (x, y \oplus f(x))$.
Let's take $n=1$ for simplicity (thus the function $f$ is defined on $(0,1)$). We have four possible $U_f$ associated to two constant possibilities ($f$ equal to $0$ or $1$), and two balanced possibilities.
So, in practice, if I want to implement this in a circuit, I have to know exactly the "matrix" of $U_f$. And to do it I have to compute $f$ two times. Thus, I know if $f$ is balanced or constant even before having applied the quantum algorithm. So for a practical aspect, I don't understand what is the point of this.
Said differently, if I am given $U_f$ I agree that in one step I will know if $f$ is balanced or constant. But if I know $U_f$ I already know the answer to this question.
I am a little confused...
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Balanced vs unbalanced superposition distinguisherBody: I've been looking at basic quantum algorithms such as the Deutsch-Jozsa algorithm that are able to characterize functions very well and I was wondering if similar approaches exist to characterize quantum states.
Consider the following example: Given a normalized state $\sum_{i=1}^{N} a_i\vert x_i\rangle$, is there some way to check if all the $a_i = 1/\sqrt{N}$ or if there exists some $a_i$ that are different from the others?
My initial lines of thinking were to apply a Hadamard on the state but for large $N$, it's not clear if that approach helps. Do you have any ideas on how to proceed, or is it the case that such problems are not things that quantum computers can help with?
EDIT: I should have emphasized some features of my question better
1) $N$ is large, yet the ""unbalancedness"" i.e. the variance among the $a_i$ can be small. Hence POVM measurements will succeed in giving me the answer with very low probability.
2) Methods that distinguish between two known non-orthogonal states seem slightly hard to apply since my question is subtly different. I ask if my state is of a specific kind (balanced) or not. Intuitively, my question seems easier to answer.
3) I should have stated it earlier but one can assume that one is allowed $c\ll N$ copies of the state if this helps.
"
"['ibm-q-experience', 'noise', 'quantum-operation', 'rigetti']"," Title: How are Rigetti and IBM QX device parameters related to Kraus operators?Body: Rigetti reports the following parameters: (https://www.rigetti.com/qpu)
- T1, T2* times
- 1-qubit gate fidelity (F1q)
- 2-qubit gate fidelity (F2q) and,
- read-out fidelity (Fro)
IBM QX reports the following: (https://quantumexperience.ng.bluemix.net/qx/devices)
- T1, T2 times
- (single) qubit gate error
- multi-qubit gate error and,
- read-out error.
I understand that one can simulate the effect of noise on qubit state using operator-sum representation. According to Nielsen and Chuang, the operation elements are:
Amplitude damping
$E_0 = \begin{bmatrix} 1 & 0\\ 0 & \sqrt{1-\gamma}\end{bmatrix}$ $E_1 = \begin{bmatrix} 0 & \sqrt{\gamma}\\ 0 & 0\end{bmatrix}$
Phase damping
$E_0 = \begin{bmatrix} 1 & 0\\ 0 & \sqrt{1-\gamma}\end{bmatrix}$ $E_1 = \begin{bmatrix} 0 & 0\\ 0 & \sqrt{\gamma}\end{bmatrix}$
Phase flip
$E_0 = \sqrt{p}\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}$ $E_1 = \sqrt{1-p} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix}$
Bit flip
$E_0 = \sqrt{p}\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}$ $E_1 = \sqrt{1-p} \begin{bmatrix} 0 & 1\\ 1 & 0\end{bmatrix}$
Bit-phase flip
$E_0 = \sqrt{p}\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}$ $E_1 = \sqrt{1-p} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix}$
Depolarizing channel
$E_0 = \sqrt{1-3p/4}\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}$ $E_1 = \sqrt{p/4} \begin{bmatrix} 0 & 1\\ 1 & 0\end{bmatrix}$
$E_2 = \sqrt{p/4} \begin{bmatrix} 0 & -i\\ i & 0\end{bmatrix}$ $E_3 = \sqrt{p/4} \begin{bmatrix} 1 & 0\\ 0 & -1\end{bmatrix}$
How are the original device parameters related to the parameters in the operations elements i.e., $p$ and $\gamma$? (A first-order approximation of relation between these parameters are also welcomed.)
[P.S. are operations elements described in N&L and Kraus operators the same thing?]
"
"['error-correction', 'resource-request', 'fault-tolerance']"," Title: Where do we put error correction code in quantum circuit?Body: First of all : I am a beginner in quantum computing.
I would like to have a resource (or an answer if it is not complicated) explaining where we put the error correction codes in a quantum circuit.
Indeed, I know we have different possible errors that can occur (bit flip, phase flip etc), and we have algorithm to correct them. But what I would like to know is if there are some strategies to where we put the error correction algorithm. Is it after each gate involved of the main algorithm ? Is there a smarter strategy used to do a single correction for a set of gates ?
If the answer is ""complicated"" I would like to have a resource to learn all this (I find a lot of things for error correction code, but I haven't found anything about where we must do the correction).
"
"['randomised-benchmarking', 'games', 'blind-quantum-computing']"," Title: Using XOR games to benchmark quantum computersBody: In an answer to a previous question, What exactly are Quantum XOR Games?, ahelwer states:
One application of xor games is self-testing: when running algorithms on an untrusted quantum computer, you can use xor games to verify that the computer isn't corrupted by an adversary trying to steal your secrets!
In an answer to a different previous question, How to benchmark a quantum computer? (which includes a link to Using a simple puzzle game to benchmark quantum computers by James Wootton), DaftWullie suggests blind quantum computation as a general strategy.
How can XOR games be used to perform blind quantum computations to benchmark quantum computers?
"
"['superconducting-quantum-computing', 'physical-qubit']"," Title: What limits scaling down the size of superconducting qubits?Body: There are multiple ways of building a qubit: Superconducting (transmons), NV-centers/spin-qubits, topological qubits, etc.
The superconducting qubits are the most well-known qubits and are also the easiest to build. The machines by IBM and Google, for instance, use superconducting qubits.
Spin qubits have sizes in the order of a few nanometers and thus have great scaling capabilities. The problem with superconducting qubits, on the other hand, is the size. Apparently, it is hard to shrink the size of a superconducting qubit (typically ~0.1mm).
What is the limiting factor in the size of superconducting qubits and why can this limiting factor not be scaled down?
"
"['quantum-gate', 'circuit-construction', 'programming']"," Title: Is it better to use fewer gates or fewer working qubits?Body: I have a script that takes a while to simulate. I can modify it in such a way where I can use fewer qubits at a time, but it will require more iterations of manipulation. I believe this will cut down on simulation time, but does is it worse when running on an actual quantum computer? It will still run in polynomial time, regardless.
I am thinking I should go with the fewer qubits and more gates method, since I would free up qubits for others and cut my simulation time, but I would like to know which is technically the better way, computationally.
"
['mathematics']," Title: Is the computational basis for Hilbert space transfinite?Body: In What is the Computational Basis? gIS states:
One also often speaks of ""computational basis"" for higher-dimensional states (qudits), in which case the same applies: a basis is called ""computational"" when it's the most ""natural"" in a given context.
The Wikipedia page for Hilbert space includes this snippet:
When that set of axes is countably infinite, the Hilbert space can also be usefully thought of in terms of the space of infinite sequences that are square-summable. The latter space is often in the older literature referred to as the Hilbert space.
If the Hilbert space has countably infinite axes, is the computational basis for it transfinite?
Additionally, would it be accurate to state that computations with finite bases correlate to classical computations, while computations with transfinite bases correlate quantum computations?
"
"['architecture', 'classical-computing']"," Title: Understanding (theoretical) computing power of quantum computersBody: I am very new to quantum computing and just try to understand things from a computer scientist's perspective.
In terms of computational power, what I have understood,
100 ideal qubits ... can equate to [$2^n$ pieces of information]
Now Rigetti Computing has announced a 128 qubit computer.
Let's imagine they indeed release it next year.
This leads me to the following thoughts, please correct me if I am wrong:
- let's say hypothetically due to the noise about 28 qubits can't be taken into consideration (as used for the fault tolerance for example)
- that is, we could work with 100 qubits as in the example above.
Could we say then, we have an analog of von Neumann architecture i.e. say 64 qubits go for memory and 32 qubits for the instruction set (say remaining 4 are reserved).
Does this mean then (oversimplified!):
- we get 2^32 bits equivalent ~ 537 MB worth of ""register bits"" for CPU instructions, altogether with caches (no idea who might need that but could probably become a many-core ""die"" see for example Quantum 4004), compared to say 512KB=2^15 bits cache for one level on a classical computer
- and for ""RAM"", we get remaining 2^64 bits equivalent = 2.3 exabytes worth memory? (way more than current supercomputers have; Google had though reportedly total disk storage of 10 exabytes in 2013)
"
"['physical-realization', 'physical-qubit', 'technologies']"," Title: Is there any single-logical-qubit physical device out there as of end 2018?Body: By my first impression, there are many-qubits computers out there and more to come, as to follow the press.
Now a closer look reveals that it's all about designing and building physical qubits.
Then, as it seems from further reading, you actually need quite many physical qubits (dozens or hundreds) to come close to a practically usable logical qubit.
So does it mean after all, nobody has yet built any single logical qubit?
Note. This question is meant to understand the state of the art as applyied to computing, not to blame it!
"
['measurement']," Title: Can one ever find the elements of a superposition state?Body: Given some set of basis states $\{\vert 0\rangle, \vert 1\rangle, \vert 2\rangle...\vert N\rangle\}$ and an unknown superposition of the form $\frac{1}{\sqrt{2}}(\vert i \rangle + \vert j \rangle)$, what exactly forbids us from computing $i$ and $j$? I know about the no cloning theorem but why can I not see it from a single copy of the state?
"
"['entanglement', 'programming']"," Title: Are there any test examples of Octave and Quantum Entanglement?Body: I read this research paper.
I have octave and the package running.
This is an example of what I did so far -
octave:3> s1 = state(normalize(ket([1,0])+ket([0,1])))
s1 =
0.00000 0.00000 0.00000 0.00000
0.00000 0.50000 0.50000 0.00000
0.00000 0.50000 0.50000 0.00000
0.00000 0.00000 0.00000 0.00000
How would I see whether or not a state is entangled? Are there any examples using octave demonstrating entanglement?
"
"['nielsen-and-chuang', 'fidelity']"," Title: Intuitive role of the polar decomposition in proof of Uhlmann's theorem for fidelityBody: I have read the Wikipedia article which relates the polar decomposition to a complex number being split into its modulus and phase but this analogy isn't very intuitive to me.
In Nielsen and Chuang, the polar decomposition is especially important in proving results around fidelity. If I have states $\rho \in H_{R}$ and $\sigma \in H_{Q}$, Uhlmann's theorem shows that the best purification that preserves fidelity $F(\rho, \sigma)$ is some state in $R\otimes Q$ and gives us a method to find it. Set state $ m = \sum_i\vert i_R\rangle\vert i_Q\rangle$. Now
$\vert\psi\rangle = 1\otimes \sqrt{\rho}\vert m\rangle$
$\vert\phi\rangle = 1\otimes \sqrt{\sigma}V^{\dagger}\vert m\rangle$
gives the purification that preserves fidelity. Here, the polar decomposition of $\sqrt{\rho}\sqrt{\sigma}$ is $|\sqrt{\rho}\sqrt{\sigma}|V$.
While I can follow the proof in Nielsen and Chuang, I have no intuition about what the polar decomposition is doing here and why this particular purification preserves fidelity.
I'm looking for intuition only, so proofs are unimportant. Could someone help with simple example states and how they transform under different purifications and why the polar decomposition-based purification works best?
"
"['circuit-construction', 'adiabatic-model']"," Title: Can we do adiabatic quantum computing with a quantum circuit model and how?Body: This is a question that must be asked a lot but is it possible? And if in theory possible, what are the challenges to do it, and what are the drawbacks?
"
"['quantum-state', 'programming']"," Title: Why do $n$ inputs to a ket give a vector of dimension $(2^n,1)$?Body: NB - notation from Octave.
I understand that
ket([0])
is the $(1,0)$ in a $(x,y)$ plane.
But when I try a ket with three numbers I get a column vector of dimension $(8,1)$. I assume that comes from $2^3=8$ ie there are $2^n$ states for $n$ variables in the ket.
But how is that understood in terms of a vector space? I have seen the algebra online but that has not really explained how the vector space can be envisioned. I am mainly trying to relate a column position to a physical characteristic or at least explain why that size would exist.
octave:27> ket([0,1])
ans =
0
1
0
0
octave:28> ket([0,1,1])
ans =
0
0
0
1
0
0
0
0
"
"['entanglement', 'superdense-coding']"," Title: Controlling high-dimensional Hilbert spaces with a single qubitBody: In superdense coding, you can use one qubit to control the Hilbert space of two qubits and steer it into 4 mutually orthogonal states, so that measurement of both qubits together will not have a probabilistic outcome.
I think the idea is cool. I want to understand a more general question that arises from this result.
What if I have 100 qubits (or N qubits, if you like), entangled by a neutral party, and 99 are sent to my friend and 1 is sent to me. How much control do I have over the composite quantum state? How many mutually orthogonal states can one steer the global state into?
Thanks.
EDIT:
Thank you for your interest in this question. I can't seem to figure out who is right, so let's consider a slightly different question.
There are a total of 5 qubits. I have 2, and my friend has 3. Clearly the upper bound of classical bits I can send to my friend is 5. But is it possible to find 5 unitary operations I can perform on my two qubits to steer the state into 5 orthogonal states.
If you can answer that, then how does this generalize to N and M qubits?
Hopefully this comes closer to the real question I want to ask.
"
"['quantum-gate', 'matrix-representation']"," Title: What's the matrix representation of this 3-qubit CZ circuit?Body: How do I calculate the matrix representation of this part of a teleportation circuit? It must be a matrix of dimension 8.
"
"['information-theory', 'entropy', 'relative-entropy', 'semidefinite-programming', 'cvx']"," Title: How to calculate the conditional min-entropy via a semidefinite program?Body: I am trying to formulate the calculation of conditional min-entropy as a semidefinite program. However, so far I have not been able to do so. Different sources formulate it differently. For example, in this highly influential paper, it has been formulated as:
$$H_{\text{min}}(A|B)_\rho = - \underset{\sigma_B} {\text{inf}} \ D_{\infty}(\rho_{AB} \| id_A \otimes \sigma_B)
$$
Where $$\rho_{AB} \in \mathcal{H_A \otimes H_B}, \sigma \in \mathcal{H_B}$$ and
$$D_{\infty}(\tau \| \tau') = \text{inf} \{\lambda \in
\mathbb{R}: \tau \leq 2^{\lambda} \tau' \}$$
How do I formulate it into a semidefinite program? It is possible as is mentioned in this lecture.
A possible SDP program is given in Watrous's lecture:
$$\text{maximize}: <\rho, X>$$
$$\text{subject to}$$
$$Tr_X{X} == \mathcal{1}_Y$$
$$X \in \text{Pos}(X \otimes Y)$$
How do I write it in CVX or any other optimization system?
"
"['circuit-construction', 'universal-gates']"," Title: Reversible computation without inverting the circuitBody: I know that if you have a circuit $U$ that transforms $A → B$, it's possible to construct an inverse, ${U\dagger}(B) → A$. Is it also possible to transform the states with $T_{i,o}$ so that I can use the original circuit to do the reverse computation? Like so:
$$
U(T_o(B)) → T_i(A)
$$
For example, I know the Toffoli gate is its own inverse. So $T_{i,o}$ can be the identity function:
$$U_{\operatorname{Tof}}(A) → B$$
$$U_{\operatorname{Tof}}(I(B)) → I(A)$$
I would like to know if some reasonable $T$ functions exists when $U$ is a universal circuit.
I'm a quantum computing newbie and coming at this question more from a physics standpoint, so not sure quite sure how to ask this most clearly. Suggestions are appreciated. Links to related research would also be great.
EDIT: $T$ may differ for input and output states.
"
"['non-locality', 'foundations', 'correlations', 'nonlocal-games']"," Title: Are correlations stronger than those allowed by quantum mechanics possible?Body: We know how a quantum correlation setup can help us with a better probability of winning games like the CHSH. But what is the upper bound that physics can allow? Is it the quantum correlation setup? Or can we exceed them in general sense to get much stronger correlations?
"
"['physical-qubit', 'photonics']"," Title: How is the polarization of a photon able to hold quantum information?Body: It is my understanding that light, and its polarization, is used to transfer information in quantum computers, but how can the information encoded in say, an electron also be stored in light? I understand that the spin of an electron or other particle is often used to create the qubit, where its ""value"" can be any point on the sphere below between zero and one.
However, how is the polarization of a photon able to have that kind of variety of possible values? Is there something I'm missing? Is there a quantized version/explanation of polarizations that I simply haven't seen that allows for the same range of information storage and extraction?
"
"['algorithm', 'error-correction']"," Title: What is the longest quantum circuit?Body: To date, what is the longest quantum computation ever performed? Length is measured in number of operations.
EDIT ---
I'm looking for a quantum computation with a clear ending and a clear output. Something like a quantum computation that solves a set of linear equations would count. But I consider a benchmarking experiment that measures the lifetime of the quantum information 'long' because it can be arbitrarily long and give the same output as a similar experiment which is much shorter.
"
"['resource-request', 'bloch-sphere', 'state-space-geometry']"," Title: Can the Bloch sphere be generalized to two qubits?Body: The Bloch sphere is a nice visualization of single qubit states. Mathematically, it can be generalized to any number of qubits by means of a high-dimensional hypersphere. But such things are not easy to visualize.
What attempts have been made to extend visualizations based on the Bloch sphere to two qubits?
"
"['mathematics', 'information-theory', 'correlations']"," Title: In Bell nonlocality, why does $P(ab|xy)\neq P(a|x)P(b|y)$ mean the variables are not statistically independent?Body: I've been working through the paper Bell nonlocality by Brunner et al. after seeing it in user glS' answer here. Early on in the paper, the standard Bell experimental setup is defined:
Where $x, y \in \{0,1\}$, $a, b \in \{-1, 1\}$, and the two people (Alice & Bob) measure a shared quantum system generated by $S$ according to their indepedent inputs $x$ and $y$, outputting the results as $a$ and $b$.
The paper then has the following equation:
$P(ab|xy) \ne P(a|x)P(b|y)$
And claims the fact this is an inequality means the two sides are not statistically independent. It's been a long time since I took probability & statistics in university, so I'm interested in this equation, what it means, and why it is a test for statistical independence. Why is this equation used, and what is the intuitive meaning of each side? I have basic knowledge of conditional probability and Bayes' theorem.
"
"['algorithm', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Shor's algorithm weaknesses & uniqueness of close rationalBody: I'm working through a problem set, and am stuck on the following problem:
a) What can go wrong in Shor’s algorithm if Q (the dimension of the Quantum Fourier Transform) is not taken to be sufficiently large? Illustrate with an example.
b) What can go wrong if the function, f, satisfies $f(p) = f(q)$ if the period $s$ divides $p − q$, but it’s not an “if and only if” (i.e., we could have $f(p) = f(q)$ even when $s$ doesn’t divide $p − q$)? Note that this does not actually happen for the function in Shor’s algorithm, but it could happen when attempting period finding on an arbitrary function. Illustrate with an example.
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)? Illustrate with an example.
d) Prove that there can be at most one rational $\frac{a}{b}$, with $a$ and $b$ positive integers, that’s at most $\epsilon$ away from a real number $x$ and that satisfies $b < \frac{1}{\sqrt{2\epsilon}}$. Explain how this relates to the choice, in Shor’s algorithm, to choose Q to be quadratically larger than the integer $N$ that we’re trying to factor.
I've been wrestling with it for a while, and my attempt so far is:
a) When $s$ (the period) does not divide $Q$, a sufficiently large $Q$ ensures that the rational approximation to $\frac{k Q}{s}$ where $k$ is an integer is sufficiently close to determine a unique $s$.
b) There might be more than one period $s$ associated with the function (something like an acoustic beat), so it would be much more difficult to solve for one period individually.
c) Completely lost....
d) I supposed that there existed two different rationals such that $\mid{\frac{a_1}{b_1} - \frac{a_2}{b_2}}\mid> 0$ and tried to force a contradiction using the constraints $\mid\frac{a_\mu}{b_\mu}-x\mid \leq \epsilon$ and $b_\mu < \frac{1}{\sqrt{2\epsilon}}$, but couldn't get it to come out. Either I am making a stupid mistake and/or missing something simple (?).
I am really struggling to gain intuition for Shor's algorithm and its specific steps, so I'm very unconfident when trying to address parts (a) - (c). I'm stumped by (c) especially; isn't Shor's algorithm robust in the sense that it does not matter if $N$ is even or odd? If anyone could point me in the right direction, it would be appreciated. Thanks!
"
"['algorithm', 'machine-learning']"," Title: Is quantum backpropagation faster than classical backpropagation?Body: I recently stumbled upon a press release from Xanadu.ai stating that
Under the hood, PennyLane's core feature is that it implements a
version of the backpropagation algorithm - the workhorse for training
deep learning models - that is naturally compatible with quantum
devices.
As far as I know, not many algorithms are known to profit from the features of a quantum computer. So is quantum backpropagation one of these algorithms that is theoretically faster than classical backpropagation? Or what advantages should one get from running backpropagation on a quantum computer?
"
"['quantum-gate', 'quantum-networks', 'circuit-construction']"," Title: How to you encode a network as an adjacency-list in the quantum-gate model?Body: I have a network problem that I believe would be represented as an adjacency-list on a quantum circuit. Typically, the list is up for traversing from various perspectives (e.g., shortest-path between two points).
Adjacency-list example:
x-> a, b, c
y-> a, d, e
x-> b, c, d
Any insight will be much appreciated!
"
"['mathematics', 'non-locality', 'bell-experiment', 'correlations']"," Title: Definition of locality in Bell experimentsBody: Continuing from my previous question on Brunner et al.'s paper; so given a standard Bell experimental setup:
where independent inputs $x,y \in \{0, 1\}$ decide the measurement performed by Alice & Bob on quantum state $S$ with outcomes $a,b \in \{-1, 1\}$, $a$ and $b$ are correlated (not independent) if:
(1) $P(ab|xy) \ne P(a|xy)P(b|xy) \ne P(a|x)P(b|y)$
Of course, there are perfectly innocent non-quantum reasons why $a$ and $b$ could be correlated; call these reasons confounding variables, some artifact of when Alice & Bob's systems interacted in the past. The set of all confounding variables we call $\lambda$. If we take into account all variables in $\lambda$, a local theory claims that $a$ and $b$ will become independent and thus $P(ab|xy)$ will factorize:
(2) $P(ab|xy,\lambda) = P(a|x,\lambda)P(b|y,\lambda)$
This equation expresses outcomes depending only on their local measurement and past variables $\lambda$, and explicitly not the remote measurement.
Question one: what is the mathematical meaning of the comma in equation (2)?
Question two: what is an example of a variable in $\lambda$?
The paper then says the following:
The variable $\lambda$ will not necessarily be constant for all runs of the experiment, even if the procedure which prepares the particles to be measured is held fixed, because $\lambda$ may involve physical quantities that are not
fully controllable. The different values of $\lambda$ across the runs should thus be characterized by a probability distribution $q(\lambda)$.
Question three: why was it a set of variables before but is now only a single variable?
Question four: what is an example of a probability distribution for $q(\lambda)$ here?
We then have the fundamental definition of locality for Bell experiments:
(3) $P(ab|xy) = \int_{Λ} q(\lambda)P(a|x, \lambda)P(b|y, \lambda) d\lambda$ where $q(\lambda|x,y) = q(\lambda)$
Question five: What does the Λ character mean under the integral sign?
General question: so we have a continuous probability distribution $q(\lambda)$ over which we're integrating. Why are we multiplying the RHS of equation (2) by $q(\lambda)$ in the integrand? That would seem to make equation (3) different than equation (2). What's an example of this integral with concrete values?
"
"['quantum-gate', 'tensor-product', 'circuit-construction']"," Title: What circuit or operation corresponds to the tensor product?Body: What Clifford gate circuit operating on states $|\psi_1\rangle$ and $|\psi_2\rangle$ prepares the state $|\Psi\rangle=|\psi_1\rangle \otimes |\psi_2\rangle$ ?
"
"['algorithm', 'cryptography', 'speedup', 'shors-algorithm']"," Title: Lesser qubit computer doing the parts of Shor's against e.g., RSA-2048 sized primeBody: After posting this question to Physics, it became pretty clear I should have posted here. So:
How might a (e.g.) 72-bit crypto-relevant quantum computer attack RSA-2048?
Bonus: how might that be characterized? (e.g., nn-qubit requires xxx passses, run time ~yyy)
Shor's algorithm appears to allow for parallel execution or iterative runs with a combination step. Assumption is that smaller-qubit QC might be able to perform those pieces.
However, it is suggested that a 4000-qubit/100m-gate quantum computer would be necessary. As the quantum piece of Shor's is a large transform, I assume that sets the constraint for qubit-size
Side note: there also appear to be possible speedups that may reduce the run time, such as qubit recycling? or the 4-8 passes vs. the 20-30 passes (by David McAnally)
"
"['architecture', 'd-wave', 'adiabatic-model', 'embedding']"," Title: What is the ""TRIAD"" graph and where can I find more information about it?Body: I was looking up how to program for a D-Wave machine and I came across this image which says it's the ""optimal hardware graph"" for a D-Wave machine:
Unfortunately the image seems to have come from this website:
http://people.cs.vt.edu/~vchoi/MinorEmbed.pdf (I got a preview somewhere else and they provided a link to this website), and when I click on that link it says ""Forbidden You don't have permission to access /~vchoi on this server."" The same happens if I remove the PDF from the URL and only look at the faculty member's webpage. The webpage does work if I remove the faculty member's name though, but then it's just the CS department website.
So where can I find the original work where this comes from?
I searched for alternative sources on Google, but it seems that ""triad"" means very many different things!
"
"['entanglement', 'communication', 'locc-operation']"," Title: How to transfer non maximally entangled state to maximally entangled?Body: Let a three-qubit state shared between Alice, Bob and Charlie stationed at distant laboratories be
$$\psi_{ABC}=\frac{\sqrt{2}}{\sqrt{3}}|000\rangle+\frac{1}{\sqrt{3}}|111\rangle.$$
How to evaluate the maximum probability of transforming the state to a three
qubit maximally entangled state by local operations and classical communication only?
"
"['algorithm', 'programming', 'q#']"," Title: Quantum counting in Q#Body: I cannot seem to get an estimate for the number of solutions using the quantum counting algorithm described in Nielsen and Chuang, i.e. phase estimation with the Grover iteration acting as $U$.
I try doing the following with control and target as allocated qubit registers:
let controlBE = BigEndian(control);
let ancilla = target[0];
X(ancilla);
ApplyToEachCA(H, control + target);
for (i in 0..Length(control) - 1) {
Controlled GroverPow([control[Length(control) - 1 - i]], (2 ^ i, target));
}
Adjoint QFT(controlBE);
let fiBE = MeasureInteger(controlBE);
let numSolutionsD = PowD(Sin(ToDouble(fiBE) / 2.0), 2.0) * ToDouble(2 ^ Length(inputQubits));
Message(""numSolutions: "" + Round(numSolutionsD));
My GroverPow is a discrete oracle that is supposed to perform the Grover iteration to the power defined by the given integer.
operation GroverPow(power: Int, qubits: Qubit[]): Unit {
let ancilla = qubits[0];
let inputQubits = qubits[1..Length(qubits) - 1];
let aug = Tail(inputQubits);
let ans = Most(inputQubits);
for (i in 1..power) {
Oracle(ans, database, ancilla, aug); // Grover iteration
ApplyToEachCA(H, inputQubits);
ApplyToEachCA(X, inputQubits);
Controlled Z(Most(inputQubits), Tail(inputQubits));
ApplyToEachCA(X, inputQubits);
ApplyToEachCA(H, inputQubits);
}
}
This just doesn't give the correct answer, even when I have the oracle do absolutely nothing. Is there an obvious bug that I'm missing? I've tried using various combinations of my home-grown functions as well as the built-in AmpAmpByOracle and QuantumPhaseEstimation functions and various initial/target states but to no avail. I've tried absolutely everything I can think of, and am almost starting to get suspicious of the validity of this algorithm...obviously it's sound but that's where I'm at! Just doesn't seem to work.
"
"['measurement', 'mathematics']"," Title: Quantum spin measurementBody: The state of a spin $\frac{1}{2}$ particle is $|0\rangle$ which is eigenstate of $\sigma_z$. What is the most generalized way to show that the results of any spin measurement along any direction in x-y plane is completely random.
"
"['quantum-operation', 'kraus-representation']"," Title: Deduce the Kraus operators of the dephasing channel using the ChoiBody: I'm trying to deduce the Kraus representation of the dephasing channel using the Choi operator (I know the Kraus operators can be guessed in this case, I want to understand the general case).
The dephasing channel maps a density operator $\rho$ as
$$\rho\rightarrow D(\rho)=(1-p)\rho+ p\textrm{diag}(\rho_{00},\rho_{11}) $$
The Choi operator acts on a channel as
$$C(D)=(I \otimes D)\sum_{k,j=0}^1 \vert k\rangle \langle j \vert \otimes \vert k\rangle \langle j \vert=\sum_{k,j=0}^1\vert k\rangle \langle j \vert \otimes D(\vert k\rangle \langle j \vert)=\\=|0\rangle\langle 0|\otimes|0\rangle\langle 0|+p|0\rangle\langle 1|\otimes|0\rangle\langle 1|+p|1\rangle\langle 0|\otimes|1\rangle\langle 0|+|1\rangle\langle 1|\otimes|1\rangle\langle 1|=\\=|00\rangle\langle00|+p|01\rangle\langle01|+p|10\rangle\langle10|+|11\rangle\langle11|= \sum_{j=0}^3 |\psi_j\rangle\langle\psi_j|$$
Now, to find the Kraus operators, I should just find some $K_j$ such that $|\psi_j\rangle =(I\otimes K_j) \sum_{k=0}^1 \vert k\rangle \otimes \vert k\rangle$. These operators are simply
$$ K_0=|0\rangle\langle 0|\quad K_1=\sqrt{p}|1\rangle\langle 0| \quad K_2=\sqrt{p}|0\rangle\langle 1|\quad K_3=|1\rangle\langle 1|$$
And I should have $$D(\rho)=\sum_{j=1}^3 K_j\rho K_j^\dagger$$
But
$$ \sum_{j=1}^3 K_j\rho K_j^\dagger=(\rho_{00}+p\rho_{11})|0\rangle\langle0| + (\rho_{11}+p\rho_{00})|1\rangle\langle1|$$
Which is most certainly not what I should get. I'm sure I'm either doing a massive calculation error, or I have massively misunderstand everything.
Moreover, doing this I should only be able to find 4 Kraus operator, while I know that the representation is not unique and in particular this channel can be represented by only two Kraus operators. Any help is appreciated.
"
"['measurement', 'mathematics']"," Title: Are the eigenvalues of an observable always -1 and 1?Body: What are the necessary & sufficient conditions for a matrix to be an observable, and what is the proof that any such matrix has eigenvalues -1 and 1 (if indeed that is the case)? I ask because in the standard Bell experimental setup the measurement outputs are always -1 or 1.
Possibly related: in a previous question I asked whether the squared absolute values of the eigenvalues of a unitary matrix are always 1 (they are).
"
"['programming', 'quantum-gate', 'cirq']"," Title: Is it possible to create controlled gates with an exponent in Cirq?Body: Is it possible to create controlled gates with an exponent in Cirq? For example, a controlled $\sqrt Z$ gate.
"
"['quantum-gate', 'matrix-representation', 'mathematics', 'superposition']"," Title: How to properly write the action of a quantum gate implementing an operator $U$ on the superposition of its eigenvectors?Body: Let's say, that we are in the possession of a quantum gate, that is implementing the action of such an operator
$$ \hat{U}|u \rangle = e^{2 \pi i \phi}|u\rangle $$
Moreover, let's say, that this operator has at least two eigenvectors $|u\rangle$ and $|v\rangle$, with the following eigenvalues:
$$ \hat{U}|u \rangle = e^{2 \pi i \phi_0}|u\rangle $$
$$ \hat{U}|v \rangle = e^{2 \pi i \phi_1}|v\rangle $$
If we would like to act with such a quatntum gate on the eigenvector $|u\rangle$, we could write this in the matrix form:
$$ \hat{U}|u\rangle \equiv \begin{bmatrix}
e^{2 \pi i \phi_0} & 0 \\
0 & e^{2 \pi i \phi_0} \\
\end{bmatrix} |u\rangle \equiv e^{2 \pi i \phi_0} |u\rangle $$
What I want to do, is to act with the $\hat{U}$ gate on the superposition of $|u\rangle$ and $|v\rangle$, that is:
$$ \hat{U} [c_0|u\rangle + c_1|v\rangle] = c_0e^{2 \pi i \phi_0}|u\rangle + c_1e^{2 \pi i \phi_1}|v\rangle $$
We could use the following notation to write down eigenvectors $|u\rangle$ and $|v\rangle$ in the matrix form:
$$ |u\rangle = \begin{bmatrix} a_0 \\ a_1 \end{bmatrix}, |v\rangle = \begin{bmatrix} a_2 \\ a_3 \end{bmatrix} $$
Then, we could rewrtie the action $\hat{U} [c_0|u\rangle + c_1|v\rangle]$ as
$$ \hat{U} [c_0|u\rangle + c_1|v\rangle] = c_0e^{2 \pi i \phi_0}|u\rangle + c_1e^{2 \pi i \phi_1}|v\rangle $$
$$ = c_0e^{2 \pi i \phi_0}\begin{bmatrix} a_0 \\ a_1 \end{bmatrix} + c_1e^{2 \pi i \phi_1} \begin{bmatrix} a_2 \\ a_3 \end{bmatrix} = \begin{bmatrix} c_0 e^{2 \pi i \phi_0} a_0 + c_1 e^{2 \pi i \phi_1} a_2 \\ c_0 e^{2 \pi i \phi_0} a_1 + c_1 e^{2 \pi i \phi_1} a_3 \end{bmatrix} $$
Is there any way of writing the $\hat{U}$ gate in the matrix form for the above case? The only thing that comes to my mind, is that it should ""at the same time"" have values $e^{2 \pi i \phi_0}$ and $e^{2 \pi i \phi_1}$ on its diagonal, but I know that this reasoning is wrong and I was wondering, if there is some official way to write this down.
"
"['algorithm', 'resource-request', 'optimization']"," Title: Resources on hybrid quantum-classical algorithms applied to combinatorial optimization problemsBody: I am doing a thesis on ""Metaheuristics and Quantum Computing"", and was wondering if anyone could recommend some papers/pages
to read talking about hybrid quantum/classical computing.
(My idea is to get quantum population, evaluate through classical
function and then considering the classical evaluation, change the original
state of qubits to get new quantum sample, and so on and so forth.)
"
"['programming', 'gate-synthesis', 'pyquil']"," Title: Measuring the Hamiltonian in the VQEBody: I am trying to implement VQE in pyQuil and am dumbfounded by how to measure the expectation value of a general Hamiltonian on $\mathbb{C}^{2^n}$ i.e. determine $\langle\psi , H \psi\rangle$ on a Quantum computer. As far as I understand on a real Quantum Computer (not any quantum virtual machine) I can only measure in the computational basis, which is the basis of the Hamiltonian $H = X = \sum x \left|x\right>\left<x\right|$, but not for any Hamiltonian whose eigenvectors are not the computational basis. But how do I measure with any Hamiltonian that is not diagonal in the computational basis?
Sure I can measure e.g. some of the qubits in the $X$-basis instead of the $Z$-basis by applying a Hadamard gate to them, but this surely doesn't help me if I want to measure sth. non-local, i.e. if the ground-state of my hamiltonian is an entangled state.
On a maybe related note: Can I write any hamiltonian (hermitian matrix) as a Pauli decomposition? I know I can for a single qubit, but does this hold for multiqubits aswell?
"
"['communication', 'surface-code']"," Title: What is the quantum bandwidth of a planar array of noisy qubits, assuming free classical communication?Body: A common task to perform during quantum computation on the surface code is moving qubits from one place to another. There are standard ways to do this within the surface code, but I was wondering what the actual fundamental limits are. If we forget about the fact that we're using the surface code, and just focus on the fact that we have a planar grid of noisy qubits with nearest-neighbor connections, and a fast classical computer noting measurements and generally helping out, how fast can we move quantum information across that patch?
Given an operation failure rate $\epsilon$, a patch of length L and height H, and the ability operations in parallel with some duration T, how long does it take to move N qubits from the left side of the patch to the right side of the patch?
"
"['quantum-state', 'tensor-product']"," Title: Why is the state of multiple qubits given by their tensor product?Body: How did we derive that the state we get by $n$ qubits is their tensor product? You can use $n=2$ in the explanation for simplicity.
"
"['algorithm', 'classical-computing', 'quantum-advantage']"," Title: Quantum Supremacy: How do we know that a better classical algorithm doesn't exist?Body: According to the Wikipedia (Which quotes this paper https://arxiv.org/abs/1203.5813 by Preskill) the definition of Quantum Supremacy is
Quantum supremacy or quantum advantage is the potential ability of
quantum computing devices to solve problems that classical computers
practically cannot.
On that same paper, Preskill says that a more feasible approach would be to find Quantum Systems that a quantum computer can simulate in polynomic time while a classical computer can't.
My question is: Would that situation be enough to prove Quantum Supremacy? How do we know no better classical algorithm exist? Maybe there is a efficient way of simulating that system but we don't know it yet. If this is the case, then proving quantum supremacy is more about proving rigorously that a problem is classically hard than about finding that it is quantumly easy, right?
"
"['information-theory', 'entropy', 'tomography', 'mutual-information', 'quantum-discord']"," Title: Does computing the quantum mutual information $I(\rho^{AB})$ require full tomographic information of $\rho^{AB}$?Body: In the discussions about quantum correlations, particularly beyond entanglement (discord, dissonance e.t.c), one can often meet two definitions of mutual information of a quantum system $\rho^{AB}$:
$$
I(\rho^{AB}) = S(\rho^A) + S(\rho^B) - S(\rho^{AB})
$$
and
$$
J(\rho^{AB}) = S(\rho^A)-S_{\{\Pi^B_j\}}(\rho^{A|B}),
$$
where $S$ is the Von-Neumann entropy, $\rho^A$ and $\rho^B$ are the reduced states of the individual subsystems of $\rho^{AB}$ and the second term in $J$ is the quantum analogue of the conditional entropy
$$
S_{\{\Pi^B_j\}}(\rho^{A|B}) = \sum_j p_j S(\rho^{A|\Pi^B_j}).
$$
In the expression for the conditional entropy $\rho^{A|\Pi^B_j} = \text{Tr}_B[\rho^{AB} (\mathbb{I}^A \otimes \Pi^B_j )]/p_j $ are the states of the subsystem $A$ after getting a particular projector $\Pi^B_j$ in $B$, which happens with a probability $p_j = \text{Tr}[\rho^{AB} (\mathbb{I}^A \otimes \Pi^B_j ) ]$. While $I$ characterizes the total correlations between $A$ and $B$ the second expression involves a measurement process, in which non-classical features of $\rho^{AB}$ are lost, and therefore $J$ characterizes classical correlations in $\rho^{AB}$.
While measuring $J$ is relatively straightforward, (for 2 qubits one can just measure 4 probabilities $p(\Pi^A_i \Pi^B_j), \, i,j = 1,2$ and calculate the mutual information of the resulting probability distribution) I can't think of an easy way of estimating $I$. So my question is: is it possible to measure $I$ without performing a full tomography of $\rho^{AB}$?
"
"['error-correction', 'stabilizer-state']"," Title: Stabilizer for quantum error correction codeBody: I have some very basic questions about stabilizers.
What I understood:
To describe a state $|\psi \rangle$ that lives in an $n$-qubit Hilbert space, we can either give the wavefunction (so the expression of $|\psi\rangle$), either give a set of commuting observable that $|\psi\rangle$ is an eigenvector with $+1$ eigenvalue.
We define a stabilizer $M$ of $|\psi \rangle$ as a tensor product of $n$ Pauli matrices (including the identity) that verifies $M |\psi \rangle = |\psi\rangle$.
And (apparently) we need $n$ stabilizers to fully define a state.
The things I don't understand:
- How can a stabilizer necessarily be a product of Pauli matrices?
With $n=1$, I take $|\psi \rangle = \alpha | 0 \rangle + \beta |1 \rangle$, excepted for specific values of $\alpha$ and $\beta$, this state is only an eigenvector of $I$ (not of the other pauli matrices). But saying $I$ is the stabilizer doesn't give me which state I am working for.
- How can we need only $n$ stabilizers to fully define a state?
With $n$ qubits we have $2^n$ dimensional Hilbert space. I thus expect to have $2^n$ stabilizers, not $n$ to fully describe a state.
I am looking for a simple answer. Preferably an answer based on the same materials as my question, if possible. I am really a beginner in quantum error correction.
I learned these things within a 1-hour tutorial, so I don't have references for which book I learned this from. It is what I understood (maybe badly) from the professor talking.
"
"['resource-request', 'simulation', 'circuit-construction']"," Title: List of known circuits and their expected outputBody: I've written an API which takes in a circuit scaffold, according to some specifications, and outputs the results of simulating the circuit. The circuit constraints are that the measurements are performed optionally at the end. I want to test the API against known quantum circuit results.
I was wondering if there was a online resource which tabulates a list of known circuits and their results/outputs? An online quantum simulator would also work.
"
"['algorithm', 'quantum-fourier-transform']"," Title: How to describe, or encode, the input vector x of Quantum Fourier Transform?Body: Firstly, I'd like to specify my goal: to know why QFT runs exponentially faster than classical FFT.
I have read many tutorials about QFT (Quantum Fourier Transform), and this tutorial somehow explains something important between classical and quantum Fourier Transform.
Inside 1, it describes that:
The quantum Fourier transform is based on essentially the same idea with the only difference that the vectors x and y are state vectors (see formula 5.2, 5.3),
However, I couldn't catch up the statement regarding ""x and y are state vectors""; I get stuck at the formula 5.2 and 5.3.
I want to know how to convert the classical input vector x to the right hand side of the formula 5.2.
If this confusing problem is solved, it'll be better for me to understand the time complexity issue of QFT.
"
"['quantum-operation', 'quantum-networks']"," Title: Three sender quantum simultaneous decoder conjectureBody: Recently I have started to read about network quantum information theory, where network problems are studied under the classical-quantum channel. For example, capacities of the cq-MAC, cq-broadcast or the cq-interference cannels are studied to characterize the maximum achievable rates possible in such communication scenarios. I found Ivan Savov's PhD thesis to be a really interesting document regarding this issues, and very recommendable for anyone interested to start to study network quantum information theory.
However, in chapter 4.3.1 the author states a conjecture called the three sender quantum simultaneous decoder conjecture, where the existence of a POVM decoder for a cq-channel with three senders is conjectured. Such result is very important to proof most of the results of the thesis and it is an important result in general for network quantum information theory. However, at the time it was unproved, and so it remained as a conjecture. I have been researching to see if such cojecture has been proved, but I have been unable to find a general proof for it (in Classical communication over a quantum interference channel it is proved for an special case, but not in a general way).
Consequently, I was wondering if such conjecture has already been proved and so if it has been, I would like to go through such proof. Note that both references I gave are from 2012, so I assume that advances in the issue have been done by this point.
"
"['quantum-operation', 'information-theory']"," Title: Quantum channel Holevo information additivity: proof approachBody: I have an interesting idea for a proof approach that someone might find useful. Here it is.
Suppose we are given a quantum qubit channel $N$ (for example the amplitude damping channel) whose Holevo information we are trying to prove is additive for two uses, i.e, we are trying to show that $\chi_{N \otimes N} = 2 \chi_N$.
Given the channel $N$ and another channel $M$ that we know has strongly additive Holevo information, suppose we construct a channel $N^\prime$ that simulates the channel $N$ with probability $(\chi_{N \otimes N} - 2 \chi_N)$, and simulates the channel $M$ with probability $1 - (\chi_{N \otimes N} - 2 \chi_N)$, i.e,
$$N^\prime = (\chi_{N \otimes N} - 2 \chi_N) N + (1 - (\chi_{N \otimes N} - 2 \chi_N))M.$$
Note that for qubit channels $\chi_{N \otimes N} \leq 2$ and $\chi_N \leq 1$, so the assumption that $(\chi_{N \otimes N} - 2 \chi_N) \leq 1$ -- and so can be used as a probability -- is reasonable.
From the construction of the channel, we can see that if $N$ is additive, then $(\chi_{N \otimes N} - 2 \chi_N) = 0$, and $N^\prime$ is strongly additive.
That was the idea; to use $(\chi_{N \otimes N} - 2 \chi_N)$ in the construction of a new channel. May be this idea, or a variant of it, can be used to prove something.
I would be interested to know about similar ideas that have been used in proofs before.
"
"['quantum-gate', 'gate-synthesis', 'bloch-sphere']"," Title: How to obtain Y rotation with only X and Z rotations gates?Body: Let's say you have a system with which you can perform arbitrary rotations around the X and Z axis. How would you then be able to use these rotations to obtain an arbitrary rotation around the Y axis?
I have seen somewhere that rotation around an arbitrary axis can be achieved by doing three rotations around two fixed axis, that is, $$\hat{R}_\vec{n}(\theta)=R_Z(\gamma)R_X(\beta)R_Z(\alpha)$$ for some angles $\gamma, \alpha, \beta$. But how do you actually use this? What if I want to rotate around the Y axis with an angle of $\theta$ i.e. $\hat{R}_Y(\theta)$? Then how do I figure out what $\gamma,\alpha,\beta$ to use?
Edit: I've found a nice answer on Physics SE.
"
"['cryptography', 'bb84']"," Title: Comprehension questions on quantum cryptography especially BB84Body: I have recently read a lot about the BB84 protocol, I have used three primary sources, the original work, a QK book, and a diploma thesis.
My questions refer to the photons sent by Alice, the base of Bob and a possible attack on the protocol (MITM attack).
My first question is about sending the photons from Alice to Bob. The original paper states that Alice sends a single photon in one out of four polarization directions, my question. How does Alice know the direction of the photon? I imagine that I look at a single unpolarized photon, this is sent through a random filter. But there are cases in which a photon does not come through a filter (photon has 90° and the filter is 0°). So how does Alice know if a photon is ever sent? How can she even produce a single say we make a vertically polarized photon?
My second question is based on Bob, in the original paper, only Bob is measured in one of two possible bases (0°, 90°) or (45° and -45°). In my second source (the book), however, it is stated that Bob simply uses a filter from the respective base. I'll explain it a bit more carefully: The statement of the book is that Bob measures (always) at 90° or 45°. But now the diploma thesis, which I use as a third source, says that Bob uses 0°, 90° 45° -45° as a filter for the detection at random. I understand both possibilities, because assuming a photon comes in 90° and I measure in 0° then I can indeed from the non-detection conclude that the photon has been polarized in 90° direction. So I suspect the statements are equivalent, both in the book and in the thesis. Is it correct that way? and what does measuring in a base mean?
My third question relates to a possible attack. I have read a paper in which a MITM (man-in-the-middle) attack is carried out. My book source also lists this attack. But in what way is that an attack scenario, if only I have to authenticate the connection? Then the actual attack is still witless?
I hope my questions are understandable. It is important for me to understand that. I am looking forward to your answers. If I should explain one or the other in more detail, then, of course, I would correct my question and specify. Thanks so far!
"
"['mathematics', 'projection-operator']"," Title: Projection operators and positive operatorsBody: I recently came across the concepts of operators. However with current my knowledge I am unable to solve the following problem.Given an operator $$\vec{A}=\frac{1}{2}(I+\vec{n}.\vec{\sigma})$$ where $\vec{n}=n_x\hat{x}+n_y\hat{y}+n_z\hat{z}$ is a unit vector and $\vec{\sigma}=\sigma_x\hat{x}+\sigma_y\hat{y}+\sigma_z\hat{z}$ in usual Pauli matrices notation, under what condition on $\vec{n}$, is $\vec{A}$ is a positive operator and in other condition $\vec{A}$ is a projection operator.
"
"['algorithm', 'resource-request', 'research']"," Title: Pointer to related research (paper)Body: Recently, I was reading a paper (arXiv:1804.03719 [cs.ET]), which had the following quote (the most relevant part has been bolded),
Quantum algorithms are often grouped into number-theory-based, Oracle-based, and quantum simulation algorithms, such as for instance on the excellent Quantum Zoo site [57], which is largely based on the main quantum algorithmic paradigm that these algorithms use. These paradigms are the Quantum Fourier Transform (QFT), the Grover Operator (GO), the Harrow/Hassidim/Lloyd (HHL) method for linear systems, variational quantum eigenvalue solver (VQE), and direct Hamiltonian simulation (SIM). The fact that most known quantum algorithms are based on these few paradigms in combination is remarkable and perhaps surprising. The discovery of additional quantum algorithm paradigms, which should be the subject of intense research, could make quantum algorithms applicable across a much wider range of applications.
I am very interested in exploring the topic of quantum algorithm paradigms. However, my usual approach of following the reference trail failed to unearth any relevant papers.
If anyone has any suggestions regarding where to look, or know any relevant papers, I would appreciate your input.
Thanks!
"
"['quantum-state', 'measurement']"," Title: How to measure in the standard basis?Body: I saw some related topics, but none of them give step by step instructions on measuring in standard basis (or some other basis). Could you please give such instructions? Giving an example would be good, too.
"
"['quantum-state', 'cryptography']"," Title: How to encode a qubit in standard basis?Body: I wonder what the steps for encoding a qubit in a certain basis are (you can give your answer in terms of the standard basis for simplicity). Example and a little explanation about steps would be great.
"
"['fault-tolerance', 'surface-code']"," Title: Magic State Distillation Understanding CheckBody: I'm currently trying to understand the T magic state distillation algorithm described in ""Universal Quantum Computation with Ideal Clifford Gates and Noisy Ancillas"" [1] (Section V starting on Page 6). I need to understand the basics of magic state distillation in order to understand the motivations for optimization procedures used in another paper [2], which I need to give a talk on for a class. I know the distillation procedure used [2] (Bravyi-Haah) is different from the one described in [1], but [1] seems like a more natural starting point.
As this is background for the class presentation I am to give, my goals with this post are to refine my understanding as I continue to try and understand this topic and (most importantly) to make sure I do not spread any misinformation. That is, I don't expect to achieve 100% understanding from the responses to this post.
I would like to verify which points of the following plain-language laymen's explanation of the magic state distillation procedure described in [1] are incorrect or correct.
Imagining the production of T-states for use in a surface code,
1) Magic state distillation is performed within the surface code
2) The initial step of producing many copies of raw noisy T-states is done through the direct use of a non-fault tolerant T-gate
3) Distillation of these raw states is performed through discarding states which cause nontrivial surface code stabilizer measurements (eigenvalue = -1)
4) The raw states with trivial surface code stabilizer measurements (eigenvalue = 1) are transformed into a single qubit magic state.
"
"['mathematics', 'non-locality', 'bell-experiment', 'correlations']"," Title: Determining whether $P(ab|xy)$ factorizes in Bell experimentsBody: Continuing from my previous (1, 2) questions on Brunner et al.'s paper on Bell nonlocality.
Again, we have the following standard Bell experiment setup:
where independent inputs $x,y \in \{0, 1\}$ decide the measurement performed by Alice & Bob on quantum state $S$ with outcomes $a,b \in \{-1, 1\}$. We say $a$ and $b$ are correlated (not independent) if:
$P(ab|xy) \ne P(a|x)P(b|y)$
which is a lazy physicist's way of writing:
$P[A = a \cap B = b | X = x \cap Y = y] \ne P[A = a | X = x] \cdot P[B = b | Y = y]$
Where $A, B, X, Y$ are discrete random variables and $a,b,x,y$ some specific elements from the sets defined above.
I wanted to check this basic (in)equality with some simple example values, so I considered the following:
- $S = |++\rangle$, a non-entangled quantum state
- If $X = 0$, Alice measures with $\sigma_z$; if $X = 1$, she measures with $\sigma_x$
- If $Y = 0$, Bob measures with $\sigma_x$; if $Y = 1$, he measures with $\sigma_z$
Since $S$ is not an entangled state, we can write out the following probability tables:
$\begin{array}{|c|c|c|}
\hline
x & a & P(a|x) \\ \hline
0 & 1 & 0.5 \\ \hline
0 & -1 & 0.5 \\ \hline
1 & 1 & 1 \\ \hline
1 & -1 & 0 \\ \hline
\end{array}$
$\begin{array}{|c|c|c|}
\hline
y & b & P(b|y) \\ \hline
0 & 1 & 1 \\ \hline
0 & -1 & 0 \\ \hline
1 & 1 & 0.5 \\ \hline
1 & -1 & 0.5 \\ \hline
\end{array}$
We then expect $P(ab|xy) = P(a|x)P(b|y)$ for all the values of $a,b,x,y$. The problem is I don't know how to calculate the LHS of that equation! I can make the following table:
$\begin{array}{|c|c|c|c|c|c|}
\hline
x & y & a & b & P(a|x)P(b|y) & P(ab|xy) \\ \hline
0 & 0 & 1 & 1 & 0.5 \cdot 1 = 0.5 & ? \\ \hline
0 & 0 & 1 & -1 & 0.5 \cdot 0 = 0 & ? \\ \hline
0 & 0 & -1 & 1 & 0.5 \cdot 1 = 0.5 & ? \\ \hline
0 & 0 & -1 & -1 & 0.5 \cdot 0 = 0 & ? \\ \hline
0 & 1 & 1 & 1 & 0.5 \cdot 0.5 = 0.25 & ? \\ \hline
0 & 1 & 1 & -1 & 0.5 \cdot 0.5 = 0.25 & ? \\ \hline
0 & 1 & -1 & 1 & 0.5 \cdot 0.5 = 0.25 & ? \\ \hline
0 & 1 & -1 & -1 & 0.5 \cdot 0.5 = 0.25 & ? \\ \hline
1 & 0 & 1 & 1 & 1 \cdot 1 = 1 & ? \\ \hline
1 & 0 & 1 & -1 & 1 \cdot 0 = 0 & ? \\ \hline
1 & 0 & -1 & 1 & 0 \cdot 1 = 0 & ? \\ \hline
1 & 0 & -1 & -1 & 0 \cdot 0 = 0 & ? \\ \hline
1 & 1 & 1 & 1 & 1 \cdot 0.5 = 0.5 & ? \\ \hline
1 & 1 & 1 & -1 & 1 \cdot 0.5 = 0.5 & ? \\ \hline
1 & 1 & -1 & 1 & 0 \cdot 0.5 = 0 & ? \\ \hline
1 & 1 & -1 & -1 & 0 \cdot 0.5 = 0 & ? \\ \hline
\end{array}$
But cannot figure out how to fill in the value of $P(ab|xy)$. How do I do that (without using the values of $P(a|b)P(b|y)$)?
I would then like to perform the same exercise with the CHSH setup:
- $S = |\Psi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$
- If $X = 0$, Alice measures with $\sigma_z$; if $X = 1$, she measures with $\sigma_x$
- If $Y = 0$, Bob measures with $\sigma_z$ rotated $\frac{\pi}{8}$ radians counter-clockwise around the y-axis; if $Y = 1$, he measures with $\sigma_z$ rotated $\frac{\pi}{8}$ radians clockwise around the y-axis
How would we then write out the above three probability tables? I guess we probably wouldn't be able to easily write out the first two, but we can with the third?
"
"['measurement', 'notation']"," Title: Convention for expressing measurement in non-standard basisBody: If we're measuring in common bases like $|0\rangle$, $|1\rangle$ or $|+\rangle$, $|-\rangle$ we express this by saying we're measuring with $\sigma_z$ or $\sigma_x$, or measuring in the computational or sign bases. What's the conventional or most-concise way to say we're measuring in a non-standard basis, like the in CHSH experiment where Bob measures in the computational basis rotated $\pm\frac{\pi}{8}$ radians around the y-axis? Do we derive the observable from its eigenvectors and use that?
"
"['algorithm', 'quantum-state', 'simulation']"," Title: FPGA qubit simulationBody: This question is regarding the simulation of qubits, using FPGAs. My question is: how does using FPGAs to simulate qubits help us understand or give us an insight into how quantum computers could be constructed? I know many quantum computation scientists use software to simulated qubits, for example, Matlab and even Python. But I just don't understand why to use FPGAs.
I know for a fact that FPGAs are really useful in speeding up processing power and execute processes in parallel.
Is this the sole purpose of using FPGAs or are there other reasons why they are being used in quantum computation simulations?
"
"['algorithm', 'entanglement', 'circuit-construction', 'phase-estimation']"," Title: How to analyze highly entangled quantum circuits?Body: I came across a quantum circuit very similar to the phase estimation circuit, which is shown below:
In the phase estimation algorithm we assume, that we can efficiently implement an operator $U$, which performs the following operation:
$$ U|u\rangle \equiv e^{2 \pi i \phi} |u\rangle, $$
where $|u\rangle$ is the eignevector of $U$ and $e^{2 \pi i \phi}$ is the corresponding eigenvalue. Such an operator can be denoted in the matrix form as
$$ U \equiv \begin{bmatrix} e^{2 \pi i \phi} & 0 \\ 0 & e^{2 \pi i \phi}\end{bmatrix} $$
and its controlled version can be written as
$$ CU \equiv \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & e^{2 \pi i \phi} & 0 \\ 0 & 0 & 0 & e^{2 \pi i \phi}\end{bmatrix} $$
(the $CU^j$ gate will only have $e^{2 \pi i \phi j}$ in places of $e^{2 \pi i \phi}$). For such a case I was still able to express the resulting vector (after going through the $CU^j$ gate) as the tensor product of two vectors. Thanks to this, I was able to see what is the effect of applying the inverse quantum Fourier transform on one of these vectors.
Now let's say, that $U$ is not diagonal and its each entry is different from 0. In such a case, I think there appears strong entanglement between qubits in the first and the second register. Because of this (from the very definition of entanglement) I wasn't able to express the resulting vector as tensor product of some compound vectors and I don't know, what will be the result of applying the inverse quantum Fourier transform on the first register.
All of the above is just one example showing my real problem - how to analyze quantum circuits, where qubits (or registers) are highly entangled?
"
"['entanglement', 'qudit', 'graph-states']"," Title: Graph state and maximally entangled stateBody: How can I show that a multi-qudit graph state $|G\rangle$ is the maximally entangled state? What kind of measure of entanglement can be used to quantify the amount of entanglement in a given graph state?
"
['mathematics']," Title: Is geometric algebra/calculus used in quantum computing?Body: This is really a question out of curiosity. I am aware that geometric algebra and geometric calculus provide simplifications in many aspects of physics. I'm wondering if this framework's usefulness extends to the realm of quantum computing.
"
['error-correction']," Title: Why can't there be an error correcting code with fewer than 5 qubits?Body: I read about 9-qubit, 7-qubit and 5-qubit error correcting codes lately. But why can there not be a quantum error correcting code with fewer than 5 qubits?
"
"['entanglement', 'notation']"," Title: Notation for two entangled registersBody: Suppose I have two registers x and y, of length m and n bits respectively. I want to initialize my system to contain an equal superposition of all $2^{n+m}$ states, then apply an oracle function (in superposition). How do I notate this correctly?
For example:
Consider the system $|\psi\rangle=|x_{m-1}\rangle...|x_0\rangle|y_{n-1}\rangle...|y_0\rangle = |x\rangle|y\rangle$
and quantum oracle $F(x,y)\rightarrow \{0,1\}$
- Initialize the system to $|\psi_0\rangle=|0\rangle|0\rangle$
- Apply the Hadamard gate to obtain uniform superposition over all states
$|s\rangle$ = $H|\psi_0\rangle = \frac{1}{\sqrt{2^{n+m}}}\sum_{x=0}^{2^m}\sum_{y=0}^{2^n}|x\rangle|y\rangle$
- Compute $|\phi\rangle = F(|s\rangle) = \alpha|0\rangle + \beta|1\rangle$, for $\alpha,\beta \in \mathbb{C}$
I hope the algorithmic steps I'm describing are relatively clear but is this the correct way to notate it?
"
"['algorithm', 'hhl-algorithm', 'hamiltonian-simulation']"," Title: How to find parameters for circuit decomposition of Hamiltonian simulation of any matrix $A$?Body: In version 2 of the paper Quantum Circuit Design for Solving Linear Systems of Equations by Cao et al., they have given circuit decomposition for $e^{iA\frac{2\pi}{16}}$, given a particular $A_{4\times 4}$ matrix, in Fig 4. I am trying to find equivalent decomposition for a $2\times 2$ matrix like $A'=\begin{pmatrix} 1.5&0.5\\0.5&1.5 \end{pmatrix}$. Can anyone explain and summarize the standard method for this?
"
"['algorithm', 'programming', 'q#']"," Title: An algorithm with the Hadamard operatorBody: My goal in writing this algorithm in Q# was that func would either output (1,2) or (10,20), since the output result can be either One or Zero. However, I sometimes have (1,20) or (10,2) as output. Does anyone know why this happens?
operation func () : (Int,Int)
{
mutable res000 = Zero;
mutable int1 = 0;
mutable int2 = 0;
using (goop = Qubit[1])
{
H(goop[0]);
set res000 = M(goop[0]);
if(res000 == Zero)
{
set int1 = 1;
set int2 = 2;
}
else
{
set int1 = 10;
set int2 = 20;
}
ResetAll(goop);
}
return (int1,int2);
}
Edit:
Here's another bit of information. I also have two projection functions, and I want the projection functions to output func:
operation Pr0 (m:Int,n:Int) : Int
{
return m;
}
operation Pr1 (m:Int,n:Int) : Int
{
return n;
}
operation func () : (Int,Int)
{
mutable res000 = Zero;
mutable int1 = 0;
mutable int2 = 0;
using (goop = Qubit[1])
{
H(goop[0]);
set res000 = M(goop[0]);
if(res000 == Zero)
{
set int1 = 1;
set int2 = 2;
}
else
{
set int1 = 10;
set int2 = 20;
}
ResetAll(goop);
}
return (int1,int2);
}
operation testPr1 () : (Int,Int)
{
return (Pr0(func()),Pr1(func()));
}
Here are the C# codes:
class Driver
{
static void Main(string[] args)
{
using (var sim = new QuantumSimulator())
{
var res3 = testPr1.Run(sim).Result;
Console.WriteLine(res3);
}
Console.WriteLine(""Press any key to continue..."");
Console.ReadKey();
}
}
"
"['quantum-gate', 'simulation', 'unitarity']"," Title: Unitary gate(s) from product of exponentBody: Often unitary gates are defined as a product of exponentials, with some parameter in the power-term. However, often it is not clear how to construct unitary gates from it, at least not for me that is.
In here we see two of such situations. The first is
$$\Pi_{j=1}^n e^{-i\beta\sigma_j^x},$$
with parameter $\beta$ and $\sigma_j^x$ a single bit Pauli-X on qubit $j$. As I understand it, this is the same as a $R_X(2\beta)$ gate applied to every qubit. Is that correct?
The second one, that is a bit harder I believe and is related to clauses, is
$$\Pi_{\alpha} e^{-i\gamma C_{\alpha}},$$
where $C_{\alpha}$ is 1 whenever clause $\alpha$ is true and 0 otherwise. How can I implement this as elementary unitary gates?
"
"['error-correction', 'textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang']"," Title: Confusion on the definition of the phase-damping channelBody: I am reading about the phase damping channel, and I have seen that some of the different references talking about such channel give different definitions of the Kraus operators that define the action of such channel.
For example, Nielsen and Chuang define in page 384 the phase damping channel with Kraus operators
\begin{equation}
E_0=\begin{pmatrix}1 & 0 \\ 0 & \sqrt{1-\lambda}\end{pmatrix}, \qquad E_1=\begin{pmatrix}0 & 0\\0 & \sqrt{\lambda} \end{pmatrix},
\end{equation}
where $\lambda$ is the phase damping parameter. However, in the $28^{th}$ page of Preskill's notes on quantum error correction, such channel is defined by Kraus operators:
\begin{equation}
E_0=\sqrt{1-\lambda}I, \qquad E_1=\begin{pmatrix}\sqrt{\lambda} & 0 \\0 & 0 \end{pmatrix}, \qquad E_2=\begin{pmatrix} 0 & 0 \\ 0 & \sqrt{\lambda}\end{pmatrix}.
\end{equation}
Seeing the notable difference between both descriptions, while also having a diffeent number of Kraus operators, I am wondering which is the correct one, or if they are equivalent, why is it such case. A unitary description of the phase damping channel will also be helpful for me.
"
"['quantum-gate', 'programming', 'qiskit', 'gate-synthesis', 'hhl-algorithm']"," Title: Implementing gate with two parameters using Qiskit in PythonBody: I am trying to implement the HHL algorithm (for solving $Ax=b$). I am assuming $A$ to be unitary and Hermitian so that I can find the Hamiltonian simulation for it easily.
For any $A$ to be Hermitian and unitary, it has to be of form,
$$ A = \begin{pmatrix} x & \pm\sqrt{1-x^2}\\ \pm\sqrt{1-x^2} & x\end{pmatrix} $$
I reduced $e^{i\alpha A}$ to following (by using formula $e^{i\theta A} = (\cos\theta)I + i(\sin\theta)A$ where $A^2=I$), but I don't know how to implement it on Qiskit.
$$ e^{i\alpha A} = \begin{pmatrix} \cos\alpha+i\sin\alpha\cos\frac{\theta}{2} & i\sin\alpha \sin\frac{\theta}{2} \\ i\sin\alpha \sin\frac{\theta}{2} & \cos\alpha+i\sin\alpha\cos\frac{\theta}{2} \end{pmatrix} .$$
where $\theta = 2\cos^{-1}{x}$. How to construct this gate?
"
"['entanglement', 'non-locality', 'cloning']"," Title: Shared entanglement to copy orthogonal statesBody: Assume that Alice and Bob are allowed to share entanglement and are spatially separated. Alice is given an unknown state and asked to measure this in the computational basis to obtain $\vert 0\rangle$ or $\vert 1\rangle$. Is there some way for Bob to also have a copy of same state as Alice instantaneously?
Note that it does not violate no-signalling since the outcome of the measurement for Alice is random - so she cannot use it to communicate. Another perspective is that this is sort of like cloning but since the only outcomes that Alice gets are $\vert 0\rangle$ or $\vert 1\rangle$ and they are orthogonal, it isn't forbidden by the no-cloning.
If this can be done, how should she and Bob design a quantum circuit that achieves this? Otherwise, what forbids this possibility?
"
"['resource-request', 'photonics', 'games']"," Title: Photonic CHSH GamesBody: How can a CHSH game be realized in a photonic circuit?
"
"['quantum-gate', 'entanglement', 'circuit-construction']"," Title: A quantum circuit with entanglement with EveBody: I'm trying to work through a self-made exercise, which may be ill formed as a question. Any general advice in dealing with these types of problems is also much appreciated!
I'm looking at a quantum gate $U_f$ for a function $f$, that has the effect $$\sum_x \alpha_x \vert x\rangle\vert 0\rangle \mapsto \sum_x \alpha_x\vert x\rangle\vert f(x)\rangle. $$
This will in most cases be an entangled state: for instance, if $f(x) = x$, then I get what looks like a Bell state.
I want to consider a case where the first register is already maximally entangled with a third party, Eve.
- One way to proceed is to write the first register as a mixed state which I obtain after tracing out Eve's part. The trouble now is, when we consider the action of the gate, that the gate entangles the two registers. I have no idea how to sort out the entanglement between Eve and the first register and the new entanglement between the first and second registers.
- Alternatively, if I don't trace out Eve's register and instead implement the gate $\mathbb 1\otimes U_f$, then I'm still not sure what the outcome is. Before the gate, I have $$\sum_x \vert x \rangle_E\vert x\rangle\vert 0\rangle. $$ (I have marked Eve's register for clarity.) After the gate, I could naively write $$\sum_x \vert x\rangle_E\vert x\rangle\vert f(x)\rangle, $$ but this looks dubious to me. Particularly, this looks like Eve is now entangled with the second register but that seems wrong.
I'm not sure how entanglement monogamy fits in but I suspect my guess for the state isn't compatible with it. Can anyone clarify what's going on for me?
"
"['cryptography', 'communication']"," Title: BB84 protocol over LiFiBody: The question is already explained in the title, but I'm curious regarding the possibility to adopt the BB84 protocol over LiFi (in theory). Could it be possible or are there some limitations, such as the single photon evaluation?
"
"['complexity-theory', 'quantum-turing-machine']"," Title: Has any research been done on quantum Zeno machines?Body:
Zeno machines (abbreviated ZM, and also called accelerated Turing machine, ATM) are a hypothetical computational model related to Turing machines that allows a countably infinite number of algorithmic steps to be performed in finite time. -Wikipedia
The quantum Zeno effect (also known as the Turing paradox) is a feature of quantum-mechanical systems allowing a particle's time evolution to be arrested by measuring it frequently enough with respect to some chosen measurement setting. -Wikipedia
This seems fitting for a continuous-variable environment (eg. photonics). Has any research been done on quantum Zeno machines? (Google: No results found for ""quantum zeno machine"".)
"
"['quantum-gate', 'simulation', 'cirq', 'circuit-construction']"," Title: Is it possible to see how CompositeGates are decomposed when simulated using XmonSimulator?Body: I'm simulating a circuit like this:
(0, 0): ───────────────X───────X─────────@───────────────M─────────────
│ │ │ │
(1, 0): ───H───@───H───@───X───@^0.333───@^0.5───X───H───M─────────────
│ │
(2, 0): ───────X─────────────────────────────────────────M─────────────
but when I try to debug by simulating with moments steps (as instructed here), I end up getting 36 steps, and I assume this is because some of the gates in the circuit are decomposed into XmonGates. Is there a way to see this decomposed circuit?
Alternatively, is there a way to step through the simulation where each step matches a moment in the original circuit?
"
"['measurement', 'textbook-and-exercises', 'density-matrix', 'cryptography']"," Title: Density matrix after measurement on density matrixBody: Let's say Alice wants to send Bob a $|0\rangle$ with probability .5 and $|1\rangle$ also with probability .5. So after a qubit Alice prepares leaves her lab, the system could be represented by the following density matrix: $$\rho = .5 |0\rangle \langle 0| + .5 |1\rangle \langle 1|= \begin{bmatrix} .5 & 0 \\ 0 & .5 \end{bmatrix} $$Am I right?
Then, Bob would perform measurement in the standard basis. This is where I get confused. For example, he could get $|0\rangle$ with probability .5 and $|1\rangle$ with .5. So what is the density matrix representing the state after Bob performs his measurement in the standard basis accounting for both of his possible outcomes?
"
"['programming', 'qiskit']"," Title: How to set up Qconfig.py and where is the file?Body: How to set up Qconfig.py and where is the file? I mean under which folder? Like /anaconda/lib/python3.6/site-packages/qiskit/.
"
"['mathematics', 'matrix-representation', 'nielsen-and-chuang']"," Title: How can we be sure that for every $A$, $A^\dagger A$ has a positive square root?Body: In the Polar Decomposition section in Nielsen and Chuang (page 78 in the 2002 edition),
there is a claim that any matrix $A$ will have a decomposition $UJ$ where $J$ is positive and is equal to $\sqrt{A^\dagger A}$.
Firstly, how can we be sure that every matrix $A^\dagger A$ will have a square root, and secondly, that the square root will be a positive operator?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: Can vectorization lead to mixed states?Body: Given an operator $L = \sum_{ij}L_{ij}\vert i\rangle\langle j\vert$, in some basis, the definition of vectorization is $vec(L) = \sum_{ij}L_{ij}\vert i\rangle\vert j\rangle$. The operation is invertible and heavily used in quantum information.
This definition always leads to a pure bipartite state but my notes, Wikipedia, etc. have no indication about whether one can also map operators (of some sort) to a mixed bipartite state. Can anyone shed some light on if this makes sense and there exist extensions of the definition of vectorization?
"
['quantum-operation']," Title: Derive the form of an isometric extension of the erasure channelBody: Show that an isometric extension of the erasure channel is $$U^N_{A\to BE} =\sqrt{1−\epsilon}\left(|0\rangle_B \langle 0|_A +|1\rangle_B \langle 1|_A \right)\otimes|e\rangle_E+ \sqrt{\epsilon}|e\rangle_B \langle0|_A \otimes |0\rangle_E + \sqrt{\epsilon}|e\rangle_ B \langle 1|_A \otimes |1\rangle_E$$
$$=\sqrt{1−\epsilon} \text{ I}_{A \to B}\otimes|e\rangle_E+\sqrt{\epsilon}\text{ I}_{A \to E}\otimes\otimes|e\rangle_B$$
where, the Erasure Channel implements the following: $\rho \to (1 − \epsilon) \rho + \epsilon|e\rangle\langle e|$.
I know that the Kraus operators for the quantum erasure channel are the following: $\left\{\sqrt{1−\epsilon}\left(|0\rangle_B \langle 0|_A +|1\rangle_B \langle 1|_A \right),\sqrt{\epsilon}|e\rangle_B \langle0|_A,\sqrt{\epsilon}|e\rangle_B \langle1|_A\right\}$. I also know that for a quantum channel $N_{A\to B}$ with the following Kraus representation:
$$N_{A\to B}(\rho_A) = \sum_jN_j\rho_A N_j^{\dagger},$$
an isometric extension of the channel $N_{A\to B}$ is the following linear map: $$U^N_{A \to BE} =\sum_jN_j \otimes|j\rangle$$ .
Using this, the $N_1$, $N_2$ and $N_3$ in our case are $\sqrt{1−\epsilon}\left(|0\rangle_B \langle 0|_A +|1\rangle_B \langle 1|_A \right)$,$\sqrt{\epsilon}|e\rangle_B \langle0|_A$ and $\sqrt{\epsilon}|e\rangle_B \langle1|_A$ are respectively. I am just confused on, which $|j\rangle$ to choose. How do I know the appropriate orthonormal vectors in this case?
Thanks for the help!
"
"['algorithm', 'shors-algorithm', 'cirq']"," Title: Would this quantum algorithm implementation work?Body: I am trying to implement the order finding algorithm on Cirq finding the minimal positive $r$ for coprime $x$ and $N$ satisfying the equation $x^r \ = \ 1$(mod$ \ N$). In my case, I have set $x \ = \ 2$ and $N \ = \ 3$, so the algorithm should output $r \ = \ 2$. In order to implement the unitary, I simply observed that if we initialize the input that is being acted upon by the controlled-unitary matrices as a collection of $|1\rangle$ states, the unitary operation for this algorithm, $U|y\rangle \ = \ |2^jy \ $mod($3)\rangle$ acts trivially, in all circumstances, since $|y\rangle \ = \ |11\rangle \ = \ |3\rangle$. I feel as though I am missing a very important point, or maybe am not understanding the algorithm correctly, because when I try to implement the algorithm with no unitary gate (since it is supposedly trivial), the algorithm does not work.
"
['measurement']," Title: Are projective measurement bases always orthonormal?Body: Are projective measurement bases always orthonormal?
"
"['algorithm', 'superposition']"," Title: How to prepare a superposed states of odd integers from $1$ to $\sqrt{N}$?Body: $\newcommand{\q}[2]{\langle #1 | #2 \rangle}
\newcommand{\qr}[1]{|#1\rangle}
\newcommand{\ql}[1]{\langle #1|}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\round}[1]{\left\lfloor #1 \right\rceil}
\DeclareMathOperator{\div}{div}
\DeclareMathOperator{\modulo}{mod}
$I present all the detailed reasoning in my strategy and show it has a problem. My question is how to overcome this flaw. An example here will be best. In what follows, ""bit"" means ""q-bit"".
Let $N = 77$ and let $n$ be the number of bits of $N$. How many bits do I need to superpose all odd integers from 1 to $\sqrt{77}$? I believe that's approximately $n/2$. (It is $n/2$ exactly if $n$ were even. Since it is not, I need $\floor{n/2} + 1$.) For $N = 77$, $7$ bits is enough.
Let $B$ be a register big enough to hold the superposed states of all all odd integers from 1 to $\sqrt{77}$. Let $A$ be a register big enough to hold $77$, but also big enough to hold the division of $77$ by the superposed state held in $B$. For clarity, assume my division operator is given by
$$U_{\div} \qr{b}_x \qr{a}_y = \qr{b}_x (\qr{a \div b} \qr{a \modulo b})_y$$
and assume that $y = n + (n/2)$ and $x = n/2$. So, in our example, since $N=77$, it follows $n = 8$ and then the size of $B$ is $4$ bits, while the size of $A$ is $8 + 4 = 12$.
But since I want in $B$ only the odd integers, I take $B$'s lowest bit and force it to be $1$. So my preparation of $B$ is to start with it completely zeroed out, flip its lowest bit and finally use the Hadamard gate on all of B's bits except the lowest. I get
$$H^{\otimes 3} \qr{000}\otimes\qr1 = \qr{+}\qr{+}\qr{+} \otimes \qr{1}.$$
Now I get the states $\qr{1}, \qr3, \qr5, \qr7, \qr9, \qr{11}, \qr{13}, \qr{15}$. I wish I had stopped at $\qr{7}$.
This means I need less than $n/2$ bits in register $B$. By inspection, I see in this example that the size of $B$ should be $3$ bits, not $4$ because this way I end up with the superposition terms $\qr1, \qr3, \qr5, \qr7$, but all I'm sure of here is just this example.
So the question is what size in general should $B$ have so that it is able to hold all superposition terms of only odd integers from $1$ to $\sqrt{N}$?
"
"['algorithm', 'shors-algorithm', 'cirq']"," Title: Why is this implementation of the order finding algorithm not working?Body: I asked a question about this earlier, but I am still coming across problems in my algorithm implementation.
I am trying to implement the order finding algorithm on Cirq finding the minimal positive $r$ for coprime $x$ and $N$ satisfying the equation $x^r \ = \ 1$(mod$ \ N$). In my case, I have set $x \ = \ 2$ and $N \ = \ 3$, so the algorithm should output $r \ = \ 2$.
Since the unitary is defined by $U|y\rangle \ = \ |2^jy$mod($3)\rangle$, and $y \ = \ |1\rangle$, then the value of $U|1\rangle$ should simply switch back and forth between $|1\rangle$ and $|2\rangle$. Since we are defining:
$2^j$mod($3) \ = \ \big(2^{j_1 2^0}$mod($3)\big)\big(2^{j_2 2^1}$mod($3)\big) \ ... \ \big(2^{j_t 2^{t-1}}$mod($3)\big)$
Each of the terms in the form $\big(2^{j_k 2^k}$mod($3)\big)$ becomes $\big(1 \ $mod($3)\big)$, except for when $k \ = \ 0$, in which case we get $\big(2 \ $mod($3)\big)$. Because of this, I implemented two $CNOT$ gates being controlled by the $j_1$ qubit acting on each of the two qubits acting as $|y\rangle$ ($|1\rangle$ is mapped to $|2\rangle$ if the control qubit is $|1\rangle$, and $|1\rangle$ is mapped to $|1\rangle$ if the control qubit is $|0\rangle$). It doesn't seem necessary to implement more gates on all the other $j$ qubits because mathematically, they turn out to act trivially in this context.
After this, I then pass all of the $j$ qubits through the inverse quantum Fourier transform. The outputs I'm getting seem kind of strange:
(This is all $7$ of the $j$ qubits measured for $20$ iterations of the circuit).
I was just wondering if anyone had any insight, since I feel as though I made some kind of mistake in creating the unitary.
I don't think this is necessarily a coding problem but just in case it is helpful, this is the code I have for the circuit so far:
# Quantum Order Finding Algorithm
import cirq
import numpy as np
import random
import tensorflow as tf
import time
import timeit
from cirq.google import ExpWGate, Exp11Gate, XmonMeasurementGate
from cirq.google import XmonSimulator
from matplotlib import pyplot as plt
from itertools import combinations
from cirq.circuits import InsertStrategy
# Gate schematic --> Hadamard (0) --> Controlled Phase gate (1, 0) --> Hadamard (1) --> Swap (0, 1) --> Measure (0, 1)
n = 5
a = 2
qubits = []
for i in range(0, n):
qubits.append(cirq.GridQubit(0, i))
other_qubits = []
for k in range(n, n+a):
other_qubits.append(cirq.GridQubit(0, k))
circuit = cirq.Circuit()
#Preparing the qubits
for j in qubits:
had_gate = cirq.H.on(j)
circuit.append([had_gate], strategy=InsertStrategy.EARLIEST)
'''
for l in other_qubits:
x_gate = cirq.X.on(l)
circuit.append([x_gate], strategy=InsertStrategy.EARLIEST)
'''
circuit.append(cirq.X.on(other_qubits[1]))
#Applying the unitary
circuit.append([cirq.CNOT.on(qubits[0], other_qubits[0]), cirq.CNOT.on(qubits[0], other_qubits[1])])
#circuit.append([cirq.CNOT.on(qubits[0], other_qubits[1]), cirq.CNOT.on(qubits[0], other_qubits[2]), cirq.CNOT.on(qubits[1], other_qubits[2]), cirq.CNOT.on(qubits[1], other_qubits[0]), cirq.CCX.on(qubits[0], qubits[1], other_qubits[0])])
#Applying the Inverse QFT
circuit.append(cirq.SWAP.on(qubits[0], qubits[4]))
circuit.append(cirq.SWAP.on(qubits[1], qubits[3]))
for b in range(0, n):
place = n-b-1
for h in range(n-1, place, -1):
holder = h
gate = cirq.CZ**(1/(2**(h-place)))
circuit.append(gate.on(qubits[holder], qubits[place]))
circuit.append(cirq.H.on(qubits[place]))
def circuit_init_again(meas=True):
if meas:
yield XmonMeasurementGate(key='qubit0')(qubits[0])
yield XmonMeasurementGate(key='qubit1')(qubits[1])
yield XmonMeasurementGate(key='qubit2')(qubits[2])
yield XmonMeasurementGate(key='qubit3')(qubits[3])
yield XmonMeasurementGate(key='qubit4')(qubits[4])
#circuit.append()
circuit.append(circuit_init_again())
print("" "")
print("" "")
print(circuit)
print("" "")
print("" "")
simulator = XmonSimulator()
result = simulator.run(circuit, repetitions=50)
print(result)
"
['complexity-theory']," Title: What's the notion of input size for Quantum Verification?Body: I've been looking into $\mathsf{QPIP}_\tau$ as a complexity class. The following will be a summary of definition 3.12 in Classical Verification of Quantum Computations by Urmila Mahadev.
A language $L$ is said to have a Quantum Prover Interactive Proof ($\mathsf{QPIP}_\tau$ ) with completeness $c$
and soundness $s$ (where $c − s$ is at least a constant) if there exists a pair of algorithms $(P, V)$, where $P$ is the
prover and $V$ is the verifier, with the following properties:
- The prover $P$ is a $\mathsf{BQP}$ machine, which also has access to a quantum channel which can transmit $\tau$ qubits.
- The verifier $V$ is a hybrid quantum-classical machine. Its classical part is a $\mathsf{BPP}$ machine. The quantum
part is a register of $\tau$ qubits, on which the verifier can perform arbitrary quantum operations and which has
access to a quantum channel which can transmit $\tau$ qubits. At any given time, the verifier is not allowed to
possess more than $\tau$ qubits. The interaction between the quantum and classical parts of the verifier is the
usual one: the classical part controls which operations are to be performed on the quantum register, and
outcomes of measurements of the quantum register can be used as input to the classical machine.
- There is also a classical communication channel between the prover and the verifier, which can transmit
polynomially many bits at any step.
- At any given step, either the verifier or the prover perform computations on their registers and send bits and
qubits through the relevant channels to the other party.
There are some more details regarding defining $c$ and $s$, but these are unimportant for my question.
Additionally, it should suffice to take $\tau = 0$, and let $V$ be a $\mathsf{BPP}$ machine that has entirely classical communication with $P$.
I'm curious about how specifically the classical part of $V$ is supposed to manipulate the input.
The setting for this paper is taking arbitrary $L\in\mathsf{BQP}$ and reducing it to 2-Local Hamiltonian (where the non-identity parts are Pauli $X$ and $Z$ gates), which is $\mathsf{QMA}$-complete.
This means that the initial input $L$ is specified as some polynomial-size quantum circuit, which must be reduced (in quantum polynomial time) to a local hamiltonian instance.
I have issues understanding how $V$ (in the case when $\tau = 0$, so $V$ is just a $\mathsf{BPP}$ machine) can preform this reduction, or even more generally hold the quantum circuit. Each of the (polynomially many) gates in the circuit is a quantum gate, which for a $n$-qubit system would be of size $2^n\times 2^n$. I feel like $V$ can't have an input of this size, because then the input size is exponential in $n$ (which would cause all sorts of issues with restricting $V$ to be poly-time in the input).
I could see each of (polynomial many) gates $U_i$ being written as a product of (polynomial many) universal gates from some fixed, finite set of gates (or even some gate set of size $\mathsf{poly}(n)$ --- it shouldn't matter). This would mean that the input to $V$ is small enough such that ""polynomial time in the input"" is a reasonable restriction.
- Under such a restriction, can a $\mathsf{BPP}$ verifier $V$ reduce the circuit $L$ to $2$-Local Hamiltonian?
- Additionally, while such a restriction is natural to me, is this how it is typically done? Specifically, how are quantum circuits generally input to classical machines?
"
"['quantum-gate', 'gate-synthesis', 'nielsen-and-chuang']"," Title: Construction of ${R_n(\theta)}$ using only the Hadamard and ${\pi/8}$ gatesBody: In the ""Quantum Computation and Quantum Information 10th Anniversary textbook by Nielsen & Chuang"", they claim that Eqn(4.75) is a rotation about the axis along the direction
( ${cos(\pi/8)}$, ${sin
(\pi/8)}$, ${cos(\pi/8)}$ ). They then defined an angle ${\theta}$ such that:
${cos(\theta/2)}$ = $cos^2$(${\pi/8}$)
and its also claimed to be an irrational multiple of 2${\pi}$.
We know that the rotational matrices about any arbitrary axis takes the form of
${cos(\theta/2)}$ ${I}$ - ${i}$ (${n_x}$${X}$ + ${n_y}$${Y}$ + ${n_z}$${Z}$) ${sin(\theta/2)}$ ,
but Eqn(4.75) gives:
${cos^2(\pi/8)}$ ${I}$ - ${i}$ [ ${cos(\pi/8)(X+Z)+sin(\pi/8)Y}$ ] ${sin(\pi/8)}$
My question is how does this ${\theta}$ be able to simultaneously satisfy ${sin(\pi/8})$? Why does ${\theta}$ be referenced from ${cos^2(\pi/8)}$ instead of ${sin(\pi/8})$?
"
['quantum-operation']," Title: How to show there is a channel $\tilde\Lambda$ such that $\tilde\Lambda\circ\Lambda=\Lambda'$ with $\Lambda,\Lambda'$ dephasing channels?Body: I'm taking a quantum information course and one of my exercises says to find $p,p'$ for which there is a channel $\tilde\Lambda(\Lambda(\rho))=\Lambda'(\rho)$, where $\Lambda$ and $\Lambda'$ are dephasing channels with $\Lambda(\rho)=(1-p)\rho+p\sigma_z\rho\sigma_z, \Lambda'(\rho)=(1-p')\rho+p'\sigma_z\rho\sigma_z$. I'm rather confused how to do that, would appreciate any tips and hints.
"
"['algorithm', 'shors-algorithm', 'cirq']"," Title: Is this the correct quantum circuit for the order-finding algorithm?Body: The algorithm is being implemented on Cirq, with the goal of finding the smallest $r$ for cooprime numbers $x$ and $N$ satisfying the equation $x^r \ = \ 1($mod $N)$. I have set $x \ = \ 2$ and $N \ = \ 3$, so the algorithm should output $r \ = \ 2$.
This is the circuit that Cirq outputs for my code. Are there any mistakes that I'm making in the algorithm implementation, as I am getting some strange results:
"
"['algorithm', 'cirq']"," Title: Do these outputs seem normal for the order finding algorithm?Body: I'm sorry for posting so many questions about this specific problem, but I just want to make sure that I am implementing an algorithm correctly. I am simulating the order finding algorithm (finding minimal $r$ for $x^r \ = \ 1$mod($N)$). Right now, I am trying to implement the case of $x \ = \ 2$ and $N \ = \ 5$. I am getting outputs that look somewhat like this:
When I pass these results through the continued fraction algorithm, I'm getting the expected results of the algorithm, however, these results seem weird, as they are basically just every combination of $1$ and $0$ for the first two qubits. I just want to make sure that I am actually implementing the algorithm correctly, and not just getting lucky with my results. Again, I'm very sorry for all the questions about this specific problem.
"
['algorithm']," Title: Are the order finding and period finding algorithms the same thing?Body: Do they both just use similar methods of calculation, or are they completely interchangeable?
"
"['quantum-state', 'notation']"," Title: A question about notation for quantum statesBody: I am reading an article on representation of digital images using qubits. But I am not able to understand the notations of the article.
Can somebody help me: $|0\rangle$: It means the first basis vector in the respective vector space. But what does $ |0\rangle^{3q+ 2n}$ mean?
"
"['physical-qubit', 'quantum-state', 'resource-request']"," Title: Non-layperson explanation of why a qubit is more useful than a bit?Body: I have a computer science and mathematics degree and am trying to wrap my head around quantum computing and it just doesn't seem to make sense from the very beginning. I think the problem is the definitions out there are generally watered down for lay-people to digest but don't really make sense.
For example, we often see a bit compared to a qubit and are told that an ""old fashion digital bit"" can only be in one of two states, 0 or 1. But qubits on the other hand can be in a state of 0, 1, or ""superposition"", presumably a third state that is both 0 AND 1. But how does being in a state of ""both 0 and 1"" deliver any value in computing as it is simply the same as ""I don't know""? So for example, if a qubit represents the last binary digit of your checking account balance, how does a superimposed 0 and 1 deliver any useful information for that?
Worse you see these same articles say things like ""and two qubits can be put together for a total of 4 states, three can make a total of 8 states"" -- ok that's just $2^n$, the same capability that ""old-fashioned bits"" have.
Obviously there is great promise in quantum computing so I think its more a problem of messaging. Any suggestions for intro/primer literature that doesn't present the quantum computing basics in this oxymoronic way?
"
"['circuit-construction', 'quantum-fourier-transform', 'cirq', 'quirk']"," Title: Why are these circuits not producing the expected output?Body: This circuit was created on the Quirk platform. I'm trying to implement a basic case of phase estimation. For some reason, I'm getting this strange result.
When the Inverse QFT is broken down, it seems to yield the expected answer:
I have no idea why this is happening. I tried playing around with the endian-ness of the qubits, but it didn't seem to work.
"
"['cryptography', 'games']"," Title: How are nonlocal games used in device-independent quantum cryptography?Body: As I understand it, device-independent quantum cryptography enables you to safely perform cryptographic operations without necessarily trusting the quantum device on which they are performed. Nonlocal games are said to have applications in this domain; see for example A Monogamy-of-Entanglement Game With Applications to Device-Independent Quantum Cryptography by Tomamichel et al. Is there a simple explanation of how nonlocal games can help in this domain? I understand the mechanics of the CHSH game quite well.
"
"['algorithm', 'circuit-construction', 'quantum-fourier-transform']"," Title: Implementation of inverse QFT?Body: When implementing the inverse quantum Fourier transform, in addition to reversing the circuit, does one need to take the conjugate transpose of the phase shift gates in the circuit as well?
"
"['algorithm', 'speedup', 'complexity-theory']"," Title: Quantum algorithms for problems outside NPBody: What is known about quatum algorithms for problems outside NP (eg NEXP-complete problems), both theoretically like upper & lower speedup bounds and various (im)possibility results, as well as concrete algorithms fro specific problems?
The reason I am asking is that we currently have processorrs with low 10's of qubits. NP problems over low 10s of classical bits can generally solved on classical computers. With non-NP problems we could have problems which are not classically tractable even in that range. This could be an opportunity to demonstrate practical quantum advantage on current hardware. This does not necessarily require the quantum algorithm to be generally tractable, only that it can solve smallish problems in acceptable time where classical algorithms can not.
The idea is to find problems that take considerable time on classical computers for instance sizes that are representable on current quantum processors. Finding quantum algorithms that are faster on those instances would be a form of quantum advantage even if the quantum algorithms were not necessarily superior asymptotically.
"
"['algorithm', 'circuit-construction', 'quantum-fourier-transform', 'cirq', 'quirk']"," Title: Why are these circuits not producing the same output?Body:
I am simulating the phase shift algorithm on the Quirk platform. Even when the endian-ness of the built-in inverse QFT gate is corrected for, the circuits still output different results. Shouldn't the output be identical?
The bottom circuit seems to be producing the output I would expect from the phase estimation algorithm, I'm not sure what is going on with the top circuit.
I am using Quirk to ensure I am implementing the order finding algorithm correctly, so this result is kind of worrying, since I trust the built in inverse QFT over the one that I made, however, mathematically, I am fairly certain that my circuit is producing the right values.
"
"['error-correction', 'measurement', 'surface-code']"," Title: Measuring order ancilla qubits in surface codeBody: Recently I have been reading about surface codes a little and one thing I came acros was a specific order in which gates should be applied before the ancilla is measured. See for instance figure 2 in this article.
The specific order of the two-qubit gates with the ancilla is important due to some commutation relations which will not be valid otherwise.
Can someone explain in more detail why this order is important? (heavy math is allowed here)
Furthermore, what goes wrong if we use different orders? And why is this order different for $X$- and $Z$-type plaquettes?
"
"['algorithm', 'circuit-construction']"," Title: How to get all combinations of given input?Body: I'm stuck with a very specific problem that I'm not sure on how to implement using quantum gates. Suppose I have an n qubit circuit and that I want in output a random n qubit string containing exactly k qubits equals to one. E.g. if n=7 and k=3, possible outputs can be $|0010110\rangle$ or $|0101001\rangle$.
In other words, it basically should give one of the possible combinations of the binomial coefficient $\binom{n}{k}$.
Is there any efficient way to implement this?
"
"['quantum-operation', 'partial-trace']"," Title: How many Kraus operators are required to characterise a channel with different start and end dimensions?Body: If we have a quantum channel mapping from a $d$-dimensional state to a $d$-dimensional state, it can be described by at most $d^2$ Kraus operators. Suppose our channel maps instead from a $d_1$-dimensional state to a $d_2$-dimensional state, with $d_1>d_2$, e.g. with the quantum operation of taking the partial trace over a mode. What is the maximum required number of Kraus operators to characterise the channel? Is it $d_1d_2$, analogous to the case where $d_1=d_2$?
"
['cpt-symmetry']," Title: Eigenvalues of CPT operatorBody:
Suppose we define an operator CPT that carries out the CPT transformation:
$$\text{CPT}|\Psi\rangle = A|\Psi\rangle$$
where A is just a constant. Or put another way, the states of our theory are eigenfunctions of the CPT operator. -Source
What do the eigenvalues of the CPT operator mean? *
"
"['resource-request', 'qudit', 'photonics']"," Title: Time-bin encoding quditsBody:
Time-bin encoding is a technique used in Quantum information science to encode a qubit of information on a photon. Wikipedia
Is there a generalization for $n$-th level qudits?
"
"['quantum-gate', 'physical-realization', 'superposition']"," Title: How does the CNOT gate operate when the control qubit is a superposition?Body: If a control qubit is in superposition, how it will affect target qubit if it is collapsed or in superposition? Is it true that CNOT works only if the control bit collapsed to 1? Also, is it possible to collapse or Hadamard control qubit “on the go” in a real life quantum computer and have a functional CNOT gate?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Is it possible to expand/merge different circuits?Body: Suppose I have created a circuit composed of some registers with the usual
qc = QuantumCircuit(qr, cr)
where qr and cr are a quantum register and a classical register respectively.
Now, suppose that at this point I want to invoke a subroutine. This subroutine, however, uses some ancillas. Is there any functions to append this new set of qubits to the original circuit? Something like
ancillas = QuantumRegister(n, 'ancillas')
#qc.append(ancillas)
An equivalent problem (maybe) is the following one. Suppose I have a quantum circuit qcn composed of n qubits and a subroutine which returns another quantum circuit qck operating on k qubits, with k > n. Is it possible to compose the two circuits in such a way that the first n qubits on which the subroutine operates are the same of the original circuit?
At the moment, the only solution to me seems to declare in advance all the total number of qubits required (k in the previous case) and then passing around them to the various functions.
"
"['algorithm', 'grovers-algorithm']"," Title: Speedup Prange ISD using GroverBody: In his 2009 paper, Grover vs McElicee, Bernstein proposed to use the Grover's algorithm to obtain a quadratic speedup on the Prange ISD.
However, it is not quite clear to me in which part of the algorithm a Grover search can be used and all other papers and references citing Bernstein's paper don't seem to clarify the point.
Does anyone has any idea on this point?
"
['adiabatic-model']," Title: Proof on approximating adiabatic evolution by quantum circuitBody: I am reading on how the adiabatic evolution can be approximated by a quantum circuit of size poly(nT) and I am trying to follow the derivation in the paper
W. van Dam, M. Mosca, and U. Vazirani, “How Powerful is Adiabatic
Quantum Computation?,” Proceedings 2001 IEEE International Conference
on Cluster Computing, pp. 279–287, 2001.
In section 4, page 4, it states that:
""The Campbell-Baker-Hausdorff theorem tells us how well we can approximate ‘parallel Hamiltonians’ by consecutive
ones: $|||\exp(A+B) − \exp(A)\exp(B)||| \in O(|||AB|||)$.""
The norm I believe is just the operator induced norm. I am familiar with the BCH formula but could not see the above relation directly coming out from the formula. So how is this relation derived?
I tried looking into the reference which is ""matrix analysis"" by Rajendra Bhatia but didn't get any success.
"
['algorithm']," Title: Multiple random coin flipsBody: Suppose that in my circuit I have to generate multiple, say n, random coin flips.
For example, this coin flips could be used to activate n CNOTs half of the time.
The trivial solution could be to use n different qubits and Hadamard them. However, this gets really huge when n is large.
Is there any better way? By better I mean using a small (fixed??) number of qubits and only a few simple quantum gates.
"
"['circuit-construction', 'programming', 'measurement', 'qiskit']"," Title: qiskit - Is there any way to discard the results of a measurement?Body: I have a circuit composed by n qubits, plus a single one which is an ancilla. I'm making multiple measurements on the ancilla at different stages of the circuit, while working on the n qubits. These measurements are not really needed at all: they are just a way to collapse the state of the qubit at some point during the computation and then reuse the same qubit in a different way.
At the end of the circuit, when I'm measuring the outcome of the n qubits, I don't want the result of this ancilla to be shown in the output of the get_counts() function; what I want is only the output of the n qubits. Is there any way to achieve this result?
"
"['mathematics', 'hamiltonian-simulation', 'notation']"," Title: Problem with the mathematical formulation of ""qubitization""Body: In this research paper, the authors introduce a new algorithm to perform Hamiltonian simulation.
The beginning of their abstract is
Given a Hermitian operator $\hat{H} = \langle G\vert \hat{U} \vert G\rangle$ that is the projection of an oracle $\hat{U}$ by state $\vert G\rangle$
created with oracle $\hat{G}$, the problem of Hamiltonian simulation is approximating the time evolution operator $e^{-i\hat{H}t}$ at time $t$ with error $\epsilon$.
In the article:
- $\hat{G}$ and $\hat{U}$ are called ""oracles"".
- $\hat{H}$ is an Hermitian operator in $\mathbb{C}^{2^n} \times \mathbb{C}^{2^n}$.
- $\vert G \rangle \in \mathbb{C}^d$ (legend of Table 1).
My question is the following: what means $\hat{H} = \langle G\vert \hat{U} \vert G\rangle$? More precisely, I do not understand what $\langle G\vert \hat{U} \vert G\rangle$ represents when $\hat{U}$ is an oracle and $\vert G \rangle$ a quantum state.
"
['clifford-group']," Title: Isomorphism between the Clifford group and the quaternionsBody: How do I find an explicit isomorphism between the elements of the Clifford group and some 24 quaternions?
The easy part:
The multiplication of matrices should correspond to multiplication of quaternions.
The identity matrix $I$ should be mapped to the quaternion $1$.
The hard part:
To what should the other elements of the Clifford group be mapped? Since the following to elements generate the entire group, mapping these will be sufficient:
$$H=\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}\text{ and }P=\begin{bmatrix}1&0\\0&i\end{bmatrix}$$
Can anybody help?
"
"['algorithm', 'shors-algorithm']"," Title: Expected repetitions of the quantum part of Shor's algorithmBody: Shor's algorithm to factor a number $N$ goes as follows:
- Pick a random value $b \in (0, N)$.
- Use a specific quantum computation to a sample a value $v$ that should be close to $2^{m} k/p$ where $m$ is a precision parameter of the quantum computation, $p$ is the period of $f(x) = b^x \pmod{N}$, and $k$ is an unknown integer resulting from the sampling process.
- Convert $v$ into a potential period $p$ using an algorithm based on continued fractions.
- If $b^p \neq 1 \pmod{N}$, goto 1. The period finding process failed (e.g. maybe you got $v=0$).
- If $p$ is odd, goto 1. You got a useless period. Try a different $b$.
- If $b^{p/2} \equiv -1 \pmod{N}$, goto 1. You got a useless period. Try a different $b$.
- Output $\gcd(b^{p/2} - 1, N)$
My question is: how often do steps 4, 5, or 6 fail? Assuming an ideal quantum computer with no error, how often do you just get unlucky and pick a bad $b$ or sample a bad $v$? How many times do you expect to repeat step 2 before the factoring succeeds?
References giving numerical upper bounds on the 4-5-6 failure chance would be especially appreciated.
"
"['quantum-state', 'tensor-product', 'no-cloning-theorem']"," Title: Proof of no-cloningBody: I was reading a proof of No-cloning theorem, there are a couple of steps that are not clear to me, but the book does not give explanation for them. So here it is:
Theorem: It is impossible to create an identical copy of an arbitrary unknown quantum state.
Proof (by contradiction): Suppose that there exists a unitary $C$ (that copies an arbitrary unknown q-state). Then:
.
This is the first thing I have trouble with, why do we take only one state ($\left| 0 \right>$ state) to prove that it is impossible to copy any arbitrary state into $any$ qubit?
The proof goes on stating:
Here I don't understand how (116) is the same as (117) (don't mind explaining the identity matrix in the middle). I will appreciate it if you make these 2 steps clearer to me.
"
"['algorithm', 'quantum-gate', 'matrix-representation', 'teleportation', 'quirk']"," Title: Building a matrix corresponding to the teleportation circuitBody: I'm trying to build the matrix that corresponds to this quantum teleportation circuit, but it never works when I test it in the quirk simulator, I tried finding the matrix corresponding to every part of the circuit and then multiplying but it never works, anyone knows what I might be doing wrong?
When I was calculating the matrices I didn't consider the measurement gates.
"
"['open-quantum-systems', 'master-equation']"," Title: How to formulate the master equation for three systems?Body: I have a three composite system of the form $H_{\text{tot}}=H_{ab}\otimes H_c$ where the system $C$ is behaving as the dissipator or the environment (I can model it as a thermal bath). And it is coupled only to system $B$ but not $A$. While $A$ is coupled with $B$ and entangles with it under time evolution. At $t=0$ is can take a composite state completely separable $H_{\text{tot}}(0)=H_a\otimes H_b \otimes H_c$.
My objective is to solve the Master equation (more precisely the Lindbladian form) for $\rho_{ab}.$
But when I do that (with the partition as $H_{ab}|H_c$), the sub-system $A$ trivially disappears from the equations of motion. Because it does not couple with $C$ directly but only acts via $B$ indirectly.
What is the right way to model this kind of interaction?
"
"['measurement', 'density-matrix', 'decoherence']"," Title: How to write a post-measurement state, if we don't know the measurement result?Body: Once a state is measured, but we don't look at the result, is the state now written as a density matrix, that is, the probability that it could land on a measurement operator multiplied by the operator applied on the state, this summed up for every measurement operator that it could land on contained in the measurement?
"
"['algorithm', 'shors-algorithm', 'unitarity']"," Title: Understanding why the modular function part of Shor's algorithm is unitaryBody: I've been struggling to understand the modular exponent bit of Shor's algorithm. My understanding is that it takes
a register in the state $\frac{1}{\sqrt{Q}}\sum_{k=1}^{Q-1} |k\rangle |0\rangle$ to the state $\frac{1}{Q}\sum_{k=1}^{Q-1} |k\rangle |f(k)\rangle$ where $f(k) = x^{k}$ mod $N$.
(Here, $x$ is the random integer found at the start of Shor's algorithm.)
My question is: Why is this operation unitary?
"
"['programming', 'qiskit']"," Title: How to fix? 'E1101:Instance of 'QuantumCircuit' has no 'h' member' and 'E1101:Instance of 'QuantumCircuit' has no 'cx' member'Body: I'm using this simple code to test my Qiskit and learn how to use it but it keeps giving this problems, how do I fix it (Using VS Code and Anaconda Python 3.7)
import numpy as np
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute
# Create a Quantum Register with 3 qubits.Basicaly creating the number of qubits your system will use
q = QuantumRegister(3, 'q')
# Create a Quantum Circuit acting on the q register. Declaring the Circuit, this circuit shall create a GHZ state
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])
#Draws the circuit
from qiskit.tools.visualization import circuit_drawer
circuit_drawer(circ)
"
"['algorithm', 'entanglement', 'grovers-algorithm', 'w-state']"," Title: How to implement Grover's diffusion operator when starting with a W state?Body: In the general form of Grover's algorithm, we start with the uniform superposition of n qubits. Now, suppose instead that we start with a generic state, for example the W state, and the oracle only inverts the phase of one of the basis.
To make it more concrete, let's say we have in input a $W_3$ state $$|W\rangle = \frac{1}{\sqrt{3}} (|001\rangle + |010\rangle + |100\rangle)$$
and that the oracle inverts only state $$|001\rangle$$
At this point, how can we implement the diffusion operator? In other words, how can we amplify only this state in order to obtain the right output with an high probability?
"
"['programming', 'qiskit', 'ibm-q-experience', 'qasm']"," Title: Print circuit compiled on hardware?Body: I would like to see the compiled circuit as executed on a hardware.
Nominally, this sequence of commands should return the QASM circuit in the variable ran_qc, but it is a Null pointer. Does anyone know how to make it work?
I was notified via this ticket that it should be fixed, but I do not see any improvement on my end.
I'm using qiskit.version'0.6.1'
and connected to IBMQX4.
jobRes=job.result()
print('ran_qc get_names()=',jobRes.get_names())
assert len( jobRes.get_names()) ==1
circuit_name = jobRes.get_names()[0]
print('ran_qc name=',circuit_name)
ran_qc=jobRes.get_ran_qasm(circuit_name)
print(ran_qc)
"
"['ibm-q-experience', 'teleportation']"," Title: Why can't you run a teleportation circuit on an IBM Q device?Body: I'm studying teleportation circuits with this tutorial and just out of curiosity, why can't a teleportation circuit be run on an IBM Q device?
"
"['quantum-gate', 'programming', 'qiskit', 'gate-synthesis']"," Title: How do I build a gate from a matrix on Qiskit?Body: I'm creating a gate for a project and need to test if it has the same results as the original circuit in a simulator, how do I build this gate on Qiskit? It's a 3 qubit gate, 8x8 matrix:
$$
\frac{1}{2}
\begin{bmatrix}
1 & 0 & 1 & 0 & 0 & 1 & 0 & -1 \\
0 & 1 & 0 & 1 & 1 & 0 & -1 & 0 \\
0 & 1 & 0 & -1 & 1 & 0 & 1 & 0 \\
1 & 0 & -1 & 0 & 0 & 1 & 0 & 1 \\
1 & 0 & 1 & 0 & 0 & -1 & 0 & 1 \\
0 & 1 & 0 & 1 & -1 & 0 & 1 & 0 \\
0 & 1 & 0 & -1 & -1 & 0 & -1 & 0 \\
1 & 0 & -1 & 0 & 0 & -1 & 0 & -1
\end{bmatrix}
$$
"
"['information-theory', 'entropy']"," Title: Shannon entropy is least when Measurement basis = Mixture basisBody: For a one qubit system, take a basis.
Call this the mixture basis.
Consider only basis states and classical mixtures of these basis states.
Definition of Shannon Entropy used here: Defined with respect to the measurement basis, on the probabilities of various outcomes.
For eg: $\frac{1}{2}|0\rangle \langle0| + \frac{1}{2}|+\rangle \langle+|$, when measured in the $|0\rangle, |1\rangle$ basis has Shannon Entropy $-\frac{3}{4}\log(\frac{3}{4}) - \frac{1}{4}\log(\frac{1}{4})$ because there is $\frac{3}{4}$ chance of measuring $|0\rangle$ and $\frac{1}{4}$ chance of measuring $|1\rangle$.
I'm trying to prove that the least value of Shannon Entropy will occur when the measurement basis is equal to the mixture basis.
(This is for me to get an intuition of Von Neumann entropy. If I prove the above, then I can think of Von Neumann entropy as the least Shannon entropy I could get after measuring across any basis.)
Let the mixture basis be $\frac{1}{2}(I + n.\sigma)$ and $\frac{1}{2}(I - n.\sigma)$
Let the measurement basis be $\frac{1}{2}(I + m.\sigma)$ and $\frac{1}{2}(I - m.\sigma)$
Let the qubit be $$p\frac{1}{2}(I + n.\sigma) + (1-p)\frac{1}{2}(I - n.\sigma)$$
Probability of the qubit showing up as $\frac{1}{2}(I + m.\sigma)$ when measured is:
$$p(\frac{1}{2}(1 + m.n)) + (1-p)(\frac{1}{2}(1-m.n))$$
Let the above value be $p^{'}$
Then the Shannon Entropy will be $p^{'}log(p^{'}) + (1-p^{'})log(1-p^{'})$
And to minimize the entropy, I need to minimise or maximise $p^{'}$
I'm not sure how to do that though, and whether what I'm trying to do so far makes sense. I'll be grateful for any help on continuing the proof/ insight on the intuition I'm trying to build.
"
"['resource-request', 'simulation', 'quantum-networks', 'emulation']"," Title: Are there emulators for quantum networks?Body: Inspired by the question Are there emulators for quantum computers?, I'm curious to know if it's possible to emulate a quantum network on a classic computer. Additionally, is it possible to emulate a quantum network over a classic network?
Current resources:
"
"['nielsen-and-chuang', 'quantum-operation', 'textbook-and-exercises', 'kraus-representation']"," Title: How to find the operator sum representation of the depolarizing channel?Body: In Nielsen and Chuang (page:379), it is shown that the operator sum representation of a depolarizing channel $\mathcal{E}(\rho) = \frac{pI}{2} + (1-p)\rho$ is easily seen by substituting the identity matrix with
$$\frac{\mathbb{I}}{2} = \frac{\rho + X\rho X + Y\rho Y +Z\rho Z}{4}.$$
What is the more systematic way to see this result? Particularly, for the higher dimensional analogue, I cannot see how to proceed.
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang', 'partial-trace', 'kraus-representation']"," Title: How does $\mathcal E(\rho)=\mathrm{Tr}_{env}[U(\rho\otimes\rho_{env})U^\dagger]$ turn into $P_0\rho P_0+P_1\rho P_1$?Body: In the Quantum Operations section in Nielsen and Chuang, (page 358 in the 2002 edition), they have the following equation:
$$\mathcal E(\rho) = \mathrm{Tr}_{env} [U(\rho \otimes \rho_{env})U^\dagger]$$
They show an example with
$\rho_{env} = |0\rangle \langle0|$
and $U = \mathrm{CNOT}$, and claim that the final solution is:
$$P_0\rho P_0 + P_1\rho P_1,$$
where $P_0=|0\rangle \langle0|$ and $P_1=|1\rangle \langle 1|$.
These are my steps so far to get this, but I don't know how to trace out the environment after this:
Let $\rho$ be $|\psi \rangle \langle \psi |$,
so that $\rho \otimes \rho_{env} = |\psi, 0\rangle \langle \psi, 0|$.
Applying the unitary $U$, we have
$$ |00 \rangle \langle 00| \psi, 0 \rangle \langle \psi, 0 | 00 \rangle \langle 00 |
+ |00 \rangle \langle 00| \psi 0 \rangle \langle \psi 0 | 10 \rangle \langle 11 | \\
+ |11 \rangle \langle 10| \psi 0 \rangle \langle \psi 0 | 00 \rangle \langle 00 |
+ |11 \rangle \langle 10| \psi 0 \rangle \langle \psi 0 | 10 \rangle \langle 11 |.
$$
I don't know how to trace out the environment in the above state.
Also, I realize that I have considered only a pure state, if anyone can show it for a general state that would be great.
"
"['algorithm', 'quantum-gate', 'circuit-construction']"," Title: Multiple random coin flips without measurementsBody: The question is similar to this one. As suggested in the answer, I can easily do this with just one qubit: I repeatedly Hadamard it and measure in order to have a fair coin flip at every point. The problem with it is that, because of the measurements, the computation is not reversible.
So, again, suppose that in my circuit I have to generate multiple, say n, random coin flips. For example, this coin flips could be used to activate n CNOTs half of the time.
The trivial solution could be to use n different qubits and Hadamard them. However, this gets really huge when n is large.
Is there any better way? By better I mean using a smaller number of qubits and only a few simple quantum gates.
"
"['teleportation', 'qudit']"," Title: How is quantum teleportation generalized to qudits?Body: In an answer to a previous question, Generalization for n quantum teleportations, Craig Gidney states:
The more complicated way to generalize teleportation is figuring out how to make it work on qutrits and qudits instead of only qubits. Basically, instead of using a ""basis"" made up of tensor products of X and Z matrices, you need to switch to a basis based on clock and shift matrices.
How can quantum teleportation be generalized for qudits?
"
"['quantum-gate', 'mathematics', 'matrix-representation', 'tensor-product', 'tensor-networks']"," Title: Clock matrix vs matrix clockBody: In the process of research leading up to my previous question, I found out about matrix, vector & logical clocks.
The citation in the aforementioned question mentions clock and shift matrices. Wikipedia states:
These two matrices are also the cornerstone of quantum mechanical dynamics in finite-dimensional vector spaces as formulated by Hermann Weyl, and find routine applications in numerous areas of mathematical physics. The clock matrix amounts to the exponential of position in a ""clock"" of d hours, and the shift matrix is just the translation operator in that cyclic vector space, so the exponential of the momentum. They are (finite-dimensional) representations of the corresponding elements of the Weyl-Heisenberg on a d-dimensional Hilbert space.
I am curious to find out
- if there is any usage of matrix, vector or logical clocks in quantum computing
- how clock matrices and matrix clocks compare & contrast
"
"['cryptography', 'teleportation']"," Title: What does teleportation have to do w/ XOR linked lists?Body: I am trying to wrap my head around the correlation between repeating teleportation & XOR linked lists.
I understand that:
- ""the quantum equivalent of the one time pad (i.e. XORing a message with a secret key) is quantum teleportation"" (source)
- ""the simplest way to generalize teleportation is to just repeat it"" (source)
What I don't understand is how repeating teleportation could lead to ""a data structure which is used to maintain a list of data items"" (see this answer for more use cases for quantum XOR linked lists).
Hopefully someone can help me to understand how these concepts connect, because I do not understand teleportation well enough to see how it could be used to accomplish any of the use cases described in the answer to my XOR linked list question.
See also: Equivalent Quantum Circuits sections VII. A & B
As example applications we study quantum teleportation and dense coding protocols in terms of a simple XOR swapping circuit and give an intuitive picture of a basic gate teleportation circuit.
"
['algorithm']," Title: Solution enumeration algorithm?Body: Suppose I have a quantum algorithm that produces solutions where more than one different linear combination of qubit values with raised probability amplitudes is a correct result. Each linear combination is correct in the context of this hypothetical algorithm, but it is not the task of the algorithm to also iteratively elicit the solutions, but merely to produce a superposition where all possible solutions are represented within it. The problem isn't with the implementation of the supposed algorithm, but with the issue of potentially measuring a superposition that hasn't been fully honed to a single maximal linear combination, since in the ensemble of measurements you might obtain each of the different linear combinations, making the results unclear, despite the fact the algorithm implementation is potentially correct. The objective is therefore to have an abstract procedure to read off these possible answers in a clean manner, so that they aren't lost, but for which the superposition has been narrowed to a final value.
For example, suppose I have linear combinations $|10\rangle$ and $|11\rangle$, each which cannot be decomposed into simpler expressions with independent amplitudes, that have raised probability in that, for my quantum algorithm, these are correct. The others, $|00\rangle$ and $|01\rangle$ have amplitudes near zero. For simplicity, it can be said that each the current superposition is described by: $\frac{1}{\sqrt{2}}(|10\rangle + |11\rangle)$. Before reading each value off, I want to cancel the probability of all others aside from the ith term of the superposition. Therefore, first cancel out $|11\rangle$, so that I don't have a very high chance of reading $|11\rangle$ when the first measurement is done, so the superposition becomes simply $|10\rangle$. In every iteration of this procedure, I want the superposition narrowed to a single term, so that there is no confusion upon measurement. As with the example, after the first measurement, repeat, but with probability canceled from $|10\rangle$ to $|11\rangle$.
But, I want a mechanism to do this form me for $N$ possible admissible answers, so that it works in the more general case.
"
"['programming', 'qiskit']"," Title: Module BasicAer not foundBody: After installing qiskit-terra via git (pip install qiskit), all python programs involving the line from qiskit import BasicAer do not run.
Example:
from qiskit import *
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q,c)
qc.h(q[0])
<qiskit.extensions.standard.h.HGate object at 0x7f6a146ee7f0>
qc.cx(q[0],q[1])
<qiskit.extensions.standard.cx.CnotGate object at 0x7f6a146ee940>
qc.measure(q,c)
<qiskit.circuit.instructionset.InstructionSet object at 0x7f6a146eea58>
backend_sim = Aer.get_backend('qasm_smulator')
Traceback (most recent call last):
File ""<stdin>"", line 1, in <module>
NameError: name 'Aer' is not defined
"
"['programming', 'qiskit']"," Title: ModuleNotFoundError: No module named qiskit.providersBody: The following message I got by running the qft.py code
Traceback (most recent call last):
File ""qft.py"", line 18, in
from qiskit.providers.ibmq import least_busy
ModuleNotFoundError: No module named qiskit.providers
This the code snippet (from the QISKit repository):
I suppose that something was wrong with the installation process?)
# -*- 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.
""""""
Quantum Fourier Transform examples.
Note: if you have only cloned the Qiskit repository but not
used `pip install`, the examples only work from the root directory.
""""""
import math
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit import execute, BasicAer, IBMQ
from qiskit.providers.ibmq import least_busy
###############################################################
# make the qft
###############################################################
def input_state(circ, q, n):
""""""n-qubit input state for QFT that produces output 1.""""""
for j in range(n):
circ.h(q[j])
circ.u1(math.pi/float(2**(j)), q[j]).inverse()
def qft(circ, q, n):
""""""n-qubit QFT on q in circ.""""""
for j in range(n):
for k in range(j):
circ.cu1(math.pi/float(2**(j-k)), q[j], q[k])
circ.h(q[j])
q = QuantumRegister(5, ""q"")
c = ClassicalRegister(5, ""c"")
qft3 = QuantumCircuit(q, c, name=""qft3"")
qft4 = QuantumCircuit(q, c, name=""qft4"")
qft5 = QuantumCircuit(q, c, name=""qft5"")
input_state(qft3, q, 3)
qft3.barrier()
qft(qft3, q, 3)
qft3.barrier()
for j in range(3):
qft3.measure(q[j], c[j])
input_state(qft4, q, 4)
qft4.barrier()
qft(qft4, q, 4)
qft4.barrier()
for j in range(4):
qft4.measure(q[j], c[j])
input_state(qft5, q, 5)
qft5.barrier()
qft(qft5, q, 5)
qft5.barrier()
for j in range(5):
qft5.measure(q[j], c[j])
print(qft3)
print(qft4)
print(qft5)
###############################################################
# Set up the API and execute the program.
###############################################################
try:
IBMQ.load_accounts()
except:
print(""""""WARNING: There's no connection with the API for remote backends.
Have you initialized a file with your personal token?
For now, there's only access to local simulator backends..."""""")
print('Qasm simulator')
sim_backend = BasicAer.get_backend('qasm_simulator')
job = execute([qft3, qft4, qft5], sim_backend, shots=1024)
result = job.result()
print(result.get_counts(qft3))
print(result.get_counts(qft4))
print(result.get_counts(qft5))
# Second version: real device
least_busy_device = least_busy(IBMQ.backends(simulator=False,
filters=lambda x: x.configuration().n_qubits > 4))
print(""Running on current least busy device: "", least_busy_device)
job = execute([qft3, qft4, qft5], least_busy_device, shots=1024)
result = job.result()
print(result.get_counts(qft3))
print(result.get_counts(qft4))
print(result.get_counts(qft5))
"
"['programming', 'measurement', 'qutip']"," Title: Measuring qubits in QuTiPBody: How can you measure qubits in QuTiP?
As far as I have seen you can define a Hamiltonian and let it evolve in time. It is also possible to define a quantum circuit, however, measuring and running it is not possible.
Does anyone know how to do this?
A simple circuit could be
H q[0]
CNOT q[0],q[1]
Measure q[0], q[1]
"
['algorithm']," Title: Why it is hard to simulate a quantum device by a classical devices?Body: I was recently watching a talk by Urmila Mahadev on ""Classical Verification of Quantum Computations"" (see this). I am not new to quantum computation just have a familiarity with the qubit and some part of quantum mechanics. I even did not get the meaning of the simulation. I am guessing it means that given an encoding of a quantum device with input. The classical device will take this encoding and get the results. The only thing which I have understood is that there may be many states in which quantum device can go through on a particular input.
Question: Why it is hard to simulate a quantum device by a classical device?
Please note that I am not sure what it means by "" hard "". Is it time-wise or space-wise? The meaning of "" simulation "" is also not clear to me.
"
"['information-theory', 'entropy', 'state-space-geometry']"," Title: Is the set of all states with negative conditional Von Neumann entropy convex?Body: I have read somewhere / heard that the set of all states that have non-negative conditional Von Neumann entropy forms a convex set. Is this true? Is there a proof for it?
Can anything be said about the reverse - set of all states that have negative conditional Von Neumann entropy?
"
"['information-theory', 'entropy']"," Title: Building Intuition for Relative Von Neumann EntropyBody: This is how I think about classical relative entropy: There is a variable that has distribution P, that is outcome $i$ has probability $p_i$ of occuring, but someone mistakes it to be of a distribution Q instead, so when outcome $i$ occurs, instead of being $-log(p_i)$ surprised, they are $-log(q_i)$ surprised (or gain said amount of information).
Now someone who knows both the distributions is calculating the relative Shannon entropy, so expectation value of their surprise is $-\Sigma p_i log(p_i)$ and they know that the mistaken person's probability of being $log(q_i)$ surprised is $p_i$, so their the expectation value of surprise is $-\Sigma p_i log({q_i})$ and the difference is $\Sigma p_i log(p_i) - \Sigma p_i log(q_i)$ which is the classical relative entropy.
For a given state, the Von Neumann entropy is the Shannon entropy minimised over all possible bases. Since in the measurement basis, the eigenvalues are the probabilities, and both eigenvalues and trace are basis invariant, we can write this as $\Sigma \lambda _i log(\lambda_i)$ which is also equal to $Tr(\rho log( \rho ))$.
Relative Von Neumann entropy is defined as follows:
$$ Tr(\rho log(\rho)) - Tr(\rho log (\sigma))$$
The first term is understandable, but by analogy to the classical relative entropy, assuming that person Q is measuring in the sigma basis, let's call it ${\{| \sigma_i \rangle
\}}$, the second term should reduce to $p^{'}_1 log (q1) + p^{'}_2 log(q2) ... $, where $p^{'}_i$ is the actual probability of the state $\rho$ landing on $| \sigma_i \rangle $. The log part is take care of, but I'm not sure how multiplying and tracing out will give this result.
If there's a better way to understand relative Von Neumann entropy, that's welcome too.
"
"['quantum-gate', 'circuit-construction']"," Title: How to decompose 4 qubits Toffoli-gate into two-qubits CNOT gate?Body: Can I decompose a 4-qubit Toffoli gate into two qubit CNOT gate without ancillary state?
"
"['algorithm', 'mathematics', 'shors-algorithm']"," Title: In Shor's factorization algorithm for $N$, why can we always find $n$ such that $N^2\le 2^n\le 2N^2$?Body: This may be a silly question but at the start of Shor's algorithm to factorise a number $N$ we need to find a number $n$ such that
$N^{2} \leq 2^{n} \leq 2N^{2}$
Why does such a number $n$ exist for any $N$?
"
"['algorithm', 'grovers-algorithm']"," Title: Is there any (really) quantum procedure that's an algorithm and not a Las Vegas algorithm?Body: Let me take Grover's algorithm as an example. In most cases, Grover's algorithm is able to yield with a high probability the desired term of the superposition. When the superposition has more than 4 terms, there's a small chance we will not obtain the desired term of the superposition, in which case we can repeat the procedure and measure it again, until we really get the desired result.
Although the probability of not getting the desired result decreases exponentially, it is technically not guaranteed that one will ever get the desired measurement. Therefore, we cannot prove that Grover's algorithm is an algorithm because we cannot prove it terminates with the correct answer in a finite number of steps.
(Otherwise, what part of the definition of ""algorithm"" I'm missing here?)
We can however define Grover's algorithm as a Las Vegas algorithm because if we do not measure the desired result, we could produce a ""failure"" result, satisfying therefore the definition of ""Las Vegas algorithm"".
Surely a quantum computer is able to calculate everything a classical computer can, so quantum computers can execute algorithms in the formal sense of the word. But is there an algorithm (not a Las Vegas algorithm) that uses true quantum features like superpositions and entanglement always producing the right answer in a finite number of steps and is not a Las Vegas algorithm? That's what I'm after. I appreciate any light on this direction.
"
"['simulation', 'tomography']"," Title: Numerical quantum state tomography simulatorBody: On a classical computer, I want to simulate a learning-based quantum state tomography of a qubit. We can formulate it as finding a parametrized unitary evolution that takes the unknown pure state to a known state. We measure on the basis of the known state (see 1). If we get the known state we proceed, otherwise we change the parameter of the unitary evolution slightly, until we obtain a large number of projections to the known state successfully. There are a lot of simulators listed in quantiki website and also in some previous posts here. Does anyone know a simple simulator to do that?
"
"['programming', 'qiskit']"," Title: Qiskit - expand and/or merge registersBody: Suppose one of my functions create some ancillary qubits and reset them.
Then, another function wants to create a larger number of ancillary qubits. So, I'd like to reuse the first set of qubits and add the difference two them. Is there any efficient way to achieve the goal?
def function1(qc):
r = 3
ancillas = QuantumRegister(r, 'ancillas')
qc.add(sum_q)
# use the ancillas
return ancillas
def function2(qc, partial_ancillas):
r = 5
diff = r - len(partial_ancillas)
if diff > 0:
# something like ancillas = partial_ancillas.add(diff)
# or maybe ancillas = partial_ancillas + QuantumRegister(diff)
else:
ancillas = partial_ancillas
return ancillas
qc = QuantumCircuit()
anc = function1(qc)
anc = function2(qc, anc)
"
"['quantum-state', 'mathematics']"," Title: Ways in which $\frac{1}{\sqrt 2} (|00\rangle + |11\rangle)$ can be expressed as $\frac{1}{\sqrt 2} (|uu\rangle + |vv\rangle)$Body: I want to find out what values $|u\rangle$ and $|v\rangle$ can take if I want to write $$\frac{1}{\sqrt 2} (|00\rangle + |11\rangle)$$ as $$\frac{1}{\sqrt 2} (|uu\rangle + |vv\rangle).$$
Say
$$|u\rangle = a|0\rangle + b|1\rangle$$
$$|v\rangle = c|0\rangle + d|1\rangle.$$
Now,
$$\frac{1}{\sqrt 2} (|uu\rangle + |vv\rangle)$$
= $$(a^2 + b^2)|00\rangle + (ab + cd)(|01\rangle + |10\rangle) + (c^2 + d^2)|11\rangle.$$
We have
$$(a^2 + b^2)e^{i\theta} = 1$$
$$(c^2 + d^2)e^{i\theta} = 1$$
(for the same $\theta$)
$$ab + cd = 0$$
We also know that:
$$|a|^2 + |b|^2 = 1 \implies a^*a + b^*b = 1$$
$$|c|^2 + |d|^2 = 1 \implies c^*c + d^*d = 1$$
How do I find the relation between $a, b, c, d$ as rigorously as possible?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qiskit - Authorization Required errorBody: When I use Qiskit to do quantum computing, I suffer from a big problem.
When running the code,it turns out to be:
{""error"":{""name"":""Error"",""status"":401,""message"":""Authorization Required"",
""statusCode"":401,""code"":""AUTHORIZATION_REQUIRED""}}
It seems that I failed to authorize my account. I don't know how to get authorization. Can anyone help me?
"
"['programming', 'qiskit', 'circuit-construction']"," Title: Programming quantum half adderBody: While computing the carry bit [C=0 XOR (AB)] I am unable to compute that AB in Qiskit. I don't whether Toffoli gate is available in Qiskit. So does anyone know how to perform AB, which is basically the AND gate without using the Toffoli gate if it isn't available?
"
"['quantum-gate', 'circuit-construction', 'adiabatic-model']"," Title: Problem with approximating adiabatic evolution with quantum circuitBody: I am reading on how to approximate adiabatic evolution with quantum circuit and I had some trouble following the arguments given in the early papers which proves this results. I am mainly following
W. van Dam, M. Mosca, and U. Vazirani, “How Powerful is Adiabatic Quantum Computation?,” Proceedings 2001 IEEE International Conference on Cluster Computing, pp. 279–287, 2001.
In it the authors assumed a problem Hamiltonian
$$H_p=f(z)|z\rangle\langle z|$$
so $H_p$ is diagonal in the computational basis. Towards the end of the proof, it is kind of assumed that $H_p$ and its associated evolution operator can be efficiently computed and implemented in quantum circuits. I struggled to see why this is so. Doesn't one need to fully specify $H_p$ to implement the unitary associated with it? In this case does it become equivalent to assuming we can already solve the optimization problem?
Also, if we don't assume $H_p$ to be diagonal in the computational basis, would it be possible that we need exponential number of gates to implement the adiabatic evolution?
Maybe a relevant and more general question is, in general is there any hard Hamiltonian's that is difficult to simulate on a quantum circuit?
"
"['algorithm', 'resource-request', 'complexity-theory', 'simons-algorithm']"," Title: Classical complexity for Simon's problemBody: Simon's problem is that you are given a function $f : \{0,1\}^n \to \{0,1\}^n$ such that $f(x)=f(y)$ if and only if $x \bigoplus y$ is either $0^n$ or some unknown $s$. The problem is to find $s$. If $s=0^n$, then $f$ is 1 to 1 otherwise 2 to 1.
What is the classical complexity for Simon's problem?
Wikipedia says $\sqrt {2^n}$ but without any proof. Is there any site or book where I can find the proof for this?
"
"['algorithm', 'programming', 'qiskit']"," Title: Entanglement in VQE ansatz in QiskitBody: The Qiskit documentation on VQE describes two of the ansatz as ""rotations with entanglements"". The rotation gates are more or less clear, but the documentation doesn't mention what gate is used for entanglement. I suspect they use something like $\exp(-i \alpha Z_1 Z_2)$, but what exactly?
"
"['density-matrix', 'nielsen-and-chuang', 'information-theory', 'tensor-product', 'partial-trace']"," Title: Partial trace over a product of matrices - one factor is in tensor product formBody: $$Tr(\rho^{AB} (\sigma^A \otimes I/d)) = Tr(\rho^A \sigma^A)$$
I came across the above, but I'm not sure how it's true. I figured they first partial traced out the B subsystem, and then trace A, but I don't see how you are allowed to partial trace out B from both the factors in the arguments. A proof or any intuition on this would be appreciated.
Edit 1:
The notation
$\rho^{AB}$ is a state in Hilbert space $H_A \otimes H_B$
$\sigma^A$ is a state in Hilbert space $H_A$
$\rho^A$ is $\rho^{AB}$ with $B$ subsystem traced out.
$I/d$ is the maximally mixed state in Hilbert space $B$.
I saw this being used in Nielsen and Chuang, section 11.3.4, in the proof of subadditivity of entropy.
Edit 2:
So, I tried to write an answer based on DaftWullie's comment and Алексей Уваров's answer, but I am stuck again.
So, $$\rho^{AB} = \sum_{mnop} \rho_{mnop} |mo\rangle \langle np|$$
Then $$\rho^{A} = \sum_{mno} \rho_{mnoo} |m\rangle \langle n|$$
Let $$\sigma^A = \sum_{ij} \sigma_{ij} |i\rangle \langle j|$$
And $$I/d = \sum_{xy} [I/d]_{xy} |x\rangle \langle y|$$
RHS
$$Tr(\rho^A \sigma^A)\\
= Tr(\sum_{mno} \rho_{mnoo} |m\rangle \langle n|\sum_{ij} \sigma_{ij} |i\rangle \langle j|)\\
= Tr(\sum_{mnoj} \rho_{mnoo} \sigma_{nj} | m \rangle \langle j|)\\
= \sum_{mno} \rho_{mnoo} \sigma_{nm}$$
LHS
$$Tr(\rho^{AB} (\sigma^A \otimes I/d)\\
= Tr(\sum_{mnop} \rho_{mnop} |mo\rangle \langle np| \sum_{ijxy} \sigma_{ij} [I/d]_{xy} |ix\rangle \langle jy|)\\
= Tr(\sum_{mnoxjy}\rho_{mnox} \sigma_{nj} [I/d]_{xy} | mo \rangle \langle jy |)\\
= \sum_{mnyx} \rho_{nm}[I/d]_{xy}\\
= (1/d)\sum_{mny} \rho_{mnyy} \sigma_{nm}$$
Which is the same as the RHS, but there's an extra $1/d$ factor?
Also, am I thinking about this the wrong way? Is there a simpler way to look at this?
"
"['algorithm', 'programming', 'q#', 'shors-algorithm']"," Title: How many logical qubits are needed to run Shor's algorithm efficiently on large integers ($n > 2^{1024}$)?Body: First, I know there are differences in logical qubits and physical qubits. It takes more physical qubits for each logical qubit due to quantum error.
Wikipedia states that it takes quantum gates of order $\mathcal{O}((\log N)^2(\log \log N)(\log \log \log N)$ using fast multiplication for Shor's Algorithm. That comes out to $1,510,745$ gates for $2^{1024}$. Further down the article, it says that it usually take $n^3$ gates for $n$ qubits. This would mean it would take ~$115$ qubits.
However, I've run Shor's Algorithm as implemented in Q# samples using Quantum Phase Estimation and it comes out to $1025$ qubits.
"
"['quantum-state', 'photonics', 'optical-quantum-computing']"," Title: Multi-photon states in photonic quantum computing?Body: Within photonic quantum computing, one of the ways to represent information is the dual-rail representation of single-photon states ($c_0|01\rangle \ + \ c_1|10\rangle$). Is it possible to utilize multi-photon states (for example, two optical cavities with total energy $2\hbar\omega$, using a state like $c_0|02\rangle \ + \ c_1|20\rangle \ + \ c_2|11\rangle$, where $|02\rangle$ represents two photons in one cavity, $|20\rangle$ represents two photons in the other cavity, and $|11\rangle$ represents one photon in each cavity?
"
"['mathematics', 'resource-request', 'games', 'artificial-intelligence']"," Title: How could a quantum computer perform nimber arithmetic?Body: I am interested in combinatorial game theory & was doing some research on quantum combinatorial games. This lead me to wondering how a quantum computer might be able to perform nimber arithmetic (perhaps as a part of a game playing AI).
I am aware of the fact that nim sums are equivalent to bitwise XOR & that XOR correlates to CNOT, which is why it seems resonable to me that a quantum computer would be able to perform calculations with nimbers.
How could a quantum computer perform nimber arithmetic?
"
"['quantum-gate', 'quantum-state', 'measurement']"," Title: Why does state preparation of 'off the shelf' qubits not follow from the Born rule (Mermin)?Body: In Mermin's Quantum Computer Science, section 1.10 (Measurement gates and state preparation), Mermin writes that:
This role of measurement gates in state preparation follows from the Born rule if the Qbits that are to be prepared already have a state of their own, even though that state might not be known to the user of the quantum computer. It also follows from the generalized Born rule if the Qbits already share an entangled state – again, not necessarily known to the user – with additional (unmeasured) Qbits. But one cannot deduce from the Born rules that measurement gates serve to prepare states for Qbits “off the shelf,” whose past history nobody knows anything about. In such cases the use of measurement gates to assign a state to the Qbits is a reasonable and plausible extension of the Born rules. It is consistent with them, but goes beyond them.
Why are ""off the shelf"" qubits any different from qubits whose state is unknown to the user? And why does whatever property these qubits have mean that the use of measurement gates for state preperation doesn't follow directly from the Born rule?
"
"['quantum-gate', 'gate-synthesis', 'solovay-kitaev-algorithm']"," Title: Approximating unitary matricesBody: I currently have 2 unitary matrices that I want to approximate to a good precision with the fewer quantum gates possible.
In my case the two matrices are:
- The square root of NOT gate (up to a global phase)
$$G = \frac{-1}{\sqrt{2}}\begin{pmatrix} i & 1 \\ 1 & i \end{pmatrix} = e^{-\frac{3}{4}\pi} \sqrt{X}$$
- $$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}$$
My question is the following:
How can I approximate these specific matrices with the fewer quantum gates possible and a good precision?
What I want to have an can afford to have it:
- I can afford to use several days/weeks of CPU time and a lot of RAM.
- I can afford to spend 1 or 2 human days searching for mathematical tricks (in last resort, that is why I ask here first). This time does not include the time I would need to implement the hypothetical algorithms used for the first point.
- I want the decomposition to be nearly exact. I don't have a target precision at the moment, but the 2 gates above are used extensively by my circuit and I don't want errors to accumulate too much.
- I want the decomposition to use the fewest quantum gates possible. This point is secondary for the moment.
- A good method would let me choose the trade-off I want between the number of quantum gates and the precision of the approximation. If this is not possible, an accuracy of at least $10^{-6}$ (in terms of trace norm) is probably (as said before, I do not have estimates so I am not sure of this threshold) required.
- The gate set is:
$$
\left\{ H, X, Y, Z, R_\phi, S, T, R_x, R_y, R_z, \text{CX}, \text{SWAP}, \text{iSWAP}, \sqrt{\text{SWAP}} \right\}
$$
with $R_\phi, \text{SWAP}, \sqrt{\text{SWAP}}$ as described in Wikipédia, $R_A$ the rotation with respect to the axe $A$ ($A$ is either $X$, $Y$ or $Z$) and
$$\text{iSWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\
0 & 0 & i & 0 \\
0 & i & 0 & 0 \\
0 & 0 & 0 & 1 \\ \end{pmatrix}$$.
The methods I know about:
- The Solovay-Kitaev algorithm. I have an implementation of this algorithm and already tested it on several unitary matrices. The algorithm generates sequences that are quite long and the trade-off [number of quantum gates] VS [precision of the approximation] is not enough parametrisable. Nevertheless, I will execute the algorithm on these gates and edit this question with the results I obtained.
- Two papers on 1-qubit gate approximation and n-qubit gate approximation. I also need to test these algorithms.
EDIT: edited the question to make ""square root of not"" more apparent.
"
"['quantum-state', 'mathematics', 'density-matrix', 'classical-quantum']"," Title: Is the set of classical-quantum states convex?Body: I read about the classical-quantum states in the textbook by Mark Wilde and there is an exercise that asks to show the set of classical-quantum states is not a convex set. But I have an argument to show it is a convex set. I wonder whether I made a mistake in my proof.
Here is the definition of classical-quantum states (definition 4.3.5):
The density operator corresponding to a classical-quantum ensemble
$\{p_X(x)$, $|x\rangle\langle x|_X \otimes \rho_A^x\}_{x\in \mathcal{X}}$ is called a classical-quantum state and takes the following form:
$$\rho_{XA} = \sum_{x \in \mathcal{X}} p_X(x) |x\rangle\langle x|_X \otimes \rho_A^x.$$
My argument about the set of classical-quantum states is convex is as follows. Let $\rho_{XA}$ and $\sigma_{XA}$ to be two arbitrary classical-quantum states. Specifically, we can write
$$\rho_{XA} = \sum_{x \in \mathcal{I}_1} p_X(x) |x\rangle\langle x|_X \otimes \rho_A^x,$$
$$\sigma_{XA} = \sum_{x \in \mathcal{I}_2} q_X(x) |x\rangle\langle x|_X \otimes \sigma_A^x,$$
where $\mathcal{I}_1 = \{x: p_X(x) \neq 0\}$ and $\mathcal{I}_2 = \{x: q_X(x) \neq 0\}$.
Then we take the union $\mathcal{I}=\mathcal{I}_1 \cup \mathcal{I}_2$. We define $\rho_A^x$ to be an arbitrary density operator for $x \notin \mathcal{I}_1$ and similarly $\sigma_A^x$ to be an arbitrary density operator for $x \notin \mathcal{I}_2$.
We can then rewrite $\rho_{XA}$ and $\sigma_{XA}$ as
$$\rho_{XA} = \sum_{x \in \mathcal{I}} p_X(x) |x\rangle\langle x|_X \otimes \rho_A^x,$$
$$\sigma_{XA} = \sum_{x \in \mathcal{I}} q_X(x) |x\rangle\langle x|_X \otimes \sigma_A^x.$$
Since we are adding zero operators, $\rho_{XA}$ and $\sigma_{XA}$ are not changed.
Then for any $\lambda \in (0,1)$, we want to show $\lambda \rho_{XA} + (1-\lambda) \sigma_{XA}$ is a classical-quantum state.
(Note that the trivial case where $\lambda =1$ or $\lambda = 0$ just gives back $\rho_{XA}$ and $\sigma_{XA}$ back, respectively.)
We now define $\xi_{XA} :=\lambda \rho_{XA} + (1-\lambda) \sigma_{XA}.$
$$
\xi_{XA} =\lambda \sum_{x \in \mathcal{I}} p_X(x) |x\rangle\langle x|_X \otimes \rho_A^x + (1-\lambda) \sum_{x \in \mathcal{I}} q_X(x) |x\rangle\langle x|_X \otimes \sigma_A^x\\
=\sum_{x \in \mathcal{I}} |x\rangle\langle x|_X \otimes (\lambda p_X(x) \rho_A^x + (1-\lambda) q_X(x)\sigma_A^x) \\
=\sum_{x \in \mathcal{I}} w_X(x)|x\rangle\langle x|_X \otimes \xi_A^x,
$$
where $w_X(x) = \lambda p_X(x) + (1-\lambda) q_X(x)$ and $\xi_A^x = \frac{\lambda p_X(x) \rho_A^x + (1-\lambda) q_X(x)\sigma_A^x}{\lambda p_X(x) + (1-\lambda) q_X(x)}$.
Since $X \in \mathcal{I}$, not both $p_X (x)=0$ and $q_X(x)=0$. For $\lambda \in (0,1)$, we have $w_X(x) \neq 0$ for $x \in \mathcal{I}.$
Also, $\sum_{x \in \mathcal{I}} w_X(x) = \sum_{X \in \mathcal{I}} \lambda p_X(x) + (1-\lambda) q_X(x) = 1$.
Therefore, the state $\xi_{XA}$ is a classical-quantum state.
So, I conclude the set of classical-quantum states is convex.
Can anyone point out where I made a mistake?
Or is there a typo in the textbook?
"
"['quantum-state', 'measurement', 'postselection', 'tomography']"," Title: How is postselection used in quantum tomography?Body: I refer to this paper but reproduce a simplified version of their argument. Apologies if I have misrepresented the argument of the paper!
Alice has a classical description of a quantum state $\rho$. Alice and Bob both agree on a two outcome observable $M$. Now, the goal for Bob is to come up with a classical description of a state $\sigma$ that gives the right measurement statistics i.e. $Tr(M\rho) \approx Tr(M\sigma)$.
The way this is done is that Bob has a guess state, say the maximally mixed state, $I$. Alice then tells him the value of $Tr(M\rho)$. Bob then measures the maximally mixed state repeatedly (or he runs a classical simulation of this with many copies of the maximally mixed state) and ""postselects"" the outcomes where he obtains $Tr(M\rho) \approx Tr(MI)$. In this way, he obtains a state that reproduces the measurement statistics of the true state.
What is the meaning of postselection in this context? How does Bob go from $I$ to $\sigma$ in this procedure?
"
"['programming', 'q#']"," Title: How do I produce circuit diagrams from a Q# program?Body: If I implement an adder operation in Q#, I'd like to see a quantum circuit diagram of what that adder is doing in order to check that it looks right. Is there a built-in way to do this?
"
"['programming', 'q#']"," Title: Programmatic access to wavefunction in Q# for testsBody: I'm trying to write unit tests for some small Q# operations. It would be ideal if I could access the wavefunction. Is there a way to get it?
I found Microsoft.Quantum.Diagnostics.DumpRegister, but it writes its output to the console or a file in a format intended for humans. I don't want to parse a non-trivial file format as part of writing a unit test.
"
"['programming', 'q#']"," Title: How do I write functions that modify operations in Q#?Body: In Q#'s type documentation, it is mentioned that you can create signatures like this:
function ConjugateInvertibleWith : (inner: ((Qubit[] => Unit) : Adjoint),
outer : ((Qubit[] => Unit) : Adjoint))
: ((Qubit[] => Unit) : Adjoint)
My question is: how is this function actually implemented.
Presumably a function with this name will return an operation that, when invoked, calls outer, then inner, then adjoint outer. However, I have no idea how to actually write a function like this. In particular, it's not clear how to write the equivalent of a lambda with a closure. For example, if I try to declare an operation inside a function (similar to how you can def inside a def in python), I get a syntax error.
Does this have to be done in a non-Q# library, like in C#, then imported into Q#? If so, how?
"
"['programming', 'qiskit', 'simulation']"," Title: Introspecting quantum circuit execution on Qiskit Aer simulatorsBody: Is there any way to get information from intermediate points in the execution of a quantum circuit. This is not possible on real quantum hardware but would be very useful on the Aer simulators for both learning quantum programming and for debugging.
"
"['hamiltonian-simulation', 'adiabatic-model']"," Title: Numerical approximation to eigenstates and their differentialsBody: I am working in Adiabatic Quantum Computing and I have a $6\times6$ Hamiltonian. I have only the symbolic expression for its eigenstates which have complicated expressions in solutions of degree $6$ characteristic polynomial of the Hamiltonian and even ordinary computing over these eigenstates is beyond the power of Mathematica in my computer.
I need to evaluate the Geometric phases terms like $\langle\psi_n|\partial _{\phi}|\psi_n\rangle$ where $\phi$ is just a driving adiabatic parameter and $|\psi_n\rangle$ are the solutions to the Hamiltonian.
Now, I can get numerics for $|\psi_n\rangle$ but once I get that, how can I evaluate the differential $\partial_{\phi}|\psi_n\rangle$?
Or to even approximate it in any form? Because it is impossible to get a manipulative symbolic form for $|\psi_n\rangle$ with such messy calculations, all that can be done is to write Hamiltonian numerically and find the obvious numerical eigenstates.
I have tried using all kinds of Numerical functions available in Mathematica but such a numerical differentiation in one parameter is not possible for this kind of complexity (takes a lot of time).
"
"['programming', 'q#']"," Title: How do I name the adjoint of an operation in Q#?Body: For example, if I've defined the operation PlusEqual, I'd like to say
operation MinusEqual = Adjoint PlusEqual;
but this produces a syntax error.
Is the only way to do this by exhaustively re-listing all arguments and functors?
operation MinusEqual (all_args_and_types_again) : ReturnType {
body (...) {
return Adjoint AddEqual(all_args);
}
adjoint auto;
controlled auto;
controlled adjoint auto;
}
"
"['quantum-gate', 'quantum-parallelism']"," Title: How does quantum function parallelism work?Body: Quantum parallelism is usually introduced from CNOT schema, saying that there it results, calling $ |c\rangle $ the control and $|t\rangle$ the target
$$ |0\rangle |t\rangle \implies |0\rangle |t\rangle $$
$$ |1\rangle |t\rangle \implies |1\rangle X|t\rangle $$
Generalizing that for a generic controlled-U gate, it gives
$$
|1\rangle |t\rangle \implies |1\rangle U|t\rangle
$$
To note that the separation of the output is possible only if the control $|c\rangle$ is a pure state (i.e. $|0\rangle$ or $|1\rangle$).
With a further step it is said that, if $|t\rangle = |0\rangle$, the controlled-$U$ behaves as following
$$
|c\rangle |0\rangle \implies |c\rangle |f(c)\rangle
$$
with $f(x)$ a proper function, non necessarily equal to $U$. More generally
$$
|c\rangle |t\rangle \implies |c\rangle |t XOR f(c)\rangle
$$
Now my question: from where above two expressions are derived? And how can we build $f(x)$ from U? Making some examples with $C_X$, $C_Z$, $C_Y$ the unitaries needed for implementing the $f(x)$ are always different, and I couldn't find any clear logic for it.
Any clarification, or a working examples, would be great!
"
"['programming', 'q#']"," Title: How do I multiply an integer and a double in Q#?Body: If I write this:
function f(n: Int) : Double {
return 1.5*n;
}
I get an error:
The arguments to the binary operator do not have a common base type.
Apparently I need a function to turn n from an Int into a Double. There are lots of functions going from double to int, like Microsoft.Quantum.Extensions.Math.Floor, but I wasn't able to find anything from int to double.
"
"['quantum-state', 'nielsen-and-chuang', 'initialization']"," Title: Default input states of qubits to quantum circuitsBody:
It is conventional to assume that the state input to the circuit is a
computational basis state, usually the state consisting of all
$|0\rangle$s. This rule is broken frequently in the literature on
quantum computation and quantum information, but it is considered
polite to inform the reader when this is the case.
What does this mean?
Source: M. Nielsen and I. Chuang. Quantum Computation and Quantum Information. Cambridge UniversityPress, 2000. (1.3.4 Quantum Circuits)
"
"['algorithm', 'shors-algorithm']"," Title: Shor's algorithm effectivenessBody: In Shor's algorithm we require the period to be even. If the period is not even or $x^{r/2}+1 \equiv 0 \bmod N$ then we have to restart the process and pick a new random $x$. Why do we know that the process will work for some $x$ and still be quicker than the current method of just checking if factors work?
(Here $r$ is the period, $x$ is the random number given at the start of Shor's, $N$ is the number to be factorised.)
"
"['algorithm', 'circuit-construction', 'grovers-algorithm', 'models', 'topological-quantum-computing']"," Title: Correspondence between the Topological model and Quantum Circuit modelBody: For example, given the $R$ & $F$ gates and Toric codes for a given problem, how to convert this code into the conventional circuit model and vice versa.
From the literature developed, it seems that they tackle fairly different kinds of problems for these realizations.
How to write, let's say, Grover's algorithm for a topological experiment?
What is the correspondence to convert them back and forth?
"
"['algorithm', 'complexity-theory', 'optimization', 'qaoa']"," Title: Quantum algorithms, combinatorial optimization, and approximation boundsBody: 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.
"
"['algorithm', 'programming', 'qiskit', 'quantum-computing-for-finance']"," Title: Quantum pricing of financial derivatives (call option) in Qiskit AquaBody: 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
"
"['programming', 'mathematics', 'classical-quantum']"," Title: Translating classical math and code to quantum math and codeBody: 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.
"
"['optimization', 'classical-quantum', 'semidefinite-programming']"," Title: Quantum Optimization algorithmsBody: 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.
"
"['mathematics', 'superposition', 'classical-quantum']"," Title: What does superposition do for quantum probabilistic sampling?Body: 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.
"
"['resource-request', 'research']"," Title: Academic journals dedicated to quantum algorithmsBody: 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.
"
['ibm-q-experience']," Title: How to get more credits?Body:
How can I have 150 or more credits?
I mean I want to have '150/150 credits'.
"
['error-correction']," Title: About a necessary condition for quantum error correcting codesBody: 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)}$$
"
['quantum-operation']," Title: How to define a quantum channel for the partial trace?Body: 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?
"
"['algorithm', 'simulation', 'hamiltonian-simulation']"," Title: How is the precision of a quantum simulation algorithm actually proved?Body: 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).
"
"['physical-qubit', 'nielsen-and-chuang']"," Title: Atom magnetic moment caused by orbiting electronBody: 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.
"
"['programming', 'qiskit']"," Title: Problem in installing QiskitBody: 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.
"
['quantum-fourier-transform']," Title: Can a QFT be implemented as a physical change of the measurement basis?Body: 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?
"
"['nielsen-and-chuang', 'no-cloning-theorem']"," Title: Premise of the proof of the No-Cloning TheoremBody: 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$.)
"
"['quantum-state', 'quantum-advantage']"," Title: How to distinguish quantum random from classical random?Body: 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?
"
"['stabilizer-code', 'random-quantum-circuit']"," Title: How to randomly generate unoptimized stabilizer circuits?Body: 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 \ ?$$
"
['quantum-gate']," Title: How would one implement a 4-qubit CCCNOT gate (equivalent to controlled-Toffoli)?Body: 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)?
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'povm']"," Title: Are three POVM measurements on a single qubit physically realizable?Body: 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.
"
['notation']," Title: What does $\lvert \psi \rangle$ mean?Body: 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?
"
['classical-computing']," Title: Are binary states (bits) pervasive in classical physics?Body: If
- quantum physics is a refinement of classical physics, and
- quantum computing is a refinement of classical computing, and
- classical computers use bits (binary digits) whereas quantum computers use qubits
then are binary states (0,1) a significant and pervasive construct underpinning the theory of classical physics as opposed to quantum physics?
"
"['speedup', 'machine-learning']"," Title: Low-dimensional data and quantum machine learningBody: 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$)?
"
"['quantum-state', 'fidelity', 'haar-distribution']"," Title: On the distribution of the fidelity of a random product state with an arbitrary many-qubit stateBody: 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$?
"
"['bloch-sphere', 'phase-estimation']"," Title: Which angle is estimated by the phase estimation algorithm?Body: 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?
"
"['entanglement', 'teleportation', 'annealing', 'optimization']"," Title: Entanglement and teleportation in quantum annealing and parallel computationBody: 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.
"
"['communication', 'superdense-coding']"," Title: Can superdense coding be made more efficient?Body: 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.
"
"['algorithm', 'quantum-state', 'matrix-representation']"," Title: How to efficiently calculate the inverse of a Kronecker product?Body: 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.
"
['measurement']," Title: Difference between unitary transformations and measurementBody: 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.
"
"['programming', 'qiskit']"," Title: How does one get the attributes of a circuit from its DAG in qiskit?Body: 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?
"
"['algorithm', 'programming', 'quantum-parallelism']"," Title: Which algorithm in quantum computing can be implemented for a HPC system?Body: 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!
"
['research']," Title: Could any of these university courses be a good MSc for a quantum computing future job/research?Body: 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!
"
"['algorithm', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Implementing QFT for Shor's AlgorithmBody: 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)
"
"['programming', 'qiskit']"," Title: ImportError: cannot import name 'matplotlib_circuit_drawer'Body: 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?
"
"['algorithm', 'classical-computing']"," Title: Quantum circuits explain algorithms, why didn't classical circuits?Body: 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?
"
"['algorithm', 'qiskit', 'grovers-algorithm']"," Title: In Grover, how to implement oracle and amplification using Qiskit?Body: 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?
"
"['superposition', 'quantum-parallelism']"," Title: Can quantum parallelism be turned on and off?Body: 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.)
"
['quantum-state']," Title: Beginners doubt: calculating probability of one qubit based on other in a 2 qubit systemBody: 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}$$
"
"['algorithm', 'resource-request', 'research', 'nisq', 'vqe']"," Title: Active areas of research for NISQ algorithmsBody: 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.
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: How to decompose this two-qubit unitary matrix to the standard gate set?Body: 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 :)
"
"['quantum-state', 'ibm-q-experience']"," Title: Bell state: simultaneous measurement of two entangled qubitsBody: 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?
"
"['quantum-gate', 'qiskit']"," Title: Strange circuit with multi-qubit 'unitary' gates after transpiler with optimization level 3Body: 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.
"
['ibm-q-experience']," Title: Data file read/write from within IBM Q-Experience Jupyter notebookBody: In IBM Q-Experience how can I upload a data file that I intend to read from the python code?
"
['models']," Title: How close are we in achieving computation over reals using quantum qubits?Body: 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:
- Can we really compute the distance $|x - y| < \epsilon$ using a quantum qubit? If so, can anyone throw light on how this is done?
- Also, if not, how far along are we in actually computing this quantity?
- Can we measure if quantum computers approximate this quantity better (or worse?) than classical computers?
Thanks a lot in advance!
"
"['error-correction', 'cryptography']"," Title: Renting quantum on the cloud: data privacy, adoption and error correctionBody: 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?
"
"['q#', 'qasm']"," Title: Where is OpenQasmReader in Q#?Body: 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.
"
"['programming', 'qutip']"," Title: Can't plot points on the Bloch sphere (QuTip)Body: 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.
"
"['programming', 'cirq']"," Title: Moments-based quantum circuit in CirqBody: 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?
"
"['programming', 'resource-request']"," Title: Intro to quantum computing for programmersBody: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: qiskit - Creating your own ExperimentResultData objectBody: 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.
"
"['quantum-state', 'measurement']"," Title: Probability of measuring the first qubit in the state $\frac{1}{\sqrt 2}(|0⟩+|1⟩)$ in a two-qubit stateBody: 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.
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Why is the order reversed on measurement?Body: 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'.
"
"['programming', 'classical-computing']"," Title: What concepts from classical computing are vital for quantum programmers?Body: 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?
"
"['communication', 'terminology', 'history']"," Title: What is a flying qubit?Body: 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.
"
['correlations']," Title: Out-of-time-order correlation function in the interaction picture?Body: 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
- Apply $V$ onto a quantum state, wait a time $t$, then apply $W$
- Apply $W$ at time $t$, then reverse time to $t=0$ and apply $V$
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?
"
['quantum-gate']," Title: How to translate CNOT gate by Hadamard and Pauli Z gate in matrix form?Body: 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.
"
"['graph-states', 'vqe']"," Title: Graph coloring to reduce the number of qubits in VQEBody: 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.
"
"['qiskit', 'resource-request', 'machine-learning', 'pennylane', 'nisq']"," Title: Pennylane and Qiskit for quantum machine learningBody: 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.
"
"['algorithm', 'mathematics', 'resource-request', 'hidden-subgroup-problem']"," Title: Why does representation theory often arise in the context of quantum algorithms for the hidden subgroup problem?Body: 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.
- Why is this the case? How's it helpful?
- 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.)
"
"['entanglement', 'measurement', 'tomography', 'povm']"," Title: Give an explicit example of a $d = 4$ SIC-POVMBody: 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.)
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Probability estimate in classical Deutsch-Jozsa problemBody: 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?
"
"['quantum-gate', 'universal-gates']"," Title: Why is the Toffoli gate not sufficient for universal quantum computation?Body: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: Vary parameter between shotsBody: 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?
"
"['cryptography', 'quantum-operation']"," Title: What is the difference between intercept-resend attack and measure-resend attack?Body: 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,
- measurement attack - Eve measures the particles going from Alice to Bob as in BB84 protocol
- intercept-resend - Eve can apply a unitary operation
Am I correct?
"
"['algorithm', 'resource-request']"," Title: Algorithm to approximate Chaitin's Constant?Body: I'm searching for a good quantum algorithm to approximate Chaitin's Constant. Any references/resources will do?
Note: This number is uncomputable.
"
"['quantum-gate', 'textbook-and-exercises', 'no-cloning-theorem']"," Title: Can Eve perform this operation?Body: 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?
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'partial-trace', 'kraus-representation']"," Title: How is the partial trace related to the operator sum representation?Body: 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.
"
"['algorithm', 'programming', 'qiskit', 'hhl-algorithm']"," Title: How to draw Qiskit's HHL algorithm as a circuit?Body: 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.
"
"['quantum-gate', 'gate-synthesis']"," Title: How to construct a circuit to perform this operation? Is there a general way of getting a circuit from a matrix?Body: 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.
"
"['algorithm', 'programming', 'qiskit', 'hamiltonian-simulation', 'hhl-algorithm']"," Title: Exponentiating Hermitian Matrix for use in QPE/HHLBody: 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
"
"['error-correction', 'stabilizer-code']"," Title: The process behind constructing a Stabilizer Code?Body: 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?
"
"['quantum-state', 'density-matrix']"," Title: Density matrix of a product of Bell statesBody: 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?
"
"['algorithm', 'quantum-gate', 'ibm-q-experience', 'bernstein-vazirani-algorithm']"," Title: Bernstein-Vazirani algorithm in IBM Q ExperienceBody: 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?
"
"['quantum-state', 'entanglement', 'ibm-q-experience']"," Title: Explanation of output produced by the following quantum circuitBody: 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
"
['density-matrix']," Title: Does partial tracing a system with three shared Bell states give the identity?Body: 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?
"
"['quantum-advantage', 'universal-gates', 'optical-quantum-computing', 'boson-sampling']"," Title: Boson Sampling with a single beamsplitterBody: 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.
"
"['algorithm', 'mathematics', 'simons-algorithm']"," Title: Simon's Algorithm - How to simulate second Hadamard operation on first register?Body: 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⟩$$
"
"['programming', 'qiskit', 'noise']"," Title: How good is basic_device_noise_model() simulating the noise in the quantum computer?Body: 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.
"
"['mathematics', 'error-correction', 'projection-operator']"," Title: Implications of commuting within the code spaceBody: 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.
"
['algorithm']," Title: Using quantum computers to calculate definite integrals?Body: 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:
- One can always infer the value of a field at a point.
- There can exist a Robinson Boundary Condition.
- This (Klien-Gordon) field obeys Lorentz transformations.
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?
"
"['qiskit', 'ibm-q-experience']"," Title: What is the URL of the result?Body: 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.
"
"['entropy', 'information-theory']"," Title: Entropy of a shared state as measured by the individual partiesBody: 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?
"
"['programming', 'qiskit', 'noise']"," Title: How can I implement a kraus_error in qiskit?Body: 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?
"
"['programming', 'density-matrix', 'hamiltonian-simulation', 'master-equation']"," Title: What is ""Lindblad Superoperator"" in Stochastic Master EquationBody: 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)
"
"['qiskit', 'programming']"," Title: Qiskit installation failing: VC++ 2017 not foundBody: 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/
"
"['quantum-gate', 'classical-computing']"," Title: Are quantum gates analogous to ASSPs in classical computing?Body: 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?
"
"['algorithm', 'quantum-gate', 'circuit-construction']"," Title: Is this interpretation of quantum circuits right?Body: 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?
"
"['mathematics', 'unitarity']"," Title: Prove that the state $\sum_{S\in P_n}(-)^{\tau(S)}|S\rangle$ is invariant up to a phase when changing the basisBody: 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$.
"
"['algorithm', 'hidden-subgroup-problem']"," Title: Status of hidden shift and hidden subgroup problemsBody: 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?
"
"['physical-qubit', 'architecture', 'superconducting-quantum-computing']"," Title: Why are superconducting qubits the most popular approach to build a quantum computer?Body: 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?
"
['ibm-q-experience']," Title: How to put a quantum computer on the cloud?Body: 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.
"
['quantum-state']," Title: Clarification on the information content of a qubitBody: 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.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Couldn't connect to IBMQ serverBody: 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 ?
"
"['quantum-state', 'ion-trap-quantum-computing']"," Title: How can one trapped ion physically represent quantum states?Body: 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?
"
['architecture']," Title: 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?Body: 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.
"
"['algorithm', 'error-correction', 'fault-tolerance']"," Title: Where does error correction go in a quantum algorithm?Body: 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.
"
"['physical-realization', 'qutrit']"," Title: Color-Space as Effective and Intuitive Qutrit Physical Realization?Body: 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
"
"['entanglement', 'teleportation']"," Title: Does this setup violate relativity?Body: 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?
"
['circuit-construction']," Title: How to generate the following $n$-level $n$-particle singlet state?Body: 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$.
"
"['quantum-gate', 'entanglement', 'physical-qubit', 'superposition', 'hadamard']"," Title: Is quantum superposition state a truth or an assumption?Body: 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.
"
['tensor-product']," Title: How should I interpret $|2\rangle|3\rangle$?Body: 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:
- Can I write $|2\rangle$ as $|10\rangle = |1\rangle|0\rangle$ always?
- If $|2\rangle = |10\rangle = |1\rangle|0\rangle$, Can I write $|2\rangle|3\rangle = |10\rangle|11\rangle = |1011\rangle$?
Assume $|0\rangle$, $|1\rangle$ in computational basis.
$|0\rangle = \begin{bmatrix}
1 \\
0
\end{bmatrix}$,
$|1\rangle = \begin{bmatrix}
0 \\
1
\end{bmatrix}$
"
"['entanglement', 'measurement', 'models', 'deutsch-jozsa-algorithm']"," Title: How to measure one of the qubits in a two-qubit register?Body: 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?
"
"['algorithm', 'programming', 'grovers-algorithm']"," Title: Grover's search for solving TSPBody: 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?
"
"['quantum-state', 'measurement', 'nielsen-and-chuang', 'tomography']"," Title: How to perform quantum state tomography on two qubits?Body: 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:
- In case eigenvectors of a observable coresponds to Bell states, I would measure a quantum state in Bell basis. Am I right?
- 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?
"
"['cryptography', 'key-distribution', 'bb84', 'qkd']"," Title: What authentication protocol to use for BB84 and other QKD protocols?Body: 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:
- 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.
- 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.
- 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).
- 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.
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].""
"
"['resource-request', 'physical-realization', 'architecture']"," Title: How many types of quantum computers are currently being researched?Body: 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?
"
"['quantum-state', 'density-matrix']"," Title: Density matrix for a diagonally polarized photonBody: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: Can't access IBMQ (NameError: name 'IBMQ' is not defined)Body: 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
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: Please clarify the following orthogonal property (quantum anonymous voting)Body: 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.
"
"['algorithm', 'programming', 'qiskit', 'teleportation']"," Title: Understanding quantum teleportation algorithm from qiskit tutorialsBody: 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:
"
"['algorithm', 'programming', 'q#']"," Title: How to create a q# operation to generate a random number from 1 to max?Body: 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!
"
"['algorithm', 'quantum-gate', 'physical-realization']"," Title: Why are multiple quantum gates, in a quantum circuit, used?Body: 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).$$
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Ripple Adder using Full AdderBody: 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!
"
"['programming', 'qiskit']"," Title: How does batching work in the optimizer loop of the VQC algorithm in Qiskit Aqua?Body: 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.
"
"['algorithm', 'resource-request', 'complexity-theory']"," Title: Resources to study quantum algorithms and quantum complexityBody: 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.
"
['circuit-construction']," Title: How to construct the unitary representation of the function $f(x, y, z) = (x \oplus y, y \oplus z)$?Body: 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?
"
"['quantum-advantage', 'interpretations']"," Title: Interpretations of quantum computing powerBody: 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.
- 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.
- Quantum computer can leap to the correct solution. It can tunnel through potential barriers on the solution landscape to a global maximum or minimum.
- 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.
- 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.
- 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.
Please tell me, which of these interpretations are correct and which are not.
"
"['qiskit', 'ibm-q-experience']"," Title: Is there a way to output a circuit from Qiskit to the IBM Q Experience circuit composer?Body: I can't seem to find anything, but this seems like something that should be possible.
"
"['complexity-theory', 'qma']"," Title: Self reducibility of QCMA problemsBody: 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?
"
"['programming', 'qiskit']"," Title: How to specify the CNOT gate direction (control qubit to target qubit) in Qiskit?Body: 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?
"
"['algorithm', 'vqe']"," Title: How to prepare Unitary Coupled Cluster ansatz for VQE in a circuit?Body: 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?
"
"['quantum-gate', 'quantum-state', 'bloch-sphere']"," Title: Bloch sphere and quantum operationsBody: 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.
"
"['quantum-state', 'entanglement']"," Title: Understanding the monogamy of entanglement with respect to GHZ StatesBody: 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!
"
"['entanglement', 'mathematics', 'resource-request', 'research']"," Title: Can quantum entanglement be expressed in terms of knot theory?Body: 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.
"
"['quantum-operation', 'tensor-product']"," Title: How to obtain the tensor-product of two quantum operations (superoperators) explicitly?Body: 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|$?
"
"['programming', 'ibm-q-experience', 'superconducting-quantum-computing']"," Title: What can be done so far with cloud quantum computing?Body: 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
"
"['mathematics', 'noise', 'fault-tolerance']"," Title: How's quantum noise and fault-tolerance related to symplectic geometry and geometric quantization?Body: 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?
"
['grovers-algorithm']," Title: How many iterations does Grover’s search need to find one out of $M$ marked items?Body: 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?
"
['qiskit']," Title: Getting a layout for qubits in QiskitBody: 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?
"
"['algorithm', 'programming', 'physical-realization']"," Title: How is a quantum computer programmed?Body: 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.
"
"['qiskit', 'qasm', 'openpulse']"," Title: OpenPulse: Where to get current pulse definitions for standard gates?Body: 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!
"
"['algorithm', 'qiskit']"," Title: Quantum random number generatorBody: Can we generate quantum random numbers through Qiskit?
I want to try the random number generator without using optics or noise.
"
"['qiskit', 'ibm-q-experience']"," Title: What does the error rate on the IBMQ website mean?Body:
How is the error rate pointed by the arrow defined? How did you get it?
thanks!
"
['ibm-q-experience']," Title: Find the Q-Experiment tutorial for beginnerBody: Where I can find the previous Quantum-Experiment tutorial for beginners?
(the one that was under https://quantumexperience.ng.bluemix.net/qstage/#/account)
"
"['qiskit', 'ibm-q-experience']"," Title: IBM Q experience - error code 520Body: 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=...
"
['circuit-construction']," Title: Minimum number of ancilla qubits required to make a transformation unitary?Body: 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)
"
"['circuit-construction', 'measurement']"," Title: Minimum number of ancilla qubits to unitarily simulate a measurement?Body: 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
"
"['quantum-state', 'mathematics', 'density-matrix']"," Title: Why are $d^2$ dimensions required to describe a density matrix?Body: 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?
"
"['mathematics', 'pauli-gates']"," Title: How to get specific state applying $e^{-i\phi \sigma_2/2}$ to $|0\rangle$ or $|1\rangle$?Body: 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?
"
"['quantum-state', 'speedup']"," Title: How many probabilities does the number of qubits represent?Body: 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?
"
"['quantum-state', 'entanglement']"," Title: Non-entangled two qubit system get information about the individual particle states after CNOTBody: 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?)
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Why is there only one line for the classical register?Body:
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.
"
"['quantum-state', 'entanglement', 'measurement']"," Title: Why does measuring one qubit after the other in this entangled system alter the result?Body: 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?
"
['key-distribution']," Title: BB84 and B92 protocols: what is maximum and minimum bits that Alice and Bob might agree on?Body: 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?
"
"['quantum-gate', 'no-cloning-theorem']"," Title: How is the no-cloning theorem compatible with the fact that fan-out gates work?Body: 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?
"
['measurement']," Title: Measuring in an arbitrary basisBody: 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
"
"['quantum-gate', 'matrix-representation']"," Title: Controlled phase shift gateBody: How does a controlled R gate look like (matrixwise)?
And how to generate CCR, CCCR and so on?
"
['q#']," Title: How can I transform a Result into a Bool in Q# + C# environment?Body: 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.
"
"['quantum-state', 'optimization', 'vqe']"," Title: How to explain that I get a value lower than the smallest possible through minimization procedure in VQE?Body: 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?
"
"['density-matrix', 'quantum-operation', 'partial-trace']"," Title: Simulating Classical Probabilistic Transitions with superoperatorsBody: 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
"
['artificial-intelligence']," Title: Are there realistic applications to predictive analysis of complex systems now handled by AI?Body: 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
"
"['entanglement', 'quantum-operation']"," Title: Proof that quantum entanglement does not increase the asymptotic capacity of classical channelBody: 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?
"
"['quantum-gate', 'mathematics', 'simulation', 'matrix-representation']"," Title: How do I apply a controlled gate to specific qbits in the register?Body: 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?
"
['applications']," Title: What are some examples of applications of quantum information to other sciences?Body: 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?
"
['simons-algorithm']," Title: Simon's algorithm exampleBody: 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.
"
['measurement']," Title: How do qubits use the ""superposition"" to make many trials instead of just some?Body: 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:
- A particle is rotating randomly;
- A measurement is made to know the probability of being a 1 or a 0;
- Using a quantum gate one will know if it is 1 or 0;
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.
"
"['qiskit', 'ibm-q-experience', 'error-correction']"," Title: QISKit ConnectionBody: 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.
"
"['quantum-gate', 'mathematics', 'simulation']"," Title: How to generate a SWAP of $N$ qubits?Body: 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.
"
"['quantum-gate', 'qiskit']"," Title: Why can different technology transpile the quantum gate to different representations?Body: 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?
"
"['quantum-state', 'mathematics', 'state-space-geometry']"," Title: Do states with the same purity always have the same rank?Body: 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?
"
"['entanglement', 'entropy', 'information-theory']"," Title: Entanglement entropy's role in quantum informationBody: 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.
"
"['qiskit', 'programming', 'algorithm']"," Title: Number of columns mismatch in QiskitBody: 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?
"
"['quantum-gate', 'circuit-construction']"," Title: How are physical quantum chips made?Body: 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?
"
"['mathematics', 'notation', 'projection-operator']"," Title: Interpretation of specific Hamiltonian operatorBody: 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"".
"
"['ibm-q-experience', 'complexity-theory']"," Title: How does number of shots (number of times the computation is repeated) affects time complexityBody: I want to know what happens to the time complexity in terms of big O analysis
"
['ibm-q-experience']," Title: How to fix an error: AttributeError: 'IBMQFactory' object has no attribute 'get_backend'Body: 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?
"
"['physical-realization', 'architecture']"," Title: What are the general hardware components of a universal quantum gate computer?Body: 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.
"
"['algorithm', 'grovers-algorithm']"," Title: Why, in Grover's algorithm, $H^{\otimes n}(2|0\rangle\! \langle0| - \mathcal{I})H^{\otimes n}=2|\psi\rangle \!\langle\psi| - \mathcal{I}$?Body: 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.
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: Can quantum chips be spied on?Body: 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?
"
"['algorithm', 'quantum-gate', 'entanglement', 'superposition']"," Title: What is the diference between classic probabilities and quantum probabilities?Body: So, I'm really trying my best to understand how quantum computers work.
This is how I think they work:
- There is a set of qubits;
- 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);
- 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);
- 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?
- 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;
- And then, in the end, qubits are collapsed so we get actual values in ones and zeros coming from those previous probabilities;
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...
"
"['error-correction', 'stabilizer-code', 'projection-operator']"," Title: Quantum error correction using bit-flip code for the amplitude damping channelBody: 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
- 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?
- 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?
- $[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?
"
"['circuit-construction', 'error-correction']"," Title: Quantum circuit for a three-qubit bit-flip codeBody: 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.
"
"['algorithm', 'programming', 'qiskit']"," Title: A question about qiskit's WeightedPauliOperator.evolve method for IPEA (IQPE) implementationBody: 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))
"
"['quantum-gate', 'matrix-representation']"," Title: How do I write the matrix for a CZ gate operating on nonadjacent qubits?Body: 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.
"
"['quantum-state', 'entanglement']"," Title: SWAP gate on 2 qubits in 3 entangled qubit systemBody: 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?
"
['algorithm']," Title: Quantum algorithms for the first-order and higher-order unification problem (finding substitution)Body: 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.
"
"['circuit-construction', 'quantum-enhanced-machine-learning']"," Title: Methods for encoding non-linear probabilities as dataBody: 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.
"
"['quantum-gate', 'programming', 'ibm-q-experience']"," Title: Custom gates on IBM QBody: 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?
"
"['measurement', 'tomography', 'bell-basis']"," Title: Problem with quantum tomography on two qubitsBody: 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:
- I calculated eigenvalues and eigenvectors of all observables
- I created circuits for measuring a quantum state in bases given by eigenvectors obtained in the first step
- I assigned each eigenvector its ""mirror"" in z-basis after measuring by circuits from step 2
- I prepared state $\psi$
- I did a measurement of state $\psi$ in all bases obtained in step 1 with help of circuits from step 2
- Based on measured probabilities, I calculated estimation of $\mathrm{Tr}(A\rho)$, where $A$ is an observable
- Then, I calculated estimation of density operator $\rho$
- 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.
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.
"
"['programming', 'qiskit']"," Title: AttributeError: 'Result' object has no attribute 'get_data'Body: 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?
"
['quantum-state']," Title: Why a single qubit is a state in 2D Hilbert space and not 3D or higher?Body: 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.
"
"['quantum-gate', 'ibm-q-experience', 'ibm']"," Title: Why qiskit superconducting device native gates different from that of trapped ion device?Body: 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?
"
['algorithm']," Title: The algorithm of the new quantum factoring record 1,099,551,473,989Body: 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?
"
['ibm-q-experience']," Title: Job Status: job incurred errorBody: 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
"
['qiskit']," Title: How to use parallel executions of circuits?Body: 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?
"
"['quantum-gate', 'quantum-state', 'bloch-sphere']"," Title: Do quantum gates rotate a qubit around the Bloch sphere, or do quantum gates rotate the Bloch sphere around a qubit?Body: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: run() got an unexpected keyword argument 'seed'Body: 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()
"
['qiskit']," Title: How to use Qiskit visualization in Python IDLE 3.X (Python 3.X 64-bit)?Body: 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?
"
"['quantum-gate', 'quantum-state']"," Title: Which gate combination should I use?Body: 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⟩
"
"['mathematics', 'complexity-theory', 'qma', 'postselection']"," Title: On the probability of preparing of a uniform superposition by performing a controlled-multiplication and post-selecting $0$Body: 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?
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: How to plot histogram or Bloch sphere for multiple circuits?Body: 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)
"
['applications']," Title: Will there be quantum to digital converters in the same way we need digital to analog converters to communicate between the 2 mediums?Body: 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?
"
['quantum-gate']," Title: Gate times for different qubit technologiesBody: 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?
"
['algorithm']," Title: What's a compiled quantum algorithm?Body: 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.
"
"['ibm-q-experience', 'architecture', 'ibm']"," Title: Why IBM devices have the same number of qubit and the same architecture, but the error rates are different?Body: 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?
"
"['quantum-gate', 'measurement']"," Title: Matrix representation of a measurementBody: 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?
"
"['entanglement', 'mathematics']"," Title: Maximally entangled state definition, and orthonormal basis of maximally entangled stateBody: 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?
"
"['grovers-algorithm', 'nielsen-and-chuang', 'hamiltonian-simulation']"," Title: Nielsen and Chuang, Exercise 6.12: How to simulate the specific Hamiltonian in the search algorithm by the Oracle gates?Body: 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?
"
"['algorithm', 'quantum-gate', 'circuit-construction']"," Title: How to transform e.g., a 4 by 4 unitary matrix into a quantum circuitBody: 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!
"
"['qiskit', 'phase-estimation', 'phase-kickback']"," Title: Quantum Phase Estimation implementationBody: 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.
"
"['quantum-gate', 'superposition']"," Title: Can Toffoli operate on a qubit in superposition?Body: 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!
"
"['quantum-state', 'entanglement', 'density-matrix', 'qudit']"," Title: Find the qutrit analogue of certain qubit and ququart formulas of Li and Qiao for testing separabilityBody: 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.
"
"['quantum-state', 'entanglement', 'photonics', 'orbital-angular-momentum']"," Title: What is the difference between ""intraphoton"" and ""interphoton"" entanglement?Body: 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.
"
"['experiment', 'quantum-advantage']"," Title: What is the difference between classical and quantum computers as well as computing (permuting) itself?Body: 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?
"
"['quantum-gate', 'nielsen-and-chuang']"," Title: Quantum adder mod 4Body: 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$
"
"['quantum-state', 'physical-qubit']"," Title: Can a classical limit of qubit emerge on a classical computer?Body:
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
"
['teleportation']," Title: Is quantum teleportation a natural phenomenon?Body: 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.)
"
"['pauli-gates', 'clifford-group']"," Title: Intuitive link between clifford group and gottesman-knill theoremBody: 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.
"
"['quantum-gate', 'superposition']"," Title: Represent qubit in a superpositionBody: How do we represent a qubit $\vert 1 \rangle$ and put in a superposition (in dirac)?
"
"['quantum-gate', 'quantum-state', 'qiskit']"," Title: Print data() with statevector and qasm simulator - QiskitBody: 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.
"
"['entanglement', 'quantum-operation', 'fidelity']"," Title: Does higher channel fidelity imply higher entanglement fidelity?Body: 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!
"
['complexity-theory']," Title: How powerful would quantum computers be if we had direct access to the full state vector?Body: 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?
"
"['entanglement', 'error-correction']"," Title: Repetition code encoder circuitBody: 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$$
"
"['simulation', 'hamiltonian-simulation']"," Title: Where does precisely the difficulty in exponentiating a Hamiltonian $H$ in the quantum simulation problem lay?Body: 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)?
"
"['quantum-gate', 'quantum-state', 'programming', 'q#', 'teleportation']"," Title: Is it possible to write a Q# teleportation code which returns a qubit?Body: Is it possible to write a Q# teleportation code which returns a qubit?
Thanks.
"
"['quantum-gate', 'quantum-state', 'programming', 'q#', 'bloch-sphere']"," Title: What is the corresponding code for finding the state of a qubit on the Bloch sphere?Body: 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.
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: Compiling the Pauli-Z operator to the Rz operator for Hamiltonian simulationBody: 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!
"
"['quantum-gate', 'bloch-sphere']"," Title: Can you use Rz to flip from $|+\rangle$ to $|-\rangle$?Body: 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?
"
"['mathematics', 'resource-request', 'hamiltonian-simulation']"," Title: Proof that most Hamiltonian evolutions are not efficiently approximable by quantum circuitsBody: 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?
"
"['ibm-q-experience', 'experiment']"," Title: Simple program produces consistently skewed results in IBM Q ExperienceBody: 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?
"
"['mathematics', 'history', 'foundations']"," Title: Why does quantum computing generally use matrix formulation of quantum mechanics rather than a continuous variable formulation?Body: 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.
"
"['quantum-gate', 'programming', 'circuit-construction', 'cirq']"," Title: Computing circuit depth in CirqBody: 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!
"
"['programming', 'q#']"," Title: Unit testing for quantum programs?Body: 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?
"
['matrix-representation']," Title: Representing qubit swap using linear algebraBody: 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.
"
"['quantum-state', 'state-discrimination']"," Title: Finding the optimal projective measurement to distinguish between two pure statesBody: 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)
"
"['resource-request', 'noise']"," Title: What types of noise are there?Body: 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.
"
"['grovers-algorithm', 'nielsen-and-chuang', 'oracles']"," Title: 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?Body: 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?
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'deutsch-jozsa-algorithm']"," Title: In Deutsch's algorithm, how to we get $(-1)^{f(x)}|x\rangle(|0\rangle-|1\rangle)$ from $|x\rangle(|0\rangle-|1\rangle)$?Body: 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?
"
"['ibm-q-experience', 'experiment', 'research']"," Title: Reversal of time arrow on IBM QBody: 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:
- Apply a forward time unitary evolution $U_\mathrm{nbit}|\psi_0\rangle = |\psi_1\rangle$
- 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$
- Apply an operator $U_R$ to get ""time-reversed"" state $|R\psi_1\rangle$
- Finally, apply again $U_\mathrm{nbit}$ to obtain the input state $|\psi_0\rangle$
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:
- 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?
- 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?
- 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?
"
"['algorithm', 'machine-learning', 'speedup', 'nisq', 'bayesian-learning']"," Title: Quantum speedup in Bayesian machine learning on NISQ computersBody: 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?
"
"['quantum-state', 'qiskit']"," Title: deliver a quantum register to/from a function in qiskitBody: 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
```
"
"['ibm-q-experience', 'experiment']"," Title: Writing twice to same classical register -> 1 for some backends in IBM Q ExperienceBody: 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.
"
"['quantum-state', 'superposition']"," Title: Is a qubit always in superposition?Body: 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.
"
"['error-correction', 'matrix-representation']"," Title: Syndrome extraction operator as matrix?Body: 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?
"
"['circuit-construction', 'universal-gates']"," Title: Can a Toffoli gate be implemented using Fredkin gates?Body: 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
- Can we use less than 4 gates?
- In the above circuit how to get rid of the garbage values?(I have heard they are bad for interference)
I am new to quantum computing so please correct me if I am asking something that doesn't make sense.
"
"['fidelity', 'nisq', 'diamond-norm']"," Title: What are the ""nice"" properties of the diamond norm and why is it used?Body: 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.
"
"['quantum-gate', 'circuit-construction']"," Title: How to implement a Fredkin gate using Toffoli and CNOTs?Body: 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?
"
"['ibm-q-experience', 'experiment']"," Title: Changing one qubit causes changes in another independent qubit on ibmqx2 in IBM Q ExperienceBody: 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.
"
['stabilizer-code']," Title: Why stabilizer codes are named additive quantum codes?Body: 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.
"
"['mathematics', 'zx-calculus']"," Title: Diagrammatic Quantum Reasoning: Proving the loop equation using yanking equationsBody: 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!
"
['qiskit']," Title: Help me understand this warning while running qiskit command IBMQ.load_account()Body: 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
"
"['measurement', 'physical-realization']"," Title: How are states of a qubit measured in a quantum computer?Body: How is a state of a qubit measured physically on a quantum computer?
"
['qiskit']," Title: Qiskit in Julia language?Body: 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?
"
"['programming', 'q#']"," Title: Does Q# have a bigint type?Body: 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?
"
"['quantum-gate', 'classical-computing', 'nielsen-and-chuang']"," Title: FANOUT with Toffoli GateBody:
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.
"
"['quantum-state', 'measurement', 'superposition']"," Title: What is the post measurement state given an input and the outcome measurement?Body: 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
"
"['quantum-state', 'measurement']"," Title: What are some examples of measuring qubits in different basis states?Body:
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.
"
"['quantum-state', 'nielsen-and-chuang', 'photonics']"," Title: Phase shifter acting on double rail statesBody: 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?
"
"['quantum-state', 'programming']"," Title: Representing a real valued vector with qubitsBody: 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)$.
"
['games']," Title: Proof of optimality for CHSH game classical strategyBody: 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:
- 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.
- 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.
- 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.
- However, there exists no string of bits which enables a classical strategy with success rate above 75%.
- 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.
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?
"
"['d-wave', 'adiabatic-model']"," Title: What are XX, YY, YZ etc. couplings?Body: 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?
"
"['quantum-state', 'measurement']"," Title: Evaluate the given quantum circuitBody:
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.
"
['quantum-state']," Title: What is the difference between a relative phase and a global phase? In particular, what is a phase?Body: 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?
"
"['adiabatic-model', 'topological-quantum-computing']"," Title: What is the correspondence between adiabatic phase and a topological phase?Body: 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?
"
"['programming', 'qiskit']"," Title: Result of a job for a list of circuits on QISKitBody: 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?
"
"['programming', 'qiskit', 'simulation', 'noise']"," Title: How can noise on a device be simulated using measured noise parameters?Body: 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?
"
"['annealing', 'machine-learning', 'neural-network']"," Title: Can quantum annealing be used for training convolutional neural networks?Body: 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.
"
"['programming', 'qiskit']"," Title: Can I remove gates from a QuantumCircuit?Body: 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?
"
"['programming', 'cirq']"," Title: cirq.ControlledGate from sub-circuit generatorBody: 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?
"
"['entanglement', 'bloch-sphere']"," Title: Why is an entangled qubit shown at the origin of a Bloch sphere?Body: 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.
"
"['circuit-construction', 'projectq']"," Title: Implement a circuit as a matrix in ProjectQBody: 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?
"
"['resource-request', 'photonics', 'key-distribution']"," Title: Implementing BB84 protocol with easily-obtained consumer hardwareBody: 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.
"
"['programming', 'circuit-construction', 'qiskit', 'solovay-kitaev-algorithm', 'rigetti']"," Title: Status of software packages for quantum compilingBody: 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?)
"
['gate-synthesis']," Title: Gate sequence for exponential of product of Pauli Z operatorsBody: 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.)
"
"['programming', 'q#']"," Title: How do I get a list of control qubits from Q# operations when tracing the simulation in C#?Body: 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.
"
"['programming', 'qiskit']"," Title: TypeError: unorderable types: QuantumRegister() >= int()Body: 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)
"
"['algorithm', 'quantum-gate']"," Title: How many qubits and how many gates, are required for finding the eigenvalues of a matrix?Body: 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?
"
"['matrix-representation', 'stabilizer-state', 'clifford-group']"," Title: Efficient implementation of the Clifford group for $n$ qubitsBody: 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
"
"['quantum-gate', 'mathematics', 'unitarity']"," Title: Extending a square matrix to a unitary matrixBody: 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.$:
- $U$ is a square matrix of size $2n\times 2n$,
- $U$ is of the form $\begin{bmatrix}M&A\\B&C\end{bmatrix}$,
- $A,B,C$ are all of size $n\times n$ and all of $A,B,C$ are unique linear transformations of $M$,
- The elements of $A,B,C$ can take complex values,
- 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$)?
Thank you
"
"['mathematics', 'unitarity']"," Title: When can a matrix be ""extended"" into a unitary?Body: 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?
"
"['programming', 'qiskit']"," Title: Plotting data in QISKit using plot_histogramBody: 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.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Submitting jobs to IBMQ backend via HTTP API RequestsBody: 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.
"
"['algorithm', 'biology']"," Title: Extrapolation of CRISPRBody: 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.
"
"['d-wave', 'annealing', 'embedding']"," Title: Are there established best practices for designing Dwave embeddings?Body: 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?
"
"['quantum-gate', 'matrix-representation', 'pauli-gates']"," Title: How to construct matrix of regular and ""flipped"" 2-qubit CNOT?Body: 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?
"
"['physical-realization', 'decoherence', 'noise']"," Title: Does self-induced collapse limit the size of a quantum computer?Body: 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?
"
"['d-wave', 'annealing', 'embedding']"," Title: What are techniques are used to esimate the spectral properties of annealer embedding hamiltonians?Body: 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?
"
"['quantum-state', 'notation']"," Title: What is the notational convention for the single-qubit states $\lvert0\rangle\pm i\lvert1\rangle$?Body: 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 ?
"
"['teleportation', 'continuous-variable']"," Title: Quantum teleportation over continuous variables?Body: 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.
"
"['quantum-operation', 'nielsen-and-chuang', 'noise', 'unitarity']"," Title: What do you specify when you physically apply a unitary?Body: 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?
"
"['measurement', 'superposition']"," Title: Is qubit superposition a basis-dependent concept?Body: 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?
"
"['programming', 'qiskit']"," Title: Why won't Qiskit ccx gate accept registers?Body: 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?
"
"['quantum-gate', 'mathematics', 'unitarity']"," Title: General parametrisation of an arbitrary $2\times 2$ unitary matrix?Body: 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.
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: What happens in Deutsch algorithm if I use equal input bits?Body: 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.
"
"['algorithm', 'complexity-theory', 'bqp', 'fourier-sampling']"," Title: What is recursive Fourier sampling and how does it prove separations between BQP and NP in the black-box model?Body: 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.
"
['entanglement']," Title: Defining entanglement for systems with more than two qubitsBody: 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?
"
"['algorithm', 'complexity-theory']"," Title: Intuitive Proof: BQP ⊆ PPBody:
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
"
"['complexity-theory', 'deutsch-jozsa-algorithm', 'bqp']"," Title: Why doesn't Deutsch-Jozsa Algorithm show that P ≠ BQP?Body: 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}$?
"
"['algorithm', 'complexity-theory']"," Title: Query lower bound for Majority function using the quantum adversary methodBody: 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$)?
"
"['algorithm', 'adiabatic-model', 'deutsch-jozsa-algorithm']"," Title: How to understand Deutsch-Jozsa algorithm from an adiabatic perspective?Body: 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$.
"
['superposition']," Title: How to prepare a superposed state where its terms are elements of a sequence?Body: 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}$?
"
"['quantum-state', 'entanglement']"," Title: Why do we have to uncompute rather than simply set registers to zero?Body: 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?
"
['classical-computing']," Title: Does quantum computing relate to stochastic computing in any way?Body: 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?
"
['resource-request']," Title: Resources for learning quantum computing from an undergraduate physics perspectiveBody: 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.
"
"['quantum-gate', 'gate-synthesis', 'quirk']"," Title: Creating a time dependent custom gate in QuirkBody: 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.$
"
['circuit-construction']," Title: 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}$?Body: I know I must define $U_f$, the unitary operator, on the computational basis. But what's my computational basis here?
"
"['quantum-operation', 'communication', 'classical-quantum']"," Title: Real-life examples of classical-quantum channelsBody: 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.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: How to translate matrix back into Dirac notation?Body: 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.
"
"['circuit-construction', 'complexity-theory', 'graph-isomorphism']"," Title: How to construct a quantum circuit (QIP system) for the graph non-isomorphism problem?Body: 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:
- 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.
- 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$).
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).
"
"['quantum-state', 'mathematics', 'complexity-theory', 'qma']"," Title: Quantum proof for the group non-membership problemBody: 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).
"
"['algorithm', 'grovers-algorithm']"," Title: In Grover's algorithm, why is the unitary corresponding to the phase shift $2\lvert0\rangle\langle0\rvert-I$?Body: 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.
"
"['programming', 'qiskit', 'resource-request']"," Title: Path to learn Qiskit as a tool for the futureBody: 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.
"
"['quantum-state', 'density-matrix']"," Title: How can pure state ensemble decompositions not be unique?Body: 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?
"
"['quantum-gate', 'gate-synthesis']"," Title: Hadamard gate as a product of $R_x$, $R_z$ and a phaseBody: 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
"
"['cryptography', 'key-distribution']"," Title: What is the difference between quantum key distribution and quantum key exchange?Body: 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?
"
"['programming', 'qiskit']"," Title: Deprecation warnings in Qiskit (circuit drawing)Body: 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:
- 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;
- 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;
- 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;
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)
"
['games']," Title: How can quantum computing win 97% of times in coin flipping experiment?Body: 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:
- Quantum Computer plays a move but it is not revealed to the Opponent[Human].
- Opponent[Human] plays a move and it is also not revealed to the Quantum Computer.
- Finally Quantum Computer plays a move.
- Results are shown. If its
heads, then Quantum Computer wins. Else, Opponent[Human] wins.
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:
- Quantum computer is tracking something low level in hardware. So, it knows every time, what did the opponent played.
- 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.
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.
"
"['quantum-gate', 'classical-computing']"," Title: Reversibility and irreversibility of logic gates (quantum vs classical)Body: 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?
"
"['algorithm', 'classical-computing', 'models']"," Title: Aren't reversible logic gates a necessity for efficiently executing quantum algorithms?Body: 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).
"
"['resource-request', 'error-correction', 'topological-quantum-computing', 'surface-code']"," Title: Reference that explains how to read 3d topological diagrams for surface code computationsBody: 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.
"
"['algorithm', 'shors-algorithm', 'quantum-fourier-transform']"," Title: What happens with first phase factor in QFT?Body: 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}$?
"
"['quantum-state', 'circuit-construction', 'measurement', 'decoherence', 'nielsen-and-chuang']"," Title: Measurement of a qubit and storage of the information on a bitBody: 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:
- 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.
- 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?
"
"['quantum-state', 'measurement', 'games']"," Title: Optimal strategy to a quantum state gameBody: 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...
"
['physical-realization']," Title: Is there any company that backs and implements diamond vacancy quantum computers?Body: 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?
"
"['programming', 'qiskit']"," Title: ImportError: cannot import name 'QuantumProgram' from 'qiskit'Body: 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)
"
"['algorithm', 'mathematics', 'grovers-algorithm']"," Title: How is Grover's operator represented as a rotation matrix?Body: 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.
"
"['complexity-theory', 'qma', 'postselection']"," Title: Does strong error reduction for PostQMA exist?Body: $\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.
"
['measurement']," Title: Do weak measurements (with/without weak values) have any application in quantum computation?Body: I have seen their applications in quantum state tomography but not in computation as such.
"
"['notation', 'correlations']"," Title: Why is correlation in the $X$ basis represented as $X\otimes X = 1$?Body: 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)
"
"['error-correction', 'qudit', 'qutrit']"," Title: Why can a point in anti-de Sitter space be modeled as a logical qutrit and how is its error correction done?Body: 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.
- 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""?
- How exactly does the entangled trio perform the error correction of the central logical qutrit?
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)
"
"['programming', 'ibm-q-experience']"," Title: Why can't I connect to an IBMQ device?Body: 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.
"
"['entanglement', 'communication']"," Title: Transmission of information over long distancesBody: 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?
"
"['algorithm', 'amplitude-amplification']"," Title: Does Brassard's algorithm for calculating the mean make implicit assumptions on distribution?Body: 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?
"
"['programming', 'ibm-q-experience', 'qasm']"," Title: QE error: No handlers could be found for loggerBody: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qiskit: 'per shot' resultBody: 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.
"
"['algorithm', 'optimization']"," Title: Optimal sampling strategy for VQEBody: 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
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis', 'quirk']"," Title: Is there any method of adding two operators in a circuit?Body: 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
"
"['algorithm', 'mathematics', 'grovers-algorithm']"," Title: Grover algorithm for more than one elementBody: 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!
"
"['quantum-gate', 'programming', 'q#']"," Title: Type error creating R gate in Q#?Body: 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.
"
"['quantum-gate', 'programming', 'q#']"," Title: Creating controlled R1 gates in Q#?Body: 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.
"
"['topological-quantum-computing', 'anyons']"," Title: Topological anyonic molecule statisticsBody: 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?
"
['measurement']," Title: What does simultaneous measurement of a mutually commuting set of observables mean?Body: 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.
"
"['physical-realization', 'd-wave', 'ibm']"," Title: D-Wave systems and IBM Q System OneBody: What is the difference between the D-Wave systems and the newly-born IBM Q System One?
"
"['quantum-gate', 'gate-synthesis', 'tensor-product']"," Title: Proof that $2^n \times 2^n$ operator be decomposed in terms of $2 \times 2$ operatorsBody: 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?
"
"['algorithm', 'programming', 'grovers-algorithm', 'pyquil']"," Title: How to create the oracle matrix in Grover's algorithm?Body: 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?
"
"['quantum-state', 'trapped-ion']"," Title: Ion trap qubit Hamiltonian calculation manipulationBody: 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.
"
"['quantum-gate', 'adiabatic-model', 'machine-learning']"," Title: How to recognize if a paper is talking about quantum annealing or gate logic?Body: 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?
"
"['quantum-state', 'entanglement', 'ibm', 'experiment']"," Title: Can ""experimental data from a quantum computer"" be used to test separability probability conjectures?Body: 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.)
"
"['measurement', 'simulation', 'cirq', 'entropy', 'nisq']"," Title: Where does the Xmon simulator from Googles cirq framework its entropy from?Body: 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?
"
"['entanglement', 'non-locality', 'bell-experiment', 'correlations', 'games']"," Title: Why is $P(1,2)_{\text{same}} = \frac{1}{4}$ and not $\frac{1}{2}$ in Preskill's Bell experiment?Body: 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)
"
"['architecture', 'experiment', 'bloch-sphere', 'ion-trap-quantum-computing', 'chemistry']"," Title: Spin precession using a laserBody: 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)?
"
"['quantum-gate', 'quantum-state']"," Title: How does a $2 \pi$ pulse in Cirac Zoller give a -1 sign to the state?Body: 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.
"
"['programming', 'grovers-algorithm']"," Title: Why is Grover's algorithm not converging monotonically? (Python implementation)Body: 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]]
"
"['quantum-state', 'superposition', 'notation']"," Title: How to read Dirac notation (without algebra)?Body: 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.
"
"['algorithm', 'simons-algorithm']"," Title: In Simon's algorithm, why is $f$ one-to-one if (and only if) $s=0^n$?Body: 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?
"
"['programming', 'resource-request', 'qcl']"," Title: What resources are available for learning QCL?Body: 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.
"
"['algorithm', 'simons-algorithm']"," Title: Simon's Algorithm - Probability that the measurement results in a string YBody: 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.
"
['quantum-state']," Title: Can I call $\{|0\rangle, |1\rangle\}$ the ""standard computational basis"" as it is done in linear algebra?Body: $\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?
"
"['algorithm', 'speedup']"," Title: What is the actual mechanism behind quantum computing?Body: 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).
"
"['quantum-state', 'physical-qubit', 'chemistry']"," Title: Hamiltonian of the valence electron of Yb+ ionBody: 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?
- If the magnetic moment of the electron is parallel to that of the nucleus, then the potential energy will be minimum
- If the magnetic moment of the electron is anti-parallel to the nucleus, then the PE will be maximum
- 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)
Now, given this exact scenario, what will be the Hamiltonian of the electron so that I can solve for the SE?
"
"['quantum-state', 'physical-qubit', 'chemistry']"," Title: Rabi oscillations with different energy differencesBody: 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
"
['research']," Title: Future research in quantum computation and informationBody: 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?
"
['resource-request']," Title: Chronological list of improvements in number of logical qubitsBody: 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.
"
"['algorithm', 'complexity-theory', 'grovers-algorithm', 'phase-estimation']"," Title: What is the complexity of the quantum phase estimation in Grover's algorithm?Body: 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$?
"
"['algorithm', 'grovers-algorithm', 'phase-kickback']"," Title: Is the $|-\rangle$ state the only one that can do the trick for Grover's algorithm?Body: $\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?
"
"['history', 'phase-kickback']"," Title: Who discovered the phase kickback trick?Body: Was it David Deutsch? Can you say who was the first paper to mention the phase kickback trick?
"
"['quantum-state', 'entanglement', 'tensor-product', 'classical-quantum']"," Title: Better Way Of Separating Two CQ-StatesBody: 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?
"
"['algorithm', 'complexity-theory', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Why is quantum Fourier transform required in Shor's algorithm?Body: 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?
"
"['mathematics', 'matrix-representation', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise 2.2 - Matrix representations in different input and output basisBody: 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:
- 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?
- How to solve the second part of the question?
"
"['programming', 'qiskit']"," Title: LaTeX error when drawing circuits with QiskitBody: 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?
"
"['quantum-gate', 'gate-synthesis', 'tensor-product']"," Title: Composing the CNOT gate as a tensor product of two level matricesBody: 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?
"
"['quantum-gate', 'unitarity']"," Title: Is it correct to say that we need controlled gates because unitary matrices are reversible?Body: I am new to quantum computing and saw this argument on this site but I don't understand it.
- 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?
- 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?
- 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?
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?
"
"['algorithm', 'shors-algorithm']"," Title: Possible results from Shor's algorithm in practiceBody: 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):
- 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}$
- Randomly choose $x$ such that $1 < x < N$ and check if $\gcd(x,N) = 1$ if not here is a factor
- 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)
- Measure the first set register which contain an information in form of
$$\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$$
- 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$
- 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)$
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.
"
"['algorithm', 'complexity-theory', 'space-complexity']"," Title: Is there a polynomial quantum algorithm for graph coloring?Body: Is there a polynomial time and polynomial space quantum algorithm for finding a 4 colouring of any loopless planar graph?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qiskit - How do we measure the same single qubit system multiple times while also getting the counts/results after each measurement?Body: 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?
"
"['quantum-state', 'circuit-construction', 'superposition']"," Title: Forming states of the form $\sqrt{p}\vert 0\rangle+\sqrt{1-p}\vert 1\rangle$Body: 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$?
"
"['quantum-gate', 'gate-synthesis']"," Title: Decomposition of any 2-level matrix into single qubit and CNOT gatesBody: 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!
"
"['quantum-gate', 'circuit-construction', 'swap-test']"," Title: Can the SWAP test only compare registers with the same number of qubits?Body: 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?
"
"['quantum-state', 'mathematics', 'machine-learning']"," Title: Why does $x\sqrt{1-x^2}$ enhance the ability to approximate analytical functions in quantum circuit learning?Body: 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:
- 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]$
- Apply a parameterized unitary transformation $U(\theta)$.
- Minimize the cost function by tuning the parameters $\theta$ iteratively.
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!
"
"['algorithm', 'shors-algorithm']"," Title: How exactly does modular exponentiation in Shor's algorithm work?Body: 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?
"
"['architecture', 'physical-realization', 'grovers-algorithm', 'ibm']"," Title: Current limits on Grover search spaceBody: 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 :
- Circuit architecture restrictions : Perhaps the gate set and the underlying architecture of the circuits provided by these computers puts a restriction.
- Error corrections : Additional qubits are required for correcting errors.
I would like to know if there are any additional practical/physics issues that is limiting the use of Grover search currently.
"
"['programming', 'qiskit']"," Title: QISKit warrning on marshmallowBody: 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?
"
"['resource-request', 'notation']"," Title: Is there a place online where I can catch up with all the notational syntax associated with quantum computing?Body: 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!
- $\langle\psi|U^{\dagger}MU|\psi\rangle$
- $|0\rangle\langle0|$ or $|0\rangle |0\rangle$
- $ {\oplus}$
- $|0\rangle^{\otimes n}$
- 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!
- 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.
- Is it a NOT gate? XOR gate? Or denoting any possible operation?
- Vector zero, and composition of subscript n appearing above like a 'power'.
Can someone clear up the confusion? Or offering a place to look them all and their definitions up?
"
"['quantum-gate', 'gate-synthesis', 'quirk']"," Title: How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?Body: 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?
"
['teleportation']," Title: Quantum teleportation with moving Alice and BobBody: I have questions regarding quantum teleportation, which keep confusing me.
- 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?
- 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.
- 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?
Note: Cross-posted to Physics. I've accepted this answer there.
"
"['algorithm', 'shors-algorithm']"," Title: Does Shor's algorithm end the search for factoring algorithms in the quantum world of computation?Body: 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?
"
['pauli-gates']," Title: Fast way to check if two state vectors are equivalent up to Pauli operationsBody: 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.
"
"['complexity-theory', 'matrix-representation']"," Title: Is quantum computer equivalent to Turing machine with matrix multiplication oracle?Body: 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?
"
"['quantum-state', 'measurement']"," Title: Do the probability amplitudes describe the probability of projective measurement?Body: 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.
"
"['algorithm', 'circuit-construction']"," Title: Constructing a circuit which performs the transformation $|x,y\rangle \to |x, x + y \bmod 4\rangle$Body: 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!
"
"['quantum-gate', 'quantum-state']"," Title: If $|\psi\rangle, U|\psi\rangle$ are known, how many pairs of such qubits are required to find the operator $U$?Body: 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$?
"
"['entanglement', 'nonclassicality', 'steering']"," Title: Construction of optimal ensemble to show quantum steerabilityBody: 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).
"
"['programming', 'q#']"," Title: Is programming in quantum computer same as programming in quantum simulator in classical computer?Body: 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.)?
"
"['quantum-gate', 'quantum-state', 'measurement', 'nielsen-and-chuang']"," Title: Why does $|P_U − P_V |$ equal $\langle \psi |U^{\dagger} M U|\psi\rangle −\langle \psi |V^{\dagger} M V |\psi\rangle$?Body: 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?
"
"['quantum-state', 'programming', 'qiskit']"," Title: Is it possible to create a superposition in IBMQ QISkit which has probability amplitudes $|a|\neq |b|$?Body: 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?
"
"['quantum-gate', 'programming', 'simulation']"," Title: ProjectQ - In which part of the controlled gate object are the control bits scoredBody: 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?
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis']"," Title: Decompose a general two-qubit gate into general controlled-qubit gatesBody: 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.
"
"['simulation', 'ibm-q-experience']"," Title: Why is there a difference between the simulation results and the actual quantum computer results?Body: 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. ![]()
"
"['hamiltonian-simulation', 'nielsen-and-chuang', 'pauli-gates']"," Title: Simulate hamiltonian evolutionBody: 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$$
"
"['programming', 'cirq']"," Title: Using parametrised values and 'Symbols' in CirqBody: 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 :)
"
['quantum-state']," Title: A two qubit state in a special formBody: 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$?
"
"['programming', 'cirq']"," Title: How to set a starting state in cirq?Body: 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!
"
"['physical-qubit', 'superconducting-quantum-computing']"," Title: Interaction of an RF pulse with transmon qubitBody: 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?
"
"['teleportation', 'faster-than-light']"," Title: Can we teleport a human or send information faster than light using quantum teleportation?Body: 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?
"
"['algorithm', 'quantum-gate', 'oracles', 'phase-kickback']"," Title: Show that these two expressions for the oracle transformation are equivalentBody: 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?
"
"['algorithm', 'shors-algorithm', 'quantum-fourier-transform', 'superposition']"," Title: Why do we use the quantum superposition for a period instead of factors in Shor's algorithm?Body: 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).
"
"['simulation', 'quirk']"," Title: Creating .gifs corresponding to Quirk simulationsBody: 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?
"
"['quantum-gate', 'gate-synthesis', 'nielsen-and-chuang']"," Title: 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?Body: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Consistent QISkit error: ""All devices are currently unavailable""Body: 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?
"
"['physical-realization', 'physical-qubit', 'experiment', 'chemistry']"," Title: Can one make NV centred type qubits from analogus materials in the periodic table?Body: 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?
"
"['quantum-state', 'entanglement', 'concurrence']"," Title: Connection between the definitions of concurrence for a two-qubit statesBody: 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$}$.
"
"['entanglement', 'mathematics', 'quantum-operation', 'partial-transpose', 'ppt-criterion']"," Title: For 2x2 and 2x3 systems, is the partial transpose the only positive but not CP operation?Body: 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.
"
"['non-locality', 'bell-experiment', 'correlations']"," Title: How is Bell’s Inequality converted to the CHSH inequality?Body: 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.
"
"['programming', 'cirq']"," Title: How to add control to gates in Cirq?Body: 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?
"
"['algorithm', 'quantum-state', 'machine-learning', 'quantum-advantage', 'quantum-enhanced-machine-learning']"," Title: Quantum machine learning after Ewin TangBody: 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?
"
"['algorithm', 'circuit-construction']"," Title: Garbage-Free Reversible Binary-To-Unary Decoder ConstructionBody: 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.
"
"['quantum-gate', 'qiskit', 'notation']"," Title: Qiskit gates in LaTeX representation: notation meaningBody: 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?
"
"['quantum-gate', 'quantum-state', 'notation']"," Title: What is the meaning of the state $|1\rangle-|1\rangle$?Body: 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.
- So one approach was to take the original state $|10\rangle-|11\rangle$ and apply to it $\operatorname{H}$ gate multiplied by CNOT gate.
- 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?
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$?
"
"['programming', 'qiskit']"," Title: Cannot load account with QiskitBody: 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.
"
"['algorithm', 'grovers-algorithm']"," Title: Is there a way to reverse the amplitudes of a quantum system?Body: 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?
"
['photonics']," Title: How to explain polarization using photon spin?Body: I know how polarization filters work using EM waves. Can somebody help me in understanding how they work using photons?
"
['machine-learning']," Title: How to study quantum machine learning?Body: 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!
"
"['quantum-state', 'measurement']"," Title: If a qubit is in $|1\rangle$ state, is it possible to prove that it is in $|1\rangle$ state?Body: Measuring is clearly not the answer here. Is there some trick to prove it is $|1\rangle$ state?
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: The relationship between entanglement of vector states to matrix operationsBody: 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?
"
['quantum-gate']," Title: What's the point of quantum gates being 'continuous'?Body: 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?)
"
"['programming', 'qiskit']"," Title: ""Wait"" gate throws an error ""NotImplementedError: ('No decomposition rules defined for ', 'wait')""Body: 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)
"
"['mathematics', 'notation']"," Title: How to write the map $\mathbb C\ni z\mapsto zv$ in bra-ket notation?Body: 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.
"
"['programming', 'circuit-construction', 'qiskit', 'gate-synthesis']"," Title: Building an N-qubit Controlled S GateBody: 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?
"
"['entanglement', 'density-matrix']"," Title: How to find a separable decomposition for $|\Psi^+\rangle\!\langle\Psi^+|+|\Phi^+\rangle\!\langle\Phi^+|$?Body: 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?
"
"['quantum-gate', 'cirq', 'qasm']"," Title: How is $X^q$ equal to $RX(\pi q)$?Body: 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)$.
"
"['algorithm', 'circuit-construction', 'hamiltonian-simulation']"," Title: Circuit construction for Hamiltonian simulationBody: 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.
"
"['algorithm', 'cirq']"," Title: Creating an ansatz for variational quantum algorithms?Body: 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:
- Apply an XPowGate for the same parameter for all qubits. This is the method we have written above.
- Apply a ZPowGate for the same parameter for all qubits where the transverse field term h is +1.
- 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.
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.
"
"['measurement', 'communication', 'teleportation']"," Title: Why is measurement needed in teleportation?Body: 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.
"
"['quantum-state', 'bloch-sphere']"," Title: What's a vector in the Bloch sphere representation?Body: 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)$?
"
['bloch-sphere']," Title: What utility is provided by the Bloch sphere visualization?Body: 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?
"
"['algorithm', 'chemistry']"," Title: How to apply unitary coupled cluster to a spin problem?Body: 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.
"
"['mathematics', 'matrix-representation', 'unitarity']"," Title: Differentiate between local and global unitariesBody: 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)?
"
['programming']," Title: Which quantum computing programming language should I learn?Body: 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).
"
"['quantum-gate', 'quantum-state', 'quantum-operation']"," Title: The meaning of measurements in different basesBody: 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)$?
"
"['quantum-state', 'density-matrix']"," Title: Why is a density operator defined the way it's defined?Body: 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?
"
"['quantum-gate', 'qudit', 'qutrit']"," Title: Computing with qutritsBody: 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.
"
"['entanglement', 'teleportation', 'applications', 'superdense-coding']"," Title: How we can describe entanglement from measurement and resource perspectives?Body: 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?
"
"['entanglement', 'mathematics']"," Title: What is the general variety corresponding to the Segre embedding for $n$-qubit systems?Body: 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!
"
"['quantum-state', 'programming', 'qiskit', 'measurement', 'simulation']"," Title: For CNOT gate with control qubit set to 1, the measured state of the second qubit unexpectedly depends on the measurementBody: 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()
"
"['algorithm', 'entanglement', 'teleportation', 'no-cloning-theorem']"," Title: How to prove teleportation does not violate no-cloning theorem?Body: 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?
"
"['entanglement', 'mathematics', 'density-matrix', 'bloch-sphere', 'state-space-geometry']"," Title: Homeomorphism or stereographic projection corresponding to the set of mixed states within the Bloch sphereBody: 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:
- 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?
- 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.
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.
"
"['quantum-state', 'mathematics', 'density-matrix', 'bloch-sphere', 'state-space-geometry']"," Title: Purity of mixed states as a function of radial distance from origin of Bloch ballBody: @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?
"
"['quantum-gate', 'quantum-state', 'measurement', 'nielsen-and-chuang']"," Title: Why isn't the circuit performing a measurement in the Bell basis?Body: 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?
"
"['complexity-theory', 'nielsen-and-chuang', 'bqp']"," Title: Clarification needed for the N&C proof that BQP ⊆ PSPACEBody: 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.
"
"['quantum-state', 'physical-qubit']"," Title: What does an observable in a different basis mean physically?Body: 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?
"
"['algorithm', 'mathematics', 'grovers-algorithm']"," Title: Proof that Grover's operator can be written as $D_N=-H_n R_N H_n$Body: 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$$
"
"['algorithm', 'mathematics', 'shors-algorithm']"," Title: How does $x^{\frac{r}{2}} \equiv -1 \pmod {p_i^{a_i}}$ follow from ""if all these powers of $2$ agree""?Body: 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$
"
"['quantum-state', 'circuit-construction', 'mathematics', 'quantum-operation', 'povm']"," Title: POVM three-qubit circuit for symmetric quantum statesBody: 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.
"
"['algorithm', 'mathematics', 'shors-algorithm']"," Title: Confusion regarding probability of period resulting in factoringBody: 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.
- 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}$?
- Why is the probability of each of these powers of 2 agreeing with the previous at most 50%?
Related: Expected repetitions of the quantum part of Shor's algorithm
"
"['algorithm', 'mathematics', 'shors-algorithm']"," Title: Why do we search for square roots of 1 in Shor's algorithm unlike the quadratic sieve?Body: 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
"
['algorithm']," Title: Computing max of 2, length n bit registriesBody: 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.
"
"['qiskit', 'hhl-algorithm', 'tomography']"," Title: Quantum algorithm for linear system of equations (HHL) - Final Step: How can I find my vector of solution $|x\rangle$?Body: 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.
"
"['gate-synthesis', 'optimization']"," Title: Optimise implementation of a quantum algorithm when an input is fixedBody: 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:
- 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?
- 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)?
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?
"
"['entanglement', 'entropy', 'state-distillation']"," Title: What do entanglement cost and distillable entanglement have to do with measuring entanglement?Body: 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.
"
"['programming', 'resource-request', 'machine-learning']"," Title: What language is more suitable for quantum machine learning algorithms?Body: 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.
"
['annealing']," Title: Q1Q2Q3 coupling in qubo fileBody: 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?
"
"['physical-realization', 'superconducting-quantum-computing']"," Title: How do frequency-tunable microwave resonators work?Body: 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?
"
"['quantum-gate', 'gate-synthesis', 'universal-gates', 'solovay-kitaev-algorithm']"," Title: Rewrite circuit with measurements with unitariesBody: 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!
"
['error-correction']," Title: 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?Body: 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?
"
"['quantum-state', 'entanglement', 'non-locality']"," Title: EPR states with permuted qubitsBody: 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?
"
"['quantum-state', 'entanglement', 'no-cloning-theorem']"," Title: What does it mean that copying a state is impossible but creating a copy of by entangling is possible?Body: 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?
"
['ibm-q-experience']," Title: How much variation is there in the results between each quantum computer on the IBMQ Quantum Experience system?Body: 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?
"
"['error-correction', 'fault-tolerance']"," Title: A question on Eastin-Knill theoremBody: 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.
"
"['programming', 'qiskit', 'simulation', 'noise']"," Title: What are reasonable noise/dephasing parameters for QuEST to emulate state-of-the-art quantum computers?Body: 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?
"
"['error-correction', 'fault-tolerance', 'surface-code']"," Title: In what situation are three rounds of syndrome measurement required for fault-tolerance in the surface code?Body: 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.
"
"['programming', 'qiskit', 'grovers-algorithm']"," Title: Finding the second smallest number. Is it achievable in QC?Body: 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.
"
"['error-correction', 'density-matrix', 'decoherence']"," Title: Decoherence in quantum systems always produces $\vert0\rangle$Body: I was recently asked two questions concerning error in quantum computing:
- 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?
- 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.
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?
"
"['mathematics', 'cryptocurrency', 'quantum-money', 'no-cloning-theorem', 'key-distribution']"," Title: What role do Hecke operators and ideal classes perform in “Quantum Money from Modular Forms?”Body: 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?
"
"['quantum-gate', 'pauli-gates']"," Title: Where is the factor of $-i$ in rotation gates coming from?Body: 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}\\
$
"
"['quantum-gate', 'pauli-gates']"," Title: Rotation operator on Pauli parity gates $XX$, $YY$ and $ZZ$Body: 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 $$
"
"['programming', 'qiskit']"," Title: Qiskit predecessor and successor map of DAG circuitsBody: 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?
"
"['physical-qubit', 'decoherence', 'noise']"," Title: What noise channel that is not coming from the control can lead to XY qubit rotations?Body: 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.
"
['error-correction']," Title: Why does phase flip correction error? Why could any error be written as a linear combination of I, X, Z and ZX matrices?Body: 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?
"
"['algorithm', 'complexity-theory', 'grovers-algorithm']"," Title: Grover's algorithm and Battleship solutionBody: 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?
"
"['resource-request', 'error-correction']"," Title: How does Steane code use the classical Hamming code for error correction?Body: 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?
"
"['circuit-construction', 'quirk']"," Title: How to simulate a simple circuit to add two numbers in Quirk?Body: 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?
"
"['error-correction', 'measurement', 'projection-operator']"," Title: What does it mean to perform a measurement in correspondence with different projections?Body: 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?
"
['error-correction']," Title: In error correction code why don't we imitate the Hamming code instead of the complicated Steane code?Body: 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?
"
"['error-correction', 'resource-request', 'quantum-operation']"," Title: Estimating the depolarizing probability of depolarizing channelsBody: 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.
"
"['error-correction', 'measurement', 'pauli-gates']"," Title: How does the actual measurement collapsing an error to an orthogonal basis look like?Body: 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?
"
['annealing']," Title: Q1Q2Q3Q4 coupling in qubo fileBody: 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?
"
"['quantum-gate', 'gate-synthesis']"," Title: Implement Fredkin gate with square root of swapBody: 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?
"
"['quantum-state', 'mathematics', 'superposition']"," Title: How to measure superposition coefficients to determine state?Body: 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.
"
"['algorithm', 'qiskit', 'grovers-algorithm']"," Title: How is the Grover-Algorithm applied to a database?Body: 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?
"
"['algorithm', 'quantum-gate', 'grovers-algorithm']"," Title: How do you implement the gates for Grover's algorithm for more than 4 elements?Body: 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:
- How do you convert the gates in the Grover algorithm for N bits? Is there a general derivation somewhere?
- 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?
- What does a general construction procedure look like to create a gate from a unitary matrix?
"
"['algorithm', 'grovers-algorithm']"," Title: Adapting search algorithm to search the minimum in a database in $O(\sqrt{N}\log(N))$ queriesBody: 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?
"
"['programming', 'qiskit']"," Title: Problems with qiskit-terra: missing members of instance QuantumCircuitBody: 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))
"
"['algorithm', 'grovers-algorithm']"," Title: Durr and Hoyer's: A Quantum Algorithm for Finding the MinimumBody: 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?
"
"['quantum-gate', 'quantum-state', 'superposition']"," Title: How to implement such a gate where one input bit is zero and the other is one and the output should be one?Body: 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?
"
"['teleportation', 'superdense-coding']"," Title: Are superdense coding and teleportation just a prototype or the 'only' type?Body: 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.
"
"['quantum-state', 'circuit-construction', 'superposition']"," Title: How can I invert the least significant bit of a certain term of a superposed state?Body: 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)?$$
"
"['algorithm', 'simons-algorithm', 'hidden-subgroup-problem']"," Title: What is the hidden subgroup in Simon's problem?Body: 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?
"
"['quantum-state', 'algorithm', 'machine-learning', 'swap-test']"," Title: Swap Test for vector difference - how are different sized inputs combined?Body: 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.$$
"
"['quantum-gate', 'circuit-construction', 'oracles']"," Title: Implementing an oracleBody: 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.
"
"['photonics', 'quantum-memory']"," Title: How does quantum memory work using atoms?Body: 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?
"
"['textbook-and-exercises', 'density-matrix', 'information-theory', 'entropy']"," Title: How do I calculate the von Neumann entropy of a pure one-qubit density matrix?Body: 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?
"
"['programming', 'qiskit']"," Title: Import from qiskit-aqua errorBody: 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
"
"['algorithm', 'circuit-construction']"," Title: Estimation of Z in the quantum Euclidean algorithmBody: 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?
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'measurement', 'teleportation']"," Title: How to complete this teleportation circuit? How to create a copy of $|\psi〉$?Body:
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?
"
"['algorithm', 'speedup']"," Title: Quantum speedup without entanglementBody: Is there an instance of a quantum algorithm that is faster than its classical counterpart, but doesn't use entanglement, only superposition?
"
"['measurement', 'quantum-operation', 'noise']"," Title: Application of improved compatibilityBody: 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?
"
"['quantum-gate', 'quantum-state', 'mathematics']"," Title: How to understand the operators for watermarking schemes?Body: 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.
"
"['quantum-state', 'mathematics', 'terminology']"," Title: Meaning of ""diagonal to the computational basis""Body: 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.
"
"['resource-request', 'quantum-operation', 'decoherence']"," Title: Clarifying the relationship of the probabilities of depolarizing channel and relaxation/dephasing timesBody: 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.
"
"['ibm-q-experience', 'ibm']"," Title: What is maximum circuit depth and size IBM Q5 and Q16 could handle?Body: 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.
"
"['quantum-gate', 'mathematics', 'gate-synthesis', 'matrix-representation']"," Title: How are multi-qubit gates extended into larger registers?Body: 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.
"
"['algorithm', 'circuit-construction', 'deutsch-jozsa-algorithm']"," Title: Deutsch–Jozsa algorithm: why is $f$ constant?Body: 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?
"
"['quantum-gate', 'quantum-state']"," Title: How do I embed classical data into qubits?Body: 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?
"
"['quantum-gate', 'quirk']"," Title: Explanation of the function of the circuitBody: 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.
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: Summing states of two qubit registersBody: 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?
"
"['algorithm', 'nielsen-and-chuang', 'phase-estimation']"," Title: Phase estimation algorithm: probability bound of obtaining $m$Body: 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}$
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How to calculate circuit depth properly?Body: Is the circuit depth the longest sequence of gates applied on one of the qubits?
Or is it something more complicated?
"
"['programming', 'circuit-construction', 'optimization']"," Title: Evolving a quantum circuit using a genetic algorithmBody: 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
"
"['quantum-gate', 'circuit-construction', 'grovers-algorithm', 'nielsen-and-chuang']"," Title: N&C quantum circuit for Grover's algorithmBody: 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).
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'quantum-circuit']"," Title: Understanding quantum circuit diagrams: a circuit that compares two states $|YX\rangle$ and $|AB\rangle$Body: 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:
"
"['quantum-gate', 'algorithm', 'unitarity', 'deutsch-jozsa-algorithm', 'oracles']"," Title: How to prove that the query oracle is unitary?Body: 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?
"
"['mathematics', 'cryptography', 'teleportation']"," Title: Quantum teleportation of a state, from one of two basesBody: 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.
"
"['algorithm', 'grovers-algorithm', 'nielsen-and-chuang']"," Title: Proof of the optimality of Grover's algorithmBody: 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:
- Why does it have to be shown that $D_k$ is limited?
- Why must it be shown that $D_k$ does not grow faster than $O(k^2)$? What
is the idea behind it?
- 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?
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.
"
"['grovers-algorithm', 'nielsen-and-chuang']"," Title: In what sense do repeated applications of Grover's operator rotate the state closer to the target?Body: 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.
"
"['algorithm', 'grovers-algorithm', 'deutsch-jozsa-algorithm', 'oracles']"," Title: How does an oracle function in Grover's algorithm actually work?Body: 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?
"
['chemistry']," Title: What are the rules that map the second-quantized fermionic Hamiltonian into spin-form in OpenFermion?Body: 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?
"
"['quantum-operation', 'kraus-representation']"," Title: What is the ""complementary map"" of a channel with given Kraus decomposition?Body: 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.
"
"['algorithm', 'resource-request', 'grovers-algorithm', 'deutsch-jozsa-algorithm', 'research']"," Title: What can be a mini research project based on Grover's algorithm or the Deutsch Jozsa algorithm?Body: 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!
"
"['algorithm', 'resource-request', 'complexity-theory', 'research']"," Title: Is there a list of accessible open problems in quantum computing from a theoretical computer science perspective?Body: (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).
"
"['quantum-gate', 'gate-synthesis']"," Title: Implementing these $N×N$ matrices on $\log N$ qubitsBody: 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!
"
"['algorithm', 'grovers-algorithm', 'cryptography', 'applications']"," Title: Consequences of Grover's algorithmBody: 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.
"
"['quantum-operation', 'kraus-representation']"," Title: How does the vectorization map relate to the Choi and Kraus representations of a channel?Body: 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?
"
['quantum-operation']," Title: What is the ""Stinespring Dilation""?Body: 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?
"
"['quantum-gate', 'error-correction', 'annealing', 'models']"," Title: Is there an inherent difference in need for error correction between quantum annealing and gate based methods?Body: 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?
"
"['resource-request', 'measurement', 'simulation']"," Title: Why can't a quantum computer strongly simulate itself?Body: 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?
"
"['physical-qubit', 'ibm-q-experience', 'ibm']"," Title: How many physical qubits are used when I run a program on a IBM Q computer?Body: 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?
"
"['algorithm', 'complexity-theory', 'applications']"," Title: Will quantum computers be able to solve the game of chess?Body: 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.
"
"['algorithm', 'grovers-algorithm', 'cryptography']"," Title: Grover's algorithm: number of searches required to find a keyBody: 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} $ ...
"
"['quantum-operation', 'quantum-fisher-information', 'quantum-metrology']"," Title: Why is the quantum Fisher information $J_f=[f(\frac43-f)]^{-1}$ for maximally entangled qubit pairs?Body: 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.
"
"['quantum-gate', 'classical-computing', 'unitarity']"," Title: Implementing ""Classical AND Gate"" and ""Classical OR Gate"" with a quantum circuitBody: 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!
"
"['measurement', 'experiment', 'topological-quantum-computing', 'anyons']"," Title: Measuring Ising anyons: What is a fusion measurement?Body: 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.
- 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$?
- How can we experimentally measure the energy of the system and how do we know if it corresponds to $|0\rangle$ or $|1\rangle$?
- 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)
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.
"
"['algorithm', 'optimization']"," Title: Genetic algorithm does not converge to exact solutionBody: 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:
- 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.
- If it's not a controlled gate, it can change the type of gate or introduce a control.
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.
"
"['quantum-operation', 'information-theory', 'entropy', 'channel-capacity']"," Title: Understanding classical vs. quantum channel capacitiesBody: 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?
"
"['entanglement', 'entanglement-witness']"," Title: How is the expression for the optimal entanglement witness derived?Body: 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 ||} $$
- How was this expression arrived at?
- Is this true only for the separable set, or any convex set?
"
"['measurement', 'quantum-operation', 'povm', 'locc-operation']"," Title: What is an example of a measurement that is LOCC but not separable?Body: 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.
"
"['physical-qubit', 'superconducting-quantum-computing']"," Title: What is the charging energy in relation to a superconducting transmon?Body: 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?
"
"['programming', 'd-wave', 'annealing', 'pyqubo', 'qubo']"," Title: How to calculate the $r^{\text{th}}$ digit of $\sum ^{j−1}_{p=i}d^p_{\pm k}$ using PyQUBO?Body: 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?
"
"['algorithm', 'complexity-theory', 'bqp', 'forrelation']"," Title: Is there a BQP algorithm for each level of the polynomial hierarchy PH?Body: 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?
"
"['quantum-state', 'circuit-construction']"," Title: How to construct a quantum circuit for the following state transformation?Body:
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.
"
"['algorithm', 'quantum-state', 'mathematics']"," Title: Hidden shift problem as a benchmarking functionBody: 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$.
"
"['algorithm', 'nielsen-and-chuang']"," Title: Quantum addressing schemeBody: 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?
"
"['algorithm', 'mathematics', 'shors-algorithm']"," Title: Reason for evaluating $a^x \bmod N$ from $x = 0$ to $N^2$Body: 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?
"
"['error-correction', 'surface-code', 'toric-code']"," Title: Is the quantum Singleton bound compatible with the Toric Code?Body: 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?
"
"['algorithm', 'hhl-algorithm']"," Title: What are applications of HHL's ""simple example"" to determine similar stable states of different quantum processes?Body: 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?
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: Are X-state separability and PPT- probabilities the same for the two-qubit, qubit-qutrit, two-qutrit, etc. states?Body: 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.
"
"['quantum-gate', 'quantum-state']"," Title: What are the individual probabilities after √SWAP gate?Body: 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$?
"
"['programming', 'qiskit']"," Title: Using latest (GitHub) version of Qiskit as Python libraryBody: 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.
"
"['programming', 'qiskit']"," Title: Qiskit DAG circuit - print information about individual gate/node by numberBody: 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?
"
"['programming', 'qiskit']"," Title: (name of gate) is not in the list of basis operationsBody: 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, """")
])
])
])
}
"
"['algorithm', 'quantum-fourier-transform']"," Title: Quantum transformation equivalent to Discrete Wavelet transformBody: 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?
"
"['programming', 'q#']"," Title: How do I do printf debugging in Q# in a convenient way?Body: 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?
"
"['algorithm', 'quantum-gate', 'shors-algorithm']"," Title: Are there any other published quantum factoring algorithms that are simpler or more efficient than Shor’s?Body: 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?
"
"['programming', 'qiskit']"," Title: Exception encountered while running quantum-enhanced support vector machinesBody: 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.
"
"['algorithm', 'quantum-gate']"," Title: Calculating entries of unitary transformationBody: 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.
"
"['quantum-gate', 'universal-gates']"," Title: How to prove universality for a set of gates?Body: Which of the following sets of gates are universal for quantum computation?
- {H, T, CPHASE}
- {H, T, SWAP}
And how do we prove it?
"
"['programming', 'qiskit', 'decoherence', 'ibm']"," Title: Graphing the decoherence of qubits being used to perform an algorithmBody: 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?
"
"['entanglement', 'density-matrix', 'qutrit', 'state-distillation', 'ppt-criterion']"," Title: What proportions of certain sets of PPT-two-retrit states are bound entangled or separable?Body: 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.
"
"['quantum-gate', 'tensor-product']"," Title: Quantum Toffoli gate equationBody: 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?
"
"['programming', 'cirq']"," Title: How do you start a simulation with a random initial state in Cirq?Body: How do you create a random initial state by modifying the $2^{n}$ vector amplitudes instead of starting every simulation at $|0000...000\rangle$?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: Experiment runtime on IBMQBody: 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
"
"['algorithm', 'grovers-algorithm']"," Title: Prove that the operator $H U_{0^\perp}H$ can be expressed as $2|\psi\rangle\langle\psi|-I$Body: 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.
"
"['algorithm', 'grovers-algorithm', 'cryptography']"," Title: Grover's algorithm – DES circuit as oracle?Body: 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!
"
"['quantum-state', 'tensor-product', 'notation']"," Title: Notation for two qubit composite product stateBody: 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?
"
"['quantum-state', 'algorithm', 'teleportation']"," Title: Understanding this description of teleportationBody: 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:
- 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.
- What does the superscript 0 on the operators refer to?
- 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.
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.
"
"['quantum-gate', 'quantum-state']"," Title: Preparing odd integers using quantum computationBody: 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
"
"['algorithm', 'research', 'quantum-walks']"," Title: What can be some bachelor thesis ideas in quantum random walks?Body: 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?
"
"['quantum-gate', 'circuit-construction', 'matrix-representation']"," Title: Quantum addition and modulo operation using gatesBody: 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?
"
"['mathematics', 'fourier-sampling', 'hidden-subgroup-problem']"," Title: Burnside Decomposition in Kuperberg's Hidden ShiftBody: 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?
"
"['algorithm', 'quantum-gate', 'qiskit', 'hhl-algorithm']"," Title: Controlled unitary from the HHL algorithm – practical implementation using QiskitBody: 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?
"
"['quantum-gate', 'circuit-construction']"," Title: Identifying a matrix with the fundamental quantum logic gatesBody: 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?
"
"['algorithm', 'quantum-gate', 'grovers-algorithm', 'cryptography']"," Title: Reversible crypto systems for use in the Grover's algorithmBody: 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?
"
"['quantum-state', 'circuit-construction', 'superposition']"," Title: How to superpose two composite qubit states?Body: 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$ ?
"
"['quantum-state', 'entanglement', 'density-matrix', 'teleportation', 'noise']"," Title: Quantum teleportation with ""noisy"" entangled stateBody: 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.
"
"['algorithm', 'mathematics', 'measurement', 'deutsch-jozsa-algorithm']"," Title: Correct way of expressing a measurement in a different computational basisBody: 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$?
- 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}$.
- 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}$.
"
"['entanglement', 'measurement', 'density-matrix']"," Title: How does the probability of measurement turn out to be negative?Body:
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?
"
"['entanglement', 'density-matrix', 'bell-basis', 'photonics', 'ppt-criterion']"," Title: What are the ranges of the four $q$ parameters in the magic simplex of Bell states formula?Body: 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?
"
"['programming', 'circuit-construction', 'machine-learning']"," Title: How to build a quantum circuit representing the Ising Model?Body: 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.
"
"['mathematics', 'nielsen-and-chuang', 'phase-estimation']"," Title: Eigenstate of unitary operator used for Order-FindingBody: 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?
"
['quantum-state']," Title: Associating quantum states with decimal numbersBody: 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?
"
"['d-wave', 'annealing', 'optimization', 'graph-states']"," Title: What does it mean to have 2000 qubits and 6016 couplers?Body: 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)?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'density-matrix']"," Title: How to show a density matrix is in a pure/mixed state?Body: 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 ?
"
"['quantum-state', 'entanglement', 'ppt-criterion']"," Title: Finding separable decompositions of bipartite X-states using the methodology of Li and QiaoBody: 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?)
"
"['algorithm', 'bernstein-vazirani-algorithm']"," Title: Is the Bernstein-Vazirani algorithm dependent on the specific behavior of the oracle?Body: My understanding of the Bernstein-Vazirani algorithm is as follows:
- 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})$$
- We run each qubit through a Hadamard gate first, then through the oracle:
- 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.
- 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!
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:
"
"['circuit-construction', 'gate-synthesis']"," Title: How is it possible to implement unitary operator when its size is exponential in inputs?Body: 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?
"
"['programming', 'qiskit', 'measurement', 'grovers-algorithm']"," Title: Grover's algorithm returns skewed probability distributionBody: 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:
- 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.
- I have inadvertently entangled the qubits in such a way that the result is affected.
Any insight into this would be greatly appreciated.
"
"['programming', 'bloch-sphere', 'qutip']"," Title: Drawing tangent vectors to the Bloch sphere with qutipBody: 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?
"
"['quantum-state', 'mathematics']"," Title: Encoding bosonic degrees of freedomBody: 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.
"
"['quantum-gate', 'tensor-product']"," Title: What is the tensorial representation of the quantum swap gate?Body: 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?
"
"['algorithm', 'hhl-algorithm']"," Title: Does HHL implementation require a priori eigendecomposition?Body: 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?
"
"['algorithm', 'programming', 'grovers-algorithm', 'q#']"," Title: Counting in Q#: number of solutionsBody: 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.
"
['quantum-state']," Title: Quantum representation of cubeBody: 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?
"
['quantum-operation']," Title: What's the difference between Kraus operators and measurement operators?Body: 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)
"
"['quantum-gate', 'quantum-state']"," Title: Why do we need reversibility?Body: 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.
"
"['physical-realization', 'classical-computing', 'ibm']"," Title: What is the difference in computational power between qubit and bit (transistor)?Body: 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?
"
"['quantum-gate', 'quantum-operation']"," Title: How should we interpret these quantum logic gates as physical observables?Body: 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?
"
"['circuit-construction', 'complexity-theory', 'classical-computing']"," Title: Is it possible to construct an equivalent quantum circuit from a CORDIC-based digital circuit?Body: 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:
- 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?
- 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?
- How do we prove that the time complexities of the digital and quantum counterparts are equal (or nearly equal)?
"
"['algorithm', 'amplitude-amplification']"," Title: Amplitude Estimation Algorithm — Lambda (Q) OperatorBody: 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?
"
"['quantum-gate', 'matrix-representation']"," Title: Error in showing $\operatorname{CPHASE}_{12}=\operatorname{CPHASE}_{21}$ in the matrix representationBody: 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?
"
"['quantum-gate', 'notation']"," Title: What does it mean to express a gate in Dirac notation?Body: 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$$
"
"['notation', 'bloch-sphere']"," Title: What is the meaning of writing a state in its Bloch representation?Body: 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?
"
"['quantum-gate', 'mathematics', 'matrix-representation']"," Title: Square root of CNOT and spectral decomposition of the Hadamard gateBody: 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?
"
"['quantum-state', 'circuit-construction']"," Title: Tips and tricks for constructing circuits to generate arbitrary quantum statesBody: 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?
"
"['programming', 'qasm2circ']"," Title: How to draw a multiple qubit controlled NOT gate using qasm2circ?Body: 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?
"
"['quantum-gate', 'mathematics', 'tensor-product', 'notation']"," Title: Writing the transformation matrix for the following in terms of Kronecker products of elementary 2-qubit gatesBody: 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?
"
"['ibm-q-experience', 'quantum-operation', 'noise']"," Title: Implementing a depolarizing channel for 2 qubits on IBM QBody: 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$$
"
"['mathematics', 'density-matrix', 'bloch-sphere', 'state-space-geometry']"," Title: Why is the boundary of the set of states in the generalised Bloch representation comprised of singular matrices?Body: 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:
- Geometry of qutrit and Gell-Mann matrices
- What is the dimension of the space of all pure qudit states of dimension $D$?
"
['algorithm']," Title: Calculating the expectation value of a unitary operator on a quantum computerBody: 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:
- quantum phase estimation algorithm;
- Hadamard test.
Are there more efficient techniques to do that?
"
"['quantum-gate', 'quantum-state', 'gate-synthesis', 'ibm-q-experience']"," Title: Making a maximally mixed 2-qubit state in the IBM QBody: 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?
"
"['quantum-state', 'entanglement']"," Title: Is $ |x,y,z\oplus f(x,y)\rangle$ entangled?Body: 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$ ?
"
"['quantum-state', 'ibm-q-experience']"," Title: What interesting properties can I measure with a 1 qubit state?Body: 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).
"
"['measurement', 'simulation', 'ibm-q-experience']"," Title: Interpreting results from IBM's processor vs. simulatorBody: 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.
"
"['measurement', 'ibm-q-experience', 'correlations', 'bell-experiment']"," Title: How to measure a Bell inequality violation in IBM Q?Body: 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?
"
"['algorithm', 'grovers-algorithm', 'cryptography', 'nielsen-and-chuang']"," Title: Grover's algorithm and RSA from NielsenBody: 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?
"
"['quantum-gate', 'matrix-representation']"," Title: How to interpret the matrix representation of a quantum gate?Body: 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?
"
"['entanglement', 'density-matrix', 'entanglement-witness']"," Title: Is there a two-qudit Choi entanglement witness $W^{(+)}$?Body: 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.
"
"['simulation', 'topological-quantum-computing', 'anyons', 'quantum-advantage']"," Title: Simulating quantum computers using anyon braidingBody: 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?
"
"['mathematics', 'information-theory', 'entropy']"," Title: Can an isometry leave entropy invariant?Body: 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?
"
"['algorithm', 'quantum-state', 'classical-computing']"," Title: Large size of matrices for little outcomeBody: 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?
"
"['quantum-gate', 'zx-calculus']"," Title: Controlled Hadamard gate in ZX-calculusBody: 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?
"
"['quantum-state', 'circuit-construction', 'information-theory', 'fidelity']"," Title: Quantum circuit for computing fidelityBody: 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?
"
"['resource-request', 'notation']"," Title: Resources for quantum computing which do not use Dirac notationBody: 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.)?
"
"['entanglement', 'notation']"," Title: What does ""bipartite"" mean?Body: 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!
"
"['entanglement', 'resource-request', 'complexity-theory']"," Title: Complexity analysis of separability in the multipartite caseBody: 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.
"
"['measurement', 'deutsch-jozsa-algorithm', 'bernstein-vazirani-algorithm']"," Title: Deutsch-Jozsa algorithm as a generalization of Bernstein-VaziraniBody: 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?
"
"['quantum-state', 'programming', 'qiskit', 'initialization']"," Title: Default value for a state created by QuantumRegisterBody: 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$?
"
"['quantum-gate', 'quantum-state']"," Title: CNOT's control qubit preceded by Hadamard: Why is sqrt also applied to target qubit?Body: 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}$?
"
"['quantum-gate', 'circuit-construction', 'complexity-theory']"," Title: Cost of implementing Boolean function quantumly?Body: 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$?
"
"['entanglement', 'information-theory', 'entropy']"," Title: Superoperator cannot increase relative entropyBody: 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?
"
"['quantum-gate', 'programming', 'qiskit']"," Title: How does the cnx gate work in Qiskit (Python)?Body: Could somebody explain the cnx operator, and how it operates on its qubit parameters to flip the target qubit in Qiskit (Python)?
"
"['entanglement', 'physical-realization']"," Title: Is generating usable entanglement difficult?Body: 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.
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'information-theory', 'entropy']"," Title: In the proof of the joint entropy theorem, why are $p_i\lambda_i^j$ the eigenvalues?Body: 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.
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Order of controls and targets of cnx gates in Qiskit (Python)Body: 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?
"
"['quantum-gate', 'qutrit']"," Title: Defining standard qubit gates for qutritsBody: 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.
"
"['quantum-turing-machine', 'church-turing-thesis']"," Title: What precisely is the quantum extended Church-Turing thesis?Body: 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
- What precisely is the statement of the quantum extended Church-Turing thesis? Original references appreciated.
- 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?
- 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?
†: "Every finitely realizable physical system can be perfectly simulated by a universal model computing machine operating by finite means."
"
"['decoherence', 'superconducting-quantum-computing']"," Title: Is the theory of decoherence general or specific to the physical implementation?Body: 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?
"
"['density-matrix', 'quantum-operation']"," Title: What is the relevance of preservation of trace in completely postive trace preserving (CPTP) maps?Body: Why is the trace preserving part necessary? Is it not enough if it can take all matrices to matrices of trace 1?
"
"['quantum-operation', 'physical-realization', 'key-distribution', 'bb84']"," Title: Counting channel uses of the lossy bosonic channel or definition of channel usesBody: 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?
"
"['error-correction', 'decoherence']"," Title: How is the decoherence rate connected to the error rate?Body: 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?
"
"['algorithm', 'quantum-state', 'hamiltonian-simulation', 'initialization']"," Title: How to pick number of simulation qubits for finding eigenvalue of fermionic Hamiltonian?Body: 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?
"
"['quantum-state', 'entanglement', 'cryptography']"," Title: Does a 5-partite state with these entanglement properties exist?Body: 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.
"
"['quantum-gate', 'gate-synthesis']"," Title: Minimal quantum OR circuitBody: 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?
"
"['error-correction', 'physical-realization', 'randomised-benchmarking', 'quantum-volume']"," Title: What quantum volume is needed to represent a single logical qubit?Body: 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).
"
"['mathematics', 'nielsen-and-chuang', 'phase-estimation']"," Title: Method to find $r$ in the case when $r'$ returned by the continued fractions procedure is a factor of $r$Body: 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?
"
"['quantum-operation', 'information-theory', 'entropy']"," Title: Prove that quantum channels cannot increase the Holevo information of an ensembleBody: 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?
"
"['quantum-operation', 'noise', 'information-theory', 'entropy']"," Title: Degradable channels and their quantum capacityBody: 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:
- What are degradable channels?
- 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.
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.
"
"['algorithm', 'hhl-algorithm']"," Title: Is HHL executed in a single run? If yes, how do they carry out controlled rotation without knowing eigenvalues?Body: 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?
"
"['quantum-gate', 'gate-synthesis']"," Title: Transferring classical OR gate in a quantum gateBody: 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?
"
"['quantum-gate', 'gate-synthesis', 'nielsen-and-chuang']"," Title: Nielsen and Chuang's proof for 'approximating arbitrary unitary gates is generically hard'Body: 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?
"
"['entanglement', 'partial-transpose', 'entanglement-witness']"," Title: Are entanglement witnesses of this form optimal?Body: 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.
"
"['circuit-construction', 'classical-computing']"," Title: Implementing piecewise functions on a quantum computerBody: 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?
"
"['resource-request', 'complexity-theory', 'classical-computing']"," Title: References on quantum arithmetic circuit complexityBody: 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.
"
"['physical-realization', 'experiment', 'ibm']"," Title: IBM's quantum computing capabilities — entangled 18-qubit GHZ states and high coherence timesBody: 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?
"
"['entanglement', 'qudit', 'entanglement-witness']"," Title: Explicit 16⨯16 matrix representations of two-qudit entanglement witnessesBody: 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?
"
"['mathematics', 'nielsen-and-chuang', 'fidelity']"," Title: Proving the inequality $|\mathrm{tr}(AU)|\le \mathrm{tr}|A|$ in Uhlmann's theoremBody: 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?
"
"['quantum-state', 'circuit-construction']"," Title: Implementing conditional operators in a quantum circuitBody: I have 4 states say $|00\rangle, |01\rangle,|10\rangle, |11\rangle$. I want to add the states in a manner such that
- $|a\rangle=|00\rangle\otimes|01\rangle\to |00\rangle\otimes|01\rangle$
and
- $|b\rangle=|10\rangle\otimes|11\rangle\to |10\rangle\otimes|01\rangle$.
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?
"
"['quantum-state', 'error-correction', 'quantum-operation']"," Title: State of a system after the second qubit of a Bell state sent through a bit flip error channelBody: 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?
"
"['entanglement', 'quantum-operation', 'physical-realization', 'entanglement-witness', 'ppt-criterion']"," Title: How are witness operators physically implemented?Body: 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)$.
- Is this the way it is done?
- 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.)
"
"['mathematics', 'quantum-operation', 'kraus-representation']"," Title: Direct derivation of the Kraus representation from the natural representation, using SVDBody: $\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)?
"
"['mathematics', 'quantum-operation']"," Title: How does a map being ""only"" positive reflect on its Choi representation?Body: 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)?
"
['fidelity']," Title: Are there disadvantages in using the inner product between states instead of the fidelity?Body: 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.
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Understanding the oracle in Deutsch's algorithmBody: 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.
"
"['algorithm', 'grovers-algorithm']"," Title: Grover search with single query to $f(x)$ and multiple queries to $f(x) = a$Body: 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) ?
"
"['mathematics', 'resource-request']"," Title: How to understand the Haar measure from a quantum information perspective?Body: 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?
"
"['quantum-gate', 'matrix-representation']"," Title: Matrix representation of multiple qubit gates (Hadamard transform on single wire)Body: 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?
"
"['quantum-state', 'mathematics', 'trace-distance', 'classical-quantum']"," Title: Trace distance of two classical-quantum statesBody: 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.
"
"['quantum-gate', 'circuit-construction']"," Title: Implementing a controlled sum operationBody: 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?
"
"['error-correction', 'measurement']"," Title: Shor 9 qubit code — how are the observables measured and eigenvalues obtained during syndrome measurement?Body: 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:
- How does one measure the observables?
- How are the eigenvalues obtained?
"
"['programming', 'qiskit', 'error-correction', 'ibm-q-experience']"," Title: How does measurement calibration work?Body: 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).
"
"['measurement', 'quantum-operation', 'povm']"," Title: Does the dilation in Naimark's theorem produce a state?Body: 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?
"
"['quantum-gate', 'mathematics']"," Title: What is the spectral decomposition of the Pauli $X$ gate?Body: 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?
"
"['quantum-state', 'programming', 'qutip']"," Title: How to prepare a statistical mixture of $|0,0\rangle $ and $ |1,1\rangle $ in QuTiP?Body: 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 $?
"
"['physical-realization', 'architecture', 'physical-qubit', 'superconducting-quantum-computing']"," Title: How is a physical qubit measured and how is the result interpreted?Body: 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?
"
"['programming', 'circuit-construction']"," Title: How do I translate a quantum circuit for computing x + y mod 8 into a program?Body:
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.
"
"['algorithm', 'circuit-construction']"," Title: Circuit construction for execution of conditional statements using least significant bitBody: 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?
"
['complexity-theory']," Title: CTCs and information time travel — what non-trivial insights do they lead to?Body: 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:
- In brief, what really are closed timelike curves?
- 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?†
- What other non-trivial insights have the study of CTCs provided us in the context of quantum information?
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.
"
"['quantum-gate', 'matrix-representation']"," Title: What applications does the quantum gate [(i,1),(1,i)] have?Body: 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?
"
"['algorithm', 'classical-computing', 'quantum-advantage']"," Title: What exactly makes quantum computers faster than classical computers?Body: What feature of a quantum algorithm makes it better than its classical counterpart? Are quantum computers faster than classical ones in all respects?
"
"['algorithm', 'qiskit', 'ibm-q-experience']"," Title: IBM QISKit: creating a variational algorithm from zeroBody: 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!
"
"['resource-request', 'simulation', 'bloch-sphere']"," Title: Is there any online Bloch sphere simulator?Body: 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). :)
"
"['entanglement', 'mathematics', 'quantum-operation', 'partial-transpose']"," Title: Structural Physical Approximation of Partial TransposeBody: 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.
"
"['algorithm', 'quantum-fourier-transform', 'phase-estimation']"," Title: Phase estimation error analysisBody: 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?
"
['quantum-gate']," Title: Why does a quantum circuit consist of simple quantum gates which act on at most a fixed number of qubits?Body: 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?"".
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'notation']"," Title: Circuit construction and Dirac notation of the following operationBody: 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$
"
"['quantum-gate', 'qiskit', 'gate-synthesis']"," Title: Transform matrix into a combination of simple quantum gatesBody: 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}$$
"
"['mathematics', 'quantum-advantage', 'boson-sampling', 'random-quantum-circuit']"," Title: What is the HOG test and how would it help proving quantum supremacy?Body: 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
"
"['physical-realization', 'superconducting-quantum-computing', 'photonics', 'optical-quantum-computing', 'ion-trap-quantum-computing']"," Title: What are the main obstacles to overcome to build silicon-photonic quantum computers?Body: 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.
"
"['entanglement', 'density-matrix', 'concurrence']"," Title: Why do we use complex-conjugate instead of complex-conjugate-transpose when calculating the concurrence?Body: 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?
"
"['circuit-construction', 'machine-learning', 'neural-network']"," Title: How to encode MNIST data set on a quantum circuit to study supervised learning with QNN?Body: 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)
"
"['quantum-gate', 'quantum-state']"," Title: Permutation of initialized statesBody: 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$.
"
"['quantum-state', 'notation']"," Title: Which is the correct depiction of a qubit before it collapses?Body: 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!
"
['resource-request']," Title: What are the basics needed to learn quantum computing?Body: 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.
"
['ibm-q-experience']," Title: How do the credit points work in IBM quantum experience?Body: 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.
"
"['programming', 'qiskit', 'resource-request', 'ibm-q-experience']"," Title: How to quickly calculate the custom U3 gate parameters $\theta, \phi$ and $\lambda$ for any unitary?Body: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: Success probability in Grover's algorithm where there are multiple targetsBody: 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$$
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'nisq']"," Title: Most efficient way for general state generationBody: 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?
"
['circuit-construction']," Title: Can someone walk us through Nielsen's proof on a circuit for quantum teleportation?Body: 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?
"
"['quantum-gate', 'algorithm', 'grovers-algorithm', 'quantum-circuit']"," Title: Understanding the implementation of Grover's diffusion operator using the oracle qubitBody: 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?
"
"['quantum-gate', 'tensor-product', 'notation']"," Title: Kronecker notation of an operatorBody: 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?
"
"['resource-request', 'architecture', 'ibm-q-experience', 'ibm']"," Title: IBM Q devices' hardware/resource constraintsBody: 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.
"
"['quantum-state', 'machine-learning', 'superposition']"," Title: Reinforcement learning with a quantum agentBody: 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?
"
"['algorithm', 'hamiltonian-simulation']"," Title: Implement a Hamiltonian in O(n) - exercise questionBody: 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.
"
"['error-correction', 'quantum-operation', 'gottesman-knill']"," Title: Twirling Quantum Channels: Pauli and Clifford TwirlingBody: 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.
"
"['quantum-gate', 'quantum-state', 'notation', 'tensor-product']"," Title: Writing the notation when gates act on non successive registersBody: 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$?
"
"['contextuality', 'nonclassicality']"," Title: How does quantum contextuality relate to mutually commuting observables?Body: 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?
"
"['physical-realization', 'architecture', 'physical-qubit', 'optical-quantum-computing']"," Title: Physical qubit of optical quantum computerBody: 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?
"
['quantum-gate']," Title: Are these notations for the CCNOT gate with different controls correct?Body: Following this answer by @DaftWullie, I give what I think of different cases of the CC-NOT gate:
- $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$.
- $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$.
- $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$.
- $I\otimes I\otimes I+ P_1\otimes P_1\otimes(U-I)$ is the CC-NOT operator when both controls are $1$.
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$.
"
"['quantum-state', 'circuit-construction']"," Title: Quantum operation involving permutationBody: 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?
"
"['quantum-state', 'entanglement']"," Title: What happens when an operator is applied only to some bits of a mixed state?Body: 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)$
"
"['information-theory', 'entropy']"," Title: What property ensures that von Neumann entropy is conserved?Body: 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?
"
"['quantum-gate', 'qiskit']"," Title: How to construct a CCY gate in QiskitBody: 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.
"
"['entanglement', 'bell-experiment']"," Title: Simultaneous eigenstate of commuting observables and their tensor productBody: 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.
"
"['programming', 'machine-learning']"," Title: How to plot decision boundary with support vectors when running quantum SVM algorithm?Body: 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.
"
"['quantum-state', 'physical-qubit', 'pauli-gates']"," Title: How do physical implementations of Z gate selectively affect $\lvert1\rangle $ basis vector?Body: 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.
"
"['quantum-state', 'physical-qubit', 'tensor-product']"," Title: How to interpret $-\rvert1\rangle \otimes \rvert1\rangle = -\rvert11\rangle$?Body: 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?
"
"['algorithm', 'measurement', 'simulation']"," Title: How to determine the minimum number of experiments needed to compute m-many k-local Pauli expectations?Body: 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:
- 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)
- How do I find the elements of the maximally reduced set of measurement bases that accomplish (1).
Example a:
$$
O = Z_1 + Z_2 + Z_3 + Z_1 Z_2
$$
- The minimum number of experiments is 1.
- 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.
Example b:
$$
O = X_1 Y_2 + Y_1 X_2 + X_1 X_2 + Y_1 Y_2
$$
- The minimum number of experiments is 4.
- 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.
So, given an arbitrary $O$ how do I find the minimum number of experiments and the corresponding maximally reduced set of measurements
"
['entanglement']," Title: Observing that some action has happened in an entanglement scenarioBody: 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.
"
"['algorithm', 'complexity-theory']"," Title: Best query and memory complexity for iterated functionBody: 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)$:
- Can we do better than $R \cdot T$ queries while maintaining negligible quantum memory complexity?
- Can we do better than $R \cdot T$ queries with additional quantum memory? If so, then how much? Can we do less than $T$?
"
"['algorithm', 'error-correction']"," Title: Where (in the algorithm) is the logical qubit encoded in Q.E.C?Body: 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 $
"
"['programming', 'qiskit', 'ibm-q-experience', 'machine-learning']"," Title: How to run quantum SVM algorithm from Qiskit in real IBM Quantum Computer using IBMQ?Body: 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
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: Quantum operation in blocksBody: 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.
"
"['algorithm', 'measurement', 'grovers-algorithm', 'oracles']"," Title: Why is the application of an oracle function not a measurement?Body: 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?
"
"['algorithm', 'ibm-q-experience', 'deutsch-jozsa-algorithm']"," Title: Implementing Deutsch's problem on IBM Q composerBody: 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?
"
"['quantum-gate', 'circuit-construction']"," Title: Tensorial notation for this quantum XOR circuitBody: 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.
"
"['quantum-state', 'physical-qubit']"," Title: What ""states"" can a qubit have if it doesn't have values?Body: 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)?
"
"['programming', 'qiskit', 'chemistry']"," Title: Defining qubit operator from scratchBody: 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!
"
"['entanglement', 'partial-trace']"," Title: What are nontrivial examples of $n$-sharable bipartite states?Body: 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?
"
"['error-correction', 'stabilizer-code']"," Title: How to calculate the distance of stabilizer code?Body: 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?
"
"['programming', 'ibm-q-experience', 'qasm']"," Title: How to define custom controlled unitaries in OPENQASM 2.0?Body: 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.
"
"['quantum-gate', 'gate-synthesis']"," Title: How to decompose a controlled unitary $C(U)$ operation where $U$ is a 2-qubit gate?Body: 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.
"
"['quantum-gate', 'ibm-q-experience']"," Title: IBM Q devices scheduling of gates with different durationsBody: 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?
"
"['quantum-gate', 'circuit-construction', 'ibm-q-experience', 'quantum-fourier-transform']"," Title: 2-qubit QFT in IBMQ: controlled phase rotationBody: 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.
"
"['algorithm', 'research']"," Title: Which journals and conferences would be most appropriate for new number-theoretic quantum algorithms?Body: Non-super-slow review process and non-super-slow publication should take precedence.
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: Restoring an initial state after computationBody: 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
- 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
- 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.$$
- 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$.
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 ?
"
"['algorithm', 'grovers-algorithm', 'quantum-advantage']"," Title: Grover algorithm for a database search: where is the quantum advantage?Body: 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?
"
"['programming', 'qiskit', 'fidelity', 'tomography']"," Title: How to calculate the fidelity of a certain gate of a IBMQ device in Qiskit using randomized benchmarking/tomography?Body: 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.
"
"['programming', 'q#', 'qasm']"," Title: How to see the QASM code corresponding to compiled Q# function?Body: 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?
"
"['quantum-state', 'physical-qubit', 'q#']"," Title: Converting a qubit's state to a binary value in Q#Body: 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?
"
"['quantum-state', 'entanglement', 'physical-qubit']"," Title: Can entangled qubits be disentangled without using code or software?Body: 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.
"
"['mathematics', 'bloch-sphere', 'state-space-geometry']"," Title: How are orthogonal sets of pure states arranged in state space?Body: 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?
"
"['quantum-gate', 'qiskit', 'ibm-q-experience']"," Title: How to implement the XY Heisenberg interaction using IBMQ and Qiskit?Body: 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.
"
"['algorithm', 'quantum-state', 'mathematics', 'measurement']"," Title: Understanding a quantum algorithm to estimate inner productsBody: 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.
"
"['quantum-gate', 'pauli-gates']"," Title: Expressing CNOT in the eigenbasis of $X$ (Preskill lecture notes eq. 7.6)Body: 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.
"
"['algorithm', 'quantum-gate', 'qiskit', 'hhl-algorithm']"," Title: How can I express controlled unitary operation in QPE of this implementation of HHL?Body: 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?
"
['physical-qubit']," Title: How much power do quantum computers use based on the number of qubits being allocated?Body: 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.
"
"['qiskit', 'ibm-q-experience']"," Title: Results from looped experiments on IBM Q different than individual experimentsBody: 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?
"
"['mathematics', 'hamiltonian-simulation']"," Title: Clarification of a procedure to compute the product of the exponential of two matricesBody: 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.
"
"['programming', 'qiskit']"," Title: Can't draw figures with Qiskit in Visual StudioBody: 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
"
"['programming', 'qiskit']"," Title: Measurement inconsistency in QiskitBody: 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?
"
"['programming', 'qiskit']"," Title: About the Qiskit draw functionBody: Where does Qiskit put the rendered figure created by circuit.draw(output='mpl')?
"
"['algorithm', 'grovers-algorithm']"," Title: Implementation of Grover's Algorithm (minimum spanning tree)Body: 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.
"
"['quantum-state', 'textbook-and-exercises', 'notation']"," Title: What would be the meaning of an $i$ in a qubit state $i\alpha|0\rangle+\beta|1\rangle$?Body: 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.
"
"['entanglement', 'resource-request', 'error-correction', 'terminology', 'surface-code']"," Title: What is the definition of Bell state on a n-qubit system?Body: 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!
"
"['error-correction', 'nielsen-and-chuang', 'projection-operator']"," Title: Error syndromes and recovery procedure in bit flip codeBody: 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.)
"
['quantum-state']," Title: Question on state distinguishabilityBody: 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?
"
"['circuit-construction', 'superposition']"," Title: Summation of amplitudesBody: 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?
"
"['circuit-construction', 'resource-request', 'chemistry', 'many-body-systems']"," Title: Primer for learning about quantum circuits simulating systemsBody: 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!
"
"['circuit-construction', 'gate-synthesis']"," Title: Controlled controlled adder gates involvedBody: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: Grover's diffusion on subset of input spaceBody: 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})$?
"
"['algorithm', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Why should we use inverse QFT instead of QFT in Shor's algorithm?Body: 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.
"
"['optimization', 'adiabatic-model', 'spin-glasses']"," Title: Is there a general method of expressing optimization problem as a Hamiltonian?Body: 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?
"
"['quantum-state', 'adiabatic-model', 'optimization']"," Title: How to tell if the ground states of two Hamiltonians are solutions of the same optimization problem?Body: 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)?
"
"['quantum-state', 'density-matrix']"," Title: How can I write the maximally mixed state on m qubits as a linear combination of basis vectors?Body: 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}$?
"
['ibm-q-experience']," Title: Visualizer error in IBM Q Experience BetaBody: 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.
"
"['quantum-state', 'ibm-q-experience', 'projection-operator']"," Title: Weeding out qubit states with leftmost qubit as 1Body: 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?
"
"['algorithm', 'circuit-construction', 'teleportation']"," Title: Quantum gate teleportation T gateBody: 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.
"
"['quantum-gate', 'circuit-construction', 'quantum-fourier-transform']"," Title: Quantum Fourier Transform without SWAPsBody: 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:
- 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...
- 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?
"
['ibm-q-experience']," Title: Back End for Reset GateBody: 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
"
"['quantum-state', 'measurement']"," Title: What happens if I measure only the first qubit of a Bell state?Body: 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?
"
"['superposition', 'stabilizer-state']"," Title: Deriving a state vector from a stabilizer state's generatorsBody: 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.
"
"['density-matrix', 'decoherence']"," Title: Quantum state where phase information is unknownBody: 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?
"
"['quantum-gate', 'circuit-construction']"," Title: Sequential circuit using quantum gatesBody: 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?
"
"['algorithm', 'circuit-construction', 'resource-request', 'shors-algorithm']"," Title: Can anybody explain or suggest a good reference on how to make a modular exponentiation circuit for N=15 with any coprime base?Body: 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.
"
"['quantum-gate', 'matrix-representation', 'tensor-product']"," Title: How do I write a tensor product of conditional gates in matrix form?Body: 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.
"
"['algorithm', 'hhl-algorithm']"," Title: Clarification of the ""Calculations"" section of the (HHL09) paperBody: 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:
- 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$?
- 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?
- 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$.
I would be happy to edit/add any information that can help decipher this. Thanks
"
['quantum-state']," Title: What does ""an $n$-qubit array can represent $2^n$ possible array elements"" mean?Body: 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?
"
"['programming', 'simulation', 'bloch-sphere', 'qutip', 'open-quantum-systems']"," Title: Plotting Bloch sphere in QuTiPBody: 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?
"
"['phase-estimation', 'phase-kickback']"," Title: Obtaining phases of all basis statesBody: 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.
"
"['programming', 'grovers-algorithm']"," Title: Grover search for basis states with complex coefficents and multiple marked statesBody: 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
"
"['information-theory', 'entropy']"," Title: What is Landauer’s principle?Body: 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?
"
['amplitude-amplification']," Title: Amplitude suppressionBody: 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?
"
"['quantum-state', 'entanglement', 'measurement']"," Title: Quantum secret Sharing using GHZ state paperBody: 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
- 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
- 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.
- 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.
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}$$
"
"['resource-request', 'research']"," Title: Quantum Computing Project InquiryBody: 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.
"
"['programming', 'quantum-gate']"," Title: Perform quantum gate operations using state vectors and matricesBody: 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!
"
"['measurement', 'nielsen-and-chuang', 'quantum-operation', 'projection-operator']"," Title: Quantum channel representation of projective measurementBody: 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.
"
"['programming', 'circuit-construction', 'qiskit']"," Title: How to program a controlled Hadamard-Hadamard gate?Body: 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?
"
"['quantum-state', 'density-matrix', 'fidelity']"," Title: Quantum fidelity simplified formula while both of the density matrices are single qubit statesBody: 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!
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: Simulating a 3-local Hamiltonian TermBody: 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?
"
"['entanglement', 'mathematics']"," Title: What is the motivation for Weyl matrices in quantum information theory?Body: 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:
- 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?
- 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?
"
['ibm-q-experience']," Title: Experiments stuck on VALIDATING ibmq_16_melbourneBody: 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.
"
"['algorithm', 'quantum-state', 'programming']"," Title: Eliminating a term of a superposition stateBody: 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.
"
['quantum-gate']," Title: Is swap gate equivalent to just exchanging the wire of the two qubits?Body: 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?
"
"['qiskit', 'error-correction']"," Title: Get result measurement into a circuit with QiskitBody: 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.
"
"['programming', 'quantum-state']"," Title: How to find a common eigenstate of commuting operators?Body: 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.
"
"['entanglement', 'mathematics', 'density-matrix', 'matrix-representation', 'partial-transpose']"," Title: Equivalent determinant condition for Peres-Horodecki criteriaBody: 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?
"
"['quantum-state', 'entanglement', 'measurement', 'cryptography']"," Title: GHZ - measuring particlesBody: 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
- 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?
- 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?
- 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?
"
"['quantum-gate', 'programming', 'circuit-construction', 'qiskit']"," Title: Implementing a complex circuit for a Szegedy quantum walk in qiskitBody: 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:
- Multiple controlled gates (2 and 3 controls and targets like $H$, $R_{y}$).
- Hermitian conjugate of an operator (Dagger).
- Ancilla qubits, that increase the complexity of the circuit.
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.
"
"['quantum-gate', 'quantum-state']"," Title: CX gate with HadamardBody: 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.
"
"['quantum-gate', 'quantum-fourier-transform', 'universal-gates']"," Title: Is the quantum Fourier transform efficient if only one control-phase is allowed in the gate setBody: 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)?
"
"['entanglement', 'information-theory', 'entropy', 'entanglement-witness']"," Title: How to prove the following bosonic entanglement expression?Body: 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.
"
"['programming', 'q#']"," Title: How to compute the inverse of an operation in Q#?Body: 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)?
"
"['resource-request', 'superdense-coding']"," Title: Superdense coding projectsBody: 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?
"
"['ibm-q-experience', 'ibm']"," Title: IBM Slack links brokenBody: 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.
"
"['mathematics', 'grovers-algorithm', 'nielsen-and-chuang']"," Title: Construction of Phase Shift Operation used in Quantum SearchBody: 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?
"
"['entanglement', 'density-matrix', 'partial-transpose']"," Title: Understanding the classification of quantum states based on partial transposition: representations of the bipartite density matrixBody: 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$?
"
"['quantum-state', 'measurement', 'qudit']"," Title: $n$ qubit vs. a $d=2^n$ qudit states and measurementsBody: The pure states of a qudit inhabit the $\mathbb{CP}(d-1)$ manifold.
- Is it true that the pure states of $n$ qubits live on the $\mathbb{CP}(2^n-1)$ manifold?
- 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.
"
"['algorithm', 'physical-realization', 'cryptography', 'shors-algorithm']"," Title: Calculating power of a quantum computer for RSABody: 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?
"
"['algorithm', 'hhl-algorithm']"," Title: Using the HHL algorithm to compute $A |b \rangle$ instead of $A^{-1} |b \rangle$Body: 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.
"
"['circuit-construction', 'universal-gates']"," Title: How many two-qubit gates are required to implement a general N-qubit unitary?Body: 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?
"
"['programming', 'qiskit', 'ibm-q-experience', 'bell-experiment']"," Title: Bell State 11 not working for parity curveBody: 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?
"
"['entanglement', 'mathematics', 'state-distillation']"," Title: Motivation for the definition of k-distillabilityBody:
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?
"
"['entanglement', 'mathematics', 'state-distillation']"," Title: Geometric interpretation of 1-distillabilityBody: 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:
- 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$?
- 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?
"
['error-correction']," Title: 2 ways to do the three qubits bit-flip codeBody: 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 ?
"
"['quantum-gate', 'ibm-q-experience']"," Title: Bug in IBM backend?Body: 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.
"
"['quantum-gate', 'matrix-representation']"," Title: Controlled Z gate acting on 3 qubits in matrix formBody: 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)$$
"
"['quantum-gate', 'circuit-construction']"," Title: Understanding CNOT gate for indirect measurementBody: 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?
"
"['quantum-state', 'programming']"," Title: How to represent $|+\rangle$ in Python?Body: 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!
"
"['programming', 'bloch-sphere', 'qutip']"," Title: How to add states on the Bloch sphere from a master equation?Body: 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.
"
"['algorithm', 'grovers-algorithm']"," Title: Does an oracle use only the eigenstates of the quantum register?Body: 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.
"
"['quantum-state', 'entanglement']"," Title: What are the two qubits in the state $a\lvert 00\rangle+b\lvert11\rangle$?Body: 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?
"
"['quantum-state', 'quantum-operation']"," Title: Does the Choi-Jamiolkowski isomorphism really establish a connection between kinematics and dynamics?Body: 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
"
['algorithm']," Title: The possibility of recovering the matrix $A+B$ from $e^{i(A+B)t}$ for Hermitian $A,B$Body: 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}$ ?
"
['ibm-q-experience']," Title: Bug report bug report?Body: 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?
"
"['quantum-gate', 'quantum-state']"," Title: Non-linear sign shift gateBody: 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.
"
['resource-request']," Title: Getting started with quantum computing from a computer science perspectiveBody: 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.
"
"['quantum-state', 'tensor-product']"," Title: Kronecker product and multiplication operation on qubit statesBody: 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?
"
"['physical-realization', 'physical-qubit', 'superconducting-quantum-computing']"," Title: Physical realization of qubits with superconducting Josephson junctionsBody: Does anybody know how to explain briefly how to realize qubits (initialization, states transition, measurements,..) with superconducting Josephson junctions, say DC-SQUIDS?
"
"['measurement', 'bell-experiment', 'projection-operator', 'hadamard', 'bell-basis']"," Title: Projecting $\lvert ++ \rangle$ on Bell BasisBody: 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) = ?
$$
"
"['quantum-state', 'no-cloning-theorem']"," Title: Cloning quantum states with a device that distinguishes between two non-orthogonal quantum statesBody: 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?
"
"['algorithm', 'speedup']"," Title: Could quantum computing improve chess engines?Body: 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.
"
"['programming', 'ibm-q-experience']"," Title: Having trouble communicating with the IBM Q Experience REST APIBody: 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'}}
"
"['quantum-gate', 'error-correction', 'textbook-and-exercises']"," Title: How do you implement a negative controlled gate using the regular controlled gate?Body: 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.
"
"['quantum-state', 'density-matrix']"," Title: Which state describes carrier transport through channel? A mixed state or a pure state?Body: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: What about this metaphor for quantum computing?Body: 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.
"
['simulation']," Title: Quantum Codes and Plasma Codes for Simulation ApplicationsBody: 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!
"
"['circuit-construction', 'cirq']"," Title: N-Toffoli on CirqBody: 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.
"
"['classical-computing', 'speedup', 'ibm']"," Title: Comparing CPU to QPU In terms of processing powerBody: 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""?
"
"['quantum-state', 'physical-qubit', 'superconducting-quantum-computing']"," Title: States of a qubit in a DC-SQUIDBody: 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)?
"
"['circuit-construction', 'cirq']"," Title: Measuring the expected energy of a quantum circuitBody: 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.
"
['resource-request']," Title: Are there any Quantum Computing degrees in Germany, Quebec, or The USA?Body: 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?
"
['hamiltonian-simulation']," Title: Hamiltonian simulation in quantum computationBody: 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?
"
"['simulation', 'hamiltonian-simulation', 'cirq', 'optimization']"," Title: How to implement NM Algorithm for Variational Quantum Eigensolver?Body: 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:
- The objective function is the energy measurement operation from
Cirq's tutorial.
- $x_1,...., x_n$ are the gate parameters in each of the quantum gates for the circuit representing the ansatz.
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?
"
"['quantum-gate', 'physical-realization', 'optical-quantum-computing']"," Title: How to perform quantum logic gates on plasmons?Body: 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)
"
['decoherence']," Title: Can decoherence account for suppression of interference in all basis?Body: (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)?
"
"['quantum-state', 'simulation', 'hamiltonian-simulation', 'cirq', 'surface-code']"," Title: GridQubit in Cirq vs LineQubitBody: 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
"
['qiskit']," Title: What does it mean to get 403 error when running a code on Qiskit?Body: 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.
"
"['entanglement', 'information-theory', 'communication']"," Title: Does entanglement allow communication of user specified information or not?Body: 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?
"
"['algorithm', 'oracles']"," Title: Why is the second register needed to define bit flip quantum oracles in a way that distinguishes between complementary oracles?Body: 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.
"
"['quantum-gate', 'circuit-construction', 'error-correction']"," Title: There seems to be a problem with the implementation of identity gates on Qiskit as compared to the circuit composerBody: 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?
"
"['quantum-gate', 'quantum-fourier-transform', 'hadamard']"," Title: What is the intuition of using Hadamard gate in quantum fourier transform?Body: 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?
"
"['quantum-gate', 'programming', 'qiskit', 'randomised-benchmarking']"," Title: How to do randomised benchmarking for non-Clifford gates on Qiskit?Body: 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?
"
"['quantum-gate', 'circuit-construction', 'neural-network']"," Title: How to derive a circuit from given equations?Body: 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?
"
"['circuit-construction', 'simons-algorithm', 'oracles']"," Title: Coding an oracle for Simon's algorithmBody: 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$.
"
['quantum-volume']," Title: How to calculate the quantum Volume?Body: 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?
"
"['d-wave', 'annealing']"," Title: Minimum Spanning Tree on D Wave ProcessorBody: 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?
"
"['simulation', 'd-wave']"," Title: How to get samples in ""bins"" from D-Wave's dimod?Body: 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
"
"['complexity-theory', 'random-quantum-circuit']"," Title: Can we amplify BPP algorithms with a random quantum circuit?Body: 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?
"
"['mathematics', 'density-matrix']"," Title: What is the probability that measurement finds it in the $|0\rangle$ state?Body: 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 ...
"
"['circuit-construction', 'qiskit', 'gate-synthesis', 'quantum-fourier-transform']"," Title: Using Quantum Fourier Transform in adding two 2-bit numbersBody: 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?
"
"['quantum-gate', 'qiskit', 'universal-gates']"," Title: How can I build a controlled gate for this matrix in qiskit?Body: 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
$$
"
"['quantum-gate', 'gate-synthesis']"," Title: How to create an $n$-qubit normally controlled gate?Body: 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?
"
"['qiskit', 'ibm-q-experience', 'universal-gates']"," Title: What does a quantum circuit look like after qiskit.compile() has been applied?Body: 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?
"
"['quantum-state', 'density-matrix']"," Title: Taking the two qubit reduced density matrix on a 5 qubit systemBody: 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!
"
"['algorithm', 'complexity-theory', 'hhl-algorithm']"," Title: Showing that Matrix Inversion is BQP-complete - HHL AlgorithmBody: 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.
"
"['algorithm', 'deutsch-jozsa-algorithm', 'oracles']"," Title: Implementing the one-bit Deutsch Oracle algorithm using phaseBody: 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?
"
"['algorithm', 'circuit-construction', 'hamiltonian-simulation', 'cirq', 'machine-learning']"," Title: Quantum Optimization via Quantum Label Classification in Quantum CircuitsBody: 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:
- A 5th qubit to be a readout bit (ancilla) to measure the predicted label of the readout bit.
- A Pauli-X gate to ensure the readout bit would be |1> following Farhi's paper prior to start measuring the predicted label.
- N-bit toffoli gate to indirectly measure the ansatz to measure the effects of the $(\beta, \gamma)$ in the circuit as these are changed.
- 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.
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:
- 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?
- 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.
- 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?
- 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.
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.
"
"['quantum-gate', 'gate-synthesis']"," Title: Approximating unitary matrices -- restricted gatesetBody: 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.
"
"['qiskit', 'ibm-q-experience', 'decoherence']"," Title: Measuring Coherence Length for T1 and T2 values with IBMQ ExperienceBody: 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:
- 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?
- 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?
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.
"
"['quantum-gate', 'gate-synthesis']"," Title: Calculate the square root of Euler anglesBody: 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?
"
"['algorithm', 'mathematics', 'grovers-algorithm', 'nielsen-and-chuang']"," Title: Angular Error associated with Quantum Search AlgorithmBody: 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?
"
"['classical-computing', 'classical-quantum']"," Title: Can a quantum computer run classical algorithms?Body: 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?
"
"['quantum-state', 'gate-synthesis', 'universal-gates', 'solovay-kitaev-algorithm', 'random-quantum-circuit']"," Title: Sampling random circuits vs Solovay-Kitaev compilerBody: 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$?).
"
"['classical-computing', 'no-cloning-theorem', 'classical-quantum', 'cloning', 'nonclassicality']"," Title: Classical and quantum limits to classical copying?Body: 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:
- 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.
- 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?
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.
"
"['quantum-state', 'programming']"," Title: Synchronous Interactions Between Quantum and Macroscopic SystemsBody: 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
"
"['quantum-gate', 'no-cloning-theorem']"," Title: Why can't a fanout be made with a CNOT gate?Body: 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?
"
['quantum-gate']," Title: Is a ccH, ccX and ccH equivalent to a cH, ccX and cH sequence?Body: 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?
"
['resource-request']," Title: Is my background sufficient to start quantum computing?Body: 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:
- Is my background sufficient for studying quantum computing?
- Where should I start/which materials do you suggest?
"
"['programming', 'qutip', 'open-quantum-systems']"," Title: Modifying GRAPE for open quantum systemsBody: 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 ?
"
['no-cloning-theorem']," Title: When can a fanout be used without violating the no-cloning theorem?Body: 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?
"
['entanglement']," Title: What is the difference between entangled and separable states or electron spin-singlets?Body: What is the difference between entangled states and separable states or electron spin-singlets?
"
"['entanglement', 'deutsch-jozsa-algorithm']"," Title: How can a CNOT gate change the control qbit (e.g. in the Deutsch Oracle problem)?Body: 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.
"
"['quantum-gate', 'error-correction', 'physical-qubit']"," Title: I thought we had already passed this error and qubit threshold?Body: 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?
"
"['programming', 'qiskit', 'quantum-gate']"," Title: import error :No module named 'qiskit_aqua'Body: 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'
"
['qiskit']," Title: Qiskit Aqua cannot import 'QasmQobj'Body: 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'
"
"['algorithm', 'quantum-gate', 'deutsch-jozsa-algorithm']"," Title: What does a zero state combined state vector for 2 qubits mean?Body: 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
"
"['quantum-state', 'entanglement', 'grovers-algorithm']"," Title: Entangling marked qubit with part of the register in Grover's searchBody: 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.
"
"['qiskit', 'ibm-q-experience']"," Title: How to upload .py file to new online Qiskit NotebookBody: 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.
"
"['nielsen-and-chuang', 'optical-quantum-computing']"," Title: Hamiltonian for Single-photon, Single-atom QED CavityBody: 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.
"
"['entanglement', 'circuit-construction']"," Title: What implementation changes should be done in maxcut code using VQE?Body: 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:
- Why have only these circuits only been used?
- 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?
"
['ibm-q-experience']," Title: Number of Shots always 1024/or nothing (IBM q experience)Body: 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.
"
"['complexity-theory', 'oracles']"," Title: Separating NP from BQP relative to an oracleBody: 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}$.
"
"['complexity-theory', 'qma']"," Title: Quantum State SanitizingBody: 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.
$$
"
"['quantum-gate', 'qiskit', 'pauli-gates']"," Title: CRZ and CRY GatesBody: 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!
"
"['grovers-algorithm', 'q#']"," Title: How does ControlledOnInt in Q# make it Grovers Oracle?Body: 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
"
"['quantum-gate', 'gate-synthesis']"," Title: Efficient implementation of exponential of projectorBody: 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.
"
"['circuit-construction', 'qiskit', 'ibm-q-experience']"," Title: How do I get out 2 measurements from the same execution on Qiskit?Body: 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!
"
"['quantum-gate', 'qiskit']"," Title: About a Qiskit FunctionBody: 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 !
"
"['qiskit', 'ibm-q-experience']"," Title: How do I check my remaining IBM Q credits?Body: 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?
"
['qiskit']," Title: Creating and running parallel circuits in QiskitBody: 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())
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: Problem with initial_layout on Qiskit/IBMQ: 'Not enough qubits in CouplingGraph'Body: 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!
"
"['algorithm', 'circuit-construction', 'hamiltonian-simulation']"," Title: Ansatz Techniques to Multi-Body Physics ProblemsBody: 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?
"
"['quantum-gate', 'gate-synthesis', 'quantum-control']"," Title: control gate with 3 inputs, two control and rotation gateBody: 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)?
"
"['programming', 'hamiltonian-simulation', 'machine-learning']"," Title: Encoding Binary Data into Quantum BasisBody: 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.
"
['qutip']," Title: What is the need of convolution here?Body: 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
"
['qutip']," Title: Different values of similar functionsBody: 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
"
['grovers-algorithm']," Title: Second reflection in the Grover's algorithmBody: 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?
"
['qutip']," Title: Is the analytical solution right?Body: 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
"
['physical-qubit']," Title: Charge Qubit vs TransmonBody: 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
"
"['qiskit', 'resource-request', 'biology']"," Title: Where I can read about protein folding on quantum computers with simple examples?Body: Where I can read about protein folding on quantum computer (Qiskit will be ideal variant) with simple examples? Thanks
"
"['quantum-state', 'grovers-algorithm', 'q#']"," Title: Is it possible to change the oracle in Grover's search to ponderate probabilities in multiple values search?Body: 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]);
}
}
"
['simulation']," Title: Anti-symmetrization on the latticeBody: 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.)
"
['ibm-q-experience']," Title: IBM Quantum Experience: simulation not running on IBMQ_16_melbourneBody: 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?
"
['qiskit']," Title: Draw ""Initialize"" circuit as sequence of single gatesBody: 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)
"
"['quantum-state', 'physical-qubit']"," Title: Measuring a quantum wire at t > 0Body: 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)
"
"['quantum-state', 'measurement', 'probability']"," Title: Find probability of a single qubit's measurement results from a 5 qubit stateBody: 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.
"
"['quantum-state', 'trace-distance']"," Title: What is intuition for the trace distance between quantum states?Body: 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?
"
"['quantum-state', 'qiskit', 'density-matrix']"," Title: The meaning of the city plot in QiskitBody: 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?
"
"['qiskit', 'fidelity', 'terminology']"," Title: What does fidelity mean?Body: 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.
"
"['programming', 'qiskit']"," Title: Quantum Computing Qiskit - How to read data from classical registersBody:
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
"
"['quantum-gate', 'quantum-state']"," Title: What is the purpose of the last bits in the 2-qubit-operation Toffoli implementation?Body: What is the purpose of these quantum gates?
They're appended to the circuit after the value has been computed.
"
['cirq']," Title: Estimate run time of Cirq circuit on forthcoming Google quantum computerBody: 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!
"
['quirk']," Title: How to use the input gates in QuirkBody: 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"".
"
"['mathematics', 'measurement', 'experiment', 'bell-experiment']"," Title: given an EPR pair, how do I calculate expectation value?Body: 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⟩]$
"
['quantum-fourier-transform']," Title: How to decompose the Quantum Fourier Inverse matrix into elementary quantum gates?Body: 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.
"
['qiskit']," Title: Controlled-Initialize instructionBody: 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'}
"
"['quantum-gate', 'circuit-construction']"," Title: How is inner product addition performed?Body: 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 $?
"
"['qiskit', 'ibm-q-experience']"," Title: edit a program on IBM Q experienceBody: 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
"
"['programming', 'circuit-construction', 'q#', 'oracles']"," Title: Hamming with prefix oracleBody: 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]);
}
}
}
"
"['algorithm', 'mathematics']"," Title: What is $\mathbb{Z}_2$ symmetry?Body: I encountered the notion of $\mathbb{Z}_2$ symmetry in an article. Can someone give a definition?
"
"['programming', 'qiskit']"," Title: How to reset classical register on QISKitBody: 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?
"
['circuit-construction']," Title: Is it possible to simulate any classical algorithm with the same efficiency on quantum computer?Body: 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?
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Find the quantum operation corresponding to a given unitary evolution and projective measurementBody: 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.
"
"['mathematics', 'complexity-theory', 'nielsen-and-chuang']"," Title: Minimum Multi-Degree Polynomials representing Boolean FunctionsBody: 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.
"
"['programming', 'quantum-gate', 'algorithm']"," Title: The most important quantum question , how to force a superposition qubit to collapses to an exact value?Body: 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}
"
"['quantum-gate', 'circuit-construction', 'qiskit', 'simulation']"," Title: How to create an Ising coupling gate with Qiskit?Body: 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.
"
"['programming', 'ibm-q-experience']"," Title: How call from IBM Q Experience (Jupyter Notebook) cplexBody: 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
"
"['algorithm', 'qaoa']"," Title: QAOA and symmetry effects on the anglesBody: 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]$ ?
"
"['pauli-gates', 'clifford-group']"," Title: Definition of the Pauli group and the Clifford groupBody: 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?
"
"['quantum-state', 'measurement']"," Title: What's the probability of measuring outcomes give measurement observable $M$ and state $\rho$ when $\mathrm{Tr}\!\:(\!\!\;M\rho)$ is a complex value?Body: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: Measuring the effect of energy relaxation with IBMQ ExperienceBody: 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()
"
['classical-computing']," Title: A quantum computer that doesn't use entangled qubits has the same computational power as a classical one?Body: 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.
"
"['quantum-state', 'bloch-sphere', 'mub']"," Title: Maximum number of ""almost orthogonal"" vectors one can embed in Hilbert spaceBody: 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.
- $N(0, d)$ = d
- $N\left(\frac{1}{2}, 2\right)$ = 3, this can be seen by explicit construction of vectors using the Bloch sphere.
- $N\left(\frac{1}{\sqrt{2}}, 2\right) = 6$, again using the same logic.
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.
"
['algorithm']," Title: Quantum comparator with one fixed inputBody: 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
- a quantum register $\vert a \rangle$ of size
n that should be interpreted as a unsigned integer.
- a single qubit initialised to $\vert 0 \rangle$ that will store the result of $a < rhs$ at the end of the routine.
- at most one ancilla qubit, and preferably no ancilla qubit at all.
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:
- No ancilla qubit needed.
- Only QFT and phase gates, which should be easy to implement on hardware.
- A depth in $O(n)$.
But an ideal implementation would also:
- have a number of gates that grows in $O(n)$. Draper's adder is $O(n^2)$ because of the QFT.
- 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$.
- 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.
My question: do you know any paper that introduce an algorithm that may interest me, based on the lists above?
"
['qma']," Title: Quantum Metropolis Algorithm: why is Quantum Simulated Annealing necessary?Body: 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!
"
['hhl-algorithm']," Title: Apply the conditional Hamiltonian evolution (HHL)Body: 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 ?
"
"['mathematics', 'unitarity', 'hadamard']"," Title: Finding a global phase that transform the Hadamard gate to an element of $SU(2)$ and propose an evolution operator which implements the operationBody: 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$?
"
"['hamiltonian-simulation', 'tensor-product']"," Title: Which representation describes the composite Hilbert space?Body: 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?
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang']"," Title: Find the Kraus operators of the amplitude damping channel, partial tracing after evolution through a beamsplitterBody: 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:
"
['complexity-theory']," Title: complexity of classical counting algorithmBody: 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)$
"
"['algorithm', 'optimization', 'qaoa']"," Title: How does the fact that the output of a quantum circuit cannot be efficiently simulated classically help for optimisation?Body: 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.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: ERROR_RUNNING_JOB with 32 qubit circuit running on ibmq_qasm_simulator backendBody: 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.
"
['fidelity']," Title: What would be an ideal fidelity measure to determine the closeness between two non unitary matrices?Body: 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?
"
['nielsen-and-chuang']," Title: Amplitude Damping of a Harmonic OscillatorBody: 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.
"
['algorithm']," Title: Loading the finite precision representation of the norm of a vector into a computational register using CNOT gatesBody: 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?
"
['qiskit']," Title: Qiskit No backend matches the criteriaBody: 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()
"
"['programming', 'teleportation', 'projectq']"," Title: How to integrate Simulaqron on ProjectQBody: 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()
"
"['quantum-gate', 'circuit-construction']"," Title: How to create quantum circuits from scratchBody: 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
"
"['circuit-construction', 'qiskit', 'measurement']"," Title: Measurements in QiskitBody: 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?
"
"['quantum-state', 'qiskit', 'density-matrix']"," Title: How to represent an ensemble of pure quantum states in Qiskit?Body: 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?
"
"['qiskit', 'classical-quantum']"," Title: How to initialize classical register in Qiskit?Body: 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 ?
"
"['circuit-construction', 'shors-algorithm']"," Title: Is there a simple, formulaic way to construct a modular exponentiation circuit?Body: 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!
"
"['qiskit', 'ibm-q-experience']"," Title: Please help: get_statevector gives wrong result in qiskitBody: 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
"
"['qiskit', 'openpulse']"," Title: OpenPulse: Modifying pulse sequence for basic gatesBody: 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?
"
"['error-correction', 'stabilizer-code']"," Title: The merit of quantum error correction codesBody: 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.
"
['tensor-product']," Title: Derive one equation from the otherBody: 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 ?
"
"['mathematics', 'complexity-theory', 'hamiltonian-simulation']"," Title: Estimating errors in Hamiltonian Simulation paperBody: 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.
"
"['quantum-gate', 'gate-synthesis', 'universal-gates']"," Title: How to implement controlled u3 gate from Qiskit using simpler gates?Body: 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.
"
['superposition']," Title: How would I construct an Ising Hamiltonian for binary linear programming?Body: 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!
"
"['error-correction', 'stabilizer-code']"," Title: Density Evolution to Optimize QLDPC code designBody: 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.
"
['density-matrix']," Title: What's an easy way to determine a local density matrix?Body: 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.
- I'm not sure how this generalizes to states with more qubits.
- These indices are making my head explode.
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.
"
['qiskit']," Title: Hybrid classical-quantum linear solver based on the Neumann-Ulam methodBody: 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 ?
"
['algorithm']," Title: Clarification of a portion of the paper Quantum Amplitude Amplification and EstimationBody: 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?
"
"['algorithm', 'quantum-gate', 'quantum-parallelism', 'bernstein-vazirani-algorithm']"," Title: Is the intuition of quantum parallelism always correct?Body: 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.
"
"['quantum-gate', 'qiskit', 'ibm-q-experience']"," Title: How is it possible to perform a c-not on 4 qubits using the same control qubits on IBM Q computers?Body: 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?
"
['no-cloning-theorem']," Title: No-cloning theorem does not seem preciseBody: 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.
"
"['quantum-gate', 'quantum-state']"," Title: How is CNOT gate physically implemented in IBM Q?Body: 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?
"
"['nielsen-and-chuang', 'quantum-operation', 'noise']"," Title: Derive phase damping quantum operationBody: 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?
"
"['quantum-fourier-transform', 'fourier-sampling', 'hidden-subgroup-problem']"," Title: Hidden subgroup problemBody: 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?
"
"['quantum-gate', 'teleportation', 'hadamard']"," Title: How to understand a phase operation between 2 Hadamard gates?Body: 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?
"
"['mathematics', 'textbook-and-exercises', 'pauli-gates', 'linear-algebra']"," Title: How are arbitrary $2\times 2$ matrices decomposed in the Pauli basis?Body: 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 ?
"
"['error-correction', 'stabilizer-code']"," Title: All unitary errors are correctableBody: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: Chose how to map virtual qubits to physical qubitsBody: 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 ?
"
['hhl-algorithm']," Title: Understanding the filter functions in the HHL algorithmBody: 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.
"
"['quantum-state', 'fidelity']"," Title: Is phase factor negligible in fidelity of quantum states?Body: 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$?
"
['error-correction']," Title: Basics on CSS codes: manipulation of the ancillas to detect errorBody: 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 ?
"
"['circuit-construction', 'physical-realization']"," Title: quantum circuit with feasible gates for state preparationBody: 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
"
"['quantum-gate', 'error-correction']"," Title: Going from a circuit to the quantum state output of the circuitBody: 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}$$
"
['quantum-gate']," Title: Identity Gate Timing DiscrepancyBody: 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?
"
"['error-correction', 'stabilizer-code']"," Title: Knill-Laflamme condition and requirements for error correctionBody: 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?
"
"['entanglement', 'mathematics', 'no-cloning-theorem']"," Title: Why isn't there a contradiction between the existence of CNOT gate/entanglement and the no-cloning theorem?Body: 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.
"
"['simulation', 'nonclassicality', 'gottesman-knill']"," Title: Why doesn't the Gottesman-Knill theorem render quantum computing almost useless?Body: 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?
"
"['quantum-operation', 'unitarity']"," Title: Are CPTP operators and unitary operators the same thing?Body: 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?
"
"['circuit-construction', 'matrix-representation']"," Title: A basic question on circuits and matrix representationBody: 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}$,
"
"['quantum-operation', 'kraus-representation']"," Title: 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$?Body: 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.
"
"['quantum-operation', 'unitarity', 'textbook-and-exercises']"," Title: What is the unitary operator realizing a given CPTP operatorBody: 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$?
"
"['entanglement', 'teleportation', 'no-cloning-theorem', 'superdense-coding', 'key-distribution']"," Title: In what ways can qubits be used for applications that do not require entanglement?Body: 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:
- Weisner's quantum money scheme, which begat
- The BB84 quantum key distribution scheme.
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?
"
"['superposition', 'amplitude-amplification']"," Title: How to amplify a specific part of the quantum stateBody: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: If I have a state $a|0000\rangle+b|0011\rangle$, how do you change it to make $b>a$?Body: 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$?
"
['ibm-q-experience']," Title: Gate error in IBM-Q simulator vs real backendBody: 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,
"
"['simulation', 'noise']"," Title: Implementing noise model in Quantum simulatorBody: I have noticed that a few papers, such as this one, provide models two for typical noise that a qubit encounters during network transmission:
- Λ 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.
- Λ 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.
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?
"
"['models', 'resource-theories']"," Title: Why is the resource theory approach used in quantum information processing?Body: 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 ?
"
['error-correction']," Title: Questions about theorem and proof: ""Quantum error correction condition"", Thm 10.1 Nielsen & ChuangBody: 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$ ?
"
"['quantum-gate', 'phase-estimation']"," Title: Sketch the quantum logic gates correctly and give a proof for the identityBody: 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$$
- I can first apply $U^c$ and afterward measure the control qubit.
- Or I can first measure the control qubit and then apply $U$ only if
the measurement outcome was 1.
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.
- \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.
- 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$
"
['cryptography']," Title: Clarifying Mosca's Inequality Theorem - parallel vs additiveBody: 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?
"
['error-correction']," Title: Intuition about Knill-Laflamme QEC conditionsBody: 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.
"
['hhl-algorithm']," Title: Matrix Inversion is BQP-complete proof in HHL and the probability of measuring $T+1 \leq t \leq 2T$Body: 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!
"
"['programming', 'qiskit', 'measurement', 'textbook-and-exercises', 'vqe']"," Title: How to calculate an Expected Value of some operator acting on qubits?Body: 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?
"
['pauli-gates']," Title: Can there be multiple energy eigenstates corresponding to the same eigenvalue of a Hamiltonian (Pauli-X)?Body: 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.
"
"['quantum-gate', 'mathematics', 'teleportation']"," Title: Explain matrix multiplication math operations of a Hadamard gate after a phase gateBody: 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.
"
"['quantum-gate', 'nielsen-and-chuang']"," Title: 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- NOTsBody: Its a Problem from
Michael Nielsen quantum computation and quantum information
"
"['quantum-gate', 'circuit-construction', 'measurement']"," Title: Implementation of filter operationBody: 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?
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Why does Qiskit swap gate accept registers, but cswap doesn't?Body: 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
"
"['quantum-operation', 'unitarity', 'kraus-representation']"," Title: Can the Kraus decomposition always be chosen to be a statistical mixture of unitary evolutions?Body: 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?
"
"['physical-qubit', 'superconducting-quantum-computing']"," Title: Excitation of a superconducting circuitBody: 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?
"
"['architecture', 'physical-qubit', 'superconducting-quantum-computing']"," Title: What design considerations set the frequency bounds for superconducting qubits?Body: 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?
"
"['circuit-construction', 'simulation']"," Title: Reversible Circuit Simulation (for classical tests of quantum subroutines)Body: Problem: trying to implement and test quantum subroutines on quantum simulators I run into multiple challenges:
- Quantum simulation is a very hard problem: a very low number of simulated qubits is supported
- 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.
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
"
"['quantum-state', 'quantum-operation', 'information-theory', 'channel-capacity', 'mutual-information']"," Title: What exactly is the relation between the Holevo quantity and the mutual information?Body: 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?
"
"['quantum-gate', 'q#']"," Title: How to make a time rotation in Qsharp like in Quirk spinning gates?Body: 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
"
"['quantum-state', 'qiskit', 'error-correction', 'ibm-q-experience', 'superconducting-quantum-computing']"," Title: How do I interpret the readout error for a quantum computer?Body: 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?
"
['circuit-construction']," Title: Circuit for controlled rotations conditioned on a $d$ bit precision estimate of $\theta$ for $O(d)$ gatesBody: 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.
"
"['quantum-gate', 'cirq']"," Title: How to do a $C-PH$ gate in google cirqBody: 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.
"
"['quantum-operation', 'kraus-representation']"," Title: Do the Kraus operators of a CPTP channel need to be orthogonal?Body: 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?
"
"['quantum-state', 'measurement', 'tensor-product']"," Title: The correct set of measurement operators on a mutiple qubit systemBody: 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?
"
"['grovers-algorithm', 'complexity-theory', 'classical-computing', 'speedup']"," Title: Are there many practical problems for which Grover's algorithm beats the best heuristic classical algorithm?Body: 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.)
"
"['entanglement', 'superdense-coding', 'bell-basis']"," Title: If Alice and Bob share a Bell state, can Alice send her individual qubit to a third party?Body: 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$?)
"
['quantum-operation']," Title: Do the eigenvalues of the Choi matrix have any direct physical interpretation?Body: 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?
"
"['algorithm', 'deutsch-jozsa-algorithm', 'simons-algorithm', 'oracles', 'bernstein-vazirani-algorithm']"," Title: What are examples of non-oracular versions of famous oracular problems?Body: 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?
"
"['quantum-state', 'entanglement', 'non-locality', 'qkd']"," Title: Non maximally entangled states for QKDBody: 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?
"
"['resource-request', 'hamiltonian-simulation', 'chemistry', 'applications']"," Title: Number of Qubits Required for Simulation of Caffeine and Penicillin MoleculesBody: 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.
"
"['qiskit', 'error-correction', 'ibm-q-experience']"," Title: Job execution issue while using IBMQ ExperienceBody: 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.
"
"['deutsch-jozsa-algorithm', 'oracles']"," Title: Deutsch-Jozsa on non-balanced oraclesBody: 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.
"
"['programming', 'q#']"," Title: Q#: How to setup a project correctly (on Linux, command line)?Body: 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?
"
"['quantum-operation', 'locc-operation']"," Title: Why can any LOCC operation be written as $\sum_k (A_k\otimes B_k)\rho(A_k^\dagger\otimes B_k^\dagger)$?Body: 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$.
"
['no-cloning-theorem']," Title: Bounding advantage of a 'no cloning theorem' counterfeiterBody: 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).
"
"['quantum-state', 'bloch-sphere']"," Title: What is the rotation matrix corresponding to a point on the Bloch sphere?Body: 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!
"
"['measurement', 'projection-operator', 'povm']"," Title: What is the relation between POVMs and projective measurements?Body: 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 ?
"
"['circuit-construction', 'measurement']"," Title: Performing a measurement in the standard computational basis of a three qubit system on two qubitsBody: 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?
"
"['programming', 'q#']"," Title: Q#: dynamically assigning (or updating) multidimensional Qubit arraysBody: 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:
- Remembering indices in the qubit array (this will be messy)
- Getting a representation of a three dimensional qubits array: $Qubit[rank][dim][bitlength]$
- Getting a custom type of QubitVectors and getting an array of those.
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.
"
['ibm-q-experience']," Title: What is the IBM Q credits?Body: 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.
"
"['quantum-gate', 'matrix-representation', 'stabilizer-code']"," Title: Why is $Z_1Z_2$ spanned by this set ? Surely it's too small?Body: 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 ?
"
"['quantum-state', 'density-matrix']"," Title: What is the average value of $|c_i\bar c_j|$ for a random state $|\psi\rangle=\sum_i c_i|i\rangle$?Body: 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');
"
"['quantum-gate', 'quantum-fourier-transform', 'quantum-control']"," Title: The control phase gate in Quantum fourier transform and the question it brings up regarding control gates in generalBody: 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 ?
"
"['quantum-gate', 'circuit-construction']"," Title: Understanding how control gates are written in tensor notationBody: 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?
"
"['quantum-state', 'density-matrix']"," Title: Is there any meaning for a density operator if we omit the j-th row and column in quantum mechanics?Body: 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?
"
['algorithm']," Title: Are there any quantum algorithms to compute the norm of a vector, better than the classical version (O(d), where d is dimension)Body: 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!
"
['qiskit']," Title: How to do subplots when plot_histogram etc. closes the figureBody: 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)
"
['error-correction']," Title: What are the Main Classes of Quantum Error-Correcting Codes?Body: 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!
"
"['algorithm', 'oracles', 'quantum-walks']"," Title: Oracle for welded tree walkBody: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: Grover's algorithm in a nutshellBody: 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.
"
['quantum-gate']," Title: How to derive the way a controlled $U$ gate acts on an input state?Body: 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!
"
"['quantum-gate', 'mathematics', 'unitarity']"," Title: Does the general form of a unitary operator define strict signs for the second column?Body: 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?
"
"['quantum-gate', 'superposition', 'hadamard']"," Title: How do 2 Hadamard gates act on a single qubit?Body: 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?
"
"['trace-distance', 'diamond-norm']"," Title: Is the diamond norm subadditive under composition?Body: 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)$$
"
['grovers-algorithm']," Title: Grover's algorithm for game treeBody: 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)?
"
"['algorithm', 'programming', 'ibm-q-experience', 'applications', 'nisq']"," Title: Software for Quantum ComputingBody: 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 ?
"
"['simulation', 'complexity-theory']"," Title: Simulating depth-2 circuitsBody: 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.
"
"['algorithm', 'qiskit', 'pauli-gates', 'pennylane']"," Title: Expected value of a product of the Pauli matrices in different basesBody: 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?
"
"['machine-learning', 'swap-test']"," Title: Distance calculation between two vectorsBody: 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?
"
['qiskit']," Title: qiskit - measure only 1 of the register out of n registersBody: 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.
"
"['complexity-theory', 'quantum-advantage']"," Title: Strong vs weak simulations and the polynomial hierarchy collapseBody: (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?
"
"['qiskit', 'games']"," Title: Using Qiskit with BlenderBody: 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
"
"['quantum-state', 'unitarity']"," Title: Find the local unitary that takes the bell state to a state phi that has an extractable bell stateBody: 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.
"
['quantum-gate']," Title: How is the Controlled Z Gate implemented?Body: 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?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: Estimate of the absolute value of the probability amplitude of |0⟩ in the superpositionBody: 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
"
"['measurement', 'notation', 'bell-basis']"," Title: Representing a Bell measurement on non adjacent qubitsBody: 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?
"
"['resource-request', 'physical-realization']"," Title: Looking for papers that are pessimistic about the feasibility of a quantum computerBody: 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?
"
['quantum-gate']," Title: How to reduce circuit elements of a decomposed $C^2(U)$ operation?Body: 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.
"
"['physical-realization', 'physical-qubit', 'superconducting-quantum-computing']"," Title: What is the difference between a cooper pair box and a transmon qubit?Body: 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?
"
"['qiskit', 'simulation']"," Title: Error ERROR_TRANSPILING_JOB when trying to simulate the circuitBody: 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];
"
"['physical-realization', 'physical-qubit']"," Title: Why don't qubits continuously rotate in the $z$ direction due to free time evolution?Body: 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!
"
"['quantum-gate', 'pauli-gates']"," Title: Is $M = a \mathbb{I} - ib \sigma_Z$ a valid representation in terms of logic gates?Body: 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?
"
"['programming', 'qiskit']"," Title: Loading Qiskit account in the Jupyter notebook gives RequestsApiError errorBody: 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?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'density-matrix', 'partial-trace']"," Title: How to find the reduced density matrix of a four-qubit system?Body: 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.
"
"['entanglement', 'density-matrix', 'bell-basis']"," Title: Determining the quantum secretBody: 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:
- First, Alice performs a local unitary operation randomly
on one of her two qubits 1 and 6, say, on qubit $1$.
- 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.
- 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$.
- 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$
- $${|\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)},$$
- 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)},$$
- 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)},$$
- 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$.
$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?
"
"['quantum-gate', 'mathematics']"," Title: Can one operator commute with four other operators?Body: 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?
"
"['error-correction', 'nielsen-and-chuang', 'stabilizer-code']"," Title: 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$ generatorsBody: 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...
"
"['qiskit', 'ibm-q-experience']"," Title: Access results from an experiment without having to run the script againBody: 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.
"
"['nielsen-and-chuang', 'stabilizer-code']"," Title: Given $n-k$ stabiliser generators, how can we find an additional $k$ commuting generators?Body: 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?
"
['entanglement']," Title: Is it possible to have entanglement with different sized parties or with more than 2 parties?Body: 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?
"
"['programming', 'qiskit']"," Title: Qiskit - Renormalize the qubit after measurementBody: 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")
"
"['qiskit', 'circuit-construction']"," Title: Why qiskit changed the order of gated applied to a circuitBody: 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
"
"['error-correction', 'stabilizer-code']"," Title: The importance of length-4 cycles in Quantum LDPC codesBody: 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).
"
['qiskit']," Title: How to obtain qubit's amplitude in qiskitBody: 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.
"
"['mathematics', 'textbook-and-exercises']"," Title: Intuitive meaning of the eigenvalues and eigenvectors of a reduced density matrixBody: 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.
"
['stabilizer-code']," Title: Stabilizer error correction conditionBody: 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 ?
"
"['qiskit', 'programming']"," Title: Qiskit plot_histogram and count not workingBody: 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.
"
"['algorithm', 'qiskit', 'grovers-algorithm', 'oracles']"," Title: In Grover's Algorithm, does the exact solution need to be given to the oracle?Body: 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)?
"
"['mathematics', 'quantum-fourier-transform']"," Title: How do I prove that $\sum_{y=0}^{N-1}e^{2\pi i xy/N}=N\delta_{x,0}$?Body: 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?
"
"['quantum-state', 'entanglement']"," Title: What is the probability of measuring $|j\rangle$ with $j\in\{0, 1, 2, ... N-1\}$?Body: 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.
"
['entanglement']," Title: Measuring a single qubit in 2 bit entangled stateBody: 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>$?
"
"['entanglement', 'measurement']"," Title: In the CHSH inequality, how can I know which term is supposed to have the minus sign?Body: 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.
"
['error-correction']," Title: Link between distance of a stabilizer code and number of errors it is able to correctBody: 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 ?
"
"['algorithm', 'programming', 'quantum-advantage']"," Title: What is the point of building arithmetic circuits in a quantum computer?Body: 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?
"
"['qiskit', 'circuit-construction']"," Title: How to get amplitudes only for chosen qubits?Body: 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.
"
"['quantum-gate', 'ibm-q-experience', 'physical-realization']"," Title: Why use U2 and U1 gate in IBM quantum computers?Body: 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
"
"['quantum-gate', 'quantum-state', 'bloch-sphere']"," Title: How are measurements on $Z$ and $X$ axes interpreted in the Bloch sphere?Body: 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.
"
['algorithm']," Title: Would the Lattice Boltzmann Method be more suitable for QC CFD than Navier-Stokes?Body: 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,
"
['quantum-state']," Title: 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?Body: $$\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?
"
['cirq']," Title: Is there a function that returns the probability of measuring a particular state in Cirq?Body: 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).
"
['measurement']," Title: Is measuring real qubit states in a complex basis such as $|0\rangle\pm i|1\rangle$ possible?Body: 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]$.
"
"['entanglement', 'measurement']"," Title: What is the state after entangled qubit transfer?Body: 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?
"
"['entanglement', 'teleportation']"," Title: What is the resultant composite quantum state after the transfer?Body: 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)$
"
"['qiskit', 'ibm-q-experience']"," Title: IBMQ.load_account from stored ACCOUNT is failing on Qiskit 0.9.0Body: 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'}
"
"['algorithm', 'programming', 'qiskit', 'qaoa']"," Title: How to understand run_algorithm() inputs in qiskitBody: 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?)
"
"['quantum-gate', 'notation']"," Title: What is the name for quantum gates that can be reversed?Body: 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?
"
"['quantum-gate', 'quantum-state']"," Title: Are all operations simply matrix multiplication?Body: 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.
"
"['physical-realization', 'architecture', 'physical-qubit', 'noise']"," Title: What are the physical reasons behind noise/errors in quantum computers?Body: 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.
"
"['quantum-gate', 'ibm-q-experience', 'simulation', 'ibm']"," Title: Can we simulate quantum many-body systems with IBMQ Experience?Body: 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?
"
"['simulation', 'universal-gates']"," Title: Quantum Simulation Of Tunneling in Small SystemBody: 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 .
"
"['quantum-gate', 'programming', 'q#']"," Title: How do these alternative Q# algorithms produce the same set of Bell states?Body: 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?
"
"['quantum-gate', 'tensor-product', 'deutsch-jozsa-algorithm']"," Title: How to factor the output of a CNOT acting on the input $|-,+\rangle$Body: 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?
"
"['textbook-and-exercises', 'pauli-gates', 'unitarity', 'linear-algebra']"," Title: Should a Pauli $X$ matrix equal the identity matrix to be unitary?Body: 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?
"
['qiskit']," Title: AttributeError: 'AerJob' object has no attribute 'get_counts'Body: 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'
"
"['entanglement', 'non-locality', 'nonclassicality', 'partial-transpose']"," Title: Are inseparable states with positive partial transpose nonlocal?Body: 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?
"
"['programming', 'q#']"," Title: How to add scalar to quantum stringBody: 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.
"
"['entanglement', 'quantum-operation', 'communication', 'channel-capacity']"," Title: Why does entanglement not increase the classical capacity of a channel?Body: 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.
"
"['qiskit', 'programming', 'ibm-q-experience', 'q#', 'cirq']"," Title: Overview of Cirq, qiskit, q#, ibmq(circuit board), otherBody: 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?
"
"['quantum-state', 'measurement']"," Title: Help in understanding an exercise on observable / measurementBody: 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?
"
"['communication', 'superdense-coding']"," Title: Eavesdropping in superdense coding: why can't the third party infer anything about the message?Body: 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?
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: Extensions of product statesBody: 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.
"
"['resource-request', 'tensor-networks']"," Title: Paper concerning distributing quantum computation on many small quantum computersBody: 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?
"
['mathematics']," Title: Why use inner and outer product?Body: 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""
"
"['measurement', 'interpretations']"," Title: Does the Copenhagen interpretation (+ ""quasi-classical measuring apparatus"") allow one to bypass a derivation's objection?Body: 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
- the Copenhagen interpretation
- the objective collapse interpretations
- the transactional interpretation
- the von Neumann interpretation in which consciousness causes
collapse.
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
"
"['algorithm', 'hamiltonian-simulation', 'q#', 'trotterization']"," Title: Ground state energy estimation - VQE vs. Ising vs. Trotter–SuzukiBody: 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?
"
"['decoherence', 'research', 'correlations', 'open-quantum-systems']"," Title: General Master Equation with Decoherence QueryBody: 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)?
"
"['programming', 'qiskit', 'q#']"," Title: Big Endian vs. Little Endian in QiskitBody: 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?
"
"['quantum-state', 'entanglement', 'measurement']"," Title: How to decode 2-bit message from 2 entangled qubits?Body: 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.
"
"['quantum-gate', 'mathematics', 'nielsen-and-chuang']"," Title: Can someone show the linear algebra calculations for X, H, and CNOT gates?Body: 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
"
"['mathematics', 'bloch-sphere']"," Title: How to prove that antipodal points on the Bloch sphere are orthogonal?Body: 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?
"
"['quantum-state', 'cloning']"," Title: Is their a way to perfectly clone coherent state and squeezed states?Body: 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?
"
"['quantum-state', 'bloch-sphere']"," Title: Can a mixed state be represented on a Bloch sphere?Body: 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?
"
['hadamard']," Title: 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>$Body: 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.
"
"['mathematics', 'matrix-representation']"," Title: Can I find the states of individual qubits in a quantum register using only linear algebra?Body: 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?
"
"['programming', 'qiskit']"," Title: Question on using the Collect2qBlocks() and ConsolidateBlocks() optimizationsBody: 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.
"
"['programming', 'qiskit', 'ibm-q-experience', 'qaoa']"," Title: Backend Warning: The skip Qobj validation does not work for IBMQ provider. Disable itBody: 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?
"
"['programming', 'qiskit', 'ibm-q-experience', 'hhl-algorithm']"," Title: Running HHL tutorial on real backendBody: 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.
"
"['quantum-gate', 'circuit-construction']"," Title: How to implement the controlled square root of NOT gate on the IBM Q composer?Body: 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.
"
"['qiskit', 'ibm-q-experience']"," Title: Is it possible to simulate or replicate a cryptographic algorithm using Qiskit?Body: 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?
"
"['programming', 'qiskit', 'quantum-state']"," Title: In Qiskit, when creating multi-bit quantum and classical registers, what is the ordering of MSB to LSB?Body: 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].
"
"['quantum-state', 'mathematics', 'measurement']"," Title: How to show whether two states are indistinguishable or not by measuring in a different basis?Body: 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!
"
"['quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Do quantum supremacy experiments repeatedly apply the same random unitary?Body: 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
- Initialize the $n$ qubits into the all-zero's ket $|000\cdots\rangle$
- Generate a random unitary $U$ of $m$ gates
- Apply the quantum gate $U$ to these qubits, e.g. produce the state $|\Psi\rangle=U|000\cdots\rangle$
- Measure $|\Psi\rangle$ to produce an $n$-bit classical string
- 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.
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?
"
"['mathematics', 'nielsen-and-chuang']"," Title: Time Evolution Operator of Rabi OscillationsBody: 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?
"
"['programming', 'resource-request', 'q#']"," Title: How do I start as a quantum computing programmer?Body: How do I learn Q#? What languages should I know prior to learning Q#? How do I get started with quantum computing?
"
"['entanglement', 'mathematics', 'teleportation']"," Title: Evaluate the following teleportation equation for $U = ZX$ and $a = 0, b = 0$Body: 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
"
"['algorithm', 'programming', 'rigetti', 'pyquil']"," Title: Newbie Project: Calculate a Mersenne Prime with Quantum ComputingBody: 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).
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Running jobs on different backends at the same timeBody: 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?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: How can we construct a square root of NOT gate in Qiskit and IBMQ circuit composer using universal gates?Body: 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.
"
"['algorithm', 'circuit-construction', 'mathematics']"," Title: Variational Quantum Eigensolver (VQE) - Question about finding the imaginary part of measurementBody: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to unpickle a Result object returned by an IBMQ experiment?Body: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How many classical registers are there on (IBM) quantum computers?Body: 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?
"
"['algorithm', 'amplitude-amplification']"," Title: Is there a quantum algorithm allowing to efficiently determine the state with the highest probability of occurring?Body: 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?
"
"['entanglement', 'bell-experiment', 'bell-basis']"," Title: Find the Bell States of A and B in the following scenarioBody: 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$]?
"
"['quantum-state', 'superposition']"," Title: How many combinations can 'n' qubits have?Body: 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?
"
"['algorithm', 'qiskit', 'qaoa']"," Title: QAOA Maxcut for larger qubitsBody: 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)
"
"['qiskit', 'ibm-q-experience', 'shors-algorithm']"," Title: Is it possible to run a general implementation Shor's algorithm on a real IBM quantum computer at least for N = 15?Body: 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.
"
['resource-request']," Title: What is the seminal reference for quantum computing?Body: If someone wanted to pinpoint the seminal reference on the subject of quantum computing, what would it be? Thanks.
"
"['programming', 'qiskit']"," Title: How to plot custom gate labels in Qiskit?Body: 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
"
"['density-matrix', 'entropy', 'information-theory']"," Title: How do I compute the Relative Entropy between pure and mixed states?Body: 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?
"
['qiskit']," Title: Quantum Circuit Properties typo (documentation bug?)Body: 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.
"
"['qiskit', 'ibm-q-experience']"," Title: What is ''524 Server Error''?Body:
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?
"
"['quantum-gate', 'superconducting-quantum-computing', 'quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate setBody: 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
"
"['quantum-gate', 'superconducting-quantum-computing', 'quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 2): simplifiable and intractable tilingsBody: 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
"
"['quantum-gate', 'superconducting-quantum-computing', 'quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): samplingBody: 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?
"
"['architecture', 'google-sycamore']"," Title: Location of ""bad"" qubits on SycamoreBody: 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.
"
"['quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Number of qubits to achieve quantum supremacy?Body: 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?
"
"['decoherence', 'terminology']"," Title: What is the difference between relaxation, dephasing, and decoherence?Body: 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)?
"
['notation']," Title: Notation question: How would one read $|0\rangle (|0\rangle+|0\rangle)$?Body: 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)$?
"
"['qiskit', 'circuit-construction']"," Title: n-qubit circuit run with > n qubits?Body: 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.
"
['error-correction']," Title: Distance and number of corrected errors in quantum error correctionBody: 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!
"
"['entanglement', 'error-correction', 'quantum-operation', 'information-theory', 'communication']"," Title: Entanglement-assisted hashing bound for asymmetric depolarizing channelsBody: 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?
"
"['qiskit', 'circuit-construction', 'ibm-q-experience']"," Title: What is a ""barrier"" in Qiskit circuits?Body: 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.
"
"['quantum-state', 'continuous-variable']"," Title: What is the mean value of displacement operator for the coherent state?Body: 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>$?
"
"['machine-learning', 'applications', 'artificial-intelligence']"," Title: Can quantum computing contribute to the development of artificial intelligence?Body: 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)?
"
"['algorithm', 'deutsch-jozsa-algorithm', 'hadamard']"," Title: Analysis of the second Hadamard in the Detusch-Jozsa AlgorithmBody: 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?
"
"['mathematics', 'tensor-product']"," Title: Is there an algorithm for determining if a given vector is separable or entangled?Body: 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.
"
"['mathematics', 'measurement', 'textbook-and-exercises', 'density-matrix']"," Title: Trace of Hermitian Operator and Operator FunctionBody: 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?
"
"['mathematics', 'tensor-product']"," Title: Understanding the action of operators on vectors in tensor product spacesBody: 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
"
"['classical-computing', 'unitarity']"," Title: How can classical computations be non-unitary?Body: 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?
"
"['quantum-gate', 'quantum-state', 'hadamard']"," Title: Can everything in QM be described with degrees instead of matrices and vectors?Body: 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?
"
"['applications', 'research']"," Title: Would all quantum computing research be for naught if a powerful enough quantum computer is never built?Body: 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?
"
"['quantum-operation', 'unitarity']"," Title: Is there a quantum operation whose output is always orthogonal to the input?Body: 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.
"
"['quantum-state', 'quantum-operation', 'pauli-gates']"," Title: The solution when we transmit a qubit through a Pauli channel?Body: 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?
"
['qiskit']," Title: Exploring quantum computing with QiskitBody: 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.
"
"['quantum-state', 'measurement']"," Title: How to design a measurement that distinguishes the following pair of two-qubit states?Body: 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.
"
"['algorithm', 'complexity-theory', 'simulation', 'quantum-fourier-transform', 'space-complexity']"," Title: What is the cost of implementing the Quantum Fourier transform in a classical computer?Body: 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?
"
"['programming', 'q#']"," Title: ResetAll with adjoint autoBody: 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.
"
"['ibm-q-experience', 'machine-learning']"," Title: Transfer trained machine learning modelBody: 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?
"
"['q#', 'quantum-fourier-transform']"," Title: Unable to recognise little-endian formatBody: 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);
}
"
"['quantum-state', 'bloch-sphere', 'state-space-geometry']"," Title: Do pure qudit states lie on a hypersphere in the Bloch representation?Body: 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?
"
['applications']," Title: Applications of quantum computing for science popularizationBody: 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.
"
"['algorithm', 'complexity-theory']"," Title: Quantum algorithms for Prolog or automated theorem proving?Body: 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).
"
"['experiment', 'entropy', 'quantum-advantage', 'google-sycamore']"," Title: Quantum Supremacy: Some questions on cross-entropy benchmarkingBody: 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:
- 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?
- 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.
- 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.
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:
- 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.
- 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?
- 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.
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?
"
['classical-computing']," Title: Can quantum computer perform classical computation?Body: 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?
"
"['quantum-gate', 'qiskit']"," Title: Is there a way to develop a multiple controlled X or Z gate on Qiskit without using ancillary qubits?Body: 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)?
"
"['quantum-state', 'programming', 'qutip']"," Title: 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?Body: 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?
"
"['quantum-state', 'ibm-q-experience']"," Title: Is IBM Q composer using little-endian representation for multi-qubit states?Body: 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
- putting the $|x\rangle$ qubit (left) on top, and the $|y\rangle$ one below, or by
- putting the $|y\rangle$ qubit (right) on top, and the $|x\rangle$ one below.
Is that correct?
- 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
- 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.
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?
"
"['mathematics', 'topological-quantum-computing', 'anyons', 'history']"," Title: History of anyon theory, braidings and tensor categoriesBody: 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?
"
['classical-computing']," Title: Does a quantum computer have a clock signal and if yes how big is it?Body: 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.
"
"['quantum-gate', 'quantum-state', 'notation']"," Title: Input and output qubit notation in quantum gatesBody: 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):
- 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?
- Is this notation is only valid for when $|x\rangle$ and $|y\rangle$ are orthonormal qubits in the standard basis?
- Is this just poor notation in general and I should try to avoid it?
- If so, why is it so common across quantum computing references, and is there a better way to express this?
"
['qiskit']," Title: When I load a saved account, I get a license-agreement error (links to old website)Body: 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?
"
"['quantum-gate', 'quantum-state', 'measurement', 'pauli-gates', 'photonics']"," Title: Physical Interpretation of Pauli Matrices as Polarization CheckBody: 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?
"
"['architecture', 'models', 'open-quantum-systems']"," Title: Why do quantum computation models based on open quantum systems receive so little attention?Body: 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
"
"['algorithm', 'quantum-state']"," Title: How to prepare an initial state for variational quantum algorithms?Body: 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.
"
['ibm-q-experience']," Title: IBM 53 qubit cloud accessBody: IBM announced a 53 qubit chip.
Will the advertised chip be available for non-paying users, or only to IBM clients?
"
"['programming', 'qiskit']"," Title: 'ERROR: QasmSimulator: Circuit cannot be run using available methods.'Body: 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')
```
"
"['quantum-gate', 'qiskit', 'universal-gates']"," Title: How many ancilla qubits to use with Multiple-Control Toffoli (mct) gate in Qiskit?Body: 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?
"
"['quantum-advantage', 'random-quantum-circuit', 'google-sycamore']"," Title: Are 20 repetitions of Sycamore's one- and 2-qubit gates sufficient to produce a uniformly random state?Body: 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.
"
"['quantum-gate', 'matrix-representation', 'history', 'hadamard']"," Title: Could the Hadamard gate have been constructed differently with similar characteristics?Body: 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?
"
"['algorithm', 'grovers-algorithm']"," Title: Why can we forget about the ancilla bit in Grover's algorithm?Body: $\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?
"
"['entanglement', 'measurement', 'bloch-sphere']"," Title: Probability of equal outcomes measuring a Bell state in the directions $\vec{n}_1,\vec{n}_2$Body: 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.
"
"['measurement', 'error-correction', 'experiment']"," Title: Is manual or automated error correction more practically promising in the near term?Body: 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:
- 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.
- 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.)
"
"['measurement', 'density-matrix', 'partial-trace']"," Title: Prove that the partial trace is equivalent to measuring and discardingBody: 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.
"
"['algorithm', 'research']"," Title: Ideas for school-level project on quantum computingBody: 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.
"
"['programming', 'qiskit']"," Title: `execute()` hangs and eats memoryBody: 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?
"
"['programming', 'qiskit', 'resource-request']"," Title: Resources in Spanish to start learning quantum computing and quantum programming (Qiskit)Body: 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.
"
"['mathematics', 'tensor-networks']"," Title: How to split a 2-local unitary operator through singular value decomposition?Body: 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?
"
"['complexity-theory', 'quantum-turing-machine']"," Title: Explicit Construction of Classical Rules in Quantum Turing MachineBody: 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,
- 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$
- Interchange $s,x_n$, so $|0,q,s,x_0,x_1\rangle\mapsto|n,q,x_0,s,x_1\rangle$.
- Logical flip the pointer bit, $|n,q,s,x_0,x_1\rangle\mapsto|\lnot n,q,s,x_0,x_1\rangle$.
- 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.$
- Swap back everything as prevously done, $|1,q,s,x_0,x_1\rangle\mapsto|0,q,x_0,s,x_1\rangle$.
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?
"
"['quantum-gate', 'measurement']"," Title: What's the difference between observing in a given direction and operating in that same direction?Body: 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!
"
"['classical-computing', 'performance']"," Title: Quantum computer vs. supercomputer performanceBody: 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.
"
"['qiskit', 'noise']"," Title: Implementing noise model in Qiskit using arbitrary basis gatesBody: 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)
"
"['information-theory', 'quantum-fisher-information', 'quantum-metrology']"," Title: Why is the quantum Fisher information for pure states $F_Q[\rho,A]=4(\Delta A)^2$?Body: 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.
"
"['chemistry', 'solid-state', 'many-body-systems']"," Title: Do we know anything about the computational complexity of the exchange-correlation functional?Body: 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?
"
"['programming', 'qiskit', 'cirq']"," Title: How to prepare a specific initial state of three qubits?Body: 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?
"
"['circuit-construction', 'chemistry']"," Title: Developing quantum circuits for specific quantum chemistry configurationsBody: 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.
"
"['mathematics', 'density-matrix']"," Title: 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)$Body: 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.
"
"['quantum-gate', 'quantum-state', 'algorithm', 'swap-test']"," Title: How and why does swap test works?Body: 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.
"
"['pauli-gates', 'stabilizer-state', 'quantum-fisher-information']"," Title: Stabilizer state QFI lower limit queryBody: 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)]$$
"
"['error-correction', 'optical-quantum-computing', 'quantum-optics']"," Title: Shor's Code: Understanding how it satisfies Knill Laflamme TheoremBody: 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
"
"['quantum-gate', 'measurement']"," Title: Why does a controlled gate not constitute a measurement?Body: 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?
"
"['quantum-gate', 'entanglement', 'mathematics']"," Title: How to check if a two-qubit gate is entangling?Body: 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...
"
"['mathematics', 'error-correction', 'pauli-gates']"," Title: Matrix Index and multiplication rules for Hermitian Pauli group productsBody: 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.
"
"['quantum-gate', 'quantum-state', 'entanglement', 'teleportation']"," Title: Understanding shared Bell states from quantum entanglementBody: 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?
"
"['quantum-gate', 'quantum-state', 'bell-basis']"," Title: Transforming the first Bell state into the other Bell statesBody: 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?
"
"['quantum-state', 'entanglement', 'resource-request', 'history']"," Title: What does W stand for in the W entangled state?Body: 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
"
"['algorithm', 'resource-request']"," Title: Open problems in quantum algorithmsBody: 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?
"
['applications']," Title: Can we hope in the near future to have web apps running quantum algorithms in real-time?Body: 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?
"
"['algorithm', 'entanglement', 'shors-algorithm', 'entropy']"," Title: How to measure entanglement in an algorithm?Body: 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.
"
['cirq']," Title: Cirq: Any interesting introductory level example using 2D grid of qubits?Body: 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!
"
"['algorithm', 'quantum-gate']"," Title: How to decompose a unitary transform into two-level unitary matrices?Body: 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!
"
"['complexity-theory', 'non-locality']"," Title: Is quantum complexity basis-invariant?Body: 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.
"
"['quantum-gate', 'mathematics', 'pauli-gates', 'textbook-and-exercises', 'hadamard']"," Title: How do I prove that the Hadamard satisfies $H\equiv e^{i\pi H/2}$?Body: 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
"
"['algorithm', 'phase-estimation']"," Title: Why must we take multiple measurements for different values of $M$?Body: 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?
"
"['programming', 'cirq']"," Title: cirq.Ry complains that it needs one argumentBody: 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
"
"['physical-qubit', 'quantum-advantage', 'ibm', 'google-sycamore']"," Title: Why do the IBM and Google processors both have 53 qubits?Body: 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?
"
"['quantum-advantage', 'ibm', 'google-sycamore']"," Title: Why does Google's quantum processor outperform IBM's?Body: 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?
"
"['qiskit', 'simulation', 'noise']"," Title: How to selectively apply noise in Qiskit simulations?Body: 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?
"
"['algorithm', 'complexity-theory', 'quantum-advantage', 'bqp', 'google-sycamore']"," Title: What does Google's claim of ""Quantum Supremacy"" mean for the question of BQP vs BPP vs NP?Body: 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 ?
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'gate-synthesis']"," Title: Decomposing a controlled phase gate into CNOTsBody: 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.
"
"['algorithm', 'qiskit', 'shors-algorithm', 'd-wave']"," Title: Suggestions for hybrid factoring algorithm on DWave and QiskitBody: 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!
"
"['algorithm', 'qaoa', 'vqe']"," Title: Is VQE a class of algorithms or a specific algorithm?Body: 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?
"
"['algorithm', 'quantum-gate', 'grovers-algorithm', 'quirk']"," Title: Exact functions of a single-iteration Grover Search Algorithm's operatorsBody: 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):
- 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.
- 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.
- The CNOT gate (with $C_I$ and $C_{II}$ as controls) affects only the $|11C_{III}\rangle$ vector.
- The CNOT gate multiplies the $|11C_{III}\rangle$ vector by $-1$ and does not affect other vectors.
- 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.
- The NOT gate on $C_{III}$ multiplies the system vector by $-1$, thus the system vector is reflected relative to $|s\rangle$.
- The NOT gate on the $C_{III}$ qubit is unnecessary.
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.
"
['simulation']," Title: What is the current research status in simulating many-particle systems from first principles?Body: 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.
"
"['communication', 'non-locality', 'steering']"," Title: Understanding the idea of ""local hidden state model""Body: 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?
"
['mathematics']," Title: Conditional probability between parameter and operator in quantum mechanics?Body: 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?
"
"['algorithm', 'mathematics', 'grovers-algorithm']"," Title: What is the probability of observing a search string $\omega$ after $r$ iterations of Grover's algorithm?Body: 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$?
"
"['algorithm', 'grovers-algorithm', 'terminology']"," Title: Significance of the term ""diffusion"" in Grover's diffusion operatorBody: 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?
"
"['classical-computing', 'nonclassicality']"," Title: If classical physics emerges in some limit of quantum mechanics, shouldn't there be intermediate classical-quantum computers?Body: 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?
"
"['entanglement', 'partial-transpose', 'state-distillation', 'ppt-criterion']"," Title: Why is $\rho$ NPT if and only if $\rho^{\otimes N}$ is NPT?Body: 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?
"
"['quantum-gate', 'gate-synthesis']"," Title: How to factor Ising YY coupling gate into product of basic gates?Body: 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?
"
"['mathematics', 'density-matrix', 'tensor-product', 'trace-distance']"," Title: Prove that $\|p^{\otimes n} - q^{\otimes n}\| \leq n \|p-q\|$ for density operators $p,q$Body: 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.
"
"['algorithm', 'complexity-theory', 'qma']"," Title: Better ""In-Place"" Amplification of QMABody: $\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})$.
"
"['algorithm', 'programming', 'resource-request', 'optimization']"," Title: General mixed integer linear programming problem with quantum computersBody: 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?
"
"['quantum-state', 'nielsen-and-chuang', 'tensor-product']"," Title: Clarification of bra-ket notationBody: How do I get from equation 1.31 to equation 1.32? It seems like some terms are changing.
"
"['classical-computing', 'applications']"," Title: Can Quantum Voting Machine replace Electronic Voting Machine (EVM) in future?Body: 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?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to parallelly run a quantum circuit on IBMQ?Body: 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.
"
['quantum-parallelism']," Title: Can I imagine quantum computers as working via parallel computing?Body: 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.
"
"['algorithm', 'resource-request']"," Title: Could second quantisation and QFT become a problem when scaling up quantum computers?Body: 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?
"
['density-matrix']," Title: About production and disagreements between density matricesBody: 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?
"
"['algorithm', 'annealing']"," Title: Max eigenvalue algorithm via annealing starting from Gibbs stateBody: 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:
- Prepare the Gibbs state $\rho=e^{\beta H}/\text{tr}(e^{\beta H})$
- Cool down the system, i.e. take the limit $\beta \to \infty$
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:
- 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$?
- 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.
"
"['quantum-state', 'mathematics', 'quantum-operation']"," Title: 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?Body: 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$.
"
"['quantum-advantage', 'google-sycamore']"," Title: Making sense of the Sycamore's computing prowess - power consumptionBody: 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!
"
"['qiskit', 'ibm-q-experience']"," Title: Error on loading account with qiskit: ""TypeError: __init__() missing 1 required positional argument: 'url'""Body: 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?
"
"['quantum-advantage', 'random-quantum-circuit']"," Title: How does successfully sampling from a random quantum circuit invalidate the Extended Church-Turing Thesis?Body: 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.
- 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.
- 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.
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?
"
"['complexity-theory', 'quantum-advantage', 'random-quantum-circuit', 'google-sycamore', 'church-turing-thesis']"," Title: How exactly is solving the random circuit sampling problem a computation in the Church-Turing thesis sense?Body: 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?
"
"['quantum-state', 'circuit-construction']"," Title: 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$?Body: 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?
"
"['quantum-gate', 'entanglement', 'graph-states']"," Title: Query on paper on entanglement in graph statesBody: 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.
"
['entanglement']," Title: Faster than light data transmission using entanglementBody: 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)?
"
"['ibm-q-experience', 'measurement', 'error-mitigation']"," Title: Existing measurement error mitigationBody: 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?
"
"['qiskit', 'ibm-q-experience']"," Title: Attribute error in QiskitBody: 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?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: What is the difference between Grover's and Amplitude Amplification?Body: 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?
"
['quantum-state']," Title: How can infinite information be theoretically encoded or stored in a single qubit?Body: 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.
"
"['algorithm', 'superposition']"," Title: How do quantum states collapse to the right answer?Body: 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.
"
"['entanglement', 'quantum-networks']"," Title: Entanglement and distributed consensusBody: Are there any distributed consensus protocols which make use of quantum phenomena for improved performance? For example, symmetry breaking with a shared quantum state.
"
"['entanglement', 'pauli-gates']"," Title: How does a single-qubit gate affect other qubits?Body: 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.
"
"['qiskit', 'ibm-q-experience', 'measurement', 'vqe', 'error-mitigation']"," Title: Problem with measurement error mitigation using VQEBody: 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?
"
"['mathematics', 'density-matrix']"," Title: What can we know about the eigenvalues of a reduced density matrix knowing the eigenvalues of the original matrix?Body: 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?
"
"['algorithm', 'quantum-gate', 'circuit-construction']"," Title: How to build a CNOT out of universal CCNOT gates?Body: 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?
"
"['cirq', 'noise']"," Title: How to add noise to existing gates in Cirq?Body: 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?
"
"['superposition', 'quantum-parallelism', 'interpretations']"," Title: Effects of quantum computing on parallel universesBody: 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,
- is this actually an accurate description of how quantum computers work, or just a misrepresentation?
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:
- 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?
- 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?
"
"['algorithm', 'speedup', 'research']"," Title: Could quantum computing help solving the Eternity II puzzle?Body: 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?
"
"['mathematics', 'error-correction', 'google-sycamore']"," Title: Can we conclude that errors on Sycamore are Poisson-distributed Pauli errors?Body: 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?
"
"['algorithm', 'quantum-state', 'programming']"," Title: The Elevator ProblemBody: 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?
"
"['quantum-gate', 'decoherence', 'graph-states']"," Title: Dephasing in graph statesBody: 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.
"
"['circuit-construction', 'ibm-q-experience', 'teleportation']"," Title: Trying to build a circuit for quantum teleportation on IBMQ I get ERROR_RUNNING_JOB errorBody: 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.
"
"['quantum-state', 'entanglement', 'circuit-construction', 'cryptography', 'quantum-fourier-transform']"," Title: Secret sharing though quantum operationsBody: 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??
"
"['algorithm', 'programming', 'simulation', 'matlab']"," Title: Can my MatLab code be used as a good simulator of a quantum computer?Body: 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.
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Why is the Deutsch algorithm faster on a quantum computer?Body: 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?
"
"['cirq', 'qaoa', 'vqe']"," Title: Is there a mistake in the VQE Ansatz in Cirq's tutorial?Body: 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?
"
"['qiskit', 'simulation']"," Title: In qiskit, doing 2 subsequent measurements of a Hadamard gate on the same qubit always gives 0 on the 2nd oneBody: 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?
"
"['qiskit', 'programming']"," Title: What is the location of the Qiskit config file?Body: 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?
"
"['quantum-state', 'bloch-sphere', 'state-space-geometry', 'trace-distance']"," Title: Does the trace distance have a geometric interpretation?Body: 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.
"
['dynamics']," Title: Quantify the probability in guessing the Hamiltonian?Body: 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 |$
"
"['ibm-q-experience', 'measurement', 'error-mitigation']"," Title: Tensored vs ordinary measurement mitigation runtimeBody: 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.
"
"['algorithm', 'models', 'quantum-parallelism']"," Title: Is quantum parallel search impossible?Body: 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?
"
"['entanglement', 'density-matrix', 'graph-states']"," Title: Query on Reduced Graph StatesBody: 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.
"
"['qiskit', 'ibm-q-experience', 'vqe']"," Title: Many jobs hanging after creatingBody: 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
"
['qiskit']," Title: How do I find out which stable Python version Qiskit will be compatible to?Body: 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!
"
"['resource-request', 'superconducting-quantum-computing']"," Title: Is there any tool for generating Hamiltonian for circuit-QED?Body: 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.
"
"['mathematics', 'matrix-representation', 'pauli-gates', 'textbook-and-exercises']"," Title: Can arbitrary matrices be decomposed using the Pauli basis?Body: 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
"
"['physical-qubit', 'superposition']"," Title: What is the difference between superposition of $|0\rangle$ and superposition of $|1\rangle$ at physical level?Body: 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?
"
"['quantum-state', 'mathematics']"," Title: 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$?Body: 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?
"
['circuit-construction']," Title: How to get a large collection of quantum circuits that are valuable to practitioners?Body: 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?
"
"['quantum-state', 'measurement', 'tomography']"," Title: How to distinguish two states with same density matrix using a quantum state tomography?Body: 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?
"
"['algorithm', 'complexity-theory', 'qma']"," Title: Marriott-Watrous style amplification with a quantum inputBody: $\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.
"
"['quantum-state', 'error-correction', 'nielsen-and-chuang']"," Title: Nielsen & Chuang Exercise Question on CSS codeBody: 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?
"
['ibm-q-experience']," Title: IBM Circuit Composer pane is blankBody: 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.
"
"['programming', 'qiskit']"," Title: What is the time zone for the time returned by backend.properties()?Body: 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)?
"
"['mathematics', 'resource-request']"," Title: How to construct Schur-Weyl decomposition of independent and identically distributed mixed qudit states?Body: 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:
- 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}$.
- 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)?
"
"['quantum-state', 'algorithm']"," Title: Does anyone has some code for Mathematica or Python to convert a diagonal matrix into Dirac (bra-ket) notation?Body: 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. :)
"
"['quantum-gate', 'programming', 'qiskit', 'unitarity']"," Title: Trying to make irreversable operation in the quantum circuitBody: 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.
"
"['quantum-gate', 'random-quantum-circuit']"," Title: What is quantum gate's correponding circuit implementation?Body: 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?
"
"['measurement', 'projection-operator']"," Title: What does ""measuring a state"" mean?Body: 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.
- 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$.
- 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}}$.
- 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?
- 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?
"
"['programming', 'qiskit', 'grovers-algorithm']"," Title: How do you pass input to a circuit?Body: 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?
"
"['density-matrix', 'matrix-representation', 'hadamard']"," Title: What is the matrix representation for $n$-qubit gates?Body: 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?
"
"['quantum-state', 'quantum-operation']"," Title: What goes wrong if I try to simulate a system with a larger Hilbert space with a smaller Hilbert space?Body: 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?
"
['entanglement']," Title: Is it possible to have entanglement between more than two qubits?Body: 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.
"
"['physical-qubit', 'quantum-advantage', 'd-wave']"," Title: What is the problem in demonstrating quantum supremacy?Body: 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.
"
"['entanglement', 'pauli-gates', 'stabilizer-state']"," Title: Expectation Value of StabilizerBody: 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.
"
"['quantum-gate', 'qiskit', 'programming', 'noise']"," Title: How do I know in which state the qubit is in each step of the circuit for the simulator in qiskit?Body: I would like to know how to know in which state a qubit is (I am talking about single-qubit errors), because in order to apply a non unitary gate in the simulator I have to renormalize the state or the corresponding non unitary Kraus operator (the non unitary gate in my circuit). Therefore I need to know in which state the circuit it. I am of course talking about the simulator, which in fact is classical and therefore it must be a way to know the state at each point of the circuit.
"
['algorithm']," Title: How can we compare quantum algorithms against classical equivalents?Body: I am trying to understand Deutsch-Jozsa algorithm. It is mentioned as the first algorithm to demonstrate exponentially faster performance compared to classical algorithms for the same problem.
What I find missing in most explanations is why the quantum algorithm can be analyzed using the same complexity analysis as that of classical algorithms. It doesn't seem like an apple to apple comparison to me.
More concretely:
1. Classical solutions require at-least $2^{n-1}+1$ evaluations of the black-box function where $n$ is the number of classical bits.
2. Deutsch-Jozsa algorithm requires a single evaluation of the black-box function. However, it takes as input $n$ qubits.
- $n$ qubits is not the same as $n$ classical bits. They require exponentially more information to simulate.
- The black-box function is not the same in both cases since one deals with classical bits whereas the other deals with qubits.
Considering we've changed the input as well as the function, how can we compare these two solutions and make the claim that one is exponentially faster than the other?
"
"['qiskit', 'quantum-state', 'ibm-q-experience', 'fidelity', 'state-preparation']"," Title: How can I find the fidelity of the preparation operation $|0\rangle$ of IBMQ?Body: I want to know the fidelity (or error rate) of the preparation of $|0\rangle$. How can I obtain it?
"
"['quantum-gate', 'circuit-construction']"," Title: General approach for switching control and target qubitBody: It is well known that circuit
can be replaced with this circuit
The situation is even easier in case of controlled $\mathrm{Z}$ where gate controlled by $q_0$ and acting on $q_1$ have same matrix as one controlled by $q_1$ and acting on $q_0$. This means that replacing gate controled by qubit ""below"" with one controlled by qubit ""above"" does not need any additional gate.
I was thinking about general case, i.e. how to replace general controlled gate $\mathrm{U}$ with controlling qubit ""below"" by the gate controlled by qubit ""above"". The very basic idea is to apply swap gate, then controlled $\mathrm{U}$ with controlling qubit ""above"" and then again swap gate. This is right approach because $\mathrm{U}$ gate controlled by qubit ""above"" is described by matrix
$$
\mathrm{CU_{above} =}
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & u_{11} & u_{12} \\
0 & 0 & u_{21} & u_{22}
\end{pmatrix}
$$
and the gate controlled by qubit ""below"" has this matrix
$$
\mathrm{CU_{below} =}
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & u_{11} & 0 & u_{12} \\
0 & 0 & 1 & 0 \\
0 & u_{21} & 0 & u_{22}
\end{pmatrix}.
$$
It can be easily checked that $\mathrm{CU_{bellow}} = \mathrm{SWAP} \cdot \mathrm{CU_{above}} \cdot \mathrm{SWAP}$.
Swap gate can be implemented with three $\mathrm{CNOT}$, two controlled by qubit ""above"", one controlled by qubit ""below"". However, the latter can be converted to $\mathrm{CNOT}$ controlled by qubit ""above"" with help of Hadamards. Ultimatelly, all $\mathrm{CNOT}$s in swap gate are controlled by qubit ""above"".
So, this is a desired general approach how to convert a gate controlled by qubit ""below"" to one controlled by qubit ""above"". However, application of two swap gates increases depth of the circuit.
My question are these:
- Is there a simpler general approach how to convert a gate controlled by qubit ""below"" to one controlled by qubit ""above""?
- Are there other specific construction for other controlled gates similar to approach for controlled $\mathrm{X}$ and $\mathrm{Z}$? For example for controlled $\mathrm{Y}$, $\mathrm{H}$, $\mathrm{Ry}$ etc.
"
"['programming', 'ibm-q-experience']"," Title: How can I get the entire histogram in a 5 qubit program done in IBM quantum experience machine?Body: I have run a program on an IBM quantum experience machine which involves 5 qubits. Obviously when I measure the whole system I have 32 results but the machine only represents 20 in the histogram. In this situation the program tells you to download the results. The problem is that when I pick ""Download PNG"" or ""Download SVG"" it continues to show me a 20 results histogram. There is another option that is to pick ""Download results"" but it downloads two .json documents which I'm not sure I know how to change into a histogram.
"
['error-correction']," Title: How is the theory of modular representation involved with error-correction?Body: Recently, I have heard that the theory of modular representation can be involved with error correction in quantum information theory. However, from a point of view of mathematician, I am still quite unclear how modular representations can be used in error correction, could anyone here give some explanation? Some good references will also be helpful.
"
"['ibm-q-experience', 'physical-realization', 'd-wave', 'google-sycamore']"," Title: Which subatomic particle does each company use in quantum computing?Body: Probably each company (Google, Amazon, Intel, IBM, Microsoft, D-Wave and so on) uses a mix of subatomic particles and technologies. I would like to know which particles/technologies are used by each company.
Are there specific reasons to choose a particular technology?
"
"['qiskit', 'circuit-construction', 'ibm-q-experience', 'grovers-algorithm']"," Title: Are $\mathrm{cRz}$ with angle $\pi$ and $\mathrm{cZ}$ equal on the IBM Quantum Experience?Body: I was trying to implement the 2-qubit Grover algorithm without the auxiliary bit. Before finding the gate symbol for the controlled $\mathrm{Z}$, I worked with the controlled $\mathrm{Rz}$. The gate glossary states: "" $\mathrm{Z}$ is equivalent to $\mathrm{Rz}$ for the angle $\pi$"". So I thought the controlled $\mathrm{Rz}$ with angle $\pi$ should be equal with the controlled $\mathrm{Z}$ gate. However, I get very different results in the browser state-vector representation.
So my question is, should they be equivalent?
Here are my circuits:
"
"['qiskit', 'programming']"," Title: Is there a limited number of features for QSVM in Qiskit-Aqua?Body: Why do all tutorials that use QSVM from qiskit Aqua library have the number of features equal to 2?
"
"['qiskit', 'physical-realization', 'physical-qubit', 'ibm', 'openpulse']"," Title: How to deal with the relative phase from the evaluation of the not interacting qubit?Body: Every qubit is a realization of some two-level quantum system with $\left| 0 \right\rangle$ and $\left| 1 \right\rangle$ states. These states have their energies $E_0$ and $E_1$ respectively. By solving the Schrödinger equation for the two-level quantum system one can show time evaluation of the $\left| 0 \right\rangle$, $\left| 1 \right\rangle$ and $\left| + \right\rangle$ states:
$$
\left| \psi_0(t) \right\rangle = e^{-i \frac{E_0}{\hbar} t} \left| 0 \right\rangle \\
\left| \psi_1(t) \right\rangle = e^{-i \frac{E_1}{\hbar} t} \left| 1 \right\rangle \\
\left| \psi_+(t) \right\rangle = \frac{1}{\sqrt{2}}\left( e^{-i \frac{E_0}{\hbar} t} \left| 0 \right\rangle + e^{-i \frac{E_1}{\hbar} t} \left| 1 \right\rangle \right)=
\frac{e^{-i \frac{E_0}{\hbar} t}}{\sqrt{2}} \left(\left| 0 \right\rangle + e^{-i \frac{E_1 - E_0}{\hbar} t} \left| 1 \right\rangle \right)
$$
My question is about the relative phase $\varphi = e^{-i \frac{E_1 - E_0}{\hbar} t}$. This $\phi$ acts as a phase gate and changes the quantum state. Is this relative phase important and how in real quantum computers we should deal with it? One problem that I see is the following circuit:
After the measurement, the state should be $\left| 0 \right\rangle$, because $HH = I$. But If $t$ is such that the $\varphi = \pi$ then we will measure $\left| 1 \right\rangle$. We can forget about it if $\varphi(t) << \pi$ in the whole computational time. Otherwise, we should make sure that the time between gates should be $2\pi$.
Is this a problem and if yes how IBM, Google or etc. deal with this problem when constructing the circuits? How I understand the frequency $(E_1 - E_0)/\hbar$ value is important and for example, the ibmq_armonk qubit's frequency is equal to ~4.97428 GHz (qiskit_textbook), so should we take into account this value when we play with ibmq_armonk by using OpenPulse?
"
"['resource-request', 'd-wave']"," Title: Is it possible to use D-Wave systems for free?Body: IBM offers its platform IBM Q for free with certain constraints, such as available quantum processors and number of jobs running in parallel.
I was wondering whether there is the same possibility on D-Wave quantum annealers. I looked at D-Wave web page but I was not able to find any useful information.
Does anyone have any experience with D-Wave and possibility to at least sign up for free to some trial version?
"
"['cryptography', 'communication', 'bb84']"," Title: What is the quantum state transmitted to Bob in BB84 protocol?Body: Sender (Alice) wants to exchange private encryption key with Bob using BB84 protocol. She generate a binary string (1010100010010111),and encode using Hadamard gate and identity gate (HHHIIHIHHIIIHIIH).
What is the quantum state she transmits to reciever (Bob)?
"
"['algorithm', 'qiskit', 'qaoa', 'vqe']"," Title: VQE with error dim. mismatch using qiskit.aqua.vqeBody: when i try to call the VQE from qiskit I get an error of dimmismatch. The input matrix is of a 16x16 shape and I could not find out what where I introduce the error. In the picture The input matrix and the qubit0p is shown. I get the same error when trying to use QAOA as well
Thank you for taking the time.
self.C = self.C[:,:len(self.C[0])]
self.B = self.B[:,:len(self.B[0])]
print(""Input:"",self.C)
qubitOp = MatrixOperator(self.C)
print(qubitOp)
backend = Aer.get_backend('statevector_simulator')
var_form = RYRZ(qubitOp.num_qubits,10)
optim = COBYLA()
vqe = VQE(qubitOp, var_form, optim)
# Runs the VQE over the backend defined above.
result_vqe = vqe.run(backend)
print(qubitOp) # prints operator properties
print('energy', result_vqe['energy'], '\n')
print(result_vqe)
Here is the error
ValueError Traceback (most recent call last)
<ipython-input-1-03f1f6dbe796> in <module>
76 print_state(state)
77
---> 78 bundle_adjust(state)
79 print(""= Bundle Adjusted State ="")
80 print_state(state)
<ipython-input-1-03f1f6dbe796> in bundle_adjust(state)
39
40 # note: intervene here with other optimizers
---> 41 o.optimize()
42
43 # normalize scale (note: ~ is __invert__, *noisy is __imul__)
~\Bachelor-Project\BA\optimizerVQE3.py in optimize(self)
65 # run optimization
66 def optimize(self):
---> 67 for event in self.optimize_it():
68 pass
69
~\Bachelor-Project\BA\optimizerVQE3.py in optimize_it(self)
131
132 # Runs the VQE over the backend defined above.
--> 133 result_vqe = vqe.run(backend)
134
135 print(qubitOp) # prints operator properties
~\Anaconda3\lib\site-packages\qiskit\aqua\algorithms\quantum_algorithm.py in run(self, quantum_instance, **kwargs)
65 quantum_instance.set_config(**kwargs)
66 self._quantum_instance = quantum_instance
---> 67 return self._run()
68
69 @abstractmethod
~\Anaconda3\lib\site-packages\qiskit\aqua\algorithms\adaptive\vqe\vqe.py in _run(self)
314 if self._auto_conversion:
315 self._operator = \
--> 316 self._config_the_best_mode(self._operator, self._quantum_instance.backend)
317 for i in range(len(self._aux_operators)):
318 if not self._aux_operators[i].is_empty():
~\Anaconda3\lib\site-packages\qiskit\aqua\algorithms\adaptive\vqe\vqe.py in _config_the_best_mode(self, operator, backend)
236 ""achieve the better performance. We convert ""
237 ""the operator to weighted paulis."")
--> 238 ret_op = op_converter.to_weighted_pauli_operator(operator)
239 return ret_op
240
~\Anaconda3\lib\site-packages\qiskit\aqua\operators\op_converter.py in to_weighted_pauli_operator(operator)
86 list(itertools.product(possible_basis, repeat=num_qubits)),
87 task_kwargs={""matrix"": operator._matrix},
---> 88 num_processes=aqua_globals.num_processes)
89 for trace_value, pauli in results:
90 weight = trace_value * coeff
~\Anaconda3\lib\site-packages\qiskit\tools\parallel.py in parallel_map(task, values, task_args, task_kwargs, num_processes)
142 results = []
143 for _, value in enumerate(values):
--> 144 result = task(value, *task_args, **task_kwargs)
145 results.append(result)
146 _callback(0)
~\Anaconda3\lib\site-packages\qiskit\aqua\operators\op_converter.py in _conversion(basis, matrix)
36 def _conversion(basis, matrix):
37 pauli = Pauli.from_label(''.join(basis))
---> 38 trace_value = np.sum(matrix.dot(pauli.to_spmatrix()).diagonal())
39 return trace_value, pauli
40
~\Anaconda3\lib\site-packages\scipy\sparse\base.py in dot(self, other)
361
362 """"""
--> 363 return self * other
364
365 def power(self, n, dtype=None):
~\Anaconda3\lib\site-packages\scipy\sparse\base.py in __mul__(self, other)
478 if issparse(other):
479 if self.shape[1] != other.shape[0]:
--> 480 raise ValueError('dimension mismatch')
481 return self._mul_sparse_matrix(other)
482
ValueError: dimension mismatch
"
['hhl-algorithm']," Title: Implementation of matrix A in HHL algorithm circuitBody: In HHL algorithm, how do we implement matrix $A$ (where $A|x\rangle = |b\rangle$) in the circuit?
"
"['density-matrix', 'quantum-fourier-transform', 'experiment']"," Title: What does ""decoherence attenuates the density matrix"" mean?Body: I'm reading the paper Implementation of the Quantum Fourier Transform. On page 4, they write
To a first approximation, decoherence during the course of the QFT attenuates the entire density matrix. This is shown in figure 2.
I know that the word "attenuate" means to dampen or reduce the force of something. Since density operators have trace one, perhaps this means that the QFT decreases the trace of the density operator.
My question is: What is meant by attenuate here?
"
"['qiskit', 'vqe']"," Title: Qiskit statevector_simulator returns different resultsBody: I'm running VQE algorithm from qiskit aqua on statevector_simulator and each time I run it I get different results which are sometimes correct and sometimes not. I'm not sure if I'm setting parameters correctly.
Here is my code:
The qubitOp is generated with DOcplex module.
max_trials = 80
depth = 1
entanglement='full'
slsqp = SLSQP(maxiter=max_trials)
ry = RY(qubitOp.num_qubits, depth=depth, entanglement=entanglement)
vqe = VQE(qubitOp, ry, slsqp)
provider = IBMQ.get_provider('ibm-q')
backend = Aer.get_backend('statevector_simulator')
quantum_instance = QuantumInstance(backend,seed_simulator=seed, seed_transpiler=seed, optimization_level=0)
res = vqe.run(quantum_instance)
"
['cirq']," Title: Cirq: creating a new device with custom coupling topology?Body: Cirq has two in-built realizations of quantum hardware, which are realized as GridQubit() and LineQubit() classes (naming convention is slightly disturbing:).
GridQubit device mimics connectivity of Google's quantum chips (Bristlecone, Sycamore) and qubits are arranged in a 2D grid with nearest-neighbor couplings.
https://github.com/quantumlib/Cirq/blob/master/cirq/devices/grid_qubit.py
LineQubit device represents chips with 1D geometry, where qubits are arranged in a line and again only nearest-neighbor qubits are coupled.
Is there any possibility to specify a custom hardware coupling map? E.g. to specify adjacency matrix of new connectivity graph?
It seems that a user has to create his/her own device class for such functionality.
"
"['quantum-state', 'measurement']"," Title: Is there a measure similar to the Helstrom measurement which can distinguish between more than 2 pure quantum states?Body: My understanding is the Helstrom measurement distinguishes between 2 pure quantum states.
Is there a measure similar to the Helstrom measurement which can distinguishes between more than 2 pure quantum states? Or can the Helstrom measurement be generalized to do this?
"
"['quantum-turing-machine', 'biology', 'biocomputing']"," Title: Do biological brains compute using quantum mechanics?Body: Someone on research gate said the answer was no
Our brain is a neural network with a very complex connectome. Any system is in a sense a computer adhering quantum mechanics, but what is known about human brain doesn’t tell us it uses quantum-mechanical effects such as entangled states and superposition states as en essential element of computation.
So the human brain is more like a classical computer Or is the brain not like a Turing machine?
"
"['quantum-gate', 'circuit-construction', 'hamiltonian-simulation']"," Title: Constructing a time evolution operator $e^{it H}$ for $H^2=I$Body: Consider a Hamiltonian $H = \sigma_x \otimes \sigma_z$
Construct the time evolution operator $U(t) = \mathrm{e}^{-\frac{iHt}{\frac{h}{2\pi}}}$ [Hint:Write down the expansion of $\mathrm{e}^x$ and use the property of $H^2$]
This was one of my assignment problems and I really couldn't make sense of what the hint implied and ended up getting $H^2 = I$ and don't really know how and where to use this.
"
"['gate-synthesis', 'universal-gates']"," Title: How can I see, without math, the action of a gate in matrix form?Body: Suppose we have the Fredkin gate with
$$
F=
\left( {\begin{array}{cc}
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{array} } \right)
$$
But how is it possible to ""see"" what its action is without making any matrix multiplication?
In this document, on solving 4.25, they claim that the action of $F$ is, in the computational basis, $F|0,y,z\rangle=|0,y,z\rangle$ and $F|1,y,z\rangle=|1,z,y\rangle$. But how is it possible to know this beforehand? I feel that I am missing this mental ""gymnastic"" that I feel is crucial for developing algorithms.
"
['quantum-gate']," Title: What limits speed of quantum gates?Body: I would like to check something.
Consider I am working on cQED (superconducting qubits), or ion trapped, or silicon qubits (I would like to exclude "exotic for me" quantum computing like photon based, or topological Q.C).
The fastest you perform a gate, the less the noise has the time to act for noise "per unit time" acting (not all noise can be modelled this way but it can often be).
It is thus important to perform gate "the fastest possible".
My question is thus: What is limiting gate speed ?
About limitations I know: for superonducting qubit too short pulses are not a good solution as it might excite the system into higher than qubit level (making it leave the computational space). I would like to know what are the main limitations in general because I guess this is not the only one.
"
"['simulation', 'quantum-fourier-transform', 'phase-estimation', 'clifford-group', 'quantum-computing-for-finance']"," Title: Is it possible to demonstrate a quadratic speed-up of a quantum algorithm on a classical computer?Body: In article Quantum computational finance: Monte Carlo pricing of financial derivatives the authors said that:
Firstly:
While a practical quantum computer has yet to become
a reality, we can exhibit the speedup of our quantum
algorithm for options pricing numerically, and compare
its performance with the classical Monte Carlo method.
Secondly:
However, to showcase the
quadratic speed up, we here perform phase estimation by
using a single qubit rotated according to $\mathrm{e}^{i\theta\sigma_x /2}$, where $\theta$ is the predetermined phase.
If my understanding is correct, it is possible to simulate efficiently a circuit consisting only of Clifford gates. Since an inverse QFT is employed in the circuit, at least one $\mathrm{T}$ should be use here (QFT for three or more qubits). However, in the second quotation the authors claim that they used only a single qubit gate for phase estimation which reduced number of qubits in the inverse QFT and avoided the use of non-Clifford gates.
So my questions is: Have the authors used Clifford gates only in their construction or am I missing something? So far, I have thought that simulation of quantum computer cannot bring any speedup even in case only Clifford gates are employed.
"
"['entanglement', 'teleportation', 'communication']"," Title: Generalising the standard quantum teleportation protocol: what are the possible unitaries?Body: Consider the standard quantum teleportation scheme. Let the first register hold the state $\newcommand{\ket}[1]{|#1\rangle}\ket\psi$ to be teleported, and the second register be the one shared between the two parties. We can then summarise the protocol as follows:
- Start with the state $\ket{\psi}_1\ket{0,0}_{23}$
- Apply the unitary $U\equiv \operatorname{CNOT}(H\otimes I)$ between second and third register, thus evolving $\ket{00}$ to $\ket{\Psi^+}\simeq \ket{00}+\ket{11}$.
- Apply $U^{-1}$ between first and second registers.
- Measure the first two registers in the computational basis, and observe that for every outcome there is a local operation that can be applied to the third register that gives back $\ket\psi$.
My question is about the choice of this specific unitary $U$:
Consider the following generalisation of the teleportation scheme:
Here, we again start with $\ket\psi\otimes\ket{0,0}$, but now apply some unitary $B$ between second and third register and then $B^{-1}$ between first and second. We then measure the first two registers in the computational basis.
What are the possible unitaries $B$ such that this circuit works as a teleportation protocol? More specifically, for what choices of $B$ can we always find a unitary to apply to the third register to get back $\ket\psi$ regardless of the measurement results $a,b$?
Intuitively, $B$ must be some gate creating maximal entanglement between the qubits, but requiring that $B$ sends $|00\rangle$ to a maximally entangled state is also not enough. As a counterexample, we can consider the following $B$:
$$B\equiv \begin{pmatrix}
0&0&1&0 \\
1/\sqrt2 & 1/\sqrt2 & 0 & 0 \\
1/\sqrt2 & -1/\sqrt2 & 0 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}.$$
It is not hard to check that with this choice teleportation is not possible, despite the two parties sharing a maximally entangled state. For example, the outcome $a=b=1$ projects the third qubit to $\ket0$, which contains no information about $\ket\psi$.
"
"['hamiltonian-simulation', 'unitarity', 'optical-quantum-computing']"," Title: What is the correct sign in the unitary evolution operator of a beam splitter?Body: I'm a bit confused about which is the correct sign in the unitary evolution operator of a beam splitter.
In paper Digital quantum simulation of linear and nonlinear optical elements author uses the following expression:
$$U_{ij} = e^{i\epsilon_{ij}\left(b_j^\dagger a_i + b_j a_i^\dagger \right)} $$
where $i,j$ refers to the beam splitter modes (so, what is the meaning of $a$ and $b$?)
However, Nielsen & Chuang use (on page 291) the following equation for the same thing:
$$ U = e^{\theta\left(a^\dagger b - a b^\dagger\right)},$$
where the latter term in the exponent has a minus sign.
How can I relate both equations? Are they the same?
Lastly, can you recommend me any book which deals with beam splitter and related stuff? I have not found any good reference.
"
"['circuit-construction', 'cirq']"," Title: Ising Model, Graphs, and CirqBody: How would you explain, pictorially and without too much overhead, an interaction between the qubits on this model using Cirq?
I am interested in trying to map accurately the ansatz on Cirq to a graph using Python network's library.
I know this is a bit open-ended. What I am looking for are suggestions and examples to take a look at - besides the obvious one at Cirq's docs.
Thank you.
"
"['algorithm', 'qiskit', 'hamiltonian-simulation', 'chemistry', 'vqe']"," Title: Modifying Qiskit HamiltonianBody: I'm fairly new to the Qiskit API. I was wondering if I could get some assistance with trying to implement our technique of projecting out a new Hamiltonian from the ground-state Hamiltonian. The technique is discussed in our preprint.
There are two main challenges that I'm confronted with:
- The qiskit constructed Hamiltonian by default consist of only the non-zero Pauli strings. How can this be changed to allow for adding and removing terms that may be initial zero.
- How and where would one dynamically modify each Pauli coefficient in the Hamiltonian? For example it appears something like
qubitop.aer_pauli[i,:] = 1.0 + 0.0j
should work, but I'm not sure this is complete or an appropriate approach.
This would enable us to then use the VQE routines with Qiskit to further verify this method.
I'm looking to make these modification to the Qiskit source code just need some guidance.
"
"['quantum-state', 'measurement', 'nielsen-and-chuang']"," Title: Viewing two-qubit measurement as a projective measurementBody: I am following Nielsen and Chuang, section 2.2.5:
A projective measurement is described by an observable, $M$, a Hermitian
operator on the state space of the system being observed. The
observable has a spectral decomposition, $$M = \sum_m mP_m$$
where $P_m$ is the projector onto the eigenspace of $M$ with eigenvalue $m$. The possible outcomes of the measurement correspond to the eigenvalues, $m$, of the observable.
My question is how can we view a the projective measurement of two qubits in the standard (Z) basis using this formalism. In this measurement the projectors are
$$\left|00\right\rangle \left\langle 00\right|, \left|01\right\rangle \left\langle 01\right|, \left|10\right\rangle \left\langle 10\right|, \left|11\right\rangle \left\langle 11\right|$$
But how can I find them if I only know of the observable, which in this case is $Z\otimes Z$ if I understand correctly?
This observable has only two eigenvalues: $+1$ and $-1$. The eigenvalue $+1$ corresponds both to $\left|00\right\rangle$ and $\left|11\right\rangle$, so it seems to me I need a ""stronger"" observable, which can differentiate those two states, or I'm missing a something elementary in the definition of projective measurements.
"
"['quantum-state', 'entanglement', 'superdense-coding']"," Title: What is the implementation of the state in superdense coding?Body: What is the implementation of quantum superdense coding protocol if the sender and receiver share the entangled state
$
\frac{1}{\sqrt{2}} (\left| 01 \right> - \left| 10\right>)
$?
"
['quantum-gate']," Title: How does the CNOT gate work?Body: As defined, CNOT should for the two input states $|0\rangle = \pmatrix{1 \\ 0}$ and $\pmatrix{\alpha \\ \beta}$ should result in the second state unchanged: $\pmatrix{\alpha \\ \beta}$. However, to me it does not seem to be the case.
The matrix for CNOT is defined as:
$$\pmatrix{1\;0\;0\;0 \\ 0\;1\;0\;0 \\ 0\;0\;0\;1 \\ 0\;0\;1\;0}$$
Now, I am not sure how to interpret the two input states, it makes sense to me to use their XOR as the input:
$$\pmatrix{1 \\ 0} \otimes \pmatrix{\alpha \\ \beta} = \pmatrix{ \alpha \\ 0 \\ \beta \\ 0 }$$
Now:
$$\pmatrix{1\;0\;0\;0 \\ 0\;1\;0\;0 \\ 0\;0\;0\;1 \\ 0\;0\;1\;0} \pmatrix{ \alpha \\ 0 \\ \beta \\ 0 } = \pmatrix{\alpha \\ 0 \\ 0 \\ \beta}$$
which is a state impossible to write as XOR of two states. Besides obviously being different from the first one, even though it should not have changed.
How is that?
"
"['algorithm', 'qiskit']"," Title: Make a doubly controlled gates from existing operationsBody: I'm trying to implement an modular adder mentioned here with qiskit. I have already built the $\Phi ADD$ gate. But in order to build a modular adder like in figure 5 in the paper, I need to build a doubly-controlled $\Phi ADD$ gate. Qiskit offers a method to transfer a circuit to a controlled gate, but now I need a doubly controlled gate. I know I can use something like this, but that need an additional qubit, which is undesired. I also know that I can use this method, but I don't know how to implement the square root of $\Phi ADD$ gate. Is there any other method to do this (creating a doubly-controlled gate from the $\Phi ADD$ gate I built without adding any additional qubits)?
"
['deutsch-jozsa-algorithm']," Title: What happens with the oracle $U_f$ if you have different blackbox execution times for different inputs?Body: What will happen if the 'blackbox' function $f$ in Deutsch's algorithm is designed in such a way that it takes millions of years to deliver result if input is $x = 1$ and few seconds if the input is $x = 0$?
How long would it take the oracle $U_f$ to calculate $f$ for all inputs? My understanding is that $U_f$ has such quantum properties, that given a state $|\psi \rangle$ as a superposition of two qubits it will apply $U_f$ (and thus apply internally $f$) to each base state of $|\psi \rangle$ simultaneously.
In the scenario I've described $f$ will, however, take different execution times for different inputs. Will then there be a delay until all base states are evaluated by $ U_f$ (or more precisely by $f$)?
"
"['ibm-q-experience', 'error-correction', 'noise', 'decoherence']"," Title: IBM Q calibration parametersBody: If I download calibration of a quantum processor on IBM Q website I see these parameters:
- T1
- T2
- frequency (GHz)
- readout error
- single qubit U2 error rate
- CNOT error rate
T1 and T2 are relaxation and dephasing times, respectively.
What are the other parameters?
"
['qiskit']," Title: Qiskit visualizations module not installed but qiskit package installed. Why?Body: I am trying to set up my qiskit environment but I seem to have run in trouble that I have no idea how to solve. I have installed the qiskit packages as can be seen by running pip list:
however whenever I try to import qiskit.visualization an error occurs:
and I don't understand why since it was suppose to be installed as qiskit module is installed. Any idea where this error comes from?
"
['qiskit']," Title: Why doesn't qiskit appear in ""help(""modules"")"" even though it is installed in python environment?Body: I have updated qiskit to the newest version using pip install qiskit --upgrade and all was done successfully, and when I write pip list on the command line I get:
As I should. But then I run help(""modules"") on a jupyter notebook and get:
which I don't understand why are there no other modules. And obviously import qiskit throws an error as well. Any idea how to solve this?
PS: This is a follow-up from this question
"
"['qiskit', 'programming']"," Title: What do the numbers of the operation object in QuantumCircuit.data outputs?Body: When you have a quantum circuit and use QuantumCircuit.data you get a list with objects of this type (this is the one for a X gate acting on qubit 0 y a 2 qubits Quantum Circuit):
(qiskit.extensions.standard.x.XGate object at 0x0000019B8DEC2EB8, [Qubit(QuantumRegister(2, 'q'), 0)], [])
The first element represents the operation. What does the sequence of digits 0x0000019B8DEC2EB8 mean? I suppose it has something to do with the location or the time, but I do not know how to obtain each digit. I need to know exactly how to reproduce one of these sequences myself.
Thank you so much in advance.
"
"['resource-request', 'models', 'quantum-computing-for-finance']"," Title: Application QueryBody: I had written earlier to propose an econometric modeling application that may lend itself to a quantum computing approach, and was asking how best to proceed.
The model would be centered around the interdependencies of industries within an economy. This approach, known as input-output economic modeling, is used to quantify the output of an industrial sector given inputs from a another sector. As the inputs/outputs change over time, the result is change in demand, which in turn provides a measure of industrial sector's well-being.
The recent Black Swan event that caused an unimaginable labor crisis for the chief provider of the economy's supply chain, has shed new light on the risk of outsourcing dependency, and the effect on global economics. This is new territory. So, the question becomes: How can we monitor the global industrial interdepencies in a timely fashion to create a valuable commercial early warning system? Given the stochastic nature of the problem, I imagined input-output econometric modeling might provide a leaping off point for an application suited to this new computing approach.
Does this make sense?
Thank you
Rich Z
"
"['quantum-gate', 'matrix-representation']"," Title: How to represent an $n$-qubit circuit in matrix form?Body: If a given quantum circuit has $n$ qubit inputs and a certain number of gates, how can we represent the whole circuit in matrix form? Here's an example:
I am sorry, I am confused on how to express the circuit above in matrix form. Especially on how I'll be a able to take into consideration the circuit lines affected by a Toffoli gate? How does the matrix representation of the first Toffoli gate (read from left to right) differ to the matrix representation of the second Toffoli gate since they have different control and target lines. Also what's the difference of the matrix representation of the NOT gate applied to the first circuit line to a NOT gate applied to the second line?
Thank you.
"
"['quantum-gate', 'circuit-construction', 'universal-gates', 't-designs']"," Title: Approximating unitaries with elements from a t-designBody: (This is basically a reference request)
I am wondering if there are any results out there on to what accuracy a given unitary can be approximated with an element drawn from a t-design.
To elaborate a bit, consider the Haar measure over $U(d)$. This integrates over all the unitaries in $U(d)$. So we could say that given some fixed unitary $U_0$, there is an element in the set of unitaries integrated over by the Haar measure which approximates $U_0$ well (this is trivial of course, since $U_0$ itself occurs in the integration).
Now consider a $t$-design. The $t$-design is a finite set of unitaries which has some special properties - namely summing over that set approximates doing a Haar integral. Heuristically, the set of unitaries in the $t$-design looks like the full set of unitaries. So now given some specific unitary $U_0\in U(d)$, is it the case that some element of the $t$-design must be close to $U_0$?
"
"['quantum-gate', 'classical-computing']"," Title: What does the $\sqrt{NOT}$ gate have to do with irreversibility?Body: In his essay ""Why now is the right time to study quantum computing"" Aram Harrow writes, after describing the action of the $\sqrt{NOT}$ gate, that:
However, if we apply $\sqrt{NOT}$ a second time before measuring, then we always obtain the outcome 1. This demonstrates a key difference between quantum superpositions and random mixtures; placing a state into a superposition can be done without any irreversible loss of information.
I'm confused by what he meant here. How does the existence of a $\sqrt{NOT}$ gate in quantum computation demonstrate a difference in irreversibility as opposed to classical computation?
"
['solovay-kitaev-algorithm']," Title: Is there an analog for the Solovay-Kitaev Theorem for approximating quantum states?Body: The Solovay-Kitaev theorem shows that we can approximate arbitrary unitary transformations with polynomially many quantum gates. Can we approximate the resulting state vectors in the same way by specifying the quantum states of pairs (or possibly more) of qubits? I.e. if we have $\psi_{i,j}$ be the approximate state of the qubits $i$ and $j$, is this enough to approximate the entire quantum state?
Cross-posted on physics
"
"['qiskit', 'vqe', 'qasm']"," Title: Finding optimal values of depth and max_trials parameters in vqe algorithmBody: I am running vqe algorithm in qasm_simulator and cannot get the optimal solution.
Are there any methods for finding the optimal value of depth for variational form and max_iter for optimizer parameters? What exactly does the depth parameter?
"
"['qiskit', 'programming', 'entropy']"," Title: How to calculate the Von Neuman entropy on qiskit with the module quantum_info?Body: I am trying to wrap my head around he quantum_info module on qiskit, since most of the functions on qiskit.tools are going to be deprecated, but I am very confused with the Statevector and DensityMatrix objects. For example, with this snippet of code:
simulator = BasicAer.get_backend('statevector_simulator') # the device to run on
result6 = execute(circuit6, simulator).result()
outputstate6 = result6.get_statevector(circuit6, decimals=3)
probability = np.abs(np.array(outputstate6))**2
outstatevector=quantum_info.states.Statevector(outputstate6)
print(type(outstatevector))
print(type(outputstate6))
print(outputstate6)
print(quantum_info.entropy(outputstate6))
I get:
<class 'qiskit.quantum_info.states.statevector.Statevector'>
<class 'numpy.ndarray'>
[0.447+0.j 0. +0.j 0.632+0.j 0.632+0.j]
as expected but then I get the error on quantum_info.entropy(outputstate6):
QiskitError: 'Input quantum state is not a valid'
How can I solve this?
"
['quantum-state']," Title: Negative of a qubit stateBody: I have a quick question: Is the qubit state $|\psi\rangle$ the same as $-|\psi\rangle$?
"
"['qiskit', 'measurement', 'bell-basis']"," Title: How to measure in the bell basis?Body: The question is quite straightforward, I have some two qubit state and I want to measure it in the Bell basis. This question answers me partly, but I still have some doubts because, I thought that just reversing back the transformation would give me the desired mapping from:
$$
|\Phi^+\rangle \to |00\rangle \\
|\Phi^-\rangle \to |01\rangle \\
|\Psi^+\rangle \to |10\rangle \\
|\Psi^+\rangle \to |11\rangle \\
$$
but it does't seem to work as I thought it would:
By doing the math I understand that it should give this, but what I don't understand is my reasoning to why it is so. That is, why was I wrong thinking that the above circuit would return all the measurements in the $|00\rangle$?
"
"['quantum-state', 'bloch-sphere']"," Title: How to get the Bloch sphere angles given an arbitrary qubit?Body: I understand that given a pure state $ |\psi\rangle$, we can express it in terms of two angles $\theta$ and $\varphi$ such that $|\psi\rangle = \cos(\theta/2)|0\rangle + \mathrm{e}^{i\varphi}\sin(\theta/2)|1\rangle $, and this is derived by converting from $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ into their representations in terms of $r\mathrm{e}^{i\theta}$, and then factoring and rearranging that.
But how do I convert between the two representations given arbitrary states? I know that $|0\rangle = (\theta,\varphi) = (0,0), |1\rangle = (\pi,0), |+\rangle = (\pi/2, 0)$ etc, but how do I get it for an arbitrary state $|\psi\rangle$?
So far, I have:
- If $\alpha$ is complex, shift the entire state by phase $\bar{\alpha}$, where $\bar\alpha$ is the complex conjugate of $\alpha$, to end up with $\alpha\bar\alpha |0\rangle + \bar\alpha\beta|1\rangle$
- Use the formulas:
$$
\theta = 2 \arccos(\alpha\bar\alpha) \\
\varphi = ???
$$
"
"['d-wave', 'annealing']"," Title: Quantum Annealing - Random results on big NBody: I implemented a solver for the Job Shop Problem, based on quantum annealing, on a D-Wave machine.
I have a problem, that even though minimal energy solutions exist, they are only chosen once. I set the nbr of reads to 1000, but the responses still look like this:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... 41 energy num_oc. ...
0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 ... 1 -144.0 1 ...
1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ... 1 -136.0 1 ...
2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ... 1 -134.0 1 ...
15 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 ... 0 -133.0 1 ...
16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 -133.0 1 ...
138 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 ... 0 -131.0 1 ...
3 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 ... 1 -129.0 1 ...
4 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 ... 0 -127.0 1 ...
Should't the lowest energy solution, get picked more than once, just by chance?
On multiple runs, I now always get a different, kind of random result it seems.
I tried playing around with the chain strength, up to a point where no chains are breaking anymore, so I think it should be at a good spot right now.
Do you have any idea, what the issue might be?
"
['random-quantum-circuit']," Title: How do we know that there exists a quantum circuit whose output distribution is #P-hard to calculate?Body: I am trying to understand the random quantum circuit sampling arguments for recent Google experiment, but struggling to understand why there exists a family of quantum circuit whose output distribution is #P-hard to calculate exactly. Papers in this topics just show how to reduce average case random circuit sampling to exact random circuit sampling, but does not provides details of the #P-hardness of exact quantum circuit sampling. Could anybody provide detailed arguments for the fact that there exists a family of quantum circuit whose output distribution is #P-hard to calculate exactly?
Thanks.
"
"['entanglement', 'partial-trace']"," Title: Given partial states, can one construct the best estimate of the full state?Body: Given some partial states $\rho_{AB}$ and $\sigma_{AC}$, is there a general procedure to construct a state $\delta_{ABC}$ such that the following sum of trace distances
$$||\text{Tr}_C(\delta_{ABC}) - \rho_{AB}||_1 + ||\text{Tr}_B(\delta_{ABC}) - \sigma_{AC}||_1$$
is minimal? That is we want a joint state that under partial traces is as close as possible to some given targets. In particular, when there is entanglement in both $AB$ and $AC$, I'm not sure how to proceed.
"
"['quantum-gate', 'noise', 'superconducting-quantum-computing']"," Title: Why are two qubits gates more noisy?Body: I would like to understand why two qubit gates are generally more noisy.
If I am interested in single qubit gates, I can have an effective modelling as a master equation:
$$\dot{\rho}=\frac{1}{i \hbar} [H,\rho]+\gamma \mathcal{D}[\sigma_-] \rho +\gamma^* \mathcal{D}[\sigma_z] \rho$$
The rate of noise is roughly: $\gamma+\gamma^*$
With $H=\frac{\hbar \Omega}{2} \sigma_y $ for a $y$ rotation in the interaction picture.
For a two qubit gate, I would expect a simple model like:
$$\dot{\rho}=\frac{1}{i \hbar} [H,\rho]+\gamma \left(\mathcal{D}[\sigma^1_-]+\mathcal{D}[\sigma^2_-]\right) \rho +\gamma^* \left( \mathcal{D}[\sigma^1_z] + \mathcal{D}[\sigma^2_z]\right) \rho$$
With $H=\frac{\hbar g}{2} \left( \sigma_1^+ \sigma_2^-+\sigma_1^- \sigma_2^+ \right)$
My question is:
Why are two qubit gates generally noisier ?
Indeed here with this simple model I would expect the rate noise to simply be $2(\gamma+\gamma^*)$. Thus twice as the one for the single qubit gate. But at the same time we have two qubits so ""per qubit"" the rate of noise is the same.
Are two qubits gate noisier because they rotate slower ?
I would like a justified answer (with references) in the context of superconducting qubits.
"
"['quantum-operation', 'noise', 'unitarity']"," Title: Explicit form for composition of Choi representation quantum channelsBody: Let $|\Omega \rangle$ be the maximally entangled state over a bipartite system whose parts are each dimension $d$, i.e.
$$
| \Omega \rangle \equiv \sum_i^{d}| ii \rangle
$$
Then one way of writing the Choi representation $J(\Phi)$ of a channel $\Phi: \mathbb{C}^{d\times d} \rightarrow \mathbb{C}^{d\times d}$ that acts on density operators $\rho \in \mathbb{C}^{d \times d}$ is:
$$
J(\Phi) \equiv (I \otimes \Phi )| \Omega \rangle \langle \Omega |
$$
If I choose $\Phi_U$ to be a unitary channel (i.e. $\Phi_U (\rho ) = U\rho U^\dagger$) then its Choi representation in this notation would be:
$$
J(\Phi_U) \equiv (I \otimes U)| \Omega \rangle \langle \Omega |(I \otimes U^\dagger)
$$
My question is, is there an explicit way to represent compositions of unitaries in terms of the unitaries' respective Choi representations? In other words, if $\Phi_{U\circ V}(\rho) \equiv UV\rho (UV)^\dagger$, how can I ""nicely"" represent $J(\Phi_{U \circ V})$, for example in terms of $J(\Phi_U)$ and $J(\Phi_V)$ and linear operations in $\mathbb{C}^{d^2 \times d^2}$?
"
['pauli-gates']," Title: Similarity Transformations on Pauli Operators in 2-qubit states (eq. 11 - Farhi's QNN Paper)Body: Again, I am new to quantum computing and have a CS background, so apologies if this seems like an obvious question or if I seem unclear. $\newcommand{\braket}[1]{\langle #1 \rangle}\newcommand{\bra}[1]{\langle #1 |}\newcommand{\ket}[1]{| #1 \rangle}$
Let $U_l = \text{exp}(i\frac{\pi}{4}l(z)X)$ where $X$ is the pauli $\sigma_x$ gate and $l(z)$ is either $+1$ or $-1$
The paper that I've been reading claims that $$U_l^{\dagger}YU_l = \cos(\frac{\pi}{2}l(z))Y + \sin(\frac{\pi}{2}l(z))Z$$ where $Y$ is the pauli $\sigma_{y}$ gate and $Z$ is $\sigma_z$
Finally, they conclude that $$\bra{z,0}U_l^{\dagger}YU_l\ket{z,0} = \sin(\frac{\pi}{2}l(z)) = l(z)$$ , where $z = z_1,...,z_n$
When I try this myself, I don't get the same result and I am not able to spot my mistake. Here's my approach:
$U_l = \text{exp}(i\frac{\pi}{4}l(z)X) = I + e^{i\frac{\pi}{4}l(z)}X$ where $I$ is the identity matrix
Thus, I have that $$U_l^{\dagger}Y = Y + ie^{-i\frac{\pi}{4}l(z)}Z$$ and therefore $$U_l^{\dagger}YU_l = -ie^{i\frac{\pi}{4}l(z)}Z + ie^{-i\frac{\pi}{4}l(z)}Z$$ which, when we apply Euler's formula, reduces to: $$2\sin(\frac{\pi}{4}l(z))Z$$ which doesn't seem to be correct.
Could you please help me out? I've been stuck on it for a couple of days now.
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: How many Qubits does the qiskit implementation of Shor's Algorithm need to factor N=15?Body: I know there is a documentation for qiskit.aqua.algorithms.Shor that explains that they used this reference for implementing the actual circuit. It says that the number of qubit needed is 2n+3. So to factor N=15, 11 qubits would be needed. I decided to test this using Qiskit with a backend that has up to 15 qubits. But then I get an error saying that I needed 18 qubits to factor N = 15. Is the implementation different from the actual paper referenced? or am I missing something ?
This is the code I used to factor N=15
shor = Shor(15,2)
backend = provider.get_backend('ibmq_16_melbourne')
quantum_instance = QuantumInstance(backend, skip_qobj_validation=False)
res = shor.run(quantum_instance)
print(""The list of factors of {} as computed by Shor is {}."".format(PRIME, res['factors'][0]))
And this is the error i got
TranspilerError: 'Number of qubits (18) in circuit1 is greater than maximum (15) in the coupling_TranspilerError: 'Number of qubits (18) in circuit1 is greater than maximum (15) in the coupling_map'
"
"['algorithm', 'oracles']"," Title: Convert a quantum Phase Oracle into a Probability OracleBody: Suppose we have an oracle $O_f$ that given an initial state $|x\rangle$ maps it into the following state:
$$
O_f : |x\rangle \mapsto e^{if(x)} |x\rangle
$$
Now, assuming that $f(x) \in [0,1]$, is it possible to construct a quantum circuit $O_p$ such that:
$$
O_p : |x\rangle \otimes |0\rangle \mapsto |x\rangle \otimes (\sqrt{f(x)} |0\rangle + \sqrt{1-f(x)} |1\rangle)
$$
using $O_f$ ? If you can suggest some references, i would appreciate it. Thank you very much.
"
"['quantum-gate', 'bqp']"," Title: $\sf BQP$ and general $\mathrm{SU}(2^n)$ gatesBody: In his lecture on quantum computing, Scott Aaronson describes polynomial-size quantum circuits,
Now, once we fix a universal set (any universal set) of quantum gates, we'll be interested in those circuits consisting of at most p(n) gates from our set, where p is a polynomial, and n is the number of bits of the problem instance we want to solve. We call these the polynomial-size quantum circuits.
and then using this goes on to give a practical definition of $\sf BQP$:
$\sf BQP$ is the class of languages $L\subseteq\{0, 1\}^*$ for which there exists a uniform family of polynomial-size quantum circuits, $\{C_n\}$, such that for all $x\in\{0, 1\}^n$:
- If $x\in L$ then $C_n$ accepts input $|x\rangle|0\cdots0\rangle$ with probability at least 2/3.
- If $x\notin L$ then $C_n$ accepts input $|x\rangle|0\cdots0\rangle$ with probability at most 1/3.
Now, take $G$ to be any standard universal gate set (e.g. the Clifford+$\rm T$ set), and let $L$ be a language that can be computed on $n$ qubits only by using (polynomially many copies of) some general $SU(2^n)$ gate $\rm U$, whose decomposition requires exponentially (in $n$) many gates from the set $G$. Seemingly $L\notin\sf BQP$ as the circuit implementing $\rm U$ is not a polynomial circuit.
Then, let $G'=G\cup\{\rm U\}$. Clearly, $G'$ is still a universal gate set. However, computing $L$ requires polynomially many gates from $G'$, which would indicate $L\in\sf BQP$.
This seems like a contradiction. Or more profoundly, the definition of $\sf BQP$ seems to depend on the choice of the gate set. What exactly is going wrong here? And is $L$ an element of $\sf BQP$ or not?
"
['resource-request']," Title: Guide for Quantum Information and Computing Internships and Learning OpportunitiesBody: I know this perhaps not a suitable topic for this SE - after all, this is about QC knowledge sharing - but I am wondering if this could be a resource for people who are interested in the field, are currently enrolled in college - undergrad and beyond - and would like to know the best way - for their current station in the physics/QC track/journey - to approach/pursue the many opportunities there are out there.
I really hope the community takes upon this question and this becomes a wiki for people to come and see the feedback from the community to be better prepared to compete for those learning opportunity - specially the internships, which as far as I know, are not that many.
"
"['mathematics', 'measurement', 'quantum-operation', 'classical-computing']"," Title: CPTP, Kraus representation and classical registersBody: What is the best mathematical representation of a quantum system that has some classical registers and some quantum registers?
I'm asking because I'm considering any ""physical"" process $\pi()$ that takes no input, but that outputs both classical and quantum values, like for example a tuple $(x, \rho)$, with $x \in \{0,1\}^n$ a classical string, and $\rho$ a quantum state on $m$ qubits, and I'd like to find a kind of Kraus representation of $\pi$.
I wanted to use the usual formalism of CPTP, but it's not clear in which Hilbert space lives $(x, \rho)$... Indeed, usually, a Hilbert space is stable by superposition, but here the first ""register"" cannot be in superposition. Of course, I could say that $x$ is in fact $|x\rangle$ and therefore the output of $\pi()$ is strictly contained in a Hilbert space of size $2^n$, but then $\pi()$ is not simply $\sigma = \sum_i B_i 1 B_i^\dagger$, as I'd also need to ""measure"" $\sigma$ to extract a random $x$, and then set $\rho$ to be the matrix $\sigma$ ""postselected"" on $x$.
Is there some better representation for such process that makes the difference between quantum outputs and classical outputs?
"
"['resource-request', 'entropy', 'information-theory']"," Title: What are good resources for newcomers on entropy measurements?Body: I am starting on quantum computing and I got to entropy measurements, but that has me stuck because there seems to be a lack of resources for newcomers on those concepts and their utility. Does anyone know any good reference on them?
"
"['algorithm', 'circuit-construction']"," Title: How to construct Control-Z with square root of swap?Body: How to construct Control-Z with square root of swap(up to some single qubit operations)? In some papers it just directly mention that it's possible but didn't tell how to do.
"
"['ibm-q-experience', 'simulation']"," Title: How many cores and what processors are used in the cloud ibmq_qasm_simulator?Body: Cloud IBMQ simulator ibmq_qasm_simulator can process up to 32-qubit circuits quite fast. However, I could not find any information about the simulator backend properties, e.g. how many cores, what processors, etc.
Could anybody provide me with this information (or link)?
"
"['qiskit', 'ibm-q-experience', 'error-correction', 'noise', 'error-mitigation']"," Title: Mitigating the noise in a quantum circuitBody: I'm using Qiskit and I have a Quantum Circuit (say, circuit) that gives reasonable results when using the simulator, namely
sim_backend = provider.get_backend('qasm_simulator')
job = execute(circuit, sim_backend, shots=shots)
However, when switching to the true machine, namely
sim_backend = provider.get_backend('ibmq_16_melbourne')
I'm experiencing very noisy, meaningless results.
From my understanding, this is normal and, in these cases, error mitigation is performed by measuring the noise of the quantum circuit and then operating with this knowledge.
Could someone tell me which Qiskit routine I could use to mitigate noise and how?
EDIT
Following the comment by Davit Khachatryan and the answer by Martin Vesely, I have prepared the code below.
# --- Standard imports
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
# Loading your IBM Q account(s)
provider = IBMQ.load_account()
# --- Imports
from qiskit import QuantumCircuit, execute, BasicAer
from qiskit.tools.monitor import job_monitor
import math
from numpy import linalg as LA
import numpy as np
#%config jupy = 'svg' # Makes the images look nice
import time
import matplotlib.pyplot as plt
nBits = 2
shots = 8192
# --- Computation of the calibration matrix
from qiskit.ignis.mitigation.measurement import (complete_meas_cal,CompleteMeasFitter)
from qiskit import *
qr = QuantumRegister(2)
meas_calibs, state_labels = complete_meas_cal(qr=qr, circlabel='mcal')
backend = provider.get_backend('ibmq_16_melbourne')
job = execute(meas_calibs, backend=backend, shots=1000)
job_monitor(job, interval = 3)
cal_results = job.result()
meas_fitter = CompleteMeasFitter(cal_results, state_labels, circlabel='mcal')
print(meas_fitter.cal_matrix)
# --- Execution of the noisy quantum circuit
qc = QuantumCircuit(nBits, nBits)
qc.x(1)
qc.measure(qc.qregs[0], qc.cregs[0])
job = execute(qc, provider.get_backend('ibmq_16_melbourne'), shots = shots)
#job = execute(qc, BasicAer.get_backend('qasm_simulator'), shots = shots)
job_monitor(job, interval = 3)
result = job.result()
print(result.get_counts())
# --- Error correction
# Get the filter object
meas_filter = meas_fitter.filter
# Results with mitigation
mitigated_results = meas_filter.apply(result)
mitigated_counts = mitigated_results.get_counts(0)
print(mitigated_counts)
The noisy quantum circuit returns:
{'00': 661, '11': 34, '10': 7494, '01': 3}
The error mitigated noise circuit returns:
{'00': 132.05699755089069, '11': 29.711709316932044, '01': 0.4405790117450936, '10': 8029.790714120432}
Is that what I should expect?
"
"['programming', 'density-matrix', 'qutip']"," Title: Numerical methods for finding an eigen basis of a degenerate LiouvillianBody: I'm trying to find the steady-state of a master equation,
$$\dot{\rho}(t) = \mathcal{L}\rho(t),\tag{1}\label{1}$$
In the form where we vectorise the density matrix and matrixify (??) the Liouvillian super operator $\rho$ is a vector representing a state, $\mathcal{L}$ is the Liouvillian, a complex matrix describing the evolution, which is not necessarily symmetric and $\dot{\rho}$ is the rate of change of $\rho$. To find the steady-state we need to set the LHS of the equation to 0 and solve for $\rho$.
This is just the eigenvector problem, $(\mathcal{L}-\lambda\pmb{I})\rho=0$ for the case where the eigenvalue, $\lambda=0$.
In many systems I am studying the 0 eigenvalue of $\mathcal{L}$ is degenerate so there should be more than one solution for the original master equation. Ideally, we could find a basis for the degenerate subspace (I assume that this subspace of $\mathcal{L}$ is diagonalizable). Qutip has the function steadystate() which, given a system Hamiltonian and some jump operators uses various numerical methods to find the steadystate. I am relatively new to using numerical methods but the systems I am dealing with are large so requires it. I have tried using the GMRES method to solve equation \eqref{1} with $\dot{\rho}=0$ but this only produces a single solution and does not help me find a basis.
An alternative approach is to use the function liouvillian() which given the same parameters as steadystate() returns the Liouvillian, L, of the system in matrix form. We can then use L.eigenstate() to find the eigenvectors associated with the zero eigenvalues. A few issues with this is that the zero eigenvalues are never quite zero but just very small, however I'm not sure this is necessarily a problem. The eigenvectors produced appear to be linearly independent, at least in the simple case I'm looking at where the system is only doubly degenerate in the zero eigenvalue, so they could form a basis for this degenerate subspace. Finally, when the Liouvillian is applied to any linear combination of these eigenvectors (as long as the cofactors are not too large) the result is zero. My only problem is that when I apply the Liouvillian to the steadystate produced by the GMRES approach the result is not zero and after some simple checks it does not appear to be in the space spanned by the eigenvectors. Is this necessarily a problem or just an issue of numerical accuracy. Is my approach of using the eigenvectors of the zero eigenvalue as a basis for the steadystate valid?
Any advice on solving this problem would be much appreciated! Thanks.
"
"['cryptography', 'bb84', 'qkd']"," Title: How does a rectilinear filter used for QKD-BB84 detect both horizontal and vertical polarizations?Body: When using the BB84 algorithm for QKD, you arbitrarily choose which of two filters (bases) to use when detecting a photon: rectilinear or diagonal. If you choose rectilinear, you can detect polarization with certainty if the photon is rectilinear, i.e., either vertically- or horizontally-polarized.
But how? A polarization filter that allows transmission of vertically-polarized photons will block horizontally-polarized photons and vice-versa, no?
Perhaps you use a vertically-polarized filter as the rectilinear filter and then the complete lack of a photon indicates horizontal polarization, but how would you distinguish that from, say, absorption of the photon into the fiber?
"
"['error-correction', 'stabilizer-code']"," Title: Obtaining low weight stabilizer generatorsBody: Suppose I know a set of stabilizer generators of a qubit quantum code. Is there a systematic (and possibly efficient) way to transform this set of generators to a different set (generating the same code) with lowest possible weights? I suspect that there is no efficient way, because this problem looks very similar to the shortest basis problem of lattices which is conjectured to be very hard.
"
"['mathematics', 'tensor-product']"," Title: Is kronecker product identifiable?Body: I have a unitary matrix $U$ and a quantum state $\vert \Psi \rangle$ such that
$$ U \vert \Psi \rangle = e^{i \theta} \vert \Psi \rangle.$$
I also know that my unitary matrix and my quantum state can be written as $U = U_1\otimes U_2$ and $\vert \Psi \rangle = \vert \Psi_1\rangle\otimes\vert\Psi_2\rangle$ with matching dimensions (i.e. $U_1$ acts on the Hilbert state $\vert\Psi_1\rangle$ belongs to, same for $U_2$ and $\vert\Psi_2\rangle$).
My first equation then becomes
$$U_1\vert\Psi_1\rangle \otimes U_2 \vert\Psi_2 \rangle = e^{i\theta} \vert \Psi_1 \rangle \otimes \vert \Psi_2 \rangle.$$
Can I deduce the 3 following assertions from my formula above?
- $U_1 \vert\Psi_1\rangle = e^{i\theta_1}\vert\Psi_1\rangle$
- $U_2 \vert\Psi_2\rangle = e^{i\theta_2}\vert\Psi_2\rangle$
- with $\theta = \theta_1 + \theta_2 + 2k\pi$.
The implication seems ""logical"" as we just separate $2$ non-related quantum states from each other, but I do not have enough confidence in my reasoning to accept this result yet. I searched for a mathematical proof, but the closer I found is the following theorem from here:
Theorem: Let $A$ and $B$ be two complex square matrices. If $\lambda$ is an
eigenvalue of $A$ with corresponding eigenvector $x$ and $\mu$ is an
eigenvector of $B$ with corresponding eigenvector $y$, then $\lambda\mu$ is an
eigenvalue of $A\otimes B$ with corresponding eigenvector $x\otimes y$. Moreover, every
eigenvalue of $A\otimes B$ arises as such a product.
that does not fit with my problem (not the good implication and more oriented toward eigenvectors).
"
"['algorithm', 'oracles']"," Title: Graphs are represented using oracle, where oracle is the adjacency matrix. Is there any simple example of this?Body: I have been reading papers on graph theory in quantum computing. Mostly, papers explain that they use adjacency matrix to represent the graph. But I could't find the practical simple example to understand it better. Does anybody know about such example?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: In Qiskit, where is the floating point operation performed?Body: I am using Qiskit - the simple circuits I am writing can either run on the hardware backend (using least_busy) or the QASM simulator backend.
If I have statements like the following - (random_numbers were generated using QRNG in the circuits - not shown here)
b = .6
a = .3
flt = []
for rn_num in random_numbers:
flt.append( b*(a-rn_num) + a * rn_num)
Where are these floating point operations performed? I am connected to IBM Quantum Experience - using Jupyter. Are these operations performed on a traditional machine or a quantum backend?
My understanding is unless it is related to a Quantum circuit - everything gets executed on a traditional machine (similar to print or sockets?)
Is there a document that explains this further? I read release notes - I found them a bit ambiguous. I found this comment in Aer 0.3 release note
Increased performance with simulations that require less floating
point numerical precision.
Maybe this note is referring to statevectors in floating point ...??
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: Computation of a reduced density matrixBody: On wikipedia, the article on quantum entanglement gives an example of the computation of a reduced density matrix. I would like to understand precisely what's going on with the computation.
First the context. We consider two systems A and B respectively belonging to Hilbert spaces $\mathcal{H}_A$ and $\mathcal{H}_B$.
We consider the state of the composite system $| \Psi\rangle \in \mathcal{H}_A \otimes\mathcal{H}_B$.
We are interested by the reduced density matrix on the subsystem A, given by the following formula :
$$ \rho_A = \sum_j \langle j |_B ( | \Psi\rangle \langle\Psi| ) |j\rangle_B $$
Then the article gives the following example . Consider the entangled state :
$$ | \Psi \rangle =\frac{1}{\sqrt{2}} ( |0\rangle_A |1\rangle_B - |1\rangle_A |0\rangle_B ) $$
the article says that the reduced density of A is then :
$$ \rho_A = \frac{1}{2} (|0\rangle_A \langle 0|_A + |1\rangle_A \langle 1|_A)$$
I wanted to compute it myself using the definition above but I'm having trouble with it.
The term $| \Psi\rangle \langle\Psi|$ makes sense to me :
$$ | \Psi\rangle \langle\Psi| =\frac{1}{2} ( |0\rangle_A |1\rangle_B \langle 0|_A \langle 1|_B - |0\rangle_A |1\rangle_B \langle 1|_A \langle 0|_B - |1\rangle_A |0\rangle_B \langle 0|_A \langle 1|_B + |1\rangle_A |0\rangle_B \langle 1|_A \langle 0|_B ) $$
but then let's consider the first term of the sum in the definition of the reduced density matrix :
$$ \langle 0|_B | \Psi\rangle \langle\Psi| |0\rangle_B $$
we then have term such as
$$ \langle 0|_B |0\rangle_A $$
and I can't make sense of it. If $\mathcal{H}_A = \mathcal{H}_B$ it's the inner product on $\mathcal{H}_A$ but here I'm confused. Dropping the subscripts I have :
$$ \langle 0| | \Psi\rangle \langle\Psi| |0\rangle + \langle 1| | \Psi\rangle \langle\Psi| |1\rangle = - \frac{1}{2} (|0\rangle \langle 0| + |1\rangle \langle 1|)$$
So here there is this minus sign that is not in the given answer of Wikipedia plus I ""lost"" the information on the states.
Could you help me doing the computation correctly ?
"
"['algorithm', 'cryptography', 'cryptocurrency']"," Title: Like blockchains, other than the few quantum algorithms available out there, are quantum computers/algorithms a solution looking for a problem?Body: Like Distributed Ledger Technologies (DLT) and Blockchain, other than the few quantum algorithms available out there, are quantum computers/algorithms a solution looking for a problem?
For one, I am ambivalent - with the scarcity of quantum algorithms, I am leaning towards ""a solution looking for a problem"" .
"
"['measurement', 'simulation', 'hamiltonian-simulation', 'cirq', 'vqe']"," Title: VQE Cirq exampleBody: Is my understanding correct that in this example the Hamiltonian measurement is not performed through measuring individual Pauli operators because all its terms are mutually commuting? So, for each run, we just measure all the qubits in the $Z$ basis, and substitute the values into the classical expression?
But if we added a term like $X_1 Y_2$, we would have to double the number of runs, right?
"
"['qiskit', 'programming', 'quantum-fourier-transform']"," Title: qiskit: IQFT acting on subsystem of reversed-ordered qubits stateBody: I have a state psi as an ndarray of shape (2 ** 3,) s.t.
psi[0]= amplitude of 000
psi[1] = amplitude of 001.
So my qubit ordering is reversed w.r.t. qiskit's. To initialize the circuit correctly and apply the IQFT on the first 2 qubits from the left I tried the following code:
import qiskit as qt
from qiskit.aqua.circuits import FourierTransformCircuits as QFT
circuit = qt.QuantumCircuit(3)
circuit.initialize( psi, [i for i in reversed(circuit.qubits)])
QFT.construct_circuit(circuit=circuit, qubits=circuit.qubits[:2], inverse=True)
backend = qt.Aer.get_backend('statevector_simulator')
final_state = qt.execute(circuit, backend, shots=1).result().get_statevector()
From the tests I've run, final_state is not what I expected: defining
exact = np.kron(IQFT_matrix(2),np.eye(2)).dot(state) with IQFT_matrix(2)= IQFT_matrix for 2 qubits.
np.testing.assert_array_almost_equal(final_state, exact)
fails. Can you please help me find the problem?
"
"['bloch-sphere', 'information-theory']"," Title: How many classical bits are needed to represent a qubit?Body: I have two question concerning information content of qubit.
Question 1: How many classical bits are needed to represent a qubit:
A qubit can be represented by a vector $q = \begin{pmatrix}\alpha \\\beta \end{pmatrix}, ~~ \alpha, \beta \in \mathbb{C}$. So, we need four real numbers to represent it. But when facts that (i) $|\alpha|^2+|\beta|^2 = 1$ and (ii) two qubits which differ in global phase only are indistinguishable, are taken into account, only two real numbers are necessary (angles on Bloch sphere). Moreover, we can choose a precission of the qubit representation (i.e. number of decimal places in $\alpha$ and $\beta$ or Bloch sphere angles) which influence number of classical bits needed to described the qubit.
So, it seems to me that the qubit representation cannot be used for measuring qubit information content but only memory consumption in simulation. Am I right?
Question 2: What is an (effective) information content of qubit:
A superdense coding enable us to send two classical bits via one qubit. But on the other hand you need two entangled qubits prepared in advance.
Given these facts, what is an information content of qubit? One or two classical bits? Or do I need to use another angle of view given the fact that qubits are ""continuous"" (i.e. described by complex numbers $\alpha$ and $\beta$)?
"
"['quantum-state', 'quantum-operation']"," Title: Is quantum deletion via a partial randomization procedure possible?Body: The paper, Quantum deletion is possible via a partial randomization procedure claims that it is possible to bypass the no-deleting theorem by a procedure called R-deletion. But this seems to go against the original no-deleting theorem. If not, why so?
And doesn't the following line from the first paper actually convey a swapping operation which has been categorically excluded by Pati and Braunstein?
But, whatever this state be in our actual realization of R-deletion, we do not recover now, from the linearity of Quantum Mechanics, the result in {1} that $|A_\psi\rangle= \alpha|A_H\rangle +\beta|A_V\rangle$.
"
"['quantum-gate', 'quantum-state', 'machine-learning', 'phase-estimation', 'phase-kickback']"," Title: How to decompose a multi-target controlled gate?Body: I'm trying to replicate with qiskit the results of this paper in which basically they implement a quantum version of the Principal Component Analysis applying Quantum Phase Estimation algorithm in order to find eigenvalues and eigenvectors from a covariance matrix.
Everything works fine for the 2x2 covariance matrix case but when they extend the circuit to the 4x4 case it's not very clear how they modify the phase kickback part of the quantum circuit.
In the picture that shows the general circuit for QPE, some multi-target controlled-U gates are shown:
In the 2x2 case this can be made using simple cU3 gates repeated several times as shown in this answer, where the parameters $\theta, \phi, \lambda$ that are needed for the cU3 gate are calculated using the qiskit function euler_angles_1q directly from the $e^{2\pi i\rho}$ 2x2 matrix where $\rho$ is the normalized covariance matrix:
$\rho=\frac{\sigma}{tr(\sigma)}$
($\sigma$ is the 2x2 covariance matrix for which we want to find the eigenvalues and the eigenvectors)
But for the 4x4 case they provide a circuit that does the phase kickback with several U3 gates
My question is:
- Since I am a beginner I don't understand how a controlled multi-target gate is decomposed in this chain of gates. Could you please explain me the idea behind this decomposition or give me some resources to start from in order to understand it?
- Is it possible to decompose a multi-target cU3 gate using only 2 single target cU3 gates?
"
"['qiskit', 'ibm-q-experience', 'error-correction', 'noise']"," Title: Different QFT results when using Simulator or Quantum MachineBody: I'm performing QFT using the following code:
# Importing standard Qiskit libraries and configuring account
from qiskit import *
from qiskit.tools.monitor import job_monitor
provider = IBMQ.load_account()
# --- Imports
from numpy import linalg as LA
import numpy as np
def qftA(circ, n):
""""""n-qubit QFT on the qubits in circ.""""""
for k in range(n):
j = n - k
circ.h(j - 1)
for i in reversed(range(j - 1)):
circ.cu1(2 * pi / 2**(j - i), i, j - 1)
for i in range(n//2):
circuit.swap(i, n - i - 1)
# --- Parameters
nBits = 2
shots = 8192
pi = np.pi
# --- Input data
# --- Defining the array coefficients
coefficients = [0., 1., 3., 1.]
coefficients = coefficients / LA.norm(coefficients)
# --- Defining the quantum circuit
circuit = QuantumCircuit(nBits, nBits, name = ""Quantum circuit"")
# --- Quantum circuit initialization
circuit.initialize(coefficients, range(nBits))
# next, do a qft
qftA(circuit, nBits)
circuit.measure(range(nBits), range(nBits))
#sim_backend = provider.get_backend('ibmq_16_melbourne')
#sim_backend = provider.get_backend('ibmq_vigo')
#sim_backend = provider.get_backend('ibmq_essex')
sim_backend = BasicAer.get_backend('qasm_simulator')
job = execute(circuit, sim_backend, shots=shots)
job_monitor(job, interval = 3)
result = job.result().get_counts()
print(result)
I have performed a comparison between the simulator and machine results:
QASM SIMULATOR
{'00': 4648, '01': 1680, '10': 169, '11': 1695}
MELBOURNE
{'00': 3850, '01': 2180, '10': 508, '11': 1654}
VIGO
{'00': 4757, '01': 1937, '10': 308, '11': 1190}
ESSEX
{'00': 4251, '01': 1495, '10': 883, 11': 1563}
LONDON
{'00': 4280, '01': 1332, '10': 608, '11': 1972}
BURLINGTON
{'00': 2880, '01': 1638, '10': 1745, '11': 1929}
IBMQX2
{'00': 4425, '01': 1381, '10': 763, '11': 1623}
OURENSE
{'00': 4922, '01': 1766, '10': 353, '11': 1151}
ARMONK
single qubit
So, depending on what I use I obtain different results. Could someone tell me why and suggest remedies?
EDIT
I have removed the swap at the end of the circuit, as suggested by Davit Khachatrya, and these are the results I achieve
qasm_simulator
{'00': 4639, '10': 1651, '01': 201, '11': 1701}
ibmq_16_melbourne
{'00': 4210, '10': 1828, '01': 531, '11': 1623}
ibmq_vigo
{'00': 4676, '10': 1697, '01': 406, '11': 1413}
ibmq_essex
{'00': 4013, '10': 1462, '01': 1010, '11': 1707}
ibmq_london
{'00': 4341, '10': 1565, '01': 678, '11': 1608}
ibmq_burlington
{'00': 3798, '10': 1376, '01': 1770, '11': 1248}
ibmqx2
{'00': 4281, '10': 1481, '01': 621, '11': 1809}
ibmq_ourense
{'00': 4533, '10': 2037, '01': 293, '11': 1329}
My feeling is that I have now less noisy results.
"
"['graph-states', 'stabilizer-state']"," Title: Constructing an eigenbasis of graph states for a set of stabilizersBody: The stabilizers of a given graph all commute, thus it must be possible to diagonalize them simultaneously. If I start with one graph state and write down all its stabilizers is there an easy way to derive a complete eigenbasis of the stabilizers in terms of graph states?
"
"['quantum-state', 'bloch-sphere', 'unitarity', 'hadamard']"," Title: How should I understand the change of qubit's basis as a rotation?Body: I have a little difficulty with understanding. How do I properly visualize the change of qubit's basis as a rotation?
Let's say that we have classical basis vectors, $|0\rangle$ and $|1\rangle$. Now, we can change this basis into the $\{|+\rangle, |-\rangle\}$ one by applying a Hadamard gate:
$$ H|0\rangle = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \frac{|0\rangle + |1\rangle}{\sqrt{2}} = |+\rangle, $$
$$ H|1\rangle = \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} = \frac{|0\rangle - |1\rangle}{\sqrt{2}} = |-\rangle. $$
Is there some analogy between the Hadamard gate and classical rotation matrix, which can be defined as
$$ R(\theta) = \begin{bmatrix} \cos \theta & -sin \theta \\ \sin \theta & \cos \theta \end{bmatrix},$$
for a rotation in the counterclockwise direction by the angle of $\theta$?
I think that my problem lies in viewing the vectors $|0\rangle$ and $|1\rangle$ as two perpendicular vectors on a plane of real numbers. But, we are dealing with two vectors of complex numbers, so I guess we shouldn't think of them in this way, but rather than that, use the Bloch sphere?
"
"['quantum-state', 'cirq']"," Title: Cirq - Print state of qubitBody: Seeing a state of qubit is too complicated in Cirq
I don't want to simulate, I would be happy for debugging, to see the probability/ amplitude of the state of a qubit, without measure and simulate
Something like:
circuit = cirq.Circuit()
msg, R, S = cirq.LineQubit.range(3)
circuit.append([cirq.H(R),cirq.CNOT(R, S)])
print(R.state)
""R = 0.12|0>+0.58|1>""
or
""(0.12,0.58)
Is there anyway to do this?
"
"['hhl-algorithm', 'cirq']"," Title: Explanation of HHL Cirq implementationBody: Can someone help me in understanding the program on the link given below?
I would really appreciate if someone could give a detailed explanation ...
https://github.com/quantumlib/Cirq/blob/master/examples/hhl.py
"
"['quantum-state', 'matrix-representation', 'tensor-product']"," Title: 2 qubit gate operation on multi qubit systemsBody: Considering a 3 qubit system, what does the matrix operation will look like if I apply CNOT on qubit 1 and qubit 2 and then apply CNOT on qubit 1 and qubit 3?
"
"['ibm-q-experience', 'measurement', 'teleportation']"," Title: How to implement controlled gate based on measurement (quantum teleportation)?Body: I am implementing the teleportation algorithm on IBM Q Experience (GUI interface). Certain operations on the third qubit are only performed if the classical measurement result is 1, for example
if (c==1) x q[2];
However, it removes all the if statements after it is transpiled (lines 19 and 21). Do you know what I did wrong?
"
['gate-synthesis']," Title: Cost of controlled-$U_i$Body: What is the cost (number of gates) of $\sum_{i=0}^{N-1}| i \rangle \langle i|\otimes U_i$ in terms of $N$ and the costs of the unitaries $U_i$? Say the gate set consists of arbitrary one-qubit gates and the CNOT. The unitaries $U_i$ act on an arbitrary number of qubits.
I know, for example, that the Toffoli gate, which is of the above form with $N=4$ and $U_3=X$, can be constructed with $6$ CNOTs.
"
"['quantum-state', 'entanglement']"," Title: Is Quantum Entanglement the one-dimensional spatial relationship between two particles as described by mathematics?Body: Is Quantum Entanglement the one-dimensional spatial relationship between two particles as described by mathematics?
By one dimensional I mean, when they travel at opposite directions their spin is also opposite (without any spooky communication between the two, just the plain fact of their direction as described by our observations).
"
"['physical-realization', 'photonics', 'optical-quantum-computing']"," Title: Are single photons necessary for this quantum autoencoder implementation?Body: The following diagram is from Experimental Realization of a Quantum Autoencoder: The Compression of Qutrits via Machine Learning
How this setup works:
What will be obtained from this set up is the state vector of the input light (I don't use the term 'photon' because it might not be necessary) just before entering stage (c) and its state vector when exiting stage (c). Due to the |H> |V> two different polarization states and two different optical paths (upper one and lower one), there are three bases states (notice that this beam displacer only deflects |v> polarized light so not four bases), so its state vector is 3-dimensional at the input of (c) and is expected to be 2-dimensional at the output of (c) because the autoencoder part is supposed to compress the state vector such that the upper path basis is always 0 valued.
My question is, why is it necessary to use single photon for this experiment?
In order to distinguish the statistics of different state vectors, I can just use something to measure the intensity of the output light at the two optical path; specifically for the lower path at output, I use another beam displacer to separate V and H light and measure their intensities separately. With knowing those intensities, I can get the coefficients of each basis and hence known exactly the state vector, or can I?
"
['notation']," Title: How should I understand the link between $x$ and $| x \rangle $?Body: In the paper ""Quantum Expectation-Maximization for Gaussian Mixture Models"" I encountered the following proposition :
Consider two vectors x,y and $\theta$ the angle between x and y, $\theta < \frac{\pi}{2}$. Then $||x - y|| \leq \epsilon$ implies $|| |x\rangle - |y\rangle || \leq \frac{\sqrt 2 \epsilon}{||x||}$.
I'm not sure how to interpret the link between $x$ and $| x \rangle $ ?
In the case x is an integer, for example $x = 4$ then I'd say that $| x \rangle = | 100 \rangle $. But what about $x = 3.5$ or $x = (2.5, 2.5)$ ?
In those cases what $| x \rangle$ would be ?
"
"['quantum-state', 'bloch-sphere', 'quantum-control', 'open-quantum-systems']"," Title: Deriving Bloch vector $dr$ from master equationBody: I am trying to derive the Bloch vector $dr$ for a measurement of a observable in any arbitrary direction $\theta$. For context this is the setup and derivation I have for continuous measurement along the $z$ axis.
The equation of continuous measurement on observable X has the following form:
$\frac{d \rho}{d t}=\mathcal{D}[X] \rho+\sqrt{\eta} \mathcal{H}[X] \rho \xi(t)$
$\mathcal{D}[X] \rho=X \rho X^{\dagger}-\frac{1}{2}\left(X^{\dagger} X \rho+\rho X^{\dagger} X\right)$
$\mathcal{H}[X] \rho=X \rho+\rho X-\left\langle X+X^{\dagger}\right\rangle \rho$
Kappa is the measurement strength.
In Bloch Vector form,
$\rho=\frac{1}{2}\left(I+x \sigma_{x}+y \sigma_{y}+z \sigma_{z}\right)$
Then,
$\mathcal{D}[X] \rho=2 \kappa\left(\sigma_{z} \rho \sigma_{z}-\rho\right)$
$\mathcal{H}[X] \rho=\sqrt{2 \kappa}\left(\sigma_{z} \rho+\rho \sigma_{z}-2 z \rho\right)$
To find $dx$
$\frac{d x}{d t}=\frac{d T r\left(\sigma_{x} \rho\right)}{d t}=2 \kappa\left(\operatorname{Tr}\left(\sigma_{z} \sigma_{x} \sigma_{z} \rho\right)-x\right)+\sqrt{2 \kappa \eta}\left(\operatorname{Tr}\left(\left(\sigma_{x} \sigma_{z}+\sigma_{z} \sigma_{x}\right) \rho\right)-2 x z\right) \xi(t)$
$=-4 \kappa x-\sqrt{8 \kappa \eta} x z \xi(t)$
$\frac{d z}{d t}=\frac{d \operatorname{Tr}\left(\sigma_{z} \rho\right)}{d t}=2 \kappa\left(\operatorname{Tr}\left(\sigma_{z}^{2} \rho \sigma_{z}\right)-\operatorname{Tr}\left(\sigma_{z} \rho\right)\right)+\sqrt{2 \kappa \eta}\left(\operatorname{Tr}\left(\sigma_{z}^{2} \rho+\sigma_{z} \rho \sigma_{z}\right)-2 z \operatorname{Tr}\left(\sigma_{z} \rho\right)\right) \xi(t)$
$=\sqrt{8 \kappa \eta}\left(1-z^{2}\right) \xi(t)$
Now I am trying to find the $\frac{d z}{d t}$ and $\frac{d x}{d t}$, in the case that the $\mathcal{D}[X]$ and $\mathcal{H}[X]$ terms for the same master equation where becomes $X = \cos(\Theta )\sigma _z+\sin(\Theta )\sigma_x$ along measurement angle $\theta$ are:
$\mathcal{D}[X] \rho=X \rho X^{\dagger}-\frac{1}{2}\left(X^{\dagger} X \rho+\rho X^{\dagger} X\right)$
$= \cos^2(\Theta )\sigma _z\rho \sigma _z+\sin^2(\Theta )\sigma _x\rho \sigma _x$
I am confused on what the simplified form of $\mathcal{H}[X]\rho$ will be as my simplification skills are not very strong
I would also need help in finding $\frac{d T r\left(\sigma_{x} \rho\right)}{d t}$ and $\frac{d T r\left(\sigma_{z} \rho\right)}{d t}$ with the $\sin$ and $\cos$ terms like the above simplification.
"
"['quantum-gate', 'qiskit', 'entanglement']"," Title: How does quantum state teleportation works?Body: I've started learning Quantum Computing from the Qiskit Textbook and was able to easily understand or work out everything until it came to the working of Quantum Teleportation
I can understand the procedure of it, but cannot understand why it works and was unable to work out the math of it. I also couldn't find any source that explained this is in a more simplistic manner.
Here's the procedure that I have copy-pasted from the textbook:
Step 1: Alice and Bob create an entangled pair of qubits and each one
of them holds on to one of the two qubits in the pair.
The pair they create is a special pair called a Bell pair. In quantum
circuit language, the way to create a Bell pair between two qubits is
to first transfer one of them to the Bell basis ( |+⟩ and |−⟩ ) by
using a Hadamard gate, and then to apply a CNOT gate onto the other
qubit controlled by the one in the Bell basis.
Let's say Alice owns q1 and Bob owns q2 after they part ways.
Step 2: Alice applies a CNOT gate on q1 , controlled by |ψ⟩ (the
qubit she is trying to send Bob).
Step 3: Next, Alice applies a Hadamard gate to |ψ⟩ , and applies a
measurement to both qubits that she owns - q1 and |ψ⟩ .
Step 4: Then, it's time for a phone call to Bob. She tells Bob the
outcome of her two qubit measurement. Depending on what she says, Bob
applies some gates to his qubit, q2 . The gates to be applied, based
on what Alice says, are as follows :
00 → Do nothing
01 → Apply X gate
10 → Apply Z gate
11 → Apply ZX gate
Note that this transfer of information is classical.
And voila! At the end of this protocol, Alice's qubit has now
teleported to Bob.
"
"['quantum-gate', 'ibm-q-experience', 'physical-realization']"," Title: Physical implementation of gates on IBM QBody: There is a lot of quantum gates in IBM Q Composer, however, only few are implemented physically while others can be composed of them.
When one looks at description of a quantum processor in IBM Q interface, there is a list of basis gates. For example those are id, u1, u2, u3, cx for Melbourne processor. However, gates $I$, $U1$ and $U2$ are special cases of $U3$. If one removes statement include ""qelib1.inc""; from QASM code, only $CNOT$ and $U3$ gates are left. So, it seems that all single qubit gates are implemented with $U3$ and there is of course two qubits $CNOT$.
According to IBM Q manual, $U3$ gate is implemented by three frame changes and two $X_{\pi/2}$ pulses.
My questions are these:
- Which gates are implemented physically on IBM Q? I would expect $CNOT$ and some single qubit gates but which ones?
- What are frame changes and $X_{\pi/2}$ pulses used for gate implementation?
"
"['qiskit', 'mathematics']"," Title: Eigenvalue and eigenvector in QiskitBody: I want to calculate eigenvectors and eigenvalues for real symmetric matrix or Hermitian matrix. Can I use this: https://qiskit.org/documentation/api/qiskit.aqua.components.eigs.Eigenvalues.html
"
"['quantum-state', 'measurement']"," Title: Half of Standard Basis MeasurementBody: I know that we can measure a state in standard basis (Z) where the post measurement state is either $|0\rangle$ or $|1\rangle$. But can you do a 'half-Z' basis measurement? I mean, you only measure with $|0\rangle \langle0|$ or $|1\rangle \langle1|$. So that when you measure $|+\rangle$, you would get $|0\rangle$ or $|1\rangle$ with equal probability. But if you measure $|0\rangle$ in $|1\rangle \langle1|$, then you would not get a detection with certainty. Is there any implementation of this sort of a 'half-basis'?
"
"['quantum-state', 'qiskit', 'fidelity']"," Title: How to calculate state fidelity in Qiskit?Body: I have a circuit with different structures, now I'm trying to calculate the fidelity between those with the original one. How do I calculate the fidelity? I want also to initialize the state vector by myself. Can someone show how to compute fidelity for the below example?
For example if I have a circuit like below,
q = QuantumRegister(2)
qc = QuantumCircuit(q)
qc.cu1(3*pi/4, q[0], q[1]);
print(qc)
and different structure
q = QuantumRegister(2)
qc = QuantumCircuit(q)
qc.h(q[0]);
qc.h(q[1]);
qc.cu1(3*pi/4, q[0], q[1]);
qc.h(q[0]);
qc.h(q[1]);
print(qc)
"
"['circuit-construction', 'nielsen-and-chuang', 'universal-gates']"," Title: Why is Deutsch's gate universal?Body: (This is related to Exercise 4.44 in Nielsen and Chuang)
Deutsch quantum gate is basically a $iR_x(\alpha \pi)$ gate with two control qubits. The constant $\alpha$ is an irrational number that allows to perform any rotation $R_x (\theta)$ by sending $|11\rangle$ to the control qubits. In particular, one can (approximately) construct the set $\{ X, CNOT, \text{Toffoli} \}$ by choosing
$$\alpha \pi \, \approx \, \pi \mod 2\pi,$$
such that $R_x(\alpha \pi) \approx X$. My question is: how do you reach quantum universality? I guess you should be able to construct the Hadamard ($H$) and phase ($S$) gates, which together with $CNOT$ and Toffoli give quantum universality. Or else you should be able to construct $R_z(\theta)$ since $R_z(\alpha) R_x(\beta) R_z(\gamma)$ or $R_x(\alpha) R_z(\beta) R_x(\gamma)$ give any one-qubit unitary.
"
"['quantum-operation', 'notation']"," Title: Confusing notation in Wikipedia's quantum channel articleBody: In the Wikipedia's Quantum channel article, it is said that a purely quantum channel $\phi$ (it's not exactly the same phi calligraphy but it's close), in the Schrodinger picture, is a linear map between density matrices acting on two Hilbert spaces. Then properties of this mapping are given and we find the following notation :
$$I_n \otimes \Phi$$
We find again this difference of notation in the Heisenberg picture paragraph.
However I believe $\phi$ and $\Phi$ are the same and I don't understand the change of notation between the twos. Is there a difference justifying this change or is it a lack of coherence of the notation ?
"
"['physical-realization', 'topological-quantum-computing']"," Title: Why does non-locality and the particle-hole symmetry not contradict each other?Body: Currently, I'm learning about topological quantum computers.
In one of the explained techniques, cooper pairs in superconductors are considered, where a cooper pair with a hole form a Majorana bound state. The pair is at the zero energy level, and as non-zero energies are not allowed, this should protect the Majorana bound state. However, as we have a pair, it is possible for the particles to each have a non-zero and opposite energy. Effectively the total energy is still zero, but each of the particles has non-zero energy.
If we bring these particles far apart, there will be no interaction between them. Consequently, each of the two cannot move to a non-zero energy, as that would violate the particle-hole symmetry.
What I don't understand is:
How can the particles be considered independent, such that their energy is protected and the particle remains at zero energy, while we still have the Majorana properties from the interaction of the two particles?
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: Error while running Quantum Teleportation Algorithm on real device using qiskit on IBM-QBody: I am trying to implement Quantum Teleportation Algorithm on an actual device, I am using IBM-Q Jupyter notebook for the same purpose.
The code is as follows:
import qiskit as qk
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
from qiskit import execute, Aer
from qiskit import IBMQ
from qiskit.visualization import plot_histogram
%config InlineBackend.figure_format = 'svg'
def apply_secret_unitary(secret_unitary, qubit, quantum_circuit, dagger):
functionmap = {
'x': quantum_circuit.x,
'y': quantum_circuit.y,
'z': quantum_circuit.z,
'h': quantum_circuit.h,
't': quantum_circuit.t
}
if dagger == 1:
functionmap['t'] = quantum_circuit.tdg
if dagger:
[functionmap[unitary](qubit) for unitary in secret_unitary]
else:
[functionmap[unitary](qubit) for unitary in secret_unitary[::-1]]
secret_unitary = 'hzxhzhx'
qc = QuantumCircuit(3, 1)
'''
qc[0] -> The qubit to be teleported
qc[1] -> entangled state, possessed by alice
qc[2] -> entangled state, possessed by bob
'''
apply_secret_unitary(secret_unitary, qc.qubits[0], qc, dagger = 0)
qc.barrier()
qc.h(1)
qc.cx(1, 2)
qc.barrier()
qc.cx(0, 1)
qc.h(0)
qc.cx(1, 2)
qc.cz(0, 2)
apply_secret_unitary(secret_unitary, qc.qubits[0], qc, dagger = 1)
qc.barrier()
qc.measure(2, 0);
qc.draw(output= 'mpl')
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
provider.backends()
from qiskit.providers.ibmq import least_busy
backend = least_busy(provider.backends(filters = lambda b: b.configuration().n_qubits >= 3 and
not b.configuration().simulator and
b.status().operational == True))
job_exp = execute(qc, backend = backend, shots = 8192)
exp_result = job_exp.result()
exp_measurement_result = exp_result.get_counts()
print(exp_measurement_result)
plot_histogram(exp_measurement_result)
The error which the following code gives is:
IBMQJobApiError: ""'400 Client Error: Bad Request for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs/5e73033786653e0018a2364e/resultDownloadUrl. Cannot get presigned download url., Error code: 3202.'""
I've tried deleting my account and load a new account using a newly generated token but that doesn't seem to work either.
Clicking the link in the error gives the following error:
OPERATION_NOT_AVAILABLE
404 Shared class ""Hub"" has no method handling GET /ibm-q/Groups/open/Projects/main/Jobs/5e72ff01121d5e0018bfe775/resultDownloadUrl.
code: 2411
perhaps, I am using a method which is now deprecated. How can I tackle this situation?
"
"['gate-synthesis', 'unitarity']"," Title: How to prove that a matrix is an arbitrary unitary?Body: My goal is to prove that I can synthesise arbitrary unitary from two components.
In the end, I find a matrix with the form
\begin{equation}
\mathbf{W}_j=\begin{pmatrix}
|\alpha|2\cos{(\phi_{k,2}+\phi_{k,1})}+i|\beta|2\cos{(\phi_{k,2}-\phi_{k,1})} & i|\alpha|2\sin{(\phi_{k,2}+\phi_{k,1})}+|\beta|2\sin{(\phi_{k,2}-\phi_{k,1})}\\
i|\alpha|2\sin{(\phi_{k,2}+\phi_{k,1})}+|\beta|2\sin{(\phi_{k,2}-\phi_{k,1})} &
|\alpha|2\cos{(\phi_{k,2}+\phi_{k,1})}+i|\beta|2\cos{(\phi_{k,2}-\phi_{k,1})}
\end{pmatrix}
\end{equation}
where $\phi_{k,1}$,$\phi_{k,2}$,$\alpha$ and $\beta$ are parameters.
Where can I begin to prove that it is an arbitrary unitary?
"
"['quantum-gate', 'zx-calculus']"," Title: Explain the representation of the CNOT gate in ZX-calculusBody: In ZX-calculus, the CNOT gate is represented by this:
Can someone show me why this is true, using just the basic rewriting rules? All books/papers I have seen simply take it without proof, but I can't see why it is true.
"
"['quantum-gate', 'gate-synthesis', 'unitarity']"," Title: How can I fill a unitary knowing only its first column?Body: I have a unitary matrix that I want to construct. I only care what happens to the first computational state, so the first column is specified. So far, I've been assigning each question mark to a variable and solving $UU^T = I$ analytically. But this 6x6 case is out of computational reach for this method.
Is there any general method, or any clever trick, to help me fill in the rest of matrices such as $U$?
Note: I actually would prefer if all the entries were real, so technically these are better called orthogonal matrices.
$U = \frac{1}{\sqrt{5}}\begin{bmatrix}
0 & ? & ? & ? & ? & ? \\
1 & ? & ? & ? & ? & ? \\
1 & ? & ? & ? & ? & ? \\
1 & ? & ? & ? & ? & ? \\
1 & ? & ? & ? & ? & ? \\
1 & ? & ? & ? & ? & ? \\
\end{bmatrix} $
"
"['cryptography', 'communication', 'bb84']"," Title: How to deal with noise in BB84 protocol?Body: BB84 protocol works followingly:
- Alice generate $N$ random qubits $a_i$ in state either $|0\rangle$ or $|1\rangle$ . These will be a key. Then she prepares $N$ random bits $b_{i}$. If $b_i=0$, an identity gate is applied and qubit is left in either state $|0\rangle$ or $|1\rangle$. If $b_i=1$ then Hadamard gate is applied changing qubit $a_{i}$ to either state $|+\rangle$ or $|-\rangle$. After that qubits are sent to Bob.
- Bob generates $N$ random bits. According to the value of $b_{i}^{'}$ he applies either identity or Hadamard gate on received qubit $a_{i}$ and measure it, receiving either 0 or 1.
- Alice and Bob compare bits $b_i$ and $b_i^{'}$. If they are equal, now classical bit $a_i$ is preserved and become part of the key. About $N/2$ of $a_{i}$ bits are preserved on average.
- Alice and Bob send each other $N/4$ $a_{i}$ bits to analyze a noise level. In case the level is higher than some threshold (natural noise level of the channel used for a quantum communication), there is a high probability that Eve tried to catch communication between Alice and Bob. In such a case, the current key is dismissed and the process starts again.
- Alice and Bob reconcile the key obtained in step 4 to ensure that both have the same key, cleaned from noise. At the same time, they have to amplify privacy to hide the key from Eve because this communication is done via the classical channel.
So, my question is how step 5 is done in practice? To reconcile the key, they have to exchange some information about it. I found that a hash function can be used for concealing information about the key from Eve as much as possible. However, if the information is hidden, how can Alice and Bob repair the key to ensure they have the same one?
"
"['quantum-gate', 'entanglement', 'tensor-product']"," Title: What is a local operator?Body: I have a sort of basic question. I think an operator that acts on $n$-partite states is defined (up to permutation of parties) to be local if it can be written as
$$A = A_1 \otimes_{i=2}^n \mathbb{I}_i $$
where the subscript $i$ denotes the party on which an operator acts. This definition ensures that $A$ is acting only on one party (here we are assuming that each party is spatially separated from the rest). So far so good. The problem comes when I consider concatenation of operators. Consider for instance a 3-qubit system, and consider the local operators
$$\mathcal{O}_1 = Z_1 \otimes \mathbb{I}_2 \otimes \mathbb{I}_3 \, , \quad \mathcal{O}_2 = \mathbb{I}_1 \otimes Z_2 \otimes \mathbb{I}_3 \, , \quad \mathcal{O}_3 = \mathbb{I}_1 \otimes \mathbb{I}_2 \otimes Z_3 \, , $$
i.e. $\mathcal{O}_i$ applies the $Z$ gate to party $i$ and does nothing to the rest. If Alice performs $\mathcal{O}_1$, then Bob performs $\mathcal{O}_2$ and then Charlie performs $\mathcal{O}_3$, which I understand is a protocol within the LOCC rules (actually no communication is needed at all) then the resulting gate is
$$ \mathcal{O}_3 \mathcal{O}_2 \mathcal{O}_1 = Z_1 \otimes Z_2 \otimes Z_3 \, ,$$
which I would say is a non-local operator. How is it that a succession of local operators gives rise to a non local operator?
"
"['simulation', 'cirq']"," Title: Normalization of the quantum state in CirqBody: My understanding, for instance from this youtube video, is the following:
Assuming a state $\psi = \alpha |0\rangle + \beta |1\rangle$, where $\alpha$ and $\beta$ can be complex. I believe any state is always normalized, so that $|\alpha|^2 + |\beta|^2 = 1$. The probabilities can be calculated as follows: $P_0 = |\alpha|^2$ and $P_1 = |\beta|^2$.
I am currently switching from Qiskit to Cirq. In Cirq, I simulate a simple 3-qubit circuit (see code below). I get the following state:
[0.34538722-0.7061969j 0.29214734-0.14894447j 0.29214737-0.14894448j
0.13474798+0.02354215j 0.29214734-0.14894444j 0.13474798+0.02354215j
0.134748 +0.02354216j 0.03903516+0.04161799j]
When adding all the squares of the real components, I end up with 0.4313373551216718. This is confusing me, as this appears to be non-normalized.
My question: Why does this not add up to 1?
Minimal example:
import cirq
import sympy
import numpy as np
import math
# qubits
q = cirq.GridQubit.rect(1, 3)
q_pi = np.pi/4 # quarter_py
# Create a circuit on these qubits using the parameters you created above.
circuit = cirq.Circuit(
cirq.rx(0.1).on(q[0]), cirq.rx(0.1).on(q[1]), cirq.rx(0.1).on(q[2]),
cirq.ry(q_pi).on(q[0]), cirq.ry(q_pi).on(q[1]), cirq.ry(q_pi).on(q[2]),
cirq.rz(q_pi).on(q[0]), cirq.rz(q_pi).on(q[1]), cirq.rz(q_pi).on(q[2]))
simulator = cirq.Simulator()
results = simulator.simulate(program=circuit, param_resolver=resolver, qubit_order=q).final_state
print(results)
print(np.sum([math.pow(x.real,2) for x in results]))
"
"['physical-realization', 'nielsen-and-chuang', 'physical-qubit', 'chemistry']"," Title: Readout using an NMR spectrumBody: I'm trying to understand how to read results from an NMR quantum computer.
According to Nielsen and Chuang:
The principal output is the free induction decay signal $$V(t) = V_0\text{Tr}\left[e^{-iHt}\rho e^{iHt}(iX_k+Y_k)\right]$$
This signal is measured for some period of time, and then the results are Fourier-transformed into a plot like this one
My question is: what do these peaks mean? Suppose I want to know how much of my ensemble is in the $|110\rangle$ (or whatever) state, how do I read this off of the plot?
"
"['qiskit', 'optimization', 'vqe', 'quantum-computing-for-finance']"," Title: What is the risk factor on IBM's portfolio optimization notebook?Body: In the notebook ""portfolio optimization"" on IBM's platform the goal is to calculate the optimal stock selection using a classical and a quantum algorithm (VQE). A random portfolio is generated and then a risk factor is set.
What is the realistic value of this risk factor on the stock market and why do the authors select a risk factor of 0.5? How does it change the selection of the optimal portfolio?
"
"['qiskit', 'deutsch-jozsa-algorithm']"," Title: Understanding the working of oracle in Deutsch - Jozsa AlgorithmBody: Reading through the official Qiskit textbook, I fell onto the problem of Deutsch - Jozsa Algorithm, which seemed little mystical to me at first but as I tried out the example of its working, I was unable to work out the last part of it, the example is copy-pasted below:
Let's go through a specific example for a two-bit balanced function with hidden bitstring a=3.
- The first register of two qubits is initialized to |0⟩ and the second register qubit to |1⟩:
$$|ψ_0⟩=|00⟩_1|1⟩_2 $$
- Apply Hadamard on all qubits:
$$|ψ_1⟩=\frac{1}{2}(|00⟩_1+|01⟩_1+|10⟩_1+|11⟩_1)\frac{1}{\sqrt{2}}(|0⟩_2−|1⟩_2)$$
- For a=3, (11 in binary) the oracle function can be implemented as $Q_f=CX_{1a}CX_{2a}$,
$$|ψ_2⟩=\frac{1}{2\sqrt{2}}[|00⟩_1(|0⊕0⊕0⟩_2−|1⊕0⊕0⟩_2)+|01⟩_1(|0⊕0⊕1⟩_2−|1⊕0⊕1⟩_2)+|10⟩_1(|0⊕1⊕0⟩_2−|1⊕1⊕0⟩_2)+|11⟩_1(|0⊕1⊕1⟩_2−|1⊕1⊕1⟩_2)] $$
4.Thus:
$$|ψ_2⟩=\frac{1}{2\sqrt{2}}[|00⟩_1(|0⟩_2−|1⟩_2)−|01⟩_1(|0⟩_2−|1⟩_2)−|10⟩_1(|0⟩_2−|1⟩_2)+|11⟩_1(|0⟩_2−|1⟩_2)]
=\frac{1}{2}(|00⟩_1−|01⟩_1−|10⟩_1+|11⟩_1)\frac{1}{\sqrt{2}}(|0⟩_2−|1⟩_2)$$
$$ =\frac{1}{\sqrt{2}}(|0⟩_{10}−|1⟩_{10})\frac{1}{\sqrt{2}}(|0⟩_{11}−|1⟩_{11})\frac{1}{\sqrt{2}}(|0⟩_2−|1⟩_2) $$
- Apply Hadamard on the first register:
$$ |ψ_3⟩=|1⟩_{10}|1⟩_{11}(|0⟩_2−|1⟩_2) $$
- Measuring the first two qubits will give the non-zero 11, indicating a balanced function.
The main problem in understanding was in the final step, going from :
$$ |ψ_2⟩=\frac{1}{2}(|00⟩_1−|01⟩_1−|10⟩_1+|11⟩_1)\frac{1}{\sqrt{2}}(|0⟩_2−|1⟩_2) $$
to:
$$ |ψ_2⟩=\frac{1}{\sqrt{2}}(|0⟩_{10}−|1⟩_{10})\frac{1}{\sqrt{2}}(|0⟩_{11}−|1⟩_{11})\frac{1}{\sqrt{2}}(|0⟩_{2}−|1⟩_{2}) $$
It seems to be some sort of a factorization step, how does that work?
"
"['simulation', 'cirq']"," Title: How to calculate the probabilities of observing quantum states using the ""expectation_from_wavefunction"" in cirq (and why)Body: I am currently simulating some quantum circuits, and want to calculate the probabilities of observing each individual state. I am able to use Cirq for this, and calculate it using $P_{00} = |\alpha|^2$.
Code:
import cirq
import sympy
x0, x1 = sympy.symbols('x0 x1')
q = cirq.GridQubit.rect(1, 2)
circuit = cirq.Circuit(
cirq.rx(x0).on(q[0]), cirq.rx(x1).on(q[1]),
cirq.ry(3.14/4).on(q[0]), cirq.ry(3.14/4).on(q[1]))
resolver = cirq.ParamResolver({x0: 0.2, x1: 0.3})
simulator = cirq.Simulator()
results = simulator.simulate(program=circuit, param_resolver=resolver,
qubit_order=q).final_state
print(""Internal quantum state:"", results)
print(""Probabilities of observing each state:"", [abs(x)**2 for x in results])
Output:
internal quantum state: [0.8377083+0.08743566j 0.3529709-0.11249491j 0.35297093-0.06251574j 0.13120411-0.08743566j]
probabilities of observing each state: [0.7094002059173512, 0.13724355108492148, 0.12849669756020887, 0.024859516013751914]
However, in multiple tutorials (for instance from TFQ) I see the use of ""expectation_from_wavefunction"":
z0 = cirq.Z(q[0])
qubit_map={q[0]: 1, q[1]: 1}
z0.expectation_from_wavefunction(results, qubit_map).real
output:
0.6757938265800476
My question:
How can I use expectation_from_wavefunction to obtain the probabilities of observing the individual states ($P_{00}, P_{01}, P_{10}, P_{11}$)?
Bonus question: why would I favor this approach?
"
"['resource-request', 'physical-realization', 'physical-qubit', 'photonics', 'optical-quantum-computing']"," Title: What are some good resources for learning about photonic qubits?Body: I am interested in resources that would allow me to learn about the physics behind optical quantum computation, and specifically, the physical properties of photonic qubits. I have some good resources on quantum optics, but is there anything more specific (for instance, any good review papers) I should be reading alongside this material?
"
"['qiskit', 'quantum-state', 'circuit-construction', 'teleportation']"," Title: How does the teleportation circuit work after the initial entanglement?Body: I'm trying to understand why we do what we do when we teleport a state from Alice's first qubit to Bob's qubit. I understand the initial entanglement, but could use help walking through the program.
I have a teleportation circuit,
circuit = QuantumCircuit(3,3)
First, I create the bell pair for Alice and Bob:
circuit.h(1)
circuit.cx(1,2)
Then, I flip alices first qubit to a 1 state; this is the qubit whose state is to be teleported:
circuit.x(0)
Then, my understanding gets fuzzy, and I have a few questions.
1) I seem to entangle Alice's to-be-teleported state qubit with her qubit that is entangled with Bob's. But what exactly am I doing when I conditionally flip this to-be-teleported qubit and then put a hadamard on it?
circuit.cx(0,1)
circuit.h(0)
and then 2) how does my measurement affect Bob's qubit?
circuit.measure([0,1],[0,1])
finally, 3) why do I again conditionally flip Alice's second qubit with Bob's qubit and then conditionally rotate Alice's to-be-teleported qubit with Bob's qubit?
circuit.cx(1,2)
circuit.cz(0,2)
Here is the whole circuit, for reference:
"
"['bell-experiment', 'non-locality', 'nonclassicality']"," Title: Does the CHSH inequality fully characterise the local polytope?Body: Consider the standard two-party CHSH scenario. Each party can perform one of two measurements (denoted with $x,y\in\{0,1\}$) and observe one of two outcomes (denoted with $a,b\in\{0,1\}$).
Let $P(ab|xy)$ be the probability of observing outcomes $a,b$ when choosing the measurements settings $x,y$. Local realistic theories are those that, for some probability distribution over some hidden variable $\lambda$, satisfy
$$P(ab|xy)=\sum_\lambda q(\lambda)P_\lambda(a|x)P_\lambda(b|y).\tag1$$
Define the local polytope $\mathcal L$ as the set of theories that can be written as in (1).
Note that we identify here a theory with its set of conditional probabilities: $\boldsymbol P\equiv (P(ab|xy))_{ab,xy}$.
Denote with $E_{xy}$ the expectation values $E_{xy}=\sum_{ab}(-1)^{a+b}P(ab|xy)$.
We then know that all local realistic theories $\boldsymbol P\in\mathcal L$ satisfy the CHSH inequality:
$$\Big|\sum_{xy}(-1)^{xy} E_{xy}\Big| = |E_{00}+ E_{01} + E_{10} - E_{11}|
= \left|\sum_{abxy}(-1)^{a+b+xy}P(ab|xy)\right| \le 2.\tag2$$
Is the opposite true? In other words, do all theories satisfying (2) admit local realistic explanations?
"
"['quantum-gate', 'universal-gates']"," Title: Error bound on approximating arbitrary rotation gatesBody: I'm working on the following problem form Nielsen and Chuang (Ex. 4.40) regarding the universality of Hadamard, phase and $\pi/8$ gates for single qubit gates:
For arbitrary $\alpha$, $\beta$,
$E(R_{\vec{n}}(\alpha), R_{\vec{n}}(\alpha + \beta)) = |1 - exp(i\beta/2)|$,
where $E(U, V) = max_{|\psi\rangle} || (U-V)|\psi\rangle||$
Show (using the previous equality) $\forall \epsilon >0$ , $\exists n$, such that $E(R(\alpha)_{\vec{n}}, {R(\theta)_{\vec{n}}}^n) < \frac{\epsilon}{3}$, where $\theta$ is an irrational multiple of $2\pi$.
My attempt:
Prior to the exercise, it discusses how for any arbitrary error $\epsilon > 0$, we can find some multiple $(mod$ $2\pi)$ of irrational $\theta$ (found using the Pigeonhole principle, which I think I understand, and I'm skipping and taking as given), call it $\theta_k \in (0, 2\pi]$, |$\theta_k| < \epsilon$ such that all multiples $(mod$ $2\pi)$ of $\theta_k$ differ by at most $\epsilon$. Thus $\forall \alpha \in [0, 2\pi)$, $\exists m$, such that $|\alpha - (m\theta_k) | =|\alpha - (mk\theta)| < \epsilon$. Let $n = mk$, then
$E(R(\alpha), {R_{\vec{n}}}(\theta)^n) = E(R_{\vec{n}}(\alpha), {R_{\vec{n}}}(n\theta)) = E(R_{\vec{n}}(\alpha), {R_{\vec{n}}}(\alpha + (n\theta -\alpha))) <
E(R_{\vec{n}}(\alpha), {R_{\vec{n}}}(\alpha + \epsilon)) = |1 - exp(i\epsilon/2)| = \sqrt{((1 - cos(\epsilon/2))^2 + sin(\epsilon/2)^2} = \sqrt{2(1 - cos(\epsilon/2))} < 2$
(which is not correct).
I feel like I'm missing something very obvious in this whole exercise. A hint would be appreciated.
"
['terminology']," Title: Terminology : Are basis states the same as basis vectors?Body: The question says it all. Explain any difference in terminology that can be encountered across Physics, Quantum Computing and Mathematics. Thanks!
"
"['algorithm', 'circuit-construction']"," Title: Is there a systematic way to build quantum circuits?Body: The question is quite straightforward. In classical computation, there exists several ways to build logical circuits based on thruth tables and Karnaugh maps. Is there anything equivalent for quantum computation?
Every circuit that I have made is mostly either guessing or saw someone else's answer and paved my way to it.
"
"['algorithm', 'programming', 'q#']"," Title: May I deploy my C# code to Q# Azure quantum computing?Body: I have a code like this
public string CalculateMD5Hash(string input)
{
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hash = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
{
sb.Append(hash[i].ToString(""X2""));
}
return sb.ToString();
}
public bool checkHash(){
List<string> charset = new List<string>{""0"",""1"",""2"",""3"",""4"",""5"",""6"",""7"",""8"",""9"",""a"",""b"",""c"",""d"",""e"",""f"",""g"",""h"",""i"",""j"",""k"",""l"",""m"",""n"",""o"",""p"",""q"",""r"",""s"",""t"",""u"",""v"",""w"",""x"",""y"",""z""};
foreach(var a in charset)
{
foreach(var b in charset){
foreach(var c in charset){
foreach(var d in charset){
foreach(var e in charset)
{
string result = a+b+c+d+e;
if(CalculateMD5Hash(result).StartWiths(""9A4F2E9567F170C5""))
return true;
}
}
}
}
}
return false;
}
Is this possible to bring this into Q# & run them on Azure Quantum using some of the Q# quantum method?
"
"['error-correction', 'stabilizer-code']"," Title: What does it mean to ""measure a stabilizer""?Body: Say I have the stabilizer $XXI$, and a phase-flipped state $|\psi\rangle$. What does it mean to measure the stabilizer $XXI$?
What is the math behind ""measurement""?
"
"['circuit-construction', 'cirq', 'quantum-parallelism']"," Title: Building a state with parallel executionBody: I'm trying to implement the main algorithm described in the Quantum Recommendation Systems paper. In order to do this, I have to create a quantum state $|x\rangle$ corresponding to a real vector stored in QRAM. I used an algorithm described more in detail in another paper, in which one can read:
For the runtime, there are $2^k$ rotations executed at the $k$-th level of the tree, apart from the last level where there are none. For a given level these rotations can be executed in parallel as they are all controlled operations on the same qubit, conditioned on different bit-string values of a shared register. To see this, let $U_x$ be a single qubit rotation conditioned on a bitstring $x \in \{0, 1\}^k$. Then the unitary $\bigoplus\limits_{x\in\{0,1\}^k} U_x$ applied to $|y\rangle\otimes|q\rangle$ achieves the desired parallel operation on the single qubit $|q\rangle$, where $|y\rangle = \sum\limits_{x\in\{0,1\}^k}\alpha_x\,|x\rangle$ is some superposition over bitstrings.
I'm not sure that I understand this notion of parallel execution. In the algorithm, at a given step $k$, one performs on one qubit $2^k$ controlled rotation conditionned on every qubit amongst the first $k-1$. Hence, we can summarize this as one big unitary matrix that acts on the first $k$ qubits, which will look-like $\begin{bmatrix}R_{\theta_1}&0&0\\\vdots&\ddots&\vdots\\0 & 0 & R_{\theta_{2^k}}\end{bmatrix}$, where for a given angle $\theta$, $R_\theta$ is the rotation of angle $\theta$ around the $Y$-axis of the Bloch sphere.
If we assume that this big operator is applied in $O(1)$, then I understand the notion of parallelism: you don't have to successively apply the $2^k$ controlled gates, so you have a gain in complexity. But then, there is one problem I can't cope with. When you execute an algorithm on a quantum computer, I read that you are only allowed to use a specific set of gates. Hence, a compiler takes your code and transforms it to a compatible code. But am I sure that the compiler will always (or even sometimes) be able to decompose this big gate into a succession of smaller, allowed gates, without breaking the complexity?
"
"['hamiltonian-simulation', 'open-quantum-systems']"," Title: Questions about the Hamiltonian of a decayBody: In paper Simulating quantum systems on a quantum computer the author mention in section 3, simulating a decay to obtain the ground state, and give the Hamiltonian for that:
$$H=H_1+H_2 + H_{1I}\otimes H_{2I}$$
My questions are:
- Can you explain this Hamiltonian more explicitly, or refer me to a paper doing that?
- Are there papers that elaborate this Hamiltonian in a quantum computer?
- Are there other Hamiltonians expressing the decay process?
Any answer will be more than appreciated, and thank you :)
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How can I run programs in test folder Github QiskitBody: I am new to GitHub/Python - please tell me how can I run programs in https://github.com/Qiskit/qiskit-aqua/tree/master/test and its sub directories in Jupyter. I am connected to IBM Q Expereince. I am looking at class QiskitBaseTestCase and unittest.
I am reading on unittest - I see a template (sample fixture)
import unittest
def fun(x):
return x + 1
class MyTest(unittest.TestCase):
def test(self):
self.assertEqual(fun(3), 4)
For something like that including the following is sufficient in Jupyter.
if __name__ == '__main__':
unittest.main()
I have tried to copy the https://github.com/Qiskit/qiskit-aqua/blob/master/test/base_test_case.py into Jupyter and start from there - it hasn't helped.
Please help - how to run the Qiskit test cases in Jupyter?
"
"['programming', 'q#']"," Title: Installing Q# in jupyterBody:
I have followed all steps described in https://docs.microsoft.com/en-us/quantum/install-guide/qjupyter
But I am unable to get through part 3. It is showing syntax error in Python terminal in Jupyter notebook.
I am not seeing Q# terminal in jupyter notebook (New) folder
Now after so many attempts its showing
I am done with this. I think its better to switch to Qiskit.
"
['quantum-state']," Title: How can I calculate the probability of a quantum system in superposition to be in the ""up"" state?Body:
I've got this question to answer and from what I can tell, I need to take the square of the absolute value for the probability amplitude.
In this case I think the answer should be the square of $e^{i\phi} \cos(\theta)$
When I try to input this answer it returns ""Phi is not a valid variable for this solution""
How do I go about tackling this question?
"
"['cirq', 'vqe']"," Title: Cirq: easiest way to compute qubit Hamiltonian expectation value with number of shotsBody: I was wondering what was the easiest way to take a qubit Hamiltonian, and get an expectation value estimated with a certain number of shots over a parameterized quantum circuit (or ansatz) with Cirq.
"
"['information-theory', 'entropy', 'max-entropy', 'relative-entropy']"," Title: Questions about the relation between max-relative entropy $D_{\max}(\rho||\sigma)$ and max-informationBody: The max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\},$$
where $\rho\leq \sigma$ should be read as $\sigma - \rho$ is positive semidefinite. In other words, $D_{\max}$ is the logarithm of the smallest positive real number that satisfies $\rho\leq\lambda\sigma$. I would like to understand the following properties of this quantity when the states are bipartite i.e. they live on $H_A\otimes H_B$. In the following, all $\rho$ and $\sigma$ correspond to quantum states (positive semidefinite matrices with unit trace).
A quantity known as the max-information that $B$ has about $A$ is given by
$$I_{\max}(A:B)_\rho = \min\limits_{\sigma_B} D_{\max}(\rho_{AB}||\rho_A\otimes\sigma_B)$$
Let the minimum on the right hand side be achieved by the state $\sigma^\star_B$. My questions are as follows
- Can someone provide an example of a state $\rho_{AB}$ for which $\sigma^\star_B \neq \rho_B$?
- Is it true that $D_{\max}(\rho_{B}||\sigma^\star_B) \leq D_{\max}(\rho_{B}||\sigma_B)$ for all $\sigma_B$ i.e. is the $D_{\max}$ minimizing state preserved under a partial trace?
"
"['quantum-gate', 'entanglement', 'hadamard']"," Title: Simple algebraic explanation for normalizing statesBody: I'm wondering how a set of three 0-state qubits, each prepared identically, like so:
When considered together, may produce the fraction:
along with their combined states.
This is the entire circuit. Is this an indication of entanglement? Understanding the algebra here will help me to understand more generally how the entanglement occurs. Thanks in advance.
"
['algorithm']," Title: Quantum algorithm for QR and SVD matrix decomposition?Body: I would like to know if exist a quantum algorithm tailored to compute the QR decomposition and SVD of a matrix? Pointers to relevant papers will be very appreciated.
"
"['quantum-state', 'measurement', 'bell-basis']"," Title: Constructing and Measuring in an Arbitrary 3-qubit basisBody: As part of a Quantum Theory project I have ""constructed"" an arbitrary 3-qubit basis:
$\left|B_0\right> =\left|000\right>$
$\left|B_1\right> = \frac{1}{\sqrt{2}}\cos(x)(\left|100\right> + \left|010\right>) + \sin(x)\left|001\right>$
and so on to $\left|B_6\right>$.
The states are orthogonal and form a proper basis set.
However, I would like to know if (and how) such a measurement can be performed.
I was looking at polarization of light and time-bins qubits experiments, but they only seem to look at creating those states, rather than performing a measurement in this basis.
Thank you in advance for your answers!
"
"['quantum-gate', 'pauli-gates']"," Title: Qubit in a mix sin/cosine stateBody: The question is pretty simple. How can I get an input qubit $|0⟩$ in the state, say $$\cos{\frac{\pi}{10}}|0⟩ + \sin{\frac{\pi}{10}}|1⟩$$ Or any other sine/cosine mix state? Which gates do I need to use?
Thanks!
"
"['quantum-state', 'bloch-sphere']"," Title: How is a qubit represented on a bloch sphere?Body: A quantum state can be represented as linear combination of 2 states:
In Chuang and Nielsens book, it states that because the squared amplitudes sum to 1:
That the combination can be rewritten as:
My first question is, why exactly is this? And secondly, how is this state represented in the bloch sphere?
I am aware that this may be a simple question to many, but a step by step walkthrough of the algebra underlaying the bloch representation of the qubit would be immensely helpful to me and some friends.
"
"['quantum-state', 'nielsen-and-chuang']"," Title: Why is Hilbert space considered especially large?Body: In Nielsen & Chuang section 1.2 introduces multiple qubits and Hilbert spaces.
More generally, we may consider a system of n qubits. The computational basis states
of this system are of the form $|x_1 x_2 ...x_n\rangle$, and so a quantum state of such a system
is specified by $2^n$ amplitudes. For $n = 500$ this number is larger than the estimated
number of atoms in the Universe! Trying to store all these complex numbers would not
be possible on any conceivable classical computer. Hilbert space is indeed a big place.
In principle, however, Nature manipulates such enormous quantities of data, even for
systems containing only a few hundred atoms. It is as if Nature were keeping $2^{500}$ hidden
pieces of scratch paper on the side, on which she performs her calculations as the system
evolves. This enormous potential computational power is something we would very much
like to take advantage of. But how can we think of quantum mechanics as computation?
Okay, but for a $n=500$ classical bits you still have $n$ amplitudes, just half as many as the quantum counterpart. And $2^{500}$ is still really huge. Does saying ""Hilbert space is is a big place"" (Carlton Caves) really mean anything on its own? What do I need to add to this to really differentiate from the classical counterpart?
"
"['programming', 'cirq']"," Title: A bug during CIRQ installationBody: I had the following problem with an installation of the Cirq.
When I typed python -m pip install cirq, I got the following line:
""Cannot uninstall 'sympy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.""
The source of this issue was in a new version of 'sympy' (1.23 instead of 1.22).
I found a simple solution to remove 'sympy'
conda uninstall sympy
and then wrote this code python -m pip install cirq again. After that, everything works fine.
Could you correct this bug in the future?
"
"['quantum-state', 'entanglement', 'circuit-construction']"," Title: Uniform superposition of states with one qubit set to $|1\rangle$ and others to $|0\rangle$Body: I am wondering what a circuit should look like if I want to prepare the state of the following form:
$$
|0\rangle^{\otimes n} \mapsto \dfrac{
|1000\ldots0\rangle +
|0100\ldots0\rangle +
|0010\ldots0\rangle +
\ldots +
|00\ldots001\rangle
}{\sqrt{n}}
$$
Is this something well-known and trivial?
ANSWER
Apparently, this question was asked here.
The Q# realization is provided in katas 15-17 here.
"
"['quantum-gate', 'gate-synthesis']"," Title: Decompose Toffoli gate with minimum cost for IBM quantum computerBody: The known decomposition of toffoli gate that can be used on IBM quantum computer is :
I want to know any other Toffoli gate decompositions that can be used on IBM quantum computer and have a cost less than 15 gates
"
"['quantum-gate', 'qiskit', 'hamiltonian-simulation', 'hhl-algorithm']"," Title: Quantum circuit to implement matrix exponentialBody: I want to build a circuit which will implement $e^{iAt}$, where $ A=
\begin{pmatrix}
1.5 & 0.5\\
0.5 & 1.5\\
\end{pmatrix}
$ and $t= \pi/2 $.
We see that $A$ can be written as, $A=1.5I+0.5X$. Since $I$ and $X$ commute, $e^{iAt}=e^{i(1.5I)t}e^{i(0.5X)t}$.
Evaluating manually, I get $e^{iAt}=1/2\begin{pmatrix}
e^{2it}+e^{it} & e^{2it}-e^{it}\\
e^{2it}-e^{it} & e^{2it}+e^{it}\\
\end{pmatrix}.$
Question
How can I decompose the matrix $""1/2\begin{pmatrix}
e^{2it}+e^{it} & e^{2it}-e^{it}\\
e^{2it}-e^{it} & e^{2it}+e^{it}\\
\end{pmatrix}""$ into elementary quantum gates
"
"['quantum-state', 'quantum-fourier-transform']"," Title: What is the probability to get all qubits equal zero after QFTBody: Question from exam:
Bob built a quantum computer wiht 10 qubits. All qubits are set to zeroes. Bob performed a quantum Fourier transform on the system and then measured the system.
what is the probability that the result will be 0 (all qubits are zeroes)?
"
"['no-cloning-theorem', 'cryptocurrency', 'quantum-money']"," Title: Has Blockchain made Quantum Money obsolete?Body: Quantum Money is an old proposal that solves the forgeability problem of traditional banknotes, by leveraging the No-Cloning Theorem.
Recently, blockchains solved the Double-Spending problem allowing them to be de facto usable as money. Indeed even though on a blockchain you can forge as many coins as you wish, the other participants will not accept your claims.
Are there any aspect which make quantum money a superior alternative to blockchain digital currencies?
"
['quantum-gate']," Title: S gate vs P gate?Body: The paper A Fully Fault-Tolerant Representation of Quantum Circuits uses the $P$ gate which is given as:
$$P = \begin{bmatrix}1 & 0\\0 & i\\\end{bmatrix}.$$
Nielsen and Chuang Quantum Computation and Information 10th edition uses the $S$ gate which is also given as:
$$S = \begin{bmatrix}1 & 0\\0 & i\\\end{bmatrix}.$$
Why does the same gate has different names?
"
"['quantum-state', 'bloch-sphere']"," Title: Bloch sphere, where are magnitude and phase of a qbit?Body:
Where are magnitude and phase of a qbit on Bloch sphere?
Phase is angle φ. What do you mean by magnitude? Amplitudes? They are given by angle θ - amplitude of |0⟩ is cos(θ/2) and amplitude of |1⟩ is sin(θ/2).
Does it means that Z axis represent magnitude/amplitudes, and X and Y represent phase?
Why do we need 2 axis (X and Y) to represent phase?
"
"['quantum-gate', 'quantum-state', 'bell-basis']"," Title: Creating Bell states (a question from tutorial)Body: I was going through a Quantum Computation lecture series on YouTube given by Umesh Vazirani. There in Lecture 6.3 he talks about creating a Bell state using a Hadamard and CNOT gate. He seems to be using |0⟩ and |1⟩. Is he talking about measuring a qubit in 0-1 basis and then using the qubits that gave 0 as a result for the |0⟩. Here is an image for reference.
"
['entanglement']," Title: Entanglement - Natural and Unavoidable or Difficult to Do and Flimsy?Body: I’m hoping the quantum community here might weigh in with some thoughts on something that is bothering me regarding quantum entanglement…something that seems as big a disagreement in the quantum world as the Copenhagen theory, and it’s possibly directly related.
I’m of the belief that quantum entanglement is natural and unavoidable, and that any two quantum particles that “touch” or come near each other will not only entangle, but entangled the rest of their lives. I know at least a few very well-respected quantum theorists and scientists hold this view.
The opposite, seemingly far more popular side of the argument, believes that entanglement is fairly difficult to do and the entanglement bond is flimsy and easy to break. The former side believes that decoherence is simply the measurement devices getting entangled with the quantum entangled particles we are trying to follow and our inability to track/separate the additional entanglement impacts on the original tracked particles (i.e. like trying to follow a drop of colored dye dropped into an ocean).
Which side do you fall on, is entanglement easy and hard to avoid or hard to do and easily broken?
Any additional thoughts you could add would be much appreciated.
I'm thinking about writing an article on this subject and share some of the replies, so if you reply, consider that I may print it in my article.
"
"['entanglement', 'textbook-and-exercises']"," Title: More than one Schmidt coefficient implies entanglement?Body: I'm studying Quantum Information Theory by Mark M. Wilde, and I got stuck in solving the exercise 3.8.2 in page 100. The exercise is to show that a pure bipartite state is entangled if and only if it has more than one Schmidt coefficient. The hint below the problem says that
\begin{equation*}
\max_{|φ\rangle_A,|ψ\rangle_B} |\langleφ|_A ⊗ \langleψ|_B |ϕ\rangle_{AB}|^2 < 1
\end{equation*}
if there is more than one Schmidt coefficient for the state $|ϕ_{AB}\rangle$. Also, the hint suggests using the Schwarz inequality. It is clear that one Schmidt coefficient implies a product state, but I cannot figure out how to show the strict inequality above. I appreciate any help.
"
"['quantum-state', 'noise']"," Title: What is the precise definition of the environment a qubit lives in?Body: The book An Introduction to Quantum Computing (section 10.4.1 Error Models for Quantum Computing) by Phillip Kaye, Raymond Laflamme and Michele Mosca states the following:
Errors occur on a qubit when its evolution differs from the desired one. This difference can occur due to imprecise control over the
qubits or by interaction of the qubits with an environment. By
‘environment’, we mean everything external to the qubit under
consideration. A ‘quantum channel’ is a formal description of how
qubits in a given setting are affected by their environment.
I would like to know what is the environment and what are the physical characteristics that describe it.
Furthermore, does the qubit alone generate noise within itself (assuming that no noise is generated from its environment)?
"
['universal-gates']," Title: Is $R_x$, $R_y$, $R_z$, and $CNOT$ a Universal gate set?Body: The book ""Introduction to Spintronics"" 2nd edition says on page 542 that an arbitrary single qubit rotation and a CNOT comprises a universal gate set. Is this true?
If so, why isn't this the gate set implemented in commercial quantum computing implementations? The book makes them sound straight-forward to implement in the context of semiconductor quantum dot-based qubits.
"
"['simulation', 'openfermion']"," Title: ""$W_n$ state"" in Bravyi-Kitaev encodingBody: For a particular simulation, I need the initial (physical) state of the QC to represent the equal superposition of all single-occupancy fermionic second-quantized states. In Jordan-Wigner encoding, I can simply prepare the $W_n$ state:
$$
\begin{alignedat}{8}
&\text{Fermionic state}:\qquad&&(|1000\ldots\rangle+|0100\ldots\rangle+|0010\ldots\rangle+\ldots)/\sqrt{n}\\
&\text{JW encoded state}:\qquad&&(|1000\ldots\rangle+|0100\ldots\rangle+|0010\ldots\rangle+\ldots)/\sqrt{n} = U_{W_n} (|0\rangle^{\otimes n})
\end{alignedat}
$$
How do I prepare such a state in the Bravyi-Kitaev encoding?
So far I know how to construct:
- The BK code matrix $\beta_n$ (as defined here). For each fermionic state, it gives the corresponding qubit state.
- A circuit $U_{W_n}$ implementing the $W_n$ transformation — which does the job in the case of JW encoding.
My guess is that I should somehow implement a unitary gate which would do sort of a BK transform of the qubits...
More generally, given some superposition of the fermionic states (the one which, in the JW language, can be prepared from $|0\rangle^{\otimes n}$ by a known operator $U$), how do I construct the corresponding BK-encoded state?
"
"['programming', 'ibm-q-experience', 'simulation', 'teleportation', 'entanglement-swapping']"," Title: Entanglement Swapping CircuitBody: I implemented 2 versions of the entanglement swapping circuit in IBM Q. One is using classical measurement to control X, Z gates. Another is just us C-NOT and Controlled-Z. They should be equivalent. The 1st and 2nd bits were entangled. After teleportation of the 2nd bit to the 4th bit, I expect the 1st and the 4th bit will be entangled. I can see that when using the 2nd method. But not the case for 1st method. Did I make a mistake or there is a bug?
Method 1:
Method 2:
"
"['quantum-gate', 'circuit-construction', 'quantum-computing-for-finance']"," Title: Rotations to encode $f(x)$ into ancilla qubit for quantum Monte CarloBody: I'm trying to understand the quantum monte-carlo algorithm starting at the most basic version. A key step is rotating (Algorithm 1 p.g 8), an ancilla bit by rotation $R$ with respect to the value of a function $f(x)$ where $x$ is a bit string encoded in $|x\rangle$, such that:
$R|x\rangle|0\rangle = \sum_{x} |x\rangle(\sqrt{1-f(x)}|0\rangle + \sqrt{f(x)}|1\rangle) $
Starting with the simple function $f(x) \rightarrow y $, where $x \in \{0,1\}^k$ and $y \in [0,1]$, i.e $f(x)$ maps the bit string to its corresponding fractional number, I am trying to find the rotation $R$.
Initially I was thinking along the lines of using a controlled rotation for each bit $k$ such that $R_y^k|0 \rangle \rightarrow (\sqrt{1-\frac{1}{2^k}}|0\rangle + \sqrt{\frac{1}{2^k}}|1\rangle) $ however the issue here is that successive rotations aren't additive, so for example the the encoding the bit string $|x \rangle = \{1,1\} $:
$f(\{1,1\}) \rightarrow 0.75$,
the controlled rotations from the first and second bit would be
$R_y^1R_y^2|0 \rangle \neq (\sqrt{1-f(x)}|0\rangle + \sqrt{f(x)}|1\rangle)$ .
which is due to the nonlinearity of $\arccos$
$\arccos(\sqrt{0.5}) + \arccos(\sqrt{0.25}) \neq \arccos(\sqrt{0.75})$
The other approach is to have a controlled rotation for each permutation in $\{0,1\}^k$ however this results gates $O(2^K)$ .
For this simple $f(x)$ what is the best way to derive the circuit for rotation $R$ controlled by $|x \rangle$ and if there is a circuit that only involves $O(K)$ gates.
Thanks!
---- Current ideas ----
1) Linear approximation of $\arccos$ for sufficiently small $a,b$ we can apply a linear correction term to approximate
$\arccos(a) + \arccos(b) = \arccos(a+b) - \frac{\pi}{2}$
Generalising this for a $K$ bit system $\{i_1,i_2, \dots i_K\} $ the correction is $-\frac{\pi}{2}(1-\sum_ki_k)$.
In this case instead of $f(x) \rightarrow y $ it is required that $f(x) \rightarrow \sqrt{y} $, and assuming the linear approximation $O(K)$ rotations are required to map binary representation of $\sqrt{y}$ to the ancilla state
2) Be lazy and implement a qgan neural network that approximates the rotations. Given a $K$ bit system this only requires $2^K$ training values.
"
"['algorithm', 'quantum-state', 'programming', 'physical-qubit', 'embedding']"," Title: What exactly does it mean to embed classical data into a quantum state?Body: As the title states.
I am a Machine Learning Engineer with a background in physics & engineering (post-secondary degrees). I am reading the Tensorflow Quantum paper. They say the following within the paper:
One key observation that has led to
the application of quantum computers to machine learning is their ability to perform fast linear algebra on a
state space that grows exponentially with the number of
qubits. These quantum accelerated linear-algebra based
techniques for machine learning can be considered the
first generation of quantum machine learning (QML) algorithms tackling a wide range of applications in both supervised and unsupervised learning, including principal
component analysis, support vector machines, kmeans clustering, and recommendation systems.
These algorithms often admit exponentially faster solutions compared to their classical counterparts on certain
types of quantum data. This has led to a significant
surge of interest in the subject. However, to apply
these algorithms to classical data, the data must first
be embedded into quantum states, a process whose
scalability is under debate.
What is meant by this sentence However, to apply these algorithms to classical data, the data must first be embedded into quantum states?
Are there resources that explain this procedure? Any documentation or links to additional readings would be greatly appreciated as well.
Thanks in advance!
Note: I did look at this previous question for reference. It helped. But if anyone can provide more clarity from a more foundational first principles view (ELI5 almost), I would be appreciative
"
"['qrac', 'information-theory']"," Title: Impossibility of QRAC with random question, or more general proof of impossibilityBody: TL;DR: Is it known that QRAC where the ""question"" is random instead of chosen are impossible? More generally what are the methods to prove impossibility games?
I often face problems for which I want to prove that they are not solvable. Either with probability 1 (like here), but more generally I'm interested on how to find some upper bound (optimal if possible) of these problems.
As an example, let's consider the following game: I prepare a $|+_\theta \rangle$ with $\theta$ a multiple of $\frac{\pi}{2}$, and the goal is to output $D \in S$, with $S = \{\{0,\frac{\pi}{2}\},\{0,\frac{3\pi}{2}\},\{\pi,\frac{\pi}{2}\},\{\pi,\frac{3\pi}{2}\} \}$, such that $\theta \in D$.
I'd like now to see the different methods to prove that it's not possible to win this game with probability 1, or, even better, I'd like to find an upper bound, or, even better, prove the optimality.
So far, I have two methods, but they are not really perfect:
- the first method is to write a semi-definite program (SDP), where we write each possible output as a 2x2 POVM $\{E_0, E_1, E_2, E_3\}$, and then we solve agains the constraint that the $E_i$ are positive, sum to 1, and we try to maximize the success probability (which is basically a sum of projections on these POVM). Feeding that into a SDP solver program, we can prove that the optimal probability of success is about $0.85$. The advantage of this method is that if the SDP program is nice, we have optimal bound. The problem is that we need to trust a computer.
- another method would be, again, to write the above POVM, and manually try to find some contradiction if the probability of success is equal to 1. The advantage is that we have a proof ""on the paper"". The problem here is that it can be a bit tedious and long to write, and harder to ""automatize"", and it does not prove optimal bounds, just upper bound, or maybe simply impossibility.
Then, I tried to look at the Holevo bound, but it seems that I can't find anything interesting, because from $D$ I can extract at most one bit about $\theta$.
Talking about bounds, I was thinking also to use the Nayak's bound. Unfortunately, this game does not really encode a traditional QRAC (or it's not obvious to me), but it does encode a QRAC where the question asked by Bob is random. Indeed, if we encode a two bit string $m$ such that $00$ is encoded with $|+_0\rangle$, $01$ with $|+_{\pi/2}\rangle$, $11$ with $|+_{\pi}\rangle$ and $10$ with $|+_{3\pi/2}\rangle$, then if we know $D$ we can know for sure one bit of $m$, but we cannot say in advance ""give me the $n$'th bit.
So here is my question:
1) is it known that ""randomized"" QRAC are impossible?
2) is there some other bound that could be useful to prove imposibility results?
Thanks!
"
['applications']," Title: Is quantum computing apropriate for video encoding?Body: Hello and sorry if the question is too layman's here. I haven't found an answer when googling.
I am a programmer with some video encoding background, so I know how much energy is ""wasted"" on encoding. Especially with the 2020's situation when a lot of people are working from home, being on video calls all the time, world's encoding has dramatically increased.
There's the new H.265 encoder, which does quite a lot of optimizations, but many of them need to search through a lot of possibilities on how to describe objects moving in a scene - direction, light changes, color changes, size changes, ...
Intuitively, this seems like an ideal application of quantum computing, which, as far as I have read, is good for parallel searching for optimal solution of rather non-discrete problems.
Is that a correct assumption? Is there any progress in that direction? Or is it still too early to apply the current state of the art to such problems?
"
"['qiskit', 'ibm-q-experience', 'measurement', 'phase-estimation']"," Title: Given a state $|\phi\rangle=\frac{1}{\sqrt{2}}(|0\rangle+e^{i\theta}|1\rangle)$, how do I know the angle $\theta$?Body: Question1. If there is a state $|\phi\rangle=\frac{1}{\sqrt{2}}(|0\rangle+e^{i\theta}|1\rangle)$, and I want to know the angle $\theta$. What kind of measurement should I do? Could somebody give me the quantum circuit?
Question2. How to perform a measurement with base $M{{({{\theta }_{k}})}_{\pm }}=\left\{ 1/\sqrt{2}\left( |0\rangle \pm {{e}^{-i{{\theta }_{k}}}}|1\rangle \right) \right\}$ on IBMQ?
"
"['quantum-gate', 'quantum-state', 'qiskit', 'circuit-construction']"," Title: Gate corresponding to $-I$Body: I am implementing a quantum circuit in Qiskit. I create the equal superposition state
$$
-|00\rangle + |01\rangle + |10\rangle +|11\rangle
$$
but I want to obtain the quantum state
$$
|00\rangle - |01\rangle - |10\rangle -|11\rangle .
$$
In general, when I have $n$ qubits, I want to put a -1 coefficient in front of every state except $|0\rangle^{\otimes n}$. This transformation corresponds to $-I$ matrix. Which gate(s) should I apply to my circuit to have this transformation?
"
"['resource-request', 'research']"," Title: What are mailing lists that advertise conferences and academic positions in the area of quantum computing?Body: I am aware of Oxford's Quantum Foundations mailing list that regularly advertises conferences and openings for academic positions related to quantum theory. What are other mailing lists that advertise stuff like this in the area of quantum computing?
For the interested: you can subscribe to the Quantum Foundations list by sending an email to quantum-foundations-subscribe@maillist.ox.ac.uk
Also, this question seems to be related: Resources to keep a track on open Ph.D. positions in specific sub-fields/topics of quantum computing
"
"['algorithm', 'resource-request', 'annealing']"," Title: Best route to learn quantum annealing as a beginnerBody: My main goal is to learn Quantum annealing and quantum optimization in general. This concept is elaborated in this paper. A better example is this paper. I am particularly interested in reading material where the author describes in detail without skipping any step as to how one maps the cost function of your desired optimization problem into a Hamiltonian that can then be solved using a quantum computer.
Most papers that do this, such as the ones I just showed, either assume you already know how to do the mapping and skip the mathematical steps, or will assume you are more interested in the stuff from physics pov and hardware pov. I am interested in this problem only from the algorithmic pov. I want to read tutorial style papers written for engineers interested more in the combinatorial maths and equation manipulation stuff laid out in a detailed manner.
Could you please cite videos/books/papers? If there is prereq to learn mapping costs functions to Hamiltonians then please suggest the quickest possible route for the same?
"
['grovers-algorithm']," Title: Need some explanation about a notation in Grover's algorithmBody: I was reading a wonderful lecture from John Wright on Grover's algorithm. In section 2.3, he makes some simplifications :
Lastly, we are also going to assume that the data is labeled as $n$-bit boolean strings in $\{0,1\}^n$ rather than being indexed from 1 to $N$
This is the part that I have trouble understanding. Does that mean that every item in the list is labeled with a binary number ? Or is it something else, because the black box function is said to do this : $$f:\{0,1\}^n \rightarrow \{0,1\}$$
Which means it either outputs 0 or 1. But then I can't understand the first part. Could someone please explain this to me ?
Edit : thanks for all the answers, I will just explain what I didn't understand. Basically, putting a set to a power of $n$ means that you apply the Cartesian product $n$ times. In this case $\{0,1\}^n$ means all the different combinations of bits you can do of size $n$.
"
"['circuit-construction', 'hhl-algorithm']"," Title: Quantum circuit to get expectation values of Pauli matrices, given state $|\psi\rangle$Body: I'm trying to solve 2 linear equations with the help of HHL algorithm. I've taken $A=\begin{pmatrix}
1.5 & 0.5\\
0.5 & 1.5\\
\end{pmatrix}$ and $b=\begin{pmatrix}
1\\
0\\
\end{pmatrix}$. I've implemented the circuit here, on quirk.
Question
How do I get expectation value of Pauli matrices in the above circuit?
"
"['quantum-gate', 'algorithm', 'grovers-algorithm']"," Title: Construct a oracle for XORBody: I am trying to construct an oracle which should accept 10 or 01 (i.e. $|1\rangle$ should be returned for these input). In the below picture the oracle is between the barrier and after the barrier we have Grover. But something is wrong. After the measurement I get as a result {'10': 260, '01': 248, '00': 274, '11': 242}.
"
"['quantum-gate', 'machine-learning', 'neural-network', 'quantum-enhanced-machine-learning']"," Title: How is data encoded in a quantum neural network?Body: I am a newbie to quantum machine learning. I am trying to build a quantum neural network (QNN). What I studied so far about QNN is that input would be qubits and hidden layer parameter can be set using rotation gates. Since we have limited qubits to use as in IBMQ (we can use 5 qubits only), I am unable to understand how the data set is inputed to our quantum circuit (QNN). If anyone can please guide me with that, would be great.
Thanks
"
"['pauli-gates', 'notation']"," Title: What does the notation $\sigma_j^z$ mean for Pauli matrices?Body: In multiples papers or online article on the QAOA algorithm (such as this one), I found notation for the Hamiltonian similar to this one :
$$ \sum_{ij} \frac{1}{2} (I-\sigma_i^z \sigma_j^z)$$
I don't know how to interpret the notation $\sigma_j^z$. I guess it has something to do with the Pauli matrix $\sigma_z$ but that's all I can understand.
"
['ibm-q-experience']," Title: Why does not ibm-q-experience transpile a circuit always in the same way?Body: When I run a certain circuit (using several qubits, it is not a very simple one) in IBM quantum experience, I find that sometimes it is transpiled in one way and sometimes in another. And the final results are (quite) different. Specifically, I notice this fact in IBM q-computers with more than 5 qubits.
Is it possible to avoid this apparently random behaviour? Is it possible to control the way the circuit is transpiled?
"
['ibm-q-experience']," Title: Real backend for my students?Body: I'd like each of my students to run at least one program (however trivial) on a real quantum computer. They can each sign up for accounts on ibm-q-experience. The question is, which of the backends are real and which are simulations? I see the word ""simulation"" in some of their names. Does that mean that any backend without the word ""simulation"" in its name is a real quantum computer?
"
"['ibm-q-experience', 'pauli-gates']"," Title: Gate Y returns wrong phase in IBM's circuit composerBody: One can check that, with IBM's circuit composer, $Y$ gate acted on $|0\rangle$ or on $|1\rangle$ returns the same phase of $\pi/2$. Is this a bug?
"
"['quantum-gate', 'ibm-q-experience']"," Title: Tensor product IBM on Quantum ExperienceBody: How can you take the Tensor Product in IBM Quantum Experience?
For example
$$(X|1⟩) \otimes ((X|1⟩)$$
I have tried to look up but couldn’t find anything
"
"['algorithm', 'error-correction']"," Title: Why should we measure in X/Z basis for Z/X errors in Steane syndrome extraction?Body: From the Steane syndrome extraction of quantum error correcting code, we use ancilla qubit prepared in logical X/Z basis to detect logical Z/X errors in the logical data state (The CNOT is transversal).
Every material tell me that it works because X errors will propogate to the left part of ancilla and Z errors will propogate to the right part. However, I'm confused how the measurement works. For example in the left part, even there is no error (Or applying a stabilizer), measuring logical + at Z basis will cause uncertain results, and X error just make thing more complex. Can somebody explain how the measure work and why it can get the syndrome?
"
"['quantum-gate', 'circuit-construction']"," Title: How can you construct the different two-qubit Bell states?Body: How can you construct the different Bell states? For example $$\frac{|01⟩-|10⟩}{\sqrt{2}}$$
"
"['qiskit', 'measurement', 'grovers-algorithm']"," Title: Result of Grover on Qiskit simulatorBody: I have executed this circuit and I don't understand why the result is $|11\rangle$ ?
[q[0], q[1]] : solution register
[q[2]] : ancilla register (clause value)
[q[3]] : boolean value of Oracle function
Thanks you
"
"['ibm-q-experience', 'measurement', 'noise', 'decoherence']"," Title: Readout error in IBM quantum experience processorBody: Is there a section on the IBM website that shows information about the readout error for the devices of quantum experience? I have only seen the errors for single-qubit (U2) and CNOT gates but nothing involving measurements.
If not, is there any suggestion about how to measure it? The only thing that comes to my mind is to run the ground state because any circuit would mix readout with gate errors. But I think that the resulting noise might as well be due to other factors like imperfect preparation of the ground state.
"
"['quantum-gate', 'universal-gates']"," Title: How to construct Deutsch's gate or $\pi/8$ rotations using Toffoli+Hadamard?Body: It is known that Toffoli and Hadamard are Quantum Universal.
My question is - how to construct (an approximation of) the Deutsch's gate or the $\pi/8$ rotation using Toffoli + Hadamard?
I've seen several implementations of the Toffoli gate using Hadamard, CNOT and $\pi/8$ gates, but none for the other direction.
"
"['density-matrix', 'tensor-product']"," Title: Composition of tensor productBody: I don't have much confidence with density matrices, and I would like to be sure about a property of composition of tensor products operations. Specifically,
$$ \sum_i \sum_j |a_i\rangle|b_i\rangle\langle c_j|\langle d_j| =$$
$$ =\sum_i \sum_j |a_i\rangle \langle c_j| |b_i\rangle \langle d_j| $$
and the reason for this is the following property of the tensor product:
$$(x \otimes y)^T(x \otimes y) = (x^Tx \otimes y^Ty) $$
Am I right?
"
['ibm-q-experience']," Title: Transpiling error in IBM Quantum ExperienceBody: I ran the following code
which adds two 2-digit numbers on different back-ends and the simulator gives the expect result while all real QC's have a problem with the transpiling:
In fact, Melbourne was able to return some results but they were quite far from what expected and what the simulator returned. Has anybody encountered a similar problem? I paste below how the result looks when it fails:
"
"['physical-realization', 'complexity-theory']"," Title: On the complexity of an oracle for a classical functionBody: Let us assume that we have a classical function $f:\{0\,;\,1\}^n\to\{0\,;\,1\}^m$ which is efficiently computable. Then, its oracle is defined with $\mathbf{U}_f\,|x\rangle\,|y\rangle=|x\rangle\,|y\oplus f(x)\rangle$. I quite often read that if $f$ is efficiently computable, then so is $\mathbf{U}_f$. Why is it the case? Where is the computational cost of evaluating $f$ taken into account?
Since $\mathbf{U}_f$ is a permutation matrix, one can implement it with at most $2^{n+m}$ SWAP gates, but this is not very efficient. What am I missing?
Another related question is: given a permutation matrix, how can one find the appropriate CNOT/SWAP gates succession to implement it? Even if an efficient solution exists, how does one find it?
"
"['grovers-algorithm', 'speedup']"," Title: How can we apply Quantum Algorithms (Grover's to be specific) to edge coloring problem?Body: I am a novice in the Quantum Computing field. Recently we were discussing NP-complete problems in Algorithms class and a question arose in my mind which I have stated above, can anyone help me with this?
"
"['entanglement', 'foundations']"," Title: Will two entangled qubits be affected by gravity?Body: Will two entangled qubits be affected by gravity? I mean if one is near blackhole's horizon and other is on earth will the effect of relativity be experienced on the measurement? will there be any delay or error in measurement?
"
"['quantum-gate', 'tensor-product']"," Title: How do I compute the output of quantum circuit involving multiple gates?Body: I'm new in quantum computing, I have this question.
Qubits $x$ and $y$ are in $\mathbb{C}^2$ (column vector) and $A, B$ are unitary matrices ($A$ 8x8 and $B$ 4x4 matrix).
If I'm not wrong the input of $A$ is $x_1 \otimes x_2 \otimes x_3$ which is in $\mathbb{C}^8$ (column vector). Now given the output $z=A(x_1 \otimes x_2 \otimes x_3)$ how can I extract $y_3$ from $z$ to calculate $y_3 \otimes y_4$ ($x_4 = y_4$) which is the input of $B$?
"
['deutsch-jozsa-algorithm']," Title: How are the two states factored out of Deutsch's circuit?Body: After placing the Hadamards on the 2 qubits (both initialized in the $|1\rangle$ state) in the circuit, we are given:
$ |\psi_{b}\rangle = \frac{1}{2}(|0_{1}0_{2}\rangle -|1_{1}0_{2}\rangle -|0_{1}1_{2}\rangle +|1_{1}1_{2}\rangle) $
the above state is run through the f-cnot, and we are given a superposition:
$ |\psi_{c}\rangle = \frac{1}{2}(|0_{1}f(0_{2})\rangle -|1_{1}f(1_{2})\rangle -|0_{1}\tilde f(0_{2})\rangle +|1_{1}\tilde f(1_{2})\rangle ) $.
In order to compute whether the function is balanced or not, we can use some factoring:
If $ f(0)=f(1) $ we can factor out:
$ |\psi_{c}\rangle = \frac{1}{2}(|0_{1}\rangle -|1_{1}\rangle)(|f (0_{2})\rangle - |\tilde f (0_{2})\rangle)
$
If $ f(0)=\tilde f(1) $ we can factor out:
$ |\psi_{c}\rangle = \frac{1}{2}(|0_{1}\rangle +|1_{1}\rangle)(|f (0_{2})\rangle - |\tilde f (0_{2})\rangle)
$
Question:
How are these two factored-out states for $ f_1 $ and $ \tilde f_1 $, actually pulled out of the original superposition? Like, how are they actually factored?
"
"['measurement', 'simulation', 'cryptography', 'bb84', 'qkd']"," Title: Why Alice and Bob don't get the same result when they measure in the same basis?Body: I'm simulating the BB84 protocol using simulaqron. My
problem is that when Alice and Bob measure in the same basis, they
don't get the same result.
How can I fix this error?
.
BB84.py
from cqc.pythonLib import CQCConnection, qubit
import numpy as np
""""""
BB84 protocol
""""""
def prepare_qubits(Sender,receiver,key_bit):
q=qubit(Sender)
S_basis="""" # The sender basis
if key_bit == 1: #prepare qubits in |1> state
q.X() #apply X gate
else:
pass
# convert to Hadamard basis randomly
if 0.5 < np.random.random():
q.H() #apply hadamard gate
S_basis='H'
else:
S_basis='S'
pass
Sender.sendQubit(q,receiver)
return [q,S_basis]
def receive_qubits(Receiver):
#R_basis=[] #Receiver basis
# Wait to receive a qubit
q=Receiver.recvQubit()
C="""" # for basis choice
# If we chose the Hadamard basis
# to measure in, apply H
if 0.5 < np.random.random():
q.H()
C='H'
else:
C='S' #S: Standard Basis
pass
# Measure the qubit in the standard
# basis and store the outcome in m
m=q.measure ()
return [m,C]
Alice.py
from cqc.pythonLib import CQCConnection, qubit
import numpy as np
from BB84 import *
from CAC.classical_comm import *
# Establish a connection to SimulaQron
with CQCConnection(""Alice"") as Alice:
print(""***********************BB84 protocol***************************"")
#Alice.closeClassicalServer()
m=[]
B=[]
S=''
n=2 #number of qubits
Alice.sendClassical(""Bob"",n)#send the number of qubits
key= np.random.randint(0, high=2**n)#to replace with QRNG() function
k=np.binary_repr(key,n) #binary representation
print(""Alice's random key"",key)
print(""Alice's binary key:"",k)
print(""*********************************"")
for x in k:
m.append(str(x))
s=prepare_qubits(Alice,""Bob"",x) #send BB84 states
#receive a confirmation msg from Bob via the CAC
B.append(s[1])
S+=str(s[1])
""""""
#send Alice's basis to Bob
ff=S.encode()#conversion to byte
Alice.sendClassical(""Bob"",ff)
""""""
print('a basis',B)
#received Bob's Basis
x=Alice.recvClassical()
B_basis=list(x.decode())
print(""Bob basis received"",B_basis)
#print(B_basis.split(""""))
aa=sifted_key(B,B_basis,m)
print(""sifted key"",aa)
listToStr =""[""+','.join(map(str, aa[1]))+""]""
ff=listToStr.encode()
Alice.sendClassical(""Bob"",ff)
#Close connection to SimulaQron
Alice.close()
Bob.py
from cqc.pythonLib import CQCConnection, qubit
import numpy as np
from BB84 import *
from CAC.classical_comm import *
import ast
# Establish connection to SimulaQron
with CQCConnection(""Bob"") as Bob:
#Bob.closeClassicalServer() #if I want to use my socket functions
n=Bob.recvClassical()[0] #number of qubits given by Bob (""Eve"")
key=[]
B=''
for i in range(0,n):
c=receive_qubits(Bob)
#send confirmation to Alice via CAC
#print(""out meas."",c[0])
key.append(c[0])
B+=str(c[1]) #Bob basis
print(""Bob off"",B)
#send Basis to Alice
print(""bob's initial key :"",key)
ff=B.encode()#conversion to byte
Bob.sendClassical(""Alice"",ff)
#receive Alice's basis
a=Bob.recvClassical()
x=a.decode()
res = ast.literal_eval(x)
print(""Alice's Basis received"",res)
key_s=[]
for c in res:
key_s.append(key[c])
print(""final sifted key"",key_s)
Bob.close()
"
"['quantum-gate', 'algorithm', 'quantum-state', 'circuit-construction']"," Title: How to switch bit in the quantum state?Body: I want to transform binary representation from one to other. Here, I have 2 registers one act as control register and another is target register with the same number of qubits $n$. Consider $n = 3$ qubits state and $N = 2^{n}$,
\begin{eqnarray}
|\psi_{0}\rangle &=& |i\rangle \otimes \sum_{i = 0}^{N} a_{i}|i\rangle \\
|\psi_{0}\rangle &=& |i\rangle \otimes (a_{0}|000\rangle + a_{1}|001\rangle + a_{2}|010\rangle + a_{3}|011\rangle + a_{4}|100\rangle + a_{5}|101\rangle + a_{6}|110\rangle + a_{7}|111\rangle)
\end{eqnarray}
I want a quantum circuit or algorithm ($T_{i}|\psi_{0}\rangle = |\psi_{1}\rangle$) to transform, for example, the target state,
\begin{equation}
|\psi_{1}\rangle = |101\rangle \otimes (a_{0}|000\rangle + a_{3}|001\rangle + a_{2}|010\rangle + a_{1}|011\rangle + a_{5}|100\rangle + a_{4}|101\rangle + a_{7}|110\rangle + a_{}|111\rangle).
\end{equation}
Please note that the amplitude $a_{i}$ still the same as before the operation.
How to realize a quantum circuit like that, I know some special case where the operator will shift a bit to the right or left. However, I want a general form of operator $T$.
"
"['quantum-gate', 'quantum-advantage', 'google-sycamore']"," Title: In Google's Quantum Supremacy experiment, what if we use $\theta=45°$ for two-qubit $f_{sim}$ gates?Body: In Google's Quantum Supremacy experiment, they use $f_{sim}$(fermionic-simulation) gates with $\theta=90°$ and $\phi=30°$ as their two-qubit gates. What if we use $\theta=45°$ for the two-qubit $f_{sim}$ gates? What will it do to the experiment's complexity?
"
"['hamiltonian-simulation', 'quirk']"," Title: Problem with commutation of $e^{-iH_1t}$ and $e^{-iH_2t}$, where $H_1$ commutes with $H_2$Body: I'm given with a Hamiltonian, $H=H_1+H_2$, where $H_1=\sigma_x\otimes\sigma_z$ and $H_2=\sigma_y\otimes\sigma_y$, and want to built a circuit which will implement $e^{-iHt},t=\pi/6$. We see that as $\sigma_x\otimes\sigma_z$ and $\sigma_y\otimes\sigma_y$ commutes, so $e^{-iHt}=e^{-i(\sigma_x\otimes\sigma_z)t}e^{-i(\sigma_y\otimes\sigma_y)t}.$
By referring to answer given here,the first circuit is of $e^{-i(\sigma_x\otimes\sigma_z)t}$ and the second implements $e^{-i(\sigma_y\otimes\sigma_y)t}$, where $Y=\frac {1}{\sqrt{2}} \begin{pmatrix}
1&1\\
i&-i\\
\end{pmatrix} $
Note that the bottom qubit corresponds to the first in the tensor product.
Question
As $H_1$ and $H_2$ commutes, $e^{-iH_1t}$ and $e^{-iH_2t}$ should also commute. But here, in quirk. Though probabilities are same after both cases, the final state isn't, which indicates $e^{-i(\sigma_x\otimes\sigma_z)t}$ and $e^{-i(\sigma_y\otimes\sigma_y)t}$ are not commuting. What's my mistake here?
"
"['tensor-product', 'notation', 'qaoa']"," Title: What does the notation $U(B,\beta) = \prod_{j =1}^n e^{-i \beta \sigma_j^x} $ mean in the context of QAOA?Body: In the article Quantum Observables for continuous control of the Quantum Approximate Optimization Algorithm via Reinforcement Learning, the following notation is used to describe an Unitary operation over $n$ qubits :
$$U(B,\beta) = \prod_{j =1}^n e^{-i \beta \sigma_j^x} $$
with $\beta$ a real parameter and $\sigma^x_j$ the pauli matrix $\sigma^x$ applied to the $j^{th}$ qubit. I first thought that this should be read as a matrix product, but since it's applied over $n$ qubits, I believe it should be a tensor product, otherwise there's a dimensionality issue.
I wonder if using the classical matrix product $\prod_{j =1}^n$ notation instead of the $\otimes_{j =1}^n$ notation is conventionnal in Quantum computing litterature ? If it is, I would also be interested with some explanation on why it is conventionnal, as I find it confusing.
"
"['algorithm', 'complexity-theory', 'nielsen-and-chuang']"," Title: Not sure what do Nielsen and Chuang mean by number of operationsBody: I am reading Nielsen and Chuang's ""Quantum Computation and Quantum Information"". One important concept about algorithms is how the number of operations scales with the length of the input. I realized I might not be getting what they actually mean by this in Exercise 5.17:
Part (1) is OK. In part (2) I think there is a typo. According to the answer to this question, it should read ""$y=\log_2 N$"" rather than just ""$\log_2 N$"". Then, what I understand the algorithm is doing in that step is computing $x=\log_2N/b$ for each $b \leq L$. These are $O(L)$ operations rather than $O(L^2)$ as it claims. Where are the other $O(L)$ operations?
I have thought perhaps these numbers don't agree because you have to take into account the number of operations required for elementary mathematical operations (see e.g. here), and computing $2^x$ takes more than one operation. But if I take into account the complexity of $2^x$, then I should also take into account the complexity of division in $x = \log_2 N/b$. Moreover, I don't think they are referring to this, because I have read all the chapters until here and I don't remember that they have explained this.
"
"['quantum-state', 'density-matrix']"," Title: Need some help with Purity calculationBody: maybe you could help me a little about my calculation of a quantum pure state with purification.
I have this density matrix:
\begin{equation}
\rho=
\begin{pmatrix}
0.4489 & 0.2304 & 0.2162 & 0\\
0.2304 & 0.2518 & 0.2399 & 0\\
0.2162 & 0.2399 & 0.2993 & 0\\
0 & 0 & 0 & 0
\end{pmatrix}
\end{equation}
Then I calculated the Eigenvectors and Eigenvalues of this matrix:
Eigenvalues:
\begin{equation}
e=[0.79987375 \space\space 0.16872495 \space\space 0.03140131\space\space 0 ]
\end{equation}
Eigenvectors:
\begin{equation}
eigenvectors=
\begin{pmatrix}
0.66857314 & 0.73407551 & 0.11892473 & 0\\
0.51561267 & -0.34235582 & -0.78545278 & 0\\
0.53586708 & -0.58645173 & 0.60738854 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
\end{equation}
After that I used the formula for purification with the computational bases:
$|\Psi\rangle = \sum \sqrt{p_i} |\phi_i\rangle \otimes \lvert\psi_i\rangle$.
computational bases:
\begin{equation}
computational bases=
\begin{pmatrix}
1 & 0 & 0 & 0\\
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
\end{equation}
If I put this all in the equation I got this big $\Psi$
\begin{equation}
\Psi=
\begin{pmatrix}
0.59794281 \\
0.21179379 \\
0.09495786 \\
0 \\
0.65652529 \\
-0.14062656 \\
-0.10392167\\
0\\
0.10636112\\
-0.3226337\\
0.10763176\\
0\\
0\\
0\\
0\\
0
\end{pmatrix}
\end{equation}
Then I checked if the Purifiaction is correct, so I calculated the density matrix of $\Psi$ and then I traced out B and thought the result is the density matrix $\rho$, but this is my result:
\begin{equation}
\rho=
\begin{pmatrix}
0.41140921 & 0.35291256 & 0.00548653 & 0\\
0.35291256 & 0.461601 & 0.10401436 & 0\\
0.00548653 & 0.10401436 & 0.12698979 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}
\end{equation}
But this isn´t equal to the density matrix $\rho$.
For the calculation of the partial trace i used the qiskit lib and Python:
import qiskit.quantum_info
qubits=[0,1]
rho= qiskit.quantum_info.partial_trace(psi_density,qubits)
My question is why I didn´t get the origin rho matrix back? Did I make a mistake with the Purity calculation?
I would be glad to get an explanation for this.
edit: For Purifiaction is used this piece of code:
w, v = LA.eig(rho)
null_base = np.array([1,0,0,0])
one_base = np.array([0,1,0,0])
two_base = np.array([0,0,1,0])
three_base = np.array([0,0,0,1])
v_1=v[0]
v_2=v[1]
v_3=v[2]
v_4=v[3]
v_1_trans = v_1.reshape(-1,1)
v_2_trans = v_2.reshape(-1,1)
v_3_trans = v_3.reshape(-1,1)
v_4_trans = v_4.reshape(-1,1)
null_base_trans = null_base.reshape(-1,1)
one_base_trans = one_base.reshape(-1,1)
two_base_trans = two_base.reshape(-1,1)
three_base_trans = three_base.reshape(-1,1)
sum_1 = np.tensordot(v_1_trans, null_base_trans, 0) * np.sqrt(w[0])
sum_2 = np.tensordot(v_2_trans, one_base_trans, 0) * np.sqrt(w[1])
sum_3 = np.tensordot(v_3_trans, two_base_trans, 0) * np.sqrt(w[2])
sum_4 = np.tensordot(v_4_trans, three_base_trans, 0) * np.sqrt(w[3])
psi=sum_1+sum_2+sum_3+sum_4
psi=psi.reshape(16,1)
so w are the eigenvalues and v are the eigenvectors. The trans variables just only make column vectors for tensordot.
"
"['circuit-construction', 'grovers-algorithm']"," Title: Quantum circuit CCX optimization for GroverBody: I am working on a circuit for a Grover problem and during that I am trying to minimize the used QuBits.
The problem is shown in the attached image. In this case the circuit is more or less efficient but with a growing number of input bits (the x register) the ccx grows more complex (cccx, ccccx, ...) and inefficient but more importantly more qubits in y register are needed (one more for each comparison).
My primary goal is to reduce the used y-QuBits. Can someone think of such a circuit or is it already optimal (I really dont think so).
"
"['physical-realization', 'topological-quantum-computing', 'anyons']"," Title: Topological quantum computer and two dimensional materialsBody: Recently I read thread on topological quantum computers. If I understood correctly, gates in such computers are based on ""effects"" in two dimensional spaces. Since our space is three dimensional, such topology has to be ""simulated"".
My questions are:
- Can 2D materials (like graphene) be used for construction of topological quantum computer (i.e. to produce anyons used for computing)?
- Could you please provide with link to articles on physical implementation of topological quantum computer?
Cross-posted on Physics SE
"
"['physical-realization', 'experiment']"," Title: Where does the energy go in a Power Rabi experiment with superconducting circuits?Body: When performing a Power-Rabi experiment, e.g in superconducting circuits, we are playing a pulse to a qubit and then reading out its state by playing another pulse to a dispersively-coupled readout resonator. We are repeating this process many times for different amplitudes of the pulse to the qubit, and we can see oscillations in the averaged state of the qubit as a function of the amplitude. This is the Rabi oscillation phenomenon which is very well understood, and has a very simple mathematical model. However, it is rather weird that even though we are increasing the energy flow to the qubit, it is starting to lose energy. Since I expect energy conservation, my question is where this energy is going?
"
"['simulation', 'rigetti', 'pyquil']"," Title: How to get the $T1$ specs for the Rigetti's quantum processor (Aspen 7)Body: I am trying to find the $T1$ coherence time for different qubits of Rigetti's quantum processor (Aspen 7) using Python. I tried using Specs() but encountered an error.
"
"['error-correction', 'qutip']"," Title: Is there quantum error correction code package for pythonBody: I'm working on the development of a new quantum error correction protocol that tries to maximize the coherence of the qubit. Is there a package for python, similar to qutip, that could help me in this process?
"
"['qiskit', 'programming', 'measurement']"," Title: Qiskit - Z expectation value from counts?Body: For a given state $|\psi\rangle$, how would I work out $\langle\psi|Z|\psi\rangle$ ?
If I run a quantum circuit and get the counts dictionary on qiskit, I get observables in the Z basis.
For n=1 qubits, the basis states returned are $|0\rangle$ & $|1\rangle$ with the counts for each state. I would assign +1 to the counts for $|0\rangle$ and -1 to the counts for $|1\rangle$ and work out the Z expectation value.
For n=2 qubits, $|00\rangle$ & $|11\rangle$ have eigenvalues +1 and $|01\rangle$ &$|10\rangle$ have eigenvalues -1. The Z expectation value is thus [counts(00) + counts(11) - counts(01) - counts (10) ]/ shots where counts(00) is the counts returned for the $|00\rangle$ state.
This is extended to n = 3,4,5.. qubits.
My question is how do I calculate this automatically in qiskit?
"
"['algorithm', 'programming', 'grovers-algorithm']"," Title: Finding minimum with GroverBody: I am a beginner in quantum computing. I have already computed the sat quantum solver with Grover search and then, I would like to compute the ""minimum search"" of Dür and Hoyer. My question is: Is it possible to encode a list with two registers of qubits?
If it is possible, I would like to see a general methods with explanations of how to encode a list in a quantum circuit. :)
Ref: A Quantum Algorithm for Finding the Minimum
"
"['qiskit', 'bloch-sphere']"," Title: $\lambda$ parameter for U3 gate in qiskit Bloch sphere visualisationBody: It is easy to see how $\theta$ (rotation from the positive z-axis) and $\varphi$ (rotation from the positive z-axis) affect the initial state of the qubit when looking at the Bloch sphere but I have been playing around with different $\lambda$ values and can't see a clear transformation. Geometrically, how does lambda transform the state?
"
"['circuit-construction', 'complexity-theory', 'quantum-fourier-transform', 'phase-estimation']"," Title: How to implement exponentiation of a gate without breaking complexity?Body: In the application of QFT for quantum phase estimation (QPE) of a unitary $\mathbf{U}$, one has to perform successive controlled operations using powers of $\mathbf{U}$. In order not to break the complexity, each of the controlled $\mathbf{U}^{2^i}$ gates must have the same complexity when applying them as $\mathbf{U}$.
Hence, if I want to apply a QPE on a gate whose circuit is known, how should I proceed? If I just concatente the circuit of $\mathbf{U}$ to itself $2^i$ times, applying $\mathbf{U}^{2^i}$ is $2^i$ times as long as applying $\mathbf{U}$, which breaks the complexity.
I've seen papers and posts about modular exponentiation, but I'm not sure this would work in my case, since I do not work modulo some whole number.
I understand that fundamentally, what I want to do is to implement a unitary which, given a state $|x\rangle\,|y\rangle$ returns the state $|x\rangle\,\mathbf{U}^x|y\rangle$, but I don't know how should I perform this.
"
"['quantum-gate', 'qiskit']"," Title: How to perform operations like sin over Qiskit parametersBody: I want to create a parameter dependent gate in qiskit and I need to compute some complex operations as sympy.atan2 or sympy.sin over the parameters but I don't know how
I've tried
from qiskit import *
from qiskit.circuit import Parameter
import sympy as sy
x=Parameter('x')
theta=Parameter('θ')
phase=sy.atan2(sy.N(x)*sy.sin(theta),sy.cos(theta))
circuit = QuantumCircuit(3,3)
circuit.cu1(phase,0,1)
but I obtain
CircuitError: 'invalid param type atan2 in instruction cu1'
"
"['quantum-state', 'bloch-sphere', 'quirk']"," Title: Find local state and compute Bloch coordinates, like QuirkBody: In a multi-qubit system I can find the amplitudes of a state and compute probabilities, $\theta$, and $\varphi$. This falls out from simulation with simple numpy arrays. For example, after application of a variety of states, I get the amplitudes for all multi-qubit state $|\psi\rangle$, eg., $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$ as 4x1 complex numpy array, representing the tensor product of my 2 qubits.
These amplitudes and phases corresponds to this display in Quirk:
However, Quirk also shows the ""local state"" - per qubit - as a bloch wireframe.
How do I compute the Bloch coordinates for this local state, eg., out of my state vector? I believe I can get $\theta$ as the $arccos$ of the measurement probability for $|0\rangle$, which I compute via projection of $|0\rangle \langle 0|$ and $|1\rangle \langle 1|$ onto the density operator of the state? But how do I get the phase?
Thanks for any pointers!
"
"['quantum-gate', 'quantum-state', 'trace-distance']"," Title: It two unitaries are delta apart in trace norm, then what is the trace norm of outputs states when the same input state is applied to two unitaries?Body: Suppose we are given two unitary matrices $U$ and $V$, with the following guarantee,
$$||U - V||_1 \geqslant \delta$$
for some $\delta \geqslant 0$.
We apply an input density state $\rho$ individually to both $U$ and $V$, resulting in the output state $U\rho U^{\dagger}$ and $V\rho V^{\dagger}$ respectively. Then can we say anything about the trace norm of the output states, i.e,
$$||U\rho U^{\dagger} - V\rho V^{\dagger}||_1 \geqslant \hspace{1mm} ?$$
"
['hhl-algorithm']," Title: Problem with controlled rotation in HHLBody: In HHL algorithm, for subroutine involving controlled rotation, after applying $R_y(\theta)$, where $\theta=2\sin^{-1}\left(\frac{C}{\lambda}\right)$ to the ancilla, the state changes to $\sqrt{1-\frac{C^2}{\lambda^2}}|0\rangle+\frac{C}{\lambda}|1\rangle.$
Question
If $\lambda=1$, then by $\sqrt{1-\frac{C^2}{\lambda^2}}|0\rangle+\frac{C}{\lambda}|1\rangle$ and choosing $C=1$, we get $\theta=\pi$. For $\lambda=2$, $\theta=\frac{\pi}{3}.$ So in general, for each $\lambda$, correspondingly there's a different $\theta$. Since we don't know eigenvalues a priori, how do we account $\theta $s for superpositon of eigenvalues?
With respect to the circuit here on page 5, I don't understand how the controlled rotation part works. Will this circuit work when I choose a hermitian matrix $A_{4\times 4}$ such that, one of it's eigenvalues, $\lambda_j=10\neq 2^i,i \in \mathbb{Z}$ ?
"
"['quantum-gate', 'matrix-representation']"," Title: Trying to use matrices for Hadamard and Controlled Not gatesBody: I have the following simple quantum circuit:
This outputs are 00 and 11 for the two qubits. Using matrices, I have applied the H gate to the first qubit (ket 0):
$\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\ 1&-1\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\end{pmatrix}$
Is this right? Moreover, I don't understand how to apply the Controlled Not to to resulting matrix. I assume it's applied to a product basis state of the resulting:
$\begin{pmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\end{pmatrix}$ and $\begin{pmatrix}0\\1\end{pmatrix}$
I would be grateful for any help on continuing this, and if anyone could point out if I am wrong with my previous calculations. I appreciate the help in advance.
"
"['machine-learning', 'qaoa']"," Title: What does the maximum of a Hamiltonian means (in a particular paper)?Body: In the paper Quantum Observables for continuous control of the Quantum Approximate Optimization Algorithm via Reinforcement Learning, an Hamiltonian is defined in order to solve the MAXCUT problem :
$$ C = \sum_{<i,j>} \frac{1}{2} (I -\sigma_i^z \sigma_j^z) = \sum_{<i,j>} C_{i,j} $$
with $\sigma_j^z$ the pauli matrix $\sigma^z$ applied to the $j^{th}$ qubit. The sum is taken over all adjacent edge in the original graph problem.
The paper indicates the following result :
$$ \lim_{p \rightarrow \infty} [\max_{\beta,\gamma} \langle \beta,\gamma |_p C | \beta,\gamma \rangle_p] = \max C $$.
consider $|\beta,\gamma \rangle_p$ some states produced by the QAOA algorithm and $p$ an integer, their value do not matter for my question.
The quantity $\max_{\beta,\gamma} \langle \beta,\gamma |_p C | \beta,\gamma \rangle_p$ is clearly scalar, whereas I can't make sense of the expression $\max C$.
My question is then, what does $\max C$ means in this context ?
I believe the answer is not given in this paper. I might have the answer from this documentation, where it is said that the Hamiltonian is constructed from the classical function,
$$C(z_1,...,z_n) = \sum_{<i,j>} \frac{1}{2} (1 -z_i z_j)$$
Where the sum is taken over all adjacent edges in the original graph problem, with $z_i = 1$ if $z_i \in S$ or $z_i = -1$ if $z_i \in \bar{S}$ (same for $z_j$) with $S$ and $\bar{S}$ the bipartition of the original graph.
I believe the authors of the first paper I linked were referring to this classical function and not to the Hamiltonian when speaking about $\max C$.
My second guess is that it might refers to some matrix norms but none is defined in the article.
What do you think ?
"
['cirq']," Title: Placement of quantum circuitsBody: I have a question concerning the placement of quantum circuits on Google devices. Consider the following code:
import cirq
q = [cirq.LineQubit(x) for x in range(5)]
circuit = cirq.Circuit(cirq.CNOT.on(q[0],q[3]), cirq.CNOT.on(q[1],q[4]))
line = cirq.google.line_on_device(cirq.google.Bristlecone, length=5)
circuit_opt = cirq.google.optimized_for_xmon(circuit=circuit, new_device=cirq.google.Bristlecone, qubit_map=lambda i: line[i.x])
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=1024)
This ad comparable codes yields the error
ValueError: Non-local interaction: cirq.CZ.on(cirq.GridQubit(0, 5), cirq.GridQubit(1, 7)).
Does Cirq provide a mechanism to automatically place (and route) a generic algorithm in the qubits 0..5 onto a concrete lattice structure?
Thanks in advance, Matthias
"
"['qiskit', 'programming', 'ibm-q-experience', 'noise']"," Title: Error parameters from Qiskit backendsBody: In order to build a custom noise model in Qiskit Aer, I requested the error parameters from different backends and got 3 (9) parameters for each single-qubit (two-qubit) gate as output. However, I could not find any documentation of what these numbers are actually specifying. Based on a previous stack-exchange question about Qiskit's basic_device_noise_model(), I would guess that the first parameter is giving the gate fidelity. Is this true? What are the other 2 (8) numbers specifying?
Here is an example for a single-qubit (id) and a two-qubit (cx) gate from the backend orense:
{'type': 'qerror',
'operations': ['id'],
'instructions': [[{'name': 'id', 'qubits': [0]}],
[{'name': 'z', 'qubits': [0]}],
[{'name': 'reset', 'qubits': [0]}]],
'probabilities': [0.9996936442814689,
5.460519336879117e-05,
0.0002517505251623531],
'gate_qubits': [[0]]},
{'type': 'qerror',
'operations': ['cx'],
'instructions': [[{'name': 'id', 'qubits': [1]}],
[{'name': 'z', 'qubits': [0]}],
[{'name': 'reset', 'qubits': [0]}],
[{'name': 'z', 'qubits': [1]}],
[{'name': 'z', 'qubits': [0]}, {'name': 'z', 'qubits': [1]}],
[{'name': 'reset', 'qubits': [0]}, {'name': 'z', 'qubits': [1]}],
[{'name': 'reset', 'qubits': [1]}],
[{'name': 'z', 'qubits': [0]}, {'name': 'reset', 'qubits': [1]}],
[{'name': 'reset', 'qubits': [0]}, {'name': 'reset', 'qubits': [1]}]],
'probabilities': [0.9893181752693058,
0.0004106923127677822,
0.001895703775229592,
0.002657456705309657,
1.1031810267579292e-06,
5.092144099539429e-06,
0.005698491726413379,
2.365595624250726e-06,
1.0919290223224507e-05],
'gate_qubits': [[0, 1]]},
"
"['quantum-gate', 'physical-realization', 'hadamard']"," Title: $H = e^{i\pi/4} \sqrt{iNOT}$?Body: In the paper Valley qubit in Gated MoS$_2$ monolayer quantum dot, a description of how a $NOT$ gate would be performed on a qubit in the described device is given.
The authors say that in the described implementation the operation performed is an $iNOT$ gate, and that the Hadamard operation can be implemented by performing half of the $iNOT$ Rabi transition. Particularly, the authors say that $H = e^{i\pi/4}\sqrt{iNOT}$, (actually they say $H = e^{i\pi/4}\sqrt{NOT}$, but I assume this is a typo).
Most generally, my question is: Does $H = e^{i\pi/4}\sqrt{iNOT}$? I cannot work it out.
My confusion may stem from my lack of understanding concerning why the implemented operation corresponds to $iNOT$ instead of simply $NOT$. My understanding is that $iNOT = i\sigma_x$. I'd appreciate any insight you have on this as well. Thank you.
"
"['algorithm', 'quantum-advantage', 'vqe']"," Title: Decomposing Hamiltonian into qubit model representationBody: One of the main applications of VQE is its application to find the approximation to the ground state energy (smallest eigenvalue of the Hamiltonian) for a particular molecule through an iterative method.
To be able to do this, we first need to write the Hamiltonian of the molecule in the second quantization form:
$$ H_{fer} = \sum h_{pq} a_p^\dagger a_q + \sum h_{pqrs} a_p^\dagger a_q^\dagger a_r a_s $$
then we map $H_{fer}$ to $H_{qubit}$ by one of the maps (JW, parity, BK) so it's easier to calculate the expectation value. That is
$$H_{fer} = \sum h_{pq} a_p^\dagger a_q + \sum h_{pqrs} a_p^\dagger a_q^\dagger a_r a_s \rightarrow H_{qubit} = \sum_{i\alpha} h^i_\alpha \sigma^i_\alpha + \sum_{ij\alpha \beta} h_{\alpha \beta}^{ij}\sigma_\alpha^i \sigma_\beta^j + ... $$
I understand that the set $\{\sigma^i\}^{\otimes n}$ forms a basis for an $n \times n$ Hermitian operator so it's reasonable to consider the map from $H_{fer}$ to $H_{qubit}$
However, the advantage of VQE is to be able to find the min energy in an efficient manner, and to be able to do that one needs to evaluate the expectation value of $H_{qubit}$, that is, $\langle H_{qubit} \rangle$. To be able to do this, you must make sure that $H_{qubit}$ has an efficient decomposition. That is, you don't want to use all $4^n$ terms to describe the Hamiltonian... since this will kill off all the efficiency you want to achieve.
So my question is, how do we know that we can always write the Hamiltonian for a particular system in the Pauli matrices basis using only polynomial terms? It turns out that this is true for electronic structure Hamiltonian for a molecule, but why?
Given some arbitrary physical system, how do I know whether I can write out a specific Hamiltonian for that system in a polynomial number of terms for the Pauli decomposition? Can you give me an example where this is not the case?
"
"['quantum-state', 'mathematics', 'bloch-sphere']"," Title: Represent a pure state in terms of 2 antipodal points on the Bloch sphereBody: I recently had an assignment where the question is based on the assumption that we can write any pure state qubit $|\phi \rangle$ as:
$$|\phi \rangle = \gamma |\psi\rangle + \delta |\psi^\perp \rangle$$
Where $|\psi\rangle$ and $|\psi^\perp \rangle$ are 2 antipodal points on the Bloch sphere:
$$ |\psi\rangle = \cos \frac{\theta}{2} |0\rangle +e^{i\varphi}\sin \frac{\theta}{2} |1\rangle$$
$$ |\psi^\perp\rangle = \cos \frac{\theta + \pi}{2} |0\rangle +e^{i\varphi}\sin \frac{\theta + \pi}{2} |1\rangle$$
I have a lingering question about how this actually works. So far I got:
$$|\phi\rangle= \gamma |\psi\rangle + \delta |\psi^{\perp}\rangle$$
$$= \gamma \left(\cos \frac{\theta}{2} |0\rangle +e^{i\varphi}\sin \frac{\theta}{2} |1\rangle \right) + \delta \left(\cos \frac{\theta + \pi}{2} |0\rangle +e^{i\varphi}\sin \frac{\theta + \pi}{2} |1\rangle \right)$$
$$ = \left(\gamma \cos \frac{\theta}{2} + \delta \cos \frac{\theta + \pi}{2}\right)|0\rangle
+ \left(\gamma e^{i\varphi}\sin \frac{\theta}{2} + \delta e^{i\varphi} \sin \frac{\theta + \pi}{2}\right)|1\rangle$$
$$\Rightarrow \alpha = \gamma \cos \frac{\theta}{2} + \delta \cos \frac{\theta + \pi}{2}$$
$$\Rightarrow \beta = \gamma e^{i\varphi}\sin \frac{\theta}{2} + \delta e^{i\varphi} \sin \frac{\theta + \pi}{2}$$
So $\alpha^2 + \beta^2 = 1$. I'm not sure if I can solve this equation. I wonder if it's solvable or is there a better way to go about understanding writing a pure state in $|\psi\rangle$ and $|\psi^\perp \rangle$ basis. I know that they are orthonormal so intuitively it should work.
"
"['algorithm', 'machine-learning']"," Title: QML: ""Quantum Data loader"" instead of QRAM?Body: In last year‘s conference ""Quantum For Business 2019"" Iordanis Kerenidis gave a nice talk about quantum machine learning.
At about time 27:10 he mentions a ""Quantum Data loader"" as an alternativ for QRAM. To me it sounds very concrete but I can not find any reference for it. Has somebody any details about it or did I get this wrong?
I have looked at arxiv papers 1911.01117 and 1812.03584, that he probably referred to in his talk. But these seem to use QRAM explicitely.
"
"['programming', 'circuit-construction', 'ibm-q-experience']"," Title: I made a simple circuit on qiskit,but I have some question on this resultBody:
I made a simple circuit that we can see. In my view, $|00000\rangle$ should appear in one result, but I didn't see it. why?
"
['qiskit']," Title: Qiskit not installing properly on pyCharm CEBody: I have installed qiskit through my terminal using pip3 install qiskit. But when I try to import all from it in my coding software, it returns a ModuleNotFound error:
When i try to install it in interpreter settings, this error message returns:
"
"['quantum-gate', 'entanglement']"," Title: Does Controlled-U gate entangle qubits?Body: I've read C-NOT gate entangles qubits, but is it only for C-NOT or any arbitrary CU gate (apart from the likes if CI) entangles qubits?
"
"['circuit-construction', 'teleportation', 'deferred-measurement']"," Title: Does principle of deferred measurement imply information can travel faster than light?Body: I have been reading the book by Michael A Nielsen and Isaac Chuang and came across the principle of deferred measurement. They showed using this principle how the circuit for quantum teleportation can be changed and measurements taken at last. But wouldn't this imply that we don't need to pass classical information that would make the receiver take the necessary action for transportation of the circuit as it has already happened no matter the outcome of measurement of the first two qubits? Wouldn't that imply that information can be transferred faster than light as there is no need for passing of classical information?
"
['circuit-construction']," Title: Matrix mod 2 multiplicationBody: There was a similar question asked here, but I feel like mine is even more basic.
What's the easiest way to implement a circuit $U$ corresponding to a matrix-vector multiplication modulo 2?
$$
|x_1x_2x_3\ldots x_n\rangle \mapsto |y_1y_2y_3\ldots y_n\rangle=U|x_1x_2x_3\ldots x_n\rangle
$$
where
$$
\begin{pmatrix}
y_1 \\ y_2 \\ y_3 \\ \ldots \\ y_n
\end{pmatrix}
= M
\begin{pmatrix}
x_1 \\ x_2 \\ x_3 \\ \ldots \\ x_n
\end{pmatrix} \mod 2 \ .
$$
Matrix $M$ entries are $0$ and $1$, the multiplication is done modulo 2.
UPDATE
The optimal solution in given here.
For a simple solution see my answer below.
"
"['circuit-construction', 'phase-estimation']"," Title: Why is the number of qubits linear in the inverse of epsilon in Quantum Phase Estimation?Body: On Wikipedia, one can read the following about Quantum Phase Estimation:
the algorithm estimates the value of $\theta$ with high probability within additive error $\varepsilon$, using $O(1/\varepsilon )$ controlled-$U$ operations.
Why do we need so much qubits? What we want is a $t$-qubits string such that it is equal to the $t$ first bits in the binary writing of $\theta$. We also want this binary writing to be at most at $\varepsilon$ from the true value. Hence, we have that:
$$\left|\sum_{n=t+1}^{+\infty}\theta_n\,2^{-n}\right|\leqslant\frac{\varepsilon}{2}$$
In the worst case, both terms are equal and all $\theta_n$ are $1$. Hence, we have:
$$\sum_{n=t+1}^{+\infty}2^{-n}=\frac\varepsilon2\iff2^{-t}=\frac\varepsilon2\implies t=1+\left\lceil\log_2\left(\frac1\varepsilon\right)\right\rceil$$.
Hence, we would have $O(\log(1/\varepsilon))$ controlled operations, since we have as much operations as qubits in the first register. Is it Wiki that is wrong, or my calculations?
Side question: is it some sort of convention to write $O(1/\varepsilon)$ rather than $O\left(\frac1\varepsilon\right)$? I only see the former written, while I find the latter less ambiguous.
"
"['circuit-construction', 'phase-estimation']"," Title: Repeating Quantum Phase Estimation algorithmBody: In the Quantum Recommendation Systems paper, the authors use the Quantum Phase Estimation algorithm in a way that is slightly different from what I've seen so far.
This is how it is described:
The analysis of phase estimation shows that the algorithm outputs a discrete valued estimate for each eigenvalue that is within additive error $\varepsilon$ with probability at least $0.8$, the probability is boosted to $1 − 1/\mathrm{poly}(n)$ by repeating $O(\log n)$ times and choosing the most frequent estimate.
Given that if we choose an additional number of qubits equal to $3$, the probability that the QPE outputs the correct state is $\frac{11}{12}\approx0.91$, I can use this number of qubits to implement the QPE. The problem is that I have to measure the state to store it in classical memory and thereafter re-building the most frequent one. Hence, I have to reset the output state to $|0\rangle^{\otimes t}$ to apply it once again. But from the no-deleting theorem, I cannot apply some unitary that will map this arbitrary state to $|0\rangle^{\otimes t}$. I can't either use the uncompute trick because of the measurement.
My idea was, since I know the state this register is currently in, I can add $X$ gates wherever a qubit is in the $|1\rangle$ state. But this means that I would have to add gates in the circuit ""at runtime"", that is:
- Performing QPE
- Measuring state
- Apply X gates accordingly
- Repeat
Is it realistic? If it is not, what other options do I have to perform such a computation?
"
"['ibm-q-experience', 'physical-realization', 'physical-qubit', 'd-wave']"," Title: How qubit phase is build in real hardware?Body: How qubit phase is build in real hardware?
On IBM Quantum, D-Wave, etc?
"
"['qiskit', 'ibm-q-experience']"," Title: Can't load account on IBM's qiskitBody: The command load account keeps giving the warning that it can't find a QConfig file. A search for the error message brings me to an answered question. However, this solution also doesn't work, producing the same error:
How can I solve this?
"
['textbook-and-exercises']," Title: In the context of Quantum theory of Information, Typical eigenvectors are permutations of basis vectors. Why?Body:
Why is this so? Can someone please give me detailed steps with an explanation?
"
"['quantum-state', 'entanglement', 'nielsen-and-chuang', 'teleportation', 'superdense-coding']"," Title: What does it look like to split an EPR pair?Body: I am reading Quantum Computation and Quantum Information by Michael A. Nielsen & Isaac L. Chuang, and I am confused about a concept presented in Section 1.3.7: Quantum Teleportation. The book writes ""While together, Alice and Bob generated an EPR pair, each taking one qubit of the EPR
pair when they separated."" For example, if the EPR pair in question is:
$|\beta_{00}\rangle=\frac{|00\rangle+|11\rangle}{\sqrt{2}}$
How can we write mathematically what Alice and Bob each have in their possession?
This idea comes up again when quantum teleportation is applied to superdense coding in Section 2.3, where again Alice and Bob ""share a pair of qubits in the entangled state $|\beta_{00}\rangle$.
Thanks in advance!
"
"['qiskit', 'resource-request', 'optimization', 'quantum-computing-for-finance']"," Title: What is Ising Hamiltonian ? What its role in Portfolio Diversification?Body: I am asking this question with reference to this https://github.com/Qiskit/qiskit-iqx-tutorials/blob/master/qiskit/advanced/aqua/finance/optimization/portfolio_diversification.ipynb
Happy to know new resources on portfolio optimization.
"
['qiskit']," Title: Qiskit unitary representation seems shiftedBody: I have implemented a simple CNOT gate using qiskit
I was expecting a the result the matrix as in the following image (extracted from wikipedia):
from qiskit import *
circuit = QuantumCircuit(2, 2)
circuit.cx(0, 1)
simulator = Aer.get_backend(""unitary_simulator"")
result = execute(circuit, backend=simulator).result()
unitary = result.get_unitary()
print(circuit.draw())
print(unitary)
The results in the print are:
If you pay attention, it seems the order of the qbits is reversed. I would like to know why this happens and if it's normal because it seems confusing at first glance.
To be really clear: The matrix in the first image and the second (the result) should be the same.
"
"['quantum-gate', 'no-cloning-theorem']"," Title: Shifting amplitude from one basis to another with a control qubitBody: I was reading a forum where people were talking about a proposed quantum algorithm that solves an NP-complete problem in polynomial time. The algorithm appears to have flaws (after all, none of you have probably heard about it). One comment went like this:
However, there is a rather simple proof that shows that the maximum amount of amplitude which you can transfer from one component of a quantum state to another using a control qubit is fundamentally limited by the Unitarian nature of quantum operations.
I don't understand this comment. The writer does cite the no-cloning theorem without any mention of it. Is that citation referring to this claim? If so, i've never heard the no-cloning theorem stated this way. In any case, I want to investigate the claim.
I've devised a scenario where a control qubit (4d qudit or 2 qubits, it doesn't matter) acts on an equal superposition of two qubits.
Where the gate $G$ is
$$
\def\a{\color{#FF33BB}{\frac{1}{2}}}
\def\b{\color{#1C3C93}{\frac{1}{6}}}
\def\c{\color{#37D717}{-\frac{5}{6}}}
$$
$ G = \begin{bmatrix}
\a &\a &\a &\a &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\a &\c &\b &\b &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\a &\b &\c &\b &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
\a &\b &\b &\c &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\
0 &0 &0 &0 &\c &\a &\b &\b &0 &0 &0 &0 &0 &0 &0 &0 \\
0 &0 &0 &0 &\a &\a &\a &\a &0 &0 &0 &0 &0 &0 &0 &0 \\
0 &0 &0 &0 &\b &\a &\c &\b &0 &0 &0 &0 &0 &0 &0 &0 \\
0 &0 &0 &0 &\b &\a &\b &\c &0 &0 &0 &0 &0 &0 &0 &0 \\
0 &0 &0 &0 &0 &0 &0 &0 &\c &\b &\a &\b &0 &0 &0 &0 \\
0 &0 &0 &0 &0 &0 &0 &0 &\b &\c &\a &\b &0 &0 &0 &0 \\
0 &0 &0 &0 &0 &0 &0 &0 &\a &\a &\a &\a &0 &0 &0 &0 \\
0 &0 &0 &0 &0 &0 &0 &0 &\b &\b &\a &\c &0 &0 &0 &0 \\
0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &\c &\b &\b &\a \\
0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &\b &\c &\b &\a \\
0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &\b &\b &\c &\a \\
0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 &\a &\a &\a &\a
\end{bmatrix}$
Now, assuming some other part of the circuit sets the control qudit to a given setting, $|setting\rangle = |0\rangle, |1\rangle, |2\rangle $ or $ |3\rangle$, applying the gate $G$ should have the following effect
$$
G \Bigg[ |setting\rangle_4 \otimes \frac{1}{2} \Big( |00\rangle + |01\rangle + |10\rangle + |11\rangle \Big) \Bigg] \rightarrow $$
$$
\begin{cases}
|setting\rangle \otimes |00\rangle, & |setting\rangle = 0 \\
|setting\rangle \otimes |01\rangle, & |setting\rangle = 1 \\
|setting\rangle \otimes |10\rangle, & |setting\rangle = 2 \\
|setting\rangle \otimes |11\rangle, & |setting\rangle = 3 \\
\end{cases}
$$
Essentially, $G$ would have the effect of sending all the amplitude to the state corresponding to $|setting\rangle$, which is precisely what the claim above places limits on due to the unitarity of quantum mechanical operators. It's easy to check that $G$ is unitary, so what is the maximum amount of amplitude transfer?
"
"['algorithm', 'circuit-construction', 'simulation']"," Title: Rotation of multi-body interaction in quantum circuitBody: In quantum circuit, how do you implement the rotation of multi-body interaction, such as $e^{-i\theta\sigma_z^1\sigma_z^2\sigma_z^3}$? I already know the case of less than two-body interaction, but I cannot find any textbook about more than three-body interaction.
"
['qiskit']," Title: How can I implement an arbitrary quantum channel in a quantum circuit for real experiments using IBM quantum experience?Body: Let's suppose I have a quantum channel given in the Kraus decomposition
$T(\rho) = \sum_{i} K_i \rho K_i^{\dagger} $
is there any way to put explicitly these $K_i$ in IBM quantum experience (QE) to run real experiments? Or is only possible to implement quantum channels in IBM QE by using combinations of unitary gates?
"
"['quantum-gate', 'circuit-construction']"," Title: Any two level flip in $n$ qubit systemBody: Let start with a multi controlled Toffoli gate. Looking at the matrix representation (in the binary base), you easily see
$$
\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\\
}
$$
that it only switches two states: $|111\rangle$ and $|110\rangle$. Conjugating with some $X$ gates on qubit 1 and 2 gives three more pair switches. Similar for the Fredkin gate which switches $|110\rangle$ and $|101\rangle$.
- How to generate any of the $8\cdot 7 $ possible two level switches for three qubits out of elementary gates?
- And how for general $n$?
For the three qubit case, I tried to e.g. construct a switch of $|000\rangle \leftrightarrow |111\rangle$ by mapping $|110\rangle \mapsto |000\rangle$. To achieve that I conjugated the Toffoli with the following sub circuit:
two CNOTs conjugated by some $X$.
It worked! I could even construct a switch of $|000\rangle \leftrightarrow |011\rangle$ by extending the above subcircuit (with another Toffoli) the maps $|111\rangle \mapsto |011\rangle$.
But I'm not sure whether this approach is valid or if I had just a lucky punch...
"
"['entanglement', 'correlations', 'entanglement-swapping']"," Title: Can pairwise entanglement be converted into tripartite correlations?Body: Suppose Alice shares $m$ pairs of maximally entangled states with Bob and $n$ pairs of maximally entangled states with Charlie. It is clear that by measuring their states, Alice can generate correlations with Bob and Alice can also generate correlations with Charlie. If Alice does entanglement swapping, she can also make Bob and Charlie share correlations.
Is there a way for Alice, Bob and Charlie to jointly share tripartite correlations without communication? The goal is for them to all have outcome ""0"" or all have outcome ""1"".
EDIT: Just want to emphasize that communication is forbidden. Otherwise, the problem is trivial since the classical outcome ""0"" or ""1"" can be copied and redistributed.
"
"['quantum-state', 'simulation', 'hamiltonian-simulation', 'vqe']"," Title: Ansatz state for finding the lowest eigenvalue of a $2^n\times 2^n$ real matrix using VQEBody: I would like to find the lowest eigenvalue of a $2^n\times 2^n$ real matrix $H$ using the VQE procedure. The measurement part is simple — I just expand $H$ in a sum of all possible $n$-qubit Pauli terms.
But I have not yet come up with a nice way of preparing an arbitrary $n$-qubit state with real amplitudes. What would be a good ansatz operator $U(\theta_1,\ldots\theta_{2^n-1})$ to do the job?
(If I were solving the problem in the second-quantized formalism using $2^n$ qubits, I would simply use the Unitary Coupled Cluster with $(2^n - 1)$ single amplitudes — does it have an analogue in such a 'binary' encoding??)
"
['qiskit']," Title: Confusion regarding subset_fitter() functionality from CompleteMeasurementFitter() in Qiskit.IgnisBody: I have been experimenting with the measurement mitigation module in Qiskit Ignis lately. I determined a calibration matrix $M$ with the help of CompleteMeasurementFitter(..., qubit_list=qubit_list) (calibration circuits and state labels given by complete_meas_cal(..., qubit_list=qubit_list)).
I have qubit_list = [0, 1, 2] and
state_labels = ['000', '001', '010', '011', '100', '101', '110', '111']
If I remember correctly, Qiskit follows the convention that the rightmost character in the state label refers to the first qubit in the list, and so forth.
I want to find the calibration matrix for the qubit subsystem [1, 2] with the subset_fitter() function. When I went through the source code, I struggled with the line where the reduced state labels are computed:
state_labels_reduced = []
for label in self.state_labels:
tmplabel = [label[l] for l in qubit_sublist_ind]
state_labels_reduced.append(''.join(tmplabel))
qubit_sublist_ind is a list of indices, which maps the reduced qubit list to the original one, in my case:
qubit_sublist_ind = [1, 2]
What confuses me now is that the quoted code snippet produces
state_labels_reduced = ['00', '01', '10', '11', '00', '01', '10', '11']
while I would expect
state_labels_reduced = ['00', '00', '01', '01', '10', '10', '11', '11']
since qubit 0 should refer to the rightmost character in each original state label. I would expect it to be simply stripped off. What is wrong here? Maybe I just confused myself. Thanks for your help!
"
['quantum-state']," Title: Taking tensor product of single qubit unitary operation matricesBody: I understand you can compose a 2 qubit operation as the tensor product of single qubit operations as: U = U1 x U2
Where U1 applies the the first bit and U2 applies to the second.
I can compose a 2x2 hadamard as follows for U1 in python and numpy:
had = hadamard(2, dtype=complex) / math.sqrt(2)
And an identity for U2:
id = np.identity(2)
And then take the tensorproduct, U:
had_id = np.tensordot(had, id, 0)
The resulting matrix is sort of correct:
[[[[ 0.70710678+0.j 0. +0.j]
[ 0. +0.j 0.70710678+0.j]]
[[ 0.70710678+0.j 0. +0.j]
[ 0. +0.j 0.70710678+0.j]]]
[[[ 0.70710678+0.j 0. +0.j]
[ 0. +0.j 0.70710678+0.j]]
[[-0.70710678+0.j -0. +0.j]
[-0. +0.j -0.70710678+0.j]]]]
But just isn't composed properly as a 4x4 matrix that can be applied as a 2-qubit operator. If I reshape, reshape(4,4) composes the first 2 inner arrays as the first row. This is not right because the first inner array should be in the first row, but the second inner array should go to the second row.
I wonder if anyone has any advise how to do this tensor product and get the correct 4x4 matrix for the 2-qubit operator. Otherwise, I suppose I could write a couple of loop to achieve the desired but it just doesn't seem the pythonic and simple way to do things.
"
"['algorithm', 'simulation', 'interpretations']"," Title: Does Planck's constant have any role in quantum computing?Body: I am new to the area of quantum computing, but as I study it I can't help wonder about the role of the Planck's constant. When one studies quantum mechanics one often finds statements that quantum mechanics reduces to classical physics if Planck's constant was taken to be zero. While this statement is a bit vague, there are clear aspects of quantum mechanics that would not hold without a finite non-zero value of the Planck's constant. Uncertainty in ""simultaneous"" measurements of conjugate observables is one, for example. Since in many quantum algorithms measurements are carried out at the end, it appears that the Planck's constant can be chosen to be anything, including, zero, throughout all the unitary transformations of the state up until the end. In that case, what exactly is uniquely quantum about all the unitary transformations of the state? After all, states of classical systems can be defined as elements of Hilbert space. Entanglement and superposition of such classical states would be the result of them being elements of Hilbert space. Bottom line is that I have hard time seeing the reason for ""quantumness"" of quantum computing without the need for setting some non-zero value of the Planck's constant. Thank you.
QC-Novice
"
"['vqe', 'qaoa']"," Title: QAOA Belongs into VQE or the other way around?Body: I have been reading a couple of papers in the arxiv and wanted to get a clarification regarding the relation between these two methods; is one a subset of the other?
"
"['quantum-state', 'circuit-construction', 'measurement']"," Title: What is $\vert 0 \rangle \otimes \vert + \rangle$?Body: A simple question that I cannot seem to figure-out why I cannot achieve the correct result. When I evaluate $$\vert 0 \rangle \otimes \vert + \rangle,$$
I end up with $$\begin{bmatrix}1\\0\end{bmatrix} \otimes \begin{bmatrix}\tfrac{1}{\sqrt{2}}\\\tfrac{1}{\sqrt{2}}\end{bmatrix} = \begin{bmatrix}1\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\\tfrac{1}{\sqrt{2}}\end{bmatrix}\\0\begin{bmatrix}\tfrac{1}{\sqrt{2}}\\\tfrac{1}{\sqrt{2}}\end{bmatrix}\end{bmatrix} = \begin{bmatrix}\tfrac{1}{\sqrt{2}}\\\tfrac{1}{\sqrt{2}}\\0\\0\end{bmatrix},$$
where $\vert 00 \rangle$, $\vert 01 \rangle$, $\vert 10 \rangle$, $\vert 11 \rangle$ have $50\%$, $50\%$, $0\%$, $0\%$ probability to be measured, respectively.
The trivial circuit (if you even consider it a circuit) on algassert suggests that the probabilities when measured are $\vert 00 \rangle = 50\%$, $\vert 01 \rangle = 0\%$, $\vert 10 \rangle = 50\%$, and $\vert 11 \rangle = 0\%$.
Why is my solution doesn't align with algassert?
"
"['qiskit', 'cirq', 'vqe', 'qaoa', 'pyquil']"," Title: VQE for Beginners : Using Tutorial and CirqBody: I have been following this tutorial: https://dkopczyk.quantee.co.uk/vqe/
I am using Cirq to try to teach myself VQE, replicate their results, and also try to understand more about ansatz for molecular simulations - and just for plain fun!
Here's the thing though, while I can match expectation values, the graph I find for their angle range does not match their result.
What am I doing wrong and\or not getting about minimization? My code:
def small_ansatz(parameter_y, qubit):
ygate = cirq.YPowGate(exponent=parameter_y)
#ygate = cirq.YPowGate(exponent=parameter_y)
#yield xgate(qubit)
yield ygate(qubit)
#wrapping into a circuit
def psi_circuit(parameter):
curr_q = cirq.LineQubit(0)
curr_c = cirq.Circuit()
curr_c.append(small_ansatz(parameter, curr_q))
curr_c.append(cirq.measure(curr_q, key='q0'))
return curr_c
def expectation_value_vqe(param, num_reps):
curr_psi = psi_circuit(param)
print()
#keep the measured keys and values
curr_simulator = cirq.Simulator()
curr_results = curr_simulator.run(curr_psi, repetitions=num_reps)
s_k, s_v= zip(*r.measurements.items())
#convert into booleans from sp|in values
curr_state_values = 1 - 2*np.array(s_v).astype(np.int32)
#get the expectation value (the average of the counts)
#I keep double the variables because I want to remind myself of the distinction between this task and the context
#of Farhi's paper.
curr_predicted_label_value = np.mean(curr_state_values)
return(curr_predicted_label_value)
And the plot I get for my expectation values for the ansatz:
And here is the tutorial:
Edit: I also implemented this on Qiskit and did obtain the plot to match Grove's.
"
"['qiskit', 'ibm-q-experience']"," Title: Design connectivity of qasm_simulatorBody: About the qasm_simulator, does it have on its 32 qubits a qubit connectivity design like as ibmq_16_melbourne or as another real device of IBM Experience and Qiskit?
"
"['mathematics', 'textbook-and-exercises']"," Title: Quantum Expectation Calculation with Orthogonal ProjectionBody:
Let $\mathcal{H} =\mathbb{C}^2, \mathcal{M}_1 = \mathbb{C}|0\rangle$ with $|\psi\rangle = \alpha |0\rangle + \beta|1\rangle$. Show $Pr(\mathcal{M_1}) = |\alpha|^2.$
We know that $\mathcal{M_1}$ is a subspace of the Hilbert space $\mathcal{H}$, and that $Pr(\mathcal{M_1}) = \langle \psi| Proj_\mathcal{M}|\psi\rangle.$
I see that when we first evaluate $Pr(\mathcal{M_1}) = \langle \psi| Proj_\mathcal{M}|\psi\rangle$ we obtain
$\langle \psi| Proj_\mathcal{M}|\psi\rangle = \langle\alpha|0\rangle + \beta|1\rangle|Proj_{\mathbb{C}^0}|\alpha|0\rangle + \beta|1\rangle\rangle = \langle \alpha|0\rangle | \alpha|0\rangle + \beta|1\rangle\rangle$.
At this point I don't see how we can show the desired result. Am I not applying the projection operator with the given notion properly?
"
"['qiskit', 'ibm-q-experience', 'optimization']"," Title: What are the differences between the different transpiler optimization levels in qiskitBody: I am currently running a simple algorithm using Qiskit and I am running it for various transpiler optimization levels (0-3). I wish to know what exactly occurs differently when for example I run the algorithm with optimization level 1 as compared to when the algorithm is run with optimization level 3. There is general information available on what a transpiler does, however, I cannot find what exactly happens differently in each optimization level.
"
"['programming', 'ibm-q-experience', 'qasm']"," Title: How can I use IF gate in IBM Q composer?Body: I just want to use the ""if"" gate in IBM QX circuit composer, but I don't know how.
"
"['information-theory', 'entropy', 'trace-distance', 'max-entropy']"," Title: Continuity bounds on $D_{\max}(\rho_{AB}\|\rho_A\otimes\rho_B)$Body: The max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\},$$
where $\rho\leq \sigma$ should be read as $\sigma - \rho$ is positive semidefinite. Consider the following quantity for a bipartite state $\rho_{AB}$ with reduced states $\rho_{A}$ and $\rho_{B}$.
$$I_{\max}(\rho_{AB}) = D_{\max}(\rho_{AB}||\rho_{A}\otimes\rho_{B})$$
I would like to know if this satisfies a continuity bound. That is, given $\rho_{AB}\approx_{\epsilon}\sigma_{AB}$ in some distance measure, can we bound $|I_{\max}(\rho_{AB}) - I_{\max}(\sigma_{AB})|$?
Motivation for question: Recall the quantum relative entropy $D(\rho||\sigma) = \text{Tr}(\rho\log\rho - \rho\log\sigma)$ with the convention that $0\log 0 = 0$. Let us define the mutual information as follows
$$I(\rho_{AB}) = D(\rho_{AB}||\rho_{A}\otimes\rho_{B}) = -S(\rho_{AB}) + S(\rho_A) + S(\rho_B),$$
where $S(\rho) = -\text{Tr}(\rho\log\rho)$ is the von Neumann entropy. In this case, we may use Fannes inequality to find a bound on $|I(\rho_{AB}) - I(\sigma_{AB})|$ in terms of $\|\rho_{AB} - \sigma_{AB}\|_1$. I'm wondering if the move from $D(.||.)$ to $D_{\max}(.||.)$ can be made while still having some Fannes type bound.
"
"['circuit-construction', 'ibm-q-experience', 'unitarity']"," Title: Could someone give an example of this pic?Body:
This is a picture from Wiki(https://en.wikipedia.org/wiki/Quantum_logic_gate). Can someone give me a simple example by using two qubits?
"
['projection-operator']," Title: Prove that $P_{M_1}P_{M_2}= P_{M_2}P_{M_1}$ implies $\text{Pr}(\text{span}[M_1, M_2]) = \text{Pr}(M_1)+\text{Pr}(M_2)−\text{Pr}(M_1\cap M_2)$Body: Prove that if
$\text{Proj}_{M_1}\text{Proj}_{M_2}= \text{Proj}_{M_2}\text{Proj}_{M_1}$ then
$\text{Pr}(\text{span}[M_1, M_2]) = \text{Pr}(M_1) + \text{Pr}(M_2) − \text{Pr}(M_1 \cap M_2)$.
In the case where the projection operators are non-commutative, I understand how to show that the above formula is actually false. However, I am unsure of how the commutativity of the projectors implies the above equation. I have included an image from the text to provide the definitions of $M_1$ and $M_2$.
"
"['quantum-gate', 'quantum-state', 'entanglement', 'matrix-representation']"," Title: Show how the Bell state arises from the circuit with Hadamard and CNOT, using matrix notationBody: I understand that starting with
,
we can get to $\vert \Phi^+ \rangle$. First, we start with $\vert Q_1 \rangle \otimes \vert Q_2 \rangle = \vert 0 \rangle \otimes \vert 0 \rangle$ and then applying $H$ on $Q_1$ which gives $\left( \frac{1}{\sqrt{2}}\vert 0 \rangle + \frac{1}{\sqrt{2}}\vert 1 \rangle \right)\otimes \vert 0 \rangle$. After $t_1$, we obtain $\frac{1}{\sqrt{2}}\vert 00 \rangle + \frac{1}{\sqrt{2}}\vert 10 \rangle$. Then, we apply the $CNOT$ gate to end up with $$\vert \Phi^+ \rangle = \frac{1}{\sqrt{2}}\vert 00 \rangle + \frac{1}{\sqrt{2}}\vert 11 \rangle.$$
I am wondering if there is a way to show all of this using the matrix representation of gates. I have tried the following way but I can't seem to get it properly:
We start with the state $\vert 00 \rangle = \scriptstyle\begin{bmatrix}1\\0\\0\\0\end{bmatrix}$. Between $t_0$ and $t_1$, I applied $$H \otimes I = \begin{bmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 & 0\\\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} & 0 & 0\\ 0 & 0 & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\0 & 0 & \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}\end{bmatrix},$$
since we are manipulating $Q_1$ and leaving $Q_2$ unchanged to obtain $\scriptstyle\begin{bmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\\0\\0\end{bmatrix}$. Lastly, we apply $CNOT$ which gives us $\scriptstyle\begin{bmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\\0\\0\end{bmatrix}.$
I am really looking for the matrices required to achieve the desired result.
"
"['qiskit', 'ibm-q-experience', 'error-correction']"," Title: Different results between qasm_simulator and quantum computer: how to normalize for only few statesBody: I recently started developing circuits with Qiskit. I made a 5 qubit circuit in which the fourth qubit at the end of execution must always have value 1:
When I do the simulation with qasm everything is ok.
When I start the circuit on ibmq_essex I get results in which the value of fourth qubit is 0.
I would like to eliminate from the results all the states that have the fourth qubit at 0 and normalize the circuit to eliminate the errors. How can I do?
I have already tried the following set of instructions with Ignis but as you can see from the graph I have not achieved a satisfactory result
from qiskit.ignis.mitigation.measurement import (complete_meas_cal, CompleteMeasFitter)
cal_circuits, state_labels = complete_meas_cal(qr = circuit.qregs[0], circlabel = 'measerrormitigationcal')
len(cal_circuits)
cal_job = execute(cal_circuits, backend = qcomp,shots = 1024, optimization_level = 3)
job_monitor(cal_job)
cal_results = cal_job.result()
plot_histogram(cal_results.get_counts(cal_circuits[5]))
meas_fitter = CompleteMeasFitter(cal_results, state_labels)
meas_filter = meas_fitter.filter
mitigated_results = meas_filter.apply(result)
device_counts = result.get_counts(circuit)
mitigated_counts = mitigated_results.get_counts(circuit)
plot_histogram([device_counts, mitigated_counts], legend=['noisy', 'mitigated'],figsize=(20,15))
"
"['quantum-gate', 'quantum-circuit']"," Title: What do we mean by “derive full operator of a quantum circuit” and to describe the mapping from input quantum registers to output quantum registers?Body: There is a quantum circuit with several Controlled NOT and Controlled swap gates, with two 2-qubit input registers X,Y and two 2-qubit output registers X',Y' where we have to find the mapping of the circuit and what operations it performs.
"
"['quantum-gate', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Quantum computers don't try all the possible solutions, so how does the QFT really work?Body: Scott Aaronson is fond of saying ""Quantum computers do not solve hard search problems instantaneously by simply trying all the possible solutions at once."" That is, they are not non-deterministic Turing Machines.
However, most descriptions I've read of quantum QFT say that the way it works is by using qubits that are both 0 and 1 at the same time. So is the QFT, which is the basis of Shor's factoring algorithm, an exception Aaronson's aphorism, or is there something else going on that's deeper?
Based on @MarkS's comment, I gather that the something deeper involves constructive and destructive interference and the Chinese Remainder Theorem.
"
['density-matrix']," Title: Is the set of density operators invariant under the induced action of the unitary group?Body: Show that the set of density operators is invariant under
the induced action of $U(H)$ on $End(H)$.
I know that a density operator must be positive and have a trace equal to one. But I don't know how to prove the invariance under the unitary group.
I assume I need to show that the set of density operators consists of the same elements even after applying $U(H)$ to $End(H)$, or am I misunderstanding the question entirely?
"
"['quantum-state', 'entanglement']"," Title: What is the definition of genuine entanglement?Body: I can't seem to find a definition for genuine entanglement but it is being used in an article I'm reading and the references inside but I'm unable to find the precise definition.
One thing I was able to get to the bottom of is ""So far, genuine multipartite entangled (GME) states in the form of Greenberger-HorneZeilinger (GHZ) states.."", but I do not know what about the GHZ states makes them ""genuinely entangled"".
Also the way it comes up is ""genuine multipartite entanglement"", which begs the questions (after what is genuine entanglement) why does it only come up in multipartite schemes ($n>2$)?
Cross-posted on physics.SE
"
"['cirq', 'universal-gates', 'qasm', 'qasm2circ']"," Title: Implementing U2-Gates on CirqBody: I am interested in using the QASM2Cirq methods to make this gate: u2(0, np.pi, q[0]).
How can I build that object using Cirq rather than QASM string value passed onto cirq.
"
"['entanglement', 'mathematics', 'ppt-criterion', 'werner-states']"," Title: What is a separable decomposition for the Werner state?Body: Consider the two-qubit Werner state, defined as
$$\rho_z = z |\Psi_-\rangle\!\langle \Psi_-| + \frac{1-z}{4}I,
\quad |\Psi_-\rangle\equiv\frac{1}{\sqrt2}(|00\rangle-|11\rangle),$$
for $z\ge0$.
Using the PPT criterion, one can see that this state is separable iff $0\le z\le 1/3$.
I couldn't, however, find a source discussing explicit separable decompositions (in the $z\le1/3$ regime, of course).
Is there a ""nice"" way to find such decompositions?
"
"['qiskit', 'programming', 'quantum-computing-for-finance']"," Title: Error using FixedIncomeExpectedValue sampleBody: I am working with Aqua sample (qiskit-aqua/test/finance/test_readme_sample.py ) that uses the FixedIncomeExpectedValue and the AmplitudeEstimation.
It is qiskit 0.18
This sample was previously working with qiskit 0.16.2 when Statevector_simulator was used for AmplitudeEstimation. Though I used to run into an error ERROR_RUNNING_JOB when running on ibmq_ hardware. I was told to upgrade to qiskit 0.18 to fix that.
Since the update it now fails in _check_conflicting_argument with the message ""The parameters pass_manager conflicts with the following parameter(s): backend."" as shown below is a stack trace
:
qc = compiler.transpile(circuit, BasicAer.get_backend('qasm_simulator'), pass_manager=p_m)
File ""C:\Users\-----\Anaconda3\envs\qiskite\lib\site-packages\qiskit\compiler\transpile.py"", line 188, in transpile
routing_method=routing_method, backend=backend)
File ""C:\Users\------\Anaconda3\envs\qiskite\lib\site-packages\qiskit\compiler\transpile.py"", line 225, in _check_conflicting_argument
""parameter(s): {}."".format(', '.join(conflicting_args)))
TranspilerError: 'The parameters pass_manager conflicts with the following parameter(s): backend.'
Further walk through the stack trace shows the following
bckend = set_backend('STATEVEC')
ampest = AmplitudeEstimation(m, fixed_income)
result = ampest.run(quantum_instance=bckend)
..quantum_algorithm.run()
....ae.run
......if _quantum_instance.is_statevector:
........construct_circuit(measurement = False)
..........pec = PhaseEstimationCircuit(...)
..........pec.construct_circuit(measurement = False)
............._state_n_circuit_factory(qc,q,aux)
................uncertainty_model.build(...) #fixed_income_....py
..................cs = Custom(...) #multivariate_distribution.py
..................extend(cs.construct_circuit('circuit',q))
.....................cs.construct_circuit('circuit')
........................svc = StateVectorCircuit(_state_vector)
........................sv.construct_circuit(...)
..........................convert_to_basis_gates()
............................Unroller(...)
............................PassManager(...)
............................compiler.transpile(circuit, BasicAer.get_backend('qasm_simulator)...)
.............................. transpile (....)
................................._check_conflicting_argument(...backend=backend)
It is in this _check_conflicting_argument that the error message is raised ""The parameters pass_manager conflicts with the following parameter(s): backend."" and the script stops execution.
Please let me know what am I missing something here.
Thank you
"
"['complexity-theory', 'hamiltonian-simulation']"," Title: Two commuting HamiltoniansBody:
- Let's say I have 2 commuting Hamiltonians that are not degenerate, I know it means that they a have a common energy basis, yet does it mean that they also have the same ground state? Or is there any way to learn something about the ground state of one from knowing the ground state of the other?
Assume that they both have similar structure, for example they are both 2 local on a square lattice acting on n particles.
- Is there a sufficient condition for two Hamiltonians to have the same groundstate?
"
"['algorithm', 'simulation', 'hamiltonian-simulation', 'machine-learning', 'applications']"," Title: What Are The Most Promising Real-World Applications For Quantum Machine LearningBody: I know this has been asked before in different ways, however, I am interested in something with a degree of clarity and focus not found in other questions.
What I am looking to get is a list of the most promising and impactful applications that Quantum Machine Learning and resources and references that I can use to understand more.
As a prerequisite I would ask that the 'application' have a real-world use case and associated industry.
i.e. If we are saying that Quantum Machine Learning gives us Quadratic speedups for Unstructured Search Algorithms than it would be prudent to specify that this could accelerate Drug Discovery and/or Materials Development (and then link to things about Grover's Search Algorithm, Unstructured Search Algorithms, etc.).
Thanks in advance for your help!
NOTE: I have reviewed the following StackExchange links prior to asking this:
...and the links on this page were used for background info in addition to an Engineering, Machine Learning and Data Science background (and the TF Whitepaper).
"
"['gate-synthesis', 'universal-gates', 'continuous-variable']"," Title: How can I prove the universality of this set of gates?Body: I was reading this article. A brief explanation: Here we have a circuit, the registers are a stepfunction state, an single photon state and a function state. The first two have position operators $X$ and $Y$, respectively.
but I'm very confused on how can that the set
$$\{e^{i\frac{\pi}{2}(\hat{X}^2+\hat{P}^2)},e^{it_1\hat{X}}, e^{it_2\hat{X}^2},e^{it_3 \hat{X}^3},e^{i\tau \hat{X}_1\otimes \hat{X}_2}\}$$
be the universal set. I mean, where did the Y go?
In this case $\hat{A}=\lambda \mathbb{I}+\sum_{i=1}^n a_i \hat{X}_i + b_i \hat{P}_i + \alpha_i \hat{X}^2_i +\beta_i \hat{P}^2_i$
I just want a clue about how to start here, thanks everyone.
"
"['simulation', 'machine-learning', 'applications', 'neural-network', 'tensor-networks']"," Title: How Mature is the Tensorflow Quantum LibraryBody: Where does The Tensorflow Quantum ( TFQ ) library fall on it's maturity curve.
In other words can we currently leverage the TFQ library to solve real-world problems? Will we need to wait for a TFQ 2.0?
Does this library, and if not will it ever, have more than just theoretical usefulness?
Will companies be utilizing TFQ to build systems that can help companies in the wild solve a problem faster/better than if they had utilized classical systems?
Tensorflow Quantum White Paper - For Reference
"
"['quantum-state', 'circuit-construction']"," Title: Can arbitrary four-qubit states be generated via circuits of the form $(U_{12}\otimes U_{34})U_{23}$?Body: Consider a four-qubit circuit with the following structure:
where the boxes can be arbitrary two-qubit unitary operations, and the time- evolution proceeds from left to right.
That not every four-qubit unitary can be decomposed in such a way follows from a simple parameter-counting argument: $(2^4)^2\gg 3(2^2)^2$.
However, consider the case in which we have a fixed input state, and want to generate a target output. From the point of view of the number of free parameters, this seems feasible: $2(2^4)< 3(2^2)^2$.
Is it always possible?
In other words, given a fixed input $|\psi_0\rangle$ and a target $|\psi_t\rangle$, can we always find two-qubit unitaries $U_{12},U_{23},U_{34}$ (acting nontrivially only on the respective subspaces) such that
$|\psi_t\rangle = (U_{12}\otimes U_{34})U_{23} |\psi_0\rangle$
?
"
"['quantum-state', 'density-matrix', 'nielsen-and-chuang', 'fidelity', 'trace-distance']"," Title: Is the quantum state fidelity defined as $F(\rho, \sigma)=\text{tr}\sqrt{\rho^{1/2}\sigma\rho^{1/2}}$ or its square?Body: I have seen two different definition of Fidelity in different sources. For example, Nielsen & Chuang QCQI, 10th edition, page 409 defines Fidelity like the following:
$$
F(\rho, \sigma) := \operatorname{tr} \sqrt{\rho^{\frac{1}{2}} \sigma \rho^{\frac{1}{2}}}
$$
An implementation of this definition is also present in this QETLAB library.
Another definition that I have found is:
$$
F(\rho, \sigma) := \Big(\operatorname{tr} \sqrt{\rho^{\frac{1}{2}} \sigma \rho^{\frac{1}{2}}}\Big)^2
$$
This def is present in the highly regarded Preskill notes and most other places like wiki, quantiki.
Was this definition changed sometime? TIA.
"
['speedup']," Title: Why does quantum computing only offer faster computational times for certain, specific types of problems?Body: Quantum computing has gained media attention about the exponential increase in computational speeds but only when dealing with specific problems which are prone to a quantum computational approach (such as cryptography)
Why does quantum computing only increase computational speeds for specific problems? Is this an inherent constraint with Quantum Computing or could we see Quantum Computing increase computational speeds “all around” in the future?
Thank you!
Ross
"
['quantum-state']," Title: Hyperspherical parametrization of a multi-qubit stateBody: Can anyone please explain me in simple words how the hyperspherical coordinates can be used to parameterise multi-qubit states?
The state of an $n$-qubit system can be thought of as a point on the $\mathbb{CP}(2^n-1)$, which is not a sphere. Of course, for small dimensions we have some exceptional correspondences (Hopf fibration), but my question is regarding the case of a general $n$.
"
"['quantum-state', 'measurement', 'fidelity', 'bell-basis', 'partial-trace']"," Title: Fidelity With Bell State CalculationBody: Let's say I have the following state:
$$
|\psi\rangle = \sqrt{\frac{2}{3}} |0000\rangle_{a_1b_1a_2b_2} + \sqrt{\frac{1}{6}} \big( |0011\rangle_{a_1b_1a_2b_2} + |1100\rangle_{a_1b_1a_2b_2} \big).
$$
I measure the $b_1$ subsystem and find it to be $|0\rangle$. Then the post measurement state is:
$$
|\psi'\rangle = \frac{\sqrt{\frac{2}{3}} }{\sqrt{\frac{2}{3} + \frac{1}{6}}}|0000\rangle_{a_1b_1a_2b_2} + \frac{\sqrt{\frac{1}{6}} }{\sqrt{\frac{2}{3} + \frac{1}{6}}} |0011\rangle_{a_1b_1a_2b_2}
$$
Now, I want to trace out subsystems $a_1b_1$ and calculate the fidelity of the remaining system $a_2b_2$ with $|\Phi^+\rangle = \frac{1}{\sqrt{2}} (|00\rangle + |11\rangle)$. This value is found to be:
$$
|\langle \psi' |\Phi^+\rangle|^2 = .9
$$
Here is my question. If instead of tracing out subsystems $a_1b_1$, I trace out $a_2b_2$ and calculate the remaining subsystem's fidelity with $|\Phi^+\rangle$, would I find $.9$ again?
"
"['mathematics', 'pauli-gates']"," Title: How is the ground state of a Hamiltonian defined?Body: I'm studying VQE, but there is something I don't get.
We know (I think) that for a given Hamiltonian the minimum eigenvalue is associated with the ground state. But if we take the Hamiltonian to be Pauli Z, then it has two eigenvalues: 1 associated with state $ |0 \rangle $ and -1 associated with state $|1 \rangle$.
Clearly the minimum eigenvalue is -1 so the ground state should be $|1\rangle$. But the ground sate for a qubit is $|0\rangle$
What am I getting wrong?
"
"['qiskit', 'programming']"," Title: Updating qiskit doesn't update qiskit version from SpyderBody: I installed qiskit using directions at https://qiskit.org/documentation/install.html
I also have spyder installed -Spyder 3.3.6 | Python 3.7.7 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Windows 10
It works fine i.e. I am able to build from spyder and connect to ibm_q hardware ...
when I run qiskit.__qiskit_version__ it was
{'qiskit-terra': '0.12.0',
'qiskit-aer': '0.4.1',
'qiskit-ignis': '0.2.0',
'qiskit-ibmq-provider': '0.5.0',
'qiskit-aqua': '0.6.5',
'qiskit': '0.16.2'}
Then I had to update qiskit to 0.18
so I went to Conda prompt and did pip install qiskit
the installation went through successfully - if I do conda list I see the following
:
qiskit 0.18.0 pypi_0 pypi
qiskit-aer 0.5.0 pypi_0 pypi
qiskit-aqua 0.6.5 pypi_0 pypi
qiskit-ibmq-provider 0.6.0 pypi_0 pypi
qiskit-ignis 0.3.0 pypi_0 pypi
qiskit-terra 0.13.0 pypi_0 pypi
:
I then did a reset of spyder - inspite of that from the IPython console I still see the older version - 'qiskit': '0.16.2'
I ran print( qiskit.__qiskit_version__) in my script that runs inside Spyder I still see 'qiskit': '0.16.2' - please help what else needs to be done. What am I missing here? Thank you
"
['matrix-representation']," Title: Matrix definition of the Ising XX gateBody: On the English Wikipedia, $XX$ Ising gates are defined in matrix form as :
$$ XX(\phi) = \begin{bmatrix}\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{bmatrix}$$
However, on the French Wikipedia, the $XX$ Ising gates are defined as :
$$ XX(\phi) = \frac{1}{\sqrt{2}}\begin{bmatrix}1&0&0& -i e^{i \phi}\\
0&1&-i & 0 \\
0 & -i & 1 & 0 \\
-i e^{i \phi} & 0 & 0 & 1 \\
\end{bmatrix}$$
From some sources, I believe the right one is the first one. I would like some confirmations about the second definition being an error, and I would be glad to take any explanation on it. In particular, does this matrix in the second definition corresponds to the definition of another gate?
"
"['algorithm', 'circuit-construction']"," Title: What is the simplest circuit which given $|a\rangle$ and $|b\rangle$ outputs the superposition $\frac{1}{\sqrt{2}}\left(|a\rangle+|b\rangle\right)$?Body: What is the simplest quantum circuit which takes states $|a\rangle$ and $|b\rangle$ as its input, and outputs the superposition $\frac{1}{\sqrt{2}}\left(|a\rangle+|b\rangle\right)$?
Cross-posted on Physics.SE
"
"['quantum-state', 'circuit-construction']"," Title: Preparing a linear combination of two $1$-occupied statesBody: I apologize for a simple question, should be quite trivial. How do I construct a circuit for preparing such a state?
$$
|0\rangle^n \mapsto \cos(\theta)|0...0\underset{i}{1}0...0\rangle + \sin(\theta) |0...0\underset{j}{1}0...0\rangle \ ,
$$
where the $i$th and $j$th qubits are in the $|1\rangle$ state.
"
['q#']," Title: How to use ApplyToEach when operation has parameters?Body: Problem
Apply a global phase -1 to all qubits x : Qubit[].
My solution
ApplyToEach(R, PauliI, 2.0 * PI(), x)
However this yields a syntax error.
From the ApplyToEach doc, it works if the operation has no parameters:
using (register = Qubit[3]) {
ApplyToEach(H, register);
}
Thank you for your expertise. Happy qubitting!
"
['quantum-operation']," Title: Understanding Quantum Channel and Choi Jamiolkowski NotationBody: I am given the following
$\newcommand{\on}[1]{{\operatorname{#1}}}$
Let $|i\rangle$, $1 \leq i \leq \on{dim}\,\mathcal{H_A}, |s\rangle$, $1 \leq s \leq \on{dim}\,\mathcal{H_B}$ be unitary bases. Write $\Lambda = \sum_{i,j,s,t}\Lambda^{\begin{pmatrix}i \\ j\end{pmatrix}}_{ \begin{pmatrix}s \\t \end{pmatrix}}|i\rangle \langle j | \otimes|s\rangle\langle t|$ so $CJ(\Lambda)$ Hermitian implies $\Lambda^{\begin{pmatrix}i \\ j\end{pmatrix}}_{ \begin{pmatrix}s \\t \end{pmatrix}} = \overline{\Lambda}^{\begin{pmatrix}j \\ t\end{pmatrix}}_{ \begin{pmatrix}i \\s \end{pmatrix}}$
I know the following
- $\Lambda$ is a quantum channel such that $$\Lambda : \on{End}(\mathcal{H_A}) \xrightarrow{} \on{End}(\mathcal{H_B})$$
Where $\on{End}(\mathcal{H_A})$ refers to the endomorphism over Hilbert space A
$$$$
- $CJ$ refers to the Choi-Jamiolkowki isomorphism which is of the form:
$$CJ: \on{Hom}(\on{End}(\mathcal{H_A}),\on{End}(\mathcal{H_B)}) \rightarrow \on{End}(\mathcal{H_A^*}\otimes\mathcal{H_B})$$ where $\on{Hom}$ refers to homomorphism (I believe)
What does the subscript, superscript notation mean on the $\Lambda$s?
"
"['algorithm', 'resource-request', 'classical-computing']"," Title: Can I learn Quantum Programming and then go back to learn the Mathematics / Physics behind it later?Body: Learning from the ground up (while great) is an overdose of the mathematics behind quantum computing and is taking way too long to grasp.
I have a Computer Science / Programming background. I am happy to learn the programming aspects and then go back and learn the math behind it or learn the background math whenever it is necessary while programming.
I started with MacMahon's book and now on Nielsen and Chuang.. but I feel it is taking longer to get to the application layer.
"
"['quantum-gate', 'algorithm', 'vqe']"," Title: In which type of Hamiltonian does the ansatz need an entangler in VQE?Body: I would like to prepare an ansatz for VQE.
I know UCC ansatz is one of the most useful ansatz, but I would like to reduce the number of CNOT.
From the matrix of a given Hamiltonian, can we know the ansatz for the given Hamiltonian needs entanglers or not?
"
"['qiskit', 'programming', 'hhl-algorithm']"," Title: Problem with HHL algorithm on QiskitBody: I try to run HHL algorithm on quantum computer in Qiskit Notebooks on the site. I take it from here https://qiskit.org/textbook/ch-applications/hhl_tutorial.html but it doesn't work. The error message is
""Credentials are already in use. The existing account in the session will be replaced."" and ""circuits = [qc_qa_c, qc_qa_3cx, qc_qa_5cx]""
"
"['quantum-gate', 'circuit-construction']"," Title: Controlled-U gate on IBMQBody: I want to construct a following 16x16 matrix (system of four qubits)
$U=\text{diag}(1,1,...,1,e^{-iV},e^{-iV})$
where $V$ is a constant.
So this matrix describe these rotations:
$|1110 \rangle \to e^{-iV}|1110\rangle$
$|1111 \rangle \to e^{-iV}|1111\rangle$
No rotation is applied to other computational basis states.
Following the book Principles of quantum computation and information I can build this $C^4$-$U$ gate: (with ancillary qubits)
In my situation, I have to build a $C^3$-$U$ gate, but the procedure is the same.
My problem is when I have to apply this $C$-$U$ that appears in the middle of the $C^3$-$U$ gate.
I don't know how to construct the $C$-$U$ gate so that it performs ONLY the rotation $e^{-iV}$ on q[0], leaving the rest of thee qubits (q[1], q[2], q[3]) as they were.
I understand that if I know how to construct the $C$-$U$, I will have the $C^3$-$U$ gate which represents the matrix I want to implement.
"
"['qiskit', 'programming', 'tomography']"," Title: IBMQJob.result() returns KeyError: 'qObjectResult'Body: I'm running tomography job like I have done many times before. I send the job, and the job.status() is 'DONE'. But when I ask for job.results() I get the following traceback.
I'm using version 0.18.0.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/providers/ibmq/api/clients/account.py in job_result(self, job_id, use_object_storage)
245 try:
--> 246 return self.job_get(job_id)['qObjectResult']
247 except KeyError as err:
KeyError: 'qObjectResult'
The above exception was the direct cause of the following exception:
ApiIBMQProtocolError Traceback (most recent call last)
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in _retrieve_result(self, refresh)
675 try:
--> 676 result_response = self._api.job_result(self.job_id(), self._use_object_storage)
677 self._result = Result.from_dict(result_response)
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/providers/ibmq/api/clients/account.py in job_result(self, job_id, use_object_storage)
248 raise ApiIBMQProtocolError(
--> 249 'Unexpected return value received from the server: {}'.format(str(err))) from err
250
ApiIBMQProtocolError: ""Unexpected return value received from the server: 'qObjectResult'""
The above exception was the direct cause of the following exception:
IBMQJobApiError Traceback (most recent call last)
<ipython-input-50-0a8321076fbb> in <module>
----> 1 experimental_state = StateTomographyFitter(best_full_tomography_job.result(), best_full_tomography_transpiled).fit()
2 plot_state_hinton(experimental_state)
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in result(self, timeout, wait, partial, refresh)
253 'Use job.error_message() to get more details.'.format(self.job_id()))
254
--> 255 return self._retrieve_result(refresh=refresh)
256
257 def cancel(self) -> bool:
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in _retrieve_result(self, refresh)
687 raise IBMQJobApiError(
688 'Unable to retrieve result for '
--> 689 'job {}: {}'.format(self.job_id(), str(err))) from err
690 finally:
691 # In case partial results are returned or job failure, an error message is cached.
IBMQJobApiError: 'Unable to retrieve result for job 5e984c5e6ad41d00184b12c1: ""Unexpected return value received from the server: \'qObjectResult\'""'
What does it mean, and what went
EDIT:
I now see that when I retrieve a previously ran job, I get a warning message:
/anaconda3/envs/quantum/lib/python3.7/site-packages/qiskit/qobj/qasm_qobj.py:497: DeprecationWarning: qiskit.qobj.Qobj is deprecated use either QasmQobj or PulseQobj depending on your application instead.
experiments=experiments, header=header)
"
"['qiskit', 'ibm-q-experience', 'bernstein-vazirani-algorithm']"," Title: Bernstein-Vazirani IBMQ error due to probably measurementsBody: I'm using the following piece of python code:
import matplotlib.pyplot as plt
from qiskit import *
from qiskit.tools.visualization import plot_bloch_multivector, plot_histogram
from qiskit import execute, IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit.tools.monitor import job_monitor
secret_number = ""1010""
n = len(secret_number)
circuit = QuantumCircuit(n+1, n)
circuit.h(range(n))
circuit.x(n)
circuit.h(n)
circuit.barrier()
for i,v in enumerate(reversed(secret_number)):
if v==""1"":
circuit.cx(i, n)
circuit.barrier()
circuit.h(range(n))
circuit.barrier()
circuit.measure(range(n), range(n))
simulator = Aer.get_backend(""qasm_simulator"")
sim_result = execute(circuit, backend=simulator, shots=4096).result()
IBMQ.load_account()
provider = IBMQ.get_provider(""ibm-q"")
# qcomp = provider.get_backend(""ibmq_16_melbourne"")
qcomp = provider.get_backend(""ibmq_burlington"")
job = execute(circuit, backend=qcomp, shots=4096)
job_monitor(job)
real_result = job.result()
counts = real_result.get_counts(circuit)
import collections
c = collections.Counter(counts)
# printing
print(circuit.draw())
print(""result simulation:"")
print(sim_result.get_counts())
print(""results (top 5):"")
print(c.most_common(5))
The results are shown here:
As you can see, the expected result is 1010, which is correctly the value that the quantum simulator gives me. However, I find this result on the fifth position for this execution in the real quantum computer. Is this due to noise? How can I get around this?
As complementary information, I tried the same code with secret_number = ""1011001"" and the ibmq_16_melbourne server. These are the results:
As you see. The error is amplified.
"
"['ibm-q-experience', 'speedup']"," Title: Meaning of ""Running"" time field in Results and correlation with the ""shots"" choosen numberBody: I've created a same circuit that I've executed two different ways on the same computer (ibmq_16_melbourne); First with 1024 Shots and secondly with 8096 Shots
For the first (1024), I got in results, a ""Running"" time of 8.8s
For the second (8096), I got in results, a ""Running"" time of 35.7s
What does this ""Running"" field means exactly? Is it not a running execution time on the quantum computer?
If so, normally, I should got about 70 seconds for the second way.
Why is it shorter?
Thank you for your help & answers.
"
"['quantum-operation', 'information-theory']"," Title: What does it mean to take the Choi-Jamiolkowski of a quantum channel?Body: The Choi-Jamiolkowski of a channel $\newcommand{\on}[1]{\operatorname{#1}}\Lambda : \on{End}(\mathcal{H_A}) \xrightarrow{} \on{End}(\mathcal{H_B})$ is obtained through an isomorphism of the form:
$$
CJ:
\on{Hom}(\on{End}(\mathcal{H_A}),\on{End}(\mathcal{H_B)})
\rightarrow
\on{End}(\mathcal{H_A^*}\otimes\mathcal{H_B}),
$$
Where $\on{End}(\mathcal{H})$ is the set of endomorphisms over the Hilbert space $\mathcal{H}$.
How does one interpret $CJ(\Lambda)$ ?
"
"['mathematics', 'photonics', 'continuous-variable']"," Title: What types of quantum systems use infinite values?Body: Background
I am curious to learn more about any work that has been done regarding quantum systems that deal with infinite values. I am primarily interested in photonic quantum computing; however I am open to learning about other systems where infinite values are used.
Here are a few snippets that lead me to believe this is a valid concept to consider:
In Can we process infinite matrices with a quantum computer?, there is an answer that states:
If instead of manipulating the quantum information in qubits, your quantum computer were to do operations on qu𝑑its with 𝑑 being infinity, then you'd essentially be processing infinite matrices on a quantum computer.
Additionally, in another question there is an answer that states:
To get you started, the fundamental difference between the CV model and the traditional qubit model is that in the CV model, we formally apply operations on infinite-dimensional instead of two-dimensional systems. Of course, in practice, each system can be effectively described by a large but finite-dimensional Hilbert space, but it is more mathematically convenient to describe operators and states on the full infinite-dimensional space.
In Is quantum computing limited to a superposition of only two states? there is an answer that states:
In principle, there is no limit to the dimension of the state space of a quantum system. There could even be an "infinite" dimensional separable Hilbert space (in short, separable means denumerable/countable with a one-one onto mapping to the natural numbers).
From Nonseparable Hilbert space:
Furthermore, the article on Hilbert spaces contains the following:
A Hilbert space is separable if and only if it admits a countable orthonormal basis.
In case of field theory, it states:
Even in quantum field theory, most of the Hilbert spaces are in fact separable, as stipulated by the Wightman axioms. However, it is sometimes argued that non-separable Hilbert spaces are also important in quantum field theory, roughly because the systems in the theory possess an infinite number of degrees of freedom and any infinite Hilbert tensor product (of spaces of dimension greater than one) is non-separable.
Questions
What systems make use of countable infinities? How are they used?
What systems make use of uncountable infinities? How are they used?
"
"['algorithm', 'simulation', 'classical-computing', 'nonclassicality', 'interpretations']"," Title: Does a classical computer really require $2^n$ complex numbers to represent the state of $n$ qubit quantum computer?Body: One often reads that the key reason why classical computers (probabilistic or deterministic) are unable to simulate quantum algorithms such as Simon's or Shor's efficiently is that a classical computer needs $2^n$ complex numbers to represent an $n$ qubit state of a quantum computer. While it is true that the dimensionality of the Hilbert space spanned by an $n$ qubit computational basis is $2^n$, it seems to me that the subspaces reachable by many quantum algorithms that employ fixed sequence of unitary gates are substantially smaller.
Let $n$ be the number of qubits in a quantum computer. Consider an algorithm that starts from some simple initial state (say the 0 for all qubits) and employs a sequence of $kn$ unitary gates ($k$ being some factor), each involving no more than 1 or 2 qubits. One may ask: What is the size of the Hilbert subspace reachable by this algorithm from the initial state? A 2 qubit gate should not need more than 16 complex numbers for its representation and $kn$ such gates in a fixed sequence will not need more than $16kn$ such numbers (in reality the factor will be smaller). The fact that the sequence of gates is a fixed one is important in this argument to avoid branching. Many algorithms including Shor's, Grover's, Simon's are based on fixed gate sequences like this. If the number of gates scales as a polynomial of $n$, the ""size"" of the Hilbert subspace reachable from the initial state should scale as polynomial of $n$ as well. Therefore, I do not see why we would need $2^n$ complex numbers as would be needed to describe the entire Hilbert space. Can someone help explain why? If my thinking is correct, wouldn't this logic be a generalization of Gottesman-Knill theorem and wouldn't it also imply that there exists ""classical"", possibly probabilistic computing, algorithms capable of equalling Simon's and Shor's in efficiency? What am I missing?
"
"['mathematics', 'nielsen-and-chuang', 'textbook-and-exercises', 'information-theory']"," Title: Nielsen and Chuang ex 2.73Body: I've been trying to solve exercise 2.73 (p.g 105), and I'm not sure if i'v been overthinking it and the answer is as simple as i've described below or if I am missing something, or i'm just wrong!
Ex 2.73:
Let $\rho$ be a density operator. A minimal ensemble for $\rho$ is an ensemble $\{p_i,|\psi_i\rangle\}$ containing a number of elements equal to the rank of $\rho$. Let $|\psi\rangle$ be any state in the support of $\rho$. Show that there is a minimal ensemble for $\rho$ that contains $|\psi\rangle$, and moreover that in any such ensemble $|\psi\rangle$ must appear with probability
$p_i=\frac{1}{\langle\psi_i|\rho^{-1}|\psi_i\rangle}$
where $p^{-1}$ is defined to be the inverse of $\rho$, when $\rho$ is considered as an operator acting only on the support of $\rho$
My answer so far is:
$\rho$ is positive the therefore has a spectral decomposition $\rho=\sum_k\lambda_k|k\rangle\langle k|$.
The density operator cann be defined as $\rho=\sum_kp_k|k\rangle\langle k| = \sum_k|\hat{k}\rangle\langle \hat{k}|$, where $|\hat{k}\rangle=\sqrt{\lambda_k}|k\rangle$, and therefore $|k\rangle = \frac{|\hat{k}\rangle}{\sqrt{\lambda_k}} $.
For any $|\psi_i\rangle = \sum_k c_{ik}|k\rangle$, using the above definition of $|k\rangle$:
$|\psi_i\rangle = \sum_k \frac{c_{ik}}{\sqrt{\lambda_k}}|\hat{k}\rangle$
The density operator is given by $\rho=\sum_i|\psi_i\rangle\langle\psi_i|$, therefore
$\rho = \sum_{i}\sum_{k}\frac{c_{ik}^2}{\lambda_k}|\hat{k}\rangle \langle\hat{k}|$.
By the definition of $\rho$ is can be seen that $p_i = \sum_{k}\frac{c_{ik}^2}{\lambda_k}$.
--- reading this back i'm not sure this is correct at all :(
For the second part working backwards a bit:
$\langle \psi_i|\rho^{-1}|\psi_i\rangle = \langle \psi_i|\sum_k \left( \frac{1}{\lambda_k}|k\rangle\langle k| \right) |\psi_i\rangle = \sum_k \frac{1}{\lambda_k}\langle \psi_i|k\rangle\langle k |\psi_i\rangle = \sum_{i,k} \frac{1}{\lambda_k}c_{i,k}^2\langle i|k\rangle \langle k |i\rangle $
Given that $|i\rangle$ is of basis $|k \rangle$, $\langle k |i\rangle = \langle i |k\rangle = 1 $ if $i=k$, therefore
$\langle \psi_i|\rho^{-1}|\psi_i\rangle = \sum_{k} \frac{c_{i,k}^2}{\lambda_k}$ so
$p_i = \frac{1}{\sum_{k} \frac{c_{i,k}^2}{\lambda_k}}$
However the above result does not match with the result I got for $p_i$ in the first part, so one of them is wrong...
---Update---
I think the answer of the first part can be corrected, as the density matrix for $\psi_i$ needs to be normalised, and therefore to normalise it
By the definition of $\rho$ is can be seen that to normalise the trace it is required that $p_i = \frac{1}{\sum_{k}\frac{c_{ik}^2}{\lambda_k}}$.
Hence $\rho_i= p_i|\psi_i\rangle \langle\psi_i| = p_i\sum_{k}\frac{c_{ik}^2}{\lambda_k}|\hat{k}\rangle \langle\hat{k}| = \sum_{k}|\hat{k}\rangle\langle\hat{k}|$. Which is our original definition of $\rho$.
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis']"," Title: Cheap Toffoli gates with phase errorsBody: Here, a cheap verion of a Toffoli, up to a phase flip for $|101\rangle$, is given by
with $A=R_y(\pi/4)$. Are there similar versions of cheap implementation of general $C^nNOT$ gates?
I tried to just extend it the esay way, but found several unwanted off diagonal entries. My goal is a explicite $C^5NOT$.
So I came across this one for 4 qubits:
which I found here. Can anyone help me to build the circuit for 6 qubits out of the description?
And finally I found this approach:
but the number of $CNOT$s feels like $2^5$ in my case, which is too high for my purpose.
"
"['qiskit', 'quantum-fourier-transform', 'phase-estimation', 'phase-kickback']"," Title: How does Inverse QFT work in Quantum Phase Estimation?Body: I'm trying to implement Quantum Phase Estimation from qiskit textbook.
Below is the implementation circuit taken from the above-mentioned site:
The output at position 2 will be as follows:
$$|\psi _2⟩ = \frac{1}{2^{\frac{n}{2}}} \sum_{k=0}^{2^{n}-1} e^{2\pi i k} |k⟩ ⊗ |\psi⟩ $$
and after applying inverse QFT, the state becomes:
$$ | \psi _3⟩ = \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-2^n \theta)} |x⟩ ⊗| \psi⟩ $$
However, the next step claims that the above expression peaks near $ x = 2^n \theta $ which is my point of doubt, why is this the case? Wouldn't the maximum amplitude be when $ x = 0 $ based on simple calculus?
"
"['hamiltonian-simulation', 'annealing', 'vqe']"," Title: How to convert a qubit hamiltonian to QUBO and vice versa?Body: This is my hamiltonian. Solving this by hand, Numpy Python package and VQE algorithm gives the minimum energy eigenvalue -2. If we want to find the minimum energy of this hamiltonian with Quantum annealer we need to transform this into QUBO. This is a 2 qubit hamiltonian, 4x4 hermitian matrix.
\begin{equation}
H = \begin{pmatrix}
0 & 0 & 0 & 0 \\
0 & -1 & 1 & 0 \\
0 & 1 & -1 & 0 \\
0 & 0 & 0 & 0
\end{pmatrix}
\qquad
E_{min} = -2
\end{equation}
- What will be the QUBO for this hamiltonian?
- What will be the shape of the QUBO matrix? Is it 4X4 or 2X2?
- How to convert hamiltonian to QUBO? Please elaborate the mathematical steps.
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis']"," Title: Implementing a controlled-controlled-U using controlled-UBody: Suppose I know how to implement a 2 qubit gate $C-U$ (i.e controlled U), and I want to implement $CC-U$ using $C-U$ and other 1 or 2 qubit gates, is that possible?
"
"['ibm-q-experience', 'qasm']"," Title: Error when running an algorithm on real device at IBM Q using QASMBody: I'm running an algorithm on a real quantum device from IBM (ibmqx2), using the QASM and circuit composer, and it just gets the same error over and over again: Instruction not in basis gates: instruction: bfunc, qubits: [].
Here is the transpiled code:
qreg q[5];
creg c[4];
u3(2.0943951023931953, 1.5707963267948966, 1.5707963267948966) q[0];
u2(0, 3.141592653589793) q[1];
cx q[1], q[2];
cx q[0], q[1];
u2(0, 3.141592653589793) q[0];
cx q[2], q[4];
measure q[0] -> c[0];
if(c == 1) u1(3.141592653589793) q[2];
if(c == 1) u1(3.141592653589793) q[4];
measure q[1] -> c[1];
if(c == 1) u3(3.141592653589793, 0, 3.141592653589793) q[2];
if(c == 1) u3(3.141592653589793, 0, 3.141592653589793) q[4];
measure q[2] -> c[2];
measure q[4] -> c[0];
It's just a simple teleportation algorithm with an extra qubit. How can that be to not work properly? Does someone knows what may be happening?
"
"['ibm-q-experience', 'qasm']"," Title: Subroutines on IBM Q (ERROR_RUNNING_JOB returned)Body: I wrote following code in QASM editor on IBM Q web interface (note ccu1 is controlled-controlled U1 gate):
OPENQASM 2.0;
include ""qelib1.inc"";
gate ccu1 ( p ) c1, c2, t {
cu1 ( p / 2 ) c1, c2;
cx c2, t;
cu1 ( - p / 2 ) c1, t;
cx c2, t;
cu1 ( p / 2 ) c1, t;
}
qreg q[4];
creg c[4];
h q[0];
h q[1];
h q[2];
h q[3];
ccu1(pi) q[0],q[1],q[2];
id q[3];
measure q[3] -> c[3];
When I look to visualization of a state vector, everything is fine. However, when I tried to run the code on simulator I got error ERROR_RUNNING_JOB. There is also a status message Error in transpilation process. [1003] on results page.
I suspect that the issue is caused by subroutine (a gate statement at the beginning of the code).
Could anyone please help me solve the issue?
Note, I know that it is possible to use subroutine in Qiskit, but I am interested in QASM.
"
"['quantum-state', 'density-matrix']"," Title: What is the density matrix of $|+\rangle$ with respect to basis $\{|+\rangle, |-\rangle\}$?Body: Prove that the density matrix of $|+\rangle$ with respect to basis $\{|+\rangle, |-\rangle\}$ is given by
$$\rho = \begin{bmatrix}
1 & 0 \\
0 & 0
\end{bmatrix}.$$
"
"['quantum-state', 'mathematics', 'nielsen-and-chuang', 'q#', 'superposition']"," Title: Why don't I get what I expect when measuring with respect to a different basis?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
If I make a rotation of $\frac{\pi}{4}$ around the x axis, starting from $\ket{0}$, I expect $\alpha = \frac{\sqrt{2 + \sqrt{2}}}{2}$ and $\beta= \frac{\sqrt{2 - \sqrt{2}}}{2}$ when measured with respect to the computational basis states of $\ket{0}$ and $\ket{1}$. I can verify this is correct empirically using a quantum simulator. I want to measure with respect to new basis states $\ket{+}$ and $\ket{-}$, defined in Quantum Computation and Quantum Information as follows $\ket{+} \equiv \frac{\ket{0}+\ket{1}}{\sqrt{2}}$, $\ket{-} \equiv \frac{\ket{0}-\ket{1}}{\sqrt{2}}$, and corresponding to the poles of the x axis of the Bloch sphere.
Looking at the Bloch sphere, I would expect to get $\ket{+}$ half of the time, and $\ket{-}$ the other half, and I have been able to empirically verify this. However, according to the mathematics presented in the aforementioned book, I should be able to express this state $\ket{\psi} = \alpha\ket{0} + \beta\ket{1}$, with the $\alpha$ and $\beta$ previously mentioned, as follows:
$$\ket{\psi} = \alpha\ket{0} + \beta\ket{1} = \alpha\frac{\ket{+} + \ket{-}}{\sqrt{2}} + \beta\frac{\ket{+} - \ket{-}}{\sqrt{2}} = \frac{\alpha + \beta}{\sqrt{2}}\ket{+} + \frac{\alpha -\beta}{\sqrt{2}}\ket{-}$$
This math seems sound to me, however if I attempt to translate to this new basis using my $\alpha$ and $\beta$, I get
$$ \frac{\sqrt{2+\sqrt{2}} + \sqrt{2-\sqrt{2}}}{2\sqrt{2}}\ket{+} + \frac{\sqrt{2+\sqrt{2}} -\sqrt{2-\sqrt{2}}}{2\sqrt{2}}\ket{-} $$
Since $\left(\frac{\sqrt{2+\sqrt{2}} + \sqrt{2-\sqrt{2}}}{2\sqrt{2}}\right)^2 \approx 0.85$ this is not at all what I expect from looking at the Bloch sphere, and does not match what I am able to demonstrate empirically. What am I missing?
For reference, the important bit of my Q# code I've been using to test this is:
Rx(PI()/4.0, qubit);
set state = Measure([PauliX], [qubit]);
"
"['mathematics', 'textbook-and-exercises', 'hadamard']"," Title: What happens if $|\psi\rangle$ = $|0\rangle$ or $|\psi\rangle$ = $|1\rangle$ is passed as an input to two Hadamard gates in sequence?Body: I'm a computer science student and soon I will have a math exam. I'm really struggling with this preparation question. Also, includes the following:
How does this demonstrate that we need the “ket” (or the vector) representation of qubits, rather than just describing them in terms of probabilities (eg. “this is a qubit with 50% probability of being 1”)?
Could you help me please?
"
"['simulation', 'quantum-advantage', 'google-sycamore', 'random-quantum-circuit']"," Title: What did exactly Google do in simulating a random quantum circuit on a classical computer in supremacy experiment?Body: I've been working on Google quantum supremacy paper for quite some time now and I have a problem in understanding how exactly they simulate their actual random quantum circuit on a classical computer.
To be specific, in their quantum random circuit each cycle includes a single qubit gate and a two-qubit gate. The single-qubit gate is chosen randomly from a set of three gates. To randomize the procedure of choosing the single-qubit gate there is a pseudorandom number generator which is initialized with a seed according to Supplementary information of the paper (part VII).
So my question is, when they want to run the simulation of the circuit on a classical computer, how exactly do they choose the single-qubit gate randomly?
Do they use a separate pseudorandom number generator for their code? If so, how do they compare the simulation results to the actual circuit, because the two are not related at all? Or they use the same pseudorandom number generator? Or none of them and they don't choose the single qubits randomly in the simulation but they look at the physical circuit and trace the gates that have been used in that circuit and then try to perform the exact set of gates on the exact same qubits in their simulation?
Please if you know where I can find the actual code of the simulation, mention that too. Thank you for your attention!
"
"['qiskit', 'programming', 'quantum-state']"," Title: How to create states in Qiskit using complex phase angles?Body: How do we create an arbitrary vector of the following form in Qiskit?
Say, we want to initialize a qubit with a vector,
$$
\vert \psi \rangle = \frac{1+i}{\sqrt{3}}\vert 0 \rangle - \frac{i}{\sqrt{3}}\vert 1 \rangle
$$
If I put it in the form
$$
\vert \psi \rangle = \frac{1+i}{\sqrt{3}}\vert 0 \rangle - \frac{i}{\sqrt{3}}\vert 1 \rangle = cos(\frac{\theta}{2})|0> + e^{i\phi}sin(\frac{\theta}{2})|1>
$$ where
$0 < \theta < \pi$ and $0 < \phi <2\pi$
and then calculate $\theta$ and $\phi$
So,
$$
cos(\frac{\theta}{2}) = \frac{1+i}{\sqrt{3}}\\
e^{i\phi}sin(\frac{\theta}{2}) = - \frac{i}{\sqrt{3}}
$$
Therefore,
$$
\theta = 2 * \arccos{\frac{1+i}{\sqrt{3}}} \\
\phi = i * ln(\frac{- \frac{i}{\sqrt{3}}}{sin(\frac{\theta}{2})})
$$
Now, I am using the following code..
#We create the quantum state manually first
arb_quantum_state = ((1+1.j)/math.sqrt(3))*ket_0 - (1.j/math.sqrt(3))*ket_1
print(arb_quantum_state)
theta = 2*cmath.acos((1+1.j)/cmath.sqrt(3))
print('theta : ',theta)
sinValue = cmath.sin(theta/2)
print(sinValue)
phase = -1*(1.j/cmath.sqrt(3))/sinValue
phi = cmath.log(phase)/1.j
print('phi : ',phi)
# Use these theta and phi to create the circuit
circ = QuantumCircuit(1,1)
#Verify why complex values are not allowed
#circ.u3(theta.real,phi.real,0,0)
circ.u3(theta,phi,0,0)
results = execute(circ, backend=Aer.get_backend('statevector_simulator')).result()
quantum_state = results.get_statevector(circ, decimals=3)
print (quantum_state)
The above code creates the gate alright, but the execute function is returning the following error,
TypeError: can't convert complex to float
However, if I use just the real values of theta and phi, then the execute function returns a state vector, which is different than the one it should be.
"
"['quantum-gate', 'nielsen-and-chuang', 'density-matrix', 'tomography', 'quantum-process-tomography']"," Title: How to perform Quantum Process Tomography for three qubit gates?Body: I am trying to perform Quantum process tomography (QPT) on three qubit quantum gate. But I cannot find any relevant resource to follow and peform the experiment. I have checked Nielsen and Chuang's Quantum Computation and Quantum Information book.
And I found this, the formula to find Chi matrix for 2-qubit gates. Then in the research paperMeasuring Controlled-NOT and two-qubit gate operation there is lucid explanation how to perform the QPT for two qubit gates following Nielsen's suggestion in his book.
Following aforementioned references I am trying to obtain the formula for Chi matrix in case of 3 qubit gate. Experimentally I have found the matrix in the middle of equation 8.181 in Nielsen's book (it's in the attached image) but am having trouble finding permutation matrix 'P' (the permutation matrix) given in the same equation for three qubits. Can anyone help me explain how can I find it?
More importantly I want to know whether equation 8.810 of Nielsen's book (given in the attached image) itself should be used for the case of 3 qubit gates as well? If not how to modify it for 3-qubit gate?
"
"['qiskit', 'ibm-q-experience']"," Title: How to control the qubits in IBMQBody: I am trying to perform OTOC for my 7 qubit protocol. I need to carefully control and use only 7 qubits but after making measurement in the 16 qubit Melbourne system (ibmq_16_melbourne) my protocol gets transpiled in all of the 16 qubits.
Is there any way (some codes in qiskit) to use only 7 qubits of the 16 qubits in IBMQ Melbourne, so that it uses only 7 qubits which I have used in the protocol for transpiling and measurement and not more? Or is there any other quantum computer available on which I can do this?
"
"['quantum-gate', 'circuit-construction', 'tensor-product']"," Title: IBM quantum circuit - order of tensor product for equivalent matrixBody: I'm trying to understand how to apply tensor products on 3-qubit systems (or well at least 2 qubits). Let's take a basic example:
where $$\lvert \psi \rangle = \lvert q_2q_1q_0\rangle $$ with $q_2$ being the most significant bit and $q_0$ the least significant (matching the above schematic for the circuit).
H matrix (for a single qubit): $$H = \frac{1}{\sqrt{2}}\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix} $$
I understand that I need to use the identity matrix and tensor product in order to format the Hadamard matrix (and any other in the circuit) to be applied to 3 qubits. What I do not understand is how, generally, I determine the order of the tensor product? In order words, with the above description, should I do:
$$M=(H\otimes I)\otimes I =
\frac{1}{\sqrt{2}}
\begin{bmatrix}
I & 0 & I & 0\\
0 & I & 0 & I\\
I & 0 & -I & 0\\
0 & I & 0 & -I\\
\end{bmatrix}$$
or
$$M=(I\otimes I)\otimes H =
\begin{bmatrix}
H & 0 & 0 & 0\\
0 & H & 0 & 0\\
0 & 0 & H & 0\\
0 & 0 & 0 & H\\
\end{bmatrix}$$
More generally, how should I think about why the correct one is the right one? What is the logic I need to understand with regards to the "extension" of my gate's matrices and in which order I need to apply the Identity matrices in the tensor product?
"
"['entropy', 'information-theory']"," Title: What is the Von Neumann entropy of $\rho = \sum_ip_i|i\rangle\langle i| \otimes \rho_i$?Body:
Let $\overline{p}$ be a probability distribution on $\{1,....,d\}$. Then let $\rho = \sum_ip_i|i\rangle\langle i| \otimes \rho_i$.
How should I take the Von-Neumann entropy of $\rho$? I know that Von-Neumann entropy is additive under the tensor product. So
$S(\rho) = S(\sum_ip_i|i\rangle\langle i| \otimes \rho_i) = S(p_i\sum_i|i\rangle\langle i|) + S(\sum_i\rho_i)$
How can I break this down further? My goal is to prove $S(\rho) = S(\overline{p}) + \sum _i p_iS(\rho_i)$ but I would just like help on how to work with the two terms I've broken $S(\rho)$ into
"
['ibm-q-experience']," Title: How to get QASM code from IBMQ experienceBody: I am interested in retrieving the OpenQasm code of a quantum circuit, as it appears on IBM Quantum Experience. This is the code that the quantum machine actually runs. I used to be able to just copy the code from the results tab, but I seem to not be able to do that anymore. Is there any way to retrieve said Qasm code? Thank you in advance.
"
"['measurement', 'projection-operator']"," Title: Help in understanding the usage of eigenvalues in the definition of the projective measurementBody: Recently I was reading about the projective measurement in "Quantum Computation and Quantum Information" by Nielsen & Chuang, where they describe the projective measurement as follows:
Projective measurements: A projective measurement is described by an observable, $M$, a Hermitian operator on the state space of the system being observed. The observable has a spectral decoomposition,
$$ M = \sum_m m P_m, $$
where $P_m$ is the projector onto the eigenspace of $M$ with eigenvalue $m$. The possible outcomes of the measurement correspond to the eigenvalues, $m$, of the observable. [...]
Usually, while conducting a measurement on a qubit we are using two projectors, namely $P_0 = |0\rangle \langle 0|$ and $P_1 = |1\rangle \langle 1 |$.
For the case of $P_0$ we have two possible eigenvalues:
- 0, with eigenvector $\begin{pmatrix} 0 \\ 0 \end{pmatrix}$,
- 1, with eigenvector $\begin{pmatrix} 1 \\ 0 \end{pmatrix} = |0\rangle$.
In the case of $P_1$ we have simmilar eigenvalues:
- 0, with eigenvector $\begin{pmatrix} 0 \\ 0 \end{pmatrix}$,
- 1, with eigenvector $\begin{pmatrix} 0 \\ 1 \end{pmatrix} = |1\rangle$.
Because qubit has to be normalized, I guess the eigenstates associated to the 0 eigenvalue cannot be obtained during a measurement. But if we would like to stick to the definition $M = \sum_m m P_m$ for $m = \{0,1\}$, we would get
$$ M = 0 \cdot P_0 + 1 \cdot P_1 = P_1,$$
which I think is incorrect.
Because of that, isn't the formulation of an observable as $M = \sum_m m P_m$ a little bit misleading? Shouldn't it be defined as
$$ M = \sum_m \lambda_m P_m,$$
where $\lambda_m$ is the eigenvalue associated to the appropriate state? Then we would get
$$ M = \lambda_0 P_0 + \lambda_1 P_1 = 1 \cdot P_0 + 1 \cdot P_1 = \mathbf{I}. $$
"
"['measurement', 'projection-operator']"," Title: What's the interpretation of the eigenvalues of qubit's projective operators?Body: Usually, while conducting a measurement on a qubit we are using two projectors, namely $P_0 = |0\rangle \langle 0|$ and $P_1 = |1\rangle \langle 1 |$.
For the case of $P_0$ we have two possible eigenvalues:
- 0, with eigenvector $\begin{pmatrix} 0 \\ 0 \end{pmatrix}$,
- 1, with eigenvector $\begin{pmatrix} 1 \\ 0 \end{pmatrix} = |0\rangle$.
In the case of $P_1$ we have simmilar eigenvalues:
- 0, with eigenvector $\begin{pmatrix} 0 \\ 0 \end{pmatrix}$,
- 1, with eigenvector $\begin{pmatrix} 0 \\ 1 \end{pmatrix} = |1\rangle$.
I guess, that due to the noralization condition we cannot obtain the $\begin{pmatrix} 0 \\ 0 \end{pmatrix}$ states. So the only possible outcomes of a measurement are states $|0\rangle$ and $|1\rangle$ both with eigenvalue 1.
So what is the interpretation of this eigenvalue? Is it something like the ""amount of information"" stored in a qubit?
"
"['quantum-gate', 'circuit-construction', 'simulation']"," Title: A question about quantum circuit simulation on PCBody: In classical logic circuit consisting of AND, OR and others, common gates can be realized by electrnic signal. Each time cycle can run a function unit like the picture below.
Now I have read many paper and try to understand how to simulate quantum circuits on classical computer. They just tell me the circuits can be changed by ""HT circuit (Hadmard+ Toffoli)"". However, they don't tell me how to simulate a Hadmard gate and how to simulate the entangled state after Hadmard gate.
Is that means we can just translate the Quantum circuit to something just like a traditional circuit and run each function unit in a time cycle?
"
"['quantum-advantage', 'google-sycamore', 'random-quantum-circuit']"," Title: What is the role of choosing the single-qubits randomly in Google quantum supremacy experiment?Body: In supremacy paper and part D of section VII of supplementary information (below), it is said that there is a pseudo-random number generator that is initialized with a seed called $s$; And then the single-qubit gates are selected from the set of three gates $\sqrt{X} , \sqrt{Y},\sqrt{W}$ according to this random number.
D. Randomness
Single-qubit gates in every cycle are chosen randomly
using a pseudo-random number generator (PRNG). The
generator is initialized with a seed s which is the third
parameter for our family of RQCs. The single-qubit gate
applied to a particular qubit in a given cycle depends onlyon s. Consequently, two RQCs with the same s apply the
same single-qubit gate to a given qubit in a given cycle
as long as the qubit and the cycle belong in both RQCs
as determined by their size n and depth m parameters.
Conversely, the choice of single-qubit gates is the sole
property of our RQCs that depends on s. In particular,
the same two-qubit gate is applied to a given qubit pair
in a given cycle by all RQCs that contain the pair and
the cycle.
and in part E:
Single-qubit gates in the first cycle are chosen independently
and uniformly at random from the set of the three gates above. In subsequent cycles, each single-qubit
gate is chosen independently and uniformly at random
from among the gates above except the gate applied to
the qubit in the preceding cycle. This prevents simplifications of some simulation paths in SFA. Consequently,
there are $3^n2^{nm}$ possible random choices for a RQC with
n qubits and m cycles.
What I understand from the experiment and this answer is that we have a circuit, we have an input state , and after passing this input state through the circuit, we do a measurement, and a ket consisting of zeros and ones ($e.g. |{10010101..10>}$) is obtained. Now we are repeating the experiment for many times again and again in exactly the same way and with exactly the same circuit (if I'm wrong correct me), which means that the random number you produce must again produce the same series of numbers, which is possible by initializing $s$ to the previous value.
After repeating the measurements on exactly the same circuit (for example, one million times), you can draw a bar chart (see the picture below) and get the distribution function approximately and then compared the distribution to the simulation distribution as it's mentioned in this lecture note.
and in the caption of this picture it's said:
Lastly, we measure the state of every qubit. The measurement is repeated many times
in order to estimate the probability of each output state. Here, we plot the measured probabilities for two instances after 10
coupler pulses (cycles).
Now my question is, why do we use random numbers at all when we actually have to measure the output of the same circuit many times? Why don't we choose single-qubits gates according to a pattern like two-qubit gates?
Did Google do what I explained here for supremacy experiment or I'm missing something? That is, a specific circuit of certain single-qubit gates on a certain qubits and then two-qubit gates in each cycle and then go to the next cycle and after for example 20 cycles (for supremacy experiment) then measuring the state of each qubit and repeat the whole process with exactly the same circuit (same as I explained above) many times? If so, has Google actually do the experiment only on one circuit (I mean do the 1 million measurement on one specific circuit) or tested different circuits (with different value $s$) to verify the experiment?
If this is not the case, and each time after a measurement and obtaining a ket consisting of zeros and ones $s$ changes, and as a result, the circuit changes, and then the measurement is done, and this is repeated many times, and then from these measurements that the distribution is obtained, how is this distribution useful? because the measured kets are practically for different circuits.
What role does this randomness play in making things difficult? When it is practically pseudo-random and therefore structured, and by knowing $s$ (the seed) you can get the rest of the numbers, because according to this answer, what I understand is that the main difficulty is not because of the single-qubits gates are randomly chosen, but the main difficulty is because of the high dimension of the problem and the matrix multiplication in these dimensions are difficult to perform for a classical computer.(I've already read this answer but I don't quite understand)
And the last question is, what does instance mean in the figure above? Is the bar chart of each instance obtained by repeating a large number of measurements on a same circuit with the same value $s$?
"
['ibm']," Title: Error while running the circuit on a real device on IBMQBody: I have been trying to run a circuit on ibmq_16_melbourne. But the result shows ERROR_RUNNING_JOB. The run status says:
'Circuit runtime is greater than the device repetition rate [8020]'.
Here are a few circuit details:
Size (total number of gates): 14137
Depth: 7836
Qubits: 14
Shots: 64
Gate count: [('u1', 7506), ('cx', 5850), ('u2', 678), ('x', 73), ('cswap', 18), ('h', 6), ('measure', 6)]
It runs fine on the qasm_simulator. I could not find how to deal with this kind of error. Can some tell what does it mean and how to fix it?
"
"['quantum-gate', 'complexity-theory', 'quantum-fourier-transform']"," Title: How to check if a quantum circuit is deterministic?Body: I'm trying to find a way to check if a given quantum circuit is essentially a classical one (up to changes in phase).
Given a description of a quantum circuit by a list (of size $l$) of ordered operations of Hadamard gates and Toffoli gates (i.e, specifying the specific qubits on which they are operated) operating on $n$ qubits, is there an efficient (polynomial in $l,n$) algorithm that finds whether the computation of the circuit on a quantum state which is not a superposition?
That is, check if for $\forall x \in\{0,1\}^n \ \exists y\in\{0,1\}^n$ such that $U|x⟩=|y⟩$, for $U$ that is represented by the given list.
"
"['quantum-state', 'mathematics', 'nielsen-and-chuang', 'superposition']"," Title: Do any two distinct pure states form a basis?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
In Quantum Computation and Quantum Information the authors make the following statement ""[G]iven any basis states $\ket{a}$ and $\ket{b}$ for a qubit, it is possible to express an arbitrary state as a linear combination $\alpha\ket{a} + \beta\ket{b}$ of those states."" They go on to say that if the states are orthonormal, then one can perform a measurement with respect to the $\ket{a}\!, \ket{b}$ basis.
My question is does this imply that any two distinct pure states $\ket{a}$ and $\ket{b}$ form a basis for the Bloch sphere? (I apologize if this might make more sense in reference to a Hilbert space or some other vector space but I haven't gotten to that point in the book yet and have no experience with it otherwise).
It appears that any two distinct pure states are linearly independent, so I would suspect yes, but I do not believe I know enough to prove it.
For example, I attempted to try to transform the state defined by $\ket{\psi} = \frac{\sqrt{2 + \sqrt{2}}}{2}\ket{0} + \frac{\sqrt{2 - \sqrt{2}}}{2}\ket{1}$ into the basis $\{\ket{0}\!, \ \ket{+}\}$ where $\ket{+} = \frac{\ket{0} + \ket{1}}{\sqrt{2}}$. I obtained the following:
$$
\begin{align*}
\ket{\psi} &= \alpha\ket{0} + \beta\ket{1} = \alpha\ket{0} + \beta(\sqrt{2}\ket{+}-\ket{0}) = (\alpha - \beta)\ket{0} + \sqrt{2}\beta\ket{+}\\
&= \frac{ \sqrt{2+\sqrt{2}} - i\sqrt{2-\sqrt{2}} }{2}\ket{0} + \frac{i\sqrt{2}\sqrt{2 - \sqrt{2}}}{2} \ket{+}
\end{align*}
$$
This basis is neither orthogonal nor normal, so we would not be able to make a measurement with respect to it, however I believe that this is still a valid way to represent a state.
As the requirement that the basis be orthonormal in order to perform a measurement with respect to it implies that such bases exist,
I would be interested in an example of orthogonal but not normal basis. I believe that taking two orthogonal bases (antipodal with respect to the bloch sphere), then scaling them, would be sufficient to realize this type of example.
I would also be interested in an example of a normal but not orthogonal basis, however no simple examples come to mind (it may be that there are no simple examples).
"
"['qiskit', 'ibm-q-experience']"," Title: AssertionError: wrong color format 'ansibrightred'Body: I am running my old qiskit code after a very long time it's not running now showing error wrong color format 'ansibrightred' and I don't know why?
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
circuit = QuantumCircuit(2,2)
circuit.h(0)
circuit.cx(0,1)
circuit.measure([0,1], [0,1])
"
['quantum-state']," Title: Can a qubit live in $\mathcal{H}^{\otimes 2^{n}+1}$?Body: A qubit $\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle \in \mathcal{H}^2$. A more general form of $n$-qubits is an element in
$$\mathcal{H}^{\otimes 2^{n}} =
\underbrace{\mathcal{H}^2\otimes\mathcal{H}^2\otimes\ldots\otimes\mathcal{H}^2}_{n \text{ times}}.$$
Is it possible to have a qubit to be in $\mathcal{H}^{\otimes 2^{n}+1}$ i.e. in an odd dimension?
"
"['qiskit', 'measurement', 'simulation']"," Title: Results of SAT on the Qiskit simulatorBody: I computed SAT formula with the Grover search algorithm on the Qiskit simulator with default parameters, but I don't understand why the incorrect solutions don't have a probability of 0?
The SAT formula is $(x_1 \vee x_2) \wedge (x_2 \vee x_3)$.
"
"['quantum-gate', 'algorithm', 'qiskit', 'programming']"," Title: Error in qiskit.aqua.operatorBody: I want to implement this thing:
Operator([[3, Pauli([1,0,0], [0,0,0])], [2, Pauli([0,0,0],[0,0,3])]])
But while doing this there is an error in ""qiskit.aqua.operator""
How can we fix this?
The main problem is to run this notebook completely without any error:
https://gitlab.com/qosf/qml-mooc/-/blob/master/qiskit_version/07_Variational_Circuits.ipynb
If anybody had able to complete this notebook then my all doubts would be cleared.
"
"['hamiltonian-simulation', 'optimization']"," Title: How to convert QUBO problem to Ising Hamiltonian?Body: According to paper Ising formulations of many NP problems an unconstrained quadratic programming problem
$$
f(x_1, x_2,\dots, x_n) = \sum_{i}^N h_ix_i + \sum_{i < j} J_ix_ix_j
$$
can be expressed as Hamiltonian
$$
H(x_1, x_2,\dots, x_n) = -\sum_{i}^N h_i\sigma^z_i - \sum_{i < j} J_i\sigma^z_i\sigma^z_j,
$$
where $\sigma^z_i$ is Pauli $Z$ gate applied on $i$th qubit whereas other qubits are left without change.
I tried to prepare Hamiltonian for simple function
$$
f(x_1,x_2) = 5x_1+x_2-2x_1x_2
$$
as
$$
H = -(5 Z \otimes I + I \otimes Z - 2 Z \otimes Z) = \text{diag}(-4,-6,2,8).
$$
So the minimal eigenvalue is -6 and associated ground state is $|01\rangle = (0, 1, 0, 0)^T$ which is correct as $f(x_1,x_2)$ minimal value is 1 for $x_1 = 0$ and $x_2 = 1$.
However, when I changed $-2x_1x_2$ to $-7x_1x_2$ and the Hamiltonian changed to $\text{diag}(1,-11,-3,13)$, the ground state remainded $|01\rangle$, however, in this case the function has minimum in $x_1 = 1$ and $x_2 = 1$ (i.e. the ground state should be $|11\rangle = (0,0,0,1)^T$).
What did I do (or understand) wrong?
"
"['quantum-gate', 'phase-kickback']"," Title: Phase Kickback and Controlled OperationsBody: I am reading the chapter about phase kickback from ""An Introduction to Quantum Computing"" by Kaye, Laflamme, Mosca. I understand why $U_f :|x \rangle |-\rangle \rightarrow (-1)^{f(x)} |x\rangle |-\rangle$ is correct. But then it is written that $U_f$ can be thought as a 1-qubit operator $\hat{U}_{f(x)}$ acting on the second qubit controlled by the state $|x\rangle$. I don't get why this is true and why the circuits below are equivalent.
For instance if $f(0)=1$, then $U_f:|0\rangle|-\rangle \rightarrow - |0\rangle |-\rangle$, but this is not the case for the circuit given on the right since if $|x\rangle=0$, no operation is applied on the second register.
Can someone show me what I am missing?
"
"['algorithm', 'entanglement', 'simulation', 'information-theory', 'quantum-turing-machine']"," Title: Can every process in nature be simulated by a Turing Machine or a quantum computer?Body: Given any initial condition or value A, A leads to B after a procedure of physics or nature P. Now is there any turing machine or quantum computer that can simulates P,converting A into B? In other word, is any cause-effect relation in nature computable?
"
"['quantum-state', 'circuit-construction', 'hadamard']"," Title: Probabilities does not sum up to 1 in simple circuitBody: I have an issue, perhaps with normalization with the following state. For $\alpha^2 + \beta^2 =1 $, the probabilities in this state does not sum up to 1.
$$|\psi\rangle := \frac{1}{2}\left[\alpha\left(|0\rangle(|x\rangle+|x'\rangle\right) + \beta \left(|1\rangle(|x\rangle-|x'\rangle \right)\right] $$
as $p(0)=\frac{2\alpha^2+2\alpha^2\langle x|x'\rangle}{4}=\alpha^2(\frac{1+\langle x|x'\rangle}{2})$ and $p(1)=\frac{2\beta^2 - 2\beta^2\langle x | x'\rangle}{4} = \beta^2\frac{1-\langle x | x'\rangle}{2}$.
And $p(0)+p(1) = \frac{\alpha^2 + \beta^2 + \alpha^2\langle x| x'\rangle- \beta^2\langle x | x'\rangle }{2} = \frac{1 + (\alpha^2 - \beta^2) \langle x | x'\rangle}{2}$
Long version:
I created the state as follows:
- $|0\rangle |0\rangle$
- Hadamard on first qubit $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)|0\rangle$
- Controlled operations: if 0 on first register I create state $|x\rangle$ otherwise I create state $|x'\rangle$ on second qubit. $\frac{1}{\sqrt{2}}(|0\rangle|x\rangle+|1\rangle|x'\rangle)$
- Now a perform a second Hadamard gate and re-group the terms:
$$ \frac{1}{2}\left[\left(|0\rangle(|x\rangle+|x'\rangle\right) + \left(|1\rangle(|x\rangle-|x'\rangle \right)\right] $$
- Now I am ready to do a rotation on the $Y$-axis of $\alpha$ on the first qubit. This leads to:
$$ \frac{1}{2}\left[\alpha\left(|0\rangle(|x\rangle+|x'\rangle\right) + \beta \left(|1\rangle(|x\rangle-|x'\rangle \right)\right] $$
Perhaps I am doing something wrong with the normalization? But I don't need any normalization factor as $\alpha^2+\beta^2=1$
Thank you.
"
"['quantum-gate', 'quantum-state', 'random-quantum-circuit']"," Title: Help Identifying a Gate In Nielsen and ChuangBody:
I am seeking help to identify the oracle gates listed in this example. I understand that the right-most one is a toffoli gate, but what are the other ones? Specifically, I do not understand what a black versus white circle means for gate representation. This example comes from Nielsen and Chuang page 256
"
"['textbook-and-exercises', 'partial-trace', 'trace-distance']"," Title: Prove that $\operatorname{Tr}_B(O_A M)=O_A\operatorname{Tr}_B(M)$Body: Can someone help me with the following question?
Let $M$ be a general operator on the composite system $\mathcal{H}_A\otimes \mathcal{H}_B$ and let $O_A$ be an operator on $\mathcal{H}_A$. Using the definition of a partial trace that was given in class, together with the properties of the full trace, prove that $Tr_B(O_AM) = O_ATr_B(M)$.
I got stuck here:
$$M = \sum\limits_{\alpha}M^{(A)}_{\alpha}\otimes M^{(B)}_{\alpha}; O_AM = (O\otimes\mathbb{1}_B)M = \sum\limits_{\alpha}OM_\alpha^{(A)}\otimes M_\alpha^{(B)}\rightarrow$$
$$Tr_B(O_AM) = Tr_B\left(\sum\limits_{\alpha} OM_\alpha^{(A)}\otimes M_\alpha^{(B)}\right)=\sum\limits_\alpha Tr_B\left(OM_\alpha^{(A)}\otimes M_\alpha^{(B)}\right)$$$$=\sum\limits_\alpha OM_\alpha^{(A)}Tr\left(M_\alpha^{(B)}\right)$$
Editor's note: the $\mathbb{1}_B$ actually looked more like $\mathbb{R}$ except with a 1; however, I couldn't get the font to work properly in mathjax. Apologies.
"
"['entropy', 'communication', 'information-theory']"," Title: Schumacher compression - comparing with Shannon compressionBody: Background
Shannon's source coding theorem tells us the following. We shall consider a binary alphabet for simplicity. Suppose Alice has $n$ independent and identically distributed instances of a random variable $X\in \{0, 1\}$. Let us call this string $M$. There exists an encoding scheme that allows her to compress this into $m = H(X)$ bits, where $H(X)$ is the Shannon entropy, such that she can later decode it to some $\tilde{M}$. The error she makes will vanish as $n\rightarrow \infty$ i.e. in that limit $\tilde{M} = M$.
Schumacher compresssion is the correct quantum analogue of this. We shall consider qubits for simplicity. Suppose Alice has $n$ independent copies of some qubit state $\rho$ i.e. she holds $\rho^{\otimes n}$. There exists an encoding scheme that allows her to compress these registers into $m = S(\rho)$ qubits, where $S(\rho)$ is the von Neumann entropy, such that she can later decode it to $\tilde{\rho}^n$. As $n\rightarrow\infty$, the error will vanish and $\tilde{\rho}^n = \rho^{\otimes n}$.
The quantum case is interesting because $\rho^{\otimes n}$ may be entangled with some inaccessible system $R$. The encoding and decoding scheme should work such that these correlations are preserved.
Question: What does the encoded state look like?
In the classical case, the encoded string is necessarily a uniformly randomly chosen $m$ bit string. Were this not the case, Alice could compress it further. What is the correct analogue of this result for the quantum case? What we know is that this state must still retain correlations with the inaccessible register $R$ and must have von Neumann entropy of exactly $m$ bits.
My guess
- Is it a uniformly random $m$ qubit pure state? Since the state has to maintain entanglement with $R$ in general, this cannot be the answer.
- A uniformly randomly chosen $m$ qubit mixed state? This seems more plausible and the set of choices depends on how much entanglement the input state $\rho$ shares with $R$.
"
['quantum-gate']," Title: How do I compute the square root of the $Y$ gate?Body: I am trying to compute the square root of the Y gate.
$$Y_\theta =\begin{pmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{pmatrix}$$
There are many ways for doing this. I am keen on just doing the good old diagonalization and taking the square root of the eigenvalues. I compute the determinant of $Y-\lambda I$ and I set it to zero, and I get: $(cos\theta-\lambda)^2 + sin^2\theta=0$. This cannot have solutions, as a square cannot be negative.
What am I doing wrong?
"
['quantum-state']," Title: Generate a quantum state that sums up all permutations of elementsBody: First a definition: Let there be a quantum like that consists of $2^n=N$ partitions each of size $n=\log_2 N$: $$|x_0\rangle|x_1\rangle\cdots|x_{n-1}\rangle = |x_0x_1\dots x_{n-1}\rangle $$
Like in most state preparation schemes I start from $|00\dots0\rangle|00\dots0\rangle\cdots|00\dots0\rangle$ (where every $00\dots0$ represents a binary with $n$ bits, and I don't say that I permute $0$'s, it's just my initial state!). Is there an efficient way to generate to following quantum state:
$$
\sum_{\pi_k\in S_N} |\pi_k(x_0x_1\dots x_{n-1})\rangle,
$$
where $\pi(x_0x_1\dots x_{n-1})$ are all possible $n!$ permutations of $n$ elements. The final state is permutationally invariant under all permutations, but I'm not sure if this can be used for the generation.
I prefer implementations without measurements and no ancilla.
Update: A worked out example, another one and an inefficient way
Starting from the $2$ qubit state $|00\rangle$ I'd like to end with $\frac1{\sqrt 2}(|01\rangle+|10\rangle)$, which is accomplished by the following circuit:
Everything unitary! Since it was addresed in on of the answers: What happens to $|10 \rangle$? It revertibly maps to $\frac1{\sqrt 2}(|01\rangle-|10\rangle)$.
Let's try with $n=4$:
- Let's start again with $$|00\rangle|00\rangle|00\rangle|00\rangle$$
- Create a superposition in the first register:
$$
\frac1{\sqrt 4}(|00\rangle+|01\rangle+|10\rangle+|11\rangle)|00\rangle|00\rangle|00\rangle$$
- Pick one, lets say $|11\rangle$. We need to split the second register in an equal superposition of 3 levels, but in a controlled way. So every unitary in the linked answer needs to be performed controlled by the first register, i.e. doubly controlled. There are four of these operations. Here is the circuit for register 1 and 2:
where I condensed the controlled-split-into-3 gate into a easy-to-replicate block. The Toffoli's after the block take care of the fact that we need to split into varying sets of 3, according to the first register.
EDIT Since they only idle around, I ommitted the third and forth register (qubits 5 to 8) in this step.
- Along the same line for the third register, where we apply $4\cdot3=12$ operations, which split the third register in 2 levels vontrolled by the first and second register.
- Another $24$ operations for the forth register or maybe less because we can skip those who have to end on a $|0\rangle$, because it is already there...
The final state I would get with this procedure, written in decimal basis is
$$\tiny
|3210\rangle+|2310\rangle+|3120\rangle+|1320\rangle+|2130\rangle+|1230\rangle+|3201\rangle+|2301\rangle+|3021\rangle+|0321\rangle+|2031\rangle+|0231\rangle+|3102\rangle+|1302\rangle+|3012\rangle+|0312\rangle+|1032\rangle+|0132\rangle+|2103\rangle+|1203\rangle+|2013\rangle+|0213\rangle+|1023\rangle+|0123\rangle
$$
and in qubit representation:
$$\tiny
|11100100\rangle+|11100001\rangle+|11011000\rangle+|11010010\rangle+|11001001\rangle+|11000110\rangle+|10110100\rangle+|10110001\rangle+|10011100\rangle+|10010011\rangle+|10001101\rangle+|10000111\rangle+|01111000\rangle+|01110010\rangle+|01101100\rangle+|01100011\rangle+|01001110\rangle+|01001011\rangle+|00111001\rangle+|00110110\rangle+|00101101\rangle+|00100111\rangle+|00011110\rangle+|00011011\rangle
$$
This approach extends to an exponential number of multiply controlled operations. Does anyone know if there is a more efficient one?
"
"['quantum-gate', 'circuit-construction']"," Title: How to transform $|00\rangle$ into $\frac{1}{2}(|00⟩ + |01⟩ + |10⟩ + |11⟩)$?Body: I am quite new to Quantum Computing. If we have an input-state $|00⟩$. How could you transform it into the state $$\frac{1}{2}(|00⟩ + |01⟩ + |10⟩ + |11⟩)$$
"
"['quantum-gate', 'simulation', 'nielsen-and-chuang', 'hamiltonian-simulation', 'pauli-gates']"," Title: Question Regarding Simulating Hamiltonian With Quantum CircuitBody: There have been a few other questions about this section of Nielsen and Chuang, but when working through the output of the circuit, there are some inconsistencies that are probably due to some mistep/false assumption of mine, and I can't seem to figure it out.
Suppose we have the Hamiltonian
$$ H = Z_1 ⊗ Z_2 ⊗ \cdots ⊗ Z_n,\tag{4.113}$$
which acts on an $n$ qubit system. Despite this being an interaction involving all of the system, indeed, it can be simulated efficiently. What we desire is a simple quantum circuit which implements $e^{-iH\Delta t}$, for arbitrary values of $\Delta t$. A circuit doing precisely this, for $n = 3$, is shown in Figure 4.19. The main insight is that although the Hamiltonian involves all the qubits in the system, it does so in a classical manner: the phase shift applied to the system is $e^{-i\Delta t}$ if the parity of the $n$ qubits in the computational basis is even; otherwise, the phase shift should be $e^{i\Delta t}$. Thus, simple simulation of $H$ is possible by first classically computing the parity (storing the result in an ancilla qubit), then applying the appropriate phase shift conditioned on the parity, then uncomputing the parity (to erase the ancilla).
Considering the case of n=3, let's say we had $|\psi\rangle = a|000\rangle + b|110\rangle$. The above circuit is supposed to apply $e^{-iZ\otimes Z\otimes Z \Delta t}$ to the three qubits. Using what I've read on tensor products,
$$e^{-iZ\otimes Z\otimes Z t}|\psi\rangle = e^{Z\otimes Z\otimes (-iZ \Delta t)}(a|000\rangle + b|110\rangle)$$
$$= a(e^Z|0\rangle e^Z|0\rangle e^{-iZ \Delta t}|0\rangle)+b(e^Z|1\rangle e^Z|1\rangle e^{-iZ \Delta t}|0\rangle)$$
Using Taylor Series, I found that
$$e^Z|0\rangle = e|0\rangle$$
$$e^Z|1\rangle = \frac{1}{e}|1\rangle$$
$$e^{-iZ \Delta t}|0\rangle = e^{-i\Delta t}$$
$$e^{-iZ\otimes Z\otimes Z t}|\psi\rangle = a(e|0\rangle e|0\rangle e^{-i \Delta t}|0\rangle)+b(\frac{1}{e}|1\rangle \frac{1}{e}|1\rangle e^{-i \Delta t}|0\rangle)$$
$$= ae^2e^{-i \Delta t}(|0\rangle |0\rangle |0\rangle)+b\frac{1}{e^2}e^{-i \Delta t}(|1\rangle |1\rangle |0\rangle) \tag{eq. 1}$$
Once I did this, I attempted to evaluate what the circuit above, presented in Nielsen and Chuang, does to the vector $|\psi\rangle$.
$$|\psi \rangle = (a|000\rangle + b|110\rangle)|0\rangle$$
Since both $|000\rangle$ and $|110\rangle$ are even, we apply $e^{-iZ\Delta t}$ to the aux 4th qubit, so we get:
$$|\psi \rangle = (a|000\rangle + b|110\rangle)e^{-iZ\Delta t}|0\rangle$$
And since we know that $e^{-iZ\Delta t}|0\rangle =e^{-i\Delta t}|0\rangle$
$$|\psi \rangle = (a|000\rangle + b|110\rangle)e^{-i\Delta t}|0\rangle$$
$$= a(e^{-i\Delta t})(|000\rangle) + b(e^{-i\Delta t})(|110\rangle) \tag{eq. 2}$$
But this equation 2 isn't equivalent to equation 1! What exactly am I missing here? The output of the circuit isn't matching up with what happens when I actually put the state $|\psi\rangle$ through that transformation.
"
"['research', 'quantum-walks']"," Title: Speedup for spatial search problem using quantum walksBody: Given a graph $G$ and a set of marked vertices $M$, spatial search problem is the problem of finding a marked vertex. A classical approach is to perform a random walk on the graph to find out a marked vertex, for which the required time is the hitting time of the random walk.
For discrete time quantum walk, Krovi et al. [1] have proven that the hitting time is quadratically faster than the classical random walk when only 1 element is marked. For continous time quantum walks, a similar result is proven by Chakraborty et al. [2]. Recently, Ambainis et al. [3] have showed that for discrete time quantum walks, the speedup holds even when there are more than 1 marked vertices.
Are there any special types of graphs for which the spatial search problem can be solved with exponential speedup compared to classical algorithms?
For instance, for certain types of graphs like the hypercube, random walk spreads exponentially faster [4] but as detecting a marked vertex is not the same thing as finding the marked vertex in the quantum setting, I am not sure if this result implies an exponential speedup for finding a marked vertex.
[1] Krovi, H., Magniez, F., Ozols, M., & Roland, J. 2016. “Quantum walks can find a marked element on any graph”, Algorithmica, 74(2), 851-907.
[2] Chakraborty, S., Novo, L., & Roland, J. (2018). Finding a marked node on any graph by continuous-time quantum walk. arXiv preprint arXiv:1807.05957.
[3] Ambainis, Andris, et al. ""Quadratic speedup for finding marked vertices by quantum walks."" arXiv preprint arXiv:1903.07493 (2019).
[4] Kempe, Julia. ""Discrete quantum walks hit exponentially faster."" Probability theory and related fields 133.2 (2005): 215-235.
"
"['quantum-gate', 'qiskit', 'ibm-q-experience', 'pauli-gates']"," Title: Qiskit flipped representation of qubits in CNOT gate?Body:
The conventional CNOT gate is shown on the right, and the Qiskit version is on the left. Since Qiskit defines it has a flipped representation kindly explain what is happening to the 11 position?
"
"['programming', 'circuit-construction', 'matrix-representation', 'cirq', 'tfq']"," Title: How do you represent one-qubit rotations in two registers as a $4\times 4$ unitary matrix?Body: Let's say you have a circuit that performs a Z-rotation in the first register, and a Y-rotation in second register. How can we express this "moment" in terms of a 4x4 matrix, i.e. a two-qubit gate? My end goal is to express the circuit below in terms of only tfq.util.get_supported_gates :
{cirq.X: 1,
cirq.XX: 2,
cirq.Y: 1,
cirq.YY: 2,
cirq.Z: 1,
cirq.ZZ: 2,
cirq.H: 1,
cirq.CZ: 2,
cirq.CNOT: 2,
cirq.SWAP: 2,
cirq.ISWAP: 2,
cirq.FSimGate(theta=0.123, phi=0.456): 2,
cirq.I: 1,
cirq.PhasedXPowGate(phase_exponent=0.123): 1,
cirq.PhasedISwapPowGate(phase_exponent=0.123): 2}
But I would like to start by understanding how I would represent just the first stacked Y- and Z-rotation in terms of a 4x4 matrix. For each moment, after I have the matrix representation, I plan to use cirq.two_qubit_matrix_to_operations to decompose this quasi-two-qubit operation into Z/XY/CZ gates.
Are either of these the correct representation for $Rz(\gamma)$ and $Ry(\theta)$ rotations in registers one and two respectively?
1.
$$ \begin{pmatrix} \cos{\theta} & -\sin{\theta} & 0 & 0 \\ \sin{\theta} & \cos{\theta} & 0 & 0 \\ 0 & 0 & e^{-i\gamma/2} & 0 \\ 0 & 0 & 0 & e^{i\gamma/2} \end{pmatrix} $$
2.
$$ \begin{pmatrix} e^{-i\gamma/2}\cos{\theta} & 0 & -e^{-i\gamma/2}\sin{\theta} & 0 \\ 0 & e^{i\gamma/2}\cos{\theta} & 0 & -e^{i\gamma/2}\sin{\theta} \\ e^{-i\gamma/2}\sin{\theta} & 0 & e^{-i\gamma/2}\cos{\theta} & 0 \\ 0 & e^{i\gamma/2}\sin{\theta} & 0 & e^{i\gamma/2}\cos{\theta} \end{pmatrix} $$
"
"['quantum-state', 'quantum-fourier-transform']"," Title: A simple question about QFT and CNOTBody: Given two $d$-dimensional states $QFT|i\rangle(i\in\{0,1,2,...,d-1\})$ and $|\varphi\rangle=|0\rangle$. If I perform $CNOT(QFT|i\rangle,|\varphi\rangle)$, and then perform $QFT^{-1}|\varphi\rangle$, can I get $i$ with measurement on$|\varphi\rangle$ in base $\{|0\rangle,|1\rangle,\ldots,|d-1\rangle\}$?
"
"['quantum-state', 'physical-qubit', 'superposition', 'state-preparation']"," Title: How instantaneous is state preparation in a quantum register, if all possible superpositions are to be initialized equally?Body: Before the start of a quantum algorithm qubits need to be initialized into a quantum register. How fast can a quantum register of length $n$ be initialized in a way that all possible superpositions of the $N=2^n$ basis states exist with equal amplitudes.
I ask because I want to find out if there's a standard procedure to put a quantum register in an equal superposition of all possible states simultaneously. I imagine if there isn't a way to do this at once then it would take much longer to prepare say a quantum register of $N=2^{1024}$ basis states than that with $N=2^{256}$ basis states in an equal superposition.
"
"['quantum-gate', 'qiskit', 'entanglement', 'noise']"," Title: What are the possible gates that I can use to vary input states before CNOT?Body: We know that the noise of the $\text{CNOT}$ gate varies depending on the input state before it.
What are the gates that I can put in the place of the 4 identity gates above to change the input state that goes to $\text{CNOT}$?
For example, if I just place a Hadamard gate then $|+\rangle$ state is the input to $\text{CNOT}$ and this might be noisier than other states. What are the possible gates that I can put before $\text{CNOT}$ to vary the input state?
I know that $S$, $T$, $S^\dagger$, $T^\dagger$, $X$, $Y$, and $Z$ gates do not change the $|+\rangle$ state if I put them. and if I use a general u3 gate then Qiskit divides it into multiple gate operations and that can be even noisier to start with.
"
"['quantum-state', 'partial-trace']"," Title: Partial Trace of Werner StateBody: I am trying to trace out the second qubit of the Werner State:
\begin{align}
W &=\frac{1-s}{4}I_{4}+\frac{s}{2}(|00\rangle\langle{00}|+|11\rangle\langle11|+|11\rangle \langle00|+|00\rangle \langle 11|)\\[0.5em]&=
\left(
\begin{array}{cccc}
(1+s)/4 & 0 & 0 & s/2 \\
0 & (1-s)/4 & 0 & 0 \\
0 & 0 & (1-s)/4 & 0 \\
s/2 & 0 & 0 & (1+s)/4 \\
\end{array}
\right)
\end{align}
I write down $I_{4}=|11\rangle \langle11|+|00\rangle \langle00|+|10\rangle \langle10|+|01\rangle \langle01|$ and the result is:
\begin{align}
W&=\frac{1+s}{4}|0\rangle \langle0|\otimes|0\rangle \langle0|+\frac{1+s}{4}|1\rangle \langle1|\otimes|1\rangle \langle1|\\ &+\frac{1-s}{4}|0\rangle \langle0|\otimes|1\rangle \langle1|+\frac{1-s}{4}|1\rangle \langle 1|\otimes|0\rangle \langle0| \\
&+\frac{s}{2}|0\rangle \langle1|\otimes|0\rangle \langle1|+\frac{s}{2}|1\rangle \langle0|\otimes|1\rangle \langle0|
\end{align}
Thus tracing out the second qubit results to:
\begin{align}
W_{A}&=\frac{1+s}{4}|0\rangle \langle0|+\frac{1+s}{4}|1\rangle \langle1|+\frac{1-s}{4}|0\rangle \langle0|+\frac{1-s}{4}|1\rangle \langle1|+\frac{s}{2}|0\rangle \langle1|+\frac{s}{2}|1\rangle \langle0|\\
&=\frac{1}{2}|0\rangle \langle0|+\frac{1}{2}|1\rangle \langle1|+\frac{s}{2}|0\rangle \langle1|+\frac{s}{2}|1\rangle \langle 0|\\
&=\frac{1}{2}\left(
\begin{array}{cc}
1 & s \\
s & 1 \\
\end{array}
\right)
\end{align}.
However the result in the notes seems to be:
\begin{equation}
\left(
\begin{array}{cc}
1/2 & 0 \\
0 & 1/2 \\
\end{array}
\right)
\end{equation}.
I am stuck and I try to find my mistake but i can't. Any help?
"
"['quantum-state', 'probability']"," Title: Is this inequality related to time-energy uncertainty true or testable?Body: Background
It is known:
In all physical systems in which energy is bounded below, there is no
self-adjoint observable that tracks the time parameter t.
However I don't think this forbids any inequality on how much time has passed can be inferred between the time evolution of an eigenstate (position or momentum) $| x \rangle $ and $U(\Delta t)| x \rangle$ where $| x \rangle $ is the position eigenket and $U$ is a unitary operator for a generic Hamiltonian. In light of that I constructed the following inequality.
Question
I can show for a position eigenstate $| x \rangle $ if it evolves in time $U(\Delta t) | x\rangle$ (where $U$ is a unitary operator for a generic Hamiltonian). Then one can bound the time elapsed by finding the probability amplitude $| \langle x | U^\dagger(\Delta t)| x + \Delta x \rangle |^2 $ and $| \langle x | U^\dagger(\Delta t)| x \rangle |^2 $ (where $\Delta x$ is the translation in space by an amount $\Delta x > 0$) and knows in advance the rate of change of momentum $|\langle x | \dot p | x \rangle |$ then one can bound $\Delta t$
\begin{align}
2 \hbar \frac{ | \langle x | U^\dagger(\Delta t)| x + \Delta x \rangle | + | \langle x | U^\dagger(\Delta t) | x \rangle| }{\Delta x|\langle x | \dot p | x \rangle | } \geq \Delta t \tag{1} \end{align}
Similarly for a momentum eigenstate $|p \rangle $ and the rate of change of position $|\langle p | \dot x | p \rangle |$:
\begin{align}
2 \hbar \frac{ | \langle p | U^\dagger(\Delta t) |p + \Delta p \rangle | + | \langle p | U^\dagger(\Delta t) | p \rangle| }{\Delta p|\langle p | \dot x | p \rangle | } \geq \Delta t \tag{2} \end{align}
Is there any realistic experiment one can do to realise this quantum mechanical watch-stop?
Proof
Consider the following limit:
\begin{align} \lim_{\delta x \to 0} \frac{| x + \delta x \rangle - | x \rangle}{\delta x} = \frac{i}{\hbar}\hat p |x \rangle \tag{3} \end{align}
Similarly:
\begin{align} \lim_{\delta t \to 0} \frac{U(\delta t)| x \rangle - | x \rangle}{\delta t} = \frac{-i}{\hbar}\hat H |x \rangle \tag{4} \end{align}
Hence, we multiply the first two equations (adjoint of one times the other) and substract:
\begin{align}
& \lim_{\delta x,\delta t \to 0 }\frac{\langle x |U^\dagger (\delta t)| x + \delta x \rangle - \langle x + \delta x| U(\delta t)| x \rangle-\langle x |U^\dagger (\delta t)| x \rangle + \langle x | U (\delta t) |x \rangle}{\delta x \delta t} \\ &= - \frac{1}{\hbar^2} \langle x | [ \hat H,\hat p] | x \rangle \tag{5}
\end{align}
Using Heisenberg's equation of motion:
\begin{align}
\lim_{\delta x,\delta t \to 0 }\frac{\langle x | U^\dagger (\delta t)| x + \delta x \rangle - \langle x + \delta x| U (\delta t)|x \rangle}{\delta x \delta t}
- \frac{\langle x | U^\dagger (\delta t) | x \rangle - \langle x |U (\delta t)|x \rangle}{\delta x \delta t} = \frac{i}{\hbar}\langle x | \dot p | x \rangle\tag{6}\end{align}
Replacing $\delta x$ and $\delta t$ with finite but small values:
\begin{align}
\frac{\langle x |U^\dagger (\Delta t)| x + \Delta x \rangle - \langle x + \Delta x|U (\Delta t)| x \rangle}{\Delta x \Delta t}
- \frac{\langle x |U^\dagger (\Delta t)| x \rangle - \langle x | U (\Delta t)| x \rangle}{\Delta x \Delta t} \approx \frac{i}{\hbar}\langle x | \dot p | x \rangle\tag{7}\end{align}
Taking the modulus and using the triangle inequality:
\begin{align}
\left | \frac{\langle x |U^\dagger (\Delta t)| x + \Delta x \rangle - \langle x + \Delta x|U (\Delta t)| x \rangle}{\Delta x \Delta t}
\right | + \left | \frac{\langle x |U^\dagger (\Delta t)| x \rangle - \langle x | U (\Delta t)| x \rangle}{\Delta x \Delta t} \right | \geq \frac{i}{\hbar} | \langle x | \dot p | x \rangle | \tag{8} \end{align}
Let us consider square of the first term:
\begin{align}
T_1^2 = \left | \frac{\langle x |U^\dagger (\Delta t)| x + \Delta x \rangle - \langle x + \Delta x| U (\Delta t)|x \rangle}{\Delta x^2 \Delta^2 t} \right |^2 = \frac{2 | \langle x | U^\dagger (\Delta t) | x + \Delta x \rangle |^2 - \langle x |U^\dagger (\Delta t)| x + \Delta x \rangle^2 - \langle x + \Delta x| U (\Delta t) |x \rangle^2}{\Delta x^2 \Delta t^2} \tag{9} \end{align}
We use the following inequality which uses $| \langle x |U^\dagger (\Delta t)| x + \Delta x \rangle| = |z|$, $ \langle x |U^\dagger (\Delta t)| x + \Delta x \rangle = z$ and $ \langle x + \Delta x |U(\Delta t)| x \rangle = z^*$ with $z = a+ib$:
\begin{align}
\frac{4 | \langle x| x + \Delta x \rangle |^2 }{\Delta x^2 \Delta t^2} \geq T_1^2 \tag{10} \end{align}
Since all quantities are positive:
$$ \frac{2 | \langle x| U^\dagger (\Delta t) | x + \Delta x \rangle | }{\Delta x \Delta t} \geq T_1 \tag{11} $$
Similarly, we define:
\begin{align}
T_2 = \left | \frac{\langle x | U^\dagger (\Delta t) | x \rangle - \langle x | U (\Delta t)|x \rangle }{\Delta x \Delta t} \right | \tag{12} \end{align}
Then,
\begin{align}
\frac{ 2 | \langle x | U^\dagger (\Delta t) | x \rangle| }{\Delta x \Delta t} \geq T_2 \tag{13}\end{align}
Hence, substituting the $T_1$ and $T_2$ inequality:
\begin{align}
\frac{2 | \langle x | U^\dagger (\Delta t) | x + \Delta x \rangle | }{\Delta x \Delta t} + \frac{ 2 | \langle x | U^\dagger (\Delta t)| x \rangle| }{\Delta x \Delta t} \geq \frac{1}{\hbar} |\langle x | \dot p | x \rangle | \tag{14} \end{align}
Or in terms of $\Delta t$:
\begin{align}
2 \hbar \frac{ | \langle x | U^\dagger (\Delta t)| x + \Delta x \rangle | + | \langle x | U^\dagger (\Delta t) | x \rangle| }{\Delta x|\langle x | \dot p | x \rangle | } \geq \Delta t \tag{15} \end{align}
Similarly for momentum eigenkets:
\begin{align}
2 \hbar \frac{ | \langle p | U^\dagger(\Delta t) |p + \Delta p \rangle | + | \langle p | U^\dagger(\Delta t) | p \rangle| }{\Delta p|\langle p | \dot x | p \rangle | } \geq \Delta t \tag{16} \end{align}
"
"['programming', 'd-wave', 'qubo', 'pyqubo']"," Title: Inequality constraints on D-Wave (using PyQUBO)Body: Inequalities cannot be directly converted into a QUBO form. By inequality, I mean something like this:
0⩽ Expression ⩽ N.
We can introduce a slack variable and convert it to an equality problem:
⟹ Expression + s = N
where:
s ∈ Z,
s ∈ [0,N]
Since the slack variables, being encoded on a quantum computer, can hold only discrete values(0, 1, 2...N) the expression also must be of a discrete nature and be of the same values(0, 1, 2...N) to satisfy the constraint.
How to encode inequality constraints when the expression is discrete but the values of the expression have sporadic (and maybe unknown) intervals(0, 1.2, 1.5, 3.8....N).
"
"['ibm', 'superconducting-quantum-computing']"," Title: Is every computer in IBM's fleet based on superconductivity?Body: I'm currently writing my thesis and I'd like to know which computer is based on a superconductive architecture to run some simulations.
Thanks for help in advance.
"
"['speedup', 'quantum-advantage']"," Title: Can quantum computers speed up parsing?Body: Can quantum computers offer Grover-like speed ups in parsing of context-free languages? For instance, general CFLs can be parsed in $O(n^3)$ with standard algorithm like https://en.wikipedia.org/wiki/CYK_algorithm. Could Grover's algorithm be used to speed up the search at each level of the CYK table to produce an $O(n^2)$ algorithm?
It doesn't appear anyone has published anything on parsing speed-ups.
"
"['algorithm', 'resource-request', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Getting started with Quantum Machine LearningBody: I have some working knowledge in Machine Learning and Deep Learning. I am currently in the process of studying Quantum Computing fundamentals.
I would like to know whether there are any Quantum Machine Learning beginner level resources I can read on?
Appreciate if any one can share any articles/books/courses/lecture notes I can read in the subject.
Thanks a lot!
"
"['quantum-gate', 'textbook-and-exercises', 'matrix-representation', 'hadamard', 'linear-algebra']"," Title: Mistake in using dirac notation when applying $X$ gate to vectorBody: The X gate is given by $\big(\begin{smallmatrix}
0 & 1 \\
1 & 0
\end{smallmatrix}\big)$ in the computational basis. In the Hadamard basis, the gate is $X_H = \big(\begin{smallmatrix}
1 & 0\\
0 & -1
\end{smallmatrix}\big) = |+ \rangle \langle +| - |-\rangle \langle-|$. When I apply the gate to the Hadamard basis vectors, the vectors should flip, and they do when I use matrix notation but not when I'm using dirac notation. I know I'm making a mistake somewhere.
$X_H |+\rangle = (|+ \rangle \langle +| - |-\rangle \langle-|)|+\rangle = |+ \rangle \langle +|+\rangle - |-\rangle \langle-|+\rangle = |+\rangle(1) - |-\rangle(0) = |+\rangle$ and
$X_H |-\rangle = (|+ \rangle \langle +| - |-\rangle \langle-|)|-\rangle = |+ \rangle \langle +|-\rangle - |-\rangle \langle-|-\rangle = |+\rangle (0) -|-\rangle(1) = -|-\rangle$
Meanwhile, in matrix notation,
$X_H|+\rangle = \big(\begin{smallmatrix}
1 & 0\\
0 & -1
\end{smallmatrix}\big) \frac{1}{\sqrt{2}}\big( \begin{smallmatrix}
1 \\
1
\end{smallmatrix}\big) = \frac{1}{\sqrt{2}}\big( \begin{smallmatrix}
1 \\
-1
\end{smallmatrix}\big) = |-\rangle
$
$X_H|-\rangle = \big(\begin{smallmatrix}
1 & 0\\
0 & -1
\end{smallmatrix}\big) \frac{1}{\sqrt{2}}\big( \begin{smallmatrix}
1 \\
-1
\end{smallmatrix}\big) = \frac{1}{\sqrt{2}}\big( \begin{smallmatrix}
1 \\
1
\end{smallmatrix}\big) = |+\rangle
$
"
"['programming', 'qiskit', 'ibm-q-experience', 'ibm']"," Title: Kernel stopping when solving water molecule ground stateBody: I'm new to QISKIT Aqua and I'm trying to follow the Ground State tutorial to solve the Water molecule ground state, but when I execute the calculations the kernel stops.
I'm using IBM Q Experience jupyter notebooks and the only thing I changed from the original tutorial is the molecule. I Changed it by excluding the previous molecule and adding this to the code:
import numpy as np
angle = np.deg2rad(104.45/2)
dist = 0.9584
molecule = Molecule(geometry=[['O', [0., 0., 0.]],
['H', [dist*np.sin(angle), -dist*np.cos(angle), 0.]],
['H', [-dist*np.sin(angle), -dist*np.sin(angle), 0.]]],
charge=0, multiplicity=1)
"
"['programming', 'qiskit', 'ibm-q-experience', 'vqe']"," Title: Increase maximum shots on IBM Hardware when running Quantum Variational AlgorithmsBody: I am interested to know whether there is a quick and elegant way of increasing the number of shots (more than 8192 shots) on IBM hardware when running variational algorithms like VQE or QAOA.
I know that within Qiskit, I can specify:
backend._configuration.max_shots= shots to change the number of max_shots but this only works for simulator. I can't increase the shots parameter to go over 8192 shots when I set my backend as one of the real hardware. That is, if I specify the following:
hardware_backend = provider.get_backend('ibmq_valencia ')
maxshots = 20000
hardware_backend._configuration.max_shots= maxshots
quantum_instance = QuantumInstance(hardware_backend, shots = maxshots, initial_layout = None,
optimization_level = 3)
then upon executing the circuit, I will have an error message:
Error is : The number of shots in the Qobj (20000) is higher than the number of shots supported by the device (8192).
Is there a quick and elegant way to overcome this issue within Qiskit? Thank you!
"
"['quantum-gate', 'fidelity']"," Title: How to Aggregate Multiple Gate FidelitiesBody: The fidelity of a qubit is nicely defined here and gate fidelity as "the average fidelity of the output state
over pure input states" (defined here).
How can one combine the fidelies of two (or more) gates to get a combined total gate fidelity? As in, if a qubit is operated on by two (or more) gates, how can we calculate the expected fidelity of the qubit (compared to its original state) after being operated on by those gates if all we know is the gate fidelity of each gate?
I imagine it is deducible from the definition of qubit fidelity... I haven't been able to figure it out. I also did a lot of searching online and couldn't find anything. I prefer the definition on the wikipedia page: $F(\rho, \sigma)=\left|\left\langle\psi_{\rho} \mid \psi_{\sigma}\right\rangle\right|^{2}$ for comparing the input state to the output state. It is easy to work with. A solution explained in these terms is much preferred.
"
"['algorithm', 'complexity-theory', 'speedup', 'deutsch-jozsa-algorithm']"," Title: What kind of boolean functions are faster to compute on qc?Body: Deutsch-Jozsa algorithm can compute if some function $f : \{0,1\}^n \rightarrow \{0,1\} $ is constant. This goes exponentially faster than on classical computers.
If we consider the set of all boolean functions $f : \{0,1\}^n \rightarrow \{0,1\} $ is there a characterizations or intuition about the properties of boolean functions, which achieve such a speedup compared to classical computations?
Consider for example the AND gate, which ANDs all $n$ inputs. I don't know if this is faster on quantum computer, but if yes what does both functions share in common and if not what is different here compared to the constant testing function?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'inner-product']"," Title: Compute the squared overlap between different given qubit statesBody: I was checking this problem from the book. And here is an example, but I think it's wrong. If it is not wrong can you please explain how did they derive it?
As per my workout, it should be one. But It seems they are doing something fishy here.
To be honest I would be surprised if this book is giving wrong solutions.
"
"['programming', 'qiskit', 'ibm-q-experience', 'noise']"," Title: Qiskit: simulate a circuit using a backend noise modelBody: from qiskit import *
def random_bitstring_generator(bit_number, backend):
bitstring = ""
one_qubit_random_bit_generator_circuit = QuantumCircuit(1, 1)
one_qubit_random_bit_generator_circuit.h(0)
one_qubit_random_bit_generator_circuit.measure(0, 0)
for _ in range(bit_number):
counts = execute(one_qubit_random_bit_generator_circuit, backend, shots=8192).result().get_counts()
bit = list(counts.keys())[0]
bitstring += bit
return bitstring
backend = BasicAer.get_backend('qasm_simulator')
print(random_bitstring_generator(1024, backend))
- How can i insert a noise model replicating IBM melbourne quantum machine for the circuit execution on simulator
- Is there a way to be able export the sequence received as output to an text/csv file
"
"['programming', 'ibm-q-experience']"," Title: I am uploading a CSV file but cannot access it in the notebookBody:
I uploaded a CSV file using import in Quantum Computing Lab folder. It is uploaded, I can see it. When I write "import filename" in my notebook, it shows an error.
I have tried doing the same in my local PC. It is working fine.
What am I doing wrong? Is there any other way to upload a CSV file and use it?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Qiskit issues with Apple Silicon?Body: Edit/summary
Everything below this first paragraph is my original question posted several days ago and involves a lot of speculating on a problem I knew less about at the time. The purpose of this first paragraph is mainly to rephrase my question more concisely in light of what I have learned since then. In summary, I had this issue where most code would run fine, except certain code in Qiskit seemed to run unreasonably slowly on the M1 architecture. I was not sure if this was due to Qiskit or one of its dependencies. I was able to track down that it is fermion to qubit operator mapping functions (and anything that utilizes them in any way, such as the UCCSD ansatz variation form) that run slowly. Everything else that I have checked seems to run fine. When I track the performance of lines of code involving these functions with time.perf_counter() and time.process_time(), the perf_counter time will be several times that of process_time, indicating to me that for some reason, the total program run time is much longer than the actual CPU processing time for these specific functions. For Intel-based machines, these two time measures are roughly the same, with perf_counter usually being a fraction of a second more. For code run on the M1 for which there are no run time issues, these two time measures are also roughly the same. Why this happens is a mystery to me and I would be interested in finding out why this happens, if this issue occurs for other functions, and if we can expect this to improve with future versions of Qiskit and other Python open source packages where this problem might also occur. The thing I plan to do next is to see if such fermion to Qubit operator mapping problems happen for other open source quantum computing packages such as OpenFermion as well.
Original Question:
Recently I upgraded my laptop and got a MacBook Pro with the M1 chip and have been playing around with Qiskit and other python code to make sure that everything runs fine so that I can make an informed decision as to whether or not I should return it. The first thing I did with this machine was to install the latest version of Anaconda, PySCF, and Qiskit. I have been going through the tutorials on the Qiskit documentation site. Everything has been working fine, until I tried to run the noiseless part of the code provided at:
https://qiskit.org/documentation/tutorials/algorithms/03_vqe_simulation_with_noise.html
If I run this code on the Jupiter notebooks provided by Anaconda, it takes about 10 minutes to finish and activity monitor indicates it uses about 30% of the CPU load on my computer. If I run the same code on the Jupyter notebooks provided by the IBM Quantum Experience Quantum Lab, it finishes in less than a minute and uses up no noticeable load on my CPU. The main bottleneck of this code seems to be on the line:
result = vqe.compute_minimum_eigenvalue(operator=H2_op)
If I change the backend from qasm_simulator to statevector_simulator, the code completes almost instantaneously. I have also tried running a code I wrote several months ago that calculates the dissociation curves of the first few energy levels of H2 using the QEOM algorithm provided by Qiskit. For both the qasm and statevector simulator backends, the code is painfully slow. For comparison, I ran it on my 2013 MacBook Pro and it was about 30 times faster than the 2020 M1.
I have my suspicions as to why this is, but I would like to find out exactly what the issue is. There appears to be no explicit compatibility issues. The python packages install fine and the code will run, but some code seems to run extremely slowly. My understanding is that Python 3.9.1rc1 is optimized for Apple silicon chips, but 3.9.0 and all other previous versions are not and have to use Rosetta 2:
https://www.python.org/downloads/release/python-391rc1/
The latest version of Anaconda seems to use python 3.8.5, probably because not all of the packages that it comes with are compatible with python 3.9.0 or 3.9.1rc1 yet. Is optimization the issue here or is it something else? If so, can we expected Anaconda to be updated to python 3.9.1rc1 in the near future? If this is the case, I can probably just be patient and wait it out since the IBM Quantum Experience Jupyter notebook servers seem to do the job just fine. (Maybe the code here is run on an external server and this is why, but I'm not sure.) Is the problem something with the backends in Qiskit or with one of the dependencies that variational algorithms in Qiskit use such as the Scipy optimizers? Are there any tests that I could run to find out exactly which packages are the problem? So far the only issues I have found involve variational algorithms on Qiskit, but I will keep searching.
Samples of code
Below are examples of code taken from the Qiskit tutorials where I seem to have this problem. Code involving Aer not involving chemistry classical and quantum eigenvalue problems seem to not have this problem.
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit.chemistry.transformations import FermionicTransformation, FermionicQubitMappingType
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
from qiskit.chemistry.algorithms.ground_state_solvers import GroundStateEigensolver
import time
toc = time.perf_counter()
molecule = Molecule(geometry=[['H', [0., 0., 0.]],
['H', [0., 0., 0.735]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER)
vqe_solver = VQEUCCSDFactory(QuantumInstance(BasicAer.get_backend('statevector_simulator')))
calc = GroundStateEigensolver(transformation, vqe_solver)
toc = time.perf_counter()
res = calc.solve(driver)
tic = time.perf_counter()
print('program completed in {} seconds'.format(tic-toc))
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit.chemistry.transformations import FermionicTransformation, FermionicQubitMappingType
from qiskit.aqua.algorithms import NumPyMinimumEigensolver
import time
molecule = Molecule(geometry=[['H', [0., 0., 0.]],
['H', [0., 0., 0.735]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER)
numpy_solver = NumPyMinimumEigensolver()
calc = GroundStateEigensolver(transformation, numpy_solver)
toc = time.perf_counter()
res = calc.solve(driver)
tic = time.perf_counter()
print('program complered in {} seconds'.format(tic-toc))
Tests
I have run this code on my M1 laptop, 2013 Intel-based laptop, and the IBM Jupyter servers and have used both time.perf_counter() and time.process_time() to track the performance of code on all three machines. On code where the M1 performs fine, these times are roughly the same on all three machines, but on code where the M1 appears to not perform well, perf_counter will be several times that of process_time on the M1. (e.g. CPU time roughly 0.7 seconds and total time 20 seconds for the first code given above) It appears that for certain code in Qiskit, the majority of the time taken to complete the code is spent on something other than CPU processing time and I do not know why. I don't have any other computational tasks going on in the background and CPU load is only about 3% or so when I'm not running code, so I do not think something like having lots of tabs open is responsible for this.
"
"['quantum-gate', 'quantum-state']"," Title: Explanation of NOT gate in Hadamard basisBody: So I am reading this book and I found this worked out example which I didn't get. If you understand these bits of pieces, can you please let me know.
Question:
Answer:
- Why is there two
H over here? I thought it would be just H * Cnot?
- Where from do we get these representations?
"
['deutsch-jozsa-algorithm']," Title: Why isn't output of Deutsch–Jozsa Algorithm simply $|0\rangle$?Body: If I look at the circuit diagram of the Deutsch–Jozsa Algorithm:
Now given the fact that Hadamard matrix or gate is its own inverse (see here), shouldn't the output (top wire) simply give back $|0\rangle$?
"
"['programming', 'algorithm']"," Title: Differences between Extractors and Privacy Amplification for Quantum Random GeneratorsBody: We know that for the last step of QRNG: we need to separate quantum and classical noises from each other so we use extractors, after extractor we need privacy amplification step. At this point:
if extractor is a strong extractor we can use it as a privacy amplification too. However I could not understand differences between extractor and privacy amplification. If I use the strong extractor for the second time, will I be able to complete my privacy amplification step?
What will change in privacy amplification?
If what happens, privacy amplification will be completed?
Thanks
"
"['quantum-state', 'measurement', 'textbook-and-exercises', 'hadamard']"," Title: How does the outcome of measurement of a qubit change when we use different basis despite the system hasn't changed?Body: Let's assume that the quantum state of the system is written in a standard basis {$|0\rangle, |1\rangle$} and when we performed a measurement we got $|0\rangle$ as an outcome of measurement so we ensure that the system will be in state $|0\rangle$ after measurement even if we make this measurement (in this basis) many times.
My question is, how we get something else than $|0\rangle$ {$|+\rangle$ or $|-\rangle$} when we are measuring in different basis {$|+\rangle, |-\rangle$} despite we didn't change the system?
"
['error-correction']," Title: Arbitrary error correctable iff Pauli error are: misunderstanding from Preskill notesBody: I am following Preskill notes.
What I want to understand is why it is in general enough to be able to correct n-qubit Pauli errors to say that an arbitrary error can be corrected.
I call: $\mathcal{M}(\rho)=\sum_a M_a \rho M_a^{\dagger}$ an error map, $C$ the code space.
A CPTP recovery operation exists if and only if, the Kraus operator of the error map verify the Knill-Laflamme condition:
$$\forall (i,j) \in C : \langle \overline{i} | M_{\delta}^{\dagger} M_{\mu} | \overline{j} \rangle = C_{\delta \mu} \delta_{ij}$$
With $C_{\delta \mu}$ an Hermitian matrix and $\langle \overline{i} | \overline{j} \rangle=\delta_{ij}$ (the family $| \overline{i} \rangle$ forms an orthonormal basis of $C$).
My question
From this condition, and the fact any Kraus operator can be decomposed as a sum of n-qubit Pauli matrices, Preskill seem to say that it shows that if one is able to correct against Pauli error it is able to correct against an arbitrary error (that verifies Knill Laflamme condition of course).
I call $\mathcal{E}$ the set of n-qubit Pauli operators on which we can decompose any of the $M_a$'s.
He says on page 10, just below (7.26)
"since each $E_a$ in $\mathcal{E}$ is a linear combination of $M_{\mu}$'s, then"
$$\forall (i,j) \in C: \langle \overline{i} | M_{\delta}^{\dagger} M_{\mu} | \overline{j} \rangle = C_{\delta \mu} \delta_{ij} \Rightarrow \forall (i,j) \in C: \langle \overline{i} | E_{a}^{\dagger} E_{b} | \overline{j} \rangle = C_{ba} \delta_{ij}$$
And I don't understand this. I could imagine $\mathcal{M}(\rho)=U \rho U^{\dagger}, U \notin \mathcal{E}$ (a unitary error that is not strictly a Pauli one). Wouldn't this be a counter example in which the Pauli matrix on which the error can be decomposed cannot in turn be expressed in function of Kraus operator.
To say things more shortly: is there an easy way to show that if one is able to correct Pauli error we can show it is equivalent to Knill Laflamme condition?
"
['error-correction']," Title: Degenerated vs non degenerated code: for both there always exist Kraus bringing to different orthogonal subspaces?Body: Context of my question
I call: $\mathcal{M}(\rho)=\sum_a M_a \rho M_a^{\dagger}$ an error map, $C$ the code space.
A CPTP recovery operation exists if and only if, the Kraus operator of the error map verify the Knill-Laflamme condition:
$$\forall (i,j) \in C : \langle \overline{i} | M_{\delta}^{\dagger} M_{\mu} | \overline{j} \rangle = C_{\delta \mu} \delta_{ij}$$
With $C_{\delta \mu}$ an Hermitian matrix and $\langle \overline{i} | \overline{j} \rangle=\delta_{ij}$ (the family $| \overline{i} \rangle$ forms an orthonormal basis of $C$).
From this condition we can distinguish two cases:
- Non degenerated quantum code: $C_{\delta \mu}=\delta_{\delta \mu}$
- Degenerated quantum code otherwise
Additional remarks
There always exist a set of Kraus operator such that $C_{\delta \mu} = C_{\delta} \delta_{\delta \mu}$: using the freedom to choose the Kraus we can show that diagonalizing $C$ on the rhs, is equivalent to take another set of equivalent Kraus operator on the lhs. I can edit with the derivation if necessary but it is really just a matter of writing the thing. Thus for any map $\mathcal{M}$, we can in principle have a set of Kraus satisfying:
$$\forall (i,j) \in C : \langle \overline{i} | M_{\delta}^{\dagger} M_{\mu} | \overline{j} \rangle = C_{\mu} \delta_{\delta \mu} \delta_{ij}$$
The distinction between degenerated and non degenerated can then be rephrased as:
- Non degenerated quantum code: $C_{\mu}=1$
- Degenerated quantum code otherwise
My question
Because of this last remark, it shows that there always exist a set of Kraus operator such that an error map satisfying Knill-Laflamme condition would bring two different codeword to two orthogonal subspace (we can generalize by linearity to any two vector living in $C$).
Thus for me what remains is that the "conceptual" difference between degenerated and non degenerated code is that:
Whatever the Kraus we use to represent the map, each Kraus of a non degenerated code will always put two different error into two orthogonal subspace.
For degenerated code it is not always the case but there exists a set of Kraus such that it is the case. And for those the difference is that the length of the vector will be modified in a different manner for each different kind of Kraus.
Would you agree ?
Can we give a physical meaning to this change in length when we work with "the good Kraus" for degenerated code ?
"
"['programming', 'qiskit', 'shors-algorithm']"," Title: Shor's implementation problem on qiskitBody:
- If
q4-7 are all supposed to be eigenstates of the operation, why is it just that q7 is in $|1\rangle$? Shouldn't all qubits 4 to 7 be in the $|1\rangle$ state to kick back phases from the $Rz$ gates applied?
- I'm trying to see what's inside each of those controlled operations, and as observed below it's a bunch of swap gates. How do swap gates do any meaningful computation? How do they kickback an important phase? I was expecting same quantum gates applied on the eigenstate such that an important phase gets kicked up, so I don't see the point in swap gates.
"
"['qiskit', 'programming', 'quantum-circuit']"," Title: How can I fix this parametrization error in Qiskit?Body: I'm trying to use the parametrized circuits to run a single model of quantum circuit with different values. Here's part of my code:
from qiskit import IBMQ
provider = IBMQ.load_account()
sim = provider.backends.ibmq_qasm_simulator
backend = provider.get_backend('ibmq_qasm_simulator')
probsu = []
for i in range(L):
circuit = circuit.assign_parameters({Ei: EWi[i]})
circuit = qc(Ei)
job_manager = IBMQJobManager()
**MExperiment = job_manager.run(circuit, backend=backend, name='MExperiment')**
result = MExperiment.result()
Ta = '1'*N
counts = result.get_counts(circuit)
if Ta in counts:
prob = counts[Ta]/sum(counts.values())
else:
prob = 0
probsu.append(prob)
Where qc(Ei) is a function of the quantum circuit model. EWi is an array of possible parameters that will be used. An error occurred at the line marked with **. Here's what qiskit shows me:
CircuitError: "Cannot bind parameters (['Ei']) not present in the circuit."
I'm not exactly sure, but it looks like parameterization requires the label 'Ei' to appear in the circuit. However, my circuit function takes the argument to accept some input like Ei. Is there a way I can fix this error? Thanks a lot for your help:)
"
"['quantum-gate', 'quantum-state', 'superposition', 'foundations']"," Title: Superposition of quantum gatesBody: In the standard model of quantum computation a gate is a unitary that acts on a subsystem. Physically, it can be implemented by some device. Now, any device is also a part of our quantum world, thus it has a quantum state. This quantum state, in theory, can be in superposition with some other state. For example, it can be in a superposition with a state of device that implements different unitary gate.
The question is, are there some rigorous theoretical considerations of what superposition of gates is and how we can model its effect on a quantum state?
"
"['qiskit', 'shors-algorithm', 'quantum-circuit']"," Title: How does this represent modular multiplicationBody: How does this circuit map $|x\rangle$ to $|7x \space mod15\rangle$? Looking into Shor's and I thought that phase kickback causes the modular exponentiation part to be mapped onto the measurement qubits through the Fourier basis.
"
"['measurement', 'textbook-and-exercises']"," Title: How changing the basis of measurement produces a state which is not in the possible system states?Body: Consider we have a quantum system which has two possible states (as double-slit experiment):
- the photon could be pass through the first slit
- the photon could be pass through the second slit
And we decided to represent the first state as $|0\rangle$ and the second state as $|1\rangle$. Assume that the quantum state is in a superposition state $|\psi\rangle=\sqrt(1/2) |0\rangle + \sqrt(1/2) |1\rangle$. So, we have a probability 50% to get $|0\rangle$ as outcome and also a probability 50% to get $|1\rangle$ as outcome.
Then we measured the state of the system in the standard basis {$|0\rangle,|1\rangle$} and get $|0\rangle$ as outcome.
My question is, how we can get $|+\rangle$ as outcome if we measured in basis {$|+\rangle,|-\rangle$}? in other words, our system has only two states $|0\rangle$ (first slit) and $|1\rangle$ (second slit) so how by changing basis we get state which is not one of the two possible states of our system {$|0\rangle,|1\rangle$}?
I know that I miss something important regarding concept of measurement but I am beginner and would like to clearly understand this concept.
"
"['qiskit', 'programming']"," Title: How can I run a set of circuits, each of which has 100 shots?Body: I'm running simulations of my quantum circuit, which includes both parametrized variables and random numbers. The question I'm trying to solve is that for each parameterized variable, I will generate a set of quantum circuits, each element of which contains different random numbers. I'm hoping to run each quantum circuit in the set with 100 shots, then carry out some analyses on the counts. I'm not exactly sure how I can do that, here's part of the code I have:
from qiskit import IBMQ
provider = IBMQ.load_account()
sim = provider.backends.ibmq_qasm_simulator
backend = provider.get_backend('ibmq_qasm_simulator')
E = np.linspace(-5,5,10) # Parameters
circuits = []
nuni = 10. # Number of the circuits in each set.
for i in range(10):
circuitsi = []
for j in range (nuni):
circuit = QuantumCircuit(qrz,crz)
circuit = qc(E[i]) # qc is a function with both parameters and random numbers.
circuitsi.append(circuit)
circuits.append(circuitsi)
for i in range (len(circuits)):
for j in range (nuni):
circuits[i][j] = transpile(circuits[i][j],backend=backend)
for i in range (10):
job_manager = IBMQJobManager()
MExperiments = job_manager.run(circuits[i], backend=backend, shots = nshot)
results = MExperiments.results()
for j in range (nuni):
counts = results.get_counts(circuits[i][j])
My current code doesn't quite work, I'm wondering am I on the right track? How can I fix my code? Thanks a lot for your help:)
Update: My code works, but it takes a really long time to run. I'm still wondering if there's a simpler way to carry out the experiment? Thanks!
"
"['quantum-gate', 'programming', 'qiskit']"," Title: How do Hadamard and CNOT gates work on Qiskit SDK? Why is the output reversed?Body: Here is the code that I have been using on IBM Q Experience (should be the latest version of Qiskit). From my understanding it seems like the outputs of Hadamard and CNOT gates are reversed in a 2-qubit system in Qiskit: A Hadamard gate operating on state 0 actually acts on state 1 and vice versa, similarly with a CNOT gate. Is there something wrong with my understanding? The comments in my code summarize the output results I find surprising.
%matplotlib inline
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from iqx import *
from qiskit.quantum_info import Statevector
sv01 = Statevector.from_label('01')
print(sv01)
plot_state_qsphere(sv01.data)
h0circuit = QuantumCircuit(2)
h0circuit.h(0)
h0circuit.draw("mpl")
final01 = sv01.evolve(h0circuit)
print(final01)
plot_state_qsphere(final01.data)
#Shouldn't the output be state 1/sqrt(2) (|01> + |11>) ????
#And why is the phase on the state |00> pi?
#Shouldn't the phase be pi for |01> instead on the qsphere (ambiguous, probably doesn't matter)?
h1circuit = QuantumCircuit(2)
h1circuit.h(1)
h1circuit.draw("mpl")
final01 = sv01.evolve(h1circuit)
print(final01)
plot_state_qsphere(final01.data)
#Shouldn't the output be state 1/sqrt(2) (|00> - |01>) ????
#Conclusion of the above. An H gate on qubit 0 seems to apply to qubit 1. An H gate on qubit 1 seems to apply to qubit 0.
sv01 = Statevector.from_label('01')
print(sv01)
plot_state_qsphere(sv01.data)
c0xCircuit = QuantumCircuit(2)
c0xCircuit.cx(0,1)
c0xCircuit.draw('mpl')
final01 = sv01.evolve(c0xCircuit)
print(final01)
plot_state_qsphere(final01.data)
#Shouldn't this result be |01> ?
c1xCircuit = QuantumCircuit(2)
c1xCircuit.cx(1,0)
c1xCircuit.draw('mpl')
final01 = sv01.evolve(c1xCircuit)
print(final01)
plot_state_qsphere(final01.data)
#Shouldn't this result be |11> ?
#Conclusion of the above. The cnot (0,1) gate actually acts as a cnot (1,0) gate. The cnot (1,0) gate actually
#acts as a cnot (0,1) gate. The states 0 and 1 are flipped somehow.
```
"
"['textbook-and-exercises', 'density-matrix', 'information-theory']"," Title: Pure state ensembles achieving the Holevo $\chi$-quantity with at most $d^2$ statesBody: Theorem 8.10 in Chapter 8 of Theory of Quantum Information asserts that the Holevo capacity of a quantum channel (between density operators on $\mathbb{C}^d$) can be achieved by an ensemble consisting of ${d^2}$ pure states.
The proof for general ensembles is a nice application of the conditions under which the Holevo information is convex (Proposition 5.48) along with Proposition 2.52 which is essentially a consequence of Catheodory's theorem and the space of density operators having real vector space dimension $d^2-1$ and therefore we can always pick the ensemble to have at most $d^2$ states.
I can also see that any value achieved by an ensemble of mixed states can be achieved by one of consisting only of pure states. My problem is that I can't see why this optimal pure state ensemble also has the $d^2$ bound on the number of states in the ensemble. Any insight into this argument would be appreciated.
"
['quantum-fourier-transform']," Title: How does the QFT represent the frequency domain?Body: QFT is often explained through the classical analogue which converts a certain function from the time domain to the frequency domain. When looking at the discrete Fourier transform, it makes sense to see a sin wave become a spike at a certain frequency.
However, I don't see how this "frequency domain" notion applies to the quantum fourier transform. How does the Fourier basis represent this frequency domain?
If we apply a QFT on a quantum "sin wave" will it output a certain frequency?
"
"['qiskit', 'ibm-q-experience']"," Title: how to generate a random sequenceBody: def random_bitstring_generator(bit_number, backend):
bitstring = ""
one_qubit_random_bit_generator_circuit = QuantumCircuit(4,4)
one_qubit_random_bit_generator_circuit.h(3)
one_qubit_random_bit_generator_circuit.measure(3,3)
for _ in range(bit_number):
counts = execute(one_qubit_random_bit_generator_circuit, backend, shots=8000).result().get_counts()
bit = list(counts.keys())[0]
bitstring += bit
return bitstring
from qiskit.providers.aer import QasmSimulator
provider = IBMQ.load_account()
ibmq_melbourne = provider.get_backend('ibmq_16_melbourne')
backend = QasmSimulator.from_backend(ibmq_melbourne)
print(random_bitstring_generator(512, backend))```
Using the above code,
I am only getting an output bit string with all 0's even with changing number of shots.
what is the error leading to incorrect output.
I am trying to generate a long random sequence
"
"['gate-synthesis', 'hhl-algorithm']"," Title: Gate-level implementation of Eigenvalue-Inversion in HHLBody: I am trying to understand how does the gate-level implementation of eigenvalue-inversion step in the HHL algorithm works.
I am following this reference, where it is stated (Lemma 4) that this can be accomplished by the use of controlled rotations:
$$ U_\theta: |\widetilde{\theta} \rangle |0 \rangle \rightarrow |\widetilde{\theta} \rangle \left(\cos \widetilde{\theta} |0\rangle + sin \widetilde{\theta} |1 \rangle \right ) $$
$$U_\theta = \sum_{\widetilde{\theta} \in \{0,1\}^n} |\widetilde{\theta}\rangle \langle \widetilde{\theta}| \otimes \exp \left(-i \widetilde{\theta} \sigma_y \right) $$
where $\widetilde{\theta}$ is the n-bit finite precision representation of the angle $\theta$, and $\sigma_y$ the Y Pauli matrix.
My question is, how are the rotation angles $\widetilde{\theta}$ for the unitary $U_\theta$ calculated/applied without a-priori knowledge of the eigenvalues $\lambda_j$ of the system matrix $A$?
I understand that the state-vector $|\widetilde{\theta} \rangle$ is obtained in the previous step of the algorithm by extracting the eigenvalues $|\lambda_j \rangle$ of $A$ using QPE (and then applying an inverse + arcsin function as described here), but I am not sure how are these angles also applied as the parameters for the controlled-rotation gates (exponent parameter in $U_\theta$.)
FYI, I did see this other post where it is stated: "You... ...have (at least a good approximation to) your eigenvalues recorded on a register. If you control off that register, you can use it to decide the angle of the rotation for each eigenvector."
So my question is how do you "use it [the register containing $|\widetilde{\theta} \rangle$] to decide the angle of the rotation [$\widetilde{\theta}$ in the $\exp$ function of $U_\theta$]"?
Thanks!
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'bell-basis']"," Title: EPR Experiment: What does it mean for Alice to measure $\vec{v} \cdot \vec{\sigma}$ on her qubit?Body: I am trying to understand Box 2.7 on page 113 of Quantum Computation and Quantum Information book by Nielsen and Chuang. They start out with following wave function:
\begin{equation}
\psi = \frac{|01\rangle-|10\rangle}{\sqrt 2}
\end{equation}
Now let $\vec{v} = k(2,3,5)$ where $k$ is just normalization factor (equal to $\frac{1}{\sqrt {38}}$) so that length of $\vec{v}$ is 1. Can someone now tell me what does it even mean that Alice will measure $\vec{v} \cdot \vec{\sigma}$ on her qubit?
And what happens when Bob measures $\vec{v} \cdot \vec{\sigma}$ on his qubit?
I am looking for a worked out answer with numbers in it rather than mathematical symbols.
"
"['quantum-gate', 'matrix-representation']"," Title: Is there a name for the 3-qubit gate that does NOT NOT NOTHING?Body: It seems to me that the "disjunction gate" (aside: is that its proper name?) can be thought of as the combination of three gates, G1, G2, and G3, where G2 is the CCNOT gate, and $G1 = G3 = ¬_a \otimes ¬_b \otimes I_c$. For context, see the bottom two rows of the following figure that I created in draw.io:
Is there a name for the gate $¬_a \otimes ¬_b \otimes I_c$ (the one I'm calling NaNbIc)?
"
"['error-correction', 'resource-request', 'stabilizer-code', 'fault-tolerance']"," Title: Transversal logical gate for Stabilizer (or at least Steane code)Body: I know that for Steane code, we can implement transversally some gates like cNOT, Hadamard and Pauli.
What I am looking for is a resource in which it is explained why implementing those gate give rise to the good logical operation.
If this is a result more general than Steane I would be interested in a "general enough" approach showing it.
"
"['algorithm', 'vqe']"," Title: Applications of pauli operator grouping for simultaneous measurement in VQEBody: I have read some papers talking about Pauli operator grouping for simultaneous measurement in VQE. I was wondering can this "simultaneous measurement" approach be used in other variational quantum algorithms? Like variational quantum classifier?
"
['density-matrix']," Title: What is the largest absolute value attainable by an off-diagonal real or complex component of a $4 \times 4$ density matrix?Body: To repeat the titular question: "What is the largest absolute value attainable by an off-diagonal real or complex component of a $4 \times 4$ density matrix?"
"
"['textbook-and-exercises', 'bloch-sphere', 'hadamard']"," Title: Show that the Hadamard gate is equivalent to a 180 degree rotation of a certain axisBody: Show that the Hadamard gate is equivalent to a 180 degree rotation about the axis defined by $(\vec{e_x} - \vec{e_z}) / \sqrt{2}$ where $\vec{e_x}$ and $\vec{e_z}$ are unit vectors pointing along the x and z axes.
I can visualize that this is true based off the mapping of the computational basis vectors to the Hadamard basis vectors on the bloch sphere but I don't know how to show this mathematically.
"
"['programming', 'qiskit', 'vqe']"," Title: Run VQE for parametrized quantum circuit with ancilla qubitsBody: Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ansatz and plug it into the built-in VQE in qiskit?
A little more context is the following. I would like to realize a quantum circuit consists of a linear combination of two unitary operators, such as $I+g$ where $I$ is the identity operator and $g$ is the translation operator that moves the qubits as $q_0\rightarrow q_1,q_1\rightarrow q_2,q_2\rightarrow q_0$. According to this paper, https://arxiv.org/abs/1202.5822, it is possible to do so with an ancilla qubit, see Fig. 1 and Eq. 3. But suppose I would like use the resulting circuit as a variational ansatz, how can I do that? If there is an approach to realize $I+g$ without ancilla qubit, I will be very happy to learn that!
from qiskit.circuit import ParameterVector
from qiskit import QuantumCircuit
theta = ParameterVector( 'theta' , 2 )
qc = QuantumCircuit( 3 )
q = qc.qubits
qc.h(q)
qc.crx( theta[0] , q[0], q[1] )
qc.cry( theta[1] , q[1], q[2] )
qc.draw('mpl')
"
"['quantum-state', 'bloch-sphere']"," Title: What makes representing qubits in a 3D real vector space possible?Body: Qubits exist in a 2D complex vector space, but we can represent qubits on the Bloch sphere as a 3D real vector space. Mathematically, what makes this possible – why don't we need 4 real dimensions?
"
"['programming', 'qiskit', 'quantum-operation', 'matrix-representation', 'pauli-gates']"," Title: Qiskit PauliWeightedOperator in the matrix representation?Body: Suppose we have a PauliWeightedOperator object from Qiskit. Is there any built-in method to convert it to the matrix representation in the computational basis? My search in the docs was not successful.
"
['quantum-gate']," Title: What is the control qubit in this 1D ladder of controlled Z gates?Body:
In the picture above, the last layer with dot-shape, is called 1D ladder of controlled Z gates. It is stated in this paper to show the barren plateau issue. I want to know which is the control qubit, the higher one or the lower one?
"
"['textbook-and-exercises', 'tensor-product', 'hadamard', 'quantum-circuit']"," Title: Show that the two circuits are equivalent mathematicallyBody: This exercise wants me to prove the equivalence of the two circuits using their mathematical representations.
Circuit 1:
Circuit 2:
Circuit 1 (q1 CNOT q0) should be represented by $I \otimes P_0 + X \otimes P_1$. Circuit 2 (Hadamard q0 and q1, q0 CNOT q1, Hadamard q0 and q1) should be $(H \otimes H)(P_0 \otimes I + P_1 \otimes X)(H \otimes H)$.
I use the following identities
$$P_0 + P_1 = I = P_{+} + P_{-}$$
$$X = P_{+} - P_{-}$$
$$Z = P_0 - P_1$$
$$P_{+} = HP_0H$$
$$P_{-} = HP_1H$$
where $P_0, P_1, P_{+}, P_{-}$ are $|0\rangle\langle 0|$, $|1\rangle \langle 1|$, $|+\rangle \langle +|$, and $| - \rangle \langle - |$ respectively.
I take circuit 1 and get this:
$$I \otimes P_0 + X \otimes P_1$$
$$= (P_{+} + P_{-}) \otimes P_0 + (P_{+} - P_{-}) \otimes P_1$$
$$= P_{+} \otimes (P_0 + P_1) + P_{-} \otimes (P_0 - P_1)$$
$$= P_{+} \otimes I + P_{-} \otimes Z$$
$$= HP_0H \otimes I + HP_1H \otimes Z$$
Are my circuit representations correct to begin with? If so, should the Z operator be there? Any help would be appreciated.
"
"['quantum-state', 'algorithm', 'hhl-algorithm', 'linear-algebra']"," Title: How to recover the normalization constant of the HHL solutionBody: HHL solves the linear equation $Ax=b$ by the quantum state $|x\rangle=A^{-1} |b\rangle$. However, the quantum state $|x\rangle$ is normalized and thus diffs a normalization constant from the solution vector $x$. My question is how to recover the missing normalization constant?
Especially, HHL is supposed to be applied to a scenario which does not need $x$ itself by some number $x^T M x$. In this case, normalization constant matters to compute $x^TMx$ by $\langle x|M|x\rangle$.
"
"['quantum-state', 'textbook-and-exercises', 'bell-basis', 'linear-algebra']"," Title: How to show that Bell states are orthonormalBody: I was reading some material on QC online and I found some material that explains how to show that Bell states are orthonormal but without details.
I understand that we need to check $\langle state1|state2\rangle = 0$ but I'm not really sure how to calculate that with Dirac notation.
In the link above he somehow omitted the bra and the kets and just used the coefficients directly? I'm not sure I understand... Could someone please clarify a bit more?
"
['error-correction']," Title: Necessary and sufficient condition to define logical operation (stabilizer code)Body: My question is highly related to this topic
It is about defining logical operation on a Stabilizer code.
I call $S$ the stabilizer group of a code space $C$, and I assumed it is generated by a family $S=\langle s_1,...,s_p \rangle$. I call $G_n$ the $n$-Pauli matrix group ($n$ being the dimension of the full Hilbert space).
A definition of logical operation is as follow:
$U_L$ is a logical operation if $\forall |\psi \rangle \in C$, $U_L | \psi \rangle \in C$
And, we realize that if $|\psi \rangle$ is stabilized by $g$, $U_L |\psi \rangle$ will be stabilized by $U_L g U_L^{\dagger}$.
Questions: which condition to ensure $U_L$ is a logical operation
A sufficient condition is to have $U_L S U_L^{\dagger} = S$, which means that $U_L \in N(S)$ (where $N(S)$ is the normalizer of $S$).
Indeed, this way we would be certain that $U_L |\psi\rangle$ will be stabilized by $S$ and thus be in the codespace.
What disturbs me is that according to the comments here (and some of the sources attached), the logical operation are actually exactly elements of $N(S)$. I see the sufficient condition but not the necessary one.
For instance, if $U_L$ is non clifford, for $s \in S$, $U_L s U_L^{\dagger}$ might not even be an n-Pauli matrix, thus $U_L S U_L^{\dagger} \neq S$ as $S \subset G_n$. In this case obviously $U_L$ wouldn't be in the normalizer of $S$. But wouldn't it be possible to have a non n-Pauli matrix that still stabilize appropriately $C$ ?
So my question is: Why is it sufficient and necessary to have $U_L \in N(S)$ so that $U_L$ is a logical operation ?
"
"['error-correction', 'universal-gates', 'fault-tolerance', 'clifford-group']"," Title: Understanding transversal gates for the 7 qubit steane codeBody: How can one derive the complete list of transversal operators for the 7-qubit Steane code? I can derive the Clifford operators that are transversal, but I do not understand an easy way to check for non-Clifford transversal operators, and some idea on how to do this in general would be helpful. If there is a reference that would help.
"
['quantum-state']," Title: What is the probability of error in quantum fingerprinting using cswap test?Body: In quantum fingerprinting, the states are sent to a 3rd party in order to verify if both qubits match or not. To do so, a swap test is needed by the 3rd party.
I read some information on swap test including this link here and I noticed that the probability of cswap test is:
If $|\phi _{x}\rangle =\ |\phi _{y}\rangle$ then we observe a 0 with $prob(0) = 1$ according to wikipedia.
So I was wondering what are the probabilities of a false positive and false negative in quantum fingerprinting?
According to what I saw I'm guessing:
- Probability to get a false positive (a 0 even if both states don't match) is 1 - P(getting 0) so it's 0?
- Probability of getting a false negative (a 1 even if both states match) is 1/2?
But I'm not sure if my conclusion is correct, could someone please confirm this and give some explanation?
"
"['programming', 'resource-request']"," Title: What is the best learning path for quantum computing?Body: Looking for a starter point for a professional training as a Quantum Computer programmer. Is a master in Computer Science XOR Applied Physics a good starting point?
"
['error-correction']," Title: Proper definition of logical operation in Q.E.CBody: My question is related to this topic
I consider working with error correcting code on which I want to define logical operations.
Let's assume I want to define a logical operation on logical qubit. In the context of Stabilizer code we would have to make sure that this operation acts in the code space as explained here.
But this is not enough, we must also verify that the logical gate, once ensured it preserves the code space does the appropriate operation.
Some general requirements
I call $A$ the gate I want to implement logically under $A_L$. I call $C$ the code space.
One condition I must have is to ensure: $\forall |\psi \rangle \in C, A_L |\psi \rangle \in C$.
But this is not enough, I must "preserve" the action of this operation on the logical space.
One necessary condition would be to make sure that:
$$ \forall X: [A,X] \rightarrow [A_L,X_L]$$
I don't know how to phrase it precisely mathematically but basically it is to say that the commutator of $A$ with any other operator has the same "shape" as in the logical space.
And as $n$-Pauli matrices form a basis of $U(n)$, I guess this condition would by linearity be equivalent to say:
$$ \forall E \in G_n, [A,E] \rightarrow [A_L, E_L] $$
Where $G_n$ is the $n$-Pauli matrices group. But still: is ensuring commutation rule enough or is it only necessary to preserve the meaning of the operation ?
My question in the end
What is a rigorous way to define logical operation on a quantum error correcting code. And if there are some "nice" equivalent way to define them I would be interested to know them. If we cannot be absolutely general, I will be fine with a definition for Stabilizer codes.
"
"['circuit-construction', 'measurement', 'deferred-measurement']"," Title: Are there any algorithms that take measurements in an intermediate step?Body: As a beginner in quantum computation, I noticed that all quantum algorithms take various gates followed by measuring the qubits in the last step. Is it always the case? Are there any algorithms that take measurements in an intermediate step?
"
"['entanglement', 'measurement', 'bell-basis']"," Title: Trouble understanding the EPR ExperimentBody: I fail to understand the EPR experiment. From Wikipedia:
Alice now measures the spin along the z-axis. She can obtain one of
two possible outcomes: +z or −z. Suppose she gets +z. Informally
speaking, the quantum state of the system collapses into state I. The
quantum state determines the probable outcomes of any measurement
performed on the system. In this case, if Bob subsequently measures
spin along the z-axis, there is 100% probability that he will obtain
−z. Similarly, if Alice gets −z, Bob will get +z.
I emphatically do not reproduce above claim. As example I consider measurement of spin along an arbitrary axis. Specially I consider measuring spin along $\vec{v} = \frac{1}{\sqrt{38}}(2,3,5)$ and with input state $\psi = \frac{1}{\sqrt 2}(|01\rangle - |10\rangle)$. Here are my steps:
- Alice wants to measure spin along $\vec{v}$. This means we create the observable $M = \vec{v} \cdot \vec{\sigma}$ where $\vec{\sigma}$ is the vector of individual Pauli matrices i.e., $\vec{\sigma} = (X , Y , Z)$.
- $M$ is a $2\times2$ matrix and $\psi$ is a $4\times1$ vector. To make a measurement corresponding to $M$ on the first qubit we need to create a tensor product of $M$ with the $2\times2$ identity matrix $I$. So let $O = M \otimes I$.
- Now to perform the measurement we will do a eigen decomposition of $O$. Note that gives me 4 eigenvalues not 2. Its true that there are 2 unique eigenvalues $\{+1, -1\}$ and I understand these to mean spin "up" or spin "down".
- I get following probabilities of the 4 eigenvalues:
Alice's Eigenvalues (i.e., possible measurement outcomes)
[-1.00000000000000, -1.00000000000000, 1.00000000000000, 1.00000000000000]
Alice's probabilities
[0.452776776413453, 0.0472232235865468, 0.0472232235865468, 0.452776776413453]
- Now suppose Alice measures the first eigenvalue $-1$ (spin "down").
- We then collapse the wavefunction $\psi$ to one of the corresponding eigenvectors of $O$. Let $\psi^{'}$ be the collapsed wavefunction after Alice's measurement, which is one of the two eigenvectors of $O$ with eigenvalue $-1$.
- Now Bob will measure spin along the $\vec{v}$ axis on the second qubit. The observable corresponding to this is $O^{'} = I \otimes M$ and input to this observable is $\psi^{'}$.
- And now the kick: when I simulate Bob's measurement I do not get a spin "up" outcome with 100% probability. I find that there are 2 unique eigenvalues associated with non-zero probabilities.
Bob's Eigenvalues
[-1.00000000000000, -1.00000000000000, 1.00000000000000, 1.00000000000000]
Bob's probabilities
[0.00892013138361998, 0.0855263157894737, 0.0855263157894737, 0.820027237037433]
And this is my dilemma.
Can someone explain me what it is that I have done wrong? I would like a worked out answer with numbers in it rather than mathematical symbols. An answer showing what needs to be corrected to my code would be even better.
Aside: If part of the answer is that $O$ should be $M \otimes M$, I emphatically consider that to be cheating. The experiment states:
Alice now measures the spin along the z-axis...
the quantum state of the system collapses into state I...
Bob subsequently measures
spin along the z-axis, there is 100% probability that he will obtain
−z. Similarly, if Alice gets −z, Bob will get +z.
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: Why do the eigenvectors of a spin observable not align with the direction of the spin?Body: The italicized section below is referring to chapter 3 of "Quantum Mechanics: The Theoretical Minimum" by Leonard Susskind and Art Friedman.
It is written that the operator that corresponds to measuring spin in the $\hat{n}$ direction is $\sigma_\hat{n} = n_x X + n_y Y + n_z Z$. The book gives an example where $\hat{n}$ lies in the z-x plane,
$$\hat{n} = \begin{pmatrix}\sin(\theta) \\ 0\\ \cos(\theta)\end{pmatrix}$$
where $\theta$ is the angle between $\hat{n}$ and the $z$ axis. In matrix form, this gives:
$$ \sigma_\hat{n}=
\begin{pmatrix}
\cos(\theta) & \sin(\theta) \\
\sin(\theta) & -\cos(\theta)
\end{pmatrix}
$$
with eigenvalues and eigenvectors $[1,
\big(\begin{smallmatrix}
\cos(\theta/2) \\
\sin(\theta/2)
\end{smallmatrix}\big)]$
and
$[-1,
\big(\begin{smallmatrix}
-\sin(\theta/2) \\
\cos(\theta/2)
\end{smallmatrix}\big)]$.
So, if a state, $|\psi\rangle$, is pointing in the direction $\hat{n}$, it has an angle of $\theta$ from the Z axis, then it's state vector in the Z basis should be $|\psi\rangle =
\big(\begin{smallmatrix}
\cos(\theta) \\
\sin(\theta)
\end{smallmatrix}\big) = \hat{n}$.
Why do the eigenvectors of $\sigma_n$ not align with the vector for $\hat{n}$? My thinking is that measuring the spin in the direction $\hat{n}$ should leave a state either in $\hat{n}$ or a state orthogonal to $\hat{n}$.
My guess is that I'm making a mental error going from the Cartesian system to Bloch Sphere system.
"
['resource-request']," Title: Opportunities in quantum computing for an undergradBody: I am currently an undergrad student in computer engineering in Brazil and I have taken the Quantum mechanics subject as well as I am did a project (the two jupyter notebooks, it's in portuguese though) on quantum computing with a teacher that is currently building one at my college. Apart from the chances I already have of learning about this subject are there other means or opportunities any of you recommend going after?
"
"['quantum-gate', 'circuit-construction']"," Title: Decomposing a $(w+1)$-qubit permutation gate into $w$-qubit permutation gates, SWAPs and NOTsBody: Say I have a quantum circuit of $w+1$ qubits with a permutation gate (mapping computational basis states to computational basis states) that does the permutation $(i, i+1)(i+4, i+5)$ on $w+1$ qubits if $i$ is odd and the permutation $(i+1, i+2)(i+3, i+4)$ if $i$ is even, for some fixed $i$ in the range $1 \leq i \leq 2^W -2$. Is it possible to decompose the $(w+1)$-qubit permutation gate into some $w$-qubit permutation gates, $\mathrm{SWAP}$s and $\mathrm{NOT}$s? How? (Ideally, I'd like to avoid using $\mathrm{SWAP}$s and $\mathrm{NOT}$s due to certain implementation issues.)
I think it should be possible because of Lemma $2$ in the appendix of the paper
Generating the group of reversible logic gates (Vos, Ra & Storme, 2002) (PDF):
The subgroup of exchangers $\mathbf{E}_w$, augmented with the $\text{NOT}$ gate and the $\text{CONTROLLED}^{w−2}$ $\text{NOT}$ gate, generates the group of even simple control gates.
but I'm not sure how to construct the circuit.
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Kraus decomposition for non trace preserving operation: shouldn't we have $0 \leq \sum_k E_k^{\dagger} E_k \leq I$Body: In N&Chuang, on page 368 is written the following theorem:
The map $\mathcal{E}$ satisfies axioms A1,A2,A3 if and only if
$$\mathcal{E}(\rho)=\sum_k E_k \rho E_k^{\dagger}$$
Where $\sum_k E_k^{\dagger} E_k \leq I$
The axiom A2 is convex linearity, the axiom A3 is CP, the axiom A1 is:
Axiom A1: $0 \leq Tr(\mathcal{E}(\rho)) \leq 1$
Shouldn't be added in the theorem: $\sum_k E_k^{\dagger} E_k \geq 0$ as well to ensure the fact the trace can never be negative ? So in the end we would have:
$$0 \leq \sum_k E_k^{\dagger} E_k \leq I$$
"
"['entanglement', 'density-matrix']"," Title: Why do purifications only differ by a local unitary?Body: Let's consider $\rho_A$ a density matrix. I introduce a space $B$ and an entangled state $|\Psi\rangle$ (the purification) so that:
$$\newcommand{\tr}{\operatorname{Tr}}\rho_A = \tr_B(|\Psi\rangle \langle \Psi |_{AB}) $$
Let's consider another purification of $\rho_A$: a vector $|\widetilde{\Psi}\rangle$. By definition we have:
$$ \rho_A = \tr_{B}(|\widetilde{\Psi}\rangle \langle \widetilde{\Psi} |_{AB})$$
I have read that those two states are indeed purification of $\rho_A$ if and only if:
$$ |\widetilde{\Psi}\rangle = I_A \otimes U_B |\Psi\rangle_{AB} $$
I understand the sufficient part, but I don't see why it would be necessary for $ |\widetilde{\Psi}\rangle$ to have this form. Could someone explain me how to get this result ? I found the statement but not a proof for this and I don't manage to find it (I'm probably missing something very obvious)
"
"['deutsch-jozsa-algorithm', 'hadamard']"," Title: Why do multi-bit hadamards expands to what they do?Body: I'm a Computer Scientist undergrad student studying for an exam in Quantum computing. In all of the algorithms I have been studying (Deutsch–Jozsa, Simons, Shors, Grovers) I constantly see multi-qubit Hadamard gates being expended to the normalised sum of all the possible values like so:
$$\left|x\right>\xrightarrow{\mathbb H^{\otimes n}}\frac{1}{\sqrt{2^n}}\sum_{x=0}^{2^n-1}\left|x\right>$$
That makes complete sense to me, however, it's when they perform another hadamard transformation on that state that I get a bit confused with the $(-1)^{x·y}$ that gets multiplied with each part of the superposition like so:
$$\frac{1}{\sqrt{2^n}}\sum_{x=0}^{2^n-1}\left|x\right>\xrightarrow{\mathbb H^{\otimes n}}\sum_{x=0}^{2^n-1}\sum_{y=0}^{2^n-1}\left(-1\right)^{x.y}\left|y\right>$$
where
$$x.y = x_0y_0\oplus x_1y_1\oplus x_2y_2\oplus\ldots\oplus x_{n-1}y_{n-1}$$
I don't quite understand where this $(-1)^{x·y}$ has suddenly appeared from, or I don't have an intuition as to why it is required. My understanding was the performing one Hadamard after another kind of undoes the other?
Any intuition on this would be extremely helpful!
For a full reference I was triggered to ask here after seeing this happen in almost all the algorithms I mentioned above, but most recently here:
Deutsch-Jozsa Algorithm
"
['complexity-theory']," Title: Probabilistic query complexity lower bound for Bernstein-Vazirani problemBody: In the Bernstein Vazirani algorithm, the problem is to find $s$ for $f(x) = s \times x $ , $f : \{0,1 \}^n \to \{0 , 1 \} $. The literature says that the classical randomized algorithms also requires $ \Omega ( n)$ queries. I cannot find a proof for this claim. It seems it has something to do with Yao's principle. Can anybody help me to figure out how to prove this?
Thanks.
"
"['qiskit', 'error-correction']"," Title: How to implement if statement based on measurement results in qiskit?Body: I tried to implement three qubit bit flip code in qiskit and need to get the result of measurements and then apply recovery quantum operations conditioned on the measurement results. The following is a simplified version to initialize a circuit:
q= QuantumRegister(3)
c= ClassicalRegister(3)
qc= QuantumCircuit(q, c)
qc.measure(q,c)
I noticed that this question had a similar question and they transformed the statement
if(c[0]==0) qc.x(q[0])
into
qc.x(q[0]).c_if(c[0], 0)
However, I want to have multiple quantum operations conditioned on the if statement
if c[0]==1 and c[1]==1:
qc.x(q[0])
qc.x(q[1])
can this work with ""c_if""?
"
"['ibm-q-experience', 'quantum-fourier-transform', 'phase-estimation', 'quantum-computing-for-finance']"," Title: Cannot replicate results in article on pricing financial derivatives on IBM QBody: I am trying to implement a circuit for searching for the largest eigenvalue and respective eigenvector of an operator, i.e. phase estimation, introduced in article Towards Pricing Financial Derivatives with an IBM Quantum Computer, page 6, figure 3(a).
The authors of the article use the phase estimation for indentification of the most important component in principal component analysis. In particular, they look for the largest eigenvalue of this matrix
\begin{equation}
\rho=
\begin{pmatrix}
0.6407 & 0.3288 \\
0.3288 & 0.3593
\end{pmatrix}
\end{equation}
The largest eigenvalue of the matrix is 0.8576 with respective eigenvector $(0.8347; 0.5508)^T$.
To search for that, the authors proposed following cicuit
Note that gates denoted by -1.57 and -0.79 are $S^\dagger$ and $T^\dagger$ respecitvelly. They act on ""bottom"" qubit and they are controlled by ""top"" qubit
$U3$ operators implement operator $\mathrm{e}^{2\pi i \rho}$ and its powers.
According to the article, results after measurement should be these:
Note that pink bars are results obtained on simulator, while blue ones on IBMQX2 processor.
Based on these results, the authors concluded that the largest eigenvalue is approximated by value $0.111_2$ (0.875 in decimal which is close to actual value 0.8576).
I tried to replicate their results with this circuit on IBM Q:
Note: please find a code in QASM at the end of the question to see parameters of gates
I received these results on IBM Q simulator.
According to my results, the largest eigenvalue should be zero which does not make sense.
So, my questions are these:
- Where I did a mistake in circuit implementation? My circuit and the author's seems to be the same.
- Why the qubit $|q_3\rangle$ is initialized by gates $Ry$ and $Rz$ with parameter $\theta$ equal to 1.00 and 0.33, respectively? I would expect only gate $Ry$ with $\theta = 1.1665$ as this gate produce the eigenvector $(0.8347; 0.5508)^T$. However, replacement of $Ry(1.00)$ and $Rz(0.33)$ with $Ry(1.1665)$ does not change resulting histogram significantly.
Here is a QASM code of my circuit
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[4];
creg c[4];
h q[0];
h q[1];
h q[2];
ry(1.00) q[3];
rz(0.33) q[3];
cu3(1.6,-1.12,2.03) q[2],q[3];
cu3(2.23,0.51,3.65) q[1],q[3];
cu3(0.8,-4.53,-1.39) q[0],q[3];
h q[0];
cu1(-pi/2) q[0],q[1];
cu1(-pi/4) q[0],q[2];
h q[1];
cu1(-pi/2) q[1],q[2];
h q[2];
measure q[3] -> c[3];
measure q[2] -> c[2];
measure q[1] -> c[1];
measure q[0] -> c[0];
"
"['algorithm', 'qiskit', 'ibm-q-experience']"," Title: Qubit measurement is followed by instructions. Error code: 7006Body: Trying quantum teleportation in
https://github.com/Qiskit/qiskit-textbook/blob/master/content/ch-algorithms/teleportation.ipynb
Succesful runs in 'qasm_simulator', but when switching to IBMQBackend('ibmqx2') I get IBMQJobFailError
"
"['algorithm', 'cryptography', 'communication-complexity']"," Title: Could quantum computers be useful for sending encrypted information over a classical channel?Body: A quantum computer running Shor's algorithm would be famously useful for decrypting information encrypted by many classical public-key cryptography algorithms. Is there any reason (either a specific proposed protocol or a general heuristic argument) to suspect that a quantum computer could be useful for encrypting information in a way that's more secure than is possible with a classical computer with comparable resources? Ideally, secure even against attacks by quantum computers?
I'm not talking about ""physics-based"" quantum encryption schemes like quantum key distribution (discussed here) or other schemes that require transmitting a coherent quantum state over a quantum channel. I'm talking about more traditional ""mathematics-based"" encryption schemes, in which one or both parties have a quantum computer at each end, but they can only transmit the encoded information in the form of classical bit strings over an insecure classical channel (potentially after having transmitted a symmetric key out of band).
This question is inspired by Scott Aaronson's comments here and here on his blog. Apparently people regularly claim that quantum computers (not QKD) could be useful for encryption, but Prof. Aaronson has never understood why.
"
"['programming', 'simulation']"," Title: Monty Hall Problem in Quantum ComputingBody: Is it possible to make a quantum Monty Hall problem where the quantum computer wins the game always?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Pauli I in eoh procedure doesn't become a global phase gate in qiskit evolution_instruction method. Possible consequencesBody: If one has two qubits in arbitrary stats and wishes to apply a controlled version of some global phase gate $P(\varphi) = \begin{pmatrix} e^{i\varphi} & 0 \\ 0 & e^{i\varphi} \end{pmatrix}$ one should obtain:
$$
\left| \psi_0 \right\rangle \left| \psi_1 \right\rangle = \left(c_{00} \left| 0 \right\rangle + c_{01} \left| 1 \right\rangle \right)\left(c_{10} \left| 0 \right\rangle + c_{11} \left| 1 \right\rangle \right) \xrightarrow{\text{CP}
}$$
$$
\xrightarrow{\text{CP}}
c_{00} \left| 0 \right\rangle \left(c_{10} \left| 0 \right\rangle + c_{11} \left| 1 \right\rangle \right) + c_{01} \left| 1 \right\rangle \left(c_{10} e^{i\varphi} \left| 0 \right\rangle + c_{11} e^{i\varphi} \left| 1 \right\rangle \right),
$$
This example shows that in contrast to global phase gate $P$ which doesn't produce any measurable changes in a qubit state, the controlled version of it ($CP$) makes measurable changes in the state of a system of qubits. So it is ok if $P$ is ignored, but it is not ok if $CP$ is ignored (what is happening in the presented code).
Here is a code where I use qiskit.aqua.operators.common.evolution_instruction method, where because of (how I understand) ignoring the global phase gate, the $CP$ gate wasn't obtained (the print(qc.qasm()) command shows no gate is added to the circuit):
import numpy as np
from qiskit import *
from qiskit.aqua.operators import WeightedPauliOperator
from qiskit.aqua.operators.common import evolution_instruction
phase = np.pi
pauli_dict = {'paulis': [{""coeff"": {""imag"": 0.0, ""real"": phase}, ""label"": ""I""}]}
identity = WeightedPauliOperator.from_dict(pauli_dict)
pauli_list = identity.reorder_paulis()
instruction = evolution_instruction(pauli_list, evo_time=1, num_time_slices=1, controlled=True)
q = QuantumRegister(2)
qc_temp = QuantumCircuit(q)
qc_temp.append(instruction, q)
qc = qc_temp.decompose()
print(qc.qasm())
Possible consequences: when I tried to implement IPEA algorithm for $H = \begin{pmatrix} E_1 & 0 \\ 0 & E_2 \end{pmatrix}$ Hamiltonian I was estimating $E_2 - E_1$ instead of estimating $E_2$ eigenvalue. This problem was reported here. Problems may arise also for other quantum algos that use PEA as a subroutine (like HHL algo).
Is this a problem/bug? Are there alternatives to qiskit evolution_instruction method that don't ignore phase gates (or Pauli I operator)?
"
['entanglement']," Title: How to identify entanglement in a given pure state?Body: If I have either of the following states:
$$\left|\psi_0\right\rangle = \frac{1}{2}\left|0000\right\rangle + \frac{1}{2}\left|0011\right\rangle + \frac{1}{2}\left|1100\right\rangle + \frac{1}{2}\left|1111\right\rangle$$
$$\left|\psi_1\right\rangle = \frac{1}{\sqrt{3}}\left|001\right\rangle -\frac{1}{\sqrt{3}} \left|010\right\rangle + \frac{1}{\sqrt{3}}\left|100\right\rangle$$
How can I check to see whether they are entangled or not? I have seen people say that the state $\left|\psi_1\right\rangle$ is entangled because ""there are correlations between the three qubits"", but I can't find what this really means.
"
['hhl-algorithm']," Title: HHL Algorithm: Relation between Eigenvalues and condition numberBody: I have been going through the original HHL paper (2009), and I see that they call a linear system of equations ""well behaved"" / ""well-conditioned"", if
$$ |\lambda| \in \left[\frac{1}{\kappa}, 1\right]$$
where $\kappa$ is the condition number. I am not that strong in Linear Algebra, but it is very obscure to me why they are combining eigenvalues and singular values. Could someone explain why this is being done either in the context of this particular algorithm, or in general?
"
"['quantum-state', 'unitarity', 'hadamard']"," Title: Why is a Hadamard gate unitary?Body: The Hadamard gate is a unitary gate, but how does the matrix times its own conjugate transpose actually result in the $I$ matrix? I am currently looking at it as a scalar, 0.707..., multiplied by the matrix of ones and negative one.
\begin{equation}
H=\frac{1}{\sqrt{2}}
\begin{pmatrix}
1 & 1 \\
1 & -1
\end{pmatrix}
\end{equation}
"
"['quantum-state', 'textbook-and-exercises', 'bloch-sphere']"," Title: Find the $\theta$ and $\phi$ values on the Bloch sphere corresponding to the state $\frac{1+i}{2}|0\rangle+\frac1{\sqrt2}|1\rangle$Body: If I have the following state:
$$
\left| \varphi \right>=\frac{1}{\sqrt{2}}\left(\left(\frac{1+i}{\sqrt{2}} \right)\left| 0 \right> + \left| 1\right>\right)
$$
How can I find the $\theta$ and $\phi$ values of this qubit on the Bloch sphere?
"
"['communication', 'bb84', 'faster-than-light']"," Title: Does the Lieb-Robinson bound constrain the speed of entanglement information transmission?Body: I just learned from the existence of the theoretical Lieb-Robinson bound, which indicates that the speed at which information can be propagated in non-relativistic quantum systems cannot exceed this upper limit. If this is true, then does it mean that the entanglement is not transmitting information? So what does it mean for protocols like BB84 (quantum key distribution)?
"
"['communication', 'superdense-coding']"," Title: What is the practical interest of superdense coding?Body: When you enter the field of quantum communications, you run at some point into the concept of superdense coding.
Basically it is a way to encode classical bits on the qubits of a quantum channel, which sounds interesting in the first place to increase classical throughput by benefitting of the exponential growth of the Hilbert space with multiple qubits.
Yet when you look at the protocol in more detail, you understand that even though it seems that you have encoded 2 classical bits in 1 qubit, you actually need a second, entangled, qubit to retrieve the information from the 1st qubit.
So there is no real benefit - if you need to send two photons, you can encode two bits classically.
So apart from a textbook example, where is the practical interest? Are there more subtle points I am missing? Are there more intricatre protocols to avoid that?
Cross-posted on math.SE
"
['measurement']," Title: Does the energy of a qubit change when it undergoes a collapse?Body: Can the state of a qubit affect its energy? Please elaborate on your answer
"
"['quantum-state', 'nielsen-and-chuang', 'bloch-sphere']"," Title: what are the angles 𝜃, and ϕ values of the following quantum state?Body: I need to find the coordinate 𝜃 and ϕ values of the quantum state on the bloch sphere
$$
\left| \varphi \right>=\frac{1+i}{\sqrt{3}} \left| 0 \right> + {\sqrt{\frac{1}{3}}} \left| 1\right>
$$
"
"['ibm-q-experience', 'physical-realization', 'architecture', 'research', 'quantum-memory']"," Title: What is the state of the art on Quantum Random Access Memories?Body: I realized that Quantum Random Access Memory (qRAM) was proposed to make quantum computers more similar to classical one. Currently quantum computers have very constrained memory, given only quantum registers on quantum processors can be used for an algorithm to run. It is true that e.g. Qiskit language allows to use RAM or HDD of classical computer, however, resulting algorithms are hybrid quantum-classical.
I found some proposals how to implement qRAM, e.g. here.
But my understanding is that the device is highly experimental nowadays.
So my questions are those:
- Does anybody know about progress in this field? Some links to articles of state-of-art implementation of qRAM will be highly appreciated.
- What about IBM Q? Do we have an opportunity to use qRAM on IBM Q computer in foreseeable future (i.e. few years)?
"
"['quantum-state', 'measurement', 'nielsen-and-chuang']"," Title: Qubit measurement of the state $\frac{1}{\sqrt2}|00\rangle+\frac{i}{2}|01\rangle-\frac{1}{2}|11\rangle$Body: If we measure the first qubit and obtain $|0\rangle$, what does the second qubit collapses to?
$$
\left| \varphi \right>=\frac{1}{\sqrt{2}} \left| 00 \right> + {\frac{i}{2}} \left| 01\right> - {\frac{1}{2}} \left| 11\right>
$$
"
"['circuit-construction', 'nielsen-and-chuang']"," Title: Uncomputation in quantum implementation of a classical algorithmBody: In Nielsens and Chuangs book, they present a way to implement a reversible version of any classical algorithm (section 3.2.5).
In short, they use Fredkin and other simple reversible gates to implement a circuit doing $(x, 0, 0, y) \rightarrow (x, f(x), g(x), y)$ by first copying $x$ to the second register and then using the Fredkin gate equivalent of the classical algorithm to take the second register (now $x$) and the ancilla bits in the third register to $f(x)$ and some garbage $g(x)$.
Then they use $CNOT$ gates to add $f(x)$ to the last register, resulting in $(x, f(x), g(x), y \oplus f(x))$.
I understand that it is now important to uncompute the $g(x)$ garbage bits so that they don't mess with quantum interference that may occur later on the fourth register (the result). So they take the registers back to $(x, 0, 0, y\oplus f(x))$ using the inverse of the Fredkin gate implementation.
Now I am wondering if the following would also work:
Take $(x,0,y)$ to $(f(x), g(x), y)$ using the Fredkin equivalent of the classical algorithm. Then use $CNOT$ gates to go to $(f(x),g(x),y\oplus f(x))$ and then do the uncomputation step as before to get $(x, 0, y\oplus f(x))$.
This way we save a register. I assume I am either making some mistake on the way or the authors deemed their version easier to understand.
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'ibm-q-experience']"," Title: How to implement the CCH gate in quantum computers available in clouds?Body: How to implement CCH gate in quantum computers available in clouds? If there is not any gate directly available for it, what are the possible ways to represent CCH?
"
"['quantum-state', 'bloch-sphere']"," Title: What is the probability of a single qubit state lying over the surface of Bloch sphere?Body: I want to compute the POVM $E_{(\theta, \phi)}$ of the measure which gives the probability of a qubit state lying over the surface of Bloch sphere, with angles $\theta, \phi$. How can I handle this?
Dividing the surface area through the volume of Bloch sphere seems not to be a solution because it gives and absurd result of 3.
How should I start?
_____EDIT____________
For clarification, I will write down the full statement of the problem:
Find the POVM $E_{(\theta, \phi)}$ of the measure which determines the probability that the state of a qubit is on the surface of the Bloch sphere with polar angle $\theta$ and azimuthal $\phi,$ the relation of completeness being fulfilled in this case:
$$\int d^{2} \Omega E_{(\theta, \phi)}=\mathbb{I}$$
Is that a projective measure? Prove also that:
$$p(\theta, \phi)=\operatorname{Tr}\left[E_{(\theta, \phi)} \rho\right]=\frac{1}{4 \pi}(1+\boldsymbol{r} \cdot \boldsymbol{\Omega})$$
with $r$ being the state's Bloch vector and $\Omega=(\sin \theta \cos \phi, \sin \theta \sin \phi, \cos \theta)$.
Explain why the only determination of the maximum of $p(\theta, \phi)$ allows tomography the state.
I was trying to use the pure state $\rho = \frac{1}{2}\left( \mathbb{I}+\vec{\Omega } \cdot \vec{\sigma} \right)$ as a operator measure for the mixed state $\rho '$ but can't obtain the factor $\frac{1}{4\pi}$.
I hope this update clears up your doubts
"
"['programming', 'ibm-q-experience']"," Title: IBM Quantum Experience API Without QISKitBody: I am a computer science master's student who is doing research in the field of quantum computing. I have an IBM quantum experience account(https://quantum-computing.ibm.com/) and as such I was provided an access token under my account settings page. As a part of my research I would like to be able to interact with the api to submit jobs, check device status, list all devices I have access to etc., using any programming language of my choice.
Unfortunately, I have been having a lot of difficulty interacting with this API due in part to not being able to find any documentation on the API endpoints, how to authenticate with the API etc. Additionally some of the information that I have found appears to be out of date or missing details. For instance, through my own investigations with monitoring network traffic on the quantum experience homepage I have discovered that the API url appears to have changed from https://quantumexperience.ng.bluemix.net/api/ to https://api.quantum-computing.ibm.com/api.
Does anyone have any documentation related to what endpoints are available and what data they return from the API, as well as how to properly authenticate with the API as this would be a great help.
Additionally, my research will involve accurate timing of how long quantum programs take to run. Is there any information either returned from the API jobs, such as the time taken to run the program or in device specifications with average times for gates, measurements, and if statements, so I can at least estimate a total time for my programs?
"
['resource-request']," Title: What is the best way to get into and learn quantum computing for a 14 year old?Body: I have always wanted to do something with computers since I was 2. I have explored all kinds of things in the tech world for a long time. I have also loved physics for a long time. Someone recently suggested that I explore Quantum Computing. I had heard about it a lot beforehand and always thought it sounded fun. I don't really know where to start because I don't know anyone in the field. Does anyone know what the best way is I can start in the field?
"
"['quantum-gate', 'qiskit', 'stabilizer-code']"," Title: How to implement controlled multiqubit gates in qiskit?Body: To implement a stabilizer code I need to measure stabilizer generators, as shown in Fig. 10.16 in Nielsen & Chuang. Is there a way for controlled multiqubit gates in qiskit?
"
['measurement']," Title: Generalized measurement interpreted as entanglement unitary + measurement. Why is it indeed a unitary?Body: A generalized measurement can be defined as follow:
It is a set of operators $\{M_m \}$ such that, given an initial quantum state $|\psi\rangle$, we have the state after measurement being:
$$|\psi\rangle \rightarrow \frac{M_m |\psi\rangle}{\langle \psi | M_m^{\dagger}M_m |\psi\rangle} $$
The probability to find the outcome $m$ is: $p(m)=\langle \psi | M_m^{\dagger}M_m |\psi\rangle$
We can interpret the generalized measurement as entanglement unitary between a system and an ancillary system, and then a measurement on this ancillary system via the following:
$$U |\psi \rangle |0 \rangle = \sum_m M_m |\psi \rangle |m \rangle$$
My question is: how to prove that this $U$ is indeed a unitary ? I guess we also have to define its action on other states than $|0\rangle$ in the ancillary system, but how to do it ?
"
"['error-correction', 'fault-tolerance']"," Title: Why does quantum error correction work?Body: I read about some QEC codes such as Shor code. It encodes a logical qubit to 9 physical qubits, to correct the bit-flip and phase-flip error. To do this, it needs multiple $\mathrm{CNOT}$ and $\mathrm{H}$ gates. As we know, the increase of the number of operations brings errors. How can this procedure then decrease the overall error rate?
"
"['error-correction', 'surface-code']"," Title: Logical qubit initialization for the surface codeBody: I am reading Fowler et al's paper on the surface code.. I do not understand how to initialize a logical qubit in an arbitrary state with the surface code. I do understand how to initialize the qubit in logical $|{0}\rangle$ and $|{1}\rangle$, but not how to initialize in an arbitrary superposition.
In Appendix B he shows that after the measurements in the circuit below,
the middle two qubits are in the one of the following four states:
Can they also be in a superposition of one of these states?
"
"['measurement', 'povm']"," Title: Why are POVMs useful? Are they just an axiomatic way to define measurement?Body: I know the definition of projective measurement, generalized measurement, POVM.
I understand the usage of generalized measurement for the reason that it can model experiments ""easier"" (for example measurement of a photon that will be destructive so that measuring again the state just after the first measurement will give me another answer).
However, I am still kinda confused by why we have introduced the notion of P.O.V.M. For me we have everything we want from generalized & projective measurement.
Would you agree with me if I say that POVM is just an axiomatic way to define statistics of measurement. There is nothing much to understand/overthink.
In the sense, we ask the minimal mathematical properties that our measurement operator must fullfil with respect to statistical behavior which is:
- they are semidefinite positive (to have positive probabilities)
- they sum up to identity (to have probability summing up to $1$)
and we relate our measurement operator with the physics:
$$p(m)=\mathrm{Tr}(E_m \rho)$$ where $m$ is the outcome, $E_m$ the associated POVM.
"
"['quantum-gate', 'circuit-construction', 'ibm-q-experience', 'hadamard']"," Title: Why is implementation of controlled Hadamard on IBM Q so complex?Body: With reference to question how to implement CCH gate I easily realized that CH gate can be implemented with $\mathrm{Ry}$ gates and $\mathrm{CNOT}$ followingly:
Note $\theta = \frac{\pi}{4}$ for first $Ry$ gate and $\theta = -\frac{\pi}{4}$ for second one.
However, when I put $\mathrm{CH}$ gate implemented on IBM Q to circuit, a transpiled circuit has this form:
So, the first circuit has only two one qubit gates whereas the second one has six such gates. If I understand it correctly, any single qubit gate is on IBM Q eventually replaced by $\mathrm{U3}$ gate with respective parameters.
It seems to me that the second circuit is unnecessary complex.
Is there any reason why to implement $\mathrm{CH}$ gate in such way or am I missing something?
"
"['qiskit', 'circuit-construction', 'stabilizer-code']"," Title: Simulation for the [5,1,3] stabilizer code in QiskitBody: Sorry that I keep asking questions for the same subject. It is driving me crazy.
I have followed the [5,1,3] stabilizer code circuit designed by Gottesman in page 35 in his paper (also illustrated in my another question). This code has four stabilizer generators $XZZXI$, $IXZZX$, $XIXZZ$, $ZXIXZ$.
The following is a minimal working example in which I only draw the stabilizer generator $IXZZX$,
from qiskit import *
encoded = QuantumRegister(5,'encoded')
stab = QuantumRegister(4,'stab')
syndr = ClassicalRegister(4, 'syndr')
five = QuantumCircuit(encoded)
fiveS = QuantumCircuit(encoded, stab, syndr)
#----------------------------------encode----------------------------------
five.h(encoded[0])
five.h(encoded[1])
five.h(encoded[2])
five.h(encoded[3])
five.z(encoded[0])
five.z(encoded[3])
five.cz(encoded[0],encoded[1])
five.cz(encoded[0],encoded[3])
five.cy(encoded[0],encoded[4])
five.cz(encoded[1],encoded[2])
five.cz(encoded[1],encoded[3])
five.cx(encoded[1],encoded[4])
five.cz(encoded[2],encoded[0])
five.cz(encoded[2],encoded[1])
five.cx(encoded[2],encoded[4])
five.cz(encoded[3],encoded[0])
five.cz(encoded[3],encoded[2])
five.cy(encoded[3],encoded[4])
five.barrier()
#-------------------stabilizer generator IXZZX------------------------------
fiveS.h(stab[1])
fiveS.cx(stab[1],encoded[1])
fiveS.cz(stab[1],encoded[2])
fiveS.cz(stab[1],encoded[3])
fiveS.cx(stab[1],encoded[4])
fiveS.h(stab[1])
fiveS.measure(stab,syndr)
#----------------circuit visualization--------------------
#%matplotlib inline
#(five+fiveS).draw(output='mpl')
counts = execute( five+fiveS, Aer.get_backend('qasm_simulator'), shots=10000).result().get_counts()
print(counts)
Measuring stabilizer generators should return $0000$ but instead I get half $0000$ and half $0010$ (Same results returns when measuring $XIXZZ$, $ZXIXZ$). Where am I wrong?
Question updated
I tried to add all qubits in one quantum register and produce one quantum circuit.
from qiskit import *
stab = QuantumRegister(9,'stab')
syndr = ClassicalRegister(4, 'syndr')
five = QuantumCircuit(stab, syndr)
#----------------------------------encode----------------------------------
five.h(stab[0])
five.h(stab[1])
five.h(stab[2])
five.h(stab[3])
five.z(stab[0])
five.z(stab[3])
five.cz(stab[0],stab[1])
five.cz(stab[0],stab[3])
five.cy(stab[0],stab[4])
five.cz(stab[1],stab[2])
five.cz(stab[1],stab[3])
five.cx(stab[1],stab[4])
five.cz(stab[2],stab[0])
five.cz(stab[2],stab[1])
five.cx(stab[2],stab[4])
five.cz(stab[3],stab[0])
five.cz(stab[3],stab[2])
five.cy(stab[3],stab[4])
five.barrier()
#-------------------stabilizer generator IXZZX------------------------------
five.h(stab[6])
five.cx(stab[6],stab[1])
five.cz(stab[6],stab[2])
five.cz(stab[6],stab[3])
five.cx(stab[6],stab[4])
five.h(stab[6])
five.measure(stab[5],syndr[0])
five.measure(stab[6],syndr[1])
five.measure(stab[7],syndr[2])
five.measure(stab[8],syndr[3])
#----------------circuit visualization--------------------
#%matplotlib inline
#five.draw(output='mpl')
counts = execute( five, Aer.get_backend('qasm_simulator'), shots=10000).result().get_counts()
print(counts)
However, the same happens. The following are my running results.
"
"['error-correction', 'surface-code']"," Title: Understanding surface code diagramsBody: I originally posted this question on the Physics StackExchange site (see here), but I realized it would be better suited on this one.
I'm trying to understand the diagrams used in the following paper. I'm new to the area so I don't have experience with the stabilizer formalism, but I'm trying to figure out what's going on in the diagrams (Figures 1 and 2, specifically). I have a few specific questions:
- Each vertex has a physical data qubit. But what exactly do the operators (green circles) represent? Is there an X and Z operator on every vertex site, or only some of them (Figure 1b)?
- Relatedly, the logical X and Z operators are specified as chains of single-qubit operators (the green circles, I presume) connecting top to bottom (logical X) or left to right (logical Z). Do these chains have to be straight lines, or can they twist and turn?
- Do the semi-circular plaquettes (which have only two single-qubit operators on them) represent the fact that we are wrapping around the surface (so we are on a torus), or is it something else?
- I don't understand the single-qubit Pauli flips described in Figure 2. I can't see how we get an error (red dot). Any explanation for this would be helpful.
If someone could also explain to me the relationship between the Figure 1 in the above paper and Figure 1 of this paper, I think it would help makes things clearer.
"
"['cryptography', 'key-distribution']"," Title: In the BICONF information reconciliation protocol for QKD: should I also run BINARY on the complementary bits subset?Body: The descriptions of the BICONF information reconciliation protocol in the literature appear to be inconsistent.
All descriptions agree that in each iteration Alice and Bob should select a random subset of bits of the key, that Alice should tell Bob what the correct parity of the chosen subset is, and that Bob should run BINARY on the selected subset if the correct parity differs from the current parity.
However, some descriptions (e.g. [2], [3]) explicitly say that Bob should also run BINARY on the complementary bits subset if the parity differs on the chosen bits subset.
Other descriptions (e.g. [4], [5]) only mention running BINARY on the chosen bits subset and never mention running BINARY on the complementary bits subset.
My questions are:
- Should I or should I not also run BINARY on the complementary bits subset? In other words, which of the two conflicting descriptions is correct?
- If yes, it appears necessary that Alice must also reveal the correct parity of the complementary bits subset (*). The fact that the chosen bits subset contains an odd number of errors says nothing about the number of errors in the complementary bits subset. The number of errors in the complementary bits subset could very well be zero, in which case it is not correct for Bob to run BINARY on the complementary bits subset. Is my understanding correct that more parities will need to be revealed?
- I would like to consult the original paper where BICONF was introduced, which is apparently [1], to see what it says. Is there an online PDF version for this available (I could not find any)?
(*) = Or alternatively, we can infer the correct parity of the complementary subset from the correct parity of the entire key, which in turn can be inferred from the correct parities of all the top-level blocks in the earlier Cascade iterations.
References:
[1] Tomohiro Sugimoto and Kouichi Yamazaki. A study on secret key reconciliation protocol ""cascade"". IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, E83-A(10), 2000.
[2] JesusMartinez-Mateo,ChristophPacher,MomtchilPeev,AlexCiurana,andVicenteMartin. Demystifying the Information Reconciliation Protocol Cascade. arXiv:1407.3257 [quant-ph], Jul 2014. https://arxiv.org/pdf/1407.3257.pdf Section 3.2 page 8: Then, they compute and exchange the parity value of this subset, and perform two dichotomic searches if their parities differ, one for the chosen subset and the other for the complementary subset (i.e., the subset of bits that were not selected).
[3] André Reis. Quantum Key Distribution Post Processing - A study on the Information Reconciliation Cascade Protocol, July 2019. https://repositorio-aberto.up.pt/bitstream/10216/121965/2/347567.pdf Section 3.1.2 page 16: If the parity of Bob’s subset is different, they execute BINARY once for the chosen subset and another for the complementary subset.
[4] Gilles Brassard and Louis Salvail. Secret-Key Reconciliation by Public Discussion. In Advances in Cryptology — EUROCRYPT ’93, pages 410–423. Springer Berlin Heidelberg, Berlin, Heidelberg, 1993. https://link.springer.com/content/pdf/10.1007%2F3-540-48285-7_35.pdf Section 6.2 page 418: Each time CONFIRM shows a subset for which Alice’s and Bob’s string have different parities they run BINARY on this subset and thus correct an error.
[5] Shengli Liu. Information-Theoretic Secret Key Agreement, Feb 2002. https://pure.tue.nl/ws/files/1977072/200210541.pdf. Section 2.3.1 page 22: Then Alice tells Bob the parity of her subset, and Bob checks whether his subset has the same parity. The primitive ends in case of identical parity, otherwise a binary search is performed to locate an error.
"
['qiskit']," Title: Is qiskit_backend_monitor magic function deprecated?Body: I've upgraded qiskit for the first time in a while and I've discovered that the magic function for displaying backend information doesn't seem to work properly.
Here's what I've tried running:
from qiskit.tools.jupyter import *
backend = P[1].get_backend('ibmq_poughkeepsie')
%qiskit_backend_overview
This returns a ZeroDivisionError.
I've also tried calling backend_monitor(backend), but returns a TypeError, saying that 'module' object is not callable.
I've tried looking into what kind of changes might have been made to the library for monitoring backends, but I cannot seem to find the answer I'm looking for. Any help would be much appreciated!
"
"['quantum-gate', 'quantum-state', 'bloch-sphere']"," Title: Simplify the system to find the $\theta$, $\phi$ on bloch sphereBody: I have problem to simplify the quantum system states on bloch sphere to get $\theta$, $\phi$ values,
My question is not duplicated!
$$
\left| \varphi \right>=\frac{1+i}{\sqrt{3}} \left| 0 \right> + {\sqrt{\frac{1}{3}}} \left| 1\right>
$$
"
"['quantum-gate', 'quantum-state', 'unitarity']"," Title: What unitary gate produces these quantum states from the computational basis?Body: Suppose that we have one-qubit unitary $U$ that maps
$$ \left| 0 \right> \longmapsto \frac{1}{\sqrt{2}} \left| 0 \right> + {\frac{1+i}{2}} \left| 1\right> $$
and
$$ \left| 1 \right> \longmapsto {\frac{1-i}{2}} \left| 0 \right> - \frac{1}{\sqrt{2}} \left| 1\right> $$
What is $U$?
"
"['quantum-state', 'bloch-sphere']"," Title: Find coordinates $\theta$ and $\phi$ on the Bloch sphere of a given qubit stateBody: In last time there is a lot of questions how to find $\theta$ and $\phi$ for particular state on Bloch sphere. I think that it would be useful to solve one example to stop stream of very similar questions.
So my question is how to find $\theta$ and $\phi$ on Bloch sphere?
Please demonstrate calculation on this quantum state:
$$
\left| \varphi \right>=\frac{1+i}{\sqrt{3}} \left| 0 \right> + {\sqrt{\frac{1}{3}}} \left| 1\right>
$$
Note to moderators and other users: please do not mark this question as duplicity but rather use it for closing similar questions on Bloch sphere coordinates calculation. It seems that explanation on particular example is asked rather than theoretical method how to solve such problems.
"
"['error-correction', 'superconducting-quantum-computing', 'surface-code']"," Title: How does Surface-17 tell apart Z errors on Db and Dc?Body: I'm looking into this paper from DiCarlo's group Scalable quantum circuit and control for a superconducting surface code. I don't understand how it's supposed to identify specific single-qubit errors, specifically how it tells apart single qubit X or Z errors on the data qubits belonging only to one of the weight-4 syndromes.
Does it? Maybe that's not even required, if it really isn't, why?
"
"['algorithm', 'quantum-state', 'vqe']"," Title: What is a better ansatz for VQE?Body: I am using Qiskit.
I made two quantum circuits to generate $\cos\theta|00\rangle + \sin\theta|00\rangle$ for VQE calculations as follows.
Apparently, the first one which has fewer CNOT gates is better ansatz for calculations. However, I would like to evaluate the efficiency of these circuits qualitatively.
Run time or something?
Thank you.
"
['quantum-state']," Title: What value of K parameter of the following two vectors?Body: I have two vectors:
$$
a=\begin{pmatrix}
{1} & {1} & {1} \
\end{pmatrix} \\
b=\begin{pmatrix}
{1} & {2} & {k} \
\end{pmatrix}
$$
These vectors should be orthogonal. What is value of $k$?
"
"['algorithm', 'neural-network']"," Title: Is there a quantum neural network ""hello world"" for character recognition (convolutional neural networks)?Body: I'm making my way through several neural network examples and libraries. Landing on this nugget, in creating a basic NN for character recognition.
In calculating weights and biases, looking at the graph below, looks oddly familiar in one of the quantum-related problems to solve - minimizing cost functions and finding local minimums.
Is there an equivalent quantum NN for this and are there examples I can begin working with?
My interest here is in how a parallel quantum system can be more efficient with training data over its non-quantum counterpart.
"
"['rigetti', 'pyquil', 'openfermion']"," Title: Error during Forest openfermion installationBody: I tried installing Forest openfermion by
pip install forestopenfermion and I got the following long error message (cut):
Building wheels for collected packages: scipy
Building wheel for scipy (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/michelle/anaconda/envs/py3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '""'""'/private/var/folders/jl/jdqt56zx7nl6czhgp8qhdwd40000gn/T/pip-install-7odaoj4r/scipy/setup.py'""'""'; __file__='""'""'/private/var/folders/jl/jdqt56zx7nl6czhgp8qhdwd40000gn/T/pip-install-7odaoj4r/scipy/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 /private/var/folders/jl/jdqt56zx7nl6czhgp8qhdwd40000gn/T/pip-wheel-8zcv76y9 --python-tag cp37
cwd: /private/var/folders/jl/jdqt56zx7nl6czhgp8qhdwd40000gn/T/pip-install-7odaoj4r/scipy/
Complete output (1015 lines):
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
FOUND:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/michelle/anaconda/envs/py3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/michelle/anaconda/envs/py3/include']
FOUND:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/michelle/anaconda/envs/py3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/michelle/anaconda/envs/py3/include']
Running from scipy source directory.
non-existing path in 'scipy/integrate': 'quadpack.h'
Splitting linalg.interpolative Fortran source files
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
FOUND:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/michelle/anaconda/envs/py3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/michelle/anaconda/envs/py3/include']
FOUND:
libraries = ['mkl_rt', 'pthread']
library_dirs = ['/Users/michelle/anaconda/envs/py3/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/Users/michelle/anaconda/envs/py3/include']
non-existing path in 'scipy/sparse': 'sparsetools/sparsetools_impl.h'
non-existing path in 'scipy/sparse': 'sparsetools/bsr_impl.h'
non-existing path in 'scipy/sparse': 'sparsetools/csc_impl.h'
non-existing path in 'scipy/sparse': 'sparsetools/csr_impl.h'
non-existing path in 'scipy/sparse': 'sparsetools/other_impl.h'
running bdist_wheel
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
creating build
creating build/src.macosx-10.9-x86_64-3.7
creating build/src.macosx-10.9-x86_64-3.7/scipy
building library ""dfftpack"" sources
building library ""fftpack"" sources
building library ""mach"" sources
building library ""quadpack"" sources
building library ""odepack"" sources
building library ""dop"" sources
building library ""fitpack"" sources
building library ""fwrappers"" sources
building library ""odrpack"" sources
building library ""minpack"" sources
building library ""rootfind"" sources
building library ""superlu_src"" sources
building library ""arpack_scipy"" sources
building library ""sc_c_misc"" sources
building library ""sc_cephes"" sources
building library ""sc_mach"" sources
building library ""sc_amos"" sources
building library ""sc_cdf"" sources
building library ""sc_specfun"" sources
building library ""statlib"" sources
building extension ""scipy.cluster._vq"" sources
building extension ""scipy.cluster._hierarchy"" sources
building extension ""scipy.fftpack._fftpack"" sources
creating build/src.macosx-10.9-x86_64-3.7/scipy/fftpack
creating build/src.macosx-10.9-x86_64-3.7/scipy/fftpack/src
conv_template:> build/src.macosx-10.9-x86_64-3.7/scipy/fftpack/src/dct.c
conv_template:> build/src.macosx-10.9-x86_64-3.7/scipy/fftpack/src/dst.c
f2py options: []
f2py: scipy/fftpack/fftpack.pyf
Reading fortran codes...
Reading file 'scipy/fftpack/fftpack.pyf' (format:free)
Line #86 in scipy/fftpack/fftpack.pyf:"" /* Single precision version */ ""
crackline:2: No pattern for line
Post-processing...
And so on... Could somebody help me? Thanks!
"
"['error-correction', 'nielsen-and-chuang', 'noise']"," Title: What kind of errors does the master equation in the Lindblad form describe, continuous errors or discrete errors?Body: I noticed that in page 427 in Nielsen & Chuang's book Quantum Computation and Quantum Information, quantum error correction is possible because errors can be discretized.
In other hand, the master equation in the Lindblad form in the following seems describes errors continuously occurring on qubits,
$\frac{d\rho}{dt}=-i[H,\rho]+\frac{1}{2}\sum_{j}\lambda_j(2L_j\rho L_j^\dagger-L_j^\dagger L_j\rho-\rho L_j^\dagger L_j)$.
I want to say that ""errors can be discretized"" is one of the basis that ""quantum error correction is possible"". But then I found errors described by the master equation can also be corrected and these errors seems like continuous errors to me.
My question is if the bold sentence is wrong or the errors described by the master equation are actually discrete errors?
"
['qiskit']," Title: max_cut in qiskit aquaBody: Happened on some code, which I was hoping would run out of the box. However fails on the import
from qiskit.aqua.translators.ising import max_cut
I've not been able to find the module in the documentation. Any ideas how to solve this? Other then use an earlier version of Qiskit?
I get the following error:
from qiskit.aqua.translators.ising import max_cut
ModuleNotFoundError: No module named 'qiskit.aqua.translators'
"
"['entanglement', 'measurement', 'teleportation', 'entanglement-swapping']"," Title: Problem involving entanglement swappingBody: I'm trying to solve a problem. I have my own approach to it, as the one in the textbook seems overly complicated. I tried using my own approach, but I'm not sure if what I found was a coincidence or not.
Here's the problem (it's in French, I did my best to translate):
Alice and Bob are separated by a distance of $2L$. Suppose that Charlie is in the middle, i.e. he's at a distance $L$ from Alice and at a distance $L$ from Bob. Charlie produces two entangled pairs in the state $\left| B_{00} \right>_{12}$ and $\left| B_{00} \right>_{34}$. Therefore, there are 4 bits called $1,2,3,4$. Charlie keeps in his lab the particles $2$ and $3$ and sends particles $1$ and $4$ to Alice and Bob. Now, Charlie makes a measure in the Bell basis on particles $2$ and $3$ that he kept in his lab. Which are the possible results (with probabilities) of the measure in Charlie's Lab?
Here's my approach
Before the measure, we know that the initial state is : $$\left| \psi \right> = \left| B_{00} \right>_{12} \otimes \left| B_{00} \right>_{34}$$ $$=\frac{1}{2} \left( \left| 0 \right>_{1} \otimes \left| 00 \right>_{23} \otimes \left| 0 \right>_{4} + \left| 0 \right>_{1} \otimes \left| 01 \right>_{23} \otimes \left| 1 \right>_{4} + \left| 1 \right>_{1} \otimes \left| 10 \right>_{23} \otimes \left| 0 \right>_{4} + \left| 1 \right>_{1} \otimes \left| 11 \right>_{23} \otimes \left| 1 \right>_{4} \right)$$
Now, given that I know that $$\left| 00 \right>_{23} = \frac{1}{\sqrt{2}}(\left| B_{00} \right>_{23} + \left| B_{10} \right>_{23})$$, $$\left| 01 \right>_{23} = \frac{1}{\sqrt{2}}(\left| B_{01} \right>_{23} + \left| B_{11} \right>_{23})$$, and so on for the rest. I was able to rewrite the initial state as follows (although I'm not sure I can do this, given that I'm not sure I can do this):$$ \left| \psi \right> =\frac{1}{2\sqrt{2}} \left| B_{00} \right>_{23} \otimes (\left| 00 \right>_{14} + \left| 11 \right>_{14}) + \frac{1}{2\sqrt{2}} \left| B_{10} \right>_{23} \otimes (\left| 00 \right>_{14} - \left| 11 \right>_{14}) + \frac{1}{2\sqrt{2}} \left| B_{01} \right>_{23} \otimes (\left| 01 \right>_{14} + \left| 10 \right>_{14}) + \frac{1}{2\sqrt{2}} \left| B_{11} \right>_{23} \otimes (\left| 01 \right>_{14} - \left| 10 \right>_{14})$$ which reduces to: $$\left| \psi \right> =\frac{1}{2} \left| B_{00} \right>_{23} \otimes \left| B_{00} \right>_{14} + \frac{1}{2} \left| B_{01} \right>_{23} \otimes \left| B_{01} \right>_{14} + \frac{1}{2} \left| B_{10} \right>_{23} \otimes \left| B_{10} \right>_{14} + \frac{1}{2} \left| B_{11} \right>_{23} \otimes \left| B_{11} \right>_{14}$$
So, each state in each term of the sum is a possible state in Charlie's Lab after the measurement. In other words, measurements states are: $\left| B_{00} \right>_{23} \otimes \left| B_{00} \right>_{14}$ $\left| B_{01} \right>_{23} \otimes \left| B_{01} \right>_{14}$ $\left| B_{10} \right>_{23} \otimes \left| B_{10} \right>_{14}$ $\frac{1}{2} \left| B_{11} \right>_{23} \otimes \left| B_{11} \right>_{14}$
Therefore, the probability of measuring each state is $p=\frac{1}{4}$. I found this without using Born's rule. I used the fact that in another state, such as $\left| \phi \right>=\alpha\left| 0 \right> + \beta\left| 1 \right>$, the probability of measuring $\left| 0 \right>$ is $|\alpha|^2$(and the idea is the same for $\left| 1 \right>$). I used this fact, but I'm not sure why I would be allowed to do this. Now that I'm writing this question, I realize that perhaps, given that the states after the measure form a basis for our space, writing the initial state as a sum of basis vectors, I am allowed to do this. Would you say that I'm correct?
"
['mathematics']," Title: How to read a Qubit rotation lookup table?Body: In A New Quantum Inspired Genetic Algorithma a lookup table is used to decide the Qubit rotation. But how the lookup table is used is not briefed.
Does anyone know how it is done ?
An example is shown below.
$\delta\theta$ is chosen equal to $\pi/25$. The following table gives the value of the rotation angle in function of $\alpha, \beta$ and the bit's value in the best solution.
$$\text{Table 1. Lookup table of the rotation angle}$$
$$\begin{array} {|c|c|c|c|}\hline \boldsymbol\alpha & \boldsymbol\beta & \textbf{Reference bit value} & \textbf{Angle} \\ \hline >0 & >0 & 1 & +\delta\theta \\ \hline >0 & >0 & 0 & -\delta\theta \\ \hline >0 & <0 & 1 & -\delta\theta \\ \hline >0 & <0 & 0 & +\delta\theta \\ \hline <0 & >0 & 1 & -\delta\theta \\ \hline <0 & >0 & 0 & +\delta\theta \\ \hline <0 & <0 & 1 & +\delta\theta \\ \hline <0 & <0 & 0 & -\delta\theta \\ \hline \end{array}$$
"
"['error-correction', 'stabilizer-code', 'surface-code']"," Title: Block codes with better parameters vs. surface codes, which need less ancilla qubits?Body: I'm learning quantum error correction by myself and I want to know the relation between block codes and surface codes.
I find that many researchers in the field of coding theory are exploring quantum block codes with better parameters, like constructing quantum codes from various classical codes.
In other hand, I find that surface codes are popular in recent papers.
My questions are
- Which one are more promising in quantum error correction? and further in constructing fault-tolerant quantum computers?
- How many ancilla qubits are needed now approximataly for a computable logical qubit?
"
"['quantum-state', 'qiskit', 'measurement', 'tomography']"," Title: Is it possible to get the $\alpha$ and $\beta$ (amplitudes) of a qubit in Qiskit?Body: Is it possible to get the $\alpha$ and $\beta$ (amplitudes) of a qubit in Qiskit, i.e. not only probabilities after measurement but complete quantum state?
"
"['programming', 'q#']"," Title: How to invoke a C# method inside a Q# operation?Body: Suppose there is a Q# operation as follows:
operation Op () : Bool {
let result = CSharpMethod ();
return result
}
where CSharpMethod () is a defined method in the Driver class as follows:
public static bool CSharpMethod () {
// ...
// return a boolean value
}
So my question is how to call a method of a C# class inside a Q# operation and handle its returned value?
Thanks.
"
"['programming', 'ibm-q-experience', 'qasm']"," Title: OPENQASM: How to include my own librariesBody: I studied the OPENQASM 2.0 spec a few times but failed to find a way to include my own libraries. Have I missed anything?
Right now, the only way is to use include ""qelib1.inc"" mechanism to separate the library from my own code. When the circuit starts to grow, there is a real need to group various components to different files. How can that be achieved without contaminating the qelib1.inc?
"
"['programming', 'q#']"," Title: Is it possible to create a Q# operation with optional parameters?Body: In C# it is possible to have:
public void Fun (int n = 0){
// ...
}
then the following method call examples will be compiled:
So I wonder whether or not such a useful facility is available in creating Q# operations with optional parameters?
"
"['physical-realization', 'physical-qubit', 'noise']"," Title: Building a DIY quantum computer - how to reduce a noise?Body: I refer to A DIY Guide to Building a Quantum Computer and Researchers advance noise cancelling for quantum computers.
With my friends, I would like to build our simplified quantum computer.
We are also keen to reduce the noise, so my question: is there some quick and easy way to reduce noise?
"
"['algorithm', 'grovers-algorithm', 'amplitude-amplification']"," Title: Negating amplitude in amplitude amplification when second qubit is 0 not workingBody: I have experimented a bit with Grover's Algorithm, and I wanted to search for the states $|00\rangle$ and $|10\rangle$. I tried making a Quantum Circuit, which looks like the one below, but measuring the superposition 1 024 times only gives me all states with equal probability. Any way I could alter the approach?
"
"['entanglement', 'measurement', 'bell-basis']"," Title: What is the property of any entangled pair of qubits?Body: We know that any of the Bell states has the special property that the second qubit will be found in a state which is predictable based on measuring one of the qubits. But assuming any other pair of entangled qubits (any other entangled state apart from the Bell states) how does measuring the first qubit affects the probability of finding the second qubit in a specific state after measurement? Can we deduce any property(ties) for any entangled pair of qubits?
Obviously, there is a general property that measuring a quantum system impacts other systems entangled with it forthwith. But here I mean some property which is more specific and more calculational based. For instance, if the first qubit after measurement collapses in zero state then the probability of finding the second qubit in zero state will be $n$ where $n$ is calculated through some computations.
Thanks.
"
"['programming', 'q#']"," Title: How to reduce the length of Q# programs execution time?Body: In the released Q# documentation by Microsoft available at: Quantum Development Kit Full State Simulator, it is written
By default OpenMP uses all available hardware threads, which means that programs with small numbers of qubits will often run slowly because the coordination required will dwarf the actual work. This can be fixed by setting the environment variable OMP_NUM_THREADS to a small number.
So I wonder how to do that as I couldn't find the solution of fixing OMP_NUM_THREADS to a small number in their documentation?
Update:
Following is the snippet of the my code which does the main job:
mutable numberOfObservedZeros = 0;
for (i in 1..firstLoop){
for (j in 1..secondLoop){
Set (qubit,Zero);
Ry (0.3141, qubit);
R1 (0.0, qubit);
if (M(qubit) == Zero){
set numberOfObservedZeros += 1;
}
}
}
where firstLoop and secondLoop are passed to the operation containing the above block of code.
"
"['speedup', 'optimization', 'phase-estimation', 'quantum-computing-for-finance']"," Title: Travelling salesman problem on quantum computerBody: Recently a pre-print of article Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience appeared. The authors use a phase estimation as a core for their algorithm. This part of the algorithm is used for a length calculation of a particular Hamiltonian cycle in TSP.
After that a minimization algorithm introduced in A Quantum Algorithm for Finding the Minimum is employed to find an actual soulution of TSP.
Briefly, the proposed algorithm work as follows:
Firstly a matrix $A$ containing distances among $N$ cities (i.e. element $a_{ij}$ is distance from city $i$ to city $j$) is converted to matrix $B$ which elements are $b_{ij} = \mathrm{e^{i a_{ij}}}$ in order to represent distances among cities as a phase. Note that $a_{ij}$ are normalized on interval $(0;2\pi)$.
After that, for each city a diagonal matrix $U^{(i)}$ is constructed. An element $u^{(i)}_{jj} = b_{ij}$ i.e. a distance from city $i$ to city $j$.
Then a final operator $U = U^{(1)}\otimes U^{(2)} \otimes \dots \otimes U^{(N)}$ is constructed. The matrix $U$ is diagonal hence its eigenvectors are vectors constituing z-basis (or standard basis) and respective eigenvalues are diagonal elements of the matrix. Because of approach how $U$ is constructed, $(N-1)!$ of $N^N$ diagonal elements contain length of all possible Hamiltonian cycles in TSP.
Each Hamiltonian cycle can be represented wiht eigenvector obtained followingly:
$$
|\psi\rangle = \otimes_{j} |i(j) - 1\rangle
$$
for $j \in \{1\dots N\}$ and function $i(j)$ returns city $i$ we traveled to $j$ from. For example, consider four cities and cycle $1 \rightarrow 2 \rightarrow 3\rightarrow 4\rightarrow 1$. In this case
- $i(1) - 1 = 4 - 1 = 3$, so $|3_{10}\rangle = |11\rangle$
- $i(2) - 1 = 1 - 1 = 0$, so $|0_{10}\rangle = |00\rangle$
- $i(3) - 1 = 2 - 1 = 1$, so $|1_{10}\rangle = |01\rangle$
- $i(4) - 1 = 3 - 1 = 2$, so $|2_{10}\rangle = |10\rangle$
Hence $|\psi\rangle = |11 00 01 10\rangle$. Multiplication $U|\psi\rangle$ returns lenght of the Hamiltonian cycle.
This setting allows to use phase estimation to get lenght of a cycle. Setting respective $\psi$ as an input to phase estimation leads after inverse Fourier transform to obtaining lenght of the cycle.
So far, I understand everything. However, the authors proposed:
We get the phases in form of binary output from
phase estimation algorithm, then we can easily perform
the quantum algorithm for finding the minimum [10] to find the minimum cost and the corresponding route that
is to be taken for that particular cost.
Note that [10] is the second article I mentioned above.
Since the complexity of minimum finding is $\mathcal{O}(\sqrt{N})$ we get quadratic speed-up for TSP solving, so complexity of TSP would be $\mathcal{O}(\sqrt{(N-1)!})$. But if my understanding is correct, we need to have a table of all Hamiltonian cycles prepared before phase estimation and to prepare a quantum state which is superposition of all eigenstates describing these cycles.
But to prepare all cycles in advance will take $\mathcal{O}((N-1)!)$ time unless there is a faster algorithm for permutation generation.
So my questions are:
- Where does the speed-up come from if we need to have all Hamiltonian cycles in TSP listed in advance?
- Is there a quantum algorithm for preparing all permutation of set $\{1 \dots N\}$ faster than on classical computer?
Note: since the paper is a pre-print there are some mistakes, e.g. $d+c-a-b$ in equation (8) should be d-c+a-b. Figure S1 is not completed, moreover, there is a more efficient way how to implement $\mathrm{C-U^{(i)}}$ gate (avoiding Toffolis).
"
['algorithm']," Title: What are quantum inspired algorithms?Body: I am starting to see press about quantum inspired algorithms. Are these algorithms that solve problems faster by looking at things from a quantum computing perspective?
"
['qiskit']," Title: Use Qiskit in other programming languages (C#, JavaScript and Lua)Body: I am exploring using Qiskit in other programming languages for game development, such as C# (for Unity game engine), JavaScript (Phaser.io) and Lua (LÖVE2D).
Is there a general way to call Qiskit class and methods from other programming languages? Perhaps this is a question related to python and not specific to Qiskit. But I think it still has values in this stackexchange for people want to develop applications in other languages using Qiskit.
The answer for Julia: Qiskit in Julia language? is related but not the same. I have edited the question for C#, JavaScript and Lua specifically.
"
['entanglement']," Title: How many $n$-qubit states are entangled?Body: My question is a bit broad, but my concern is mainly on understand the ratio between the number of possible linear combinations that can be decomposed in a direct product of states and the number of possible entangled states in that system. The system is a just an $n$-qubits set, as an usual vector space, with the assumption that all the states in a certain superposition can be expected as equally probable. As an example to clarify what I mean take:
$$
\left| \psi \right\rangle = \frac{\sqrt{2}}{2} (\left| 00 \right\rangle + \left| 11 \right\rangle)
$$
I know that the ratio in a 2-qubits system should be 50%, but what about $n=100$?
To improve the clarity of the question I would ask, how do you interpret this kind of graph?
Where Product = a state that can be decomposed uniquely by a tensor product. Entangled = it's own defition.
Is this a true picture of what's going on in an $n$-qubit system or not?
"
"['qiskit', 'error-correction']"," Title: How to realize this quantum error correction circuit on real hardware?Body: I want to realize this error correction circuit.
To do that, I created a circuit:
However, I cannot execute on real hardware.
How can I create a circuit to realize this correction on real hardware?
"
['quantum-gate']," Title: What is the outcome of this circuit?Body: What would be the outcome of this circuit?
"
"['algorithm', 'programming', 'grovers-algorithm']"," Title: Logical Explanation behind second reflection in Grover's algorithmBody: Logically, what does the second reflection in Grover's algorithm do? I currently don't have a lot of background in linear algebra so I'm failing to understand what exactly its purpose is and what it does.
"
"['quantum-state', 'entanglement', 'measurement']"," Title: How to know if any two arbitrary qubits are entangled?Body: Suppose there are two quits called q1 and q2. They are in two different superposition states. If we represent their states on the Bloch sphere surface, q1 is located at point_1 and q2 is placed at point_2. Please note that point_1 is different from point_2 and we know where point1 and point2 are. Now, my question consists of two parts:
- How to make
q1 and q2 entangled?
- After making them entangled, how to check if they are entangled indeed?
"
"['quantum-state', 'measurement']"," Title: How to compute the probability of finding a given state in the $|+\rangle$ state?Body: Consider the state
$$
\left| \varphi \right>=\frac{i}{\sqrt{3}} \left| 0 \right> + \sqrt{\frac{2}{3}} \left| 1\right>.
$$
What is the probability of qubit system when measured in the state $\left| + \right>$?
"
"['algorithm', 'grovers-algorithm', 'amplitude-amplification']"," Title: Grover diffusion operator for a 3 qubit systemBody: I want to make a three qubit system that marks the states where the last qubit is 0. I have made an oracle function but when I try to run the reflection the amplitudes are only higher than the others by around 15%. Is there something I'm missing out on the second reflection/diffusion operator, I'm kinda new to this field so don't know much. I have attached a picture of the second reflection as well as the probabilities:
Reflection:
Probabilities:
"
"['circuit-construction', 'stabilizer-code']"," Title: Stabilizer circuit synthesis via Clifford gatesBody: I have been working with stabilizer codes and I understand the mathematical way that they are described and how to simulate such in a classical computer in order to check their performance.
However, lately I have been wondering how this class codes would be implemented physically in terms of Clifford gates in an actual quantum computer. I have not found much about such mapping in the literature, and less of an actual general algorithm (most of the things I have found are just examples, and not general algorithms that realize the task). Can anyone give some insight about this circuit synthesis problem? Are there any general algorithms that realize this circuit synthesis? Are there optimized versions?
"
"['qiskit', 'grovers-algorithm', 'ibm']"," Title: Grover's algorithm for 3SAT problem gives erroneous resultsBody: I'm writing some code in python with Qiskit that implements Grover's algorithm to solve the 3-SAT problem, but when I run it it doesn't give the correct annswer. I've checked the circuit with the QuantumCircuit.draw() function and I can't find any error. The result should be one of the possible answers that satisfy the function.
Here's the code and the circuit together with the result it outputs:
from qiskit import QuantumCircuit, execute, Aer, IBMQ
import math
import random
from qiskit.visualization import plot_histogram
import qiskit
variables = 3
clausules = 2
treball = variables - 2
temp = clausules - 1
total = variables + clausules + treball + temp
funcio = [['0', '-1', '-2'], ['0', '1', '2']]
pro_vars = []
pro_vals = []
# Process input
for i in range(len(funcio)):
pro_vars.append([])
pro_vals.append([])
for j in range(len(funcio[i])):
if funcio[i][j][0] == '-':
pro_vals[i].append(0)
pro_vars[i].append(int(funcio[i][j][1]))
else:
pro_vals[i].append(1)
pro_vars[i].append(int(funcio[i][j]))
#Quantum algorithm
opt_iter = 1#int(math.pi / 4 * math.sqrt(2**variables))
simulator = Aer.get_backend('qasm_simulator')
circuit = QuantumCircuit(variables + clausules + treball + temp + 1, variables)
# Qubit inicialization
for i in range(variables):
circuit.h(i)
circuit.h(total)
circuit.x(total)
def grover():
#Set work qubits to state 0
for i in range(variables, variables + treball):
circuit.reset(i)
#Oracle
for i in range(clausules):
for j in range(3):
if (pro_vals[i][j] == 0):
circuit.x(int(pro_vars[i][j]))
control = circuit.qbit_argument_conversion(range(variables))
work = circuit.qbit_argument_conversion(range(variables, variables + treball))
target = circuit.qbit_argument_conversion(variables + treball + i)
circuit.barrier()
circuit.OR(control, target[0], work)
circuit.barrier()
for k in range(treball):
circuit.reset(variables + k)
for j in range(len(pro_vars[i])):
if pro_vals[i][j] == 0:
circuit.x(pro_vars[i][j])
circuit.ccx(variables + treball, variables + treball + 1, variables + treball + clausules)
for i in range(0, temp - 1):
control1 = variables + treball + 2 + i
control2 = variables + treball + clausules + i
targetf = control2 + 1
circuit.ccx(control1,control2, targetf)
circuit.cx(total - 1, total)
circuit.barrier()
#Grover diffusion operator
for i in range(variables):
circuit.h(i)
circuit.x(i)
circuit.h(variables-1)
circuit.ccx(0,1,variables)
for i in range(0,variables-3):
circuit.ccx(i+2, variables + i, variables + 1 + i)
t1 = variables + 1 + i
circuit.cx(2 * (variables - 1) - 1, variables - 1)
circuit.barrier()
circuit.h(variables-1)
circuit.barrier()
for i in range(variables):
circuit.x(i)
circuit.h(i)
for i in range(opt_iter):
grover()
circuit.measure(range(variables), range(variables))
job = execute(circuit, simulator, shots=1024)
result = job.result()
counts = result.get_counts(circuit)
print("function: ", funcio)
plot_histogram(counts)
#circuit.draw()
"
"['resource-request', 'bell-experiment', 'non-locality']"," Title: Are there Bell-like violations that can be observed without collecting statistics?Body: Observing the violation of Bell inequalities, be it in their original formulation, or in the nowadays more commonly used CHSH formulation, involves computing averages of specific experimentally measurable quantities. In the CHSH formulation, these are for example the averages of the products of the experimental outcomes.
Are there scenarios in which Bell nonlocality can be observed without such averages, that is, in a single-shot scenario? By this I mean a scenario in which a single measurement outcome (rather than a collection of outcomes used to compute averages, as is done in CHSH formulation) is enough to rule out a local hidden variable explanation.
I seem to recall having seen this kind of thing in some paper, possibly in a scheme involving three or more parties (or maybe it was with systems with three or more outcomes?). I can't, however, find the reference right now, so I'm not sure whether I'm remembering this correctly or not.
"
"['programming', 'resource-request']"," Title: Does anyone have any really good quantum computing illustration packages or frameworks for visually teaching various aspects of QC?Body: I'm focusing on training non quantum physics / non math majors - software engineers to be specific (and the interested senior executive that wonders by) and am bewildered by the lack of adequate training vehicles for non-quantum indigenous folks.
I'm searching for good quantum computing illustration packages or frameworks for visually teaching various aspects of QC that are interactive in nature?
For instance QUIRK does a very good job, as does the OReilly JS QC simulator - both useful to teaching purposes but we need more to really bring QC to software engineers.
Some other examples are the Bloch Sphere Playground and the Quantum State Sphere Playground. (links below)
My preference is for interactive vehicles like ""Immersive Math"" when it comes to explaining linear algebra concepts visually and interactively.
There has to be some decent vehicles out there that provide more coverage on under served fronts of QC, but I just can't seem to find them.
Links:
QUIRK: - https://algassert.com/quirk
OReilly QC: - https://oreilly-qc.github.io/#
Immersive Math: - http://immersivemath.com/ila/index.html
Bloch Sphere Playground: https://javafxpert.github.io/grok-bloch/
Quantum State Sphere Playground: https://javafxpert.github.io/quantum-state-spheres/
"
"['quantum-state', 'bloch-sphere']"," Title: Can a qubit be in the inside of the Bloch Sphere?Body: Can qubit be inside Bloch Sphere, i.e. its length is less than 1?
If yes, how we represent that state since we have only parameter for angles and not the length (norm) of the vector?
"
"['mathematics', 'matrix-representation']"," Title: Non-unitary matrix decomposition as a sum of unitary matricesBody: Several quantum algorithms that deals with linear algebra and matrices that are not necessarily unitary circumvent the problem of non-unitary matrices by requiring a decomposition of the non-unitary matrix as a sum of unitary matrices.
A widely known example being the LCU method.
I am currently facing the problem of ""how should I decompose my non-unitary matrix?"". I want to decompose as a sum of unitary matrices (in the best world ever, easy to implement unitary matrices) the following matrix:
$$
A = \begin{pmatrix}
0 & \cdots{} & \cdots{} & \cdots{} & \cdots{} & 0 \\
\vdots{} & & & & & \vdots{}\\
\vdots{} & & & & & \vdots{}\\
0 & & & & & \vdots{}\\
1 & 0 & \cdots{} & \cdots{} & \cdots{} & 0 \\
\end{pmatrix}
$$
which is obviously non-unitary.
I started by restricting myself to the Pauli matrices (+ identity) because I know that these unitary matrices are easy to implement.
I found the following decomposition:
$$
A = \frac{1}{2^{n}} (\mathbb{X} - i \mathbb{Y})^{\otimes n}.
$$
The problem with this decomposition is that it is a sum of an exponential (with respect to the number of qubits) number of unitary matrices. From another perspective, there are as much unitary matrices in the decomposition as the size of $A$, so it is linear in the size of $A$.
The methods mentioned at the beginning of this question are only efficient when the number of unitary matrices in the decomposition is poly-logarithmic, which is not the case here.
First question: is there any way to find a better decomposition (in terms of number of summed unitary matrices)? Or a proof that shows that it is not possible to do better only with the Pauli matrices?
I voluntarily took a very restricted and simple gate set. I started to think about how introducing a 2-qubit gate like CNOT would affect the decomposition. Obviously, it can only improve the number of unitary matrices summed in the decomposition, but I still cannot figure out if introducing other unitary matrices will help me to reduce the number of unitary matrices summed in the decomposition to something that is logarithmic in the size of $A$ (instead of the linear behaviour I have now).
Second question: do you have any ideas about how modifying the gate set will affect the number of summed unitary matrices in the decomposition?
"
"['quantum-state', 'nielsen-and-chuang']"," Title: How can I check if the following are possible states of a qubit?Body: I would like to check if state
$$ |\psi\rangle = \cos{\theta}|0\rangle + i \sin{\theta}|1\rangle
$$
is properly defined.
But when I calculated $\langle \psi | \psi \rangle$ is get
$$
\cos^2{\theta} - \sin^2{\theta}
$$
so I am facing sin and cos.
What is wrong in my calculation?
"
"['quantum-gate', 'mathematics', 'machine-learning', 'tensor-product']"," Title: Quantum Principal Component analysis by Seth LloydBody: I am currently reading the paper quantum principal component analysis from Seth Lloyd's article Quantum Principal Component Analysis There is the following equation stated.
Suppose that on is presented with n copies of $\rho$. A simple trick allows one to apply the unitary transformation $e^{-i\rho t}$ to any density matrix $\sigma$ up to $n$th order in $t$. Note that
\begin{align}\label{eq1}\tag{1}
\text{tr}_pe^{-iS\Delta t}\rho\otimes\sigma e^{iS\Delta t} &= \left(\cos^2\Delta t\right)\sigma + \left(\sin^2 \Delta t\right)\rho - i\sin\Delta t\left[\rho, \sigma\right] \\
&= \sigma - i\Delta t\left[\rho, \sigma\right] + \mathcal O\left(\Delta t^2\right)
\end{align}
Here $\text{tr}_p$ is the partial trace over the first variable and $S$ is the swap operator. $S$ is a sparse matrix and so $e^{-iS\Delta t}$ can be performed efficiently [6-9]. Repeated application of \eqref{eq1}
I know from the qiskit website, that we can express $\mathrm{e}^{i\gamma B}$ as $\cos(\gamma)I + i\sin(\gamma)B $ with $\gamma$ being some real number and $B$ is an involutory matrix. Can someone explain me why there is only a single $\sigma$ and no $\rho$ in $(\cos^2\triangle t)\sigma$ and a single $\rho$ and no $\sigma$ in $(\sin^2\triangle t)\rho$? Is it because of the partial trace?
Any intuition or approach is welcome. Many thanks in advance.
"
"['qiskit', 'ibm-q-experience', 'shors-algorithm']"," Title: How to make a Shor's algorithm for an arbitrary number of qubits with Qiskit on a IBM machine?Body: So suppose you want to do a Shor algorithm on an arbitrary number of qubits using an arbitrary $a$ (the base number in the periodic function $a^x \mod c$) and $c$ ( the factored number). Making the IQFT is easy for an arbitrary number of qubits because it has a clear pattern and it uses only Hadamard and controlled phase shifts gates. But what about the permutation gate that multiplies the function? I can make one for a 7 qubits Shor with 3 qubits $x$ and 4 qubits $f(x)$ using Toffolli gates but I don't know how I can code something that does it automatically for given $c$ and $a$. I also wonder how would you do it for a higher number of qubits. Any help, reading material or pointers on that?
"
"['quantum-state', 'mathematics', 'hadamard']"," Title: What are the $|+\rangle$ and $|-\rangle$ states?Body: In the Gates Glossary of IBM Quantum Experience it states
H gate
The H or Hadamard gate rotates the states |0⟩ and |1⟩
to |+⟩ and |−⟩, respectively. It is useful for making superpositions. As a Clifford gate, it is useful for moving
information between the x and z bases.
This is followed by a picture of a Bloch sphere rotation which looks good but still does tell me nothing. Well for me as a programmer all I understood by playing around with the Hadamard gate was that I get with a 50/50 probability 0 or 1 when measuring the qubit after the Hadamard gate.
But trying to learn more the above is very confusing and I do not find anything googling either without starting to ask more questions about basic terminology.
Breaking down the quoted sentence I come up with a lot of questions: What exactly is a state of a qubit? What is the state of + and what is the state of -? Why is it important to know that this is a ""Clifford gate"" does this help in any way to understand the Hadamard gate? What is the x base? What is the z base? And why am I all the time confronted with math when I want to write a program? I write software since 35 years and the amount of math I needed was very limited why should I suddenly need to understand all this math theorems? I am not stupid. I could understand math but the notations in math are intimidating. I prefer to read software code no matter how nested. Single SQL queries of 1000 lines no problem.
I know these are all basic questions but I feel that they are not properly answered anywhere without the use of either incomprehensible math or other terminology inappropriately defined either. I think also that I am not the only ""classical"" programmer that struggles with the basics.
I appreciate any answer not using new terminology that is not defined and I prefer answers that explain math formulas. If it can only be explained with math then this is okay, but please define your notations. As a programmer I prefer terms as for(i = 1; i <= N; i++) Sum += i; over terms like $\sum_{i=1}^n$ which look very alien to me.
"
"['quantum-gate', 'algorithm', 'grovers-algorithm']"," Title: Can we apply Grover to meet-in-the-middle attack?Body: $\newcommand{\Ket}[1]{\left|#1\right>}$
If we have the superposition
$$\displaystyle \sum \dfrac{1}{2^n} \Ket x \Ket{ f(x)} \Ket 0 \Ket y \Ket{g(y)} \Ket 0 \Ket {\delta_{x,y}} ,$$ here $\delta_{x,y} = 1 $ if $f(x) = g(y)$, else $\delta_{x,y}=0$. I want to copy $\delta_{x,y}$ to qubit $\Ket 0$ by some ways so that it becomes superpositon
$$\left(\displaystyle \sum \dfrac{1}{2^{n/2}} \Ket x \Ket{f(x)}\Ket {\delta_x} \right) \left(\displaystyle \sum \dfrac{1}{2^{n/2}} \Ket y \Ket{g(y)} \Ket{\delta_y} \right) \Ket 0 ,$$
means that $\delta_x = 1$ if $f(x)$ collides with some $g(y)$, and so does $y$. After that, apply Grover's algorithm on the first half and second half to find $x$ and $y$ that collides, in $O(2^{n/4})$ time complexity.
Is there any way to copy like this?
"
"['quantum-operation', 'optimization']"," Title: How to maximise over linear functionals of quantum channels?Body: I am given fixed quantum states $\rho_X$ and $\sigma_Y$ and some function of the form $\text{Tr}(N_{X\rightarrow Y}(\rho_X)\sigma_Y)$. I would like to maximize this function over all completely positive trace preserving maps $N_{X\rightarrow Y}$. What is the way to solve such an optimization?
I notice that my problem is linear in $N_{X\rightarrow Y}$ so I was wondering if there could even be an analytical solution to this?
"
"['ibm-q-experience', 'deutsch-jozsa-algorithm']"," Title: Implementing four oracles for the Deutsch Algorithm (preferably on IBM Q Experience)Body: I guess, I understood simple Deutsch Algorithm (if unary function is balanced or constant) as described here: Introduction to quantum computing: The Deutsch algorithm
I need to test it. I was wondering how I would implement all the four function oracles. I was hoping to find it, already implemented somewhere on IBM Quantum Experience.
Could someone please point me to an implementation for the same?
EDIT: Kind of answering the question: I guess my issue was: I was trying to find $f(x)$ somewhere inside the bigger black box. But if I let go of that (what if I don't want to?), then things become really simple by realizing:
we had function: $x \rightarrow f(x)$
But this is not reversible, so we wanted to implement black box with function: $|x, y\rangle \rightarrow |x, f(x) \oplus y\rangle$.
So here is what this translates to four possible functions:
1) $f(x) = 0$: $f(x) \oplus y = 0 \oplus y = y$, So, black box doesn't do anything
2) $f(x) = 1$: $f(x) \oplus y = 1 \oplus y = \bar{y}$
So, black box simply negate the $y$.
3) $f(x) = \bar{x}$: $f(x) \oplus y = \bar{x} \oplus y$ (which is also $\overline{x \oplus y}$)
So, we can implement it in two ways:
Option 1: for $x$: not it twice so that finally we get $x$.
for $y$: when $x$ is notted once, at that point use it as control to CNOT $y$ and output that.
Option 2: $x$ is outputted as it is.
For $y$ take $x$ as control and CNOT it. Then NOT it.
Here CNOT gives $x \oplus y$, and when we NOT it we get $\overline{(x \oplus y)}$ which is same as $\bar{x} \oplus y$
4) $f(x) = x:$
For $y$ simply CNOT it with $x$, using $x$ as control.
I verified it (on IBM Q Experience) and it seems to be working. :-)
I see that in all 4 implementation it is possible to not change $x$ at all. But yet, when we measure it, it's value is changing!!! I guess I still have to turn my head around that.
"
['q#']," Title: Problems with Q# installingBody: I don't know if this is the right place to ask this question. I just thought it would be a place where people knew what they are doing. If there is a better place to look for answers (stackoverflow for example), feel free to tell me.
The problem is that .NET can't install iqsharp. It says it doesn't recognize the file even though it is in the PATH folder (user/.dotnet/tools).
> dotnet iqsharp install
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-iqsharp does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
It shows the same behavior when I want to use other .NET packages. I have dotnet version 3.1.101. I can send dotnet --info if you want.
I have looked on github and other websites for solutions but most of the problems were caused by Linux Ubuntu and most of the treads are still open.
Thanks for reading and I hope you can help me.
"
"['mathematics', 'nielsen-and-chuang']"," Title: Problem 2.2 in Nielsen & Chuang - Properties of the Schmidt numberBody: This question has been asked here: ""Problem 2.2 in Nielsen & Chuang - Properties of the Schmidt number"",
but no answer has been provided there yet, thus I move it here.
The problem is stated below. This is problem 2.2 (not exercise 2.2) in Nielsen & Chuang (Page 117 in the newest version).
Suppose $|\psi\rangle $ is a pure state of a composite system with components $A$ and $B$, such that: $$|\psi\rangle = \alpha \rvert \phi \rangle + \beta \rvert \gamma \rangle$$
Prove that:
$$ \operatorname{Sch}(\psi) \geq | \operatorname{Sch}(\phi) - \operatorname{Sch}(\gamma)|$$
where $\operatorname{Sch}(x)$ is the Schmidt number of the pure state labeled $x$.
The link above provide some attempts, but not quite succeed. Any help is appreciated.
"
"['algorithm', 'resource-request', 'quantum-computing-for-finance']"," Title: Quantum computing in finance - list of articlesBody: I am trying to find application of a quantum computing in finance. So far I found these papers:
- Quantum computing for finance: Overview and prospects
- Quantum computational finance: quantum algorithm for portfolio optimization
- Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience
- Towards Pricing Financial Derivatives with an IBM Quantum Computer
- Quantum computational finance: Monte Carlo pricing of financial derivatives
- Quantum Risk Analysis
- Credit Risk Analysis using Quantum Computers
My question is: do you know about other possible application of quantum computing in finance, banking, companies finanace management or general business area?
"
"['quantum-gate', 'quantum-state']"," Title: How to find eigenvalues and eigenvector for a quantum gate?Body: I need to know how can I find eigenvalues and eigenvectors for a quantum gate, for example $X$ gate.
"
"['quantum-operation', 'kraus-representation']"," Title: What does it mean ""less than identity"" in the operator sum representation?Body: In Quantum Computation and Quantum Information by Isaac Chuang and Michael Nielsen, section 8.2.3, $\mathcal{E}=\sum_{k}E_k\rho E_k^{\dagger}$ gives the operator-sum representation. In general, it requires $\sum_k E_k E_k^{\dagger}\leq I$. But, what does it mean by the inequation here? Does it mean every entry of the matrix is a nonnegative real value up to 1?
Thanks
"
['quantum-state']," Title: How many real-valued coefficients does it take to specify an $n$-qubit state?Body: Let a quantum register of size $n$ be in the following state, expressed in the computational basis for $n$-qubit states:
$$\left| \psi \right> = \sum_{i=0}^{2^n-1} \alpha_i \left| i \right>, \forall i \in \{0, 1, ..., 2^n-1\}, \alpha_i \in \mathbb{C}$$
Additionally, the normalization condition states that:
$$\sum_{i=0}^{2^n-1}|\alpha_i|^2 = 1$$
How many real-valued coefficients would it take to express these $2^n$ complex-valued coefficients (the probability amplitudes of the register's quantum state)?
The naïve answer would be two real coefficients per complex coefficient, one for the real part and one for the imaginary part, or one for the modulus and one for the phase, so in total $2^{n+1}$.
The correct answer, it seems, is however $2(2^n-1)$, as stated in the lecture notes I am following, on slide 5.
Obviously, the normalization condition can be used to reduce the required number of real coefficients, but I can only see it reducing the required number by $1$ (express a modulus using all of the other modulus values) instead of $2$.
I just can't find an explanation to the correct answer.
"
"['programming', 'qiskit', 'q#']"," Title: IBM qiskit vs Microsoft QDKBody: I am new to both IBM Qiskit and Microsoft QDK. I wish to understand which framework would be best suited for someone new to this field. I am lookig for the pros and cons of both frameworks.
"
['qiskit']," Title: UCCSD in qiskit deprecated?Body: Is this now deprecated or moved? I've been looking for it. It was in
from qiskit.chemistry.aqua_extensions.components.variational_forms import UCCSD
"
['qiskit']," Title: More broken older Qiskit codeBody: I am persuing some older code as below
ferOp = FermionicOperator(h1=molecule.one_body_integrals, h2=molecule.two_body_integrals)
...
qubitOp = ferOp.mapping(map_type='parity', threshold=0.000001)
qubitOp = qubitOp.two_qubit_reduced_operator(num_particles)
but am getting the following error:
AttributeError: 'WeightedPauliOperator' object has no attribute 'two_qubit_reduced_operator'
Any suggestions for how to fix. I am using qiskit version:
qiskit 0.14.1
qiskit-aer 0.3.4
qiskit-aqua 0.6.2
qiskit-ibmq-provider 0.4.5
qiskit-ignis 0.2.0
qiskit-terra 0.11.1
"
"['quantum-state', 'entanglement', 'density-matrix', 'unitarity']"," Title: Are there different orderings of the fifteen SU(4) generators in common use?Body: I've recently performed certain analyses (Archipelagos of Total Bound and Free Entanglement) pertaining to eq. (50) in
Separable Decompositions of Bipartite Mixed States , that is
\begin{equation} \label{rhoAB}
\rho_{AB}^{(1)}=\frac{1}{2 \cdot 4} \textbf{1} \otimes \textbf{1} +\frac{1}{4} (t_1 \sigma_1 \otimes \lambda_1+t_2 \sigma_2 \otimes \lambda_{13}+t_3 \sigma_3 \otimes \lambda_3),
\end{equation}
""where $t_{\mu} \neq 0$, $t_{\mu} \in \mathbb{R}$, and $\sigma_i$ and $\lambda_{\nu}$ are SU(2) and SU(4) generators, respectively.""
Subsequent analyses (which I could detail)--concerning certain entanglement constraints employed in the two studies--lead me to speculate whether or not there is a possible ambiguity in the specific identification of the three $4 \times 4$ matrices ($\lambda$'s).
I, of course, had to use a specific set of three in my analyses--but, at this point, I'd just as soon leave matters ""wide open"" and not ""bias"" matters, if possible.
If there is possible ambiguity (which I presently suspect) perhaps good practice should dictate that the specific ordering employed be explicitly identified.
"
"['quantum-state', 'physical-qubit']"," Title: Is there anything practical that can be done with a single qubit?Body: Is there anything practical that can be done with a single qubit? And by ""practical,"" I mean a problem that can be solved or information that can be stored.
I realize that one practical thing that you can do with a single qubit is to write a grant application to build a computer that has 9 qubits, but that is a bit too meta for this question.
"
"['quantum-state', 'circuit-construction', 'unitarity', 'universal-gates']"," Title: How can I build up an arbitrary quantum circuit given a certain unitary matrix operation?Body: Suppose I want to put a qubit whose initial state is $|0\rangle$ to the final state $\frac{1}{\sqrt{3}}|0\rangle + \sqrt{\frac{2}{3}}|1\rangle$.
Well, in that case, the unitary matrix that performs such operation is given by:
$$U = \frac{1}{\sqrt{3}}\begin{pmatrix}1&-\sqrt{2}\\ \sqrt{2} & 1 \end{pmatrix}$$
So the question is, how can I build a quantum circuit with the usual quantum gates (X, Y, Z, etc) which reproduces this behavior?
"
"['algorithm', 'quantum-gate', 'quantum-state', 'programming']"," Title: Can two intrinsic angular momentum directions (spin) be used for future entanglement after collapse?Body: Persuant to all contributors, here I will use a coin toss analogy since the vector direction is either up or down (heads or tails). Two coins will be used for each of two tosses. It's assumed that the process will be one-shot (shots=1).
Toss one: Superposition will be applied using Hadamard gates on two qubits. Collapse will result in the following possible binary results: [00,01,10,11] (HH,HT,TH,TT).
For toss two: Of the four binary results of toss one, I will choose either 00 or 11.
I want to know how to prepare two qubits in an entangled state after either 00 or 11 is measured on those two independent qubits prepared with Hadamards in toss one.
"
['teleportation']," Title: Quantum teleportation between two computer chips, how relevant?Body: After stumbling upon this recent news article: Information teleported between two computer chips for the first time (which references a ""Nature Physics"" publication Chip-to-chip quantum teleportation and multi-photon entanglement in silicon)...
...with quantum teleportation, information appears to break that speed limit
Harnessing this phenomenon could clearly be beneficial, and the new study helps bring that closer to reality. The team generated pairs of entangled photons on the chips, and then made a quantum measurement of one. This observation changes the state of the photon, and those changes are then instantly applied to the partner photon in the other chip.
... I've been wondering what this specific break-through means for the state of quantum teleportation, if anything.
The quotes above would appear to imply that information can potentially be transported and used instantly, faster than the speed of light. Is that accurate though? My understanding was that because of its dependency on classical communication, quantum teleportation won't allow for faster-than-light communication in practice. Has that changed?
"
"['quantum-gate', 'ibm-q-experience', 'decoherence']"," Title: Measuring T1 and T2 constants on IBM QBody: We have been asked to measure relaxation and dephasing times T1 and T2 on the IBM Q using the composer only, Qiskit not allowed. I am a bit confused about the way to do so. Can someone explain the idea behind and how to implement the measurement in QASM?
"
"['qiskit', 'simulation', 'hamiltonian-simulation', 'openfermion']"," Title: Openfermion to qiskitBody: Is there a direct way to go from an object generated in openfermion to objects usable in Qiskit. I can't find anything about any plugin.
It's not too hard to translate into pyQuil and then to Qiskit from there, but a direct way would be much easier.
"
"['quantum-gate', 'physical-realization', 'google-sycamore']"," Title: Where are the physical gates in the Google processor?Body: Google's article Quantum supremacy using a programmable superconducting processor states that the processor ""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%.""
Where are the gates physically located? In the diagram, the qubits are the crosses and the qubits are the couplers.
"
['shors-algorithm']," Title: Why is the size of the top register for Shor's algorithm chosen as it is?Body: Let $N$ be the number we're trying to factor. In Shor's algorithm, the top register then has $2 \lceil\log_2(N)\rceil+1$ qubits, while the bottom register (the ancilla qubits) has $\lceil\log_2(N)\rceil$ qubits.
This is stated in my lecture notes on slide 25.
I believe I have an approximate understanding of Shor's algorithm: the end result on the top register, $\left| x_{\text{final}} \right>$, is such that $\frac{x_{\text{final}}}{T} = \frac{s}{r}$ for some integer $s$. In the aforementioned equation, $T=2^{2 \lceil \log_2(N) \rceil + 1}$ and $r$ is the oracle's (modular exponentiation) period.
The end result of the bottom (ancillary) register is the result of the modular exponentiation: $\left| f(x) + y \right> = \left| f(x) \right> = \left| a^x \mod N \right>$. The largest result possible is $N-1$, for which you require $\lceil \log_2(N - 1) \rceil$ qubits, so it makes sense that the size of the bottom register is $\lceil\log_2(N)\rceil$.
I do not however understand the choice of the size of the top register.
"
"['quantum-state', 'quantum-operation']"," Title: What does a ""Choi state"" where we relax the partial trace condition represent?Body: Consider Hilbert spaces $\mathcal{X}, \mathcal{Y}$. For any quantum channel $\mathcal{E}_{\mathcal{X}\rightarrow \mathcal{Y}}$, the bipartite Choi state $J(\mathcal{E}) \in L(\mathcal{Y}\otimes\mathcal{X})$ is given by
$$J(\mathcal{E}) = (\mathcal{E}\otimes I)\sum_{a,b} \vert a\rangle\langle b\vert\otimes\vert a\rangle\langle b\vert$$
It is also possible to show (see here for example) that the trace preserving condition of the map $\mathcal{E}$ is equivalent to the following condition on its Choi state
$$\text{Tr}_\mathcal{Y}J(\mathcal{E}) = I_\mathcal{X} \tag{1}$$
The proof is easy - it relies on noticing that the trace preserving condition implies that $\mathcal{E}(\vert a\rangle\langle b\vert) = \delta_{a,b}$ due to the trace preserving condition. Meanwhile, positive-semidefiniteness of $J(\mathcal{E})$ corresponds to complete positivity of $\mathcal{E}$.
If $J(\mathcal{E})$ is a density matrix but does not fulfill (1) is it still related to physical quantum channels (i.e. completely positive and trace preserving maps) in some way? Specifically, since completely positive maps correspond to positive semidefinite Choi matrices, does imposing that $\text{Tr}(J(\mathcal{E})) = 1$ (in addition to positive semidefiniteness) give us any condition on the map $\mathcal{E}$?
"
"['algorithm', 'quantum-gate', 'circuit-construction', 'simons-algorithm']"," Title: How to interpret a 4 qubit quantum circuit as a matrix?Body: This is part of Simon Algorithm (Initial state + some Oracle function)
There is a post that explains how to interpret circuits (How to interpret a quantum circuit as a matrix?), but I'm not sure how to apply to the following circuit.
The first part, both Hadamard to first and second qubit:
$M_1 = H \otimes H \otimes I \otimes I$
Then, first Controlled NOT:
How can I apply a matrix to the first and second qubit if I have $M_1$ that is a 16x16 matrix.
I know I could have applied $H$ to the first qubit and then do a tensor product with $I$ (third qubit), and the result, multiply by $CX$. But then I have the second $CX$ which is applied to the first qubit and 4th qubit.
Symbol $\otimes$ is a tensor product.
"
"['quantum-gate', 'ibm-q-experience', 'decoherence']"," Title: IBM quantum computers gate delay valuesBody: I am doing an state of the art study about the existing quantum computer technologies and one of the parameters of interest is the gate delay value, as it determines the time expected from a gate from such computer to make its operation, and consequently, it is important to see the coherence time that such computer presents.
I would like to know where can I find such values for the IBM quantum computers.
"
"['quantum-gate', 'circuit-construction', 'nielsen-and-chuang']"," Title: Constructing a circuit for $C^1(U)$ for rotation operators with TWO single qubit gates and CNOT gateBody: This is the exercise 4.23 from Nielsen and Chuang, asking that if it is possible to construct $C^1(U)$ for $U=R_{x,y}(\theta)$ with TWO single qubit gates and CNOT gate. My answer is no, and I would like to argue in the following way.
First, we do have such a construction for $U=R_z(\theta)$ which is the following (sorry that I have to draw it by hand)
where the (reverse) CNOT has the matrix representation
$$
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
\end{bmatrix}
$$
such that we have the matrix representation of the circuit as
$$
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
\end{bmatrix}
\big(
\begin{bmatrix}
1 & 0 \\
0 & e^{-i\theta/2}
\end{bmatrix}
\otimes
\begin{bmatrix}
1 & 0 \\
0 & e^{i\theta/2}
\end{bmatrix}
\big)
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
\end{bmatrix} =
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & e^{-i\theta/2} & 0 \\
0 & 0 & 0 & e^{i\theta/2} \\
\end{bmatrix}
$$
which is the desired matrix for $C^1(R_z(\theta))$. Thus we do a have a circuit with only two single qubit gates and CNOT for $U=R_z(\theta)$. Now for the rotation $U=R_x(\theta) = VR_z(\theta)V^\dagger$, which differ from $R_z$ by a unitary transformation V, we will need to ""sandwich"" the above circuit by some other gate. However, that is not possible by just one single qubit gate as we need unitary transformation on both sides of the circuit, despite we may merge two gates into one. Thus I feel that it is not possible for $U=R_{x,y}$. However, on the other hand, physically there is no difference between various rotation operators, it feels not right that only $R_z$ has such circuit construction but not for others. So I may have missed sth here, and any help and clarification is appreciated.
"
"['algorithm', 'quantum-gate']"," Title: Global phase and single qubit gate: does it actually matter for two (or more) qubit gates?Body: Consider the $X$ gate. Mathematically, we have $X=i e^{-i\frac{\pi}{2} X}$
But as global phase of unitaries don't matter because they will simply act a global phase to the wavefunction, we can consider implementing $X$ by $e^{-i\frac{\pi}{2} X}$, allright.
Now, consider a CNOT. Formally, we have:
$$CNOT=|0\rangle \langle 0| \otimes \mathbb{I} + |1\rangle \langle 1| \otimes X $$
If at this point I say ""well, a $X$ gate or a $\pi$ rotation around $x$ is the same, up to global phase"", I could say:
$$CNOT=|0\rangle \langle 0| \otimes \mathbb{I} + |1\rangle \langle 1| \otimes e^{-i\frac{\pi}{2} X} $$
But the two expressions of the CNOT do not differ from a global phase.
My question is the following.
Let's assume we want to implement an algorithm. Is it that we have at the beginning to define once for all how we implement an $X$ gate, and be consistant all along.
For example, if as soon as there is an $X$ in the algorithm and that I replace it by $e^{-i\frac{\pi}{2} X}$, then I will be fine.
But, if sometime I replace it by $ie^{-i\frac{\pi}{2} X}$ and sometime by $e^{-i\frac{\pi}{2} X}$ then I will have problems.
So here, indeed my two definitions of CNOT do not implement the same unitary, but if they were inside of an algorithm and that I had chosen a fixed convention for $X$, then I will be safe ?
Other question (more important for my purpose).
Let's assume I can only do single qubit rotations on which I might have a quantum control on it (I can do controlled rotation in the end).
How is it possible from this to implement a CNOT operation ? Indeed this example shows that a CNOT is not a controlled $\pi$-pulse around $x$. How could I add the $i$ that is missing in practice then ? Because from respect to the target qubit this $i$ is a global phase. This confuses me.
"
"['quantum-state', 'teleportation']"," Title: Compute the output of the quantum teleportation circuitBody: Sender and receiver use the teleportation protocol, where the sender teleports a quantum state $\left| \varphi \right>=\alpha\left| 0 \right> + \beta \left|1\right>$ to the receiver.
I want to implement this protocol, and then find the output $\left| ABC \right>$ of the quantum circuit when the measurement of the teleportation protocol in the left side is $\left| 11\right>$.
In other words: when we measure $|11\rangle$, how to show that the state $|\varphi\rangle$ was really teleported?
"
"['entropy', 'information-theory']"," Title: Convexity of coherent information - erroneous argument!Body: Consider a state $\rho_{AB}$. Let it have purification $\psi_{A'AB}$. I am interested in the coherent information of this state which is given by
$$I(A\rangle B)_\rho = S(B)_\rho - S(AB)_\rho$$
I can rewrite this as follows using the fact that $\psi_{A'AB}$ is pure.
\begin{align}
I(A\rangle B) &= S(B)_\rho - S(AB)_\rho\\
&=S(A'A)_\psi - S(A')_\psi \\
&= S(A|A')_\psi
\end{align}
Now let us consider $J(A\rangle B) = -I(A\rangle B)$. We have
\begin{align}
J(A\rangle B) &= S(AB)_\rho - S(B)_\rho\\
&= S(A|B)_\psi
\end{align}
But the quantum conditional entropy $S(X|Y)$ is a concave function of the input state (see Corollary 11.13 in Nielsen and Chuang). So both $J$ and $I$ are concave. This would imply that the coherent information is a linear function of $\psi_{A'AB}$ which I believe is not true. Where did I make a mistake in the argument?
"
"['qiskit', 'phase-estimation']"," Title: Right way to use Quantum Phase Estimation using aquaBody: I have been experimenting with Qiskit lately, but I have found the implementation of algorithms in Aqua extremely confusing. Currently I am trying to implement a very simple circuit that will return the eigenvalues of a 2x2 unitary operator, for example Pauli X. The problem is that I don't know which class I should use: is it PhaseEstimationCircuit from qiskit.aqua.circuits.phase_estimation_circuit or EigsQPE from qiskit.aqua.components.eigs.eigs_qpe or any of the many similarly named modules. An example tentative is shown below.
pauli = Pauli( z=[0], x=[1], label=None)
weighted_pauli = WeightedPauliOperator(paulis=[(1,pauli)])
a = qpc.construct_circuit()
The circuit a does not seem to be the correct one. More objectively, is there anyway to reproduce a QPE circuit as the one shown in Wikipedia through Aqua?
"
"['quantum-gate', 'physical-realization', 'quantum-memory']"," Title: How will quantum computers access large amounts of storage?Body: I've seen many articles in the popular press saying that quantum computers will enable searching through huge amounts of data in an instant. But I can't figure out how the current architectures can do that at all, things like Google's Sycamore architecture don't even have storage. There is literally nothing to search except for the state space that results from the configuration of the gates (and that seems to be an RF signal that is spread out over time).
So how will quantum computers search anything, other than tuning parameters?
"
"['fidelity', 'state-space-geometry']"," Title: What is the difference between the ""Fubini-Study distances"" $\arccos|\langle\psi|\phi\rangle|$ and $\sqrt{1-|\langle\psi|\phi\rangle|}$?Body: I sometimes see the ""Fubini-Study distance"" between two (pure) states $|\psi\rangle,|\phi\rangle$ written as
$$
d(\psi,\phi)_1=\arccos(|\langle\psi|\phi\rangle|),
$$
for example in the Wikipedia page.
Other sources (e.g. this paper in pag. 16), use the definition
$$
d(\psi,\phi)_2=\sqrt{1-|\langle\psi|\phi\rangle|}.
$$
What is the difference between these two definitions? Is one preferred over the other?
"
"['qiskit', 'programming', 'noise']"," Title: How is quantum error applied to the qubits?Body: I am trying to check the way qiskit has the noise implemented. I have read how is this theoretically done using quantum channels (see Nielsen and Chuang chapter 8) and I want to verify if qiskit follows the same procedure. I have started by the bit-flip error using the pauli_error function. Finally it creates a quantum error object which can be added to the NoiseModel object. However when adding this you have to use the add_all_qubit_quantum_error function and I do not really understand how this works. It is supposed to add the quantum error to all qubits when given a set of gates as an argument, as in the following example:
# Example error probabilities
p_reset = 0.03
p_meas = 0.1
p_gate1 = 0.05
# QuantumError objects
error_reset = pauli_error([('X', p_reset), ('I', 1 - p_reset)])
error_meas = pauli_error([('X',p_meas), ('I', 1 - p_meas)])
error_gate1 = pauli_error([('X',p_gate1), ('I', 1 - p_gate1)])
error_gate2 = error_gate1.tensor(error_gate1)
# Add errors to noise model
noise_bit_flip = NoiseModel()
noise_bit_flip.add_all_qubit_quantum_error(error_reset, ""reset"")
noise_bit_flip.add_all_qubit_quantum_error(error_meas, ""measure"")
noise_bit_flip.add_all_qubit_quantum_error(error_gate1, [""u1"", ""u2"", ""u3""])
noise_bit_flip.add_all_qubit_quantum_error(error_gate2, [""cx""])
print(noise_bit_flip)
However I do not know when the bit-flit is applied. Is it applied everytime one gate that can be decomposed in any of the ones of the list [""u1"", ""u2"", ""u3""]? What I need to know is how often it is applied and with which criterion.
Thank you for your help!
"
"['algorithm', 'shors-algorithm']"," Title: Quantum computing w.r.t. the many-worlds theoryBody: Quantum algorithms are inherently probabilistic. Let's say I run Shor's factoring algorithm on some number. There's a chance that the output I observe is incorrect. Does the many-worlds theory suggest that I'm simply in a universe where the output happened to be wrong? Because the probability of error is slim, does that mean the vast majority of universes realize a correct execution of the algorithm?
Edit: Thanks to Mark S for pointing me to Effects of quantum computing on parallel universes which fully explores my question. Also, a big thanks to everyone who commented here! The questions raised and resources raised have only helped to enhance my curiosity about the subject.
"
['ibm-q-experience']," Title: Problem with circuit composer results tabBody: I'm trying to run a simulation of the following circuit:
on the ibmq_qasm_simulator, but it only shows the ""Circuit diagram"" without the ""Circuit Implementation"" and ""Results tab"".
Did someone had that problem before ?
Note: Ever since it happened, every simulation I ran before started to have this problem too.
"
"['quantum-state', 'entanglement', 'circuit-construction', 'measurement']"," Title: Unentangling a qubit from a system: can we convert $\alpha|000\rangle+\beta|111\rangle$ into $\alpha|00\rangle+\beta|11\rangle$?Body: Let's say I start with the following arbitrary qubits:
$$
\color{red}{\vert Q_1 \rangle = \alpha_1 \vert 0 \rangle + \beta_1 \vert 1 \rangle}\\
\color{green}{\vert Q_2 \rangle = \alpha_2 \vert 0 \rangle + \beta_2 \vert 1 \rangle}\\
\color{blue}{\vert Q_3 \rangle = \alpha_3 \vert 0 \rangle + \beta_3 \vert 1 \rangle}
$$
where $\forall i : \,\,|\alpha_i|^2 + |\beta_i|^2 = 1$.
I then decide to entangle all these qubits to obtain:
$$
\vert \psi \rangle = \alpha \vert \color{red}{0}\color{green}{0}\color{blue}{0} \rangle + \beta \vert \color{red}{1}\color{green}{1}\color{blue}{1} \rangle
$$
where $|\alpha|^2 + |\beta|^2 = 1$.
Now, I realize that I don't need the second qubit to be entangled with the others, so I unentangle it to obtain the following:
$$
\begin{align}
\vert \psi \rangle &= \alpha \vert \color{red}{0}\color{blue}{0} \rangle + \beta \vert \color{red}{1}\color{blue}{1} \rangle
\end{align}
$$
I don't really care about qubit two anymore. It can be measured to destroy its superposition or even be set to anything else. The point is I unentangle it from the system. Is such thing possible? If yes, what is the mathematics and the physical realization behind this?
"
"['programming', 'qiskit', 'ibm-q-experience', 'ibm']"," Title: 'IBMQFactory' object has no attribute 'load_accounts'Body: I am following this qiskit workshop from https://colab.research.google.com/github/mtreinish/qiskit-workshop/blob/master/Workshop.ipynb . After adding my API key I had encountered the error 'IBMQFactory' object has no attribute 'load_accounts' when running qiskit.IBMQ.load_accounts(). How do I fix this?
"
"['qiskit', 'ibm-q-experience']"," Title: Vey different results between qasm_simulator and quantum computerBody: I've started playing around with circuits only recently and decided to try out and implement a 4-qubit Grover's search using qiskit.
When I run my python script using the qasm_simulator, I get the expected results with a probability peak over the value 0010 as expected (the value marked by my oracle).
However, when I change the backend to basically anything else on IBMQ (ibmqx2, ibmq_essex, ibmq_vigo), the results get very different. There is no apparent peak in the distribution whatsoever, not even if I repeat the amplitude amplification process - I use the ""iterations"" variable for that further in the code - works nicely with qasm_simulator, but seems to have no real effect on a quantum computer.
I feel like I'm doing something fundamentally wrong, but I simply cannot figure it out.
Here's my code:
import math
from qiskit import IBMQ, BasicAer
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.visualization import plot_histogram
pi = math.pi
provider = IBMQ.load_account()
def oracle(circuit, qr):
circuit.x(qr[0])
circuit.x(qr[2])
circuit.x(qr[3])
circuit.cu1(pi/4, qr[0], qr[3])
circuit.cx(qr[0], qr[1])
circuit.cu1(-pi/4, qr[1], qr[3])
circuit.cx(qr[0], qr[1])
circuit.cu1(pi/4, qr[1], qr[3])
circuit.cx(qr[1], qr[2])
circuit.cu1(-pi/4, qr[2], qr[3])
circuit.cx(qr[0], qr[2])
circuit.cu1(pi/4, qr[2], qr[3])
circuit.cx(qr[1], qr[2])
circuit.cu1(-pi/4, qr[2], qr[3])
circuit.cx(qr[0], qr[2])
circuit.cu1(pi/4, qr[2], qr[3])
circuit.x(qr[0])
circuit.x(qr[2])
circuit.x(qr[3])
def amplification(circuit, qr):
circuit.h(qr)
circuit.x(qr)
circuit.cu1(pi/4, qr[0], qr[3])
circuit.cx(qr[0], qr[1])
circuit.cu1(-pi/4, qr[1], qr[3])
circuit.cx(qr[0], qr[1])
circuit.cu1(pi/4, qr[1], qr[3])
circuit.cx(qr[1], qr[2])
circuit.cu1(-pi/4, qr[2], qr[3])
circuit.cx(qr[0], qr[2])
circuit.cu1(pi/4, qr[2], qr[3])
circuit.cx(qr[1], qr[2])
circuit.cu1(-pi/4, qr[2], qr[3])
circuit.cx(qr[0], qr[2])
circuit.cu1(pi/4, qr[2], qr[3])
circuit.x(qr)
circuit.h(qr)
qr = QuantumRegister(4)
cr = ClassicalRegister(4)
iterations = 1
groverCircuit = QuantumCircuit(qr, cr)
# apply Hadamard gate to all qubits
groverCircuit.h(qr)
while iterations > 0:
oracle(groverCircuit, qr)
amplification(groverCircuit, qr)
iterations -= 1
# measure
groverCircuit.measure(qr, cr)
provider.backends()
backend = provider.get_backend('ibmqx2')
# backend = BasicAer.get_backend('qasm_simulator')
shots = 1024
results = execute(groverCircuit, backend=backend, shots=shots).result()
answer = results.get_counts()
print(answer)
print(plot_histogram(answer))
For example, this is one of the probability distributions I got from a quantum computer, where the 0010 value should have been amplified:
"
"['quantum-gate', 'entanglement', 'grovers-algorithm', 'q#', 'oracles']"," Title: Controlled NOT gate using multiple control qubits in Q#Body: I am trying to implement the Grover's search algorithm using Q# and I am not able to implement the oracle (black box) part for the search of state $|1010\rangle$. How to implement the controlled NOT gate using 5 qubits with 4 qubits (q[0] ... q[3]) used as the control qubits and q[4] as the target qubit in Q#?
Please correct me if this is wrong, I am trying to implement Grover's algorithm using 4 qubits where 3 qubits are for the states and the 4th qubit is the auxiliary qubit so the auxiliary bit should be the target qubit?
"
"['measurement', 'entropy', 'information-theory']"," Title: Quantum state discrimination and lower bound for conditional von Neumann entropyBody: Consider two quantum states $\rho_A$ and $\sigma_A$, and define the classical-quantum state over a classical binary system $B$ and $A$,
$$\omega_{AB}^\epsilon :=\epsilon \vert 0 \rangle \langle 0 \vert \rho_A + (1-\epsilon) \vert 1 \rangle \langle 1 \vert \sigma_A.$$ I am interested in the conditional von Neumann entropy
$S(B\vert A)_{\omega_{AB}^\epsilon} = S(\omega_{AB}^\epsilon)- S(\omega_{A}^\epsilon)$. This is related to quantum state discrimination.
If $\rho_A$ and $\sigma_A$ are orthogonal, it is easy to show that $S(B\vert A)=0$. In case they are not orthogonal, I seek a lower bound of the form
$$S(B\vert A) \ge -c_1\epsilon \ln \epsilon + c_2 \epsilon,$$
where $c_1>0$ and $c_2$ is any constant. I am particularly interested in the case where $c_1$ does not depend on the dimensionality of $A$, and applies even in the countably-infinite dimensional case.
One can derive a bound of this type for a classical system in the following way. Define $c = \max_a [\min\{\rho_A(a), \sigma_A(a)\}]$, and let $\hat{a}$ indicate the state of $A$ such that $c = \min\{\rho_A(\hat{a}), \sigma_A(\hat{a})\}$. Then, write
\begin{align}
S(B|A)&=\sum_a\left[\epsilon \rho_A(a)\ln\frac{\epsilon \rho_A(a)+(1-\epsilon)\sigma_A(a)}{\epsilon \rho_A(a)} + (1- \epsilon) \sigma_A(a)\ln\frac{\epsilon \rho_A(a)+(1-\epsilon)\sigma_A(a)}{(1- \epsilon)\sigma_A(a)}\right]\\
&\ge \epsilon \rho_A(\hat{a})\ln\frac{\epsilon \rho_A(\hat{a})+(1-\epsilon)\sigma_A(\hat{a})}{\epsilon \rho_A(\hat{a})}\\
&\ge \epsilon \rho_A(\hat{a})\ln\frac{c}{\epsilon \rho_A(\hat{a})}\\
&= -\epsilon \rho_A(\hat{a})\ln\epsilon +\epsilon \rho_A(\hat{a})\ln \frac{c}{\rho_A(\hat{a})}
\end{align}
However, I have not seen something similar for the quantum case.
"
"['programming', 'simulation', 'hamiltonian-simulation', 'qutip']"," Title: Strange Behaviour of MeSolve, McSolveBody: I'm using Qutip to plot some basic two level dynamics using hamiltonians with a temporal envelope defined as the sum of two error functions, designed to make it more representative of experimental conditions.
I'm using the following code.
import numpy as np
from qutip import *
from scipy.special import erf
import matplotlib.pyplot as plt
def pulseEdge(x, x0, sigma):
pulseEdge = ((erf((x-x0)/sigma)) +1.)/2.
return pulseEdge
def pulse(t, tOn, tOff, sigma):
return pulseEdge(t, tOn, sigma)* (1.-pulseEdge(t, tOff, sigma))
def H(t, args):
H = Qobj([[0.,1],[1,0.0]])
envelope = pulse(t, 2,2+np.pi/2,0.2)
return H*envelope
tlist = np.linspace(0,10,1000)
h = np.array([H(t,0)[0][0] for t in tlist])
H_list = H
psi0 = basis(2,0)
basisStates = [basis(2,i) for i in range(2)]
e_ops = [b*b.dag() for b in basisStates]
me =mesolve(H_list, psi0, tlist, progress_bar = None, e_ops = e_ops)
plt.plot(me.expect[0])
plt.plot(me.expect[1])
plt.plot(h)
plt.show()
Which works really well and produces the desired output, a $\pi$ Rabi oscillation driven by a $\pi$ pulse. The red is the envelope of the Rabi hamiltonian, and the orange and blue are the (expected) populations of the upper and lower states of a two level system undergoing a pi pulse. This is the expected behaviour.
Except if I want the pulse one time unit later, when no evolution is driven. The code is exactly the same, except the hamiltonian function is modified to the following
def H(t, args):
H = Qobj([[0.,1],[1,0.0]])
envelope = pulse(t, 3,3+np.pi/2,0.2)
H*=envelope
return H
which produces
Or if I want the edges to be sharper, when again, no evolution occurs
def H(t, args):
H = Qobj([[0.,1],[1,0.0]])
envelope = pulse(t, 2,2+np.pi/2,0.01)
H*=envelope
return H
What element of these time dependent Hamiltonians functions is causing mesolve to correctly calculate the dynamics in some cases, and completely fail in others?
The difference between the Hamiltonians in the above plots seems minor and arbitrary to me, and the rest of the code is identical between plots.
EDIT
After Paul Nation's answer, here is updated, working code.
import numpy as np
from qutip import *
from scipy.special import erf
import matplotlib.pyplot as plt
def pulseEdge(x, x0, sigma):
pulseEdge = ((erf((x-x0)/sigma)) +1.)/2.
return pulseEdge
def pulse(t, tOn, tOff, sigma):
return pulseEdge(t, tOn, sigma)* (1.-pulseEdge(t, tOff, sigma))
def H(t, args):
H = Qobj([[0.,1],[1,0.0]])
envelope = pulse(t, 2,2+np.pi/2,0.01)
H*=envelope
return H
tlist = np.linspace(0,10,1000)
h = np.array([H(t,0)[0][0] for t in tlist])
H_list = H
psi0 = basis(2,0)
basisStates = [basis(2,i) for i in range(2)]
e_ops = [b*b.dag() for b in basisStates]
options = Options(max_step = 1)
me =mesolve(H_list, psi0, tlist, progress_bar = None, e_ops = e_ops, options = options)
plt.plot(me.expect[0])
plt.plot(me.expect[1])
plt.plot(h)
plt.show()
"
"['algorithm', 'circuit-construction', 'shors-algorithm']"," Title: How to implement modular exponentiation efficiently in Shor's algorithm?Body: I'm a noob in quantum computing and I'm trying to get Shor's algorithm working on Q# (the language is unrelated). However, I'm stuck on computing $f(x)$s in the quantum circuit. Let $N\sim \log_2(n)$ be the number of qubits needed for finding the period. As far as I know, we can initialize $s=1$, and multiply it with $a,a^2,a^4 \cdots a^{2^{N-1}} \mod n$ according to the $N$ control qubits. However, all methods I can think of needs around $O(N^2)$ modulus and thus $O(N^2)$ ancillary clean qubits (for example, compute $a,a^2,a^4 \cdots a^{2^{N-1}}\mod n$ beforehand, use additions, comparing numbers and subtracting accordingly). Is there a way to implement modulus as some reversible circuit? Or, am I all wrong?
"
"['quantum-gate', 'quantum-state', 'ibm-q-experience']"," Title: What is the $\lambda$ parameter in the $U3$ gate used for?Body: The most general single qubit gate is $\mathrm{U3}$ given by matrix
$$
\mathrm{U3}=
\begin{pmatrix}
\cos(\theta/2) & -\mathrm{e}^{i\lambda}\sin(\theta/2) \\
\mathrm{e}^{i\phi}\sin(\theta/2) & \mathrm{e}^{i(\phi+\lambda)}\cos(\theta/2)
\end{pmatrix}.
$$
If the gate is applied on qubit in state $|0\rangle$ again the most general description of quantum state is obtained, i.e.
$$
|\varphi_0\rangle = \cos(\theta/2)|0\rangle + \mathrm{e}^{i\phi}\sin(\theta/2)|1\rangle,
$$
where angles $\phi$ and $\theta$ describe position of the state on Bloch sphere.
When the gate is applied on qubit in state $|1\rangle$, the result is
$$
|\varphi_1\rangle = \mathrm{e}^{i\lambda}(-\sin(\theta/2)|0\rangle + \mathrm{e}^{i\phi}\cos(\theta/2)|1\rangle)
$$
Obviously term $\mathrm{e}^{i\lambda}$ can be ignored because it is the global phase of a state.
I can imagine that global phase can be useful for constructing contolled global phase gate but it can be implemented as $\mathrm{Ph}(\lambda) \otimes I$,
where
$$
\mathrm{Ph}(\lambda) =
\begin{pmatrix}
1 & 0 \\
0 & \mathrm{e}^{i\lambda}.
\end{pmatrix}
$$
My question is: What a parameter $\lambda$ in $\mathrm{U3}$ is used for?
"
"['quantum-operation', 'optimization', 'entropy', 'semidefinite-programming']"," Title: Forbidden/allowed outputs of a quantum channelBody: The coherent information of a channel $\mathcal{E}_{A'\rightarrow B}$ is defined as the maximum value obtained by the following function where the maximization is over all input states
$$I_{\rm{coh}}(\mathcal{E}) = \max_{\rho_{A'}} S(\mathcal{E}(\rho_{A'})) - S((I_A\otimes \mathcal{E})(\rho_{AA'})),$$
where $\rho_{AA'}$ is the purification of $\rho_{A'}$. I can think in terms of the complementary channel $\mathcal{E}^c_{A'\rightarrow E}$ instead and the optimization becomes
$$I_{\rm{coh}}(\mathcal{E}) = \max_{\rho_{A'}} S((I_A\otimes \mathcal{E^c})(\rho_{AA'})) - S(\mathcal{E^c}(\rho_{A'}))$$
Suppose I forget about the channel for a moment and only look at the registers $A$ and $E$. Clearly, the state that maximizes the coherent information is the maximally mixed state $I_{AE}$. In some sense, this is the ideal output state that we try to achieve. For any strictly noisy channel, it must hold that there exists no pure input $\rho_{AA'}$ such that
$$(I\otimes \mathcal{E^c})\rho_{AA'} = I_{AE}$$
Is there a general way to see this impossibility/possibility result for arbitrary states on the right hand side? In other words, if I am given a channel and its complementary channel (but don't know its capacity) and a ""target"" state $\rho_{AE}$, can I efficiently prove that there exists/cannot exist a pure input $\rho_{AA'}$ that satisfies
$$(I\otimes \mathcal{E^c})\rho_{AA'} = \rho_{AE}$$
"
"['classical-computing', 'performance', 'quantum-parallelism', 'quantum-turing-machine']"," Title: Does the massive parallelization in Quantum computing imply parallelization of input (as opposed to Turing machine)?Body: Being a newbie in this field, I'm trying to understand what types of real-life workloads are suitable for migrating to Quantum computers.
Intuitively, it seems to me that if a Quantum computer ingests data by reading symbols one-by-one from a tape, exactly like a classical Turing machine, it would be impossible for it to outperform the Turing machine. It seems that optimization can be achieved only if a parallel method of ingesting the input is implemented.
Is this true? Does this mean that, if I want to migrate a workload to a Quantum computer for better performance, I should first try to parallelize it as much as possible?
I'd like to clarify my question with an example:
The classical multiple string-match problem - namely, ""Given a string-set $L \subseteq \Sigma∗$ and an input stream $W \in \Sigma∗$, find all occurrences of any of the strings in $L$ that are substrings of $W$"" - is considered a 'solved problem', where many algorithms solve it in $O(n)$. However, almost all of these algorithms have a hidden constraint - they assume that the input is fed to them sequentially.
It is obvious that when a cell extracts information from its DNA strand, or when a person reads a newspaper, they do not read the 'symbols' from left to right, or in any strict order for that matter. Still, strict order is usually enforced both in DNA analysis algorithms and in text analysis algorithms.
So my question is: do we need to come up with completely different quantum-based solutions for such problems, or is there a way to 'interpret' existing algorithms to the quantum domain and still expect some speedup?
Edit (and some thoughts):
Arguing that speedup requires handling parallelized input may lead to the following (pretty radical) conclusion: Order is overrated.
Computer Science 101 is all about for() loops - maybe out of habit. Yet multithreading, hyperthreading, multicore, SIMD, DPDK, FPGA, and Quantum Computing, all considered major advancements, are all about parallelizing workloads and breaking the 'serial computing' paradigm. But at the moment we are stuck with cloud servers running endless loops and contributing to 'Pollution-as-a-Service'.
The next generation of programmers should probably learn Parallel and Quantum Computing in Computer Science 101, and treat for() loops as a last resort...
"
['qiskit']," Title: Return the value of a selected Qubit from QiskitBody: I have a quantum circuit and the job has been run on the ""statevector"" backend, which runs only 1 shot.
Therefore is there a way to return the qubit state (0 or 1) specifically when selected specifically ?
"
"['quantum-gate', 'qiskit']"," Title: How to obtain the noise of a circuit in Qiskit?Body: I referred to the following Qiskit's document: state_fidelity.
The inputs of state_fidelity are quantum state vectors or density matrices.
For example, $|00\rangle$ or $|0\rangle \langle0|$.
Now, let me assume a circuit is described as follows.
The above circuit with no noise provides $\frac{1}{\sqrt{2}}( |00\rangle + |11\rangle )$ .
When I would like to measure the noise of this circuit, I use state_fidelity and compare the measurements and $\frac{1}{\sqrt{2}}( |00\rangle + |11\rangle )$.
Here, we have to obtain the state vector such as numpy.array([***]).
However, I received the following error: AerError: 'statevector_simulator does not support noise.' when I set backend = Aer.get_backend('statevector_simulator')
to get the state vectors.
When I use qasm_simulator with noise_model (cf. How can noise on a device be simulated using measured noise parameters?), I obtained the following error: 'No statevector for experiment ""None"". However, I could obtain the counts by result().get_counts.
How can I obtain the state vector with noise_model?
Do I have to calculate the state vector from the counts?
I append the code as below.
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
# Loading your IBM Q account(s)
provider = IBMQ.load_account()
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
from qiskit import *
import numpy as np
from qiskit.providers.aer import noise
properties = device.properties()
noise_model = noise.device.basic_device_noise_model(properties)
basis_gates = noise_model.basis_gates
def test():
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q,c)
qc.h( q[0] )
qc.cx( q[0], q[1] )
qc.measure(q,c)
return qc
# test().draw()
def test2():
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q,c)
qc.h( q[0] )
qc.cx( q[0], q[1] )
# qc.measure(q,c)
return qc
# test2().draw()
backend = Aer.get_backend('qasm_simulator')
simulator = Aer.get_backend( 'qasm_simulator' )
job1 = execute( test(), backend, noise_model = noise_model, basis_gates= basis_gates, shots = 100 ).result().get_statevector()
backend = Aer.get_backend('statevector_simulator')
simulator = Aer.get_backend( 'statevector_simulator' )
job2 = execute( test2(), backend, noise_model=noise_model, shots = 100 ).result().get_statevector()
Thank you.
"
"['qiskit', 'neural-network', 'pennylane']"," Title: PennyLane operations - Kerr, Displacement and SqueezeBody: I am familiar with the quantum gates of Qiskit, but I become very confused when looking at the continuous variable (CV) operations in the PennyLane documentation. I am especially interested in the Karr, Squeeze and Displacement operators as I have seen them used in Quantum Neural networks. See here.
I don't understand the mathematical representations of these operators. How would one implement them on for example Qiskit?
"
"['noise', 'decoherence']"," Title: Rigorous definition of phenomenological master equation for decoherenceBody: I need to have a resource in which phenomenological decoherence model are well defined and explained.
Indeed, from what I read there are three usual timescales considered to model decoherence of a qubit: $T_1,T_2,T_2^*$
$T_1$ from what I understood is the typical time for which the qubit will fall in the ground state
$T_2$ is the typical time for which the qubit will lose its coherence. More precisely that the quantum superposition between excited and ground state will become a classical mixture
$T_2^*$ is the one that confuses me the most but represents the following as far as I understood.
I take two qubits $A$ and $B$ in some superposition of excited and ground states. I call $\phi_1$ and $\phi_2$ their respective angle to the $x$ axis of the Bloch sphere.
If $T_2^*$ is infinite: $\forall t, \phi_1(t)-\phi_2(t)=\phi_1(0)-\phi_2(0)$
$T_2^*$ thus represent the typical time for which $\phi_1(t)-\phi_2(t)$ is a uniform random variable that can take any value in $[0,\pi]$ (I don't know at all what is the relative phase between the two).
I don't know if there is a way to make this definition more precise.
Now, in practice, a reasonable model for some physical situations in which we assume the noise is markovian is a master equation like:
$$ \frac{\partial \rho}{\partial t} = \frac{1}{i \hbar} [H,\rho]+\sum_i \gamma_i D[X_i](\rho) $$
Where:
$$D[X_i](\rho)=X_i \rho X_i^{\dagger} - \frac{1}{2} X_i^{\dagger} X_i \rho - \frac{1}{2} \rho X_i^{\dagger} X_i $$
And $H$ is the hamiltonian of the system that may include the drive to manipulate our qubit (if we want to perform a gate for example).
My questions are:
- How to relate this master equation to those phenomenological times ? Would I be correct to do the following:
$$(\gamma_1, X_1)=(\frac{1}{T_1}, |g\rangle \langle e|)$$
$$(\gamma_2, X_2)=(Max(\frac{1}{T_2^*},\frac{1}{T_2}) , \sigma_z)$$
- Would you agree that it can be considered as a phenomenological model to describe two level system evolution ? For example if in some experiment they give values of $T_1$, $T_2$, $T_2^*$, as a first approximation the dynamic can be modelled like this
- Are there good resources that state clearly what I said. I would like to have a reference clearly stating master equation description relating the $T_1$ $T_2$ $T_2^*$ like I tried to do here.
- I have heard somewhere that ""in general"" we have: $T_2^* < T_2 < T_1$, do you confirm that it is indeed the case in most physical situations ?
- Do you agree with my understanding of $T_2^*$ ? Am I wrong in my formulation of its meaning ?
- Is the master equation written in the rotating frame at the frequency of the qubit (interacting picture) ? So the noises rate are indeed time independent and correspond to the inverse of the $T_i$ ?
"
"['quantum-state', 'ibm-q-experience', 'density-matrix', 'tomography']"," Title: Implementation of tomography on IBM QBody: I wanted to ask how do you implement a circuit that finds the non-diagonal values of the density matrix of a quantum state on IBM Q?
"
"['qiskit', 'programming', 'quantum-operation', 'noise', 'kraus-representation']"," Title: How does qiskit finally implement a noise model?Body: I have been reading qiskit documentation for hours and I still don't get how does it implements noise in the circuit. I have understood that it works with a objects of the class QuantumError which finally gives a zip of the quantum instructions (quantum gates that can be applied to the circuit) and the probability of each instruction. Once we have this, how is it really applied to the circuit when we use the add_all_qubit_quantum_error to add the error to the noise model? What I want to do is to check if it is theoretically correct as for a quantum channel the most efficient form to apply this will be to use the Kraus representation:
$$\mathcal E(\rho)=\sum_{k=1}^M E_k \rho E_k^\dagger.$$
For example for the bit-flip case the corresponding Kraus operators E_k will be:
Therefore to add the quantum noise for the bit-flip case we will need to multiply the density matrix of our state by the Kraus operator and its hermitian conjugate as we can see in the Kraus representation of a quantum channel. However I don't understand how can this corresponds with what I have read in the documentation as finally the functions such as pauli_error and so on end up returning a QuantumError object which is finally written as a zip of instructions and probabilities which I guess are append to the circuit in someway. I have carefully read the source code of every noise function that is used to implement the different types of noise and I am not able to figure out whether it is the same as implementing the corresponding Kraus errors, I would be extremely grateful if someone could answer me.
"
"['quantum-gate', 'pauli-gates']"," Title: What is the difference between the action of $Z$ and $\exp(-i Z t)$ on a state?Body: What is the difference between performing $Z$ operation and performing $e^{-i Zt}$ operation on a state, given that $e^{-i Zt}= \mathbb{1} + (-i Zt) + ...$ is not equal to $Z$ for any value of $t$?
"
['ibm-q-experience']," Title: How to prepare mixed states using IBM quantum experience?Body: I want to prepare some mixed states regarding a project that I am doing, however, I am not sure how to do that using IBM Q. Experience circuit composer. Basically, I am looking to prepare maximally mixed and non-maximally mixed quantum states.
I have attached the circuit which I could come up with.
"
"['qiskit', 'ibm-q-experience', 'qasm']"," Title: How to run a qasm file on IBMQ device?Body: I can find many qasm examples.
How can I run them on different IBMQ devices?
"
"['algorithm', 'speedup', 'amplitude-amplification', 'hidden-subgroup-problem']"," Title: The relationship between problem structure and exponential speedups under the query modelBody: What problem structure(s) are required to admit an exponential speedup in the universal quantum model of computation under the query model?
Intuitively, it would seem that much of the benefit of the quantum model, as is often suggested, is due to the ability to compute the solution in an exponentially large Hilbert space – i.e. a superposition of exponentially many possible states. We apply functions, encoded as unitary operators, to orchestrate useful interference over the amplitudes of the state space and repeat to a desired precision and measure. However, this is in essence the amplitude amplification framework inspired by Grover, which is not known to yield an exponential speedup for any problem.
So recently, I've been digging into this line of inquiry. Aaronson & Ambainis (2014), Ben-David(2011) Chailloux (2018) (among others) studied the above question, however, to date it seems that it is unresolved (not least because it seems to be a very hard problem from a complexity standpoint). That said, on the basis of existing algorithms, Aaronson and Ambainis suggest:
In the context of most existing quantum algorithms, “structured”
basically means that we are trying to determine some global property
of an extremely long sequence of numbers, assuming that the sequence
satisfies some global regularity. As a canonical example, consider
PERIOD-FINDING, the core of Shor’s algorithms for factoring and
computing discrete logarithms...The requirement of periodicity is
crucial here: it is what lets us use the Quantum Fourier Transform
to extract the information we want from a superposition...For other
known quantum algorithms, X needs to be (for example) a cyclic shift
of quadratic residues or constant on the cosets of a hidden subgroup.
This, as might be presumed, is different from the approach taken by amplitude amplification – setting aside the notion of finding a global property within a sequence with assumed global regularity. So, my question is, dipping below the surface, what is the intuition around the kinds of problems that yield quantum algorithms with an exponential speedup under the query model? Can we simply put it down to period finding and hidden subgroups or is there a higher level intuition that captures the interplay between the problem structure and the properties of quantum information (i.e. entanglement, superposition, and interference) that seem superficially necessary for an exponential speedup?
"
"['error-correction', 'fault-tolerance']"," Title: Quantum error correction - approximate vs exactBody: When one has a noisy quantum channel over which one wishes to send some quantum state, one usually comes up with an encoder and decoder. Then, the error between the input state and the output state is some $\epsilon$ which vanishes in the limit where we use the channel infinitely many times.
For quantum circuits, we have a slightly different setting. Here, we wish to act some unitary on a quantum state but unfortunately, this unitary is noisy because our gates are noisy. We once again encode the input state (the logical state) into some codespace (the physical qubits) and act the unitary on t. Now, measuring the output reveals the ""syndrome"" of the error which can then be reversed. Thus, the error is corrected but notice that this process is exact - the final state is exactly what we would have gotten if the circuit was noiseless.
Are there techniques for approximate quantum error correction, where some small error is allowed but this error vanishes in some limit (say large number of qubits) that performs better than zero error QEC?
"
"['algorithm', 'amplitude-amplification']"," Title: What is an exact quantum algorithm?Body: In the literature, there is a distinction between exact and error-bounded quantum algorithms. The former must solve a problem with a zero probability of error, whereas the latter only needs to bound the probability of error away from some constant (typically strictly less than $\frac{1}{3}$).
My questions are these:
- How do algorithms of each type differ?
- What are examples of exact algorithms?
- Can you use amplitude amplification in an exact algorithm?
"
"['quantum-state', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Quantum PCA State PreparationBody: In Quantum Algorithm Implementations for Beginners is an example of the Quantum PCA with an given 2 x 2 covariance matrix $\sum$.
The steps for state preparation are given in the paper. The steps are:
- calculate covariance matrix $\sum$ from the data
- compute density matrix $\rho = \frac{1}{Tr(\sum)}*\sum$
- calculate two-qubit pure quantum state $| \psi \rangle$
- calculate the unitary operator $U_{prep}$
I wanna comprehend the example from the paper. So far I got the density matrix $\rho$. I would be glad if someone could explain me how to calculate the quantum state $| \psi \rangle$ and futhermore $U_{prep}$.
"
"['quantum-gate', 'complexity-theory', 'simulation', 'clifford-group', 'gottesman-knill']"," Title: Why are non-Clifford gates more complex than Clifford gates?Body: There are two groups of quantum gates - Clifford gates and non-Clifford gates.
Representatives of Clifford gates are Pauli matrices $I$, $X$, $Y$ and $Z$, Hadamard gate $H$, $S$ gate and $CNOT$ gate. Non-Clifford gate is for example $T$ gate and Toffoli gate (because its implementation comprise $T$ gates).
While Clifford gates can be simulated on classical computer efficiently (i.e. in polynomial time), non-Clifford gates cannot. Moreover (if my understanding is correct), non-Clifford gates increase time consumption of a quantum algorithm far more than Clifford gates.
My questions are these:
- Am I right that non-Clifford gates increase time consumption (or complexity of quantum algorithm)?
- Why non-Clifford gates cannot be simulated efficiently? This is confusing for me, because $S$ and $T$ gates are both rotations with only different angle.
"
"['quantum-state', 'optimization']"," Title: Quantum algorithm for binary assignment problemBody: Based on the properties of the qubit, how could I solve this problem:
- I have 3 person A B C and 2 taxis T1 and T2
- A and B are friends
- B and C hate each other
- A and C hate each other
How could I maximize the pairs of people (A,C), (A,B) and (B,C) which are friends
and minimize the pairs of people who hate each other using qubits?
I know that 'pair' means entangled, so I have the possible 'pairs' in a quantum state
$$ a|AB\rangle +b|AC\rangle+c|BC\rangle $$
satisfying $ |a|^{2}+|b|^{2}+|c|^{2}=1 $ after normalization.
"
['grovers-algorithm']," Title: Grover’s algorithmBody: According to some references (Lectures on Quantum Computation at Carnegie Mellon School of Computer Science) Grover’s algorithm uses only O($\sqrt{N}\ln {N}$) gates.
Using this to calculate desired hash (such as you have in Bitcoin) will require, as I interpret the above - $256\times{2^{128}}$ gates.
Is this correct interpretation?
"
"['quantum-state', 'notation']"," Title: What are $|+\rangle$ and $|-\rangle$?Body: On a view places, I've seen kets that look like this $\left|+\right>$ or this $\left|-\right>$ but I don't seem to find any explanation of this base online. Is it just a different notation for $0$ and $1$, or does it mean something else? Thanks for your help!
"
"['measurement', 'zx-calculus']"," Title: ZX-calculus : measurement and output probabilitiesBody: I'm discovering ZX-Calculus, and it seems to be much easier to do computations on circuit that would take much more time with the usual formalism. However, I can't find a nice way to represent measurements (instead of post-selection) and compute the output probabilities. I have the feeling that normalisation and adding variables to a ""one-leg"" spiders could help, but I'm not yet convinced that it's the good way to go.
And for example, can ZX-calculus deal with ""impossible""/not normalisable circuits, like ""create a plus state and project it on minus"" ?
Thanks!
"
"['quantum-state', 'entanglement', 'measurement', 'error-correction']"," Title: The behaviour of ebits in Entanglement-assisted Quantum Error Correction Codes?Body: I am reading about Entanglement-assisted Quantum Error Correction Codes from Quantum Information Processing and Quantum Error Correction: An Engineering Approach (Chapter 9) . It is a scheme that allows the usage of any classical error correction code. Furthermore, it uses entangled qubits (ebits) which is the Bell state $\vert \Phi^+ \rangle$. It is assumed to be error-free and shared between the sender Alice and receiver Bob, prior to the start of the communication.
Alice will encode her state $\vert \psi \rangle$ with the help of local ancillary qubits $\vert 0 \rangle$ and her half of shared ebits. She will then sends the encoded qubits over a noisy quantum channel.
The book then states:
Notice that the channel does not affect the receiver’s half of shared
ebits at all.
How is that even possible? I thought if one entangled subsystem changes, then the other changes automatically.
Furthermore, consider the following (to make it simple, assume one ebit is used which is shared between Alice and Bob before communication begins). Let us say Alice will send her half of the ebit over the noise channel and a bit-flip occurred, what happens to the other half (Bob's half)?
"
['quantum-state']," Title: Why do we need different basis vectors?Body: There is a basis consisting of $|0\rangle$ and $|1\rangle$ states, i.e. z-basis. Why do we need different basis (in quantum computation), like polar basis and others ($|+\rangle$ and $|-\rangle$)?
"
"['quantum-state', 'fidelity']"," Title: Can I compute the fidelity between two states without having to diagonalise them?Body: So I have been given the following quantum states:
$$\rho = \frac{I}{2} + \frac{\bar{s}.\bar{\sigma}}{2}$$
$$\pi = \frac{I}{2} + \frac{\bar{r}.\bar{\sigma}}{2}$$
How do I calculate the fidelity between the two?
I know that the general formula for fidelity is: $tr\sqrt{\rho^{1/2}\pi\rho^{1/2}}$
I want to know if there's any way to calculate the fidelity other than to go through the mess of diagonalizing the respective matrices of $\rho \text{ and } \pi$.
"
"['programming', 'quantum-state', 'entanglement', 'classical-computing']"," Title: Does quantum computing already possess the level of abstraction to be explicable even without knowledge of physics?Body: Currently, quantum computer science (in contrast to classical computer science) can mostly only be understood if one has a good inside knowledge of physics, or more precisely quantum physics. Only then one can really understand the explanations of superposition, coherence, entanglement, etc. in relation to Qubits. I felt the same way and had to take the extra physics course, in order to really get into Quantum Computing.
However, I heard more and more that it is ""theoretically"" possible to abstract quantum computer science to such a degree, that knowledge in physics is no longer required. Is there any truth to this or is it just way too conceptual so far?
(And yes, I am aware that this question might be more related to didactics rather than on-topic with this board. But I wasn't quite sure if I should've posted it on StackOverflow. So, forgive my error, given I've done one)
"
['qiskit']," Title: Installing Qiskit Error: Building wheel failed!Body: I have been trying to install Qiskit in a virtual Python environment via pip through Miniconda command prompt on Windows 10. The issue is with using Microsoft Visual Studio tools such cl, nmake, etc. The command prompt cannot find them. However, I followed the Qiskit's installation instructions and I have installed Microsoft Visual C++ Redistributor 2015.
I tried to find to add Microsoft Visual C++ Redistributor 2015 as a path variable but couldnt find its location (not in C:/programfiles (x64)/Microsoft Visual Studio).
Any help is greatly appreciated!!!!
"
"['programming', 'qiskit']"," Title: from qiskit.aqua import... ImportError: DLL load failed: The specified module could not be foundBody: Dear team and developers.
I am using qiskit on Python 36, windows 64bits
I have the same identical problem of Import from qiskit-aqua error
But the suggested solution (installing Numpy+mkl, I did it!) is not the solution in my case as the error persists and I am desperate.
Traceback (most recent call last):
File "C:\Users\root\eclipse-workspace\Dir\file.py", line 11, in <module>
from qiskit.aqua.components.uncertainty_models import UniformDistribution, UnivariateVariationalDistribution
File "C:\Users\root\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\aqua\__init__.py", line 29, in <module>
from .utils.backend_utils import (get_aer_backend,
File "C:\Users\root\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\aqua\utils\__init__.py", line 27, in <module>
from .qp_solver import optimize_svm
File "C:\Users\root\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\aqua\utils\qp_solver.py", line 18, in <module>
from cvxopt import matrix, solvers
File "C:\Users\root\AppData\Local\Programs\Python\Python36\lib\site-packages\cvxopt\__init__.py", line 50, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.
I re-installed everything, all is up to date.
Please help.
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'grovers-algorithm', 'cryptography']"," Title: Easiest hash function to implement on QiskitBody: Trying to build an Oracle circuit for Grover's algorithm that will try to find a desired input in order to get a certain output of a hash function.
Was wondering if there were any 4 or 8 bit hash functions out there or any hash functions that could be easily built into a quantum circuit (obviously building up from classical circuits)
Any help would be great Thanks!
"
"['qiskit', 'ibm-q-experience', 'architecture']"," Title: Are all the IBM QX mapping bidirectional?Body: The connection between physical qubits of IBM devices are all bidirectional or there are some architectures that there existing some unidirectional connection?
I found that in IBM Quantum experience, all the device connections are bidirectional, I was wondering if there are some exceptions?
"
"['nielsen-and-chuang', 'textbook-and-exercises', 'entropy']"," Title: Conditional version of the triangle inequality for Von Neumann entropyBody: I'm trying to solve problem 11.3 in Nielsen Chuang:
(3) Prove the conditional version of the triangle inequality:
$$
S(A,B|C)\geq S(A|C)-S(B|C)
$$
But the inequality seems incorrect. For example, let
$$
|\psi\rangle = \frac{|0\rangle|0\rangle|00\rangle+|0\rangle|1\rangle|01\rangle+|1\rangle|0\rangle|10\rangle+|1\rangle|1\rangle|11\rangle}{2},\\
\rho^{ABC} = |\psi\rangle\langle\psi|.
$$
Then:
$$
\rho^{C}=\frac{I}{4},\\
\rho^{AC}=\rho^{BC}=\frac{I}{2},\\
S(A,B|C)=S(A,B,C)-S(C)=0-2,\\
S(A|C)=S(B|C)=1-2=-1,\\
S(A,B|C)=-2<0=S(A|C)-S(B|C).
$$
Am I doing something wrong, or did the problem mean to say $S(A,B)\geq S(A|C)-S(B|C)$ or something?
"
"['mathematics', 'speedup', 'hhl-algorithm']"," Title: Where will I find necessary math to understand HHL algorithm?Body: How can we show that HHL algorithm achieves exponential speedup?
"
['zx-calculus']," Title: ZX-Calculus: how to prove this simple equation between two very small circuitsBody: Short version:
How could I prove in ZX-calculus that these two diagrams are equal (up to a global phase), using axioms from this paper (Fig. 1) for example? Any intuition is welcome!
Long version:
I'm starting to learn about ZX-Calculus, and I wanted to try to see the different ways to perform a CZ gate (rotation of $\pi$ angle). And it appears that there are (at least) three different ways (sorry for the bad quality of the drawings):
Version 1:
Version 2: (note the minus sign on the bottom qubit)
Version 3:
Now, version 2 is very easy to derive from version 1 if we take the axiom (EU) of this paper (we will call this axiom (EU1)), and version 3 is also easy to derive from version 1 if we take the axiom (EU) of this paper (we will call this axiom (EU2)).
But I can't find how to go from version 2 to version 3 by using only the axioms in the first paper (including EU1), or the other way around. Basically, it should be enought to prove that these two diagrams are equal (and I made the computation: they are equal, up to a global phase):
Any idea how to prove the equality of these two diagrams with axioms only from the first paper for example? It seems super easy (just 1/2 nodes!)... but I can't make it... Any intuition is welcome!
"
"['algorithm', 'programming', 'hhl-algorithm']"," Title: How to encode eigenvalues of matrix $A$ in solving $A\vec{x} = \vec{b}$ using the HHL AlgorithmBody: I am trying to implement multiple parallel subroutines of HHL algorithm, each working on a different set of matrix $A$ (when solving for $x$, in $A\vec{x} = \vec{b}$), to find the expectation values of $|x\rangle$. The matrix $A$ is randomly generated Hermitian matrix, and may/may not be sparse (checking what happens, is also something I'm wondering).
I have the following queries:
- If I understand correctly, I need to encode eigenvalues of a $2 \times 2$ matrix $A$, say $\lambda_1$ and $\lambda_2$ in the quantum register. Is that right? How do I do that?
- Is the quantum register initialized with the binary values of $\lambda_1$ and $\lambda_2$? Does that mean 2 runs of HHL? Is finding Eigenvalues of matrix $A$ supposed to be a classical subroutine?
"
"['decoherence', 'terminology']"," Title: What's the difference between T1 and T2?Body: I learned that T1 is relaxation time (time from $|1\rangle$ to $|0\rangle$) and T2 is coherence time.
The relaxation is a specific case of decoherence.
What's the difference between them and what's the exact meaning of coherence time T2?
"
"['ibm-q-experience', 'simulation']"," Title: What is the difference between IBM quantum simulator and othersBody: I am currently doing my final year undegraduate research. For many quantum inspired algorithms are simulated on Matlab. However if I am to run the algorithms on a Quantum Simulator provided by IBM, will that carry any significant importance.
Basically what makes IBM Quantum simulator stand out from general Matlab based or other simulators which generates random numbers for qubits.
"
"['quantum-state', 'ibm-q-experience']"," Title: How to set initial state on IBM Q?Body: For my undergraduate final project I am working on a Quantum Inspired Genetic Algorithm.
For this I am using IBM Q real devices and I need to set a custom initial state on qubits. Using the statevector simulator this was possible, however I am not sure how to do so on real quantum hardware. For example I want to put qubit into state $|\psi\rangle = \sqrt{0.3}|0\rangle + \sqrt{0.7}|1\rangle$.
"
"['noise', 'nisq']"," Title: Dealing with noise in NISQBody: I wanted to know if there are some way in NISQ (we run ""bare"" gate without Q.E.C) to certify if an algorithm will give a correct or wrong answer based on the process of a single gate ?
For example in fault tolerant quantum computing, if you know the X,Y or Z error of a single logical gate you can easily tell what will be the probability that your full algorithm is wrong.
Are there similar constructions for NISQ ?
"
"['algorithm', 'machine-learning']"," Title: Variances of the principal components in Ewin Tang's PCA algorithmBody: In Quantum-inspired classical algorithms for principal component analysis and supervised clustering, the PCA algorithm requires that the variances of the principal vectors differ by at least a constant fraction of the Frobenius norm squared ($\sigma_{i+1}^2 - \sigma_i^2 \ge \eta ||A||_{F}^2$) and that the variance is above a certain constant $\sigma^2$. Can the assumption that the principal vectors have different variances be dropped and the output changed to just the hypervolume created by all the (unordered) principal vectors with at least a certain variance, $\sigma^2$? And, if so, what is the modified algorithm's computational complexity? From the remark,
As we assume our eigenvalues have an $\eta ||A||_F^2$
gap, the precise eigenvector $|v_j\rangle$ sampled can be identified
by the eigenvalue estimate. Then, by computing enough
samples, we can learn all of the eigenvalues of at least $\sigma^2$
and get the corresponding states
It seems like this should be fine, but later Tang adds,
Note that we crucially use the assumptions in Problem 7
for our QML algorithm: without guarantee on the gap or
that $\sigma_i \ge \sigma$, finding the top k singular vectors would be
intractable, even with samples of $|v_i\rangle$’s.
leaves open the possibility it wouldn't work.
"
"['qiskit', 'phase-estimation', 'initialization']"," Title: Prepending initial state to a quantum circuit in QiskitBody: I am trying to generate a Quantum Phase Estimation (QPE) circuit in QISKIT the following way.
1 - First, I generate a QPE circuit with the following code:
### building inverse quantum fourier transform circuit
iqft = StandardIQFTS(2)
iqft_circ = QuantumCircuit(QuantumRegister(2))
iqft.construct_circuit(mode='circuit', qubits=iqft_circ.qubits, circuit=iqft_circ, do_swaps=True)
### Defining matrix operator
matrix = np.array([[1,0],[0,np.exp(1j*np.pi/4)]])
### Defining Quantum Phase Estimation object
eigs_qpe = EigsQPE(MatrixOperator(matrix=matrix),
iqft,
num_time_slices=2,
num_ancillae=2,
expansion_mode='trotter',
expansion_order=1,
evo_time=2,
negative_evals=False,
ne_qfts=[None,None])
### Generating circuit
eigs_circ = eigs_qpe.construct_circuit(mode=""circuit"")
eigs_circ.draw(output=""mpl"")
2 - Then I want to prepend the following initial state to the previous circuit
vector = np.array([0,1])
initial_state = Custom(1,state_vector=vector)
Thus getting a QPE computed on the initial_state. Is it possible to do this, for example by accessing eigs_circ.data and prepending the proper gates that generate the initial_state?
"
"['circuit-construction', 'shors-algorithm']"," Title: Implementing QFT for Shor's Algorithm?Body: I'm studying Shor's algorithm.
This diagram shows a calculation of $4^x\mod21$.
I don't understand how this expresses $4^x \mod21$.
Could you explain this? For example, by showing another calculation such as $11^x\mod15$.
And what does this result mean?
"
"['quantum-gate', 'quantum-fourier-transform', 'hadamard']"," Title: Why can the QFT be replaced by Hadamard gates?Body: I'm studying Shor's Algorithm.
In the book, author explains QFT can be replaced by Hadamard gates?
Why this process is possible??
Thank you everybody. This is QPE. I attach part of book!!
"
"['measurement', 'teleportation']"," Title: Teleportation and non-orthogonal measurement operatorsBody: Consider the simple state teleportation gadget below. Measuring the entangled state after the CZ gate in the $X$ eigenbasis (equivalent to first applying $H$ and then measuring in computational basis) teleports the state $|\psi\rangle$ to the second register up to a $X^m H$.
Now, what if we were to consider a measurement of non-orthogonal operators (for simplicity say a POVM given by $E_1, E_2, E_3$) instead of measuring in the $X$ basis. I am reading an article in which the authors seem to indicate that this will generally leave the state on the second register in a mixed state.
Could someone explain why this is the case?
(I have actually taken this slightly out of context, as this originally concerns a quantum optics measurement, namely a so-called heterodyne measurement, where the measurement operators are given by $E=|\alpha\rangle\langle\alpha|$ but the coherent states $|\alpha\rangle$ are not orthogonal and form an overcomplete basis. However, I believe this should boil down to the same question)
"
['zx-calculus']," Title: What are some applications of the ZX calculus?Body: Recently, I came across ZX calculus. It is an interesting method to describe quantum circuits. However, it seems to me, too complicated for day-to-day use in circuit design (something like to program an application in assembler instead of in higher level language) because it uses only few quantum gates ($Rx$, $Ry$, $H$ and $CNOT$).
My question is for what purposes the ZX calculus was developed?
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: Swap test to calculate inner product with qiskit for multi-qubit statesBody: Is it possible to perform a controlled swap test with multiple targets with qiskit? I have tried using cswap(ancilla[0],qb1,qb2), where qb1 is an n-qubit register and qb2 is as well
"
"['qiskit', 'measurement']"," Title: Is there a function that gives the ideal probability distribution of a measurement in Qiskit?Body: I want to compare the theoretical output of a circuit measurement with the actual output from a real quantum computer. I can approximate the ideal output by running the circuit on a simulator. However when you're measuring a state in superposition, the results you get from a simulator are still nondeterministic, making them not ideal for comparison.
For instance, when measuring a single qubit in even superposition (the state $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$, the ideal result would be that you measure $|0\rangle$ with probability $0.5$ and $|1\rangle$ with probability $0.5$. However, when running on a simulator, you might naturally get $|0\rangle$ with probability $0.501$ and $|1\rangle$ with probability $0.499$:
In other words, knowing that the theoretical probability of obtaining state $|\phi\rangle$ when measuring a state $|\psi\rangle$ is $\langle\phi|\psi\rangle$, is there a function in Qiskit to calculate this value from a circuit or state, or to get the ideal probability distribution that I can compare my actual distribution against?
"
"['simulation', 'boson-sampling']"," Title: Commutation of bosonic operators on finite Hilbert spaceBody: I'm checking this article of R. Somma about quantum simulations
https://arxiv.org/abs/quant-ph/0512209
I understand the common commutation relations for creationd and annihilation operators, given by:
$$[b_i, b_j^\dagger]|n_1 n_2\dots n_N\rangle = b_ib_j^\dagger|n_1 n_2\dots n_N\rangle-b_j^\dagger b_i|n_1 n_2\dots n_N\rangle\\
= \sqrt{n_i(n_j+1)}|n_1\dots n_i-1\ n_j+1\dots n_N\rangle\\
-\sqrt{n_i(n_j+1)}|n_1\dots n_i-1\ n_j+1\dots n_N\rangle=0$$
My question is about equation (2.57) on page 32. They restrict the Fock space to contain at most $N_P$ bosons per site, and then they affirm that the following relations hold:
$$\left[\bar{b}_{i}, \bar{b}_{j}\right]=0,\left[\bar{b}_{i}, \bar{b}_{j}^{\dagger}\right]=\delta_{i j}\left[1-\frac{N_{P}+1}{N_{P} !}\left(\bar{b}_{i}^{\dagger}\right)^{N_{P}}\left(\bar{b}_{i}\right)^{N_{P}}\right]$$
Where does that come from?
I started considering the general Fock state $|n_1 n_2\dots n_N\rangle=\prod_{k=1}^{N}\frac{1}{\sqrt{n_k!}}{b_k^\dagger}^{n_k}|0\rangle$ and trying to compute the commutator expression but obtained nothing useful.
Can anyone help me?
"
"['quantum-gate', 'measurement']"," Title: What is the opposite of measurement, in a quantum circuit?Body: My understanding is that at the level of quantum mechanics, almost all operations are reversible in time. Most gates in a quantum circuit clearly obey this rule; they can be reversed by applying some other gate. But a measurement gate seems to be one-directional. Is there some physical process that performs the opposite of what a measurement gate does?
"
['qiskit']," Title: How do we discard or delete or reuse a qubit at the end, on Qiskit?Body:
After I have finished computing and operating a specific circuit on a set of (say) 4 qubits, my final interest only is to deal with (say) two of the four qubits. Then, how do I recycle or delete the other two qubit? Or rather how do I plot state vectors of only the two qubits of interest on Qiskit?
In the above figure I want to delete q0_0 and q0_1. I want state vectors of only q1_0 and q1_1.
"
"['mathematics', 'complexity-theory', 'games', 'mip-star']"," Title: Is Connes' Embedding Problem akin to the word problem for finitely presented groups?Body: The complexity class $\mathrm{MIP^*}$ includes the set of languages that can be efficiently verified by a classical, polynomially-bounded verifier, engaging with two quantum provers that can share (potentially infinite) entanglement, but are otherwise forbidden to signal to each other. The complexity class $\mathrm{RE}$ includes recursively enumerable problems, the Halting Problem being a complete problem therein.
A recent breakthrough of Ji, Natarajan, Vidick, Wright, and Yuen in quantum complexity theory is $\mathrm{MIP^*=RE}$. This is, in a way, a quantum analog of the classical result that $\mathrm{MIP=NEXP}$, but shows that shared quantum entanglement in a potentially infinite-dimensional Hilbert space is much much more powerful than that allowed in the (unentangled) classical setting.
Rolling back the implications of Tsirelson and others, this implies a negative answer to Connes' Embedding Problem, which is a major problem in algebra theory.
I can get my head around the complexity class $\mathrm{MIP^*}$ and that of $\mathrm{RE}$. Thanks to Yuen's lecture at the IAS, I vaguely understand Tsirelson's problem in relation to CHSH games, etc., and how it could relate to $\mathrm{MIP^*}$. Also I was able to follow a lot of Slofstra's lecture, where he mentions that Tsirelson's problem is related to finding magic squares in $\mathbb{Z}_2$, and emphasizes the relation to solving a specific word problem for finitely presented groups. Famously such word problems can be algorithmically unsolvable.
However, I know very little of even the statement of Connes' embedding problem, and I don't know how to analogize the problem to something that I'm familiar with.
According to Wikipedia, ""Connes' Embedding Problem asks whether every type II1 factor on a separable Hilbert space can be embedded into some $R^\omega$.""
Is the CEP itself akin to an algorithmic problem as in the word problem for a finitely generated groups? Or is it much more subtle than that?
Basically I'm looking for a statement of Connes' embedding problem that is a bit more accessible than the Wikipedia article?
"
"['algorithm', 'quantum-gate', 'shors-algorithm']"," Title: What do empty white circles mean in a quantum circuit?Body: I'm studying Shor's algorithm.
but I see from the beginning this empty circle.
what this circle means??
"
"['mathematics', 'notation']"," Title: In Dirac notation, why do we have $\langle cf|g\rangle = c^*\langle f\vert g\rangle$?Body: A Hilbert Space has this property
$$\langle cf,g\rangle=c\langle f,g\rangle$$
where $f$ and $g$ are the vectors in the Hilbert Space and $c$ is a complex number.
In Dirac Notation,
$$\langle cf|g\rangle = c^*\langle f\vert g\rangle$$
I am confused about why the Dirac notation takes complex conjugate on $c$. I know $\langle f \vert$ in the Dirac notation is in the Dual Hilbert space. Is this the reason? Do I need to define a Hilbert Space as
$$\langle cf,g\rangle=c\langle f,g\rangle$$
I feel it is equivalent if I define as
$$\langle cf,g\rangle = c^*\langle f,g\rangle$$
Am I right? Thanks a lot!
"
"['ibm-q-experience', 'measurement', 'shors-algorithm']"," Title: When increase the shot, why the result is different?Body: when I measure the shot = 1024
when I measure the shot = 8192
I want to derive result value 011(=3)
However, I know if measure the more shots, increase the accuracy.
why this result derive???
why increase inaccuracy??
Sorry to late reply your request. I attach my code in qiskit!!
Thank you everybody!!
and I want to gain output 011(=3)
"
['grovers-algorithm']," Title: Is it possible to mine bitcoin by implementing Grover's algorithm on a quantum computerBody: This has been bothering me for a while.
Bitcoin mining involves repeatedly changing the nonce (and occasionally the timestamp and Merkle root) in a block header and hashing it repeatedly, until the resulting hash falls below the target value. Therefore, the only valid way to find a valid hash is via brute force on a classical computer.
However, quantum computers are on the rise. 8-qubit and 16-qubit systems are already somewhat accessible to the public (for example, the IBM Q experience, which allows for cloud-based quantum computing), and the biggest quantum computer ever constructed to-date is, to my knowledge, 72-qubits. Grover's algorithm, which can only be implemented on a quantum computer, is particularly suited for breaking SHA256, the encryption algorithm behind bitcoin mining.
And therefore my question is - is it possible to implement Grover’s algorithm to find the right nonce that allows the block header hash to satisfy the target value? How many qubits would be required - 8, 16, 32 or more? My understanding is that, since we only need to iterate between all possible combinations of the nonce, which is 32 bits, wouldn't it require only sqrt(2^32)=2^16 (16 qubits) to instantly find a valid block header hash if we use Grover's algorithm?
Or am I missing something? I'm not very familiar with encryption and quantum algorithms, so please correct me if I'm wrong.
"
"['quantum-state', 'mathematics', 'nielsen-and-chuang', 'bloch-sphere', 'kraus-representation']"," Title: Affine Map of the Bloch sphereBody: I am referring to Equation (8.89) to (8.92) in Chapter 8 of "Quantum Computing and Information 10th Anniversary Edition" by Nielsen and Chuang. This section deals with the geometric picture of single qubit quantum operations on a Bloch sphere. I am trying to arrive at (8.91) and (8.92) which the authors claimed that "...it is not difficult to check..."
We have the state of a single qubit in Bloch representation:
$$\rho=\frac{I+\vec{r}\cdot\vec{\sigma}}{2}\hspace{5em}(8.87)$$
The affine map $\varepsilon$ is given as:
$$\vec{r}\longrightarrow\vec{r'}=M\space\vec{r}+\vec{c}\hspace{5em}(8.89)$$
The operators that generate the operator-sum-representation for $\varepsilon$ are given in the form:
$$E_{i}=\alpha_{i}I+\sum^{3}_{k=1}a_{ik}\sigma_{k}\hspace{5em}(8.90)$$
The text went on to say it is not difficult to check that:
$$M_{jk}=\sum_{l}\bigg[a_{lj}a^{*}_{lk}+a^{*}_{lj}a_{lk}+\big(|a_l|^2-\sum_pa_{lp}a^*_{lp}\big)+i\sum_p\epsilon_{jkp}(\alpha_la^*_{lp}-\alpha^*_la_{lp})\bigg]\hspace{1em}$$
$$c_k=2i\sum_l\sum_{jp}\epsilon_{jkp}a_{lj}a^*_{lp}\hspace{5em}\text{(8.91) and (8.92)}$$
and they claim $c_k$ was written as such because $\sum_{i}E^{\dagger}_{i}E_{i}=I$ is used to simplify it.
So I tried to see how I can somehow arrive at (8.91) and (8.92) by doing these:
$$\varepsilon(\rho)=\frac{I+\sum_{l}E_{l}\vec{r}\cdot\vec{\sigma}E^{\dagger}_{l}}{2}=\frac{I+(M\space\vec{r}+\vec{c})\cdot\vec{\sigma} }{2}$$
The second term in the above equality is what I tried to work out,
\begin{align}
\mathcal{E}&(\rho)=\sum_l E_l\rho E_l^\dagger=\frac{I+\sum_l E_l(\vec{r}.\vec{\sigma})E_l^\dagger}{2}\\
&=\frac{1}{2}\bigg[I+\sum_l\Big[ \Big(\alpha_lI+\sum_{j=1}^3a_{lj}\sigma_j\Big)\Big(\sum_{k=1}^3r_k\sigma_k\Big)\Big(\alpha_l^*I+\sum_{p=1}^3a^*_{lp}\sigma_p\Big) \Big]\bigg]\\
&=\frac{1}{2}\bigg[I+\sum_l\Big[ |\alpha_l|^2\sum_{k=1}^3r_k\sigma_k+\alpha_l\sum_{k=1}^3r_k\sigma_k\sum_{p=1}^3a_{lp}^*\sigma_p+\alpha_l^*\sum_{j=1}^3a_{lj}\sigma_j \sum_{k=1}^3r_k\sigma_k+\sum_{j=1}^3a_{lj}\sigma_j\sum_{k=1}^3r_k\sigma_k\sum_{p=1}^3a_{lp}^*\sigma_p \Big]\bigg]\\
&=\frac{1}{2}\bigg[I+\sum_l\Big[ |\alpha_l|^2\sum_{k=1}^3r_k\sigma_k+\alpha_l\sum_{k=1}^3\sum_{p=1}^3r_ka_{lp}^*\sigma_k\sigma_p+\alpha_l^*\sum_{j=1}^3\sum_{k=1}^3r_ka_{lj}\sigma_j \sigma_k+\sum_{j=1}^3\sum_{k=1}^3\sum_{p=1}^3r_ka_{lj}a_{lp}^*\sigma_j\sigma_k\sigma_p \Big]\bigg]\\
\end{align}
Before I attempt to write out the subsequent expansion in latex, I'll like to know am I on the right track? Because after expansion I get the terms with $r_k$ and we know $c_{k}$ is a constant. Can someone guide me on how to understand (8.91) and (8.92)? Or even better, show me on how to arrive at these two equations through any means. Help will be very much appreciated. Thanks.
"
"['quantum-gate', 'circuit-construction']"," Title: If an auxiliary qubit is allowed, how to construct toffoli gate in easier way?Body: We know if we don't use auxiliary, the construction of Toffoli gate will be:
However, if now you are allowed to use one auxiliary qubit, how to realize a CCNOT in a simplier way? (Can we only use X,Y,Z,H and CNOT?)
"
['hhl-algorithm']," Title: How to prepare the three-dimensional register S in HHL?Body: $\newcommand{\ket}[1]{\left|#1\right>}$
In the original HHL paper, in step 4 of the $U_{\text{invert}}$ subroutine (Appendix A.1), it says to adjoin a three-dimensional register S in the state
$\ket{h(\lambda_k)} = \sqrt{1-f(\lambda_k)^2-g(\lambda_k)^2}\ket{\text{nothing}}+f(\lambda_k)\ket{\text{well}}+g(\lambda_k)\ket{\text{ill}}$.
I have played around with some possible controlled-rotation schemes to prepare this state, but with no luck. Does anyone know how to prepare this state?
"
"['qiskit', 'machine-learning']"," Title: Does anyone know how to get a list of all the Qiskit ML datasets, and if they can also be used for classical machine learning?Body: I am trying to create a Quantum Classifier and would like to try to test it out using a Qiskit ML dataset. However, I only know of the breast cancer dataset and I would like to try it on another dataset.
On another note, I am also curious if the Qiskit ML datasets are usable for classical machine learning, for example, using TensorFlow.
"
"['cryptography', 'bb84']"," Title: Show that if $b'$ and $b$ are uncorrelated, then $a'$ and $a$ are uncorrelatedBody: Let $a'_k$ be Bob's measurement result of qubit $
{\Psi_{a_kb_k}}$, assuming a noiseless channel with no eavesdropping. Show that when $b'_k\neq b_k$, $a'_k$ is random and completely uncorrelated with $a_k$. But when $b'_k=b_k$, $a'_k=a_k$.
I have no idea how to approach this problem, but I was thinking that, for instance, one possibility is that Alice sends bob a Qubit prepared in $ab=00$, and Bob measures it in state $a'b'=01$. Then $a=a'$ but $b=b'$.
"
"['quantum-state', 'measurement']"," Title: How to find measurement probabilities of a single qbit in a tensored stateBody: Given a tensored state of qbits such as
$$
\frac{1}{\sqrt{3}}|0\rangle_1|1\rangle_2 + \sqrt{\frac{2}{3}}|1\rangle_1|0\rangle_2
$$
or
$$
\frac{1}{\sqrt{2}}(|0\rangle_1|+\rangle_2 + |+\rangle_1|-\rangle_2)
$$
Then how do you calculate the probabilities of getting $|0\rangle$ or $|1\rangle$ if you measure qbit one in the above states?
"
"['qiskit', 'ibm-q-experience', 'simulation']"," Title: How to run the Qiskit Aer simulator without noise?Body: I know that the Qasm Simulator execute quantum circuits with presence of noise, even if I do not specify the model of noise in options for that backend.
But how can I execute the circuits without noise at all?
"
['terminology']," Title: What is meant with ""shot"" in quantum computation?Body: What is a ""shot"" in relation to quantum computing? I heard it is repeating time, but I don't understand it. Additionally, why is the default number of shots 1,024 in the IBM Q Experience?
One more question - I saw the sentence for each value of the shots, the experiment repeated 100 times. What is this mean? Is there difference between shots and repeated experiments? Are shot and experiment repetition same thing?
"
"['qiskit', 'shors-algorithm']"," Title: Shor algorithm - how to obtain a period from diagram?Body: I'm studying shor's algorithm. I implemented in Qiskit and apriori I know that a period is 3 in my example.
However, unless I know about period, how to obtain this period only according to seeing diagram?
This is a circuit diagram.
This is a probability diagram. How to obtain a period from it?
"
"['qiskit', 'programming']"," Title: Installing qiskit with `pip install qiskit` gives `ERROR: Command errored out with exit status 1`Body: I have created a virtual environment by virtualenv (not conda) and tried to install qiskit by:
pip install qiskit
But it gives me a lot of error lines on the output:
Processing c:\users\mrt\appdata\local\pip\cache\wheels\20\f3\76\5a370641d58aa5f2887118316f675e967dd00c087276c5fc7d\qiskit-0.15.0-py3-none-any.whl
Requirement already satisfied: qiskit-ibmq-provider==0.4.6 in e:\py\quantum-computing\lib\site-packages (from qiskit) (0.4.6)
Collecting qiskit-aqua==0.6.4
Using cached qiskit_aqua-0.6.4-py3-none-any.whl (1.8 MB)
Collecting qiskit-aer==0.4.0
Using cached qiskit-aer-0.4.0.tar.gz (10.0 MB)
Requirement already satisfied: qiskit-terra==0.12.0 in e:\py\quantum-computing\lib\site-packages (from qiskit) (0.12.0)
Requirement already satisfied: qiskit-ignis==0.2.0 in e:\py\quantum-computing\lib\site-packages (from qiskit) (0.2.0)
Requirement already satisfied: requests>=2.19 in e:\py\quantum-computing\lib\site-packages (from qiskit-ibmq-provider==0.4.6->qiskit) (2.22.0)
Requirement already satisfied: websockets<8,>=7 in e:\py\quantum-computing\lib\site-packages (from qiskit-ibmq-provider==0.4.6->qiskit) (7.0)
Requirement already satisfied: requests-ntlm>=1.1.0 in e:\py\quantum-computing\lib\site-packages (from qiskit-ibmq-provider==0.4.6->qiskit) (1.1.0)
Requirement already satisfied: arrow>=0.15.5 in e:\py\quantum-computing\lib\site-packages (from qiskit-ibmq-provider==0.4.6->qiskit) (0.15.5)
Requirement already satisfied: nest-asyncio!=1.1.0,>=1.0.0 in e:\py\quantum-computing\lib\site-packages (from qiskit-ibmq-provider==0.4.6->qiskit) (1.2.3)
Collecting scikit-learn>=0.20.0
Using cached scikit_learn-0.22.1-cp37-cp37m-win32.whl (5.5 MB)
Requirement already satisfied: sympy>=1.3 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (1.5.1)
Processing c:\users\mrt\appdata\local\pip\cache\wheels\78\55\c8\dc61e772445a566b7608a476d151e9dcaf4e092b01b0c4bc3c\dlx-1.0.4-py3-none-any.whl
Collecting quandl
Using cached Quandl-3.5.0-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: scipy>=1.0 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (1.4.1)
Requirement already satisfied: jsonschema>=2.6 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (3.2.0)
Requirement already satisfied: fastdtw in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (0.3.4)
Requirement already satisfied: numpy>=1.13 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (1.18.1)
Requirement already satisfied: setuptools>=40.1.0 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (45.2.0)
Requirement already satisfied: psutil>=5 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (5.6.7)
Requirement already satisfied: networkx>=2.2 in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (2.4)
Requirement already satisfied: docplex in e:\py\quantum-computing\lib\site-packages (from qiskit-aqua==0.6.4->qiskit) (2.12.182)
Collecting cvxopt; python_version < ""3.8"" or sys_platform != ""win32""
Using cached cvxopt-1.2.4.tar.gz (6.7 MB)
Collecting h5py
Using cached h5py-2.10.0-cp37-cp37m-win32.whl (2.1 MB)
Requirement already satisfied: cython>=0.27.1 in e:\py\quantum-computing\lib\site-packages (from qiskit-aer==0.4.0->qiskit) (0.29.15)
Requirement already satisfied: pybind11>=2.4 in e:\py\quantum-computing\lib\site-packages (from qiskit-aer==0.4.0->qiskit) (2.4.3)
Requirement already satisfied: marshmallow-polyfield<6,>=5.7 in e:\py\quantum-computing\lib\site-packages (from qiskit-terra==0.12.0->qiskit) (5.8)
Requirement already satisfied: marshmallow<4,>=3 in e:\py\quantum-computing\lib\site-packages (from qiskit-terra==0.12.0->qiskit) (3.4.0)
Requirement already satisfied: dill>=0.3 in e:\py\quantum-computing\lib\site-packages (from qiskit-terra==0.12.0->qiskit) (0.3.1.1)
Requirement already satisfied: ply>=3.10 in e:\py\quantum-computing\lib\site-packages (from qiskit-terra==0.12.0->qiskit) (3.11)
Requirement already satisfied: idna<2.9,>=2.5 in e:\py\quantum-computing\lib\site-packages (from requests>=2.19->qiskit-ibmq-provider==0.4.6->qiskit) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in e:\py\quantum-computing\lib\site-packages (from requests>=2.19->qiskit-ibmq-provider==0.4.6->qiskit) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in e:\py\quantum-computing\lib\site-packages (from requests>=2.19->qiskit-ibmq-provider==0.4.6->qiskit) (2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in e:\py\quantum-computing\lib\site-packages (from requests>=2.19->qiskit-ibmq-provider==0.4.6->qiskit) (1.25.8)
Requirement already satisfied: ntlm-auth>=1.0.2 in e:\py\quantum-computing\lib\site-packages (from requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.4.6->qiskit) (1.4.0)
Requirement already satisfied: cryptography>=1.3 in e:\py\quantum-computing\lib\site-packages (from requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.4.6->qiskit) (2.8)
Requirement already satisfied: python-dateutil in e:\py\quantum-computing\lib\site-packages (from arrow>=0.15.5->qiskit-ibmq-provider==0.4.6->qiskit) (2.8.1)
Collecting joblib>=0.11
Using cached joblib-0.14.1-py2.py3-none-any.whl (294 kB)
Requirement already satisfied: mpmath>=0.19 in e:\py\quantum-computing\lib\site-packages (from sympy>=1.3->qiskit-aqua==0.6.4->qiskit) (1.1.0)
Collecting more-itertools
Using cached more_itertools-8.2.0-py3-none-any.whl (43 kB)
Processing c:\users\mrt\appdata\local\pip\cache\wheels\13\61\89\9192774c0f1e6c3342354df9f4804d7a9de80ac88e062d2e56\inflection-0.3.1-py3-none-any.whl
Requirement already satisfied: six in e:\py\quantum-computing\lib\site-packages (from quandl->qiskit-aqua==0.6.4->qiskit) (1.14.0)
Collecting pandas>=0.14
Using cached pandas-1.0.1-cp37-cp37m-win32.whl (7.7 MB)
Requirement already satisfied: pyrsistent>=0.14.0 in e:\py\quantum-computing\lib\site-packages (from jsonschema>=2.6->qiskit-aqua==0.6.4->qiskit) (0.15.7)
Requirement already satisfied: attrs>=17.4.0 in e:\py\quantum-computing\lib\site-packages (from jsonschema>=2.6->qiskit-aqua==0.6.4->qiskit) (19.3.0)
Requirement already satisfied: importlib-metadata; python_version < ""3.8"" in e:\py\quantum-computing\lib\site-packages (from jsonschema>=2.6->qiskit-aqua==0.6.4->qiskit) (1.5.0)
Requirement already satisfied: decorator>=4.3.0 in e:\py\quantum-computing\lib\site-packages (from networkx>=2.2->qiskit-aqua==0.6.4->qiskit) (4.4.1)
Requirement already satisfied: docloud>=1.0.375 in e:\py\quantum-computing\lib\site-packages (from docplex->qiskit-aqua==0.6.4->qiskit) (1.0.375)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in e:\py\quantum-computing\lib\site-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.4.6->qiskit) (1.14.0)
Collecting pytz>=2017.2
Using cached pytz-2019.3-py2.py3-none-any.whl (509 kB)
Requirement already satisfied: zipp>=0.5 in e:\py\quantum-computing\lib\site-packages (from importlib-metadata; python_version < ""3.8""->jsonschema>=2.6->qiskit-aqua==0.6.4->qiskit) (2.2.0)
Requirement already satisfied: pycparser in e:\py\quantum-computing\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.4.6->qiskit) (2.19)
Building wheels for collected packages: qiskit-aer, cvxopt
Building wheel for qiskit-aer (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'e:\py\quantum-computing\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\qiskit-aer\\setup.py'""'""'; __file__='""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\qiskit-aer\\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 'C:\Users\MRT\AppData\Local\Temp\pip-wheel-ygy91648'
cwd: C:\Users\MRT\AppData\Local\Temp\pip-install-6b8z6utw\qiskit-aer\
Complete output (153 lines):
--------------------------------------------------------------------------------
-- Trying ""Ninja (Visual Studio 15 2017 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.
-- Configuring incomplete, errors occurred!
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log"".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying ""Ninja (Visual Studio 15 2017 v141)"" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying ""Visual Studio 15 2017 v141"" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Visual Studio 15 2017
could not find any instance of Visual Studio.
-- Configuring incomplete, errors occurred!
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log"".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying ""Visual Studio 15 2017 v141"" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying ""NMake Makefiles (Visual Studio 15 2017 v141)"" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable ""CC"" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log"".
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeError.log"".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying ""NMake Makefiles (Visual Studio 15 2017 v141)"" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying ""NMake Makefiles JOM (Visual Studio 15 2017 v141)"" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the JOM generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable ""CC"" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log"".
See also ""C:/Users/MRT/AppData/Local/Temp/pip-install-6b8z6utw/qiskit-aer/_cmake_test_compile/build/CMakeFiles/CMakeError.log"".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying ""NMake Makefiles JOM (Visual Studio 15 2017 v141)"" generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building windows wheels for Python 3.7 requires Microsoft Visual Studio 2017.
Get it with ""Visual Studio 2017"":
https://visualstudio.microsoft.com/vs/
********************************************************************************
----------------------------------------
ERROR: Failed building wheel for qiskit-aer
Running setup.py clean for qiskit-aer
Building wheel for cvxopt (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'e:\py\quantum-computing\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\setup.py'""'""'; __file__='""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\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 'C:\Users\MRT\AppData\Local\Temp\pip-wheel-03pa82mg'
cwd: C:\Users\MRT\AppData\Local\Temp\pip-install-6b8z6utw\cvxopt\
Complete output (21 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cvxopt
copying src\python\coneprog.py -> build\lib.win32-3.7\cvxopt
copying src\python\cvxprog.py -> build\lib.win32-3.7\cvxopt
copying src\python\info.py -> build\lib.win32-3.7\cvxopt
copying src\python\misc.py -> build\lib.win32-3.7\cvxopt
copying src\python\modeling.py -> build\lib.win32-3.7\cvxopt
copying src\python\msk.py -> build\lib.win32-3.7\cvxopt
copying src\python\printing.py -> build\lib.win32-3.7\cvxopt
copying src\python\solvers.py -> build\lib.win32-3.7\cvxopt
copying src\python\_version.py -> build\lib.win32-3.7\cvxopt
copying src\python\__init__.py -> build\lib.win32-3.7\cvxopt
UPDATING build\lib.win32-3.7\cvxopt/_version.py
set build\lib.win32-3.7\cvxopt/_version.py to '1.2.4'
running build_ext
building 'base' extension
error: Microsoft Visual C++ 14.0 is required. Get it with ""Build Tools for Visual Studio"": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for cvxopt
Running setup.py clean for cvxopt
Failed to build qiskit-aer cvxopt
Installing collected packages: joblib, scikit-learn, dlx, more-itertools, inflection, pytz, pandas, quandl, cvxopt, h5py, qiskit-aqua, qiskit-aer, qiskit
Running setup.py install for cvxopt ... error
ERROR: Command errored out with exit status 1:
command: 'e:\py\quantum-computing\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\setup.py'""'""'; __file__='""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\setup.py'""'""';f=getattr(tokenize, '""'""'open'""'""', open)(__file__);code=f.read().replace('""'""'\r\n'""'""', '""'""'\n'""'""');f.close();exec(compile(code, __file__, '""'""'exec'""'""'))' install --record 'C:\Users\MRT\AppData\Local\Temp\pip-record-u6cvqizo\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\py\quantum-computing\include\site\python3.7\cvxopt'
cwd: C:\Users\MRT\AppData\Local\Temp\pip-install-6b8z6utw\cvxopt\
Complete output (21 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cvxopt
copying src\python\coneprog.py -> build\lib.win32-3.7\cvxopt
copying src\python\cvxprog.py -> build\lib.win32-3.7\cvxopt
copying src\python\info.py -> build\lib.win32-3.7\cvxopt
copying src\python\misc.py -> build\lib.win32-3.7\cvxopt
copying src\python\modeling.py -> build\lib.win32-3.7\cvxopt
copying src\python\msk.py -> build\lib.win32-3.7\cvxopt
copying src\python\printing.py -> build\lib.win32-3.7\cvxopt
copying src\python\solvers.py -> build\lib.win32-3.7\cvxopt
copying src\python\_version.py -> build\lib.win32-3.7\cvxopt
copying src\python\__init__.py -> build\lib.win32-3.7\cvxopt
UPDATING build\lib.win32-3.7\cvxopt/_version.py
set build\lib.win32-3.7\cvxopt/_version.py to '1.2.4'
running build_ext
building 'base' extension
error: Microsoft Visual C++ 14.0 is required. Get it with ""Build Tools for Visual Studio"": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\py\quantum-computing\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\setup.py'""'""'; __file__='""'""'C:\\Users\\MRT\\AppData\\Local\\Temp\\pip-install-6b8z6utw\\cvxopt\\setup.py'""'""';f=getattr(tokenize, '""'""'open'""'""', open)(__file__);code=f.read().replace('""'""'\r\n'""'""', '""'""'\n'""'""');f.close();exec(compile(code, __file__, '""'""'exec'""'""'))' install --record 'C:\Users\MRT\AppData\Local\Temp\pip-record-u6cvqizo\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\py\quantum-computing\include\site\python3.7\cvxopt' Check the logs for full command output.
System description:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Windows 10 x64
What are the requirements? What should I do to solve this problem?
Thanks in advance.
"
"['qiskit', 'pauli-gates', 'hadamard']"," Title: Generate the state $\frac{-|0\rangle + |1\rangle}{\sqrt{2}}$ with qiskit: problem with Pauli-Z behaviorBody: I want to construct the following state of a qubit using a quantum circuit: $\frac{-|0\rangle + |1\rangle}{\sqrt{2}}$
When I use the following qiskit code in Python:
q = QuantumRegister(1)
c = ClassicalRegister(1)
circuit = QuantumCircuit(q, c)
circuit.x(q[0])
circuit.z(q[0])
circuit.h(q[0])
backend = BasicAer.get_backend('statevector_simulator')
job = execute(circuit, backend)
amplitudes = job.result().get_statevector(circuit)
print(amplitudes)
I get [ 0.70710678+0.00000000e+00j -0.70710678+8.65956056e-17j]. When I remove the Pauli-Z gate I get: [ 0.70710678+0.00000000e+00j -0.70710678+8.65956056e-17j], i.e. the same result.
However, using Quirk I get the expected output. With the IBM Quantum Experience, I'm not sure. I get [ -0.707+0j, 0.707+0j ] and it says 'The qubit 0 is the one that is furthest to the right on the state.' So I guess it's also not the correct result.
I am using qiskit==0.15.0 and qiskit-aqua==0.6.4, which I updated after having this problem in an older version, too.
I also tested the following circuit:
# setup the circuit as before
circuit.x(q[0])
circuit.z(q[0])
# get and print amplitudes
Which results in [ 0.+0.0000000e+00j -1.+1.2246468e-16j], as I had expected.
Thus I am guessing, that I miss something. Can anyone explain this behavior?
"
"['algorithm', 'grovers-algorithm']"," Title: What observable do we measure at the end of a quantum search algorithm?Body: In the quantum search algorithm below, also known as Grover's algorithm, what observable do we measure at the end of the protocol?
That is, in the red box, it says ""measure the first $n$ qubits"", but which observable are we measuring?
Thanks.
"
['measurement']," Title: Reading or Unloading quantum data to classical dataBody: I have a very basic question: say I perform some set of operations on $N$ qubits (like QFT, QFT addition etc), and thus have a $N$ qubit final state.
If each qubit has something that I want to read off of it, is it possible to extract data from each qubit into classical?
I now know how to load classical data onto a quantum device, but how do I read the final data? Is it impossible to get it since the wavefunction collapses? What I mean to ask is whether there exists a general protocol to read final N qubits into N classical bits (even at least by repeated measurements (bounded by the Chernoff limit) or similar such methods).
"
"['entanglement', 'mathematics', 'density-matrix']"," Title: Applying density matrix based criterion to verify separabilityBody: In order to figure out if a given pure 2-qubit state is entangled or separable, I am trying to compute: the density matrix, then the reduced density matrix by tracing out with respect to one of the qubits, squaring the resulting reduced matrix, and finally taking its trace. Then, if the trace is $=1,$ I know the state is separable and entangled otherwise.
So I am trying this method for the following state (which we know to be entangled):
$$
|\psi\rangle = a_0b_0 |00\rangle+a_0b_1|01\rangle + a_1b_1|11\rangle \tag{1}
$$
nothing much else is really said about the coefficients other than neither of the above rhs terms have a coefficient $0.$
My attempt:
- I computed $\rho=|\psi\rangle \langle\psi|$, then took the partial trace in the basis of the 2nd qubit $\rho_1=\operatorname{Tr}_2(\rho).$
The obtained $\rho_1$ is:
$$
\rho_1 = \begin{pmatrix} a_0^2b_0^2 & a_0 a_1^* b_1^2 \\ a_0^* a_1 b_1^2 & a_1^2b_1^2\end{pmatrix} \tag{2}
$$
- Then computing $\rho_1^2$ then taking its trace, I obtain:
$$\operatorname{Tr}(\rho_1^2)=a_0^4b_0^4+a_1^4b_1^4+2a_0^2a_1^2b_1^4=(a_0^2b_0^2+a_1^2b_1^2)^2 \tag{3}$$
- So for $|\psi\rangle$ to be an entangled state, we need to show $(3)$ is $\neq 1,$ i.e., $(a_0^2b_0^2+a_1^2b_1^2)\neq 1$
- The only way I can make progress with the latter, is to assume that our given state $|\psi\rangle$ in $(1)$ is normalized, then I can assert that $(a_0^2b_0^2+a_1^2b_1^2)<1$ since by normalization $a_0^2b_0^2+a_1^2b_1^2+a_0^2 b_1^2=1$ must be unity, thus $(a_0^2b_0^2+a_1^2b_1^2)<1$ must be true and our state is entangled.
Question:
- Do my calculations make any sense? Admittedly, I am not very confident about it, and if I am correctly applying the described approach at the start.
- Is my assumption that $(1)$ is a normalized ket a necessary one in order to solve the problem of whether $(1)$ is entangled or separable?
- In case the assumption is needed, is my end result correctly interpreted then?
"
"['nielsen-and-chuang', 'deutsch-jozsa-algorithm', 'quantum-parallelism']"," Title: Understanding Steps in Deutsch's AlgorithmBody: I am currently working my way through the book Quantum Computation and Quantum Information by Chuang and Nielsen. So far it has been a joy to read, however I am hung up on a couple aspects of quantum parallelism and Deutsch's algorithm that I cannot understand as they are described in the text. My two questions are as follows.
First, in concern with quantum parallelism, suppose we are given the function $f(x): \{0, 1\} \rightarrow \{0, 1\}$, and the unitary map
$$
U_f:|x, y\rangle \rightarrow |x, y\oplus f(x)\rangle
$$
Now suppose we feed $U_f$ the input $|+\rangle |0\rangle$. Then as output we obtain the interesting state
$$
\frac{1}{\sqrt{2}}(|0, f(0)\rangle + |1, f(1) \rangle)
$$
which clearly exhibits quantum parallelism as $f(0)$ and $f(1)$ are simultaneously evaluated. What I am unclear on is exactly how to arrive at the above output state via computation: how do you compute $|0 \oplus f(|+\rangle)\rangle$, or just $f(|+\rangle)$? And how does this computation lead to our output state? What if we had more than one qubit in our input register such as the state $|++\rangle$, how would you compute $f(|++\rangle)$?
My next question follows from the first. In the text, the authors say: applying $U_f$ (as defined above) to the state $|x\rangle \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$ gives the state
$$
(-1)^{f(x)}|x\rangle \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)
$$
How was this result obtained (what computation is needed to obtain it?), where did the term $(-1)^{f(x)}$ come from?
As a consequence of this, they say that inputting the state $|+-\rangle$ into $U_f$ leaves us with the two possibilities of $\pm |+-\rangle$ if $f(0)=f(1)$ or $\pm |--\rangle$ if $f(0) \not= f(1)$. Similarly this doesn't make sense, how can I carry out the computation to show this?
Thank you all for the time and help, I will upvote partial answers (anwering one of the above questions for example).
"
"['quantum-gate', 'circuit-construction', 'ibm-q-experience', 'complexity-theory']"," Title: Simpler implementation of the Toffoli gate on IBM Q for special circumstancesBody: On current quantum hardware, a depth of circuit is constrained because of noise. In some cases, results are totally decoherent and as a result meaningless. This is especially true when Toffoli gates are used. Moreover, when it is necessary to use multiple inputs Toffoli gate (i.e. with three or more inputs), one has to use ancilla qubit(s) which has to be uncomputed eventually. This increases complexity of a circuits further.
So my questions are these:
- Is it possible to implement two inputs Toffoli gate in simpler way than for example on IBM Q?
- How to implement Toffoli gate with three or more inputs without building it up from two inputs Toffoli gates and using ancilla qubits?
"
"['quantum-state', 'entanglement']"," Title: Can I generate 4 entangled states (each 5 qubits) on a 5 qubit quantum computer?Body: Suppose that I have a 5 qubit quantum computer and want to generate
- 4 entangled states (each of 5 qubits)
- Single 6 qubit entangled state.
Are these 2 cases possible? I am a beginner please help!
"
"['quantum-state', 'decoherence']"," Title: How long can a qubit exist without decoherence?Body: In 2020, practically speaking, how long (time-wise) will a qubit function normally before decoherence kicks in?
"
"['circuit-construction', 'ibm-q-experience', 'hadamard']"," Title: How to construct a IBM Quantum Experience circuit for the following state transformation?Body: Please help me in building IBM Quantum Experience circuit for:
$$
M|0\rangle = \frac{1}{2}(|0\rangle+|1\rangle+|2\rangle+|3\rangle)
$$
Edit: Is it possible to make a circuit for a general transformation $M|0\rangle = \frac{1}{\sqrt{m}}\sum_{i=0}^{m-1}|i\rangle$ acting on $\log m$ qubits initialized to $|0\rangle$?
"
"['shors-algorithm', 'hhl-algorithm', 'quantum-fourier-transform', 'applications']"," Title: Does the quantum Fourier transform have many applications beyond period finding?Body: (This is a somewhat soft question.)
The quantum Fourier transform is formally quite similar to the fast Fourier transform, but exponentially faster.
The QFT is famously at the core of Shor's algorithm for period finding. It also comes up in a few other places, like the HHL algorithm for solving (certain very special) linear systems of equations.
The FFT, on the other hand is used in countless different applications throughout applied math, science, engineering, finance, and music (notably for signal processing and solving differential equations). Gilbert Strang called it ""the most important numerical algorithm of our lifetime.""
Given that the QFT is exponentially faster than the FFT, there seems to me to be a strange discrepancy between the literally thousands of known applications of the FFT and the relatively few applications of the QFT (even at the theoretical level, setting aside the obvious practical implementation challenges). I would have expected that, given the exponential speedup that the QFT delivers over the FFT, a quantum computer capable of implementing the QFT would instantly render many classical computing applications obsolete, and would also open up many more potential applications that are currently impractical. And yet the only application of the QFT that people seem to really discuss is using Shor's algorithm for decryption. (I don't mean ""application"" in the academic's sense of ""something that will get me a paper published"", but in the business person's sense of ""something that there might be a commercial market for"".) It's not even clear if the HHL algorithm would actually deliver a useful speedup in practice.
Is there some conceptual explanation for why the QFT doesn't seem to be as big of a deal in practice as one might expect? Is it just the usual I/O challenge of (a) efficiently reading a large data set in memory and (b) only being able to statistically sample the output amplitudes over many runs instead of being able to read them out all at once?
"
"['quantum-state', 'entanglement', 'circuit-construction', 'density-matrix']"," Title: How to prepare mixed states on a quantum computer?Body: I am a little bit confused by density matrix notation in quantum algorithms. While I am pretty confident with working with pure
states, I never had the need to work with algorithm using density matrices.
I am aware we can have/create a quantum register proportional to a density matrix by tracing out some qubits on a bigger states, but I don't have any intuition to how this can be done in practice on a quantum computer.
It is simple with just an Hadamard gate (for n being a power of 2) to prepare the following state:
$$ |\psi\rangle = \frac{1}{\sqrt{n}} \sum_i^n |i\rangle $$
The density matrix version of this state is:
$$\sigma= \sum_{i,y}^{n,n} |i\rangle\langle y|$$
But instead, I would like to know how to prepare a quantum register in the following state:
$$\rho = \frac{1}{n}\sum_{i}^{n} |i\rangle\langle i|$$
Unfortunately, I have no intuition how I can think this state in a quantum register, as I am too used to work with pure state. The density matrix should incorporate our (classical) ignorance about a quantum system, but why should I ignore the outcome of discarding (i.e. measuring) a bigger state that gives me the totally mixed state on a quantum computer?
Rephrased in other words my question is: what is the pure state state of $\rho$?
We know it must exist, because density matrices of pure states have the property that $\rho^2 = \rho$ page 20 of preskill's lecture notes.
Intuitively, is $\psi$, but it is not, as $\sigma \neq \rho$.
"
"['entanglement', 'quantum-networks']"," Title: What is ""quantum internet"" and what is its relation with quantum entanglement?Body: In a recent news "Scientists Make Major Breakthrough In ‘quantum Entanglement’ That Could Change How The Internet Works"
Scientists have managed to entangle two "quantum memories" at a distant much bigger than ever before, a breakthrough that could one day change the way the internet works.
To entangle those two quantum memories, researchers had to shoot photons, or individual particles of light, along the 50-kilometre cable.
One can think that, if one can separate quantum entangled particles then use them to transmit information between them. But the researchers entangled at the end of the cable;
After making their way over that distance, the two memories were able to interfere with each other, making the experiment a success and demonstrating that two quantum memories could become entangled over such a distance.
My questions are;
- What is quantum internet
- What is the relation of it with quantum entanglement
"
['simons-algorithm']," Title: Simon's algorithm -- circuit for given sBody: I'm currently learning Simon's algorithm, from IBM Quantum Experiene.
For the given string $s=11$, they display the implemented function $Q_f$ like this:
Can someone explain to me, why the CNOT gates are arranged like this, for $s=11$? The way I see it, the outcome of the the qubits below, should be $f(x \oplus 11)$, but we still don't know about the implementation of $f$, just because we know $s$, if I'm not wrong. So how can we display $Q_f$ here?
"
"['quantum-state', 'mathematics']"," Title: Magnitudes and phases of coefficients of a qubitBody: Quantum mechanics is based on the idea of waves, and waves have both a magnitude and a phase?
$$|\psi\rangle = i\alpha|0\rangle + \beta|1\rangle.$$
Does $\alpha$ and $\beta$ represent magnitude and $i$ represent phase?
Or how do we represent phase? Or is it something else?
"
"['qiskit', 'ibm-q-experience', 'qasm']"," Title: What is the source of this TranspilerError when running qasm file?Body:
I want to run this qasm file using IBM device.
However, there's always an error:
qiskit.transpiler.exceptions.TranspilerError: 'Number of qubits (16) in circuit0 is greater than maximum (5) in the coupling_map'
How does this error come?
How can I set up the initial mapping when running this qasm file?
How to run the qasm file in Jupyter notebook?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Decomposition of an arbitrary gate using given matrix in QiskitBody: If I have an arbitrary non-unitary matrix of say
$$
U = \begin{pmatrix}
1.5 & 0 & 0 & 0 \\
0 & 0 & 0 & 1.6 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
\end{pmatrix},
$$
is it possible to decompose it into gates implementable in qiskit?
If so, how? If not, why not?
Is is possible to have any arbitrary non-unitary matrix as an input and get the corresponding gates that implement this arbitrary matrix?
"
"['algorithm', 'quantum-gate']"," Title: What is a ""cascade of gates""?Body: While I'm reading some literature about synthesizing quantum circuit, I couldn't understand what cascades of Toffoli gates means. How Toffoli cascade runs in quantum circuit?
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: Achieve a control gate with 2 hadamard coinsBody: I want to implement two Toffoli gates with 4 qubits:
3 serving as control qubits (the 2 hadamard coins and one other qubit) and
the last one as target qubit and 3 qubits (2 coins 1 target qubits) as shown below :
Is there a way of achieving this with qiskit's ccx function ?
I tried :
qnodes = QuantumRegister(2)
qsubnodes = QuantumRegister(2)
qc.ccx(subnode[0], subnode[1], q[1])
if (q[1] ==1) :
qc.x(q[0])
qc.x(q[1])
qc.ccx(subnode[0], subnode[1], q[1])
"
"['grovers-algorithm', 'hadamard']"," Title: Hadamard/Phase/Hadamard and Inversion about the MeanBody: I understand the matrix multiplication behind Grover's algorithm, but I'd like to get an intuitive grasp on why sequence of gates Hadamard-Phase-Hadamard does inversion about the mean. Can anyone help?
"
"['nielsen-and-chuang', 'deutsch-jozsa-algorithm', 'oracles']"," Title: How does $U_f$ in Deutsch's Algorithm affect the state $|x\rangle$?Body: I am trying to read Nielsen's and Chuang's book on quantum computing and I am having problem understanding Deutsch's algorithm.
According to my understanding of the algorithm, the state $|x\rangle$ between the Hadamard gates should not change, however somehow the state of the second qubit affects the first? So from my point of view the measurement after the second Hadamard gate should always be $|0\rangle$. So is $|x\rangle$ after the $U_f$ not the state we used as input? If not then what is the state? Every answer will be appreciated, thanks in advance.
"
"['quantum-gate', 'qiskit', 'programming', 'algorithm', 'entanglement']"," Title: How to decompose arbitrary gates in Qiskit?Body: I have been exploring quantum computing, I have no idea of decomposing arbitrary gates in Qiskit. Can someone help me with an example?
"
"['qiskit', 'ibm-q-experience', 'superdense-coding']"," Title: Superdense coding circuit returns wrong resultBody: I'm new to quantum computing, but everything I've read about superdense coding claims that, in the circuit below, Bob should receive a $[01\rangle$ from Alice.
Unfortunately, that's not what I get I run the above circuit in either Qiskit or Circuit Composer. The latter results are shown below.
If I replace the Pauli-X gate with a Pauli-Z gate, the outcome is $[01\rangle$. What am I missing?
"
"['shors-algorithm', 'phase-estimation', 'phase-kickback']"," Title: What is Quantum Phase Estimation in Shor's Algorithm?Body: While I'm studying Algorithm, I couldn't understand what Quantum Phase Estimation is. And I heard there is relation between Phase-Kickback and Quantum Phase Estimation. I wonder what it is. Also, I'm not sure what this is and how it works within the algorithm. I would like to learn from the mathematical point of view and the conceptual part.
"
"['programming', 'q#']"," Title: How to retrieve the parameters of a Q# operation?Body: How to retrieve the parameters of a Q# operation? Is it possible to do such a thing at all?
"
"['deutsch-jozsa-algorithm', 'fidelity']"," Title: Which of the Jozsa axioms does the Hilbert-Schmidt inner product violate?Body: The paper Quantum fidelity measures for mixed states considers various differently-normalized variants of the Hilbert-Schmidt inner product $\mathrm{Tr}(A^\dagger B)$ on linear operators as candidate measures of the fidelity $\mathcal{F}$ between two density operators $\rho$ and $\sigma$ - that is,
$$\mathcal{F} = \frac{\mathrm{tr}(\rho \sigma)}{f \left(\mathrm{tr}(\rho^2), \mathrm{tr}(\sigma^2) \right)}$$
for various choices of normalization function $f(x,y)$. For various choices of $f$, they say which of the Jozsa axioms are and are not respected by that choice:
J1a. $\mathcal{F}(\rho, \sigma) \in [0, 1]$
J1b. $\mathcal{F}(\rho, \sigma) = 1 \iff \rho = \sigma$
J1c. $\mathcal{F}(\rho, \sigma) = 0 \iff \rho \sigma = 0$
J2. $\mathcal{F}(\rho, \sigma) = \mathcal{F}(\sigma, \rho)$
J3. $\mathcal{F}(\rho, \sigma) = \mathrm{tr}(\rho \sigma)$ if either $\rho$ or $\sigma$ is a pure state
J4. $\mathcal{F}(U \rho U^\dagger, U \sigma U^\dagger) = \mathcal{F}(\rho, \sigma)$ for any unitary operator $U$.
But oddly enough, they never discuss which of these axioms are respected by the simplest choice of normalization of all: $f \equiv 1$, which gives the Hilbert-Schmidt inner product itself as the candidate fidelity.
Which of the Jozsa axioms does the Hilbert-Schmidt inner product respect? It's easy to see that it satisfies axioms J2-J4, but what about J1a-J1c?
"
"['fidelity', 'information-theory']"," Title: Can we combine the square roots inside the definition of the fidelity?Body: The (Uhlmann-Jozsa) fidelity of quantum states $\rho$ and $\sigma$ is defined to be
$$F(\rho, \sigma) := \left(\mathrm{tr} \left[\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}} \right]\right)^2.$$
However, as discussed here, the cyclical property of the trace extends to arbitrary analytic functions:
$$\mathrm{tr}[f(AB)] \equiv \mathrm{tr}[f(BA)]$$
for any analytic function $f$ whenever either side is well-defined. Letting $f$ be the square root function, this seems to imply that
$$F(\rho, \sigma) \equiv \big(\mathrm{tr} \left[\sqrt{\rho \sigma} \right]\big)^2,$$
which is much easier to deal with. (I don't think the branch point at the origin of the square root function is an issue, because the function is still continuous there.)
- Am I correct that these two expressions are equivalent?
- If so, is there any reason why the much clunkier former expression with nested square roots is always given?
The only benefit of the original definition that I can see is that it makes it clear that the operator inside the trace is Hermitian and positive-semidefinite, so that the resulting fidelity is a non-negative real number.
Related on physics.SE
"
"['optimization', 'qaoa']"," Title: QAOA for MaxCut - Algorithm motivationBody: In the QAOA algorithm for MaxCut, the authors construct a very specific scheme where the qubits (corresponding to the vertices of the graph) are transformed using a sequence of unitaries
$$|\gamma, \boldsymbol{\beta}\rangle= U\left(B, \beta_{p}\right) U\left(C, \gamma_{p}\right) \cdots U\left(B, \beta_{1}\right) U\left(C, \gamma_{1}\right)|s\rangle$$
Here $\vert s\rangle$ is an intial state constructed by a Hadamard on the all zero state. The $U(B, \beta_i)$ and $U(C,\gamma_i)$ are also specific unitaries that the authors construct. The alternating sequence of $U(B, \beta_i)$ and $U(C,\gamma_i)$ is also specified.
QAOA works by iteratively measuring the output state $|\gamma, \boldsymbol{\beta}\rangle$. It uses a classical optimizer to choose the next set of angles $\{\beta_i\}$ and $\{\gamma_i\}$. This is repeated until the classical optimizer converges and the final measurement on the state $|\gamma, \boldsymbol{\beta}\rangle$ gives us the information of how to cut the graph.
Is there a reference that explains why this specific construction was chosen? The original paper introduces this construction and says that this yields a good cut but what motivated this very specific construction? Any references or links to talks would be greatly appreciated!
"
['entanglement']," Title: Further entangling two ebits to obtain $|0000\rangle + |1111\rangle$ stateBody: I have two ebits $e1$ and $e2$ and my 4-qubit system is in the state:
$$(|00\rangle + |11\rangle) (|00\rangle + |11\rangle)$$
Ignoring the normalizing constants for now. As mentioned, I need to obtain $|0000\rangle + |1111\rangle$.
I have the additional restriction that I can only use single gates on all the qubits, and controlled gates (CNOT, etc) only on the second and third qubit (otherwise I could just use inverse operations to disentangle all qubits, and proceed to get what I want in same way we create the GHZ state).
My idea to do this was to entangle second and third qubits, using CNOT and H gates, but it doesn't work because the 2nd and third qubits are in the state $|00\rangle + |01\rangle + |10\rangle + |11\rangle$, and I only know how to entangle if we were starting in $|00\rangle$ (or even if we're in $|0\rangle(|0\rangle + |1\rangle)$, which is what we get after H gate).
Is this possible to do?
"
"['algorithm', 'quantum-gate', 'programming', 'entanglement']"," Title: What are the different ways of representing unitary gates in terms of the matrix?Body: What are the different ways of representing unitary gates in terms of the matrix? In other words what would be the two different matrices which on multiplication give you unitary gate matrix?
"
"['entanglement', 'bell-basis']"," Title: Is back in time (classical) information transfer possible (based on delayed choice entanglement swapping)?Body: Delayed choice entanglement swapping.
Two pairs of entangled photons are produced, and one photon from each pair is sent to a party called Victor. Of the two remaining photons, one photon is sent to the party Alice and one is sent to the party Bob. Victor can now choose between two kinds of measurements. If he decides to measure his two photons in a way such that they are forced to be in an entangled state, then also Alice's and Bob's photon pair becomes entangled.
If Victor chooses to measure his particles individually, Alice's and Bob's photon pair ends up in a separable state. Modern quantum optics technology allows to delay Victor's choice and measurement with respect to the measurements which Alice and Bob perform on their photons. Whether Alice's and Bob's photons are entangled and show quantum correlations or are separable and show classical correlations can be decided after they have been measured.
We follow the calculations in the reference.
$\Phi^+=\frac{1}{\sqrt{2}}(\vert 00\rangle+\vert 11\rangle)$
$\Phi^-=\frac{1}{\sqrt{2}}(\vert 00\rangle-\vert 11\rangle)$
$\Psi^+=\frac{1}{\sqrt{2}}(\vert 01\rangle+\vert 10\rangle)$
$\Psi^-=\frac{1}{\sqrt{2}}(\vert 01\rangle-\vert 10\rangle)$
$\vert 00\rangle=\frac{1}{\sqrt{2}}(\Phi^+ + \Phi^-)$
$\vert 11\rangle=\frac{1}{\sqrt{2}}(\Phi^+ - \Phi^-)$
$\vert 01\rangle=\frac{1}{\sqrt{2}}(\Psi^+ + \Psi^-)$
$\vert 10\rangle=\frac{1}{\sqrt{2}}(\Psi^+ - \Psi^-)$
Two pairs of entangled photons (1&2 and 3&4) are each produced in the antisymmetric polarization entangled Bell singlet state such that the total four photon state has the form:
$$\vert \Psi\rangle_{1234}=\vert \Psi^-\rangle_{12}\otimes\vert\Psi^-\rangle_{34}$$
In short, we write:
$$\vert \Psi\rangle_{1234}=\Psi^-_{12}\otimes\Psi^-_{34}$$
If Victor subjects his photons 2 and 3 to a Bell state measurement, they become entangled. Consequently photons 1 (Alice) and 4 (Bob) also become entangled, and entanglement swapping is achieved. This can be seen by writing $\vert \Psi\rangle_{1234}$ in the basis of Bell states of photons 2 and 3.
$$\vert\Psi\rangle_{1234}=\frac{1}{2}(\Psi^+_{14}\otimes\Psi^+_{23}-\Psi^-_{14}\otimes\Psi^-_{23}-\Phi^+_{14}\otimes\Phi^+_{23}+\Phi^-_{14}\otimes\Phi^-_{23})$$
This is relation (2) in the paper linked above.
In order to see the correlations between their particles, Alice and Bob must compare their coincidence records with Victor. Without comparing with Victor's records, they only see a perfect mixture of anti-correlated (the Ψ’s) and correlated (the Φ’s) photons, no pattern whatsoever.
There is though another way based on statistics and a reliable entanglement witness.
When Victor entangles his photons 2 and 3, photons 1 and 4 are in a mixture of entangled states. We consider the transmitter (Victor) and the receiver (Alice and Bob) follow an agreed protocol. For each bit of information transferred (0/1), a certain number KN of pairs of photons are measured by both Victor and corespondingly by Alice/Bob. When he wants to send a 0, Victor does not entangle his photons. When he wants to send a 1, Victor entangles his photons. In order to decode the message Alice and Bob need a reliable procedure of entanglement detection . And they don't need to compare their records with Victor.
In the paper above it is discussed witnessing entanglement without entanglement witness operators. The method involves measuring the statistical response of a quantum system to an arbitrary nonlocal parametric evolution. The witness of entanglement is solely based on the visibility of an interference signal. If followed closely, this method never gives false positives.
In the protocol described , when Victor (the transmitter) and Alice and Bob (the receiver) measure N pairs of photons, then with probability $\frac{1}{4^N}$ all the N photon pairs measured by Alice and Bob will be in the same Bell state. So the transmitter and receiver can repeat measuring N pairs of photons (lets say K times) until the entanglement detection method described above will give a positive. At this point Alice and Bob know that Victor must be entangling his photons. When Victor does not entangle his photons, since the method of entanglement detection mentioned above does not give false positives, Alice and Bob will know that Victor does not entangle his photons for all the KN pairs of photons processed. For large N and K, the probability of error can be made arbitrarily small. Basically, without comparing records, Alice and Bob know what Victor is doing. That's signalling, and the no - signalling theorem can be circumvented due to the method of entanglement detection described above, which does not rely on witness operators.
In principle the problem seems to allow a solution. Reliable entanglement detection seems to circumvent the no - signalling theorem.
Question: Is back in time (classical) information transfer possible?
I am thinking about experiments that would validate Everett's many worlds interpretation of QM (or variants, because that's the only way to avoid the emerging logical paradoxes). In fact, following Scott Aaronson (and others), computation with CTC's would have a great impact in the field. But first things first, is this possible, in principle?
Cross-posted on physics.SE
"
['zx-calculus']," Title: ZX calculus: What do diamond and loop mean?Body: Recently, I started to study practical application of ZX calculus but I am confused by meaning of ""diamond"" and ""loop"".
Issue no. 1:
There are these rules:
B-rule
and D-rule
But this example seems to use the rules wrongly:
In the middle of a digram, B-rule is used, however, I do not see any loop or diamonds justifying this step (i.e. a disconection of nodes).
Similar situation occurs in this example:
Why is it possible to ignore loop and diamonds?
Issue no. 2:
Interpreation of a diamond in Hilbert space is this:
Diamond = $\sqrt{2}$
What does mean that diamond is $\sqrt{2}$? Is it a normalization constant?
Interpreation of a loop in Hilbert space is this:
Loop represent the dimension of underlying Hilbert space
Assuming D-rule, loop should represent two diamonds hence $\sqrt{2}\sqrt{2} = 2$ which is dimension of Hilbert space for description of single qubit states. But ZX calculus can be used for any number of qubits. What does it mean that loop represent a dimension? How is a dimension of ""multi-qubits"" Hilbert space represented?
"
"['qiskit', 'qudit']"," Title: How to simulate spin-1 systems with qiskit or on the IBMQ platform?Body: I am wondering how to simulate spin-1 systems with qiskit or on the IBMQ
platform? I want to initialize a qudit (a spin-1 system), and then define the usual operations (such as Sx, Sy, and Sz) on the system. If you have any experience with this, it would be much appreciated.
"
"['quantum-gate', 'circuit-construction']"," Title: How to make circuit of a 32 X 32 matrix?Body: I have a 32 X 32 matrix show in the picture below and I want to make a circuit for this matrix. Also in the picture below to the matrix picture I have written the each column in bra-ket notation to get the idea of operators required in the circuit by seeing the qubits.
"
['ibm-q-experience']," Title: Can we capture phase in IBM Quantum Experience?Body:
I have a sample IBM experience circuit which generates $$\frac{1}{2}(|00\rangle - |01\rangle - |10\rangle + |11\rangle)$$
When we measure the state will be either $|00\rangle$/$|01\rangle$/$|10\rangle$/$|11\rangle$.
I know that state phase disappears after measurement. I am testing a complex circuit which involves phase angles and I want to ask my questionusing a simple state as mentioned above.
Is there anyway to know if the circuit has produced my desired state. I want to view the full state.
"
"['entanglement', 'quantum-fourier-transform']"," Title: Does the Quantum Fourier Transform (QFT) preserve entanglement?Body: It is well known that entanglement in a quantum state is not affected when you perform a combination of 1-qubit unitary transformations.
I have seen that the QFT can be decomposed into product of 1-qubit unitary transformations (for example in Wiki). However, it is not very clear that QFT preserves entanglement or not. I have seen sources suggesting that it does, doesn't, and unclear.
Does anyone have a definite answer for this question?
"
"['mathematics', 'measurement']"," Title: Getting dot product from two wavefunctionsBody: I'm looking at some examples, but I cannot get the expected result when it comes down to making the measurement on the following state where we measure the first qubit which is the ancilla state.
Here is $|\psi\rangle = \frac{1}{2} |{0}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle + |\psi_b\rangle |\psi_a\rangle) + \frac{1}{2} |{1}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle - |\psi_b\rangle |\psi_a\rangle)$
My calculation suggests that the probability of the ancilla being in the state $|0\rangle$ is:
$p_{0} =\frac{1}{2} + \frac{1}{2}|\langle\psi_a | \psi_b \rangle|^2 $
However the text suggests that there is a minus in place of the plus. I'm not sure if I'm doing anything wrong here or this is a typo.
"
"['quantum-gate', 'matrix-representation']"," Title: What is the general matrix for the Swap gate?Body: In section 3.3.2 of this PDF, The general SWAP gate is defined as
$
S (\alpha, \hat{y}) = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & \cos(\alpha/2) & -\sin(\alpha/2) & 0 \\
0 & \sin(\alpha/2) & \cos(\alpha/2) & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
$
The same lecture notes claim that for $\alpha = \pi$, you get the SWAP gate. This is not correct if we perform the computation.
$
S (\pi, \hat{y}) = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
$
Those lecture notes also say the square root of SWAP can be created by setting $\alpha=\frac{\pi}{2}$. When we do that we get
$
S (\frac{\pi}{2}, \hat{y}) = \begin{bmatrix}
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{bmatrix}
$
The matrix for the square root of Swap is
$
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & \frac{1}{{2}} (1+i) & \frac{1}{{2}} (1-i) & 0 \\
0 & \frac{1}{{2}} (1-i) & \frac{1}{{2}} (1+i) & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
$
This is not the same matrix as the one we get when we use the general SWAP matrix. Is the matrix for the general SWAP from those lecture notes correct? I haven't been able to find another source to cross-reference.
"
"['algorithm', 'grovers-algorithm', 'shors-algorithm', 'hhl-algorithm', 'deutsch-jozsa-algorithm']"," Title: Any other quantum algorithms than Jozsa-Deutsch decision algorithm, Grover search algorithm, Shor factorization algorithm?Body: I have been working on implementing Jozsa-Deutsch decision algorithm, Grover search algorithm, Shor factorization algorithm on my home-made 2 qubits device.
I am wondering if there are any other breakthrough quantum algorithms that I can devise, run and experiment on with on my 2 qubits device?
"
"['programming', 'ibm-q-experience']"," Title: Why IBM Quantum Experience is giving different results under ibmq_qasm_simulator and ibmq_16_melbourne?Body: I am trying to run following 6 qubit quantum circuit and I am getting different results under ibmq_qasm_simulator and ibmq_16_melbourne (both involving 8192 shots). What is the reason?
ibmq_qasm_simulator ::
ibmq_16_melbourne ::
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[6];
creg c[6];
ry(1.57079631679) q[0];
ry(1.57079631679) q[1];
ry(1.57079631679) q[2];
ry(1.57079631679) q[3];
ry(1.57083295585) q[4];
ry(1.98263774407) q[5];
cx q[0],q[1];
ry(-0.00000001000) q[1];
cx q[0],q[1];
cx q[1],q[2];
ry(-0.00000001000) q[2];
cx q[0],q[2];
ry(-0.00000001000) q[2];
cx q[1],q[2];
ry(-0.00000001000) q[2];
cx q[0],q[2];
cx q[2],q[3];
ry(-0.00000001000) q[3];
cx q[1],q[3];
ry(-0.00000001000) q[3];
cx q[2],q[3];
ry(-0.00000001000) q[3];
cx q[0],q[3];
ry(-0.00000001000) q[3];
cx q[2],q[3];
ry(-0.00000001000) q[3];
cx q[1],q[3];
ry(-0.00000001000) q[3];
cx q[2],q[3];
ry(-0.00000001000) q[3];
cx q[0],q[3];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[2],q[4];
ry(0.00003662905) q[4];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[1],q[4];
ry(0.00003662905) q[4];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[2],q[4];
ry(0.00003662905) q[4];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[0],q[4];
ry(0.00003662905) q[4];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[2],q[4];
ry(-0.78523504324) q[4];
cx q[3],q[4];
ry(-0.78523504324) q[4];
cx q[1],q[4];
ry(0.78530830134) q[4];
cx q[3],q[4];
ry(-0.78523504324) q[4];
cx q[2],q[4];
ry(0.00003662905) q[4];
cx q[3],q[4];
ry(0.00003662905) q[4];
cx q[0],q[4];
cx q[4],q[5];
ry(0.17720720528) q[5];
cx q[3],q[5];
ry(0.17720720528) q[5];
cx q[4],q[5];
ry(0.01914233557) q[5];
cx q[2],q[5];
ry(0.01914233557) q[5];
cx q[4],q[5];
ry(-0.21549187642) q[5];
cx q[3],q[5];
ry(0.17720720528) q[5];
cx q[4],q[5];
ry(0.01914233557) q[5];
cx q[1],q[5];
ry(0.01914233557) q[5];
cx q[4],q[5];
ry(0.17720720528) q[5];
cx q[3],q[5];
ry(-0.21549187642) q[5];
cx q[4],q[5];
ry(0.01914233557) q[5];
cx q[2],q[5];
ry(-0.76625582782) q[5];
cx q[4],q[5];
ry(0.17720720528) q[5];
cx q[3],q[5];
ry(0.17720720528) q[5];
cx q[4],q[5];
ry(-0.37355674613) q[5];
cx q[0],q[5];
ry(0.21549187642) q[5];
cx q[4],q[5];
ry(-0.01914233557) q[5];
cx q[3],q[5];
ry(-0.01914233557) q[5];
cx q[4],q[5];
ry(-0.17720720528) q[5];
cx q[2],q[5];
ry(-0.17720720528) q[5];
cx q[4],q[5];
ry(0.37355674613) q[5];
cx q[3],q[5];
ry(-0.80454049897) q[5];
cx q[4],q[5];
ry(-0.17720720528) q[5];
cx q[1],q[5];
ry(-0.17720720528) q[5];
cx q[4],q[5];
ry(-0.01914233557) q[5];
cx q[3],q[5];
ry(-0.41184141727) q[5];
cx q[4],q[5];
ry(-0.17720720528) q[5];
cx q[2],q[5];
ry(-0.17720720528) q[5];
cx q[4],q[5];
ry(-0.01914233557) q[5];
cx q[3],q[5];
ry(-0.01914233557) q[5];
cx q[4],q[5];
ry(0.21549187642) q[5];
cx q[0],q[5];
measure q[0] -> c[5];
measure q[1] -> c[4];
measure q[2] -> c[3];
measure q[3] -> c[2];
measure q[4] -> c[1];
measure q[5] -> c[0];
"
['partial-trace']," Title: Which simple property of partial trace are we using here?Body: I would like to know which property is being used in this example.
For $Tr_1$ the partial trace on the first system:
$$Tr_1[(|0\rangle\otimes|0\rangle)(\langle 0| \otimes \langle0|)] =|0\rangle\langle0|\langle 0 | 0 \rangle $$
The property that I can imagine used are:
- the ciclicity of the trace,
- $Tr[AB]=Tr[BA]$,
- $Tr[v_1^Tv_2] = (v_1,v_2)$
"
"['d-wave', 'optimization', 'annealing']"," Title: Quantum Annealing - Job Shop ProblemBody: using this paper, I want to implement a solution for the Job Shop Problem on a D-Wave machine. One of the constraints mentioned in the paper, is
$$
h_3(\bar{x}) = \sum_i \left(\sum_t x_{i,t}-1 \right)^2,
$$
and I'm curious, how to implement a general BQM for it. I need to create a Qubo matrix, based on the solution of this sum. For that I have rewritten it to
$$
\sum_i \left(\sum_t x_{i,t}-1 \right)^2 = \sum_i\left(2\sum_t\sum_{u>t}x_{it}x_{iu} - \sum_tx_{it} +1\right)
$$
and tried to fill the generall matrix with these loops
for i in range (num_operations):
for u in range(upper_time_limit):
for t in range(u):
# What to do with 2* x_{it}x_{iu} ?
for t in range(upper_time_limit):
Q[i][t] -= 1
Here I am unsure about how to handle the first part, with situations like $x_{2, 3}x_{2,4}$, and I'm not sure what to do with the $+1$ in the end.
I appreciate any help!
"
"['ibm-q-experience', 'grovers-algorithm']"," Title: Difficulty in implementing Grover's Algorithm with large number of qubitsBody: It seems IBM offers a 15 qubit quantum computer through their quantum experience program. However, upon a quick search through the literature, the largest implementation of Grover's algorithm I have seen is with 4 qubits. What seems to be preventing people from implementing Grover's algorithm with as many qubits as possible?
"
"['programming', 'circuit-construction', 'ibm-q-experience']"," Title: Can we add two classical registers in IBM Quantum Experience?Body: Suppose I have 01 and 11 in classical register 1 and 2 respectively in IBM quantum experience circuit. I want 01 + 11 = 00 mod 4. Can it be done?
"
"['mathematics', 'density-matrix', 'nielsen-and-chuang']"," Title: Understanding the outer products in density matricesBody: I don't understand a simple property of the outer product when doing density matrices. I am studying nielsen and chuang's book.
At equation 2.197 they do show the density matrix of the state of quantum teleportation before alice performs her measurements.
For
$$|\psi\rangle = \frac{1}{2}[|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)]$$
The density matrix is just:
$$\rho_1= \frac{1}{4}[|00\rangle \langle 00|(\alpha|0\rangle + \beta|1\rangle)(\alpha^*|0\rangle+\beta^*|1\rangle)+\\
|01\rangle\langle01|(\alpha|1\rangle +\beta |0\rangle)(\alpha^*\langle1| +\beta^*\langle0|) +\\
|10\rangle\langle10|(\alpha|0\rangle -\beta |1\rangle)(\alpha^*\langle 0|-\beta^*\langle1|) +\\
|11\rangle\langle11|(\alpha|1\rangle -\beta|0\rangle)(\alpha^*\langle 1| -\beta^*\langle0|)
]$$
But in the example a couple of pages before, they present the density matrix of $|+\rangle$, which is:
$$\rho_2=\frac{1}{2} (|0\rangle+|1\rangle)(\langle0| + \langle 1|) $$
Which it gets ""opened up"" as
$$\rho_2=\frac{1}{2} (|0\rangle\langle0|+ |0\rangle \langle1| + |1\rangle\langle0| + |1\rangle\langle1|) $$
So basically I don't understand why sometimes the outer product you have the cross terms $|0\rangle \langle1|$, and sometimes you dont: I would have expected to have 16 terms in the density matrix of the teleportation, or just 2 in the example of the maximally mixed state.
Specifically, I expect either $\rho_2$ to be (which I understand is plain wrong):
$$\rho_2 = \frac{1}{2}(|0\rangle\langle0| + |1\rangle\langle1|)$$
or $\rho_1$ to be all the cross product terms:
$$\rho_1= \frac{1}{4}[|00\rangle \langle 00|(\alpha|0\rangle + |01\rangle(\alpha^*|1\rangle+\beta^*|0\rangle)+\\
|01\rangle\langle01|(\alpha|0\rangle +\beta |1\rangle)(\alpha^*\langle0| +\beta^*\langle1|) +\\
|10\rangle\langle10|(\alpha|0\rangle -\beta |1\rangle)(\alpha^*\langle 0|-\beta^*\langle1|) +\\
|11\rangle\langle11|(\alpha|1\rangle -\beta|1\rangle)(\alpha^*\langle 1| -\beta^*\langle1|+\\
|00\rangle \langle 01|(..)()..)+\\
|00\rangle \langle 10|(..)()..)+\\
|00\rangle \langle 11|(..)()..)+\\
|01\rangle \langle 00|(..)()..)+\\
|01\rangle \langle 10|(..)()..)+\\
|01\rangle \langle 11|(..)()..)+\\
etc..
)
]$$
Can someone tell me what i don get about distributive property of outer products?
"
"['qiskit', 'programming']"," Title: Implementing QFTBody: I would like to know if there is a way to:
- Implement Quantum 'Functions' e.g the QFT of QFT* containing several single-qubit operations?
- Implement such operations on an arbitrary number of qubits and in the same vein implement work-qubits.
Not looking as responsive as pyquil, however, I noticed in the Qiskit documentation that implementing a 'CircuitFactory' with the 'ABC' package seems to be the way to go. I would just appreciate insights from experienced hands.
Thank you kindly.
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: XX, YY, ZZ circuit representations?Body: Is there a good primer or set of lectures\examples that show entirely how to take a given matrix and developing a circuit that represents it. I am trying to implement a program to find the lowest Eigenvalue - VQE approach - using quantum circuits. So far, what I have done, using tutorials I found, is as follows:
$H_{total} = H_1(\theta_1) + H_2(\theta_2) + H_3(\theta_3)$
I have been relying on simulating each term of the hamiltonian, the $H_i$, as separate circuits and measuring the expected values as $\theta_i$ changes.
However, as I have been told by my TA that one cannot simulate the hamiltonians separately to find the ground state.
"
"['qiskit', 'programming', 'random-quantum-circuit']"," Title: How to make circuit for randomly selected gate?Body: I am trying to make a circuit for the randomly selected gates from a gate_list but I don't know how to put these selected gates in front of qr. statement. I don't know how to do this exactly is there any batter way to do this?
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import Aer, execute
import random
n = 8
gate_list = ['u1', 'u2', 'u3', 'id', 'x', 'y', 'z', 'h', 's']
selected_gates= []
for i in range(0,8):
x = random.choice(gates)
a = '({})'.format(i)
k = x+a
selected_gates.append(k)
print(selected_gates)
qr = QuantumCircuit(n)
qr.selected_gates[0]
qr.selected_gates[1]
qr.selected_gates[2]
qr.selected_gates[3]
qr.selected_gates[4]
qr.selected_gates[5]
qr.selected_gates[6]
qr.selected_gates[7]
qr.draw()
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: Toffoli gates with Hadamard coins (QISKIT)Body: I am creating the following circuit with Qiskit (2Toffoli gates controlled with coins)
And to set the coins for one iteration of the circuit i do the following :
qsubnodes = QuantumRegister(2)
qsubnodes = QuantumRegister(2)
qc.h(subnode[0])
qc.h(subnode[1])
and then for the first Toffoli gate:
qc.ccx(subnode[0], subnode[1], *q)
and the second toffoli gate (which is the issue) :
qc.h(subnode[0])
qc.h(subnode[1])
qc.x(subnode[1]) // to invert the coin to control for 0 (as shown in the circuit)
qc.ccx(subnode[0], subnode[1], *q)
Is it the right way of inverting the coin for the second toffoli ?
Thank you,
"
"['quantum-gate', 'hamiltonian-simulation', 'unitarity', 'vqe']"," Title: Circuit of a very trivial thingBody: I am writing to double check that if have a hamiltonian of the form $H = I_1 \otimes I_2$, when I seek to find the unitary, $e^{-i\gamma I_1 \otimes I_2}$, there really is no need to convert this into a circuit given that it's just measuring two non-interacting qubits (despite their tensor product)?
I ask this because what throws me off is the $\alpha$ factor which, in the case of $H = \frac{1}{2} (Z_1 \otimes Z_2)$ it becomes a $U \approx e^{-i\frac{\alpha}{2} Z_1 \otimes Z_2}$ which becomes the following circuit:
Provided this circuit, one question I have is, do I need an Ansatz on top of this unitary, or is this unitary the ansatz I need to represent the Ising coupling?
Thank you.
"
['qiskit']," Title: Loading old results for Data reprocessingBody: I want to process some old data again. How do I load old data retrieved from IBM-Q into a new program? I've downloaded the relevant .json file, but I don't know how to use it like I would have a new data.
"
"['algorithm', 'classical-computing']"," Title: Is there anything that can be programmed on a classical computer but not on a quantum computer?Body: Would we need to create new algorithms that only work on quantum computers or would be simply edit codes in languages such as C++ to involve the new primitives from quantum computing? Are there things that can be programmed on a classical computer that can’t be programmed ona. Quantum computer? I know that quantum computer are turing complete.
"
['optical-quantum-computing']," Title: Timing accuracy for the KLM protocol and how do controlled gates work?Body: I'm working on an open-source and open-hardware implementation of the KLM protocol, currently I'm working on EDA software that converts OpenQASM code into a manufacturable PCB
As part of that, I need to make a set of standardized components which requires creating a scalable architecture, etc. etc.
In a perfect world where every component I use works perfectly, timing and synchronization isn't an issue at all, but this is reality so I'm assuming there is a degree of accuracy needed to actually implement the KLM protocol.
I've devised a delay system using a laser that allows me to trigger my single photon sources at the same time and allows me to synchronize the production of a photon in controlled gates with the arrival of a photon at the gate, at least in theory, the reality is the electrical components (e.g. photodiodes, transistors, etc.) take time to actually do their job. Now, all of these components have known max times to do their job, usually rated in nanoseconds, so I can predict with a degree of accuracy how close the photons will be along a specific path.
So, for instance if I have 2 photons traveling towards a CX gate with two ancillary modes with a photon and a vacuum state, if the 3 photons enter the gate a few ns apart will the gate still work?
Maybe I'm overthinking this, but if I count the number of photons at my ancilla detectors and their values are what they should be even though it took an extra few ns for the photons to pass through, that means the gate worked right?
But what happens if one photon passes through the gate before the other even arrives at the gate? Surely this must mean the gate would fail, no? I guess I'm not understanding how the controlled gates actually work.
And so, my question is how do the controlled gates work, and what is an acceptable discrepancy of time between the photons (or how do I calculate it)? The max accuracy I can realize without going to silicon fabrication is down to a few picoseconds
"
"['measurement', 'graph-states']"," Title: $X$ measurement on graph state leads to edge contractionBody: I cannot understand the proof of Lemma 5 from the paper ""Resources Required for Preparing Graph States"". Here it is:
(In this paper, $|G:S\rangle$ denotes $Z_S$ applied to the graph state $|G\rangle$, and the $/$ symbol denotes contraction of an edge.)
I have two questions
1) Why is the operator $Z_{v^{\prime\prime}}^k$ inside the big brackets necessary? Since $v^{\prime\prime}$ is not present in the graph $G/vv^\prime/v^\prime v^{\prime\prime}$, does this operator not just cancel out with the one inside the term $(|0\rangle +Z_{v^{\prime\prime}}^k|1\rangle)_{v^{\prime\prime}}$ ?
2) What is special about having $v^\prime$ and $v^{\prime\prime}$ here? If we had no $v^{\prime\prime}$ vertex, and the vertex $v^\prime$ attached directly to $R$ (see figure 1), would this same argument not work?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: IBMQ: `from qiskit import QISKitError` gives 'cannot import name QISKitError'Body: When I run:
from qiskit import QISKitError
I get the error:
ImportError: cannot import name 'QISKitError'
I need QISKitError for exception handling with my program. Did IBMQ recently update this import?
"
"['quantum-gate', 'physical-realization']"," Title: The Clock Speed for the Quantum ComputersBody: Is there a way to look up the clock speed for the different computers?
"
"['qiskit', 'programming', 'quantum-enhanced-machine-learning']"," Title: Regarding quantum support vector machine using qiskitBody: I would like to ask, how can I add my own .csv data file to run a quantum support vector machine using qiskit ? I don't want to use already existing datasets in sklearn, scikit-learn library.
"
"['quantum-gate', 'measurement']"," Title: Exercises on computing by hand quantum circuitsBody: I'm trying to become familiar with manipulation of the Dirac notation.
I want to be able to compute quickly the final states obtained in a small circuit.
Typically, it should include 2 to 5 qubits, and be composed of some 2-qubit controlled gates (essentially CNOT but others would be good too),
rotation, hadamard, paulis, and other basic gates. It should not contain too many gates either so I don't spend 4 hours computing it.
Once computed the final state I want also to be able to give quickly the results of the measure of one of the qubits,
probability and state after measurement.
Do you know any exercises with solutions of the computation of circuits ?
Where can I find them ?
"
"['programming', 'circuit-construction', 'ibm-q-experience']"," Title: Why I am getting transpilation error while executing the following IBM Quantum Experience code?Body: While executing the following circuit (consisting 16 qubit and 4 classical bits) I am getting ""Error in transpilation process. [1003]"" error. I have a group of 2 operations (you can observe circuit duplication in the figure). Is it a valid circuit? If not why it is not?. Why am I getting error? (My target backend is ibmq_16_melbourne).
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[8];
qreg qGrp1[8];
creg c[2];
creg cGrp1[2];
h q[2];
h q[4];
h q[6];
x q[7];
x qGrp1[1];
h qGrp1[2];
h qGrp1[4];
h qGrp1[6];
x qGrp1[7];
cx q[2],q[3];
cx q[4],q[5];
cx q[6],q[7];
cx qGrp1[2],qGrp1[3];
cx qGrp1[4],qGrp1[5];
cx qGrp1[6],qGrp1[7];
ccx q[6],q[0],q[4];
ccx qGrp1[6],qGrp1[0],qGrp1[4];
ccx q[7],q[1],q[5];
ccx qGrp1[7],qGrp1[1],qGrp1[5];
x q[6];
x q[7];
x qGrp1[6];
x qGrp1[7];
ccx q[6],q[0],q[2];
ccx qGrp1[6],qGrp1[0],qGrp1[2];
ccx q[7],q[1],q[3];
ccx qGrp1[7],qGrp1[1],qGrp1[3];
cx q[2],q[3];
cx q[4],q[5];
cx qGrp1[2],qGrp1[3];
cx qGrp1[4],qGrp1[5];
measure q[3] -> c[0];
measure q[5] -> c[1];
measure qGrp1[3] -> cGrp1[0];
measure qGrp1[5] -> cGrp1[1];
"
"['algorithm', 'qiskit', 'programming']"," Title: How to use external .csv data file in quantum support vector machine qiskit python code?Body: I am new to python programming and Qiskit. I would like to ask can we use sklearn for adding external .csv data file before Qiskit libraries, or without sklearn, we can do or is there any other Qiskit library to add any external .csv file, to run the python code of quantum support vector machine?
How I can use .csv data file with Qiskit libraries to run quantum SVM ?
I am following the code written below, where I should put my own .csv data file
import numpy as np
from dataset import breast_cancer
from sklearn.datasets.samples_generator import make_blobs
from qiskit.aqua.utils import split_dataset_to_data_and_labels
from sklearn import svm
from utils import svm_utils
from matplotlib import pyplot as plt
#matplotlib inline
#load_ext autoreload
#autoreload 2 % Breast Cancer dataset
n = 2 # number of principal components kept
training_dataset_size = 20
testing_dataset_size = 10
sample_Total, training_input, test_input, class_labels = breast_cancer(training_dataset_size, testing_dataset_size, n)
data_train, _ = split_dataset_to_data_and_labels(training_input)
data_test, _ = split_dataset_to_data_and_labels(test_input) # %%Breast Cancer dataset
##%% Linear Support vector machine
# We use the function of scikit learn to generate linearly separable blobs
centers = [(2.5,0),(0,2.5)]
x, y = make_blobs(n_samples=100, centers=centers, n_features=2,random_state=0,cluster_std=0.5)
fig,ax=plt.subplots(1,2,figsize=(10,5))
ax[0].scatter(data_train[0][:,0],data_train[0][:,1],c=data_train[1])
ax[0].set_title('Breast Cancer dataset');
ax[1].scatter(x[:,0],x[:,1],c=y)
ax[1].set_title('Blobs linearly separable');
##%% Hands-on session on support vector machine
plt.scatter(data_train[0][:,0],data_train[0][:,1],c=data_train[1])
plt.title('Breast Cancer dataset');
model= svm.LinearSVC()
model.fit(data_train[0], data_train[1])
accuracy_train = model.score(data_train[0], data_train[1])
accuracy_test = model.score(data_test[0], data_test[1])
X0, X1 = data_train[0][:, 0], data_train[0][:, 1]
xx, yy = svm_utils.make_meshgrid(X0, X1)
Z = model.predict(np.c_[xx.ravel(), yy.ravel()])
Z = Z.reshape(xx.shape)
fig,ax=plt.subplots(1,2,figsize=(15,5))
ax[0].contourf(xx, yy, Z, cmap=plt.cm.coolwarm)
ax[0].scatter(data_train[0][:,0], data_train[0][:,1], c=data_train[1])
ax[0].set_title('Accuracy on the training set: '+str(accuracy_train));
ax[1].contourf(xx, yy, Z, cmap=plt.cm.coolwarm)
ax[1].scatter(data_test[0][:,0], data_test[0][:,1], c=data_test[1])
ax[1].set_title('Accuracy on the test set: '+str(accuracy_test));
##%% We now implement a SVM with gaussian kernel
clf = svm.SVC(gamma = 'scale')
clf.fit(data_train[0], data_train[1]);
accuracy_train = clf.score(data_train[0], data_train[1])
accuracy_test = clf.score(data_test[0], data_test[1])
X0, X1 = data_train[0][:, 0], data_train[0][:, 1]
xx, yy = svm_utils.make_meshgrid(X0, X1)
Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
Z = Z.reshape(xx.shape)
fig,ax=plt.subplots(1,2,figsize=(15,5))
ax[0].contourf(xx, yy, Z, cmap=plt.cm.coolwarm)
ax[0].scatter(data_train[0][:,0], data_train[0][:,1], c=data_train[1])
ax[0].set_title('Accuracy on the training set: '+str(accuracy_train));
ax[1].contourf(xx, yy, Z, cmap=plt.cm.coolwarm)
ax[1].scatter(data_test[0][:,0], data_test[0][:,1], c=data_test[1])
ax[1].set_title('Accuracy on the test set: '+str(accuracy_test));
##%% First steps in Qiskit
import qiskit as qk
# Creating Qubits
q = qk.QuantumRegister(2)
# Creating Classical Bits
c = qk.ClassicalRegister(2)
##%% Define and print empty circuit
circuit = qk.QuantumCircuit(q, c)
print(circuit)
##%%% Add gates to the qubits
# Initialize empty circuit
circuit = qk.QuantumCircuit(q, c)
# Hadamard Gate on the first Qubit
circuit.h(q[0])
# CNOT Gate on the first and second Qubits
circuit.cx(q[0], q[1])
# Measuring the Qubits
circuit.measure(q, c)
print (circuit)
##%% Run the circuit on the quantum simulator
# Using Qiskit Aer's Qasm Simulator: Define where do you want to run the simulation.
simulator = qk.BasicAer.get_backend('qasm_simulator')
# Simulating the circuit using the simulator to get the result
job = qk.execute(circuit, simulator, shots=100)
result = job.result()
# Getting the aggregated binary outcomes of the circuit.
counts = result.get_counts(circuit)
print (counts)
from qiskit.aqua.components.feature_maps import SecondOrderExpansion
feature_map = SecondOrderExpansion(feature_dimension=2,
depth=1)
##%%Print the feature map circuit
x = np.array([0.6, 0.3])
print(feature_map.construct_circuit(x))
##%%% QSVM Algorithm
from qiskit.aqua.algorithms import QSVM
qsvm = QSVM(feature_map, training_input, test_input)
##%% Run QSVM
from qiskit.aqua import run_algorithm, QuantumInstance
from qiskit import BasicAer
backend = BasicAer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, shots=1024, seed_simulator=10598, seed_transpiler=10598)
result = qsvm.run(quantum_instance)
##%%% Analyze output
plt.scatter(training_input['Benign'][:,0], training_input['Benign'][:,1])
plt.scatter(training_input['Malignant'][:,0], training_input['Malignant'][:,1])
plt.show()
length_data = len(training_input['Benign']) + len(training_input['Malignant'])
print(""size training set: {}"".format(length_data))
print(""Matrix dimension: {}"".format(result['kernel_matrix_training'].shape))
print(""testing success ratio: "", result['testing_accuracy'])
test_set = np.concatenate((test_input['Benign'], test_input['Malignant']))
y_test = qsvm.predict(test_set, quantum_instance)
##%% And here we plot the results. The first plot shows the label predictions of the QSVM and the second plot shows the test labels.
plt.scatter(test_set[:, 0], test_set[:,1], c=y_test)
plt.show()
plt.scatter(test_input['Benign'][:,0], test_input['Benign'][:,1])
plt.scatter(test_input['Malignant'][:,0], test_input['Malignant'][:,1])
plt.show()
"
"['quantum-gate', 'entanglement']"," Title: computing a quantum circuit by hand (CNOT on non-computational basis states)Body: I'm trying to compute the state of a particular circuit using Dirac notation but I get stuck after a while .. you can find the circuit there.
The numerical coefficients do not matter and I want to compute it for any rotation parameter.
So far here's what I've done :
Computing the three states after rotation :
$R_X(\theta_1) |0⟩ = |\phi_1⟩= \cos(\frac{\theta_1}{2})|0⟩ - i \sin(\frac{\theta_1}{2}) |1⟩$
$R_Y(\theta_2) |0⟩ = |\phi_2⟩ = \cos(\frac{\theta_2}{2}) |0⟩ + \sin(\frac{\theta_2}{2}) |1⟩$
$R_Y(\theta_3) |0⟩ = |\phi_3⟩ = \cos(\frac{\theta_3}{2}) |0⟩ + \sin(\frac{\theta_3}{2}) |1⟩$
I then compute the joint state $|\phi_1 \phi_2⟩$ :
$|\phi_1 \phi_2⟩ = (\cos(\frac{\theta_1}{2}) |0⟩ - i \sin(\frac{\theta_1}{2}) |1⟩) \otimes (\cos(\frac{\theta_2}{2}) |0⟩ + \sin(\frac{\theta_2}{2}) |1⟩)$
$ = \cos(\frac{\theta_1}{2}) \cos(\frac{\theta_2}{2}) |00⟩ + \cos(\frac{\theta_1}{2}) \sin(\frac{\theta_2}{2}) |01⟩ - i \sin(\frac{\theta_1}{2}) \cos(\frac{\theta_2}{2}) |10⟩ - i \sin(\frac{\theta_1}{2}) \sin(\frac{\theta_2}{2}) |11⟩ $
I then compute the CNOT gate with control $|\phi_1⟩$ and target $|\phi_2⟩$ :
$ CNOT(|\phi_1 \phi_2⟩) = \cos(\frac{\theta_1}{2}) \cos(\frac{\theta_2}{2}) |00⟩ + \cos(\frac{\theta_1}{2}) \sin(\frac{\theta_2}{2}) |01⟩ - i \sin(\frac{\theta_1}{2}) \cos(\frac{\theta_2}{2}) |11⟩ - i \sin(\frac{\theta_1}{2}) \sin(\frac{\theta_2}{2}) |10⟩ $
But then I'm not sure how to compute the last CNOT gate.. I could do it using matrix computation but the whole point is being able to do this kind of computation quickly by hand.
"
['algorithm']," Title: Would quantum computers improve solving statistical regression problems or neural networks?Body: Do quantum computers only offer some computational benefit or advantage for complicated algorithms or would simple ordinary least squares solving or computing the maximum likelihood estimates or Newton Raphson also benefit?
Would Monte Carlo methods or Bayesian simulation based methods or Gibbs sampling be improved?
"
"['programming', 'optimization', 'semidefinite-programming', 'partial-transpose']"," Title: How can I implement partial transpose on a variable in Picos (Python, trying to solve an SDP)?Body: I try to optimise a quantity via an SDP. I optimise over all PPT measurement operators and hence have the constraints $\Pi_k^{T_B} \succeq 0$ (PPT) for my measurement operators.
The part of the code where I define the SDP and constraints is:
[...]
# Defining the SDP
p = pic.Problem()
pic.new_param(""rho_0"", rho_0)
pic.new_param(""rho_1"", rho_1)
pic.new_param(""rho_2"", rho_2)
# Measurement operators
P_0 = p.add_variable(""P_0"", (9,9), ""hermitian"")
P_1 = p.add_variable(""P_1"", (9,9), ""hermitian"")
P_2 = p.add_variable(""P_2"", (9,9), ""hermitian"")
P_inc = p.add_variable(""P_inc"", (9,9), ""hermitian"")
# Partial transposes
p.add_constraint(PT_B(P_0, 3, 3) >> 0)
p.add_constraint(PT_B(P_1, 3, 3) >> 0)
p.add_constraint(PT_B(P_2, 3, 3) >> 0)
p.add_constraint(PT_B(P_inc, 3, 3) >> 0)
[...]
where PT_B is a function implementing the partial transpose, i.e.
def PT_B(M, d1, d2):
""""""
Partial Transpose map of M
Input: Matrix M, Dimension d1 of subsystem 1, Dimension d2 of subsystem 2
Output: Partial Transpose M_TB
""""""
assert M.shape == (d1 * d2, d1 * d2)
# Reshape into 4 tensor
M = M.reshape(d1, d2, d1, d2)
# Transpose 2nd system
M = M.transpose((0, 3, 2, 1))
# Reshape back into a density matrix
return M.reshape(d1 * d2, d1 * d2)
However, Picos doesn't let me manipulate the variable expressions. I also tried to implement the partial transpose by setting the elements of a new variable by hand to the elements of $\Pi_k^{T_B}$. But then Picos tells me that I can't slice variable expressions.
The error message for the above SDP code snippet I get is:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-38-36083f3fb159> in <module>
12
13 # Partial transposes
---> 14 p.add_constraint(PT_B(P_0, 3, 3) >> 0)
15 p.add_constraint(PT_B(P_1, 3, 3) >> 0)
16 p.add_constraint(PT_B(P_2, 3, 3) >> 0)
<ipython-input-34-2327f6ca6850> in PT_B(M, d1, d2)
5 Output: Partial Transpose M_TB
6 """"""
----> 7 assert M.shape == (d1 * d2, d1 * d2)
8
9 # Reshape into 4 tensor
AttributeError: 'Variable' object has no attribute 'shape'
If I try to force the variable expression into an np.array:
[...]
# Partial transposes
p.add_constraint(PT_B(np.array(P_0), 3, 3) >> 0)
p.add_constraint(PT_B(np.array(P_1), 3, 3) >> 0)
p.add_constraint(PT_B(np.array(P_2), 3, 3) >> 0)
p.add_constraint(PT_B(np.array(P_inc), 3, 3) >> 0)
[...]
Then I get the error message:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-39-c6e549dceb23> in <module>
12
13 # Partial transposes
---> 14 p.add_constraint(PT_B(np.array(P_0), 3, 3) >> 0)
15 p.add_constraint(PT_B(P_1, 3, 3) >> 0)
16 p.add_constraint(PT_B(P_2, 3, 3) >> 0)
/usr/local/lib/python3.7/site-packages/picos/expressions.py in __getitem__(self, index)
3973 JJ = rangeT
3974 VV = [1.] * nsz
-> 3975 newfacs = {self: spmatrix(VV, II, JJ, (nsz, sz))}
3976 if not self.constant is None:
3977 newcons = self.constant[rangeT]
/usr/local/lib/python3.7/site-packages/picos/tools.py in spmatrix(*args, **kwargs)
2187 """"""
2188 try:
-> 2189 return cvx.spmatrix(*args, **kwargs)
2190 except TypeError as error:
2191 # CVXOPT does not like NumPy's int64 scalar type for indices, so attempt
TypeError: dimension too small
Does anyone have an idea how to implement the PPT constraint in the SDP in Python?
Mathematica doesn't allow complex matrix SDPs, and Picos and CVXPY give me a hard time implementing the PPT constraint.
Thanks for any suggestions!
"
"['algorithm', 'machine-learning', 'applications', 'trapped-ion']"," Title: What are the mathematical prerequisites to study machine learning on quantum computers?Body: Besides machine learning, quantum info theory, optimization, and statistics knowledge, what are the prerequisites to implement existing ML techniques and create new ML techniques that would work on a quantum computer and be optimized to take full advantage of quantum computing’s efficiencies? What courses does one need to take? I don’t mean simulating quantum computers on a classical computers. I mean actually doing ML or Statistics or Topological data analysis on a trapped ion quantum computer.
"
"['classical-computing', 'quantum-turing-machine']"," Title: Will quantum computers pass the Turing test?Body: Will quantum computers be able to pass the Turing test sooner than classical computers?
"
"['mathematics', 'grovers-algorithm', 'quantum-networks']"," Title: Changing qubits coefficients to trigonometric functions in Grover AlgorithmBody: In this paper, in Appendix B.1 (Grover's Search Algorithm and Grover Operator G), it does a change of coefficients, such as what is done for the Bloch Sphere, but for a many qubits system using only two vectors.
Firstly, it separates the uniform superposition
$$|{\psi}\rangle = \frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}{|x\rangle} $$
in two desired states (based on Oracle ""responses"")
$$ |\psi\rangle = \sqrt{\frac{M}{N}}|\chi\rangle + \sqrt{\frac{N-M}{N}}|\xi\rangle$$
with
$$
|\chi\rangle = \frac{1}{\sqrt{M}}\sum_{x,f(x)=1}{|x\rangle} \quad,\quad
|\xi\rangle = \frac{1}{\sqrt{N-M}}\sum_{x,f(x)=0}{|x\rangle}
$$
where $N=2^n$ (with n being the number of qubits) and $M$ is the number of Maximal Cliques, in this case the number of states which $f(x)=1$, the states which would be flipped by the Oracle.
Then it changes the coefficients of each summation to trigonometric ones as follows
$$ |\psi\rangle = \sin{\frac{\theta}{2}}|\chi\rangle + \cos{\frac{\theta}{2}}|\xi\rangle$$
I could easily see that this transformation is correct and preserves $\langle\psi|\psi\rangle=1$, but I got confused on how to deduce it for a many qubits system and how to achieve a similar structure after applying the Grover Operator G R times as stated by the paper in the following equation
$$ G^R|\psi\rangle = \sin{\frac{(2R+1)\theta}{2}}|\chi\rangle + \cos{\frac{(2R+1)\theta}{2}}|\xi\rangle$$
"
"['resource-request', 'simulation', 'machine-learning']"," Title: Software for implementing Quantum Machine LearningBody: I want to have a software product specifically suited for Quantum Machine Learning. Please help me with a list of software product which has been designed specifically for implementing Quantum Machine Learning Algorithms. Currently, most of the packages are about hybrids like Pennylane and Qiskit are like generic interfaces through which quantum hardware can be accessed. I am looking for a high-level package which can make it easy to simulate QML, so that we can bring QML to audience with little understanding of Quantum Computing.
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'bell-basis']"," Title: Prove that there exist tripartite $|\psi\rangle$ which cannot be written as $|\psi\rangle=\sum_i\lambda_i|i_A\rangle|i_B\rangle|i_C\rangle$Body: Exercise 2.77 in Nielsen and Chuang asks to show by example that there exist tripartite states $| \psi \rangle_{ABC} $ which cannot be written as
$$| \psi \rangle = \sum_i \lambda_i | i_A \rangle | i_B \rangle | i_C \rangle .$$
In this unofficial solution set, they consider the state
$$| \psi \rangle = | 0 \rangle_A \otimes | \Phi_+ \rangle_{BC} = |0 \rangle_A \otimes \bigg[ \frac{1}{\sqrt{2}} \Big( |00 \rangle_{BC} + | 11 \rangle_{BC} \Big) \bigg].$$
Then they perform the arbitrary (unitary) change of basis
$$|0\rangle = \alpha | \phi_0 \rangle + \beta | \phi_1 \rangle , \\
|1\rangle = \gamma | \phi_0 \rangle + \delta | \phi_1 \rangle $$
obtaining
$$ | \psi \rangle = \Big( \alpha | \phi_0 \rangle_A + \beta | \phi_1 \rangle_B \Big) \otimes \bigg[ \frac{1}{\sqrt{2}} \Big( |\phi_0 \phi_0 \rangle_{BC} + | \phi_1 \phi_1 \rangle_{BC} \Big) \bigg].$$
Since the cross terms cannot vanish, the proof is finished. However, I don't see the last step. Why do you have $ |00 \rangle_{BC} + | 11 \rangle_{BC} = |\phi_0 \phi_0 \rangle_{BC} + | \phi_1 \phi_1 \rangle_{BC}$ ? I mean, for instance, the unitarity of the change of basis doesn't buy us the cancellation of the terms $ | \phi_0 \phi_1 \rangle$ and $| \phi_1 \phi_0 \rangle$ (I think).
EDIT: Note that:
1) The coefficients $\alpha$, $\beta$, $\gamma$ and $\delta$ are not, in general, real. Since we want to show that there is no way of rewritting $| \psi \rangle$ in Schmidt form, we have to consider the most general case where these coefficients are complex.
2) The change of basis is, in the most general case, different for each party. I mean, we should rather write
$$|0 \rangle_X = \alpha_X \, | \phi_0 \rangle_X + \beta_X \, | \phi_1 \rangle_X \, , \\
| 1 \rangle_X = \gamma_X \, | \phi_0 \rangle_X + \delta_X \, | \phi_1 \rangle_X \, , $$
where $X= A, B, C$. Unitarity conditions are
$$| \alpha_X |^2 + |\beta_X |^2 = | \gamma_X |^2 + |\delta_X |^2 = 1 \, ,\\
\alpha_X^* \gamma_X + \beta_X^* \delta_X = 0 $$
for each $X$. I don't see how you can cancel the cross terms using this.
"
['programming']," Title: symbolic quantum computing using sympy : how to use arbitrary gate?Body: I'm trying to use sympy to compute symbolic results of quantum circuits using dirac notation.
More specifically, I'd like to use the three rotation gates. I try to implement them in the following way, using sympy symbolic quantum physics package :
from IPython.display import display
from sympy import init_printing
init_printing(use_latex=True)
from sympy import expand, Eq, Symbol, simplify, exp, sin,cos,I,srepr,Matrix
from sympy.physics.quantum import *
from sympy.physics.quantum.qubit import *
from sympy.physics.quantum.gate import *
from sympy.physics.quantum.circuitplot import circuit_plot
theta = Symbol('theta')
Ry_mat = Matrix([[cos(theta/2), -sin(theta/2)],[sin(theta/2),cos(theta/2)]]) #check
Rx_mat = Matrix([[cos(theta/2), -I*sin(theta/2)],[-I*sin(theta/2),cos(theta/2)]]) #check
Ry = UGate((0,), Ry_mat)
Rx= UGate((1,), Rx_mat)
c = Ry*Rx
circuit_plot(c, nqubits=2);
qapply(c*Qubit('00'))
I get the error unhashable type: 'MutableDenseMatrix'
when executing qapply. I tried to replace the line :
c = Rx*Ry
with
c = Rx
and then there is no more errors. Does someone know what's going on ? What am I doing wrong ?
"
"['circuit-construction', 'ibm-q-experience']"," Title: Why I am not getting approximate equiprobable states in the following circuit on IBM Q simulator?Body: I have the following circuit which consists of symmetric modules. I compiled the circuit in IBM Quantum experience backend - ibmq_qasm_simulator, 8192 shots. The result is not equiprobable. Why? Since this is not a real machine ideally I should get same probability of 16.67%.
OPENQASM 2.0;
include ""qelib1.inc"";
qreg qA[8];
qreg qB[8];
qreg qC[6];
qreg qD[6];
creg c[4];
h qA[2];
h qA[4];
x qA[6];
x qA[7];
x qB[1];
h qB[2];
h qB[4];
x qB[6];
x qB[7];
h qC[0];
h qC[2];
x qC[4];
x qC[5];
h qD[0];
h qD[2];
x qD[4];
x qD[5];
cx qA[2],qA[3];
cx qA[4],qA[5];
h qA[6];
cx qB[2],qB[3];
cx qB[4],qB[5];
h qB[6];
cx qC[0],qC[1];
cx qC[2],qC[3];
h qC[4];
cx qD[0],qD[1];
cx qD[2],qD[3];
h qD[4];
cx qA[6],qA[7];
cx qB[6],qB[7];
cx qC[4],qC[5];
cx qD[4],qD[5];
x qA[0];
ccx qA[6],qA[0],qA[4];
ccx qB[6],qB[0],qB[4];
ccx qA[7],qA[1],qA[5];
ccx qB[7],qB[1],qB[5];
x qA[6];
x qA[7];
x qB[6];
x qB[7];
ccx qA[6],qA[0],qA[2];
ccx qB[6],qB[0],qB[2];
ccx qA[7],qA[1],qA[3];
ccx qB[7],qB[1],qB[3];
cx qA[2],qA[3];
cx qA[4],qA[5];
cx qB[2],qB[3];
cx qB[4],qB[5];
ccx qA[3],qC[4],qC[2];
ccx qB[3],qC[5],qC[3];
x qC[4];
x qC[5];
ccx qA[3],qC[4],qC[0];
id qA[5];
ccx qB[3],qC[5],qC[1];
id qA[5];
cx qC[0],qC[1];
cx qC[2],qC[3];
ccx qA[5],qD[4],qD[2];
ccx qB[5],qD[5],qD[3];
x qD[4];
x qD[5];
ccx qA[5],qD[4],qD[0];
ccx qB[5],qD[5],qD[1];
cx qD[0],qD[1];
cx qD[2],qD[3];
measure qC[1] -> c[3];
measure qC[3] -> c[2];
measure qD[1] -> c[1];
measure qD[3] -> c[0];
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: Primer for Quantum Circuits and OptimizationBody: I am interested in studying physical systems and trying to build circuits to simulate them. Now, of course, all the systems I could try to work with at simple, toy, systems - and that's fine.
However, I find myself unable to fully grasp how to go from say, a hamiltonian, to a graph, and then to a circuit - let alone to successfully find the right framework to add optimization.
I am wondering: do you have any papers that do a good job in taking a beginner - besides Patrick Cole's paper - from first principles to quantum gates?
Thank you.
"
"['haar-distribution', 'diamond-norm']"," Title: Is there a lower bound on the average diamond norm of two uniformly random unitaries U1 and U1 of dimension D that are sampled from haar measure?Body: I could not find any lower bound on the diamond norm for two uniformly random unitaries of dimension D sampled from the haar measure.
"
['machine-learning']," Title: Quantum Noise DatasetBody: Does anyone in here know of an open source source for finding noisy data from quantum gates. I am interested in playing around with in the same way people play around with MNIST.
I know it's a long shot, but I hope to hear back from someone!
"
"['resource-request', 'machine-learning', 'research']"," Title: Is Industry or PhD programs best for someone wanting to go to quantum machine learning?Body: Is Industry and the companies including IBMa and D-wave etc or PhD research programs best for someone wanting to go to quantum statistical/mathematical machine learning in the United States?
I mean actual quantum computers rather than simulation of quantum computers on classical computers
"
"['quantum-gate', 'qiskit', 'programming']"," Title: How to read the elements of a circuit in qiskit?Body: I would like to know if there is a way to read the elements of a circuit. What I mean is if I have a QuantumCircuit object, can I obtain the gates that are applied to each qubit in order?
I would like to implement certain noise gate after each Hadamard and I would have therefore to identify each Hadamard in the QuantumCircuit object. So I need a function that gives me all the gates in a circuit and that allows me to modificate what it returns so I can construct a modified quantum circuit.
"
"['quantum-state', 'physical-qubit']"," Title: How do I explain qubits to my cousin who is 8 year old?Body: How do I explain qubits to my cousin who is 8 years old?
"
['quantum-gate']," Title: How do I interpret the CNOT gate control-target structure after a basis-change?Body: Consider the product of gates acting on two qubits:
$$
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{pmatrix}
\cdot
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{pmatrix}
\cdot
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
0 & 0 & \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\
\end{pmatrix}.
$$
This is a controlled Hadamard, then SWAP, then CNOT. On the basis
$$
\begin{pmatrix}
00 \\ 01 \\ 10 \\ 11
\end{pmatrix}
$$
This leaves us, before the last CNOT, in the basis,
$$
\begin{pmatrix}
00 \\ 1 + \\ 01 \\ 1 -
\end{pmatrix}.
$$
It's hard for me to see the last CNOT as a control on a 1 state anymore. Am I missing something simple, or has the interpretation just been lost since I changed basis? I guess I'm wondering why even make the usual statement that CNOT (or any controlled gate) is used with a ''control'' and ''target'' since in some simple steps I can very rapidly move away from that interpretation. It seems like it should just be interpreted as another SWAP that just moves around the vector elements. Is my understanding of this correct? Thanks.
"
"['mathematics', 'error-correction', 'nielsen-and-chuang']"," Title: Identity for linear codes and their duals: why do we have $\sum_y (-1)^{x\cdot y}=|C|\delta_{x\in C^\perp}$?Body: I've come across this exercise plenty of times and I still don't understand how to do it. (Here it is from N.C. Ex.10.25)
Let $C$ be a linear code (Lets suppose its a binary code, i.e. a $k$-dimensional subspace of $\mathbb{F}_2^n$). Show that $$\sum_{y\in C}(-1)^{x\cdot y} =\begin{cases} |C|\, \text{ if $x\in C^\perp$},\\ 0\, \text{ if $x\notin C^\perp$}.\end{cases}$$
(Aside: This exercise is key in understanding why CSS codes can correct both bit flip and phase flip errors.)
The case where $x\in C^\perp$ is trivial. It's the second case that is less so... I know the following: If $x\notin C^\perp$ then $x\in C$. I can also see that the solution would follow if I could show that half the vectors $y\in C$ were orthogonal to $x$. Since this would imply that the other half are not orthogonal and we would have an equal number of $(+1)$'s coming from $x\cdot y=0$ that would cancel out with the $(-1)$'s from the $x\cdot y=1$ terms. Anyone have the missing piece or am I on the wrong track here.
"
"['quantum-state', 'measurement', 'nielsen-and-chuang', 'projection-operator']"," Title: Showing measurement of a Hermitian Unitary operator gives final states as eigenvectorsBody: This is related to exercise 4.34,
The operation described can be written as $(H \otimes I)C^1(U)(H \otimes I)(|0\rangle \otimes |\psi\rangle)$
I can get to the point where the state of the system is given by:
$|0\rangle \otimes(I+U)|\psi\rangle + |1\rangle \otimes(I-U)|\psi\rangle$,
where $U$ is a Hermitian unitary with eigenvalues $-1$ and $+1$ with corresponding eigenvectors $|\lambda_-\rangle$ and $|\lambda_+\rangle$ respectively.
however I am stuck on the final part that when measuring $q_0$ the post-measurement state is given by the corresponding eigenvector of $U$. This reduces down to to showing that
$(I-U)|\psi\rangle = |\lambda_-\rangle$
$(I+U)|\psi\rangle = |\lambda_+\rangle$
I have tried using the spectral decomp of $U$ however I can't seem to get it to lead anywhere. My current trail of thought (not sure if correct) is if taking the density of the system, $(I\pm U)$ reduces down to projectors for $|\lambda_\pm\rangle$, s.t. $P_{\pm}|\psi\rangle = c_{\pm}\lambda_\pm $.
-- Update --
An answer using projectors (as suspected) is using the fact that for $U$ to be unitary and Hermitian then $U = (2P - I)$ for an orthogonal projector $P$ (https://math.stackexchange.com/questions/57148/matrices-which-are-both-unitary-and-hermitian), hence $(I+U)$ and $(I-U)$ reduce down to a projector $P$ and its orthogonal complement $2(I-P)$, thus projecting $\psi$ onto the eigenvectors.
"
"['quantum-state', 'gate-synthesis']"," Title: What is the complexity of splitting a state into a superposition of $n$ computational basis states?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
I'm looking for (unitary$^1$) transformations$^2$, to create a superposition of any $n$ computational basis states with equal coefficients. I'm further interested in the complexity of these implementations and/or a gate count.
Building up on this question, on how to create superpositions of 3 states, I wonder how it scales to split up into any number of $n$ computational basis states. For simplicity let's always start with $\ket{00...0}$. Here are my thoughts:
- $n=5$: Split $\ket{000}\rightarrow \sqrt\frac25\ket{000}+ \sqrt\frac35\ket{001}$ by a local $Y$-gate , then implement a controlled (trigger when the rightmost bit is $0$) split like $\ket{000}\rightarrow \sqrt{\frac12}(\ket{000}+\ket{010})$ and finally a controlled (trigger when the leftmost bit is $1$) split like $\ket{001}\rightarrow \sqrt{\frac13}(\ket{001}+\ket{011}+\ket{111})$. For reference see here.
- $n=6$: same as for $n=5$ but after an local split into 2 equal halves on the first (rightmost/top) qubit, 2 controlled splits into 3 states are involved.
- $n=7$: again split in two parts with the weigths $\sqrt\frac37 :\sqrt\frac47$ and further implement controlled splits...
- $n=8$: trivial
- $n=9$: this takes 4 qubits. Split into 3 on the first 2 qubits and then have controlled splits into another 3 on the last 2 qubits.
I haven't counted CNOTs and local operations (necessary for answering the scaling question), but the pattern looks like something, how to decompose numbers. Is there a generic way to come up with a circuit to split into $n$ computational basis states?
If you can improve my suggested implementations, let me know...
"
"['ibm-q-experience', 'physical-realization', 'quantum-inspire']"," Title: What are examples of quantum computing platforms availble for free (other than IBM Q)?Body: IBM Q is (maybe first) quantum computing platform allowing users to register for free and run algorithm on real quantum processors. There are several processors with usually 5 qubits, however, it is also possible to use processor Melbourne with 15 qubits.
My question: Is there any other platform where it is possible to register for free and run programs on real quantum hardware?
"
"['algorithm', 'optimization', 'vqe', 'qaoa']"," Title: Is there a limit to the size of problems that your simulators can run on Qiskit Aqua?Body: I'm trying to solve QUBO problems using Qiskit QAOA and VQE solvers.
However, I have the experience that I can only solve small problems. I tried with both QAOA and VQE and both experience the same issue. I am wondering if there is a limit to the size of problems that your simulators can run on Qiskit Aqua.
"
"['entanglement', 'measurement', 'error-correction', 'teleportation']"," Title: How does Teleportation based Error Correction (TEC) detect and correct loss/erasure errors?Body: I'm looking at papers like Demonstration of teleportation-based error correction in the IBM quantum computer (page) 10 and Role of syndrome information on a one-way quantum repeater using teleportation-based error correction (pages 3 and 4 and figure 2).
In all these, they mention that a QND measurement enables the detection of error due to loss but I didn't quite understand how it is detected and how it is corrected.
I saw several other papers, that simply say that errors due to loss can be detected using TEC but I don't understand its working.
"
"['quantum-gate', 'algorithm', 'qiskit', 'programming', 'entanglement']"," Title: Angle in qiskitBody: I have been working on Qiskit. Is it possible to display just the angle of each gate in a circuit as an output?
For example, if the below code is my circuit is it possible to just print the angle of the gate. We have function QuantumCircuit.count_ops() to display the gate counts similarly is there a way to do so?
q2 = QuantumRegister(2)
circuit = QuantumCircuit(q2)
circuit.cu1(math.pi/2, q2[0], q2[1])
print(circuit)
"
"['circuit-construction', 'simulation', 'cirq', 'machine-learning', 'models']"," Title: Can We Currently Import Quantum Datasets (Datasets Containing Quantum Data) Onto NISQ-era Quantum Computers?Body: I'm still investigating the TFQ whitepaper.
In one section of the paper, the authors say this with respect to Quantum Datasets
In general, [a quantum dataset] might come from a given black-box source...
However, as current quantum computers cannot import quantum data from external sources,
the user has to specify quantum circuits which generate the data.
Quantum datasets are prepared using unparameterized cirq.Circuit objects and are
injected into the computational graph using tfq.convert_to_tensor
As I would like to investigate datasets like (QM9, QM8, etc.) and was hoping there was a way to involve TFQ/Cirq, this has raised a few questions for me.
Are there current methods for importing datasets containing Quantum Data onto a Quantum Computer? Similarly, is it possible to use TFQ or CIRQ or a similar Quantum-Computing/QML library to explore datasets like this in a way that garners a benefit from the use of Quantum Circuits and other Quantum Computer specific attributes?
"
['ibm-q-experience']," Title: Is there an archive of IBMQ calibration data?Body: Specifically, I'd like to see the ibmq_london calibration file for April 15, 2020.
"
['research']," Title: How to use Tensorflow and Qiskit to make a quantum neural network and recognize handwriting?Body: How to use Tensorflow and Qiskit to make a quantum neural network and recognize handwriting?
"
['adiabatic-model']," Title: Can we speed up the adiabatic process if we split the target hamiltonian in commuting parts?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
Thinking about adiabtic quantum computation, I wonder about the following:
Can we speed up the adiabatic process if we split the target hamiltonian in commuting parts?
Given the standard setup in adiabatic QC to start with a groud state $\ket{\psi_0}$ of a known and easy to prepare system hamiltonian $H_0$, we gradually change the hamiltonian towards a target one $H_1$, where the final ground state $\ket{\psi_1}$ resembles the solution of our problem. So
$$
H(t)= (1-t) H_0 + t H_1.
$$
The critical thing is, to do that in nice and slowly way, such that we don't excite the system too much.
Responsible for the speed is the energy gap between ground and first excited state.
Now we known, that a hamilton can be split into commuting parts, i.e. $H_1=\sum_k H_{1,k}$, with $[H_{1,a},H_{1,b}]_-=0;\forall a,b$.
I assume that we now can evolve the system in parts like:
$$
H(t)= (1-t_n) H_0 + \sum_{k=0}^{n-1} \operatorname{Ramp}(t_k,t_{k+1})H_{1_k},
$$
where $\operatorname{Ramp(t_k,t_{k+1})}$ is a ramp-up function.
Can we minimize the time we need for the total adiabatic process by that approach? Maybe we could ramp up the hamiltonians in an order of decreasing gaps?
"
['quantum-gate']," Title: Are there any single-qubit states $|a\rangle$ and $|b\rangle$ so that applying a CNOT to combined state $|ab\rangle$ changes the control qubit?Body: When a CNOT gate is applied to 2 qubits, one is known as the control qubit while the other is called target qubit.
According to what I understand, if the control qubit is in state $|1\rangle$ then it flips the target qubit otherwise it does nothing.
I want to know whether there is some state of 2 qubits $|a\rangle$ and $|b\rangle$ such that when we apply CNOT on the two of them by which we can flip the control qubit when control qubit is in state $|1\rangle$ and do nothing to the target qubit.
"
"['algorithm', 'ibm-q-experience']"," Title: What is the best IBMQ provider to South America?Body: What is the best option for South America Brazil to configure: provider.get_backend (''), because melbourne_16 is very slow.
"
"['programming', 'entropy', 'qutip']"," Title: Using entropy_mutual function in QuTiPBody: I am trying to calculate mutual entropies using QuTiP, but I am being unsuccessful so far. More specifically, I consider a 2^n x 2^n matrix representing the density operator of a n-qubit bipartite system AB made of system A (first m < n qubits) and B (remaining n-m qubits). No tutorial nor material on the internet addressed this specific task.
For simplicity, let us consider a 1-qubit system A and a 2-qubit system B and a density operator of dimension 8x8 representing AB in computational basis.
More practically in python, let
rhoAB = Qobj=(np.random.rand(8,8)), and assume that this is a valid density operator.
How should I call entropy_mutual so that I can get this measure between A and B, in particular, regarding the arguments selA and selB? Ideally, I would call something like entopy_mutual(rhoAB, selA=[1], selB=[2,3]) but this not the approach how the function interprets the subsystems and their respective dimensions.
"
"['cryptography', 'communication', 'bb84', 'qkd']"," Title: In the BB84 protocol, for what error thresholds can Alice and Bob not establish secure bits?Body: Suppose Alice and Bob can communicate over a quantum channel. The quantum channel is noiseless in the absence of eavesdropping, a condition that cannot be guaranteed. They can also communicate over a classical channel which may be tapped, but not disturbed
To communicate securely Alice and Bob will use the BB84 protocol to establish a secret key. In this protocol (like the version outlined in Figure.12.13 of Nielsen & Chuang) there is a point (following step 6) where Alice and Bob have both obtained $2n$ shared bits. In the next step of the protocol, they will ``sacrifice'' $n$ of their secret bits to check for the presence of an eavesdropper. This check consists of Alice and Bob comparing $n$ of their bits for inconsistencies by publicly declaring them over the classical channel. Define an observable error rate $e$ and an error threshold $e_{thresh}$, so that Alice and Bob abort the protocol if they detect $en$ errors for $e>e_{thresh}$, and proceed otherwise. My question is the following:
What can we say about the value of $e_{thres}$, in particular at what point can Alice and Bob not establish any secure bits?
There are two things that come to mind. First, there is a limit on the number of errors that Alice and Bob can correct. For instance, they could encode their information in an error-correcting code that corrects $t$ errors, and thus if $en>t$ they cannot recover the information. This can also be done classically through the so-called information reconciliation protocol, but I don't understand the limitations of this protocol (so any help on this point would also be appreciated).
Secondly, because the quantum channel is noiseless in the absence of an eavesdropper, we know that the error rate is correlated with the amount of information gained by the eavesdropper. Knowing this relationship would enable us to give an error threshold for arbitrary levels of security (i.e we could pick our threshold to ensure that w.h.p the amount of information possessed by the eavesdropper is less than some constant).
Edit: In fact, because of the noiseless quantum channel we should be perhaps thinking about the following attack, with prob $1-p$ the eavesdropper measures on the right basis and obtains a bit of information, and with prob $p$ they measure in the wrong basis and cause an error. Given an observable error rate, we should be able to deduce an upper bound on the amount of information obtained by the eavesdropper.
"
"['mathematics', 'photonics', 'continuous-variable']"," Title: What is infinite squeezing?Body: I am working my through the Strawberry Fields documentation & the section on state teleportation states:
Here, qumodes $q1$ and $q2$ are initially prepared as (the unphysical) infinitely squeezed vacuum states in momentum and position space respectively,
$\begin{split}&{|0\rangle}_x \sim \lim_{z\rightarrow\infty} S(z){|0\rangle}\\
&{|0\rangle}_p \sim \lim_{z\rightarrow-\infty} S(z){|0\rangle}=\frac{1}{\sqrt{\pi}}\int_{-\infty}^\infty {|x\rangle}~dx\end{split}$
Related: Quantum teleportation over continuous variables?
Additionally, Constructing finite dimensional codes with optical continuous variables mentions "superpositions of an infinite number of infinitely squeezed states" in the introduction.
My primary question is, what is an infinitely squeezed state & how are they used in practice?
Additionally, what is meant by unphysical? Does this mean purely mathematical?
"
['stabilizer-state']," Title: How many N-qubit stabilizer states are there?Body: An N-qubit stabilizer state is a state that can be produced by starting from the $|0\rangle^{\otimes N}$ state and applying only H, CNOT, and S gates. How many N-qubit stabilizer states are there?
Because every stabilizer state can be represented as a graph states, which has an edge (or not) between each pair out of N nodes and also one of 24 possible Clifford operations on each node, there are at most $2^{(N^2)} 24^N$ stabilizer states over $N$ qubits. But a stabilizer state can have multiple graph state representations. What's a corresponding lower bound on the stabilizer state count, and what's the exact count?
"
"['algorithm', 'qiskit', 'vqe']"," Title: How do I get intermediate values of VQE algorithm using callback?Body: I'm new to using Qiskit Aqua, and I'm trying to get the intermediate values in the VQE algorithm to study the convergence. The documentation mentions an internal callback function, but I can't figure out how to use it. Any help is appreciated.
"
"['programming', 'ibm-q-experience', 'matlab']"," Title: Access IBM Q processors from MatLabBody: Qiskit allows a user to directly access IBM Q quantum processors (both real ones and simulator). Each user is given a personal code which is entered into source code and serves as a login to the IBM Q platform.
My question is: Is there a similar possibility in MatLab? In other words, is there any module/code in MatLab allowing to access IBM Q processors?
"
"['measurement', 'pauli-gates']"," Title: Why can I apply $HS^\dagger$ and then measure in the computational basis to measure $Y$?Body: I come from a CS background
I was reading Neven and Farhi's paper (""Classification with Quantum Neural Networks on near Term Processors""), and I am trying to implement the subset parity problem using Qiskit, and solve it using a quantum Neural Network.
There is one thing that doesn't make sense to me though. In the paper, they measure ""the Pauli Y gate on the readout qubit"" (perhaps this phrasing is wrong, as I have to admit that whenever one does not measure in the computational basis, the whole thing doesn't make sense to me anymore). In one of the questions I already asked on this site, I was told that measuring in a basis other than the computational basis is simply the same as applying a matrix to the qubit and then measuring it in a computational basis.
Through various research, I was able to determine that, for this problem ""to measure the Pauli Y gate the readout qubit"", I had to apply $HS^{\dagger}$ and then measure in the computational basis in order to obtain the same result. It works, but I don't understand why it has to be this matrix in particular (is there any mathematical proof that shows that this is indeed this matrix ?)
"
"['qiskit', 'circuit-construction', 'bell-basis']"," Title: Creating Bell States with CNOT conditioned to the control qubit being set to zeroBody: I was using qiskit to generate all of the Bell States. I created the following circuits for each state:
$|\Phi^+\rangle :$
$|\Phi^-\rangle :$
$|\Psi^+\rangle :$
$|\Psi^-\rangle :$
The $|\Psi^\pm\rangle$ states were creating CNOTs with X gates before, that way we have a CNOT that acts when the control qubit is set to zero.
When I execute the first 3 circuits in Qiskit, I get the expected state vectors. However, when I execute the last one, I get $\frac{(-|01\rangle + |10\rangle)}{\sqrt{2} }$. I can see that the state vector is $|\Psi^-\rangle$ up to a global phase factor. My question is: Is this a valid method to create Bell States? Or should I stick to the one that uses "normal" CNOT, X and Z?
"
"['algorithm', 'complexity-theory', 'bernstein-vazirani-algorithm', 'gottesman-knill']"," Title: Speed up in Bernstein-Vazirani algorithm and Gottesman-Knill theoremBody: The Bernstein-Vazirani problem:
Let $f$ be a function from bit strings of length $n$ to a single bit,
$$f: \{ 0, 1\}^n \to \{0, 1\} $$
thus all input bit strings $x \in \{0,1\}^n$. There exists a secret string $s \in \{0,1\}^n$ such that
$$ f(x) = x\cdot s$$
where $\cdot$ denotes the inner product mod 2. Find $s$ by querying $f$ as a few times as possible.
This problem can be solved using 1 query using QFT. The algorithm construction only uses an $X$ gate, Hadamard ($H$) gates, and $CNOT$ gates.
Now, according to the Gottesman-Knill theorem, quantum algorithms which utilise only the
operations belonging to a certain restricted set (Clifford group $C_n$, which is nothing but the normalizer of the Pauli group $P_n$) are efficiently simulable classically.
This implies that the quantum circuit we construct including the oracle can be implemented efficiently classically. So why do we say this problem can be solved exponentially faster with a quantum computer?
I understand that if you want to develop a classical algorithm then you do have to query the oracle $N$ times... but can't we just implement the entire circuit classically in polynomial time based on the Gottesman-Knill theorem.
What am I missing here? Thank you!
"
"['qiskit', 'tomography']"," Title: Tomography library in Qiskit?Body: I am wondering what is the equivalent to the import bellow in the current version of Qiskit?
import qiskit.tools.qcvv.tomography as tomography
"
['grovers-algorithm']," Title: A question about Sysoev's extension of Grover's algorithmBody: An interesting optimization of Grover's quantum algorithm is discussed in Sysoev's paper:
Reference paper
We use the usual notation. $N = 2^n$ , the number of all possible n-bit strings . The oracle $U_\omega$ can be put in the form
$U_\omega=I - 2 (\vert\omega\rangle\langle\omega \vert )$
$U_\omega$ is a reflection of any vector on the hyperplane orthogonal to $\vert\omega\rangle$
The vector $\vert s \rangle $ and operator $U_s$ are introduced.
$\vert s \rangle = H \vert 0 \rangle^n$ , where H is the n-qubit Hadamard transform.
Operator $U_s$ reflects any vector with respect to $\vert s \rangle$
$U_s = 2\vert s \rangle \langle s \vert - I$
The Grover iteration is $U_{Grover} = U_s U_\omega$
$U_{Grover}$ rotates (at every iteration) the initial vector $\vert s \rangle$ towards the desired vector $\vert\omega\rangle$ by the angle $2\theta$, where $sin\theta = \frac{1}{\sqrt{N}}$
We note that a reflection is expressed by a unitary matrix, so if we know the algebraic form of a vector $\vert\zeta\rangle$ then we can physically construct the quantum circuit that implements the operator $U_\zeta$ which reflects any vector with respect to $\vert\zeta\rangle$ .
We consider then the following modified Grover algorithm, following Sysoev, but not exactly.
Step 1
$\vert \zeta_1 \rangle = U_s U_\omega \vert s \rangle$
Use the constructed quantum circuit implementing the operator:
$U_{\zeta_1} = 2\vert\zeta_1\rangle\langle\zeta_1\vert - I$
Step 2
$\vert \zeta_2 \rangle = U_{\zeta_1} U_\omega \vert {\zeta_1} \rangle$
Use the constructed quantum circuit implementing the operator:
$U_{\zeta_2} = 2\vert\zeta_2\rangle\langle\zeta_2\vert - I$
Step 3
$\vert \zeta_3 \rangle = U_{\zeta_2} U_\omega \vert {\zeta_2} \rangle$
Use the constructed quantum circuit implementing the operator
$U_{\zeta_3} = 2\vert\zeta_3\rangle\langle\zeta_3\vert - I$
................................and so on..........
Step $[log_2 N] $(approximately in a neighborhood of n where we stop, see note below).
$\vert \zeta_n \rangle = U_{\zeta_{n-1}} U_\omega \vert \zeta_{n-1} \rangle$
Measurement and stop.
So at each step, the current vector is reflected on the hyperplane orthogonal to $\vert\omega\rangle$ and then we further reflect this reflection with respect to the current vector itself.
The algorithm rotates the initial vector $\vert s \rangle$ towards the solution following the sequence:
$\theta , 3\theta, 9\theta , .......3^k \theta$ .....
The optimal stopping time will be in a neighborhood of $[log_2 N]$ steps, so after about n steps. The exact number can be calculated. So we can run the algorithm several times, each time stopping at random after a number of steps in a neighborhood of $[log_2 N]$. The probability of getting very close to the target vector $\vert\omega\rangle$ becomes sufficiently high.
Note that Sysoev wants to construct a universal quantum circuit that would also take as input the vector determining the reflection axis. I don't know if such a quantum circuit can be constructed, it might be impossible. But we can construct in advance all the quantum circuits implementing the operators $U_{\zeta_k}$ for $k \in \{1, 2, 3, ...., [log_2 N]\}$ and run the quantum algorithm. If we construct these quantum circuits for N sufficiently large (for a large number n of qubits), then most of the NP complete problems of interest can be solved efficiently, basically in linear time. We could also consider other sequences of reflections and axes of reflection, a lot depends on the arithmetic modulo $[\sqrt N]$ for a chosen N.
Question. Assuming that eventuality quantum circuits with a large number of qubits will become reliable and feasible, are there any major flaws in my reasoning, in principle?
In his original paper Grover gives a proof of optimality of his algorithm, but certain assumptions in his proof of optimality are not satisfied by the algorithm described here. So the question is, could this exponential speedup of Grover's algorithm be possible in principle?
Edit 1 We consider the operator U defined by the relation:
$U(\vert x \rangle , \vert y \rangle ) = ( \vert x \rangle , U_x \vert y \rangle) $ , where $U_x \vert y \rangle$ represents the reflection of $\vert y \rangle$ with respect to $\vert x \rangle$
We have then the relations:
$U(\vert s \rangle , U_\omega\vert s \rangle ) = (\vert s \rangle , U_sU_\omega \vert s \rangle) = (\vert s \rangle , \vert \zeta_1 \rangle )$
$U(\vert \zeta_1 \rangle , U_\omega\vert \zeta_1 \rangle ) = (\vert \zeta_1 \rangle , U_{\zeta_1}U_\omega \vert \zeta_1 \rangle) = (\vert \zeta_1 \rangle , \vert \zeta_2 \rangle )$
$U(\vert \zeta_2 \rangle , U_\omega\vert \zeta_2 \rangle ) = (\vert \zeta_2 \rangle , U_{\zeta_2}U_\omega \vert \zeta_2 \rangle) = (\vert \zeta_2 \rangle , \vert \zeta_3 \rangle )$
.......................and so on..........................
$U(\vert \zeta_{n-1} \rangle , U_\omega\vert \zeta_{n-1} \rangle ) = (\vert \zeta_{n-1} \rangle , U_{\zeta_{n-1}}U_\omega \vert \zeta_{n-1} \rangle) = (\vert \zeta_{n-1} \rangle , \vert \zeta_n \rangle )$
That means that we only have to design one quantum circuit, associated to the operator U. Note that this Grover-Sysoev iteration (as I would call it) is a bit more complicated than the original Grover iteration, but in principle possible to implement. Well, we have to be careful so that this type of iteration doesn't enter into conflict with the no - cloning theorem.
Another possibility is the following (state $\vert s \rangle$ is known):
$U(\vert s \rangle , U_\omega\vert s \rangle ) = (\vert s \rangle , U_sU_\omega \vert s \rangle) = (\vert s \rangle , \vert \xi_1 \rangle )$
$U(\vert \xi_1 \rangle , U_\omega\vert s \rangle ) = (\vert \xi_1 \rangle , U_{\xi_1}U_\omega \vert s \rangle) = (\vert \xi_1 \rangle , \vert \xi_2 \rangle )$
$U(\vert \xi_2 \rangle , U_\omega\vert s \rangle ) = (\vert \xi_2 \rangle , U_{\xi_2}U_\omega \vert s \rangle) = (\vert \xi_2 \rangle , \vert \xi_3 \rangle )$
.......................and so on..........................
$U(\vert \xi_{n-1} \rangle , U_\omega\vert s \rangle ) = (\vert \xi_{n-1} \rangle , U_{\xi_{n-1}}U_\omega \vert s \rangle) = (\vert \xi_{n-1} \rangle , \vert \xi_n \rangle )$
In other words, the vector to be reflected is fixed but the reflection axis is variable (in the original Grover algorithm it's the other way around ).
Anyway, my impression is that the implementation of a quantum algorithm with an exponential speedup (compared to Grover's algorithm ) is possible. That's what this question is all about.
Edit 2. Unfortunately nothing from what I tried seems to work. You need a quantum circuit that takes as input the vector to be reflected and the vector that represents the reflection axis. The output of the quantum circuit must contain the reflected vector. That does not seem possible, as far as I understand. This reflection implementation problem, if ever solved, would lead to an exponential speedup of Grover's algorithm.
"
"['d-wave', 'quantum-advantage']"," Title: Is there quantum advantage to be had with a D-Wave computer in 2020?Body: I've seen a lot of excitement in the popular press about the computers made by D-Wave Systems, but when I dig deep the only practical things that I can figure out that one can do with the computer are variations of:
- Train one's staff in the use of quantum computers.
- Write papers about what you can do with a quantum computer.
- Explore quantum algorithms.
That is, these aren't even research machines---they are exploratory machines for what kind of research we would do if we had larger machines.
Am I mistaken? Is there any ""quantum advantage"" to be had from these machines---that is, a computation that can be done more cost effectively than with conventional computers?
"
"['quantum-state', 'density-matrix']"," Title: Is my $|0\rangle$ state mixed or pure?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$Given a mixed state $\rho = \sum p_k \rho_k$ that is an statistical emsemble, where each ""state"" $\rho_k$ on the upper half of the Bloch sphere
$\hskip3in$
appears with equal probability. The states don't lie on the surface of the Bloch sphere but at a radius of $1/{2\pi}$, such that the sum, which, in the continous case turns out to be an integral, properly works out. So the $\rho_k$ are not pure states!
If I now measure the system in the computational basis, I'll get $\ket0$ in 100% of the cases. So I would assume the state is a pure one, but is it?
We might need infinitely many states $\rho_k$, but maybe a big number is enough to get a good aprroximation.
Or did I miss something else?
"
"['quantum-gate', 'universal-gates', 'continuous-variable']"," Title: What is the explicit action of the non-linear gate in CV quantum computing on the quadratures?Body: In this excellently answered question 'How are gates implemented in a continuous-variable quantum computer?' the typical gates for CV quantum computing were listed and described. In particular for almost all the gates there is a description of their resulting effects on the quadrature position ($X$) and momentum ($P$).
The exception is with the action of the Kerr hamiltonian (whose action is also not described explicitely on the quadratures in the original paper by Lloyd either). There is likely a reason for this but all the same my question is:
What is the action of the Kerr hamiltonian, or a non linear equivalent like the cubic gate, on the quadratures (in the sense that the translation with P sends $x$ to $x+t$ or the squeeze gate $x$ to $xe^t$ etc)?
"
"['quantum-state', 'qiskit']"," Title: How to create a qubit in arbitrary state in qiskitBody: A QuantumCircuit() command creates a qubit with zero state always.
I've seen some instructions about using Arbitrary Initialization but it is not accessible and returns 404 error.
"
"['qiskit', 'quantum-operation', 'tomography', 'quantum-process-tomography']"," Title: What is the relationship between Choi and Chi matrix in Qiskit?Body: I'm struggling with the framework for quantum process tomography on Qiskit.
The final step of such a framework is running fit method of ProcessTomographyFitter class. Documentation states that such function gives a Choi matrix as output. Nevertheless, I'd want the Chi matrix to define the superoperator of a circuit. Specifically, I'm interested in understanding how a 2-qubit circuit affects a single qubit.
Thus, my questions are:
- What is the relationship between Choi and Chi matrix?
- When do they coincide?
- How to obtain Chi from Choi matrix?
"
['mathematics']," Title: Projection is trace-decreasing?Body: I'm studying Mark Wilde's ""Quantum Information Theory"" and the author sometimes use the inequality $\mathrm{Tr}(\prod_\mathcal{H'}Y) \leq \mathrm{Tr}(Y)$ where $Y\in \mathcal{H}'$ is a density matrix and $\prod_\mathcal{H'}=V^{\dagger}V$ with isometry $V: \mathcal{H} \rightarrow \mathcal{H}'$. As far as I know, this inequality does not hold for general matrix $Y$. So I tried to prove the inequality using the positive semi-definite condition of $Y$, but I cannot grasp any clue. Does the inequality really holds? And if it does, how can I prove it? I appreciate any help.
"
"['algorithm', 'games']"," Title: MS Quantum Katas - Measurements Task 2.3 - problems in understanding the solutionBody: I am referring to the MS Quantum Katas, Measurements, 2.3 Peres/Wooters game
I have big problems to understand the solution.
The task is defined as:
--begin
Input: A qubit which is guaranteed to be in one of the three states:
- $|A\rangle = \frac{1}{\sqrt{2}} \big( |0\rangle + |1\rangle \big)$,
- $|B\rangle = \frac{1}{\sqrt{2}} \big( |0\rangle + \omega |1\rangle \big)$,
- $|C\rangle = \frac{1}{\sqrt{2}} \big( |0\rangle + \omega^2 |1\rangle \big)$,
Here $\omega = e^{2i \pi/ 3}$.
Output:
- 1 or 2 if the qubit was in the $|A\rangle$ state,
- 0 or 2 if the qubit was in the $|B\rangle$ state,
- 0 or 1 if the qubit was in the $|C\rangle$ state.
You are never allowed to give an incorrect answer. Your solution will be called multiple times, with one of the states picked with equal probability every time.
The state of the qubit at the end of the operation does not matter.
--end
The solution is described as:
Solution
The task is a simple game inspired by a quantum detection problem due to Holevo[1] and Peres/Wootters[2]. In the game, a player A thinks of a number (0,1 or 2) and the opponent, player B, tries to guess any number but the one chosen by player A.
Classically, if you just made a guess, you'd have to ask two questions to be right $100\%$ of the time. If instead, player A prepares a qubit with 0, 1, or 2 encoded into three single qubit states that are at an angle of 120 degrees with respect to each other and then hands the state to the opponent, then player B can apply a Positive Operator Valued Measure (POVM) consisting of 3 states that are perpendicular to the states chosen by player A.
It can be shown that this allows B to be right $100\%$ of the time with only 1 measurement, which is something that is not achievable with a von Neumann measurement on 1 qubit.
See also Peres[3, chapter 9.6] for a nice description of the optimal POVM.
Next, we address how we can implement the mentioned POVM by way of a von Neumann measurement, and then how to implement said von Neumann measurement in Q#. First, we note that the POVM elements are given by the columns of the following matrix:
$$M = \frac{1}{\sqrt{2}}\left(\begin{array}{rrr}
1 & 1 & 1 \\
1 & \omega & \omega^2
\end{array}
\right)$$
where $\omega = e^{2 \pi i/3}$ denotes a primitive $3$rd root of unity. Our task will be to implement the rank 1 POVM given by the columns of $M$ via a von Neumann measurement. This can be done by ""embedding"" $M$ into a larger unitary matrix (taking complex conjugates and transposed):
$$M' = \frac{1}{\sqrt{2}}\left(\begin{array}{cccc}
1 & -1 & 1 & 0 \\
1 & -\omega^2 & \omega & 0 \\
1 & -\omega & \omega^2 & 0 \\
0 & 0 & 0 & -i
\end{array}
\right)$$
Notice that applying $M'$ to input states given by column $i$ of $M$ (padded with two zeros to make it a vector of length $4$), where $i=0, 1, 2$ will never return the label $i$ as the corresponding vectors are perpendicular.
We are therefore left with the problem of implementing $M'$ as a sequence of elementary quantum gates. Notice that
$$M' \cdot {\rm diag}(1,-1,1,-1) = M' \cdot (\mathbf{1}_2 \otimes Z) =
\frac{1}{\sqrt{2}}\left(\begin{array}{cccc}
1 & 1 & 1 & 0 \\
1 & \omega^2 & \omega & 0 \\
1 & \omega & \omega^2 & 0 \\
0 & 0 & 0 & i
\end{array}
\right)$$
...
--end
I have several questions / problems here.
- What exactly is a ""von-Neumann"" measurement? Is it just a measurement in the standard basis?
- I understand how to get M:
A POVM M with ${E_0, E_1, E_2}, E_k = |\psi_k\rangle\langle\psi_k|, |\psi_k\rangle=1/sqrt(2)(|0\rangle+\omega^k|1\rangle)$ results in $M=(\psi_0 \psi_1 \psi_2) = \frac{1}{\sqrt{2}}\left(\begin{array}{rrr} 1 & 1 & 1 \\ 1 & \omega & \omega^2 \end{array}\right)$
Next step is
Our task will be to implement the rank 1 POVM given by the columns of M via a von Neumann measurement. This can be done by ""embedding"" M into a larger unitary matrix (taking complex conjugates and transposed)
What does this embedding mean exactly, what is the math behind?
I only found one article about ""Emdedded Transforms"" (https://books.google.de/books?id=pefvCAAAQBAJ&pg=PA104&lpg=PA104&dq=embedding+matrix+into+larger+unitary+matrix&source=bl&ots=2apFdXFYNd&sig=ACfU3U3JCtj7GgJimx5cgCcKE_FrMUx_4Q&hl=de&sa=X&ved=2ahUKEwjo-K3EipHpAhW8UxUIHVuyDtYQ6AEwCXoECAgQAQ#v=onepage&q=embedding%20matrix%20into%20larger%20unitary%20matrix&f=false), but this is valid only for square matrices.
- The next step in the solution is:
Notice that applying $M'$ to input states given by column $i$ of $M$ (padded with two zeros to make it a vector of length $4$), where $i=0, 1, 2$ will never return the label $i$ as the corresponding vectors are perpendicular.
We are therefore left with the problem of implementing $M'$ as a sequence of elementary quantum gates.
What does this mean? I don't understand the sense of this.
Thanks in advance,
Markus
"
"['algorithm', 'games', 'contextuality', 'peres-mermin-square']"," Title: Problems in understanding the solution for ""Mermin–Peres Magic Square Game""Body: I am referring to the article Advanced Topics in Quantum Information Theory exercise 4 and to the MS Quantum Kata MS-Quantum-Kata which describes a solution for the Mermin–Peres Magic Square Game.
I could follow the article and do all the maths for myself until the end of the article.
Unfortunately the article ends with
... Following the hint, we consider two maximally entangled states shared between Alice and Bob:$$|Ψ〉_{AB}=1/√2(|00〉_{A_1B_1}+|11〉_{A_1B_1})⊗1/√2(|00〉_{A_2B_2}+|11〉_{A_2B_2})$$
It is then easy to check by using $$1/√2(|00〉+|11〉) =1/√2(|\phi^x_0\phi^x_0〉+|\phi^x_1\phi^x_1〉) =1/√2(|\phi^y_0\phi^y_1〉+|\phi^y_1\phi^y_0〉)$$ where $|0,1〉$ are the eigenvectors of $σ_z$ and where $|φ^{x,y}_j〉$ denote the eigenvectors of $σ_x$ and $σ_y$ as in the solution to the last exercise (with eigenvalues ±1 each), that the compatibility condition is indeed satisfied.
Unfortunately for me it is not easy to check, I spent multiple nights to try this, but I don't get it done.
- Can anyone show me how this check looks like? What is the math behind it?
- The algorithm states that Alice (and Bob) are performing multiple measurements on their qubits for all observables $M_{x,y}$ in her row (in his column).
I don't understand why this makes sense: After the first measurement the quantum state has collapsed (or could have at least), why does it make sense to do additional measurements?
I know there is something called "phase kick-back" that kicks the phase into the control bit if I use "Controlled Operations", is that something that is used here? How exactly?
- Is "Phase Kickback" only a mathematical trick or do physical systems really behave like this? Is there an easy to understand sample maybe, for a non-physic, non-mathematic guy (just a software dev)?
Thanks a lot for any help or hints.
"
['quantum-operation']," Title: When can a non-completely-positive evolution of a state be physical?Body: Definitions: a map $\Phi$ is called positive if $\Phi(\rho)$ is positive semidefinite for any positive semidefinite $\rho$, and completely positive (CP) if $\Phi \otimes \mathrm{Id}$ is a positive map with $\mathrm{Id}$ standing for an identity channel of arbitrary dimension.
It is well-known that a quantum channel needs to be a CP map in order to represent the physical evolution of a quantum system. However, I sometimes see mentions in the literature of a positive but not completely positive evolution of a system (and sometimes even beyond positive maps), in particular in the context of reduced dynamics of open quantum systems, e.g. [1], [2].
I am not too familiar with open quantum systems literature, but I would like to get some intuition for situations in which the physical evolution of a system might be expressed by a non-CP map. What classes of maps are used in such settings, and how is it all justified without ""breaking physics""? Beyond the example of open quantum systems, does it make sense in any other context to allow a state to evolve under a non-CP map?
"
"['algorithm', 'machine-learning', 'nisq']"," Title: Will NISQ based algorithms be useful in fault-tolerant Quantum computers?Body: As a data scientist, I want to use the cutting edge algorithms of machine learning to build my models, I am interested in quantum machine learning, the recent research in QML is about variational algorithms and other algorithms for NISQ machines, my question is, will these algorithms work in fault-tolerant quantum computers or we must design new algorithms such as Shor, Groover and HHL algorithms?
"
"['nielsen-and-chuang', 'shors-algorithm', 'phase-estimation', 'modular-exponentiation']"," Title: Quantum Phase Estimation Circuit and Modular ExponentiatonBody: In Nielsen and Chuang, it is stated that the effect of phase estimation circuit is mapping state $|j\rangle |u\rangle$ to $|j\rangle U^j |u\rangle$.
Here is my solution:
Consider the first $CU^{2^0}$. Let $|j\rangle = |j_1j_2\dots j_t\rangle$. It maps the state $|j\rangle |u\rangle$ to state $|j\rangle U^{j_t2^0}|u\rangle$.If $j_t=0$, then nothing happens. Otherwise, $U^{2^0}$ is applied.
Continuing like this I get the following quantum state:
$|j\rangle U^{j_12^{t-1}} \cdots U^{j_t2^0}|u\rangle$
Then it should be true that $U^{j_12^{t-1}} \cdots U^{j_t2^0} = U^j$ but I cannot see how this follows. I am studying order finding algorithm and modular exponentiation part heavily depends on this observation. Can someone help?
"
"['quantum-state', 'entanglement', 'density-matrix', 'quantum-operation']"," Title: $M(\rho)=\operatorname{Tr}_2[U(\rho\otimes\rho_2)U^{\dagger}]$ is unitary $\iff U=U_1\otimes U_2$, a product of $2$ unitary operators?Body: Let $\rho : V_1 \to V_1 $ and $\rho_2 : V_2 \to V_2 $, where $V_1$ and $V_2$ are Hilbert spaces.
Suppose that $U:V_1\otimes V_2 \to V_1\otimes V_2$ is a unitary operator.
Define a map $M : L(V_1, V_1) \to L(V_1, V_1)$ as
\begin{align*}
M(\rho) := \operatorname{Tr}_2 \left(\ U\ \rho\otimes\rho_2 \ U^{\dagger}\ \right)
\end{align*} where $\rho_2 \in L(V_2, V_2)$ is a fixed density operator, and $\operatorname{Tr}_2$ is the partial trace of vector space $V_2$.
Then, trivially $M$ is a unitary operator, if $U = U_1 \otimes U_2$ for some unitary operators $U_1 \in L(V_1,V_1)$ and $U_2 \in L(V_2,V_2)$.
Is the converse also true?
If $U$ cannot be expressed as a tensor product of $2$ unitary operators, then is $M$ non-unitary ?
I am lost how to prove this statement. Any hints or references are appreciated.
"
"['mathematics', 'cryptography']"," Title: Is Quantum Computing a problem for Cryptography?Body: How can we use Quantum Computing to break a Cryptosystem like RSA or AES-256?
Can we use Quantum Computing to solve difficult mathematical problems like Discrete Logarithms or Prime Number Factorization?
"
"['programming', 'mathematics', 'grovers-algorithm']"," Title: How to correctly define $U_\omega$ for Grover's search algorithmBody: I am working on Grover's algorithm and I am trying to implement the algorithm. I am following the Microsoft quantum katas and I finished and did everything correctly. I am trying to implement the algorithm for a specific case, but I am stuck writing the marking oracle (defined as $U_\omega$ on the Wikipedia page). I tried to look into the kata tests but I wasn't very successful.
The goal of the operator is to flip the sign of a state if it is correct. The mathematical representation for this is : $$|x\rangle \, \overset{U_\omega} \longrightarrow \, (-1)^{f(x)}|x\rangle$$This is the problem, I do not know how to implement this sign flipping. Is it done case by case ? Or is the a general ""formula"" to do so ?
Thanks for reading.
"
['phase-estimation']," Title: Quantum Phase Estimation on a superposed stateBody: Is it possible, using the QPE algorithm, to map the state $\sum_j\alpha_j\,\left|v_j\right\rangle\,|0\rangle^{\otimes n}$ to the state $\sum_j\alpha_j\,\left|v_j\right\rangle\,\left|\theta_j\right\rangle$? I understand how it is done, and why does it work when applying the QPE algorithm to an eigenvector $|v_i\rangle$. But there is this measurement after the inverse QFT, which will just outputs the state $\sum_j\alpha_j\,\left|v_j\right\rangle\,\left|\theta_k\right\rangle$ with probability $\left\|\alpha_k\right\|^2$.
I don't think it is possible to get such an entangled state after the measurement of a quantum register. Still, there are algorithms which use the QPE to get this entangled state, and which even uncomputes the second register once they're done with. What am I missing?
The algorithm I want to implement is designed as follows:
First, we have a quantum state $|\psi\rangle=\sum_j\alpha_j\,\left|v_j\right\rangle$. Then, we apply the QPE with a certain unitary whose eigenvectors are the $\left|v_i\right\rangle$ (this is not true in practice, there's an intermediary step but this does not matter here). Hence, we are left with the state $\sum_j\alpha_j\,\left|v_j\right\rangle\,\left|\theta_j\right\rangle$. We consider a gate $\mathbf{T}_\theta$ such that $\mathbf{T}_\theta\,\left|\theta_j\right\rangle\,|0\rangle = \left|\theta_j\right\rangle\,|1\rangle$ is $\theta_j < \theta$ and $\left|\theta_j\right\rangle\,|0\rangle$ if $\theta_j\geqslant\theta$. We apply this gate on the second register and are left with the state:
$$\sum_{j\in\mathcal{S}}\alpha_j\,\left|v_j\right\rangle\,\left|\theta_j\right\rangle\,|0\rangle + \sum_{j\in\overline{\mathcal{S}}}\alpha_j\,\left|v_j\right\rangle\,\left|\theta_j\right\rangle\,|1\rangle$$
where $\mathcal{S}$ represents the set of indexes $j$ such that $\theta_j\geqslant\theta$. We finally uncompute the QPE to get the state:
$$\sum_{j\in\mathcal{S}}\alpha_j\,\left|v_j\right\rangle\,|0\rangle + \sum_{j\in\overline{\mathcal{S}}}\alpha_j\,\left|v_j\right\rangle\,|1\rangle$$
and we measure the second register. This works well if all $\theta_j$ can be represented exactaly on $n$ qubits. Now, let us assume this is not the case. We denote $2^n\,\theta_j=\overline{\theta_j} + 2^n\,\delta_j$. After applying the QPE, we are left with the state:
$$\frac{1}{2^n}\,\sum_j\alpha_j\,\left|v_j\right\rangle\,\sum_{x=0}^{2^n-1}\sum_{k=0}^{2^n-1}\mathrm{e}^{-\frac{2\,\mathrm{i}\,\pi\,k}{2^n}\,\left(x-2^n\,\theta_j\right)}\,|x\rangle$$
which we can rewrite as:
$$\frac{1}{2^n}\,\sum_j\alpha_j\,\left|v_j\right\rangle\,\sum_{x=0}^{2^n-1}\sum_{k=0}^{2^n-1}\mathrm{e}^{-\frac{2\,\mathrm{i}\,\pi\,k}{2^n}\,\left(x-\overline{\theta_j}\right)}\,\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,|x\rangle$$
which we can also rewrite as:
$$\frac{1}{2^n}\,\sum_j\alpha_j\,\left|v_j\right\rangle\,\left(\sum_{k=0}^{2^n-1}\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,\left|\overline{\theta_j}\right\rangle+\sum_{\substack{x=0\\x\neq\overline{\theta_j}}}^{2^n-1}\sum_{k=0}^{2^n-1}\mathrm{e}^{-\frac{2\,\mathrm{i}\,\pi\,k}{2^n}\,\left(x-\overline{\theta_j}\right)}\,\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,|x\rangle\right)\,.$$
We now apply $\mathbf{T}_\theta$:
$$\frac{1}{2^n}\,\left[\sum_{j\in\mathcal{S}}\alpha_j\,\left|v_j\right\rangle\sum_{k=0}^{2^n-1}\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,\left|\overline{\theta_j}\right\rangle\,|0\rangle+\sum_{j\in\overline{\mathcal{S}}}\alpha_j\,\left|v_j\right\rangle\sum_{k=0}^{2^n-1}\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,\left|\overline{\theta_j}\right\rangle\,|1\rangle+\underbrace{\sum_j\left(\sum_{\substack{x=0\\x\neq\overline{\theta_j}}}^{\theta-1}\sum_{k=0}^{2^n-1}\mathrm{e}^{-\frac{2\,\mathrm{i}\,\pi\,k}{2^n}\,\left(x-\overline{\theta_j}\right)}\,\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,|x\rangle\,|1\rangle+\sum_{\substack{x=\theta\\x\neq\overline{\theta_j}}}^{2^n-1}\sum_{k=0}^{2^n-1}\mathrm{e}^{-\frac{2\,\mathrm{i}\,\pi\,k}{2^n}\,\left(x-\overline{\theta_j}\right)}\,\mathrm{e}^{2\,\mathrm{i}\,\pi\,k\,\delta_j}\,|x\rangle\,|0\rangle\right)}_{\text{Noise}}\right]\,.$$
The problem now is that I don't see how the uncomputation of the QPE will affect this state. My guess is that if I assume that the amplitude of the noise is low, then I can just ignore it, and this will not affect my results. But how can I prove it? How can I quantitize this error?
"
"['mathematics', 'trace-distance', 'information-theory']"," Title: Prove that for one-qubit unitaries $\text{Tr}|U-V|=2\max_\psi\|(U-V)|\psi\rangle\|$Body: Given two 1-qubit rotations $U=R_n (\theta)$ and $V=R_m(\phi)$ with $n$ and $m$ vectors defining a rotation and $\theta, \phi$ angles, define $D(U,V)=Tr(|U-V|)$ where $|U-V|=\sqrt{(U-V)^\dagger (U-V)}$ and $E(U,V)=max_{|\psi \rangle} ||(U-V)|\psi \rangle ||$ where $|| |\psi\rangle ||$ is the vector norm.
Im trying to prove that $D(U,V)=2E(U,V)$, which can be seen from taking $n$ and $m$ as the same vector.
I also tried considering the case $U=R_z(\theta)$ and taking $m=\cos(\alpha)Z + \sin(\alpha)X$ but in this case I couldn't prove the result as I get a too complicated expression for the trace distance. Any help for proving this?
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: How does entangle qubits pass single qubit gate?Body: How does entangle qubits pass single qubit gate?
For example, I initialize two qubits $|0\rangle\otimes|0\rangle$, then first qubit passes $H$ gate to make it an superposition state $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$ and then applied CNOT gate. The state finally become $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$
Then I put the first qubit into $X$ gate. What will happen? It will become $\frac{1}{\sqrt{2}}(|10\rangle+|01\rangle)$? If so, how could it is possible the entangled two quibits pass the single-qubit-gate? If not, what will happen in this situation?
"
"['quantum-state', 'entanglement']"," Title: A question about how to store the quantum state in quantum circuitBody: Now I have five qubits quantum circuit like:
and as the circuit, first q[0], q[2] and q[3] pass the X gate, and then is that means they store in QRAM as a whole by the following quantum circuit?
If so, in the next step, how could it possible to take q[3] and q[4] out from the ""whole $| \text{out} \rangle$""?or actually, every time it takes the ""whole $| \text{out} \rangle$"" to the new step?
"
"['matrix-representation', 'unitarity']"," Title: Find the decomposition of the following matrix into two level unitary matricesBody: Find the decomposition of the following matrix into two level unitary matrices:
$$
\frac{1}{2}
\begin{pmatrix}
1 & 1 & 1 & 1\\
1 & i & -1 & -i\\
1 & -1 & 1 & -1\\
1 & -i & -1 & i\\
\end{pmatrix}
$$
"
"['quantum-gate', 'ibm-q-experience']"," Title: Quantum gates execution times on IBM Q MelbourneBody: I am interested in the execution time of quantum gates on IBM's $15$-qubits Melbourne computer. Is there any information regarding this?
After searching for a while I have only managed to find the times of the CNOT gates here, but unfortunately, no information for other quantum operations. I am specifically interested in the Hadamard gate .h() and the phase and rotation gates .rz() and .u3(), as well as the simple inverter .x(). I know these gates are not elementary (i.e they are composite gates) but still, any information regarding their respective execution times would be greatly appreciated!
"
"['quantum-state', 'entanglement', 'measurement']"," Title: What is the best strategy to get an upper bound to measure $|00\cdots 0\rangle$?Body: You are given a quantum state$\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$ $\ket\psi$ with $2n$ qubits and the possibility to recreate the state $m$ times, but only one at a time. Further $m$ grows polynomial with $n$, i.e. $m=O(poly(n))$. Your task is to determine the probability (or even harder the coefficient) of $\ket{00\cdots0}$ in $\ket\psi$, so you start to measure.
Since you don't have enough (exponentially many) copies to fully characterize $\ket\psi$, what is the best strategy to at least get an upper bound on the probability to measure $\ket{00\cdots 0}$?
Is brute force measuring the best or could entanglement help?
EDIT:
Ok, so what one can do is to measure all qubits and collapse the state to $\ket{ m_0m_1\cdots m_{2n-1}}$, where $m_k$ is the measured $k$-th qubit $\in \{\ket0,\ket1\}$. And then I count ($\#C_{\ket{00\cdots 0}}$) how many $\ket{00\cdots 0}$ I had and divide by $m$. This gives at least the probability $\displaystyle p_{\ket{00\cdots 0}}=\frac{\#C_{\ket{00\cdots 0}}}{m}$.
But doesn't measuring any $\ket0$ at any qubit $k$ (I assume that qubits are measured one by one) and statistics on that affect my overall $p_{\ket{00\cdots 0}}$?
EDIT
I thought of some statistical thing like Bayesian Inference, testing of hypothesis,.... Can these methods be applied?
E.g. if I only look at the first measured qubit. If I measure a $\ket0$, the worst (for my prediction) that can happen is that the other two remaining qubits are in a equal superposition, so the best guess I can make is $\#C_{\ket{0}}/4m$...
"
"['quantum-gate', 'entanglement', 'physical-realization', 'superconducting-quantum-computing']"," Title: Long range two qubit gates in superconducting qubitsBody: In superconducting qubits, all the method that I have seen until now are based on short range interaction.
For example you have two qubits to process information around a middle qubit that is actually a coupler. By tuning its frequency you can make the two other qubit fictively interact.
My question is: Is there at least one method of performing two qubit gates in superconducting qubit that allows for long range interaction, i.e two qubit that are far on the computer can interact. Even a gate with very bad fidelity. Or nothing has been found for now on?
"
"['qiskit', 'nielsen-and-chuang', 'deutsch-jozsa-algorithm']"," Title: Deutsch's algorithm in QiskitBody: I am trying to understand and implement the Deutsch algorithm. I follow the logic from Nielsen book and I started to implement it in Qiskit.
For implementing the oracle, I use a CNOT gate and now I have this circuit:
Every time I ran it, the first qubit is always in state $|1\rangle$.
I am not sure if this is what I expect. Shouldn't it be sometimes $|1\rangle$ and sometimes $|0\rangle$?
"
"['algorithm', 'grovers-algorithm', 'complexity-theory']"," Title: How to find a marked item out of $K < N$ marked items when K is unknown?Body: I'm wondering about time complexities of variants of the searching problem in Grover's Algorithm. I know that using G.A. the time complexity required to find a market item reduces to $O(\sqrt N)$.
How about the following scenario:
You are given access to an oracle with $K$ marked items, and $K$ is unknown. What would be a lower bound for finding a marked item using $O(\sqrt {N/K})$, with probability more than $\frac{1}{2}$?
If so, is there an algorithm to show it?
"
"['measurement', 'density-matrix', 'entropy', 'projection-operator']"," Title: Increasing the von Neumann entropy despite the measurement?Body: Background
Assume we have a density matrix $\rho$ of a sub-ensemble. However, we have an imperfect measuring instrument. While it does perform a measurement, we do not know exactly when it performs the measurement. If we want to perform the measurement at $t= 0$. Then, the measuring instrument performs the measurement in the time interval $(- \epsilon, \epsilon)$. The probability of it happening within this interval at time $t$ is given by $p(t) \delta t$. Obviously, $ \int_{- \epsilon}^\epsilon p(t) d t = 1$. The density operator post measurement at time $t$ is given by:
$$\rho_{M} = \Big ( \frac{P_i U ( t) \tilde \rho U^\dagger ( t) P_i}{\text{Tr} P_i U ( t) \tilde \rho U^\dagger ( t) } \Big )$$
With being the $P_i$ is an arbitrary projection operator $\tilde \rho$ being the density matrix at time $0$ (assuming no measurement) and $U$ being the unitary operator. The resultant density matrix when the non-ideal measurement device is included is given by at time $\epsilon$ is $\rho(\epsilon)$ is given by:
\begin{equation}
\rho (\epsilon) = p( - \epsilon + \delta t) U(2 \epsilon - \delta t ) \Big ( \frac{ P_i U (-\epsilon + \delta t) \tilde \rho U^\dagger (-\epsilon + \delta t) P_i }{\text{Tr} (P_i U (-\epsilon + \delta t) \tilde \rho U^\dagger (-\epsilon + \delta t) )} \Big) U^\dagger (2 \epsilon - \delta t ) \delta t
\end{equation}
$$+ $$
$$p( - \epsilon + 2 \delta t) U(2 \epsilon - 2\delta t ) \Big ( \frac{ P_i U (-\epsilon + 2\delta t) \tilde \rho U^\dagger (-\epsilon + 2\delta t) P_i }{\text{Tr} P_i U (-\epsilon + 2\delta t) \tilde \rho U^\dagger (-\epsilon + 2\delta t) } \Big)U^\dagger (2 \epsilon - 2\delta t ) \delta t $$
$$+ $$
$$ \vdots$$
$$ + $$
\begin{equation}
p( \epsilon - \delta t) U(\delta t ) \Big ( \frac{P_i U (\epsilon - \delta t) \rho ' U^\dagger (\epsilon - \delta t) P_i}{\text{Tr} P_i U (\epsilon - \delta t) \rho ' U^\dagger (\epsilon - \delta t)} \Big) U^\dagger ( \delta t ) \delta t
\end{equation}
Now, in the limit $\delta t \to 0$ we get an integral:
\begin{equation}
\implies \rho(\epsilon) = \int_{- \epsilon}^\epsilon p(z) U( \epsilon - z) \Big ( \frac{P_i U ( z) \tilde \rho U^\dagger ( z) P_i}{\text{Tr} P_i U ( z) \tilde \rho U^\dagger ( z) } \Big ) U^\dagger ( \epsilon - z) dz
\end{equation}
Let us see what happens as $\epsilon \to 0$. The first thing we notice is this would imply:
\begin{equation}
\epsilon \to 0 \implies p(z) \to \delta (z)
\end{equation}
Substituting this result in our integral we get the normal result of an ideal measurement at $t = 0$:
\begin{equation}
\lim_{\epsilon \to 0}\rho( \epsilon) = \frac{ P_i \tilde \rho P_i}{Tr P_i \tilde \rho }
\end{equation}
Question
Consider the von Neumann entropy $S(\rho)$ of the system. Is there a way to find the probability distributions which ensure the von Neumann entropy always increases?
$$ S(\rho(-\epsilon)) \leq S(\rho(\epsilon)) $$
Try to solve for as general as possible?
"
"['optimization', 'adiabatic-model']"," Title: van Dam's proof for adiabatic optimization and graph diameterBody: My question concerns a proof in https://people.eecs.berkeley.edu/~vazirani/pubs/qao.pdf, ""Limits on Quantum Adiabatic Optimization - Warning: Rough Manuscript!"" by Wim van Dam and Umesh Vazirani. It seems that it was never completed, although it has been cited several times since. In particular, Lemma 2 states (summarized and paraphrased):
If a quantum adiabatic algorithm is carried out on a graph of size $n$ with diameter $w$, with a Hamiltonian whose entries are polynomial in $\log(n)$, the optimization will take time $2^{(w \log w)}$
This is a bit interpretation on my part, because the proof is very incomplete and inconsistent. Now, if this statement is true, we could* apply it to an expander graph with degree $d = \log^k(n)$, and get a graph of width $w = c\log(n)/\log(d)$ for some constant $c$.
That would imply a runtime of
$$d 2^{w\log w} = \log^k(n) 2^{(c \log n/k \log\log n) (\log\log n)} \le \log^k(n) 2^{(c \log n/k)}$$
Then by taking $k$ to be sufficiently large, say, $4/c$, this gives you a $poly(log(n))*2^{\log(n)/4}$, which appears to outperform Grover's algorithm, which is strong evidence that something here has gone wrong. :) As pointed out in the second answer to this question, there might currently be some loopholes to allow adiabatic computing to outperform gate models, but that seems extremely unlikely -- I assume I am not understanding the Lemma 2 from van Dam's manuscript, or the relevant expander graphs don't exist somehow (e.g. $c$ would depend on $n$ in some nontrivial way or something.)
Can anyone explain what's going on here, and perhaps provide a proof of that Lemma 2?
[*] This requires the existence of a such a graph. Moore graphs seem sufficient (a degree-$d$ tree branching out for $w$ levels). Ramanujan graphs might work, if they exist small enough; for example, for the case of Ramanujan graphs, the second-largest eigenvalue is bounded by $\lambda_2 \le 2\sqrt{d-1}$, and the edge expansion is lower-bounded by $\frac{1}{2}(d-\lambda_2) \ge \frac{d}{3}$. A graph with $n$ vertices and edge expansion $\phi$ has diameter bounded by $2\log(n)/\log(1+\phi)$.
"
"['quantum-gate', 'algorithm', 'nielsen-and-chuang', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Question Regarding Quantum Period-Finding Fourier Transform ApproximationBody: I am following the 5.4.1 Period-Finding Algorithm in Nielsen and Chuang as shown below:
My confusion lies with the second expression of point 3 in the procedure. Why is the second expression an approximation as opposed to just being equal to the first expression in point 3?
Nielsen and Chuang states on the next page that "the approximate equality in step 3 is required because $2^t$ may not be an integer multiple of r in general". But when I work through the following steps, I don't see exactly why $2^t$ must be an integer multiple of r for the equality to hold. Consider:
$$\frac{1}{\sqrt{r2^t}} \sum_{\ell=0}^{r-1}\sum_{x=0}^{2^t-1} e^{2\pi i \ell x/r} |x\rangle |\hat{f}(\ell)\rangle$$
We know by the definition of $|\hat{f}(\ell)\rangle$ in the image above,
$$|\hat{f}(\ell)\rangle = \frac{1}{\sqrt{r}}\sum_{s = 0}^{r-1} e^{-2\pi i\ell s/r} |f(s)\rangle$$
(I use $s$ as the index instead of $x$ because $x$ is already used as an index in the first expression.) Anyways, now plugging this in to the first expression, we get:
$$\frac{1}{r\sqrt{2^t}} \sum_{s=0}^{r-1}\sum_{x=0}^{2^t-1}\sum_{\ell=0}^{r-1} \left( e^{2\pi \ell(x-s)/r}\right) |x\rangle |f(s)\rangle$$
Now, we know that $g(x, s) = \sum_{\ell=0}^{r-1} e^{2\pi \ell(x-s)/r} = r$ if $r|(x-s)$ and $0$ otherwise. Also, let $x \equiv s_2 (mod \> r)$. So for every $x$ in the summation, there is an $s = s_2$ meaning that $g(x, s_2) = r$ and $g(x, s) = 0$ for every other $s \neq s_2$. This means that:
$$\frac{1}{r\sqrt{2^t}} \sum_{s=0}^{r-1}\sum_{x=0}^{2^t-1}\sum_{\ell=0}^{r-1} \left( e^{2\pi \ell(x-s)/r}\right) |x\rangle |f(s)\rangle = \frac{1}{2^t}\sum_{x=0}^{2^t-1} |x\rangle |f(x)\rangle$$
Regardless of whether $2^t$ is a multiple of $r$, this equality holds. However, Nielsen and Chuang is stating that its an approximation, being equal only if $r|2^t$. What exactly am I missing here? Perhaps I'm making some assumption that is not true in the work above?
"
"['circuit-construction', 'simulation', 'nielsen-and-chuang', 'hamiltonian-simulation']"," Title: Problem with building quantum circuit for Hamiltonian operationBody: In the book, Nielsen and Chuang, there is a section on quantum simulation of the quantum search algorithm. Hamiltonion operator is defined as follows-
$$
H = |x\rangle\langle x| + |\psi\rangle\langle\psi|
$$
where x is the only solution to the search problem and
$$
\psi = \frac{\sum_{x}{|x\rangle}}{N}
$$
with N being the total number of elements.
I haven't been able to understand how the following circuits were implemented using the Hamiltonions specified in the picture and the book doesn't explain how they came up with the circuits.
"
"['quantum-gate', 'circuit-construction', 'quantum-inspire']"," Title: How to approximate $Rx$, $Ry$ and $Rz$ gates?Body: Quantum Inspire is a quantum computing platform provided by QuTech. It consists of two real quantum processors - Starmon-5 and Spin-2. Whereas it is possible to use rotation gates $Rx$, $Ry$ and $Rz$ on Spin-2 processor, Starmon-5 gate set consist only of:
- Pauli gates $\text{X}$, $\text{Y}$, $\text{Z}$ and $\text{I}$
- Hadamard gate $\text{H}$
- Phase gate ($\text{S}$) and $\pi/8$ ($\text{T}$) gate and their conjugate transpose gates
- rotation around axes $x$ and $y$ for angle $\pm\frac{\pi}{2}$ gates
- $\text{CNOT}$, $\text{CZ}$ and $\text{SWAP}$ gates
My question is how can I construct gates $Rx$, $Ry$ and $Rz$ with rotation angle $\theta$ from gate listed above.
EDIT:
Based on advice from JSdJ and the Nielsen and Chuang book, I found out that:
- $HTH = Rx(\pi/4)$ which together with the fact that $T=Rz(\pi/4)$ allows to build gate
$$R_{\hat{n}}=Rz(\pi/4)Rx(\pi/4)= \text{exp}(-i\frac{\pi}{8}Z)\text{exp}(-i\frac{\pi}{8}X) = \\ \cos^2\frac{\pi}{8}I-i(\cos\frac{\pi}{8}(X+Z)+\sin\frac{\pi}{8}Y)\sin\frac{\pi}{8}$$
(note that $Y=-iZX$)
- this is a rotation around axis defined by vector $\hat{n}=(\cos(\pi/8);\sin(\pi/8);\cos(\pi/8))$. Rotation angle is given by equation $\cos(\theta/2) =\cos^2(\pi/8)$
- angle $\theta$ is $2\arccos[\cos^2(\pi/8)] \approx 1.096$ which is irrational multiple of $2\pi$
- since $\theta$ is irrational, repeated application of the gate $R_{\hat{n}}$ never leads to rotation by an angle which sum up to $2\pi$
- as a result we are able to reach any rotation by angle $\alpha$ around $\hat{n}$ axis by repeated application of $R_{\hat{n}}$, i.e. we can construct $R_{\hat{n}}(\alpha)=R_{\hat{n}}^{n_1}$, where $n_1$ is an integer
- also it is true that $HR_{\hat{n}}(\alpha)H = R_{\hat{m}}(\alpha)$ where $\hat{m}$ is axis defined by vector $(\cos(\pi/8);-\sin(\pi/8);\cos(\pi/8))$, so the same procedure allows to find rotation for $\alpha$ around axis $\hat{m}$
- it can also be proven that any arbitrary single qubit unitary matrix $U$ can be written (up to global phase) as $U = R_{\hat{n}}(\beta_1)R_{\hat{m}}(\gamma_1)R_{\hat{n}}(\beta_2)R_{\hat{m}}(\gamma_2)\dots$
- together this leads to conclusion that any $U$ (including $Rx$, $Ry$ and $Rz$ rotations) can be approximated by repeated application of $R_{\hat{n}}$ and Hadamards, i.e. $U \approx R_{\hat{n}}^{n_1}HR_{\hat{n}}^{n_2}HR_{\hat{n}}^{n_3}HR_{\hat{n}}^{n_4}H \dots$, where $n_i$ are integers
To sum up, only with $T$ and $H$ gates we can construct any rotation.
Only question is how to find integers $n_i$ for construction of arbitrary $Rx$, $Ry$ and $Rz$ rotation. Can anybody give me an example of such circuit, for exaple gate $Ry(\pi/8)$?
"
"['quantum-state', 'algorithm', 'entanglement']"," Title: What kind of operators should I perform on 4-qubit state $|\psi\rangle_A|GHZ\rangle$ to get expression like $|\Psi\rangle_4$?Body: Alice wants to send Bob qubit in state $|\psi_A\rangle = \alpha|0\rangle_A + \beta|1\rangle_A$ , also she has one qubit from GHZ state $\frac{1}{\sqrt 2}(|0\rangle_a|00\rangle +|1\rangle_a|11\rangle)$.
Then she performs Bell basis
($|\Psi_{\pm}\rangle_{Aa}=\frac{1}{\sqrt 2}(|00\rangle_{Aa}\pm|11\rangle_{Aa})$, $ |\Phi_{\pm}\rangle_{Aa}=\frac{1}{\sqrt 2}(|01\rangle_{Aa}\pm|10\rangle_{Aa})$
measurement on qubits $(A, a)$.
In terms of projection operators and/or measurement operators how can I get expression for this 4-qubit state:
$$|\Psi\rangle_4=\frac{1}{ 2}[|\Psi_{+}\rangle_{Aa}(\alpha|00\rangle +\beta|11\rangle)+|\Psi_{-}\rangle_{Aa}(\alpha|00\rangle -\beta|11\rangle)+|\Phi_{+}\rangle_{Aa}(\beta|00\rangle +\alpha|11\rangle)+|\Phi_{-}\rangle_{Aa}(-\beta|00\rangle +\alpha|11\rangle)]$$
(I understand that if just simplify this exptression I get $(\alpha|0\rangle_A + \beta|1\rangle_A) \frac{1}{\sqrt 2}(|0\rangle_a|00\rangle +|1\rangle_a|11\rangle)$ ???
"
"['qiskit', 'grovers-algorithm', 'kraus-representation']"," Title: Implementing sum on Boolean with Grover algorithmBody: We are trying to implement a ""sum over 4 booleans = k"" in the spirit of Grover search. First, we have 4 qubits, one for each boolean q00, q01, q02, q03,; then 4 qubits to computed intermediate sum (q11 and q10 to store ""q00+q01"" where q11 is the carry, etc); then 3 qubits to binary represent the int result q22.q21.q20 (varying between 0 to 3); and then a final qubit to test the result = k (here we want k=1 so 001 is the good result, then 2 X gate on q21 and q22 will bring 111 via the C3Not into q40. Finally q60 is for Grover extraction.
First we describe the sum (Oracle), then Grover Amplification (separated with a barrier); and done 2 iterations before measurements.
The histogram result is quite strange despite we found the standard 4 solutions, 0000 and 1111 appear also.
Can someone explain this behaviour?
"
"['programming', 'pyquil']"," Title: Pyquil run_and_measure gives the same output across all the trials: is this expected?Body: I tried to run the starter program demonstrated on this page:
http://docs.rigetti.com/en/stable/start.html#installing-the-qvm-and-compiler-on-linux-deb
With the following code:
# construct a Bell State program
p = Program(H(0), CNOT(0, 1))
# run the program on a QVM
qc = get_qc('9q-square-qvm')
result = qc.run_and_measure(p, trials=10)
for i in range(10):
print(result[i])
And all of result[i]'s turn out to be the same.
Is this expected?
If not, what might I be doing wrongly?
"
"['error-correction', 'surface-code']"," Title: Is there benefit to extra stabilizers in a rotated surface code?Body: I'm reading Horsman et al. ""Surface code quantum computing by lattice surgery"" and I'm wondering about the rotated surface code.
Consider Figure 13:
This is supposed to have distance 5. But in (c), an $X$ error on the top left qubit and the qubit beneath it would be undetectable (brown plaquettes are $X$-stabilizer measurements). If there were a stabilizer measurement on every outside edge, this problem wouldn't occur. What am I misunderstanding?
"
"['quantum-gate', 'solovay-kitaev-algorithm']"," Title: Why is phase gate a member of universal gate set?Body: According to Solovay-Kitaev theorem it is possible to approximate any unitary quantum gate by sequence of gates from small set of another gates. The approximation can be done with an arbitrary accuracy $\epsilon$.
One of such set of gates is composed of Hadamard gate, phase gate ($S$), $\pi/8$ gate ($T$) and CNOT gate.
However, it is also true that $S=T^2$ because $T$ gate is a rotation around $z$ axis by $\pi/4$ and $S$ gate a rotation by $\pi/2$ around the same axis.
Since $S$ gate can be composed of two $T$ gates, why do we add $S$ gate to the set? It seems that a set containing only $H$, $T$ and CNOT is equivalent. What am I missing?
"
"['circuit-construction', 'gate-synthesis', 'universal-gates']"," Title: What are the differences between the Toffoli and Fredkin gates (historical, practical, etc.)Body: I'm trying to understand the historical ordering and the practical differences between the Toffoli Gate and the Fredkin Gate.
Toffoli's February 1980 tech report MIT/LCS/TM-151 states:
Where reference [7] is:
Conservative Logic is then published in 1982 in at least different guises: an article in International Journal of Theoretical Physics and a chapter in Collision-Based Computing.
So the implication to me is that the Fredkin gate precedes the Toffoli Gate.
Given that both gates are universal, what is the purpose of trying to simulate Fredkin gates with Toffoli gates, or vice-versa?
Also, Which gate is more commonly used, and why? A recent Google search finds 84 results for "Fredkin gate" in the Google index, and 86 results for "Toffoli gate." Both of those seem to be dramatic undercounts.
"
"['quantum-gate', 'gate-synthesis', 'universal-gates']"," Title: How to construct a CU3 gate using only CX and U3 gates?Body: Knowing that CX and U3 (taking 3 parameters $\theta, \phi$ and $\lambda$) form a set of universal gates how can I construct an arbitrary CU3 gate using a decomposition of only CX and arbitrary U3 gates?
"
"['quantum-state', 'entanglement', 'measurement', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Measuring Probability of Mixed StatesBody: I am a little stuck on understanding the measurement probabilities of a 3 qubit system (QCQI q 4.41).
1)H gates are applied to both $q_1$ and $q_2$
2) $C^{(1,2)}_3(X)$, a Toffoli, controlled by $q_1$ and $q_2$ is then applied to $q_3$
3) A Unitary (S gate) is then applied to $q_3$
4) $C^{(1,2)}_3(X)$, a Toffoli, controlled by $q_1$ and $q_2$ is then applied to $q_3$
5) H gates are applied to both $q_1$ and $q_2$
The probability of measuring $|q_1\rangle = |q_2\rangle = 0$ should be $\frac{5}{8}$, however I can only seem to derive $\frac{4}{8}$, by expanding out the tensors and then cancelling.
After step 4 the state I think is:
$(|00\rangle + |01\rangle + |10\rangle)\otimes S|q_3\rangle + |11\rangle \otimes XSX|q_3\rangle$
Then after applying step 5, expanding out and cancelling I am left with:
$(|00\rangle + |00\rangle + |00\rangle - |11\rangle)\otimes S|q_3\rangle + (|00\rangle - |01\rangle - |10\rangle + |11\rangle)\otimes XSX|q_3\rangle $
however I can't seem to find the missing $|00\rangle$, and also in this result the measurement of $|00\rangle$ corresponds to two different states of $q_3$. I think the error in my understanding is somewhere here:
Applying Hs (step 5) and expanding $|11\rangle \otimes XSX|q_3\rangle$
$(H|1\rangle \otimes H|1\rangle) \otimes IXSX|q_3\rangle$ = $(|00\rangle - |01\rangle - |10\rangle + |11\rangle)\otimes XSX|q_3\rangle $
Could it also be my misunderstanding that the state of $|q_1q_2\rangle$ going into both Toffoli gates can be different for step 2 & 4? I was assuming that if that state was $|11\rangle$ in the first Toffoli then it must be $|11\rangle$ into the second as well.
"
['cirq']," Title: How to cite cirq in a scientific article?Body: What would be the best/prefered bibtex entry for citing cirq ?
Is this ok ?
@article{cirq,
title={Cirq, a python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits},
note={\url{https://github.com/quantumlib/Cirq}}
}
"
['grovers-algorithm']," Title: Exponential speedup of Grover's algorithm?Body: This question was inspired by the following reference:
Reference paper
We use the usual notation. $N = 2^n$ , the number of all possible n-bit strings . The oracle $U_\omega$ can be put in the form
$U_\omega=I - 2 (\vert\omega\rangle\langle\omega \vert )$
$U_\omega$ is a reflection of any vector on the hyperplane orthogonal to $\vert\omega\rangle$
The vector $\vert s \rangle $ and operator $U_s$ are introduced.
$\vert s \rangle = H^{\otimes n} \vert 0 \rangle^{\otimes n}$ , where $H^{\otimes n}$ is the n-qubit Hadamard transform.
Operator $U_s$ reflects any vector with respect to $\vert s \rangle$
$U_s = 2\vert s \rangle \langle s \vert - I$
The Grover iteration is $U_{Grover} = U_s U_\omega$
$U_{Grover}$ rotates (at every iteration) the initial vector $\vert s \rangle$ towards the desired vector $\vert\omega\rangle$ by the angle $2\theta$, where $sin\theta = \frac{1}{\sqrt{N}}$
We note that a reflection is expressed by a unitary matrix. That means that the operator defined below is represented by a unitary matrix, therefore a quantum circuit can be designed in order to implement this operator (Edit. This statement was proven false by the answer to this question).
We define the operator:
$U(\vert x \rangle , \vert y \rangle ) = ( \vert x \rangle , U_x \vert y \rangle) $ , where $U_x \vert y \rangle$ represents the reflection of $\vert y \rangle$ with respect to $\vert x \rangle$
In the following relations the vectors $\vert \xi_i \rangle$ are implicitly defined based on the action of the operator U.
We consider the following sequence of transformations (based on the definition of the operator U):
$U(\vert s \rangle , U_\omega\vert s \rangle ) = (\vert s \rangle , U_sU_\omega \vert s \rangle) = (\vert s \rangle , \vert \xi_1 \rangle )$
$U(\vert \xi_1 \rangle , U_\omega\vert s \rangle ) = (\vert \xi_1 \rangle , U_{\xi_1}U_\omega \vert s \rangle) = (\vert \xi_1 \rangle , \vert \xi_2 \rangle )$
$U(\vert \xi_2 \rangle , U_\omega\vert s \rangle ) = (\vert \xi_2 \rangle , U_{\xi_2}U_\omega \vert s \rangle) = (\vert \xi_2 \rangle , \vert \xi_3 \rangle )$
.......................and so on..........................
$U(\vert \xi_{n-1} \rangle , U_\omega\vert s \rangle ) = (\vert \xi_{n-1} \rangle , U_{\xi_{n-1}}U_\omega \vert s \rangle) = (\vert \xi_{n-1} \rangle , \vert \xi_n \rangle )$
In other words, the vector to be reflected is fixed but the reflection axis is variable (in the original Grover algorithm it's the other way around ).
At every step K of the algorithm above the initial vector $\vert s \rangle$ is rotated towards the desired vector $\vert\omega\rangle$ by an angle which is at about $2^K\theta$ (as order of magnitude ), where $sin\theta = \frac{1}{\sqrt{N}}$. That means that this algorithm will only need about $log_2 N$ (as order of magnitude ) steps to reach the target.
Question 1. Can a quantum circuit be designed, that implements this algorithm, in principle ?
Question 2. Does this algorithm present an exponential speedup, when compared to Grover's algorithm?
Edit. Unfortunately nothing from what I tried seems to work. You need a quantum circuit that takes as input the vector to be reflected and the vector that represents the reflection axis. The output of the quantum circuit must contain the reflected vector. That does not seem possible, as far as I understand. This reflection implementation problem, if ever solved, would lead to an exponential speedup of Grover's algorithm.
Related question
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang', 'partial-trace', 'kraus-representation']"," Title: Prove that the partial trace is a quantum operation, finding its Kraus representationBody: I am referring to Nielsen and Chuang Quantum Computation and Quantum Information 10th Anniversary Edition Textbook, Chapter 8.3.
A linear operator $E_i:H_{QR}\longrightarrow H_Q $ is defined by:
$$E_i \bigg(\sum_j \lambda_j |q_j\rangle|j\rangle \bigg)\equiv \lambda_i |q_i\rangle$$
whereby $|q_j\rangle$ and $|j\rangle$ are arbitrary states of system Q and the basis of system R respectively. Define $\varepsilon$ to be the quantum operation with the operation elements {$E_i$}:
$$\varepsilon(\rho)\equiv \sum_i E_i \rho E_i^{\dagger}$$
The text went on to say:
$$\varepsilon(\rho\otimes|j\rangle\langle j'|)=\rho \space \delta_{j,j'}=tr_R(\rho\otimes|j\rangle\langle j'|)$$
Question:
I do not understand how to arrive at $\delta_{j,j'}$, and what form will be the operator representation of $E_i$ take? From what I've observed, system Q and R are not entangled in the last equation and $E_i$ seems to disregard whatever $|j\rangle$ basis of system R.
Help will be much appreciated.
"
"['qiskit', 'programming', 'hadamard']"," Title: How can I make qiskit output raw data?Body: I am new to quantum computing, and I want to make a program to output 0 or 1 randomly by Hadamard gate, and use that information to make a GUI interface. For example, a coin flip program that output ""Tail"" when it is 1, and ""Head"" when it is 0. However, when I try to get raw data by job.result(job), I get the information of the result instead. By the way, here is the code:
from qiskit import *
simulator = Aer.get_backend('qasm_simulator')
qr = QuantumRegister(1)
cr = ClassicalRegister(1)
circuit = QuantumCircuit(qr, cr)
circuit.h(qr[0])
circuit.measure(qr, cr)
job = execute(circuit, backend = simulator, shots=1024)
a = job.result(job) #the problematic code
print(a)
I use Qiskit with Python, and do not use Jupyter notebooks.
"
"['quantum-gate', 'ibm-q-experience']"," Title: Why is a different convention used for the $Rz$ implementation on IBM Q?Body: A $z$ rotation gate is defined as
$$
Rz(\theta)=\mathrm{e}^{-i\frac{\theta}{2}Z}=
\begin{pmatrix}
\mathrm{e}^{-i\frac{\theta}{2}} & 0 \\
0 & \mathrm{e}^{i\frac{\theta}{2}}
\end{pmatrix},
$$
however, when one uses $Rz$ gate on IBM Q, the results are these (tested in Visualization of state vector):
- $Rz(\theta)|0\rangle = |0\rangle$
- $Rz(\theta)|1\rangle = \mathrm{e}^{i\theta}|1\rangle$
This means that a matrix representation of such gate is
$$
Rz^{\text{IBM}}(\theta)=
\begin{pmatrix}
1 & 0 \\
0 & \mathrm{e}^{i\theta}
\end{pmatrix}.
$$
So, it seems that $Rz(\theta)$ is on IBM Q implemented with $U1(\theta)$ gate.
Since gates $Rz(\theta)$ and $Rz(\theta)^\text{IBM}$ differs only by global phase $\theta/2$ ($Rz^\text{IBM} = \mathrm{e}^{i\frac{\theta}{2}}Rz(\theta))$, this difference can be neglected. However, in case of controlled version of $z$ rotation the global phase matters.
Controlled version of $Rz$ is described by matrix
$$
CRz(\theta)=
\begin{pmatrix}
1 & 0 & 0 & 0\\
0 & 1 & 0 & 0\\
0 & 0 & \mathrm{e}^{-i\frac{\theta}{2}} & 0 \\
0 & 0 & 0 & \mathrm{e}^{i\frac{\theta}{2}}
\end{pmatrix}
$$
On IBM Q, controlled version of $Rz$ behaves according to this matrix which is right.
Despite the global phase can be neglected in case of single qubit gates, one would expect that relation between a single qubit gate $U$ and its contolled version, i.e.
$$
CU=
\begin{pmatrix}
I & O \\
O & U
\end{pmatrix},
$$
will be preserved. In some cases the convention used by IBM for $Rz$ can be confusing (discussed for example here).
So far, I have counted with this fact but I am curious: Why does IBM use its own convention and does not follow definitions used in quantum physics?
(I would appreciate if somebody from IBM Q development team could give an insight to this).
"
['grovers-algorithm']," Title: Writing Grover's Iterator in different computational phaseBody: This question is from Nielson and Chuang's Quantum Computation and Quantum Information:
Here $|\alpha\rangle$ is given by:
$$\frac{1}{\sqrt{N-M}}\sum_{x} ""|x\rangle $$
where $\sum_{x}"" |x\rangle$ is the sum of states which are not the solution.
and $|\beta\rangle $ is given by:
$$ \frac{1}{\sqrt{M}}\sum_{x} ' |x\rangle $$
where it represents all $M$ solutions.
$\theta$ is defined by:
$$\cos\Big(\frac{\theta}{2}\Big) = \sqrt{\frac {N-M}{N}}$$
I understand everything mentioned above as well as the further geometric visualization. However, I am having trouble trying to come up with a justified way to solve this exercise. The only thing that I understand is that $G$ must be a unitary Matrix made up of trigonometric functions. How can I approach this problem?
"
['architecture']," Title: Is quantum computing the most advanced computing technology we will ever have?Body: Is there already evidence today (e.g. basic theoretical research or even prototypes) on what the next technolgy will be/could be that is superior to quantum computers?
Or have we reached the ""pinnacle computing technology"" with quantum computers and the only thing left to do is to build larger and larger (in terms of qubits) quantum computers with a more advanced architecture? If the latter is true, why is that?
If this is not the correct Stack Exchange site to ask this question, I apologize. In that case, please, point me to a better suited one.
"
"['quantum-gate', 'quantum-advantage', 'google-sycamore']"," Title: Why Google has used $\sqrt{X}$ and $\sqrt{Y}$ instead of $X$ and $Y$ in supremacy experiment?Body: In supremacy experiment Google has used $\sqrt{X}$ and $\sqrt{Y}$ as two of their single qubit gates (paper).
So My questions are:
- Is there any specific reason for choosing these gates and not $X$ and $Y$ instead?
- Is it because of technical issues like the natural choice for transmon qubits are these gates?
- Or is it about complexity of the algorithm that is needed to simulate these gates?
"
"['hamiltonian-simulation', 'pauli-gates']"," Title: How can I decompose a matrix in terms of Pauli matrices?Body: I need to see an example of how Hamiltonian, i.e. any Hermitian matrix, can be decomposed into a linear combination of Pauli matrices.
I would prefer an option to do this in larger than 2 dimensions, if that is possible.
"
"['grovers-algorithm', 'oracles']"," Title: How does the Grover's Algorithm work with a real example?Body: I am new to this field and I have been baffled by the idea of Oracle for a long time.
I am aware of the procedure, but I am very confused about how we choose the oracle.
Let say we have 4 poker cards, the spade of Ace, the club of 7, the heart of 9, and the diamond of 7. I shuffled the four cards and now I want to know where is the spade of ace.
I would first encode the cards, say 00, 01, 10, and 11 respectively for the spade of Ace, the club of 7, the heart of 9, and the diamond of 7.
To solve the problem on a quantum computer, I will first initialize the system in the superposition of the four states, and I apply the oracle corresponding to $|00\rangle$ (see Qiskit), and evolve the state and everything, I will finally end up with the state $|00\rangle$.
My question is how does this result help me in any way? I wanted to know the position of the spade of Ace in the deck of cards but instead I got a state $|00\rangle$, which means spade of the Ace. Am I missing a step somewhere?
I would appreciate it if the answer could continue with the example, and show from beginning to end how one can find the position of the card.
"
"['complexity-theory', 'cryptography']"," Title: Do we already know some problems, that would be hard to solve for quantum computers, and use them in cryptography?Body: I was wondering, whether there are any problems that we already know are difficult to solve for a quantum computer, and that we could potentially use in cryptography, just as we do now with e.g. the factorization of integers?
"
"['quantum-gate', 'circuit-construction']"," Title: Can you make a Toffoli-like gate which flips if control bits are equal?Body: The toffioli gate flips the target bit when both of the control bits are $\vert 1 \rangle $.
Would it be possible to instead have a gate which flips a target bit when both control bits are 'equal'?
Possible meanings of equal:
- Control bits are identical: $\vert c1 \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle = \vert c2 \rangle$.
- Control bits have the same sign/phase: doesn't flip if $\vert c1 \rangle = -\vert c2 \rangle$. Flips otherwise.
I am thinking about this in the context of qubits which may or may not have been marked by the oracle in Grover's algorithm if that helps.
Many thanks
"
"['algorithm', 'hhl-algorithm', 'machine-learning']"," Title: New Hybrid-HHL algorithm vs VQLSBody: A team of researchers has realized hybrid quantum algorithm for solving a linear system of equations with exponential speedup that utilizes quantum phase estimation, the algorithm demonstrates quantum supremacy and holds high promise to meet practically relevant challenges.
https://scirate.com/arxiv/2003.12770
https://www.swissquantumhub.com/quantum-supremacy-quantum-hybrid-hhl-algorithm-for-solving-a-system-of-linear-equation/
There is also a variational hybrid quantum-classical algorithm for solving linear systems, with the aim of reducing the circuit depth and doing much of the computation classically, called VQLS.
https://arxiv.org/abs/1909.05820
https://pennylane.ai/qml/demos/tutorial_vqls.html
How can we compare both algorithms?
In the part of the near-term application of H-HHL paper, they talk about Bayesian deep learning application: "One of the promising applications related to deep neural network training was discussed in [1]: since the extension of the Bayesian approach to deep architectures is a serious challenge, one can exploit the hybrid quantum HHL algorithm developed for Gaussian processes in order to calculate a model’s predictor"
[21].
Which algorithm should be better in the next-gen state-of-art 53-Qubits quantum computer for the Quantum Bayesian deep learning algorithm?
"
['error-correction']," Title: Can a quantum error-correcting code really correct any linear combination of correctable errors?Body: It appears to me that in the survey by Gottesman (around Thm 2) as well as the book by Nielsen and Chuang (Thm 10.2) it is suggested that if a QEC code corrects errors $A$ and $B$ then it also corrects any linear combination of errors (in particular by Gottesman); the sources can be found here:
Gottesman: https://arxiv.org/abs/0904.2557
Nielsen, Chuang: http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf
A simple QEC code like Shor's 9-qubit code can correct arbitrary single-qubit errors bc it can correct the Pauli errors if they occur on the same qubit, but clearly it cannot correct more than one error if they occur in the wrong places (e.g. two bitflip errors in the same block). But such an error would be a linear combination of a bitflip error X_1 hitting the first and a bitflip error X_2 hitting the second qubit in the code. What am I missing here?
"
"['programming', 'q#', 'hamiltonian-simulation', 'matrix-representation']"," Title: Generic matrix exponential in Q#Body: I am trying to find a way to implement a unitary transformation in Q# that implements e^(iA) where A is a square matrix. However, I only found ways to do this in Q# if A can be represented as a tensors of Paulis (the Exp operation: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.primitive.exp or using a PauliEvolutionSet when trying to do Hamiltonian simulation: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.simulation.paulievolutionset).
Does anyone know how to do this for a generic matrix A? If for example you want to use a 8x8 matrix, you can't express it in terms of tensors of Paulis...
Thanks in advance for the help!
"
"['gate-synthesis', 'universal-gates']"," Title: Are Toffoli gates actually used in designing quantum circuits?Body: In an actual quantum computer, are we designing circuits with Toffoli Gates and then using compilers or optimizers to remove redundancies so that we can use fewer qubits than a full Toffoli gates would require? Or are multiple gates composed by the compilers into a single quantum circuit?
Are these operations mathematically equivalent if you use Toffoli Gates or Fredkin gates, or is one gate easier for optimizers to work with?
"
"['mathematics', 'classical-computing', 'superposition']"," Title: Is it right to think of superposition as just angle?Body: Based on my current understanding, a qubit is represented as a vector $(a, b)$ which satisfy $a^2 + b^2 = 1$. Classical bit one can be represented as $(0, 1)$ and bit zero can be represented as $(1, 0)$.
And then we can have things that cannot be described isomorphically in classical computing such as $(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}})$.
Then, I came to a realization where this is quite similar to trigonometry identity where $\sin^2(t) + \cos^2(t) = 1$.
Thus, I'm wondering if a qubit is a point $p$ that lies anywhere on the circumference of a unit circle, can a qubit $(a, b)$ be described as $(\sin(t), \cos(t))$ where $t$ is the angle measured from positive $x$-axis to the line formed between $p$ and center of the circle?
Is this analogy faulty?
"
"['qiskit', 'programming', 'optimization', 'vqe']"," Title: SPSA max_trialsBody: I'm using SPSA as an optimizer in VQE algorithm.
The code runs on ibmq-qasm-simulator.
I've set SPSA max_trials parameter to 500, but, when I run the code, it makes 1000 iterations.
I've tried with COBYLA optimizer too, and it makes correctly 500 iterations.
Does someone know why?
Thanks
"
"['quantum-gate', 'nielsen-and-chuang']"," Title: How to implement the exponential of an outer product?Body: In exercise 6.7 page 258 in Nielsen and Chuang book, they have a Hamiltonian $H = \left| x \right\rangle \!\!\left\langle x \right| + \left| \psi \right\rangle \!\!\left\langle \psi \right|$ and the purpose is implementing $\exp(-iHt)\left| \psi \right\rangle$, where $\left| \psi \right\rangle = \frac{\sum_{x}\left| x \right\rangle}{\sqrt N}$.
Regarding the first part of the Hamiltonian, I couldn't understand how I can figure out the circuit implementation (the gates) for the operator $\exp(-i \left| x \right\rangle \!\!\left\langle x \right| \Delta t)$.
In the book, they implement it as:
Could you please explain to me that circuit, and how they come out with it?
And what the oracle contains? an example with 4-qubits ($exp(-i \left| 0101 \right\rangle \left\langle 0101 \right| \Delta t)$) or else, would be too helpful.
And thank you.
"
"['quantum-gate', 'circuit-construction', 'grovers-algorithm']"," Title: Can a circuit map $|x,y\rangle$ to the reflection of $|y\rangle$ with respect to $|x\rangle$?Body: Statement of the problem.
I want to consider/design a quantum circuit that takes as input two vectors $\vert x \rangle$ and $\vert y \rangle$. The output of this quantum circuit must contain the reflected vector of $\vert y \rangle$ with respect to $\vert x \rangle$ (and whatever else that is irrelevant to the purpose ) . I can't find a solution to this problem. I am not sure if this reference might give a clue towards a solution (programmable quantum gate arrays?). We work in a Hilbert space of fixed (but large) dimension.
Question. Does such a quantum circuit exist?
Note that a solution for this problem is important, because if such a quantum circuit exists, then an exponential speedup of Grover's algorithm would become a possibility (relevant for practical problems ), as can be seen in this question .
"
"['mathematics', 'bloch-sphere', 'pauli-gates', 'superposition']"," Title: Effect of Pauli X gate on minus state using bloch sphereBody: As I understood, the X gate flips the state around : $X(|0\rangle) = |1\rangle$. It can also be visualized with a $\pi$ rotation around the $x$ axis in the Bloch sphere. I have no problem with that.
The problem is with the minus state. The Bloch sphere visualization of the Hadamard gate is a $\pi$ rotation around the $z$ axis and a $\pi/2$ rotation around the $y$ axis. This makes it that when we use the H gate on the basis state we obtain $H(|0\rangle) = \frac {|0\rangle+|1\rangle} {\sqrt 2} = |+\rangle$ and $H(|1\rangle) = \frac {|0\rangle-|1\rangle} {\sqrt 2} = |-\rangle$. I understand that without any problem.
These two states are on the $x$ axis, this means that applying an X gate and therefor create a rotation shouldn't change anything. This is the case with the $|+\rangle$ state since $X(|+\rangle) = |+\rangle$. However. I simply do not understand how the case of the $|-\rangle$ state can be explained $X(|-\rangle) = -|-\rangle$ using the Bloch sphere since a rotation of $\pi$ around the $x$ axis shouldn't change anything.
Thanks for reading, and I hope you can explain
PS : I do understand the other demonstration $X(|-\rangle) = X(\frac {1}{\sqrt 2}|0\rangle-\frac {1}{\sqrt 2}|1\rangle)=\frac {1}{\sqrt 2}|\rangle-\frac {1}{\sqrt 2}|0\rangle=-|-\rangle$
"
"['qiskit', 'programming', 'circuit-construction', 'ibm-q-experience']"," Title: How to make circuit for n-control Z gate( i.e $C^3Z$ )?Body: I am trying to make circuit for $C^3Z$ gate I have seen a circuit for $C^2Z$ or $CCZ$ gate made by using $CCX$ gate so is there any way to make circuit for $C^3Z$ in this similar manner( i.e by using $CCX$ gate) or i have to do something different then this method Fig. is below for $CCZ$ gate
"
"['qiskit', 'programming', 'circuit-construction', 'ibm-q-experience']"," Title: ModuleNotFoundError: No module named 'qiskit.circuit.library'Body: I am importing from qiskit.circuit.library import MCMTVChain on python IDLE editor but it showing error ModuleNotFoundError: No module named 'qiskit.circuit.library' although it's working fine on google colab. Also why Qiskit does not work properly on python IDLE it's show lots of other error not just this one?
"
"['bell-experiment', 'non-locality']"," Title: What is the number of local deterministic behaviours in a Bell scenario?Body: Consider a Bell scenario: Alice and Bob perform measurements on a shared system, and each of them has a ""measurement box"" with a bunch of inputs (corresponding to different measurement settings) and corresponding outputs.
Say they can each choose from $m$ possible inputs, labelled as $x,y\in\{1,...,m\}$, and can get one of $\Delta$ possible outputs $a,b\in\{1,...,\Delta\}$ (taking the notation from (1303.2849)).
In this context, a behaviour is a set of joint probabilities $\boldsymbol p\equiv \{p(ab|xy)\}_{abxy}\in\mathbb R^{\Delta^2 m^2}$.
A local deterministic behaviour is a behaviour such that $p(ab|xy)=\delta_{a,a_x}\delta_{b,b_x}$ for some pair $(a_x,b_y)$ associated with each $(x,y)$.
I want to count the number of such behaviours.
To do this, I would have said that, for each $(x,y)$, there are $\Delta^2$ possible outcome assignments, as $a_x$ and $b_x$ can be chosen independently. At the same time, there are $m^2$ possible pairs $(x,y)$, and thus the total number should be $(\Delta^2)^{m^2}=\Delta^{2 m^2}$.
However, in (1303.2849) (between (17) and (18)) they state that this number is $\Delta^{2m}$. Why is my calculation off?
"
"['circuit-construction', 'measurement', 'nielsen-and-chuang', 'matrix-representation']"," Title: Nielsen & Chuang Exercise 4.34 ""Measuring an operator""Body: I need help with the exercise 4.34 from Nielsen & Chuang Book.
I am supposed to get a matrix corresponding to the circuit. Thanks
"
"['quantum-gate', 'circuit-construction', 'mathematics', 'universal-gates']"," Title: Universality and coverage of irrational multiples of $2\pi$ In $[0, 2\pi)$Body: This related to the proof of universality (pg 196),and partially related to the question Why is Deutsch's gate universal?, however i'm trying to workout a more rigorous proof and understanding of why irrationality is so important.
For $\theta_k \in [0,2\pi)$, $\theta_k = (k\theta)\text{mod }2\pi$, I am struggling to see how for a sequence $k \in \mathbb{Z}$, $k = {1\dots} N$ that the set of $\theta_k$ fills up the interval $[0,2\pi)$, and why is is important that $\theta$ is an irrational multiple of $2\pi$. Does irrationality indicate the uniqueness of each $\theta_k$? This is something I was trying to prove but can't seem to get very far, based on
$\alpha \mod \beta = a - \beta[\alpha/\beta]$, where $[]$ is the floor.
using $\alpha = \gamma(2\pi)$, where $\gamma$ is irrational, and $\beta=2\pi$
$\theta_k =k\gamma(2\pi) - 2\pi[k\gamma(2\pi)/2\pi] = k\gamma(2\pi) - 2\pi[k\gamma]$, however I can't see how this yields uniqueness for irrational $\gamma$ and not for a rational $\gamma$.
If $\gamma$ is rational $\gamma = \frac{p}{q}$, then $\frac{kp}{q}$ is still unique unless $k=1$.
....Or I could just be taking entirely the wrong approach!
"
"['d-wave', 'annealing', 'adiabatic-model']"," Title: What is an example of a simple QUBO problem?Body: I am digging into to the workings of the D-wave quantum annealing computers using this documentation. I find it very intuitive and well-explained, but their example of a ""simple QUBO problem"" does not seem an optimization problem to me as they are just trying to reproduce the XNOR (i.e., they fix the weights based on the kown solution, instead of getting a solution based on weights).
Is there a dead-simple example of a QUBO problem that also has some meaning? Up to 4 qubits for this example are fine, but it must be kind of meaningful.
"
"['physical-realization', 'architecture', 'scalability']"," Title: Why don't quantum computing scientists build two 50-qubit processors and connect them in parallel instead of building one 100-qubit processor?Body: Isn't it more scalable to build multiple processors of a lower qubit and connect them in parallel instead of building one processor of a higher qubit?
"
"['quantum-gate', 'quantum-state', 'nielsen-and-chuang', 'bloch-sphere', 'pauli-gates']"," Title: What kind of transformation does the Y-gate do on the bloch sphere?Body: I'm going through ""Quantum Computation & Quantum Information"" by Michael A. Nielsen and Isaac L. Chuang, and as a high school student with no previous knowledge, I cannot understand some things about linear transformations on the bloch sphere.
"
"['algorithm', 'quantum-state']"," Title: How to check a qubit's state?Body: Is it possible to write an algorithm that returns a single bit that represents if a qubit is in superposition or not, without compromising the qubit's wavefunction? Example:
is_in_superposition($\vert 0 \rangle$) = 0
is_in_superposition($\dfrac{1}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$) = 1
"
['quantum-advantage']," Title: How does Deutsch Oracle shows quantum supremacy?Body: I learnt from this lecture (at 33:20) that Deutsch Oracle is way faster on quantum computers than on classical computers. However, it seems to me that this is just due to smart structuring of input data, which is also doable on classical computers.
Thus, for me, the only way to accept that Deutsch Oracle is indeed faster on quantum computers is due to the fact that some of the following gates run much faster on quantum computers than being simulated on classical computers:
- Hadamard gate
- CNOT gate
So here's my questions, is the aformentioned statement true? If so, can you explain why some of the gates run faster on quantum computers? Also, which quantum mechanic principle was abused in this case?
"
"['algorithm', 'grovers-algorithm']"," Title: Quantum search algorithm with exactly 2 solutionsBody: In Quantum Country's post on the quantum search algorithm, they lay out the search algorithm for the case where there is exactly one solution $| s \rangle$. The key steps are to start in the equal superposition state $|E \rangle$ and then apply a Grover iteration $\pi \sqrt N / 4$ times. The Grover iteration is to reflect about the $|s \rangle$ state and then reflect about the $|E \rangle$ state, resulting in a rotation of the current state $|\psi \rangle$ towards $|s \rangle$.
I am having trouble seeing what we would do differently in the case where we do not assume there is one exact solution. The post recommends starting with thinking about the case where there are exactly two solutions, $|s_1 \rangle$ and $|s_2 \rangle$. It seems to me the exact same algorithm and circuit for rotating around $|s \rangle$ would work. Instead of rotating towards one specific solution in the first step of the Grover iteration, we would rotate towards the plane generated by $|s_1 \rangle$ and $|s_2 \rangle$. But that is okay, since getting our state very close the plane generated by the two solutions would mean we can measure the state and get a solution with high probability.
Is there anything else we must modify in the algorithm for search to handle two possible solutions (or N possible solutions)?
For context, the rotation about $|s \rangle$ looks like this, where $C_s$ is an oracle that flips the working bit if $|x \rangle$ is a solution (image from QC):
"
"['quantum-gate', 'quantum-state', 'physical-qubit']"," Title: Calculating the state of the qubit when $\alpha$ and $\beta$ are givenBody: I am new to quantum computing. Can someone help me in calculating state of the qubit when $\alpha = \frac{3}{5}e^{i\pi/7}$ and $\beta = -\frac{4i}{5}$.
Thanks
"
"['qiskit', 'optimization']"," Title: Layout Method in qiskitBody: Using transpile with optimization_level = 3, which is the layout method used by default?
"
"['qiskit', 'programming', 'ibm-q-experience', 'ibm']"," Title: Trying to get a provider from IBMQ but get 'No provider matches the criteria.'Body: I have created a circuit and then run the following:
provider = IBMQ.get_provider('ibm-q')
And this is what I get:
IBMQProviderError Traceback (most recent call last)
<ipython-input-24-d651cdcd236d> in <module>
----> 1 provider = IBMQ.get_provider('ibm-q')
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\ibmqfactory.py in get_provider(self, hub, group, project)
352
353 if not providers:
--> 354 raise IBMQProviderError('No provider matches the criteria.')
355 if len(providers) > 1:
356 raise IBMQProviderError('More than one provider matches the criteria.')
IBMQProviderError: 'No provider matches the criteria.'
"
"['qiskit', 'qaoa']"," Title: Evaluated Standard deviation during QAOA/VQE optimization is always zero. Qiskit 0.19Body: I'm using qiskit 0.19.1, and I'm doing some simulation of QAOA, using the aqua class QAOA. I use a callback function in my program to see energy and std during optimization, but the evaluated standard deviation is always zero, at any step (This is clearly not true almost in the final state, that is a superposition of target Hamiltonian eigenstates).
I do not figure out why, because I used this code before the release 0.19 (apart of small changes because of new libraries that in principle shoud not affect the results) and it correctly gave me a non zero std.
Do any of you had the same problem or figure out why I have it?
Thanks!
"
"['quantum-gate', 'algorithm', 'bloch-sphere', 'pauli-gates']"," Title: Cannot interpret transformations on the bloch sphere as matrix multiplicationsBody: I understand that X,Y and Z gates are rotations around the axes with the respective letters, but I cannot understand how can Y gate multiply the amplitude of 0 with unreal number and have it landing on the bloch sphere, or how can S gate add a phase of 90 degrees.
"
"['quantum-gate', 'quantum-state', 'bloch-sphere']"," Title: Where is $i|0\rangle$ located on the bloch sphere?Body: I understand linear transformations on the plane but cannot understand the Bloch sphere. How can a three dimensional sphere be generated by two linearly dependent vecotrs (the basis states 0 and 1)?
"
"['mathematics', 'fidelity']"," Title: Joint Concavity of (Root) FidelityBody: I have some problem in understanding the proof of the concavity of root fidelity given in Chapter 9.2 of Mark M. Wilde's "Quantum Information Theory". Here, the fidelity is defined by $F(\rho, \sigma) = ||\sqrt{\rho}\sqrt{\sigma}||_1^2$ where $||\cdot ||_1$ is a Schatten 1-norm and $\rho$ and $\sigma$ are density matrices. The joint concavity of root fidelity is the following property:
\begin{equation*}
\sqrt{F}\left( \sum_x p_X(x)\rho_x,\, \sum_x p_X(x)\sigma_x \right) \geq \sum_x p_X(x) \sqrt{F}(\rho_x, \sigma_x)
\end{equation*}
where $p_X(x)$ is a probability distribution. The proof of the joint concavity is given as below in the book:
Proof. Let $|\phi^{\rho_x}\rangle_{RA}$ and $|\phi^{\sigma_x}\rangle_{RA}$ be the respective Uhlmann purifications of $\rho_x$ and $\sigma_x$, i.e, $F(\rho_x, \sigma_x) = |\langle \phi^{\rho_x}| \phi^{\sigma_x}\rangle_{RA}|^2$ where $R$ denotes the environment system.
Let $|x\rangle$ be the orthonormal basis of the system $X$. Then
\begin{gather*}
|\phi^{\rho}\rangle = \sum_x \sqrt{p_X(x)}|\phi^{\rho_x}\rangle_{RA} |x\rangle_X, & |\phi^{\sigma}\rangle = \sum_x \sqrt{p_X(x)}|\phi^{\sigma_x}\rangle_{RA} |x\rangle_X
\end{gather*}
are respective purifications of $\sum_x p_X(x)\rho_x$ and $\sum_x p_X(x)\sigma_x$. Then
\begin{align*}
\sqrt{F}\left( \sum_x p_X(x)\rho_x,\, \sum_x p_X(x)\sigma_x \right) & \geq |\langle\phi^{\rho}|\phi^{\sigma}\rangle| \\
& = \Bigg| \sum_x p_X(x) \langle\phi^{\rho_x}|\phi^{\sigma_x}\rangle \Bigg| \\
& \geq \sum_x p_X(x) \,|\langle\phi^{\rho_x}|\phi^{\sigma_x}\rangle|\\
& = \sum_x p_X(x) \sqrt{F}(\rho_x, \sigma_x)
\end{align*}
where the first inequality is due to Uhlmann's theorem.
I don't think that the second inequality holds in this proof. Which point am I missing? Is this proof correct? If not, how can I prove the joint concavity of root fidelity? I appreciate any help.
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: How can I find the most suitable IBMQ provider for my location?Body: I have been trying to run my code on IBM's quantum computers, so I used the following commands to associate a quantum computer to the component qcomp:
provider = IBMQ.get_provider('ibm-q')
qcomp = provider.get_backend('ibmq-16-melbourne')
But the queue is endless.
I live in Southern Europe.
"
['qiskit']," Title: How do I change the number of max_shots of Aer qasm_simulator in Qiskit running on my computer?Body: I want to do a circuit with more than 1 million shots. How do I change the number of max_shots of Aer qasm_simulator in Qiskit? When I run it, it said Number of shots specified: 1000001 exceeds max_shots property of the backend: 1000000.'. Can someone help me? Thanks!
"
"['quantum-state', 'bloch-sphere', 'state-space-geometry']"," Title: What is the intuition of the outer product of two states?Body: If it is possible give me an intuition both with vectors on the plane and on the Bloch-Sphere.
"
['q#']," Title: Inner product of states in Q#Body: I have a state $|x\rangle$ and I want to get the expected result when measuring observable $A$ (i.e. get the result of $\langle x| A | x \rangle$). In my case $A$ can be any of the Pauli gates. Does anyone know how to do this in Q#? There doesn't seem to be an inner product function in the libraries.
Thanks for the help!
"
['quantum-gate']," Title: How do I find the matrix and circuit equivalent to this transformation?Body: First I would like to find the matrix corresponding to the transformation and then implement it with rotational gates. How can I do it?
"
"['mathematics', 'matrix-representation']"," Title: Expressing a term of an $n$-qubit Hamiltonian in terms of Pauli operatorsBody: Consider a $2^n\times 2^n$ Hermitian matrix $M$ containing up to two non-zero elements, which are $1$ (so, either $M_{ii}=1$ for some $i$, or $M_{ij}=M_{ji} = 1$ for some $i$ and $j$). Each such matrix can be expressed a linear combination of Pauli operators. For example:
$$
\begin{pmatrix}
0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0
\end{pmatrix}
=
\frac{1}{2} (XX+YY)
\ ,\quad
\begin{pmatrix}
0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0
\end{pmatrix}
=
\frac{1}{4} (1 - Z_1 + Z_2 -Z_1 Z_2)
\ .
$$
What would be the general expression for such an expansion, for an arbitrary $n$ and $i,j=1\ldots2^n$?
CLARIFICATION
I'm looking for a solution different from the one which involves taking trace with all the possible Pauli operators. The problem with that solution is that it requires $O(4^n)$ operations, since this is the total number of Paulis on $n$ qubits.
The motivation for my question, of course, comes from expanding an arbitrary Hermitian $H$ in terms of Pauli operators. The number of parameters in such a matrix is $O(2^n)$, which sets the lower bound on the solution complexity — which, I believe, is possible to achieve. One way to do this would be to decompose $M$ from my question in $O(\operatorname{poly}(n)) $ steps. This would allow to expand $H$ in $O(2^n)$ instead of $O(4^n)$ steps, via expressing it in terms of Paulis entry by entry.
"
"['quantum-state', 'entanglement', 'bell-experiment', 'non-locality']"," Title: Why is the CHSH inequality defined with a minus sign?Body: CHSH inequality is defined in the following way. Let $Q, R, S, T$ be two outcomes $\{\pm 1\}$ measurements. The measurements are chosen in a certain way, but that is not our concern right now. We know that a state $|\psi\rangle$ would not admit to any hidden variable representation if it violates the following inequality:
$$
\langle\psi| (\langle QS \rangle + \langle RS \rangle + \langle RT \rangle - \langle QT \rangle)|\psi\rangle \le 2,
$$
where, $\langle . \rangle$ is defined as the expected value of those operators with respect to $|\psi \rangle$. My question is, why do we have a negative sign for $\langle QT \rangle$? Could we not have any other constant on the right and have all positive terms on the left? Why does it work?
"
"['quantum-gate', 'circuit-construction', 'classical-computing']"," Title: Classical computations from restricted quantum gatesBody: The CNOT gate together with phase shift gates for all possible angles are not universal for quantum computing.
Are they also not universal for classical (reversible) computing?
Is it possible to characterize the set of classical Boolean functions that can be obtained using this set of gates?
"
"['hamiltonian-simulation', 'pauli-gates']"," Title: How to build a circuit for simulation of a simple Hamiltonian?Body: Consider very simple Hamiltonian $\mathcal{H} = Z = \begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}$. It has eigenvalues 1 and -1 with coresponding eigenstates $|0\rangle$ and $|1\rangle$, respectively. Hence, a ground state is $|1\rangle$.
For Hamiltonian simulation we need to construct a gate $U(t) = \mathrm{e}^{-i\mathcal{H} t}$. For our $\mathcal{H}$, this gate is $U(t) = Rz(-2t)$ gate.
To simulate the Hamiltonian we apply gate $U(\Delta t)$ several times to get from state $|\psi_0\rangle$ to state $|\psi_t\rangle$ where number of steps (or application of the Hamiltonian) is $t/\Delta t$. This is called Trotter method.
Since our gate $U$ is $z$ rotation which is additive, i.e. $Rz(\alpha)Rz(\beta) = Rz(\alpha+\beta)$, we do not have to bother about steps $\Delta t$ and simply apply $Rz(-2t)$.
I tried to apply $Rz$ gate on some states generated by Hadamard gate and $Ry$ gate with different angle $\theta$ (to have states in different superpositions) and then measure the outcome. I would expect that measured state should be ground state of Hamiltonian. But this was not the case. Probably I am missing something.
So my question is how to build a circuit for finding the ground state of the Hamiltonian? I would appreciate if you could provide a circuit for finding ground state of $\mathcal{H}=Z$.
"
"['quantum-state', 'entanglement', 'mathematics', 'bell-basis']"," Title: What does the minus sign in the four bell states represent?Body: I am in grade 11, so answers as simple as possible. I understand that in quantum teleportation, the bell measurement must be made on the teleportee and the sender, and I understand that yields one of four possible bell states:
I have yet to understand the actual REASONING behind some of them. For example, the first one shown says 'Both Alice and Bob's qubits are the same.' I got that. The second one says 'Either Alice or Bob's qubit is 1.' I got that. But what are the other two? I don't understand analogies for them, or if the subtraction is significant.
Any help appreciated, preferably in the form of an analogy!
"
['entanglement']," Title: Is there a separable state that is furthest away from an entangled one?Body: I see a lot of Venn kind of diagrams to depict the distinction between separable and entangled mixed states. Like this one (apologize my poor "paint"ings):
$\hskip2.0in$
So there is an entangled state $\rho$. It is entangled because it is not inside the set of separable states. My question is inspired by the picture:
Is there a separable state that is furthest away from the entangled one?
I tried to indicate it in red, but can we calculate the separable state?
To be concrete: What is the separable state furthest away from a GHZ state:$(|00\cdots 0\rangle+|11\cdots 1\rangle)/\sqrt2$...
"
"['algorithm', 'hhl-algorithm']"," Title: In the rotation part of HHL algorithm, how do you decompose $R$ in terms of universal gates?Body: In this paper, there is a diagram explaining how HHL works, which I attached below:
My question is, for the rotation part, how do you write $R$ as a combination of universal set of gates without knowing the eigenvalues a priori? Or what is a generic way of writing $R$ without doing any classical pre-computation regarding the eigenvalues?
In most of the implementations that I found online, it is assumed that the eigenvalues are known, and then one can find the angles of rotation by calculating for each eigenvalue: $\theta_i = arccos(\frac{C}{\lambda_i})$. After that, one can append for the ancilla register multiple $R_y$ gates with the aforementioned angles of rotation as arguments.
Thanks in advance for the help!
"
"['quantum-state', 'partial-trace', 'trace-distance']"," Title: Does the trace distance between marginals bound the distance between the overall states?Body: If the quantum states of the subsystems of two systems are close (for example: in terms of trace distance), are the states of the larger systems also close, i.e., if
$$ ||\rho_A - \rho_{A^\prime}||\leq \epsilon$$ and $$ ||\rho_B - \rho_{B^\prime}||\leq \epsilon,$$
can we claim that $$ ||\rho_{AB} - \rho_{A^\prime B^\prime}||\leq \delta(\epsilon)$$?
Thanks in advance!
"
"['entanglement', 'teleportation']"," Title: Why can’t I use quantum teleportation to transmit data FTL 1/4 of the time?Body: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
Assume there is an entangled pair $(q_1, q_2)$ owned by Alice and Bob, respectively, and some qubit $q_0$ in state $\ket{\psi}$ that Alice wants to teleport. Let Alice perform all the necessary operations to teleport $q_0$, namely, $\text{CNOT}(q_0, q_1)$, $H(q_0)$ (I'm not sure if this is sufficient, or if Alice has to measure her two qubits to collapse their superposition and complete the teleportation, but this isn't relevant to the question. Assume she does measure them if it is necessary). Now the state of $q_2$ should equal $\ket{\psi}$, or be closely related to it through one of the bell states. Assume that Alice and Bob coordinated on what time Alice would complete the teleportation, so that Bob is aware the teleportation has occurred.
What is keeping Bob from assuming that $q_2$ is in some particular bell state, and measuring $q_2$? It would seem that would allow faster than light communication 25% of the time. In fact, Bob could even produce imperfect clones of $q_2$, and my understanding is that he could somehow account for the imperfection of these clones. These imperfect clones would then allow him to extract more information from the single teleportation, and, assuming he knows the sort of thing he’s looking for, could provide an even higher chance that he receives meaningful information out of this communication - even if no classical information is sent from Alice.
What prevents this from working?
Edit
According to Holevo's Theorem, one can only retrieve up to $n$ classical bits given $n$ qubits. However, as I understand it, this does not prevent one from storing $n$ classical bits into a single qubit, imperfectly cloning it $n - 1$ times, and thus retrieving $n$ classical bits out. Given this, we can send a single qubit through teleportation and the receiver gets an accurate message approximately 25% of the time (less than this of course, due to the error introduced by the imperfect cloning).
In regards to the user not knowing whether the information is correct and thus it being no use, consider the classical case of $n$ one-way radios. Only 25% of the radios send the correct message, on channel $x$, the rest send random noise. Say the message is a recorded English sentence of some substantial length (say 20 words). An observer of this message, flipping through the channels, would be able to tell with high certainty which of these radios is transmitting the correct message. How does this differ in the quantum case, such that we cannot apply the same logic?
"
"['quantum-gate', 'algorithm', 'models']"," Title: Screening procedure in an iterative qubit coupled cluster (iQCC) ansatzBody: The paper Iterative Qubit Coupled Cluster approach with efficient screening of generators describes a new screening procedure for generators of the QCC ansatz.
How does one get from defining the flip indices $F(\hat{T})$ of a Pauli term $\hat{P}$:
$$F(\hat{P}) = \{j: \hat{f} ∈\hat{P}\}$$
to the partitioning of the second-quantised Hamiltonian as:
$$\hat{H}=\sum_{k}\hat{S}_{k},$$
where
$$\hat{S}_{k}=\sum_{j}\hat{C}_{j}\hat{P}_{j}$$
groups the terms with the same flip indices?
$$F(\hat{P}_{i})=F(\hat{P}_{j}),\quad ∀(\hat{P}_{i},\hat{P}_{j}) ∈ \hat{S}_{k}$$
And how is it that Pauli words possessing the same flip indices introduce an equivalence relation on the set of Hamiltonian terms?
"
"['qiskit', 'noise', 'qaoa']"," Title: QAOA with Qiskit: Is the initial state affected by the noise model?Body: I'm doing a simulation of the QAOA algorithm with noise via the QAOA class of Qiskit 0.19.
Here's (part of) my code:
p=1
In_params=np.random.rand(2*p)*np.pi/2
optalg= SPSA(max_trials=1000)
backend = Aer.get_backend('qasm_simulator')
model_device= provider.get_backend('ibmq_16_melbourne')
device_prop = model_device.properties()
noisemodel= NoiseModel.from_backend(device_prop)
quantum_instance=QuantumInstance(backend, shots=1024, noise_model=noisemodel)
qaoa = QAOA(qubitOp, optalg, p, initial_point=In_params, callback= mycallback)
qaoa.expectation=PauliExpectation()
result = qaoa.run(quantum_instance)
I'm using the default initial state, that is $|+\rangle^{\otimes n}$, constructed automatically by QAOA using Hadamard gates. I'm using a noise model for the execution: is the initial state construction affected by noise also?
Thanks!
"
"['entanglement', 'measurement', 'superposition', 'bell-experiment']"," Title: What are the two measurements per box being done in the Bell Tests in the IBM Quantum Experience ""Entanglement and Bell tests"" SectionBody: I am confused as to what is being measured in the boxes in the example drawings shown on the Entanglement and Bell Tests section in the IBM Q Experience:
https://quantum-computing.ibm.com/docs/guide/mult-entang/entanglement-and-bell-tests
My understanding is that the $(|00 \rangle + |11 \rangle)/ \sqrt{2}$ represents a superposition of two states, $|00 \rangle$ and $|11 \rangle$. And that $|00 \rangle$ is a two qubit entangled state. If Alice measures one of the qubits to be a $0$, the other qubit must be a $0$ as well due to the entanglement. The same is true if Alice measures a $1$.
My question comes from not understanding why $A$ and $A'$ are present in the box. What are they measuring? Is $A$ measuring one qubit while $A'$ is measuring the second qubit? Or is $A$ measuring one qubit while $A'$ measures the same qubit. Same questions for box $B$.
MY BACKGROUND: I am working through the IBM Q Experience. I have some exposure to QM through College level Physical Chemistry. I have a basic understanding of linear algebra, superposition, and entanglement.
"
"['quantum-state', 'entanglement']"," Title: Why does the entangled pair need to be entangled to perform teleportation?Body: Why does the entangled pair (the mechanism of teleportation) need to entangle to start with in order for the teleportation to proceed? After you perform the Bell measurement, doesn't it just break the entanglement anyway?
"
"['quantum-gate', 'circuit-construction']"," Title: Simplification of ""rotation swapping"" circuitBody: While trying to simplify a certain 2-qubit quantum circuit, I managed to get it down to this:
But by inspecting the corresponding two-qubit unitary directly, I can come up with the arguably simpler:
where the rotation operator ""moved"" to the first qubit.
I am using the convention
$
R_{\theta} := R_y(2\theta) =
\begin{pmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{pmatrix}
$.
The rotation $R_{\pi/4}$ is thus $=XH$.
How can I show that the two circuits are equivalent by ""elementary"" circuit identities, instead of just verifying that they amount to the same unitary? I tried many different simplifications without success.
"
"['shors-algorithm', 'modular-exponentiation']"," Title: Building the period-finding circuit for Shor's Algorithm & the classical complexity of finding the periodBody: I've been trying to learn about Shor's algorithm by writing out implementations of the circuit for modular exponentiation, ${ a }^{ x }\; ({ mod }\; N)$, to find the period $r$ for small numbers such as:
$(N=15,\quad a=11)\quad \longrightarrow \quad r=2$,
$(N=35,\quad a=13)\quad \longrightarrow \quad r=4$,
$(N=21,\quad a=5)\quad \longrightarrow \quad r=6$.
I know these are incredibly small numbers, but I realised that in order to actually start building the cicuit at all (using the binary exponentiation method), I needed to calculate the values of ${ a }^{ { 2 }^{ k } }\; ({ mod }\; N)$ for all $0\;\le\;k \; <\; 2\; \lceil { \log _{ 2 }{ N } }\rceil $, which pretty much immediately made the values of $r$ obvious before I'd even started building the circuit.
For example, take the least trivial case from the above, where $r=6$. I needed to calculate:
${ 5 }^{ 0 }\; ({ mod }\; 21)=1$,
${ 5 }^{ 1 }\; ({ mod }\; 21)=5$,
${ 5 }^{ 2 }\; ({ mod }\; 21)=4$,
${ 5 }^{ 4 }\; ({ mod }\; 21)=16$,
${ 5 }^{ 8 }\; ({ mod }\; 21)=4$,
${ 5 }^{ 16 }\; ({ mod }\; 21)=16$.
Simply by inspection, I can already see what the value of $r$ must be, because the result is the same when $x$ increases by six or twelve, but not after increasing by two or three.
I therefore have two questions:
- Is calculating these modular exponentials of $a$ to powers of two required when building these circuits, or is there some way of not even having to do that?
- If we do need to calculate these values, can we not find the period $r$ of this modular exponentiation function classically in an efficient way, starting with these values and then using a method analogous to 'interval halving', or an I being misled by using small numbers? [SEE EDIT]
Thanks in advance!
EDIT: As Mark S points out, the results of modular exponentiation have very little structure, and so although perhaps faster than $O(N)$, such an 'interval halving' method would not have logarithmic complexity, thus would be slower than Shor's algorithm for large enough $N$.
"
"['mathematics', 'superposition']"," Title: Are superpositions of an infinite number of states realizable?Body: I first encounted this idea in Constructing finite dimensional codes with optical continuous variables where it mentions ""superpositions of an infinite number of infinitely squeezed states"" in the introduction.
I was able to find this question which states in regards to free fermions that:
you can argue that the wavefunctions are superpositions of an infinite number of space ""basis states""
I was also able to find references to the idea in Quantum Cosmology And Baby Universes where it is stated:
One can therefore regard the singular $K$ eigenstates as being superpostions of an infinite number of regular harmonic oscillator solutions.
Additionally, in this paper (PDF) on Quantum Theory of the Electric Field in the Coherent States section (page 6) it states:
Coherent states are superpositions of an infinite number of Fock states
Are objects that are in a superpostion of an infinite number of states used in practice or is it strictly a theoretical and/or mathematical concept?
Related:
"
"['quantum-state', 'entanglement', 'measurement', 'superposition']"," Title: Which entangled qubit is measured in this example?Body: Sorry, I am a newbie to quantum computing.
I am reading an overview paper (released just a week ago) titled Advances in Quantum Deep Learning: An Overview (Garg & Ramakrishnan, 2020). I am stuck on the following example from paper (shown in screenshot below).
I understand that one of the qubits was measured and it returned a value of $0$. Therefore, the state of entangled two-qubit quantum system has been updated as following:
$|\psi'\rangle = \frac{1}{\sqrt{2}} |00\rangle + \frac{1}{\sqrt{2}} |01\rangle.$
But in the initial state,
$|\psi\rangle = \frac{1}{\sqrt{3}} |00\rangle + \frac{1}{\sqrt{3}} |01\rangle + \frac{1}{\sqrt{6}} |10\rangle + \frac{1}{\sqrt{6}} |11\rangle$
the superposition state $\frac{1}{\sqrt{3}} |00\rangle + \frac{1}{\sqrt{3}} |01\rangle$ has the probability $\frac{2}{3}$ which according to the statement in paper has been measured to be $0$. Then why the updated state of quantum system is
$|\psi'\rangle = \frac{1}{\sqrt{2}} |00\rangle + \frac{1}{\sqrt{2}} |01\rangle$
which yielded $0$ instead of
$|\psi'\rangle = \frac{1}{\sqrt{2}} |10\rangle + \frac{1}{\sqrt{2}} |11\rangle$
which instead has the probability $\frac{1}{3}$ when it was not measured?
"
['qiskit']," Title: Implementing controlled $\frac{\pi}{2}$ y and z rotation in QiskitBody: I'm trying to implement a controlled $\frac{\pi}{2}$ rotation along y axis and z axis (two individual gates) in Qiskit but I'm stuck. My thought was calculating the square root of the y and z pauli matrices (done), and implement using the CU3 gate. However, I wasn't able to find the correct parameters ($\theta, \phi, \lambda$) for the matrices I got. Is there a workaround for this? Thanks in advance.
Edit: I know if I remove the overall phase of $\sqrt{Y}$ then I can get the correct parameters, but I think since this is not an overall phase of all qubit so if I remove the phase I'll get a different gate?
"
"['qiskit', 'programming', 'ibm-q-experience', 'grovers-algorithm', 'oracles']"," Title: How to write decent code for oracle in Qiskit without custom circuit or long truth table?Body: I am now practising using Qiskit. The example of Grover's algorithm in tutorials suggests using logical expression, truth table or circuit to construct the oracle. In most textbooks on quantum computation as far as I have read, they use a function $f$ mapping to 0 or 1 during constructing the oracle. So I want to know if there is any beautiful way to do this with Qiskit. For instance, to find 4 in the array of (3, 4, 5, 6, 8, 2, 7, 1), how to use some $f$ like returning 1 if matched, otherwise 0, to construct the oracle? I know I can obtain a truth table 01000000, but if it's too long to compute, how to use an $f$ directly, without calculating the truth table outside the part of quantum computation?
More generally, if elements in the array to search are obtained in iterations (e.g. in one iterate, I obtain one element $x_i$, which is sum of something else like $\sum_j y_j$), should I complete these iterations before doing Grover's algorithm? Or is it feasible to embed the iterations into quantum computation so that I do not need to traversal all the iterations?
In addition, I use the tutorial from https://github.com/Qiskit/qiskit-community-tutorials/blob/master/optimization/grover.ipynb
"
"['qiskit', 'error-correction', 'error-mitigation']"," Title: Specifying qubits to achieve measurement error mitigation on QiskitBody: I'm learning how to do error mitigation on Qiskit as my experiment result differs from the simulated result. I read the tutorial here, but I have some questions about it. If I have understood it correctly, we take each basis states and measure them, to find the mitigation matrix, then execute my experiment, obtain the result, then recover the correct result using the mitigation matrix. That means I have to execute two experiment. However, how do I ensure that the qubits that I use to find the mitigation matrix is the same as the qubits that I do my actual experiment?
For example, let's say I want to execute an experiment with 3 qubits. I first run a code like the one in the tutorial. The compiler (or whatever compiles my code into instructions) uses qubit A, B and C. Then, when I execute my actual experiment, the compiler may use qubit D, E and F. As the qubits are different, then I think the mitigation will not be valid? Am I correct? if so, then how do we solve this? Obviously we have to use the same backend but I think that is achievable, but I found no way to specify which qubits to use.
Thank you in advance!
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: How to format a qiskit circuit to only have a high level abstraction?Body: Consider the following situation, we import a 3-bit Toffoli gate as follows:
from qiskit.aqua.circuits.gates.multi_control_toffoli_gate import _cccx
I further define a Quantum Register of size 4 and a circuit containing it:
qr = QuantumRegister(4, 'q')
circuit = QuantumCircuit(qr)
I form a small circuit by applying Hadamard on the last qubit followed by _cccx:
circuit.h(3)
circuit.barrier()
_cccx(circuit, q)
circuit.barrier()
circuit.draw(output=""mpl"")
The output of the following code is as follows:
As we can see that the underlying logic of _cccx is shown which makes the circuit too big, is there any way to display a higher-level abstraction which would consume less space and simply conceal the underlying gate logic?
Edit: This question is not limited to $n$-bit Toffoli gate but to any circuit which may even be defined by user.
"
"['programming', 'ibm-q-experience']"," Title: Do I have to upgrade to personal computer or laptop computer in order to be able to use the IBM Quantum Experience website or run code locally?Body: I currently have a tablet I don't have a desktop or laptop to access the IBM Quantum Experience.
Do I have to upgrade to personal computer or laptop computer in order to be able to use the website or run code locally?
"
"['quantum-gate', 'circuit-construction']"," Title: Hadamard + Hadamard + Ry: Results in the IBM Q Experience don't match the matrix resultsBody: I'm new to the IBM Q Experience. In the Composer, I built a circuit consisting of two Hadamard Gates and an Ry:
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[5];
creg c[5];
h q[0];
h q[0];
ry(pi/2) q[0];
measure q[0] -> c[0];
The results returned are 50/50 probability. However, when I apply the matrices in a spreadsheet, I get a $\frac{28}{72}$ result. (See image below.) For the Hadamard matrices, I'm using one divided by the square root of two for the corresponding a, b, and c elements and minus one divided by the square root of two for the d element. For the Ry matrix elements a,b c, and d, I have $\cos\big(\frac{pi/2}{2}\big)$, $-\sin\big(\frac{pi/2}{2}\big)$, $\sin\big(\frac{pi/2}{2}\big)$ and $\cos\big(\frac{pi/2}{2}\big)$, where $\pi=180^{\text{o}}$. The output squared in the spreadsheet gives me 28/72 probability. I hate to be a pest with such a low level question, but where in the matrices am I going wrong?
For $\pi$ I used 3.14 instead of 180 degrees, and it came out 50/50.
"
"['qiskit', 'vqe', 'initialization']"," Title: VQE restart from a previous computationBody: I'm running VQE algorithm on ibmq-qasm-simulator.
I'm trying to implement a restart mechanism in order to be able to start a new computation from the result of a previous one.
To do so I've tried to set VQE' s initial_point parameter to result['optimal_point'], where result is the return value of vqe.run(quinstance) of the previous computation.
The code has worked for a very small graph (4 nodes, 4 edges), anyway it continues to fail for little bigger graphs (5 and 6 nodes). It doesn't converge to a minimum energy state but continues to oscillate.
Is this the correct way to implement a restart?
Thanks
"
"['programming', 'hamiltonian-simulation', 'q#']"," Title: Creating Hamiltonian Simulation Operator in Q#Body: I am trying to create a unitary operator $U = \sum^{T - 1}_{k=0}$ $|k\rangle$ $\langle k |$ $ \otimes$ $e^{i A k}$ in Q#, where A is a Hermitian matrix. For the beginning, I just want A to be a combination of 2 Pauli matrices, say $A = X + 2Z$. This is the code that I have, where input is of type Qubit[3] and register of Qubit[2]:
...
let SIZE_OF_MATRIX = 2;
let unitaryGenerator = (2 ^ SIZE_OF_MATRIX, ConstructU);
let registerLE = LittleEndian(register);
MultiplexOperationsFromGenerator(unitaryGenerator, registerLE, input);
...
function ConstructU (j : Int) : (Qubit[] => Unit is Adj + Ctl) {
let generatorSystem = GeneratorSystem(2, MapToGeneratorIndex);
let evolutionGenerator = EvolutionGenerator(PauliEvolutionSet(), generatorSystem);
let unitaryOperator = TrotterStep(evolutionGenerator, 1, - IntAsDouble(j));
return unitaryOperator;
}
// The purpose of this function is to map each part of the Hamiltonian generator
// to a generator index.
// Initially, we want to test the matrix A = X + 2Z.
function MapToGeneratorIndex (index : Int) : GeneratorIndex {
// We only have 2 terms, hence index can only be 0 or 1
if (index == 0) {
// Here we just want X
return GeneratorIndex(([1], [1.0]), [0]);
}
elif (index == 1) {
// Here we want 2Z
return GeneratorIndex(([3], [2.0]), [0]);
}
// TODO: throw an error
return GeneratorIndex( ([1000], [1000.0]), [0]);
}
Does anyone know what am I doing incorrectly? I am not getting the result that I am expecting.
I know the code is messy but I am just trying to make it work for a basic 2x2 matrix first.
Thanks for the help!
"
"['qiskit', 'programming', 'vqe']"," Title: Creating a custom VariationalForm in QiskitBody: I would like to use the built-in Qiskit VQE() function, with my own variational form. What is the proper way to define it? I was expecting var_form to be simply a function returning an object of type QuantumCircuit for a particular set of parameters (that's how it's done in Pyquil).
More precisely: how do I manually create an instance of the VariationalForm class which would correspond to preparing the desired program for a given set of parameters?
So far my understanding is that I have to do smth like that:
class my_var_form(VariationalForm):
def construct_circuit(self,
parameters: Union[List[float], np.ndarray],
q: Optional[QuantumRegister] = None) -> NoReturn:
circuit = QuantumCircuit(q)
...
return circuit
Is this the proper way to do things?
CLARIFICATION
Let us define a function which would generate a Qiskit circuit for an arbitrary parameter of type float:
def black_box( param : float ):
qc = qskt.QuantumCircuit( 1 )
qc.u1( np.sqrt( param ), 0 )
return qc
np.sqrt() was chosen as a toy example, one could equally well replace it with any fucntion defined on floats. To make sure that the function makes sense, one can do this:
job = execute( black_box( 1. ), get_backend('qasm_simulator') ) # Works fine
Now, let us try to define a VariationalForm which will use our black_box function:
class my_var_form( VariationalForm ):
def __init__(self, numpar, numq, bnds) -> None:
super().__init__()
self._num_parameters = numpar
self._num_qubits = numq
self._bounds = bnds
pass
def construct_circuit(self,
parameters: Union[List[float], np.ndarray],
q: Optional[qskt.QuantumRegister] = None) -> NoReturn:
circuit = black_box( parameters[0] )
return circuit
However, the following code fails to work:
var_form_instance = my_var_form( 1, 1, [[-2., 2]] )
vqe = VQE( WeightedPauliOperator( [1., Pauli([0.],[0.])] ),
var_form_instance,
L_BFGS_B(),
np.array([0])
)
With the following error:
TypeError: loop of ufunc does not support argument 0 of type Parameter which has no callable sqrt method
The problem is that Qiskit no matter what wants to use its built-in Parameter class which is based on the sympy package.
How can I overcome this issue? Or is there absolutely no way I could use the built-in VQE function without dealing with Parameter class?
My question arises from the fact that I use an external library to generate circuits which I then convert to Qiskit format. Thus, I have a function which returns a Qiskit circuit for a set of real parameters. I would like the Qiskit VQE() function to use my own black_box() function for generating the quantum circuit on each step of the minimization.
(Alternatively, I could just not use VQE() at all, and simply run the classical minimizer myself, only using Qiskit for evaluating the expectation value of the Hamiltonian on each step... but apparently there's no built-in function for calculating the expectation value neither of a Pauli string, nor even of individual Pauli operators! See my question here: to my understanding SnapshotExpectationValue() is an unphysical method, and does not allow one to calculate expectation values of Pauli strings using sampling on real devices.)
"
"['qiskit', 'ibm-q-experience']"," Title: ibmq_qasm_simulator from IBMQ provider and qasm_simulator from Aer provider gives different resultsBody: I'm running an experiment first on qasm_simulator backend from Aer provider and the most frequent result is the correct one with the minimal energy value. Then I'm running the same experiment with the same configuration and parameter set on ibmq_qasm_simulator backend from IBMQ provider and got different results (don't reach minimal energy value). What is the reason for this behavior?
"
"['algorithm', 'grovers-algorithm', 'complexity-theory']"," Title: Question about the Grover-Sysoev algorithmBody: We consider a quantum circuit that takes as input two vectors $\vert x \rangle$ and $\vert y \rangle$. The output of this quantum circuit must contain the reflected vector of $\vert y \rangle$ with respect to $\vert x \rangle$ (and whatever else that is irrelevant to the purpose ).
It can be proved that this operator is nonlinear in the first argument, and in general is not unitary. So no chances of implementing this operator with a quantum circuit, in complete generality.
However, In the reference linked in my question Programmable quantum gate arrays it is proved that a deterministic programmable gate array must have as many Hilbert dimensions in the program register as programs are implemented (consequence of the orthogonality requirement of the program states). If each program is given as input on n qubits, then n programs would require the array to have $n^2$ qubits in the program register, but in principle possible. In our case $\vert x \rangle$ is the program, the reflection axis. So we can implement all the operators $U_{\xi_k}$ described below for $k=1.2.3......n$
And that means that these operators allow an implementation (with one quantum circuit with $n^2$ input ""program"" qubits ) as long as the program states are orthogonal (as explained above ).
And that means that the Grover-Sysoev algorithm can be implemented. This consists in the following $n$ steps:
$$|\xi_1\rangle = U_s U_\omega |s\rangle,
\quad
\vert \xi_2 \rangle = U_{\xi_1} U_\omega \vert s \rangle,
\quad
\cdots
\quad
\vert \xi_n \rangle = U_{\xi_{n-1}} U_\omega \vert s \rangle,
$$
where $U_\omega\equiv I - 2 (\vert\omega\rangle\langle\omega \vert )$
and
$U_s \equiv 2\vert s \rangle \langle s \vert - I$.
This algorithm finds a solution exponentially faster than Grover's. In other words, for a fixed large $n$ we can actually build this complex quantum circuit that would solve problems of practical interest efficiently.
The difference between this and the original Grover algorithm is that we perform an inversion about the previous state vector of the algorithm, rather than about the mean, at each step.
Note that the optimality proof in Grover 's original paper doesn't include operators with ""program"" registers as input.
Question 1. Is this algorithm possible to implement, in principle?
Question 2. Is this algorithm exponentially faster that Grover, for a fixed, chosen n?
The way ""exponentially faster"" is defined implies considering arbitrarily large values of n, but the meaning of this question is clear from the context.
My calculations indicate that both questions allow ""yes"" answers, but I could be wrong.
Another related question I asked previously can be found here.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to reduce unnecessary waiting time when using IBM's backend?Body: I'm working with a program, which needs iterations of quantum computation like this
def quantum(n):
Grover(oracle).run(QuantumInstance(...))
#n is input size associated with oracle,
#and some other components are omitted.
for n in range(0,10):
start = time.time()
quantum(n)
end = time.time()
Now I have to wait for hours to run this on the 16-qubit quantum computer. So is there any way to pack all computation into one round?
"
"['quantum-state', 'quantum-operation', 'textbook-and-exercises']"," Title: How to compute the tensor product of the depolarizing channel with the identity?Body: Consider two quantum systems A and B, B goes through a depolarizing noise channel, while A is not changed, i.e., they go through the channel $\mathbb{I}_A \otimes \mathcal{E_{\text{depol}}} $. If the input is a density operator $\rho_{AB}$, is it correct that the output is $p \rho_A \otimes \mathbb{I}/2 + (1-p) \rho_{AB}$? How can this be generalized?
Thanks in advance!
"
"['qiskit', 'error-correction', 'error-mitigation']"," Title: Real-device error mitigation with qiskitBody: I'm trying to do error mitigation in IBM-Q quantum computers with qiskit. I followed the tutorial here. My thought was that in order to make sure that I'm correcting the qubits that I'm actually using in my circuits, I should specify the backend and qubits to make sure that the qubits used in my actual circuit and obtaining the correcting matrix are the same. I asked this question and followed along, but I have encountered some problems. Here is the part that is causing problem:
qreg = qk.QuantumRegister(7)
layout = {qreg[0]: 12,
qreg[1]: 11,
qreg[2]: 13,
qreg[3]: 17,
qreg[4]: 14,
qreg[5]: 12,
qreg[6]: 6}
########## error mitigation ##########
meas_calibs, state_labels = complete_meas_cal(
qubit_list=[0, 1, 2], qr=qreg, circlabel='mcal')
print(meas_calibs[0])
# This line below is causing error if I add ""initial_layout"" in both qk.compiler.transpile and qk.execute
qk.compiler.transpile(meas_calibs, backend=_backend, initial_layout=layout)
I receive the error
qiskit.dagcircuit.exceptions.DAGCircuitError: 'not a DAG'
whenever I specify the layout. I googled about this error but found nothing. So my question is, what does this error mean? What have I done wrong and how can I fix it?
Thank you in advance.
"
['error-correction']," Title: How does the unitary encoding procedure in quantum secret sharing schemes or error correcting codes work?Body: In Cleve et al.'s paper ""How to share a quantum secret"", two encodings of quantum states are mentioned. The first one encodes one qutrit into three qutrits,
$\alpha|0\rangle + \beta|1\rangle + \gamma|2\rangle \mapsto \\ \alpha(|000\rangle + |111\rangle + |222\rangle) \\ + \beta(|012\rangle + |120\rangle + |201\rangle) \\ + \gamma(|021\rangle + |102\rangle + |210\rangle).$
The second encoding is in fact a quantum error-correcting code and encodes one qubit into four qubits,
$\alpha|0\rangle + \beta|1\rangle \mapsto
\alpha(|0000\rangle + |1111\rangle) + \beta(|0011\rangle + |1100\rangle)$.
Such succinct ways of encoding pure quantum states can often be found in the literature of quantum error correction. I am wondering how the above encodings can be implemented unitarily and if there are any general results that these brief descriptions draw on that I am missing here.
"
"['algorithm', 'simulation', 'hamiltonian-simulation']"," Title: What are the biggest obstacles currently preventing us from solving real world problems defined in terms of quantum simulation?Body: Quantum simulation (also referred to as Hamiltonian simulation) is defined as follows:
In the Hamiltonian simulation problem, 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.
One of possible applications of quantum simulation is of course simulation of quantum systems, but I'm sure, that there are many others possible. I've read about some possible approaches to this problem (like Trotterization), but I haven't come accros any practical solutions obtained thanks to these methods (probably because of my laziness :) ).
My question is - what is preventing us from solving real world problems, defined in terms of Hamiltonian simulation, on currently available quantum computers? Is this just the number of qubits available? Or maybe, it would be at least theoretically possible to create some hybrid solutions, by inventing new algorithms operating on currently available architectures, to get some results that are beyond the reach of classical algorithms?
"
"['qiskit', 'programming']"," Title: Evaluating expectation values of operators in QiskitBody: I'm wondering how in Qiskit one can calculate the expectation value of an operator given as a WeightedPauli (or, at least, of a single Pauli operator...) in a certain state (given as a QuantumCircuit object — meaning that the actual state is the result of the action of this circuit on the computational basis state). I would like the inputs of such a procedure to be floats, not Parameters (it is an essential requirement — I'm using an external library to form the circuit for each set of parameters, and then converting it gate-by-gate to Qiskit format).
This would be useful if, say, we wanted to manually implement VQE, and for that needed a function calculating the expectation value of the Hamiltonian on a quantum computer. More importantly, we would need this for implementing generalizations of VQE, such as subspace search.
I guess, PauliBasisChange may be involved...
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'mathematics', 'nielsen-and-chuang']"," Title: Correct Formulation of N&C Exercise 4.11 and other textbooks misquotingBody: Inspired by the comments in this question How to approximate $Rx$, $Ry$ and $Rz$ gates?, there is the errata for question 4.11 pg 176 in N&C. The original form states that for any non parallel $m$ and $n$, then for an arbitrary $U$:
$U = e^{i\alpha}R_n(\beta)R_m(\gamma)R_n(\delta)$, for appropriate $\alpha,\beta, \gamma, \delta$
The errata, http://www.michaelnielsen.org/qcqi/errata/errata/errata.html, corrects this s.t.
$U = e^{i\alpha}R_n(\beta_1)R_m(\gamma_1)R_n(\beta_2)R_m(\gamma_2)\dots$.
However I found that other textbooks such as Kayes and Mosca (pg. 66, thm 4.2.2), and various online material still quotes the original form of the theorem. As such I am wondering is the errata correct, and is just that all the other material has 'incorrectly' quoted the result from N&C?
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'teleportation']"," Title: In Qiskit quantum teleportation protocol, why they use CZ and CX gate at the end?Body:
I understand the simple quantum teleportation protocol and why it uses X and Z gate at the end of the circuit.
I was researching about the Qiskit and I came across this video
https://www.youtube.com/watch?v=mMwovHK2NrE
which uses the following algorithm for quantum teleportation.
I don't understand why they use CX and CZ gate with qubits $q_0$ and $q_1$ as controls and qubit $q_2$ as the target at the end.
Please try to explain why they're using CZ and CX gate at the end of the circuit.
"
"['quantum-gate', 'grovers-algorithm', 'quirk']"," Title: Question about Grover algorithm implementation in the Quirk simulatorBody: I want to implement the Grover iteration instead of the multi-control qubit implemented as in this picture:
I want to implement them like in this example of five qubits:
I mean how can I decompose them in the circuit (picture1)?
This is my attempt but I failed to get the amplitude increases for the state |1111> (after measuring the wires 1,2,3 and 6)
If you could do it in the Quirk simulator, that will be too helpful.
"
"['ibm-q-experience', 'physical-realization', 'quantum-inspire']"," Title: Is it possible to build a quantum processor with connections among all qubits?Body: Current quantum processors have constrained connectivity among qubits. For example Starmon-5 processor by Quantum Inspire has only one qubit connected to others, effectively it looks like a star. The situation is similar in case of IBM Q processors (the most obvious case is 15 qubits Melbourne processor).
I understand that connectivity among qubits is constrained by used technology. In case of semiconductor processors, probably the fact that structures are planar is the biggest obstacle. To tackle this, it would be perhaps needed to have three dimensional structures. Moreover, it seems that having full connectivity would increase a noise in NISQ processors.
My question: Is there any proposal how to build a quantum processor with full connectivity?
"
"['mathematics', 'teleportation']"," Title: Rearrangement of qubits in Quantum Teleportation ProtocolBody: I have been reading Quantum Teleportation (Pg. 27) from Nielsen and Chuang and noticed that after the Hadamard operation, the state obtained was re-written by regrouping the terms to obtain the following states:
This state may be re-written in the following way, simply by
regrouping terms:
$$\begin{align}
|\phi_2\rangle=\frac{1}{2}\big[|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-\beta|0\rangle)\big]\end{align}$$
but I am uncomfortable by this regrouping. Mathematical regrouping doesn't mean the qubits themselves get regrouped right? Moreover, how do we know that Alice is not measuring the unknown state (state to be teleported) after she measures her part of the EPR pair?
"
"['programming', 'q#', 'tensor-product']"," Title: Tensor Product in Q#Body: Does anyone know how you can obtain a new state |z> from two pre-existing states |x> and |y> using the Tensor product in Q#? i.e. |z> = |x> ⊗|y> ?
Thanks in advance for the help!
Edit: for clarity, the states that I am working with are
$|x\rangle = \frac{1}{\sqrt{2}} \sum^{3}_{j=0} \sin \frac{\pi (j + 0.5)}{4} |j\rangle$
$|y\rangle = \sum^{1}_{i=0} b_i |i\rangle$
where the $b_i$'s are just real numbers.
"
"['mathematics', 'fidelity']"," Title: Why does the state fidelity satisfy $\operatorname{tr}|\sqrt{\rho}\sqrt{\sigma}|=\operatorname{tr}\sqrt{\sigma^{1/2}\rho\sigma^{1/2}}$?Body: Given the the two states $\rho$ and $\sigma$ of a quantum system, with $|\psi\rangle$ and $|\varphi\rangle$ as their purification respectively, the fidelity is defined as:
$$F(\rho,\sigma)=\max_{|\psi\rangle,|\varphi\rangle}|\langle\psi|\varphi\rangle|$$
During the derivation of the expresssion, $|\langle\psi|\varphi\rangle|$ follows this inequality:
$$ |\langle\psi|\varphi\rangle|\leq tr|\sqrt{\rho}\sqrt{\sigma}|=tr\sqrt{\rho^{\frac{1}{2}}\sigma\rho^{\frac{1}{2}}}$$
My workings for $tr|\sqrt{\rho}\sqrt{\sigma}|$ is as follows:
$$tr|\sqrt{\rho}\sqrt{\sigma}|=tr\sqrt{(\sqrt{\rho}\sqrt{\sigma})^\dagger(\sqrt{\rho}\sqrt{\sigma})}$$
$$=tr\sqrt{(\sqrt{\sigma}\sqrt{\rho})(\sqrt{\rho}\sqrt{\sigma})}$$
$$=tr\sqrt{\sigma^{\frac{1}{2}}\rho\sigma^{\frac{1}{2}}} $$
Why do I get an expression that is different from the definition?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to get running time for each circuit executed on IBM's quantum processors in one round?Body: I want to execute multiple circuits in one round on IBM's backends, especially the 16-qubit one, to save time. For instance, execute([grover_1, grover_2, grover_3], backend).
However, I found result given by that quantum processor contain only one overall time like this:
{'backend_version': '2.1.0', 'backend_name': 'ibmq_16_melbourne', 'results': [{'header': ..., 'success': True, 'shots': 1024, 'meas_level': 2, 'data': {'counts': {}}, 'memory': False}],}, {'header': ..., 'success': True, 'shots': 1024, 'meas_level': 2, 'data': {'counts': {}}, 'memory': False}], 'qobj_id': ..., 'status': 'Successful completion', 'date': '...', 'header': {'backend_version': '2.1.0', 'backend_name': 'ibmq_16_melbourne'}, 'success': True, 'job_id': '...', 'execution_id': '...', 'time_taken': 7.73473865282683}
while simulators can provide time counted for each circuit in the result of one instance like:
{'date': '...', 'results': [{'shots': 1024, 'header': ..., 'data': {}, 'success': True, 'status': 'DONE', 'time_taken': 0.00136636000000000003, ...}, {'shots': 1024, 'header': ..., 'data': {}, 'success': True, 'status': 'DONE', 'time_taken': 0.00263673800000000008, ...}], 'header': {'backend_version': '0.1.547', 'backend_name': 'ibmq_qasm_simulator'}, 'backend_version': '0.4.1', 'job_id': '...', 'success': True, 'status': 'COMPLETED', 'qobj_id': '...', 'backend_name': 'ibmq_qasm_simulator', 'time_taken': 0.00438376, 'metadata': {..., 'time_taken': 0.00438376}}.
So anyone knows why and how to deal with the issue of counting time for each circuit executed on quantum processors without iteration which takes too much waiting time?
Or alternatively, how to make circuits executed in distinct instances queued sequentially, instead of queueing one after finishing the previous one, if I can only do something like:
for n in range(1,10):
start = time.time()
quantumAlgorithm(n)
end = time.time()
"
"['quantum-state', 'entanglement', 'teleportation']"," Title: How does quantum teleportation relate to quantum encryption?Body: I am in grade 11 and am trying to work on a project, but I find this question a little confusing. I am trying to talk about the implications of quantum teleportation, specifically quantum encryption but I have not found a good source to help me understand how they are related. Also, if you have any other cool implications of quantum teleportation please share! Thanks.
"
['quantum-operation']," Title: Physical Interpretation of Non-Trace Preserving Quantum OperationsBody: In Chapter 8 of Nielsen and Chuang's Quantum Computation and Quantum Information, a mathematical framework is developed to describe the dynamics of open quantum systems.
Suppose the initial state of principal system is $\rho$ and the initial state of the environment is $\rho_{env}$. Let the principal-system-environment system start out in the product state $\rho \otimes \rho_{env}$. Let's say after some unitary evolution $U$, we want to extract the ""evolved"" state of the principal system. We do this by tracing over the environment i.e. averaging over the states of environment as shown below
$$\mathcal{E}(\rho) = tr_{env}(U(\rho \otimes \rho_{env})U^{\dagger})$$
Let ${|e_k\rangle}$ be some orthonormal basis of the state space of the environment and $\rho_{env} = |e_0\rangle\langle e_0|$. Then we have
Now in the text, it is said that $tr(\mathcal{E}(p))$ can be less than 1 or $\sum_k E_kE^{\dagger}_k <I$. But how can this be true? Is the basis ${|e_k\rangle}$ not complete?
In the text, non-trace preserving that follow the above properties are said to ""not provide a complete description of the process that may occur in the system"". An example is used to illustrate this :
Granted $\mathcal{E}_0(\rho)$ and $\mathcal{E}_1(\rho)$ don't provide full description of the system but that is only because the basis for these operations are not complete. So are non trace preserving quantum operations those that don't account for a complete orthonormal basis of environment? If not, is there a better example or physical intuition of understanding this ""non trace preserving"" property?
"
['density-matrix']," Title: What does it mean geometrically (in terms of vectors in the Bloch sphere) if the commutator of two density matrices $ρ_1$ and $ρ_2$ vanishes?Body: When the commutator of two operators vanishes then we can measure one without affecting the other. I'm not sure how this translates in the case of density matrices.
If the density matrices are representing pure states then the density matrices would represent projection operators onto the subspace spanned by the given state. So I think a vanishing commutator on two density matrices could mean that either the subspace spanned by the two states are orthogonal or that they are the same. Is this correct?
"
['qiskit']," Title: Creating Ising Hamiltonian with QiskitBody: How to create Ising Hamiltonian and implement it with qiskit (the output should be in the form of WeightedPauliOperator) for the following problem:
$$
H = A \big(K - \sum_{i}^{N} t_i x_i \big)^2\\
x_i=\{0,1\}\\
t_i \in \mathbb{N}_{>0}\\
K\in \mathbb{N}\\
A \in \mathbb{R}_{>0}\\
$$
I want to choose any number of variables $x_i$, that the sum $\sum_{i}^{N} t_i x_i$ will equal exactly $K$.
"
"['algorithm', 'quantum-state', 'grovers-algorithm', 'oracles', 'amplitude-amplification']"," Title: Preparing a quantum state from a classical probability distributionBody: Suppose I have a black-box unitary $U_p$ which is described as follows: given a finite probability distribution $p:\{1,\ldots,n\}\rightarrow \mathbb{R}_{\geq0}$, where $\sum_{x=1}^n p(x)=1$, the action of the black box on a basis is given by $$U_p:|x\rangle|0\rangle\mapsto |x\rangle |p(x)\rangle,$$ where I am assuming I can encode each $p(x)$ into some register of quantum states (say using binary encoding into qubits). Then applying $U_p$ to a superposition of inputs is easy and I can easily construct a circuit that prepares the state $$\frac{1}{\sqrt{n}}\sum_{x=1}^n |x\rangle |p(x)\rangle.$$ My question is the following, using what I have described above or otherwise how could I prepare the quantum state $$|p\rangle:=\sum_{x=1}^n \sqrt{p(x)}|x\rangle$$ given access to $U_p$.
Remarks: My question could be seen as how one can make this fit into the amplitude amplification scheme.
One can see that this is a generalization of the typical quantum search, since if $p(x)=\delta_{x,y}$ (the distribution that is $1$ if $x=y$ and 0 if $x\neq y$) then $U_p$ is the quantum black-box for one marked item quantum search, and therefore preparing the state $|y\rangle$ can be done with $\Theta(\sqrt{n})$ queries to $U_{\delta(x,y)}$.
Update: I think this might boil down to someone explaining how I might implement the relative-phase like transformation $$ V:|x\rangle|f(x)\rangle\mapsto |x\rangle \big(\sqrt{\tfrac{f(x)}{2^m}}|0\rangle+\sqrt{1-\tfrac{f(x)}{2^m}}|1\rangle\big)$$ using some sort of controlled rotation?
"
"['textbook-and-exercises', 'density-matrix']"," Title: Can an ensemble of pure states give probability less than 1?Body: I am calculating the reduced density matrix of a bipartite system, I ended up getting that it was the sum of two density matrices of pure states each with a probability $1/3$. My understanding was that the coefficients in this ensemble should add up to $1$. But perhaps this is only for density matrices of whole systems and not for a reduced density matrix? So have I made an error in the calculation (I don't think I have) or the result I got possible?
"
['quantum-gate']," Title: Why does the concept of a unitary matrix seem so similar to that of an invertible matrix?Body: I understand that the intuition behind a unitary operator is that it preserves the length of the vector it acts upon. Also $U^\dagger U = I$. Doesn't that just mean that $U$ is just an invertible operator which preserves distance? And that $U^\dagger$ is the inverse?
If not, where am I making my mistake in reasoning? How should I rewire my thinking to avoid this flawed paradigm?
If so, does that then mean that all distance preserving and invertible operators are also normal operators?
"
"['algorithm', 'tomography']"," Title: If we could only get two-qubit tomography as an output, what algorithms are possibleBody: According to the circuit model, the output for a quantum computation on $n$ qubits is an $n$-bit string. But what if we instead got a full two qubit tomography for all $n(n-1)$ pairs of qubits?
This would need to be calculated over many shots. If we simple used 1 shot, then we could easily just read out the resulting bit string. If we had infinite shots, and hence arbitrarily accurate tomography, perhaps we'd get some undesirable superpowers. Let's rule out both with the restriction that the number of shots must be both upper and lower bounded by $\textrm{poly}(n)$.
For algorithms with deterministic outputs, all shots give the same output. So in these cases, we'll still just be able to read out the standard result.
For algorithms with random outputs (like Shor's which gives random factors), things might be more tricky.
So what kinds of algorithms could be run with this restriction? And what kind of speed-ups could be obtained?
"
"['vqe', 'nisq']"," Title: What's the point of VQE if classical computers can solve for eigenvalues easily?Body: From a few VQE tutorials online I see that they normally start with something like:
VQE is a way of getting a good estimate for the upper bound of the ground state of a quantum system's Hamiltonian. The Hamiltonian is known.
Then they proceed to show you a single qubit Hamiltonian as a 2x2 matrix, and go through the VQE algorithm to get the ground state energy (the smaller of the two eigenvalues).
Cool, but as devil's advocate, I could have just pulled out my high school maths to analytically get the smaller of the two eigenvalues. And with larger matrices, a classical computer will do the job well (which afaik is not a hard problem).
My question then is at what point does a Hamiltonian's matrix representation become so large, that even though we know it, we'd go to the trouble of probing the quantum system itself rather than solving for the eigenvalues on a classical computer? And how does that relate to the current and near future statuses of classical and quantum computing?
Please feel free to completely sidestep my question and nudge me back on track if I'm off-paradigm or started from the wrong premise.
"
['quantum-state']," Title: Why does a Hamiltonian have to be Hermitian?Body: Starting from:
$$
-i\hbar \frac{d|\psi⟩}{dt} = H|\psi⟩
$$
I was able to do some working to prove that $U$ in the corresponding discrete representation
$$
U(t_1,t_2) = exp\frac{-iH(t_2-t_1)}{\hbar}
$$
is unitary if and only if $H$ is Hermitian. That is:
$$
U^\dagger(t_1,t_2)U(t_1,t_2) = I \iff H = H^\dagger
$$
Cool! But now I'm stuck trying to understand the physical significance of the fact that $H$ is Hermitian. I try to see $H$ as a ""velocity function"" because it gives the instantaneous change in $|\psi⟩$. That's as far as my intuition goes in terms of understanding the Hamiltonian.
So what's another intuitive way of understanding why the Hamiltonian must be Hermitian? And as a bonus, can the Hamiltonian also be unitary?
EDIT
I think the following ""intuitive"" description works best for me (the answers led me here):
So we start from my idea that $H$ is like a ""velocity function"" that takes as input the current state vector $|\psi⟩$ and spits out the infinitesimal change $d|\psi⟩/dt$. Now we consider two things:
1) $H$ being hermitian means it has real eigenvalues (the proof of that is off-topic). So if you apply it to a state vector you're just scaling each of its components by a purely real number. Or in math speak, if you apply $H$ to $|\psi⟩ = \sum_i{c_i}|\psi_i⟩$ (where I've just expressed $|\psi⟩$ as a weighted sum over basis vectors $|\psi_i⟩$), you end up getting $\sum_iR_ic_i|\psi_i⟩$ where $R_i$ are purely real.
2) But then we also consider that $H$ is also multiplied by $i$. So that turns all those purely real coefficients to purely imaginary coefficients. Switching to the polar description of complex numbers, the infinitesimal change to the state vector is just a phase added to each of its components, and no amplitude scaling.
Therefore $H$ is like an instantaneous tangential nudge to the vector. So by integrating, the corresponding discrete operator $U$ is unitary.
"
"['quantum-gate', 'tensor-product']"," Title: Generic maths for two-qubit gatesBody: With regard to this question/answer:
How's the generalized behaviour of a two-qubit gate for the resulting two qubits?
Here e.g. CNOT:
If I apply the CNOT matrix to the tensor product, also the control qubit seems to get affected:
Control qubit
$$ \text{ctrl} = \begin{pmatrix} x \\ y \end{pmatrix} $$
Target qubit
$$ \text{target} = \begin{pmatrix} \alpha \\ \beta \end{pmatrix} $$
Tensor product tp:
$$
\text{tp} = \text{ctrl} \otimes \text{target} =
\begin{pmatrix} x \\ y \end{pmatrix}
\otimes
\begin{pmatrix} \alpha \\ \beta \end{pmatrix}
=
\begin{pmatrix} x\alpha \\ x\beta \\ y\alpha \\ y\beta \end{pmatrix}
$$
Applying the CNOT gate with control qubit a and target qubit b:
$$
\text{res}_1 =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{pmatrix}
\begin{pmatrix} x\alpha \\ x\beta \\ y\alpha \\ y\beta \end{pmatrix}
=
\begin{pmatrix} x\alpha \\ x\beta \\ y\beta \\ y\alpha \end{pmatrix}
$$
How to get the two results for the both qubits a and b out of this res1 vector representation (tensor product of the two resulting qubits?)?
Acc. to the linked answer, the resulting value for the target qubit b may be the vector built from the upper two values, i.e.
$$ \text{res}_\text{target} = \begin{pmatrix} x\alpha \\ x\beta \end{pmatrix} $$
Does the control qubit also get affected in that case? e.g.
$$ \text{res}_\text{ctrl} = \begin{pmatrix} y\beta \\ y\alpha \end{pmatrix} $$
Clearly building the tensor product of those two results wouldn't result in the
"
"['quantum-state', 'measurement', 'pauli-gates']"," Title: What is the state of a qubit after measuring some a Pauli operator?Body: I'm confused about the state of a system after a measurement. Say we have a particle $v$ in the state: $ |\psi\rangle= \sqrt{1/4} \ |0\rangle + \sqrt{3/4} \ |1\rangle $.
From my understanding, if one were to measure the state of $v$, one would get the result $|0\rangle$ with probability $|\sqrt{1/4}|^2=1/4$, and similarly, $|1\rangle$ with probability $3/4$.
However, I've also learned that a measurement is always done by an observable (a unitary operator), e.g. $Z=|0\rangle \langle 0|-|1\rangle \langle 1|$, and that the outcome of the measurement is an eigenvalue of this operator, and that the state we get after the measurement is always dependent on the observable we use, and similarly for the probability of getting that state.
Now, by inspection, I noticed that when I measure $Z$, I do get the state $|0\rangle$ with probability $1/4$, and $|1\rangle$ with probability $3/4$, as expected. But I don't get these results when I measure the Pauli operator $X$, for example.
Does that mean that the claim in my second paragraph always assumes a measurement of $Z$?
"
"['algorithm', 'qiskit']"," Title: Creating qubit operators for optimization problemBody: There is DOcplex module that generates WeightedPauliOperator for the DOcplex Model by calling docplex.get_operator(model). I want to understand what are the steps for creating the qubit operators (List of WeightedPauliOperator) without DOcplex module?
As I understand it is necessary to map problem to QUBO form.
"
"['programming', 'entanglement', 'q#']"," Title: Are there patterns in the numbers created with qrng by entangled qubits?Body: I want to examine the graph of 2 sets consisting of 1000 numbers created with quantum random number generator which were created by entangled qubits and see if there is a pattern in the randomly generated number series.
How can I do this with Q#?
So by doing that I think,I can entangle two qubits in Sample Quantum Random Number Generator
operation SampleQuantumRandomNumberGenerator() : Result {
// Allocate two qubits
using ((q1, q2) = (Qubit(), Qubit())) {
// Prepare Bell state (|00⟩ + |11⟩) / sqrt(2) on them
H(q1);
CNOT(q1, q2);
// The measurement results are going to be correlated: you get 0,0 in 50% of the cases and 1,1 in 50%
return (MResetZ(q1) == Zero ? 0 | 1,
MResetZ(q2) == Zero ? 0 | 1);
}
But how can I use qubits ( qs(0) for one set qs(1) for one set ) in here for getting 2 sets consisting of 1000 numbers between 0 and 100 ?
operation SampleRandomNumberInRange(max : Int) : Int {
mutable bits = new Result[0];
for (idxBit in 1..BitSizeI(max)) {
set bits += [SampleQuantumRandomNumberGenerator()];
}
let sample = ResultArrayAsInt(bits);
return sample > max
? SampleRandomNumberInRange(max)
| sample;
}
@EntryPoint()
operation SampleRandomNumber() : Int {
let max = 100;
Message($""Sampling a random number between 0 and {max}: "");
return SampleRandomNumberInRange(max);
}
"
"['quantum-gate', 'programming', 'cirq']"," Title: Can't append multiple times with self-defined oracleBody: import cirq
def set_io_qubits(qubit_count):
input_qubits = [cirq.GridQubit(i, 0) for i in range(qubit_count)]
return (input_qubits)
def debug_oracle(input_qubits):
yield (cirq.H(input_qubits[0]))
def make_grover_circuit(input_qubits, oracle):
c = cirq.Circuit()
c.append(oracle)
c.append(oracle)
c.append(oracle)
c.append(cirq.measure(*input_qubits, key='result'))
return c
def main():
input_qubits = set_io_qubits(2)
oracle = debug_oracle(input_qubits)
circuit = make_grover_circuit(input_qubits, oracle)
print('Circuit:')
print(circuit)
if __name__ == '__main__':
main()
I add c.append(oracle) three times in make_grover_circuit. However, when I print the circuit, it seems there is only one oracle. Is it a bug? Or just I can't .append my oracle more than once? Here is my result of the program.
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 /Users/a123/Desktop/Cirq/test.py
Circuit:
(0, 0): ───H───M('result')───
│
(1, 0): ───────M─────────────
Process finished with exit code 0
"
"['algorithm', 'qiskit', 'quantum-walks']"," Title: Quantum circuit for Szegedy quantum walk on a cyclic graphBody: I'm trying to implement an efficient circuit for the Szegedy quantum walk on a cyclic graph with number of nodes N = 8. I found the circuit in this thesis (page 39), the two images below show graph and circuit. I've already wrote the code using Qiskit.
The problem I am facing is how to perform a step, so how to pass as input the superposition of qubits that represents my current position and how to retrieve the next possible positions.
As suggested in the reference for the current position I'm using as state vector|$\phi_{0}\rangle = [0,\frac{1}{\sqrt{2}},0,...,0,\frac{1}{\sqrt{2}}]^{T}$ that is the column in the transition matrix P that represents node 0 then considering a state |x,y$\rangle$ as a state for the Szegedy QW I place the vector $|\phi_{0}\rangle$ in position x expecting the output in y.
To construct the vector |$\phi_{0}\rangle$ I am using an Hadamard gate and some C-NOT gates in sequence This simulation in Quirk explains better what I said before showing what I am trying to do. I don't know if I am making any serious theoretical mistakes but the results doesn't make so much sense.
"
"['cryptography', 'quantum-advantage', 'bb84']"," Title: Is the BB84 protocol an example of ""quantum supremacy""?Body: This is a fairly broad question, I hope it fits here. I am wondering if the BB84 protocol is an example of ""quantum supremacy"", ie. something a quantum computer can do but something that is assumed a classical computer cannot do the equivalent of. Are there any classical algorithms that can allow for the equivalent of secure key distribution as accomplished through BB84, with unconditional security proof? If not, what would it mean if there did exist such protocol?
"
"['qiskit', 'programming']"," Title: How to ignore spins is Qiskit chemistry package?Body: Is it possible to use built-in qiskit.chemistry tools, such as VQE, UCCSD, etc., without using the notion of spins ('alpha'/'beta')?
Let's say, I want to decsribe a system having 5 fermionic modes in the second-quantized formalism. I want to start from a state in which 3 of them are occupied. I can provide a second-quantized Hamiltonian written in terms of $h_1$ and $h_2$ coefficients and ladder operators.
How do I do all that?
"
"['quantum-gate', 'grovers-algorithm']"," Title: What exactly is the reason why the Abrams - Lloyd algorithm does not allow implementation using unitary gates and ancillary qubits?Body: In their original paper (last part of the paper), Abrams and Lloyd present a quantum algorithm that could potentially efficiently solve NP complete problems (in linear time). Their algorithm, robust to small errors, depends on the possible implementation of a nonlinear OR gate. A short presentation can be found here .
Classical irreversible logical gates can be simulated by unitary gates that involve some ancillary qubits, as can be seen here and here.
Question. What exactly is the reason why the Abrams - Lloyd algorithm does not allow implementation using unitary gates and ancillary qubits?
Note that these ancillary qubits can be set and measured when necessary, during the operation of the algorithm, and these operations introduce nonlinearity into the state evolution.
"
"['resource-request', 'simulation', 'hamiltonian-simulation', 'vqe', 'qaoa']"," Title: Resource recommendation on quantum simulationsBody: I would like to know more about quantum simulations, so as to start on a few standard physical models (maybe particle in a box, harmonic oscillator, etc.) and then build up on more complex things. But I find that the literature on this subject seems a bit scattered all over the place. I only know some guide lines, I know that I have to look into trotterization, VQE and (maybe?) QAOA. But is there a ""place"" or book that compiles all of it?
"
"['error-correction', 'physical-realization', 'noise']"," Title: Exponential Growth of Noise in Quantum ComputersBody: I recently listened to a presentation for Introductory Quantum Computing. It was very general and meant to give the listeners an idea about the potential for Quantum Computing.
The speaker ended the talk with a kind of ""On the Other Hand"" talking point by mentioning that some people are concerned that the noise in Quantum Computers will grow at such a rate that limits their overall potential.
I was wondering if anyone on this channel has any experience with this issue or knowledge about it? Is this a theoretical limit of physics of an engineering problem? What is the current state of thinking about this issue and do recent breakthroughs in Quantum Error Correction do anything to address it?
"
['bloch-sphere']," Title: Does normalizing a mixed state give a pure state?Body: According to bloch sphere interpretation, any point on the surface of the sphere corresponds to a pure state and any point inside the sphere corresponds to a mixed state. Suppose you have a point inside the bloch sphere C corresponding to a mixed state. Draw a ray connecting C and origin O of the bloch sphere. Now extend this ray OC such that we get some point C' on the surface of the sphere. Now C' = cC for which c is a real number.
So can we say that the mixed state corresponding to point C when normalized becomes a pure state? Or is there a problem with this logic?
"
"['qiskit', 'programming']"," Title: How to plot custom labels for quantum registers in Qiskit?Body: How can I plot custom labels for specific qubits on the left and right side similar to the picture shown here (A, B, Sum ...):
"
"['algorithm', 'q#']"," Title: How can I run Q# program in Azure QuantumBody: I have already made a small Q# program and ran it using Python on VSCode, my question is how can I run it on Azure Quantum to make it run faster?
- Q# program :
namespace QubitTest {
open Microsoft.Quantum.Convert;
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Measurement;
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
operation QChange() : Int {
// on retourne un qubit
using ( q = Qubit()) {
for (i in 1..500000){
H(q);
Message($"" Qubit {i} : {q}"");
}
return 0;
}
}
}
- Python Simulation :
import qsharp
from QubitTest import QChange
QChange.simulate()
"
"['simulation', 'hamiltonian-simulation', 'phase-estimation', 'trotterization']"," Title: What is the usefulness of the Suzuki-Trotter formula?Body: I can't seem to wrap my head around the suzuki-trotter formula. I have seen This answer but I am still confused of the applicability of the formula. Let me explain:
As I understand it Trotterization lets us use directly the Schrodinger equation $|\psi(t)\rangle = e^{-i H t} |\psi(0)\rangle$ where we approximate $e^{-iHt}=e^{\sum_k H_kt}\approx \bigg(\prod_k e^{-iH_k\Delta t}\bigg)^N$ where $\Delta t=t_{final}/N$. This is formula is approximate to $O(\Delta t^2)$ and we can get further precision if we consider more terms in the expansion with the commutators. In sum, we have a way to get $|\psi(t)\rangle$ from an initial state. But now let's get a familiar physical model to apply this to: the Harmonic oscillator. Then our Hamiltonian is (in 1 dimension):
$$
\hat{H}=\frac{\hat{P}^2}{2m}+\frac{1}{2}m\omega^2\hat{X}^2
$$
if we want to evolve this system we can do so in a position or momentum basis, so that the $\hat X$ operator will just be a diagonal matrix in our discrete space and $\hat P$ will also be diagonal given that we express it as $\hat X$ wrapped around the Fourier transform as $\hat P=\hat{(QFT)}\hspace{1mm}\hat X \hspace{1mm}\hat{(QFT)}^{-1}$. So we clearly have a way to study the system. Another way is to express in terms of the creation and destruction operators $A$ and $A^\dagger$, so that our Hamiltonian can be written as $\hat H=\hat A \hat A^\dagger +\hat I/2$. These operators can be easily be constructed from the position and momentum basis. Normally in a physical system we don't know how to diagonalize a priori our Hamiltonian but in this case we can.
Having said this, here's what I don't get:
- Suppose we start with the position basis and our goal is to measure the energy spectrum. In order to do so we could make use of the kickback phase and the phase estimation circuit to know this given that our initial state was already an eigenstate of the Hamiltonian, but how could we know this beforehand? In this case, we could have since its a simple model, but usually we don't, there had to be some state preparation and then evolve it in time, and if that's the case, then this render the algorithm useless.
- Another way to view this would be to start with some state that was not an energy eigenstate of the Hamiltonian in the position basis. But how would that be useful?
- Then we can look at the energy basis and we can work on that to evolve our system and check its final state, and go again through some phase kickback and estimation to know the eigenvalue, but again, this assumes some state preparation that was already known that it was an eigenstate.
I know I am wrong but I just can't see the applications due to my lack of experience. I also reckon that if my goal was to find the energy spectrum I would better off with the VQE (even though I haven't studied it yet). What are the practical uses of the Trotter formula?
PS: I have looked into these papers for the harmonic oscillator application:
DOI: 10.13140/RG.2.2.18996.81284
DOI: 10.1109/NYSDS.2018.8538959
"
"['quantum-gate', 'algorithm']"," Title: Which gate set should be used when I measure the depth of a circuit?Body: I want to measure the depth of a circuit, but I do not know which quantum gates should be used when the circuit is decomposed. For example, $ZZ$ rotation (i.e. $e^{i\theta \sigma_z^i\sigma_z^{i+1}}$) can be decomposed as $\text{CNOT}\,R_z(\theta)\,\text{CNOT}$. So, I think the depth of $ZZ$ rotation is 3. However, if $ZZ$ rotation gate exists, then the depth should be 1.
My question is as follows: Which gate set should be used when I measure the depth of a circuit?
"
"['qiskit', 'algorithm', 'hhl-algorithm']"," Title: Angles of rotation in HHL exampleBody: I am trying to implement the 4-qubit example outlined in showed in section 3 of the qiskit tutorial on the HHL algorithm. Does anyone know what are the 2 angles that the Ry gate needs to be applied with? They say what the values of C and the approximated values of the eigenvalues are ($\tilde {\lambda_1}$ and $\tilde {\lambda_2}$), but they don't mention the rotation angles. Are they just $\theta_1 = \arccos(\frac{C}{\tilde {\lambda_1}})$ and $\theta_2 = \arccos(\frac{C}{\tilde {\lambda_2}})$ ?
"
"['algorithm', 'physical-realization']"," Title: How to decide which quantum device to use if a quantum algorithm is given?Body: I'm planning to write my master thesis in quantum computing. The subject of the thesis is to find out which attributes (properties, features) of quantum algorithms respectively their implementations (circuits) are important to decide which quantum device to use. Quantum devices differ in connectivity, number of qbits, gate fidelity etc. So what kind of attributes of the algorithms would be important? Number of swap-operations? Number of ancilla bits? Breadth? Depth? Entanglement depth? ...
Here an illustrative use case:
An user has some database (e.g. phone book) and some data (number) and wants to find out if the data is a phone number and if so who it belongs to. So the user decides to use grover's algorithm and lets say IBM's Q experience. In IBM's Q experience the user can decide which device to use (Q 5 Tenerife, Q 14 Melbourne, ...). All with different properties. How should the user decide which one to use? What does it depend on? What aspects of the given algorithm contributes to the decision?
Does anybody know some good literature or papers to read, or as a starting point ?
Or good keywords to search for?
Should I look into compilers, even though papers in that direction never really name the attributes of the algorithms?
In which topic area do I have to look into?
I can't find much. And if there is no much research in that area, I guess it won't be possible to write a thesis about that.
Thanks in advance.
Best regards,
krsp.
"
"['algorithm', 'complexity-theory', 'bqp']"," Title: Could finding Golomb rulers be in $\mathrm{BQP}$?Body: The problem of factoring large numbers may be in the so-called ""intermediate"" regime. These are problems that are in $\mathrm{NP}$, but are neither likely to be easy enough to be in $\mathrm{P}$ nor hard enough to be complete. Following Shor's algorithm and a general consensus that $\mathrm{NP}\not\subseteq\mathrm{BQP}$, focus quickly turned to such difficult intermediate problems, with modest success. Now, a general consensus is that $\mathrm{BQP}$ and $\mathrm{NP}$ are likely incomparable, and research focus has moved a bit to problems, such as forrelation, that are in $\mathrm{BQP}$ but are not likely even in $\mathrm{NP}$ or even in any point of the polynomial hierarchy.
Nevertheless, one problem that appears to me to be in this ""intermediate"" area is that of finding small Golomb rulers.
Imagine marking a 6"" ruler only at the 1"" position and the 4"". To measure something one-inch in size, measure between the left edge and the 1"" mark; to measure something two-inches in size, measure between the 4"" mark and the right edge; to measure something three-inches in size, measure between the 3"" mark and the 4"" mark; etc. We can measure anything between one inches and six inches, with only two marks on the ruler.
Is there any hope of a quantum computer finding a large Golomb ruler?
That is, of finding a string of $0$'s and $1$'s that possess the Golomb property of not having distances measurable more than once?
Here I think of having $n=O(m^2)$ qubits, and preparing them in a uniform superposition having a fixed Hamming weight of $O(m)$ ; using the $i$'th index ($i$'th qubit) of the ruler as a way to perform a controlled rotation by $e^{i/n}$ I think would assign a random phase to all vectors but those corresponding to Golomb rulers... or something
EDIT
Upon consideration, perhaps it's best to ask for a quantum algorithm for the dual problem of generating a string on $n=O(m^2)$ qubits that has the Golomb ruler property, with a Hamming weight of $n$.
For example, a solution with $m=4$ and $n=6$ is the already-described string
$$\vert 1010011\rangle;$$
or equivalently
$$\vert 1100101\rangle;$$
a solution with $m=5$ and $n=11$ is
$$\vert 110010000101\rangle;$$
etc.
For a given length (given number of qubits $n$), what's the largest Hamming weight (largest $m$) that can be created for having the Golomb property?
"
"['quantum-gate', 'quantum-fourier-transform']"," Title: QFT of 3-bit systemBody: Recently I was learning about QFT(Quantum Fourier Transform). I was learning how QFT is applied with H and cROT gates. I was playing with QFT here. I was testing with 3-Qubit set as you can see in the link. The expression used for calculating is
Note:-$[0.x_1x_2x_3...x_n] = \sum_{i=1} ^n x_i2^{-i} $.
I got the above expression from here
As you can see from the link given above I was doing QFT on |100>, which should yield a phase of $0$ or $2\pi$ (first qubit)(calculated from the above expression) but from the simulator it is showing phase f $\pi/4$. I also did the same simulation on Qiskit, i got the same Bloch representation, the same phase for the first Qubit $\pi/4$. Now my question is why the difference? Why the difference between calculated phase and the Bloch representation in the simulators? Please help!!
"
"['qiskit', 'programming']"," Title: Modifying measurements in a Qiskit circuitBody: Assume my function Qiskit receives a certain circuit as an input. How do I check if this circuit already has some measurements appended to it? If so, how can I modify them? For example, if there are measurements on certain qubits, I would like to remove those in order to add some more gates, and then add the measurement of all qubits.
"
"['pauli-gates', 'vqe']"," Title: VQE: Can I build a non-hermitian Hamiltonian with just Pauli matrices?Body: From the VQE paper they claim that a Hamiltonian can be expressed as a polynomial series of pauli operators (equation 1).
While coding up VQE from scratch I made a function which would allow me to specify coefficients up to 2nd order to build the corresponding Hamiltonian (for 1 qubit).
But I noticed that $\sigma_y\sigma_z$ is in fact not hermitian, and so it doesn't give me purely real energy eigenvalues.
So is it not true the other way around? Can I not specify an arbitrary polynomial series of Pauli operators such that the result is a Hamiltonian for a closed system?
EDIT
See the accepted answer. I actually misunderstood the equation in the paper, not realising that the higher order terms were actually tensor products and only applicable to more-than-single-qubit systems.
"
['vqe']," Title: In which situations is it hard to find an ansatz?Body: Looking at the single-qubit, toy example of VQE it's pretty much trivial that arbitrary X and Y rotations are sufficient to cover all of state space for our toy system.
Unfortunately, the toy example doesn't do enough to illustrate to me why it would be any harder to do the same for a larger system. So in what situations is it hard to find an ansatz?
EDIT
After reading through some of the resources from the accepted answer I came up with a response that works best for me:
- The number of parameters required to describe all possible states of an n-qubit quantum system scales exponentially with n.
- So an ansatz which can cover all possible states would need an exponential number of parameters. And that just won't do because:
- We'd then need a classical optimistion algorithm which can search through an exponentially large parameter space.
- We'd need an exponential number of gates to actually prepare the state (certainly not good for a NISQ device with short coherence times).
- So we actually need to be able to find ansatzes who's parameters grow at most polynomially with the size of the system. But then of course, we can't cover all states.
- So then the challenge is in balancing the tradeoff between keeping the number of ansatz parameters small, but still being confident that the spanning space of the ansatz covers our ground state.
"
"['qiskit', 'ibm-q-experience']"," Title: IBMQfactory._initialize_providers ErrorBody: After a successful first run without problems, I found that I cannot connect any longer.
Code:
from qiskit import IBMQ
IBMQ.load_account() #previously enabled and saved, even updated
IBMQ.providers() # returns empty why???
provider = IBMQ.get_provider()
backend = provider.get_backend('ibmq_16_melbourne')
I re-added the token, overwrite the saved token and could successfully activate my account, but it seems that no provider can be found now.
I get this error
ibmqfactory.load_account:WARNING:2020-05-25 22:08:25,390: Credentials are already in use. The existing account in the session will be replaced.
ibmqfactory._initialize_providers:WARNING:2020-05-25 22:08:29,324: Unable to instantiate provider for {'hub': 'ibm-q', 'group': 'open', 'project': 'main'}: ""{'online_date': ['Not a valid datetime.']}""
ibmqfactory.load_account:WARNING:2020-05-25 22:08:29,325: No Hub/Group/Projects could be found for this account.
Even if I directly add the same hub, group and project, I am not able to retrieve a single provider.
If I run IBMQ_provider() I get an empty list.
It is summarized as IBMQProviderError: 'No provider matches the specified criteria
If you could give me a had, I would be very thankful.
"
"['quantum-gate', 'machine-learning', 'neural-network']"," Title: Quantum NN vs Quantum-Inspired NNBody: I can't find the true difference between Quantum Neural Network (QNN) and Quantum-Inspired Neural Network (QINN).
I have multiple guesses:
- QINN and QNN are absolutely the same thing (all QNNs are actually QINNs unless the true quantum computing hardware is developed)
- QINNs are the neural nets ensembles.
- Something else.?
Thank you a lot for any information!
"
['q#']," Title: Error running Q# notebooks: Syntax does not match any known patternsBody:
C:/snippet_.qs(1,85): error QS3001: Syntax does not match any known patterns.
C:/snippet_.qs(1,26): error QS6104: No namespace with the name ""Microsoft.Quantum.Intrinsic"" exists.
C:/snippet_.qs(7,17): error QS5022: No identifier with the name ""ArcSin"" exists.
C:/snippet_.qs(7,30): error QS5022: No identifier with the name ""Sqrt"" exists.
C:/snippet_.qs(8,5): error QS5022: No identifier with the name ""Ry"" exists.
C:/snippet_.qs(11,25): error QS5022: No identifier with the name ""H"" exists.
"
"['quantum-gate', 'quantum-state', 'ibm-q-experience', 'd-wave']"," Title: How do IBM, D-Wave, etc. change phase physically?Body: How do IBM, D-Wave, etc. change phase physically? In real hardware?
"
['quantum-state']," Title: single-qubit gate followed by a single-qubit errorBody: What are the ways to rewrite a single-qubit gate follow by a signle-qubit error?
"
['matrix-representation']," Title: Deriving a controlled Kraus operator from an uncontrolled Kraus operatorBody: I have a Kraus operator $M$. $M$ is composed of a list of matrices $M_k$ satisfying
$$\sum_{k} M_k^\dagger M_k = I$$
I would like to control the application of $M$ using a control qubit. This controlled operation will have a Kraus operator $C(M)$. Given $M$ as a list of matrices, how do I compute a list of matrices describing the Kraus operator $C(M)$?
For example, what are Kraus operators for the controlled amplitude damping channel?
Note that a perfectly valid answer to this question is ""this concept of controlling a Kraus operator is ambiguous, here's why"".
Let me clarify what I mean when I say ""controlled Kraus operator"". Any quantum operation can be translated into a unitary circuit acting on the system of interest as well as an external environment that will be traced out at the end. If you derive that circuit for the original operation, introduce a new system qubit and control every operation in the circuit using that new system qubit, then the circuit now implements the controlled Kraus operation.
My initial idea was to treat each $M_k$ as if it was a unitary operation and created a derived $C(M_k) = \begin{bmatrix} I & 0 \\ 0 & M_k \end{bmatrix}$, but this produces a list of matrices whose upper left corner violates the $\sum_{k} C(M)_k^\dagger C(M)_k = I$ requirement.
"
"['mathematics', 'pauli-gates', 'tensor-networks']"," Title: Pauli Identity Using Tensor Network NotationBody:
I am trying to understand the meaning of the equation shown in the above image taken from this paper, but I am unfamiliar with the tensor network notation. My current strategy is trying to write down matrix representations for the LHS and RHS separately and see from there that they are the same, but I am having difficulty doing it. To me, the LHS looks like $I\otimes I$ and the RHS looks like $$\frac{I\otimes I+X\otimes X+Y\otimes Y+Z\otimes Z}{2},$$
but clearly they are not equal.
Could anybody shed more light on this?
"
"['quantum-state', 'circuit-construction', 'cryptography', 'hadamard', 'bb84']"," Title: Hadamard gate with two inputs in the circuit for the BB84 protocol?Body: I am reading the book ""Quantum Computing verstehen"" by Matthias Homeister.
At the moment i'm having a look at the BB84 protocol (which is described in kind of an abstract way).
In this chapter a quantum circuit is shown, describing how Alice creates and sends a qubit and how Bob measures it.
Now Alice qubit-creation step is described as:
$\text{1. generate a random classical bit } a \text{ and initialize the qubit } | x \rangle \gets |a\rangle$
$\text{2. generate a second random classical bit } a' \text{ . If } a'=1 \text{ apply the Hadamard matrix to }|a\rangle$
I'm wondering how to interpret this Hadamard-gate with two inputs, since i havent seen it with two inputs before. Is it supposed to apply the Hadamard matrix only if the second input is 1?
"
"['machine-learning', 'neural-network', 'quantum-enhanced-machine-learning']"," Title: Why is Farhi and Neven's architecture described in ""Classification with Quantum Neural Network on near term processors"" called a Neural Network?Body: In regards to ""Classification with Quantum Neural Networks on near term processors"" (which you can find here) , there are still a few things that do not make entirely sense to me.
First of all, why is the architecture called a ""neural network""? As far as my knowledge goes, in classical ML, the fundamental unit of Neural Networks is the perceptron. However, in Farhi and Neven's paper, they never mention any form of Quantum Perceptron.
Secondly, I do not understand the figure describing the architecture (it's Figure 1 in the paper). If you look closely, there is some cross wiring, etc. (I have to admit, the figure looks like a Neural Network, but it doesn't make sense to me). I was able to implement the Subset Parity Problem using Qiskit (because nonetheless, I understand the math behind the model), and the circuit I got doesn't look like the one in the figure.
I hope you can clarify this for me.
Thank you in advance!
"
['physical-realization']," Title: Is there any legitimate information about Microsoft quantum hardware?Body: I'm wondering if anyone has information regarding the current status of Microsoft quantum hardware? How many working qubits do they have? What are the gate depth/fidelity? Any details about realization? (besides ""we're focused on sustainable solutions that will change the world""; ""in the future, topological qubits will allow us to reach fault-tolerance"", etc.)
"
"['quantum-state', 'density-matrix', 'textbook-and-exercises']"," Title: Show that $I = \frac{\rho + \sigma_x\rho\sigma_x +\sigma_y\rho\sigma_y + \sigma_z\rho\sigma_z}{2}$ for all states $\rho$Body: I am trying to show that for any qubit state p, the following holds:
$$I = \frac{\rho + \sigma_x\rho\sigma_x +\sigma_y\rho\sigma_y + \sigma_z\rho\sigma_z}{2}$$
I have tried different manipulations, but got stuck... Will be grateful for any help!
"
['entanglement']," Title: Quantum Entanglement : Changing states after measurementBody: Hi I am quite new to Quantum Mechanics and I came across with this confusion.
Let's say there are 2 entangled particles A and B.
1. When A is measured to be state 0 (doesnt measure B) does it automatically collapse B to 1 or does it imply B should be 1 ?
2. If A is measured (result is 1) and doesn't measure B, by any chance if we change the state of A to state 0 will it change the state of B ?
Thank you very much.
"
['error-correction']," Title: Smallest Distance-5 Quantum Error Correction Code?Body: Is it known/proven what the smallest quantum error correction code is that can correct arbitrary two-qubit Pauli errors? I can think of the nested/concatenated 5-qubit code or a 25-qubit version of the Shor (repetition) code, but I am not sure if there are codes requiring fewer qubits.
"
"['programming', 'q#']"," Title: 'Unable to import' error message in Q# using VS CodeBody: I'm a complete beginner in Q#.
Consider the code in the following image:
For some reason, there always is an error message when I try to import anything. It also implies to keywords like Length. The error message is :
No namespace with the name ""Microsoft.Quantum.Canon"" exists.
However, my code works just fine. The code in the image is taken directly from user guide of Q#.
Any Suggestions?
"
"['pauli-gates', 'bell-experiment', 'non-locality']"," Title: What would the CHSH inequality be equal to if the two qubits were separable?Body: I am writing an Excel spreadsheet to work through the matrix algebra for a simple Bell's game with the following parameters.
$$\newcommand{\bra}[1]{\langle #1|}\newcommand{\ket}[1]{|#1\rangle}A_\pm = \frac{1}{2}\times(I \pm Z)$$
$$A'_\pm = \frac{1}{2}\times(I \pm X)$$
$$B_\pm = \frac{1}{2}\times(I \pm \frac{1}{\sqrt{2}}\times(X+Z))$$
$$B'_\pm- = \frac{1}{2}\times(I \pm \frac{1}{\sqrt{2}}\times(X-Z))$$
For completion, I will define the matrices:
$$I = \begin{bmatrix}1&0\\0&1\end{bmatrix},\qquad
X=\begin{bmatrix}0&1\\1&0\end{bmatrix},\qquad
Z = \begin{bmatrix}1&0\\0&-1\end{bmatrix}.$$
The expectation value is calculated using the following:
Use matrix multiplication to calculate the probability of the outcome. If the outcomes are both positive or both negative, ie A+B+, then the outcome is +1. If the one is positive and the other negative (or vice versa) then the value is -1.
Sample calc:
$Pr(A_+,B_+) = \bra{Phi} A\otimes{B} \ket{Phi}$
$<AB> = Pr(A_+,B_+)\times1 + Pr(A_-,B_-)\times1 + Pr(A_+,B_-)\times(-1) + Pr(A_-,B_+)\times(-1)$
The CHSH Inequality states:
$ <AB>-<AB'>+<A'B>+<A'B'> \leq 2$
What is typically shown is that when Phi equals an entangled state, the outcome violates the CHSH Inequality.
For example, running through the above calcs with Phi equal to:
$Phi = \frac{\ket{00}}{\sqrt{2}} + \frac{\ket{11}}{\sqrt{2}}$
You can show the expectation value is $2\sqrt{2}$.
I then calculated the sum with Phi equal to:
$Phi = \ket{00}$
The expectation value I got is $\sqrt{2}$.
My question is two parts.
- First, is this value correct?
- Second, I want to know how to state in words the calculation being done when the states are separated. It seems to me, in the last situation, this is equivalent to what would happen if the bits were classical bits that both happened to be 0. I imagine a scenario where Alice and Bob are both given a classical bit and then asked to measure it. The sum value I am showing is the outcome of the game when the bits they receive are both 0 (played many times to generate a sample size sufficient to obtain the probabilities).
"
"['qiskit', 'programming', 'ibm']"," Title: Graphing T1 using QiskitBody: I am trying IBM's code for graphing T1 and I keep getting the following error:
ibmqfactory.load_account:WARNING:2020-05-28 12:28:57,538: Credentials are already in use. The existing account in the session will be replaced.
/opt/conda/lib/python3.7/site-packages/qiskit/util.py:109: DeprecationWarning: The QuantumCircuit.iden() method is deprecated as of 0.14.0, and will be removed no earlier than 3 months after that release date. You should use the QuantumCircuit.i() method instead.
return func(*args, **kwargs)
The link to the code is here: https://quantum-computing.ibm.com/docs/guide/wwwq/decoherence
"
"['graph-states', 'stabilizer-state']"," Title: Is there a tool that shows me all $2^n$ stabilizers for a given graph state?Body: Is there a tool which takes the adjacency matrix of a graph as input and prints out a table with all stabilizer measurements?
"
"['quantum-gate', 'algorithm', 'qiskit', 'circuit-construction']"," Title: How to construct a multi-qubit controlled rotation with variable angle?Body: I'm trying to construct a circuit that performs the quantum transformation :
Where $f$ is some function. Is there a way to do it without going through every possible value of $i$ ?
"
"['pauli-gates', 'textbook-and-exercises']"," Title: Generalized set of Pauli elements for a basis for the linear transformations on the vector spaceBody: I have been doing some practice problems from ""Gentle introduction to Quantum Computing"". I am a little bit lost with this one:
The generalized Pauli group $\mathcal G_n$ is defined by all elements of $\mathcal G_n$ being of the form $\mu A_1\otimes A_2 \otimes \ldots\otimes A_n$ where $A_j\in\left\lbrace I, X, Y, Z\right\rbrace$ and $\mu\in\left\lbrace 1, i, -1, -i\right\rbrace$.
Show that generalized set of Pauli elements for a basis for the linear transformations on the vector space associated with an n-qubit system.
Is there any formal proof for this problem? And how do I approach it?
"
['q#']," Title: Change single qubit state in Q#Body: I am starting with Q# and I would like to know how can I get the following qubit state:
0.8|0⟩ + 0.2|1⟩
from a qubit initialized as |0⟩.
Thanks in advance!
"
['quantum-gate']," Title: For what kinds of problems is quantum interference used in quantum computers?Body: I know that the wave like nature of the electrons allows the qubits to interfere with each other amplifying correct answers and canceling out wrong answers. But what kind of problems that use this kind of phenomena? I am still a beginner in the field so please point out any mistake I made along the way.
And if there are any research papers or articles regarding my question please let me know.
"
"['quantum-gate', 'entanglement', 'superposition', 'random-quantum-circuit']"," Title: How to create a Quantum circuit to implement the generation of 3-qubit uniform superposition wavefunctionBody: I want to know experimentally or circuit wise diagram to know how to create a circuit that will produce 3-qubit uniform superposition wave function
Can somebody help me in that
Thank you in advance
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: Conversion of python code on Machine learning to realise on quantum processorBody: I need to realise a Python code program on Qiskit. It works on fuzzy logic. How should I realise the same using quantum processors using Qiskit? Is there any support on realising Python code for Fuzzy logic using quantum logic gates. Fuzzy logic uses IF THEN rules. How is this to be done?. Which logic gate would be appropriate for the circuit.
"
"['quantum-gate', 'algorithm', 'machine-learning', 'neural-network']"," Title: Question About Measuring an Operator For Quantum Neural Network PaperBody: I'm currently reading the paper: https://arxiv.org/pdf/1802.06002.pdf
I'm a little bit stuck on the step of how to determine the following quantity:
Where U is a unitary operator acting on $|z,1\rangle$. The paper states the following:
I'm completely confused with the transition between expression 27 to the expression right after. How does applying a Hadamard to the auxiliary qubit result in the expression:
$$\frac{1}{2}(|z,1\rangle + iU|z,1\rangle |0\rangle) + \frac{1}{2}(|z,1\rangle-iU|z,1\rangle |1\rangle)$$
Shouldn't it result in
$$\frac{1}{2}(|z,1\rangle |0\rangle + iU|z,1\rangle |0\rangle) + \frac{1}{2}(|z,1\rangle |0\rangle -iU|z,1\rangle |1\rangle)$$
And if this is the case, I'm confused as to how the probability of the auxiliary qubit being 1 is $\frac{1}{2}-\frac{1}{2}Im(\langle z, 1|U|z,1\rangle)$. Could someone explain why this is the case, and perhaps what I'm missing here?
"
"['ibm-q-experience', 'resource-request', 'physical-realization', 'd-wave']"," Title: Moore's law for quantum computersBody: Moore's law states that performance of classical computers doubles every two years (later revised to 18 months) and a price for computing resources halves during same time period.
Currently, it seems that similar statement can be made for quantum annealers in term of number of qubits (D-Wave). Maybe, also for universal quantum gate-based computers. IBM plans to introduce 53 qubit processor, but so far the highest number of qubits is 20 in Tokyo processor.
My question: Is there any paper/article/business analysis dealing with Moore's law for quantum computer?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Generic 2-qubit gate in qiskitBody: I need to implement a 2-qubit gate of the following form in qiskit (I've barely started using it, so I'm happy to try a different package if that's worth it)
$$ A(\vec c)=\prod_{j=1}^3[I\otimes I\cos(c_j/2)-i\sigma_j\otimes\sigma_j\sin(c_j/2)] $$
(this is taken from this paper https://arxiv.org/abs/1306.2811).
Perhaps qiskit is the wrong tool, but I've been trying to find something in the documentation, but I find it very difficult to parse. There is UnitaryGate https://qiskit.org/documentation/stubs/qiskit.extensions.UnitaryGate.html
and Gate https://qiskit.org/documentation/stubs/qiskit.circuit.Gate.html#qiskit.circuit.Gate,
but apart from saying that the function needs parameters, there isn't any more documentation.
There is also the UnitaryGate.power(x) which could be useful if I knew how to define say a function that returns a generic XX gate.
Yet another option could be to have a function that would take a matrix, such as
g = twoQubitGateFrom4-by-4Matrix( -- some 4x4 matrix that is the desired unitary -- )
Such that later I can apply it some where, e.g.,
myQuantumCircuit.g(3,5)
or even parameterized?
myQuantumCircuit.g(3,5,vecAlpha)
"
"['quantum-gate', 'hadamard']"," Title: Is there a gate that puts a qubit into superposition with a not so purely probabalistic (50 50) outcome?Body: I know that a Hadamard states is a purely probabalistic one; e.g.
$$H\vert 0\rangle=a\vert 0\rangle+b\vert 1\rangle$$
where $a^2=0.5$ and $b^2=0.5$.
Are there any states in which the probabilities differ, and if there are how are they important?
"
"['complexity-theory', 'cryptography', 'shors-algorithm', 'entropy']"," Title: What are the thermodynamic limits of Shor's algorithmBody: The asymptotic time complexity of Grover's algorithm is the square root of the time of a brute force algorithm. However, according to Perlner and Liu, the thermodynamic behavior (theoretical minimum on energy consumption) is asymptotically the same as brute force.
Is there an analogous limit of Shor's algorithm? If so, this could potentially affect some cryptographic protocols.
"
"['simulation', 'cryptography', 'research', 'bb84']"," Title: Is it a good idea to publish a research paper about the simulation of BB84 protocol?Body: I'm an engineering student. As my end of year project I've simulated BB84 protocol using simulaqron(python). I'm thinking about publishing a paper about this simulation.
I haven't published any research paper before, do you have any suggestions about where to publish? or about how to represent my ideas?
"
['quantum-gate']," Title: Quantum NOR GateBody: How to implement NOR gate functionality within a quantum circuit? Having $3$ input bits $f(x) \rightarrow y$, I would like to achieve $y=1$ every time when $x=?00$ is on input ($x=000$ or $x=100$).
"
"['programming', 'q#']"," Title: Passing an array of qubits into Q# using PythonBody: I am trying to learn Q# and have very limited knowledge in Q#. As the title suggests, I am trying to pass an array of qubits into an operation using a python script to call the operation which is written in Q#.
For Example: Consider the following Q# code:
operation SlightlyComplicated(register : Qubit[], pauli : String[]):
Bool { // Does something and returns a bool value
}
The above operation is saved in a file called Program.qs which is saved in the same folder as the python code under the name TempQuant and then here's the python code that is responsible for calling this operation:
import qsharp
from qsharp import Result
from Quantum.TempQuant import SlightlyComplicated
res = SlightlyComplicated.simulate(register = , pauli = ['X', 'Y', 'Z', 'Z'])
print(res)
Since pauli is an array of Strings, it is easy to pass it through python since they share this type, but for types like qubit, Result, Pauli(which are exclusively present in Q#), how am I supposed to pass them through python into their respective counterparts in Q#?
For reference, I am using Visual Studio Code to write the codes.
"
"['qiskit', 'programming']"," Title: Problem with the API-token from IBM TypeErrorBody: English/Englisch:
Hi, could anyone help me please?I have a problem with the API-token
line 8, in random_qubit
IBMQ.load_account('API-token is normally standing here but I delete it for the question')
TypeError: load_account() takes 1 positional argument but 2 were given
If someone has the solution or the same problem, please comment it below this question
And sorry for my bad english.
German/Deutsch:
Hey könnte mir wer bitte helfen? Ich hab ein Problem und zwar
line 8, in random_qubit
IBMQ.load_account('API-Token hab ich heraus gelöscht wegen Kommentar sonst würde hier der API-Token stehen')
TypeError: load_account() takes 1 positional argument but 2 were given
Falls jemand die Lösung bzw das gleiche Problem hat / hatte bitte unter diesen Kommentar kommentieren
"
['measurement']," Title: Projective vs general measurements - a missing pieceBody: This may be a very basic and common question (also discussed a lot), but strikingly enough I couldn't find the answer in the books or elsewhere.
The projective measurement is given by the PVM on the space $H$:
$$\sum P_i = I,$$
where $P_i$ are mutually orthogonal projections.
The post-measurement state of a density matrix $\rho$ is
$$P_i \rho P_i ~/~ \text{Tr}(P_i \rho P_i),$$
with the probability $\text{Tr}(P_i \rho P_i)=\text{Tr}(\rho P_i)$.
The general measurement is given by the set of operators $M_i$ that corresponds to the POVM on $H$:
$$\sum M_i^\dagger M_i = I.$$
The post-measurement state of a density matrix $\rho$ is
$$M_i \rho M_i^\dagger ~/~ \text{Tr}(M_i \rho M_i^\dagger),$$
with the probability $\text{Tr}(M_i \rho M_i^\dagger) = \text{Tr}(\rho M_i^\dagger M_i)$.
Note that POVM itself doesn't describe the post-measurement state, because $M_i^\prime = UM_i$ for some unitary $U$ gives the same POVM but different post-measurement results (I mean states, though the probability will be the same).
It's known that, roughly speaking, general measurements correspond to projective measurements on a larger space. But the best exact statement I could find is that general measurement corresponds to an indirect projective measurement! The indirect measurement is when we add some ancilla state to a target system, perform a unitary evolution of a joint state followed by a projective measurement on that ancilla space and finally trace out the ancilla system.
So, the question is $-$ what if we perform PVM on the whole joint system, not just on the ancilla? Will the post-measurement results correspond to some general measurement?
Formally, let $H$ is the target system, $H_a$ - ancilla space with some fixed density matrix $\rho_0$ on it, $U$ is a unitary on $H \otimes H_a$ and $\sum P_i = I$ is a PVM on the whole $H \otimes H_a$. The post-measurements states of this scheme are
$$ \text{Tr}_a ( P_i U \cdot \rho \otimes \rho_0 \cdot U^\dagger P_i) ~/~ n_i,$$
with the probability $n_i$ where $n_i$ is just the trace of the numerator.
The question is $-$ are there operators $M_i$ such that those post-measurement states equal to $$M_i \rho M_i^\dagger ~/~ \text{Tr}(\rho M_i^\dagger M_i) ?$$
I know how to prove that there exists a unique corresponding POVM $\sum F_i=I$ on $H$ that can be used to compute probabilities, i.e. $n_i = \text{Tr}(\rho F_i)$, but it's not clear how to derive the exact $M_i$ or even prove that they exist.
Update
Also, we can consider a related quantum channel
$$ \Phi(\rho) = \sum_i \text{Tr}_a ( P_i U \cdot \rho \otimes \rho_0 \cdot U^\dagger P_i) $$ and derive Kraus decomposition
$$
\Phi(\rho) = \sum_j K_j \rho K_j^\dagger,
$$
but it still doesn't answer the question. It's not even clear if Kraus decomposition has the same number of summands.
"
"['qiskit', 'programming', 'ibm-q-experience', 'quantum-fourier-transform', 'tomography']"," Title: How to obtain the density matrix using tomography in the real device?Body: I am trying to run the QFT algorithm for n=5 (n number of qubits). The number of experiments that it generates is bigger than the one allowed by the IBM devices (i.e. 75). Therefore, I have tried to used the IBMQJobManager but this is not working as my result is not the counts but the density matrix obtain from the tomography process. Is it possible to make it work? I have made the following attempt (qft is a function that I have created that implements the QFT algorithm):
n=5
beta=0.5*np.pi
state=initial_state_QFT(n,beta)
qr=QuantumRegister(n)
cr=ClassicalRegister(n)
qc=QuantumCircuit(qr)
qc.initialize(state,qr)
qft(qc,n)
qst = tomo.state_tomography_circuits(qc, qr)
job = job_manager.run(qst, backend=device, name='foo',shots=8192)
statefit = tomo.StateTomographyFitter(job.results(), qst)
p, M, weights = statefit._fitter_data(True, 0.5)
M_dg = np.conj(M).T
linear_inversion_matrix = np.linalg.inv(M_dg @ M) @ M_dg
rho = linear_inversion_matrix @ p
rho = np.reshape(rho, (2**n, 2**n))
Thank you in advance for your answer!
"
"['machine-learning', 'unitarity', 'neural-network']"," Title: Initial assumption of the unitary that allows us to estimate the label functionBody: You can find the paper here , in which they describe the architecture of a QNN that can be used to learn binary functions and correctly classify unseen data.
They say that for each binary label function $l(z)$ where $l(z) = -1$ or $l(z) = 1$, there exists a unitary $U_l$ such that, for all input strings $z = z_0z_1...z_{n-1}$ (where each $z_i = -1,1)$, $$\langle z,0 | U_l^{\dagger} Y_{n+1} U_l |z,0 \rangle = l(z)$$
If you assume that $U_l = \text{exp}(i\frac{\pi}{4}l(z)X_{n+1})$, then it can be easily proven that $\langle z,0 | U_l^{\dagger} Y_{n+1} U_l |z,0 \rangle = l(z)$
Now let's consider the subset parity problem. Here, $l(z) = 1-2B(z)$, where $B(z) = \oplus^{n-1}_{j=0} \phantom{a} a_j \cdot \frac{1}{2}(1-z_j)$, which, when plugged into $U_l$ gives us $$\text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \frac{\pi}{2}a_j \cdot \frac{1}{2}(1-z_j))$$
Now, for the subset parity problem, what you want to learn is $\frac{\pi}{2}a_j$, which you do not know beforehand.
So, during learning, you assume that $$U_l(\vec\theta) = \text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \theta_j \cdot \frac{1}{2}(1-z_j))$$ (our goal is to update $\vec\theta$ s.t when we compute the estimated label, we get close to the actual label)
This method seems to be working fine for this problem (I get an accuracy of 96%).
Right now, I am trying to use a QNN for another binary classification problem. Contrary to the subset parity problem, I do not actually know $l(z)$ (which I thought was perfect, because the QNN allows me to design a circuit that correctly classifies my strings). Therefore, I assumed that $$U_l(\vec\theta) = \text{exp}(i\frac{\pi}{4}X_{n+1}) \prod^{n-1}_{j=0} \text{exp}(-i \theta_j \cdot \frac{1}{2}(1-z_j))$$, just like the subset parity problem.
It seems to be working fine. I get an accuracy of 76%, which isn't bad. However, I am not sure if I can assume this and I am starting to wonder if my initial assumption about $U_l$ for this new problem is legit or not (it could be a coincidence or an error in my code).
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Install qiskit in django projectBody: I was wondering if it's possible to use qiskit inside a django project. I found some ways to install jupyter notebooks, but I am not sure what is happening with qiskit.
Ideally I would like to import and use qiskit to a web app with a very simple user interface. I haven't found anything similar.
Any ideas? Thank you!
"
"['algorithm', 'quantum-advantage']"," Title: Does quantum computers give any advantage over classical computers in Sudoku?Body: To my basic knowledge I know that solving a generalized Sudoku problems is an NP-complete problem so, is there any possible way quantum computers give an advantage over classical computers in this type of problem?
"
"['programming', 'ibm-q-experience', 'machine-learning', 'models']"," Title: IBM Q Experience - Can it be used draw out ML inferences?Body: Are there Quantum-enhanced Machine Learning algorithms that can be implemented via Qiskit in IBM Q Experience and obtain valuable inferences faster than their classical counterparts from datasets of let's say Kaggle?
Please also link important papers and articles that you think are worth reading. Thank you!
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Problem with code in 'Learning quantum computation using qiskitBody: I've started learning quantum computing using 'Learn quantum computation using qiskit',
and I've stumbled upon what I think is a bug in the code in chapter 1.3: Representing Qubit States
when I reached the part and run the code:
qc = QuantumCircuit(1)
initial_state = [0,1]
qc.initialize(initial_state, 0)
qc.draw()
It returned 'Attribute Error'
Saying that 'Initialize' object has no attribute 'label'
"
"['circuit-construction', 'mathematics', 'photonics']"," Title: How do I add 1+1 using a photonic computer?Body: A similar question has been previously asked & has an excellent answer discussing half, full & ripple carry adders. I am curious to find out how these adders would be constructed in the setting of photonic quantum computers (eg. with continuous variable qumodes instead of qubits).
"
"['quantum-gate', 'circuit-construction']"," Title: quantum gates hamiltonianBody: How could we construct a circuit with quantum gates for desired time-dependent hamiltonian?
For example suppose we wanna construct for below 3 types of hamiltonian :
- a simple hamiltonian and time_independent without dissipation :$ 2\sigma_x+ 3 \sigma_z$
- a time dependent hamiltonian without dissipation : $2\sigma_x+ 3t \sigma_z$
- time dependent hamiltonian with dissipation
Is there a general solution for construct gates for these hamiltonians ?
"
['physical-qubit']," Title: How promising is the possibility of carbon-based qubits to make a qubit that’s stable at room temperature?Body: Here is the first article I could find on this idea in 2016:
https://arxiv.org/abs/1611.07690
And here is a patent in 2017 for a quantum electronic device developed with one of the authors of the paper, Mohammad Choucair along with Martin Fuechsle (who invented a single atom transistor):
https://patentscope.wipo.int/search/en/detail.jsf?docId=WO2017091870
The two are now working at Archer Materials to commercialize this idea.
Fuechsle is known for inventing a single-atom transistor, which has applications to the mentioned quantum device:
https://www.researchgate.net/publication/221840938_A_single-atom_transistor
This leads me to my questions:
- How promising is a carbon-based qubit? Any disadvantages to this approach?
- If topological quantum computing prevails, could a room temperature qubit based on carbon still be beneficial to topological quantum computing?
- Is anyone outside of Archer Materials researching this approach?
"
"['physical-realization', 'decoherence', 'photonics']"," Title: Do photons also suffer from decoherence?Body: In this Question Why do optical quantum computers not have to be kept near absolute zero while superconducting quantum computers do?
A comment said that the most common way to encode q information in photons is using their internal degrees of freedom, not using a ""there/not there"" encoding.
So does that mean that optical quantum computers that use photons doesn't suffer or suffers less from decoherence?
What sort of environmental noise causes decoherence?
What is the expected number of qubits that will allow us to build a universal quantum computer?
"
['speedup']," Title: Could a quantum computer simulator be faster than a normal computer when running on a normal computer?Body: I'm very new to quantum computing. I was just wondering if a quantum computer simulator could be faster than a normal computer when running on a normal computer. Could it?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: Find the number of elements in the Schmidt decomposition of a pure stateBody: Consider a pure state $\boldsymbol{\eta} \in \mathcal{H}_{AB}$. There exist orthonormal sets $\{\alpha_1, \alpha_2 \dots \alpha_i\} \subset \mathcal{H}_A$ and $\{\beta_1, \beta_2 \dots \beta_i\} \subset \mathcal{H}_B$, and real numbers $\lambda_k > 0$ such that
\begin{equation*}
\boldsymbol{\eta} = \sum_{i=1}^d \lambda_i \alpha_i \otimes \beta_i
\end{equation*}
My question is if it is it possible (if so, how?) to find $d$ without using the decomposition above.
What I have done so far is that I have set $\text{dim}\mathcal{H}_A=m$ and $\text{dim}\mathcal{H}_B = n$. This means that $d \leq \min(m,n)$. Besides this, I do not know what to do. I know about a theorem called Caratheodory's theorem, but I am not sure if it will help me here. Can I use any of this to show that $d$ only depends on $\boldsymbol{\eta}$? Thanks!
"
"['quantum-gate', 'algorithm', 'quantum-state', 'circuit-construction', 'textbook-and-exercises']"," Title: What are the possible qubit states?Body: For a quantum state on the form $$|\psi \rangle = \alpha |0 \rangle + \beta |1 \rangle$$ which possible qubit states can you construct from this? I know that $\alpha$ and $\beta$ must satisfy $$|\alpha|^2 + |\beta|^2 = 1$$ but are there any other requirements besides this?
"
"['quantum-gate', 'q#']"," Title: How can I code a Conditional phase shift transform?Body: I am interested in implementing a operation in Q#. The operation should follow the algorithm below:
When $A=0$ it is quite easy to see that the algorithm states if the qubitt is in nullspace apply a transformation to flip the sign of the qubit.
I am not sure how to use the algorithm for the 'i is in A' case.
"
"['quantum-gate', 'circuit-construction']"," Title: Are these two circuits equivalent (using swap gates with control qubits)?Body:
Hi. I'm trying to make a circuit including some Toffoli gates in Qiskit.
The problem is that, because of connectivity between qubits, some gates should be modified to satisfy it.
I've read this post similar to this problem: How is it possible to perform a c-not on 4 qubits using the same control qubits on IBM Q computers?
This helped me a lot, but I'm still uncertain that these two circuits are equivalent &
SWAP gates applied to $q_1, q_2, q_3$ don't affect after all works are done.
Thanks a lot.
"
"['ibm-q-experience', 'history']"," Title: Names of IBM Q backendsBody: IBM Q backends have many different names, see for example this link. We have for example processors called Melbourne, Tokyo, Armonk etc.
I am curious where these names come from? For example, I know that IBM headquarter is placed in Armonk, NY. But what about others? Is there any special logic behind naming IBM processors?
"
"['programming', 'resource-request', 'physical-realization']"," Title: Software used for modelling quantum processorsBody: What kind of software is used for modelling quantum processor architectures? Not just simulate the output, but the one that is actually used in research.
"
"['quantum-gate', 'algorithm', 'circuit-construction', 'hadamard']"," Title: Hadamard Overlap TestBody: I am trying to understand a test called Hadamard Overlap Test, which consists of a destructive swap test (section IV of swap test and Hong-Ou-Mandel effect are equivalent) right after a Hadamard test. The circuit is from the Variational Quantum Linear Solver paper:
The authors claim that ""conditioning the measurement on the ancilla qubit to yield the $|\boldsymbol{0}\rangle$
state, we can perform the depth-two Overlap circuit between registers S1 and S2 to get"":
\begin{equation}
\begin{aligned}
P(0) &=\frac{1}{2}\left(\left\langle\mathbf{0}\left|U^{\dagger} V\right| \mathbf{0}\right\rangle\left\langle\mathbf{0}\left|V^{\dagger} U\right| \mathbf{0}\right\rangle\right.+\left\langle\mathbf{0}\left|U^{\dagger} A_{l^{\prime}} A_{l} V\right| \mathbf{0}\right\rangle\left\langle\mathbf{0}\left|V^{\dagger} A_{l}^{\dagger} A_{l^{\prime}}^{\dagger} U\right| \mathbf{0}\right\rangle \\
&\left.+\operatorname{Re}\left[\left\langle\mathbf{0}\left|U^{\dagger} A_{l} V\right| \mathbf{0}\right\rangle\left\langle\mathbf{0}\left|V^{\dagger} A_{l^{\prime}}^{\dagger} U\right| \mathbf{0}\right\rangle\right]\right)
\end{aligned}
\end{equation}
$|\boldsymbol{0}\rangle$ represents a vector of 0 qubits, those making up the registers $S_1$ or $S_2$.
I can't understand how to derive this result. In particular, I have the following questions:
- What are we exactly measuring by $P(0)$? From the circuit, it seems like all the qubits are measured, and that is also the case when you do a swap test according to the reference above. I initially thought that $P(0)$ is the probability of getting 0 in the ancilla, but this should not be the case, because otherwise what is the effect of the CNOT and H performed? What I mean is that the gates inside the box are not controlled on the ancilla, so they cannot change the outcome of the ancilla.
- How do you get to this result? Below is my attempt and what I achieved so far
\begin{equation}
\begin{aligned}
& |0 \rangle |\boldsymbol{0} \rangle |\boldsymbol{0} \rangle \xrightarrow{V, U} |0 \rangle V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle \xrightarrow{H}\frac{1}{\sqrt{2}}\left(|0 \rangle +|1 \rangle \right)V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle \xrightarrow{A_l, A_{l'}^{\dagger}}\\ &\frac{1}{\sqrt{2}}\left(|0 \rangle V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle +|1 \rangle A_lV|\boldsymbol{0} \rangle A_{l'}^{\dagger}U|\boldsymbol{0} \rangle \right) \xrightarrow{H}\\
& \frac{1}{2}\left[|0 \rangle(V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle +A_lV|\boldsymbol{0} \rangle A_{l'}^{\dagger}U|\boldsymbol{0} \rangle )+|1 \rangle (V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle -A_lV|\boldsymbol{0} \rangle A_{l'}^{\dagger}U|\boldsymbol{0} \rangle )\right]
\end{aligned}
\end{equation}
Now, one measures the ancilla, if it results in a 0 state, the system collapses in
\begin{equation}
\frac{1}{2}(V|\boldsymbol{0} \rangle U|\boldsymbol{0} \rangle +A_lV|\boldsymbol{0} \rangle A_{l'}^{\dagger}U|\boldsymbol{0} \rangle)
\end{equation}
How does one implement the the CNOTs and H now? What are the further steps that yields the results of the authors?
"
"['algorithm', 'hamiltonian-simulation']"," Title: Product of block-encoded matricesBody: I am trying to understand just the first step of the proof fo Lemma 53 of this paper, with scarce success.
Before starting, let me state this definition:
Definition: Block encoding of operator A.
Let $A$ be a $s$-qubit operator, and $\alpha, \epsilon \in \mathbb{R}_+$ and $a \in \mathbb{N}$. Then, we say that a $(s+a)$-qubit unitary $U$ is a $(\alpha, a, \epsilon)$ block encoding of $A$ if:
$$\|A - \alpha(\langle0|^{\otimes a} \otimes I) U (|0\rangle^{\otimes a} \otimes I) \| \leq \epsilon $$
This is the statement I would like to prove:
Lemma 53: (Product of block-encoded matrices)
If $U$ is an $(\alpha, a, \delta)$-block encoding of an $s$-qubit operator $A$, and $V$ is an $(\beta,b,\epsilon)$-block encoding of a s-qubit operator $B$, then $(I_b \otimes U)(I_a \otimes V)$ is an ($\alpha\beta, a+b, \alpha\epsilon + \beta\delta)$-block encoding of $AB$.
The first step of the proof is writing the definition of block encoding, which for this case s:
$$\| AB - \alpha\beta(\langle 0| ^{\otimes a+b} \otimes I )(I_b \otimes U)(I_a \otimes V)(|0\rangle^{\otimes a+b} \otimes I) \| =$$
I understand all the steps of the proof, but I don't understand the first passage. Why the previous equation should be equal to:
$$=\|AB - \alpha(\langle 0| ^{\otimes a} \otimes I )U(|0\rangle ^{\otimes a} \otimes I )\beta(\langle 0|^{b} \otimes I)V(|0\rangle^{\otimes b} \otimes I) \| $$
This looks similar to the cases where I can apply the property that:
$$(A \otimes B)(|x\rangle \otimes |y\rangle) = (A|x\rangle \otimes B|y\rangle) $$
But I really don't see how in this case. I suppose there is some abuse of notation hidden somewhere. Probably, knowing the dimension of the various $I$ identity matrices would help the understanding..
Remark: in the statement of the Theorem there is a small footnote where they claim
"The identity operators act on each others ancilla qubits, which is hard to express properly using simple tensornotation, but the reader should read this tensor product this way."
"
"['quantum-state', 'unitarity', 'textbook-and-exercises']"," Title: Bipartite states whose coefficients are entries of a unitary matrixBody: I've been trying to solve this question
It seems that in order to show it has unit length, we must show that $$ \frac{1}{d} \sum_{m, n=0}^{d=1} \lvert U_{m, n}\rvert ^2 = 1 $$
I've tried searching online for this type of relation on unitary matrices but haven't succeeded in finding anything. Would appreciate any help.
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises']"," Title: How to decompose a unitary single qubit gate by universal quantum gate set?Body: How to decompose a unitary single qubit gate? I have read some paper or books, which told me a unitary single qubit gate could be decomposed by universal quantum gates set. For example {phase gate, Hadamard gate} is one of them. But they don't tell me how to do. I just understand the method of decomposition is exist, but I don't know how to decompose. The existence is proved by Solovay–Kitaev theorem, and some paper also show that {phase gate, Hadamard gate} can be used as a universal quantum gate set. But is there a pratical method to solve ""how to use {phase gate, Hadamard gate} to decompose a single qubit quantum gate? I want to know about the specific procedure.For example, How to use {phase gate, Hadamard gate} to decompose Pauli Z ?
"
['terminology']," Title: Why do we say 'classical computer' to mean 'digital computer'?Body: The term 'classical computer' is always used to mean standard digital computation (Turing model, Boolean circuits or just good old RAM). I have never seen it to mean other models of computation based on classical physics (such as analog computation). This is evident when papers talk about the classical complexity of a problem, when what is meant is the complexity defined given a digital model of computation.
Do we gain anything by 'classical' instead of 'digital', or is it just a shibboleth?
"
"['programming', 'simulation', 'machine-learning', 'tfq']"," Title: How to turn off multiprocessing in TensorFlow QuantumBody: Some background: I'm currently running the same training algorithm with a classical neural network and a quantum circuit, respectively. The NN is implemented in Keras with a TensorFlow backend, the circuit is implemented in TFQ.
My circuit has only 4 qubits and 88 trainable parameters, and training is still at least a factor 10 slower than training a NN with two dense layers (10 units each) and 182 trainable parameters. (All hyperparameters are identical.) At this moderate circuit size I don't expect circuit training to be that much slower than training the classical NN.
Looking at the CPU usage, I see that TFQ uses all cores, but only to a fraction. My suspicion is that the circuit is too small to reach the threshold where multiprocessing makes sense, so this might be a source of the slowness. However, I can't seem to find a way to turn multiprocessing off.
Question: Is there a way to disable multiprocessing in TensorFlow Quantum?
"
"['entanglement', 'quantum-operation', 'noise', 'bell-basis', 'textbook-and-exercises']"," Title: What happens when you send a Bell state through depolarizing channel?Body: For noise parameter $Q$ and a density matrix $\rho$, we know that the depolarization channel $\mathcal{E}$ would act like:
$$
\mathcal{E}(\rho) = (1 - Q)\rho +Q\frac{I}{2},
$$
where $I$ is the identity matrix in 2 dimensions. Now, an interesting question is, what happens to a Bell state $|\Phi^{+}\rangle = \frac{1}{2}(|00\rangle + |11\rangle)$, when we apply $\mathcal{E}$ to each qubits of the Bell state separately. What would be the resulting state?
Meaning, what is:
$$
(\mathcal{E} \otimes \mathcal{E})(|\Phi^{+}\rangle \langle\Phi^{+}| )
$$
Remembering that, operation on the first qubit would collapse the state. Is it physically possible?
"
"['quantum-gate', 'hamiltonian-simulation', 'pauli-gates', 'error-mitigation']"," Title: What do coupling coefficients mean in terms of Pauli gates, and why are they time dependent?Body: I am reading this error mitigation paper by the IBM team and I am slightly confused about the meaning of "coupling coefficients" when describing multi-qubit Hamiltonian.
I have only seen coupling coefficients in terms describing interaction between atom and external electric field. What do these coefficients mean in terms of pauli gates and why are they time dependent?
"
"['physical-realization', 'architecture']"," Title: How to build a quantum computer in your house?Body: As still quarantine is going on for some of us. I was wondering how to make a Quantum Computer in your garage. What may be the total cost for building one?
Was inspired by this youtube video.
"
"['mathematics', 'error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: How to get the stabilizer group for a given state?Body: Let's say we have the GHZ state with 3 qubits:
$$ |\mathrm{GHZ}\rangle = \dfrac{1}{\sqrt{2}}\Big(|000\rangle + |111\rangle \Big)$$
I want to find the stabilizer group of this state, that is, the $M_i$ operators such that $M_i|\mathrm{GHZ}\rangle = |\mathrm{GHZ}\rangle$ with $M_i \in P_3$, being $P_3$ the Pauli group for $3$ qubits.
Of course, in this case, by testing with brute force we can find:
$$\begin{align}
M_1 &= XXX\\
M_2 &= ZZ1\\
M_3 &= Z1Z\\
M_4 &= 1ZZ
\end{align} $$
But I do have a couple of questions:
- Shouldn't I get $3$ stabilizers instead of $4$? because as I understand it, the number of stabilizers is given by $n-k$ where $n$ is the number of physical bits and $k$ is the number of logical or information bits, and in our case we have $n=3,\ k=0$.
- There is no more rigorous method to find the stabilizers, without having to try all the combinations? perhaps through the Hamming matrix as in the classical codes?
"
['circuit-construction']," Title: How to do quantum circuit arithmetic?Body: I'm looking at a circuit from this paper on quantum machine learning.
So to introduce my own notation:
- we start with $|\psi_0⟩ = |0,a,b⟩ = a_0b_0|000⟩ + a_0b_1|001⟩ + a_1b_0|010⟩ + a_1b_1|011⟩$
- after the first $H$-gate we have $|\psi_1⟩$
- after the controlled-SWAP we have $|\psi_2⟩$
- after the second $H$-gate we have $|\psi_3⟩$
The paper says that at the end we measure $|0⟩$ for the top qubit with the following probability:
$$
P(|0⟩_{\psi_3}) = \frac{1}{2} + \frac{1}{2}|⟨a|b⟩|^2
$$
As I'm new to this I decided to do the expansion by hand.
The first two rows are grouped for $\vert 0xx\rangle$ and the second two rows are for $\vert 1xx\rangle$. As I understand, I can get $P(|0⟩_{\psi_3})$ by summing the probability amplitudes for the first two rows.
Here's what's baffling me:
The first two rows are basically what you would get back if you skipped the controlled-swap. You'd just come back to $|\psi_0⟩$. And as before, you'd get:
$$
P(|0⟩_{\psi_0}) = |a_0b_0| + |a_0b_1| + |a_1b_0| + |a_1b_1|
$$
So that means the probability amplitudes of the first two rows sum up to 1. Which leaves me very confused because there are still two more rows to consider which would add on another $|a_0b_1| + |a_1b_0|$.
Thanks for your time!
"
"['error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: What is the stabilizer group of a $|W\rangle$ state?Body: This question is related and complementary to this one:
How to get the stabilizer group for a given state?
What I want is to find the stabilizer group generators for the following state:
$$|W\rangle = \dfrac{1}{\sqrt{3}}\Big(|011\rangle + |101\rangle + |110\rangle \Big)$$
In theory, I should find $n-k = 3-0=3$ independent non trivial generators.
But the only one I can find is $M_1 = Z\otimes Z\otimes Z$ because any other combination, like $-Z\otimes Z\otimes -Z$ or $iZ\otimes iZ\otimes -Z$ actually is equivalent to the first one, and there cannot be a combination with $X$ because it would alter the difference between 0s and 1s that is conserved in each sum.
Where are the other two generators?
"
"['ibm-q-experience', 'grovers-algorithm', 'tensor-product']"," Title: Grover oracle result: vectors (0,1) & (0,1) => two Hadamards => product of two H results => CZ = (.5, .-5, -.5, -.5)Body: According to the Grover's algorithm section in the IBM Quantum Experience, if I have two qubits in the ""one"" state (vectors (0,1) and (0,1)), and I apply a Hadamard gate to each of them, and then input the tensor product output to a CZ gate, my resulting amplitudes should be (.5, .5, .5, and -.5). However, no matter how I fiddle with the matrices, my resulting amplitudes are (.5, -.5, -.5, and -.5) Am I screwing up the product of the results of the two Hadamards?
"
['shors-algorithm']," Title: Shor's Discrete Logarithm Algorithm with a QFT with a small prime baseBody: Suppose you replace both QFTs in Shor's discrete logarithm algorithm with simpler QFTs with small prime base w. Does this algorithm extract the discrete logarithm modulo w? It seems it does, provided you guarantee that the full discrete logarithm is not too large, and that the Hadamards in the second register only generate a smaller range of values, $max(b)$ such that $max(b)max(\alpha) < p-1$, where $\alpha$ is the full discrete logarithm. So for instance, if $max(b)$ = $max(\alpha)$ = $\frac{2^{\lfloor \log p \rfloor}}{64}$, then the modified Shor's algorithm will output $\alpha \mod w$. The modified Shor circuit will end in state:
$$
\sum_{c=0}^{2^{\lceil \log p \rceil}} \sum_{d=0}^{max(b)} \sum_{a=0}^{2^{\lceil \log p \rceil}} \sum_{b=0}^{max(b)} \exp(\frac{2 \pi i}{w}(ac+bd))|c,d,g^ax^{-b} \mod p\rangle
$$
The restricted range of $b$ works for the following reason. If we write $y \equiv g^k$ (the power of $x$ can be written as a power of $g$), then $a-rb \equiv k \mod (p-1)$ and
$$
a = rb + k - (p-1)\lfloor \frac{br+k}{p-1} \rfloor
$$
$a$ should have the entire range of $2^{\lceil \log p \rceil}$ and $b$ should be restricted to $max(b)$. This isn't a problem because any $a$ will have a $k$ which ranges from $0$ to $p-1$, so $a$ and $b$ will always have solutions. $r$ in the substitution should be chosen to be in the range $[0,max(r)]$ in order to avoid errors with taking the second modulus.
Following Shor, the amplitude is
$$
\frac{1}{w\sqrt{ max(b)max(a)}} \sum_{b=0}^{max(b)} \exp\big( \frac{2\pi i}{w}(brc+kc+bd-c(p-1)\lfloor \frac{br+k}{p-1} \rfloor)\big)
$$
Factor out a factor of $\exp(2\pi i \frac{kc}{w})$ that doesn't affect the probability and get
$$
\frac{1}{w\sqrt{ max(b)max(a)}} \sum_{b=0}^{max(b)} \exp(\frac{2\pi i}{w}bT)\exp(\frac{2\pi i}{w}V)
$$
where
$T = rc + d - \frac{r}{p-1}\{c(p-1)\}_w$ and
$V = \big( \frac{br}{p-1} - \lfloor \frac{br+k}{p-1} \rfloor\big) \{c(p-1)\}_w$
$V$ is automatically small as in the normal algorithm. For $T$, those $c,d$ such that $rc+d=0\mod w$ encode the period modulo $w$. $\frac{\{c(p-1)\}_w}{w} < 1$, so if $\frac{max(b)r}{p-1} << 1$ then the exponentials for all terms will be close to 1 for pairs $c,d$ such that $rc+d=0\mod w$, so that the $max(b)+1$ sums will all be constructive. If $rc+d \neq 0 \mod w$, then $\exp(\frac{2\pi i}{w}bT)$ will contain terms at least as ""cycled through"" as $\exp(\frac{2\pi i}{w}max(b))$, and destructive interference will guarantee their sum is nearly 0.
From the Chinese Remainder Theorem, multiple runs with different small primes can be used to reconstruct the entire discrete logarithm. Note that the small prime circuit has the same asymptotic complexity as the full discrete logarithm circuit and would require O(n) runs to construct the entire logarithm, so it would be much slower in practice. All notation is from Peter Shor's original paper, except for $\alpha$.
https://arxiv.org/abs/quant-ph/9508027
"
"['quantum-gate', 'circuit-construction', 'solovay-kitaev-algorithm']"," Title: Understanding the length of the sequence obtained via Solovay-Kitaev decompositionBody: I have downloaded two codes of SK algorithm from GitHub and try to understand how to decompose a unitary single qubit gate. These code are https://github.com/DEBARGHYA4469/Quantum-Compiler and https://github.com/cryptogoth/skc-python.
As SK algorithm needs two parameters - an unitary single qubit gate $U$ and deepth $n$. I tried to put $n=2$ and make a unitary qubit gate as $U$. If I set the accuracy $\epsilon = 0.125$, which means the sequence should include $O(\log 3.97\cdot 0.05)$ gates. I calculated it ($\log 3.97 \cdot 0.01$ is around 2). But actually the sequence I get from code is far more than 2 gates:
SHTHTHTHTHHTHTHTHTHTHTHHTHhthhththththshthhththththtSTHTHSHTHSHTHTHTHTHHTHTHTHHTHTHTHTHSHTHhthththhththththshththththTHTHSHHSTHTHShthshthshthtsTHTHTHTHTHHTHSHTHTHTHTHHTHhthhththththththhththththsshthtshhshthtHTHTHTHTHSHTHTHTHTHHTHTHTHhthshththththhthththhththtTHTHSHTHSHTHSTHSSTHTHSTHHHshthshthshththhhtshthtsshtHHTHTHHHHTHSH
ACCURACY 0.053661016216388954
So I just want to know why?
"
"['qiskit', 'programming']"," Title: Transpiler Error: Number of qubits greater than maximum in coupling mapBody: Transpiler Error: Number of qubits (2) in circuit11 is greater than maximum (1) in the couplings map
# Initialize two qubits and create Entanglement using Hadamard and CX/CNOT Gate
q = qiskit.QuantumRegister(2)
c = qiskit.ClassicalRegister(2)
qc = qiskit.QuantumCircuit(q, c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q, c)
job_exp = qiskit.execute(qc, backend=backend, shots=1024, max_credits=3)
Error:
---------------------------------------------------------------------------
TranspilerError Traceback (most recent call last)
<ipython-input-11-7b13276b10ae> in <module>()
9 qc.cx(q[0], q[1])
10 qc.measure(q, c)
---> 11 job_exp = qiskit.execute(qc, backend=backend, shots=1024, max_credits=3)
2 frames
/usr/local/lib/python3.6/dist-packages/qiskit/execute.py in execute(experiments, backend, basis_gates, coupling_map, backend_properties, initial_layout, seed_transpiler, optimization_level, pass_manager, qobj_id, qobj_header, shots, memory, max_credits, seed_simulator, default_qubit_los, default_meas_los, schedule_los, meas_level, meas_return, memory_slots, memory_slot_size, rep_time, parameter_binds, schedule_circuit, inst_map, meas_map, scheduling_method, **run_config)
249 seed_transpiler=seed_transpiler,
250 optimization_level=optimization_level,
--> 251 backend=backend)
252
253 if schedule_circuit:
/usr/local/lib/python3.6/dist-packages/qiskit/compiler/transpile.py in transpile(circuits, backend, basis_gates, coupling_map, backend_properties, initial_layout, layout_method, routing_method, seed_transpiler, optimization_level, pass_manager, callback, output_name)
205 callback, output_name)
206
--> 207 _check_circuits_coupling_map(circuits, transpile_args, backend)
208
209 # Transpile circuits in parallel
/usr/local/lib/python3.6/dist-packages/qiskit/compiler/transpile.py in _check_circuits_coupling_map(circuits, transpile_args, backend)
245 'in {} '.format(circuit.name) +
246 'is greater than maximum ({}) '.format(max_qubits) +
--> 247 'in the coupling_map')
248
249
TranspilerError: 'Number of qubits (2) in circuit11 is greater than maximum (1) in the coupling_map'
"
"['qiskit', 'programming', 'ibm-q-experience', 'noise']"," Title: How to not optimize the quantum gates in a qiskit circuit when running it in the real device?Body: I have been trying to run two circuits in the ibmq_london device, the one resulting of applying one X gate on qubit $0$ and the one that applies two X gates. I know that applying two X gates is the same as doing nothing because of its properties, but I am interested in the study of noise so I really want Qiskit to apply both gates. I have tried to place a barrier between both X gates but it does not seem to be working because I obtain the following results:
X circuit

XX circuit
I have tried to write the following code:
job_device = execute(qc, device,shots=8192,basis_gates=None,optimization_level=0)
for the execution, but it does not seem to be working as due to the effect of noise I will expect a lower value for the XX circuit (two gates applied), even taking into account the thermal relaxation.
"
"['quantum-state', 'qiskit', 'programming', 'q#', 'initialization']"," Title: How can I initialize a state with chosen amplitudes in Qiskit?Body: I was trying to initialize to an arbitrary state of n qubits with the initialize() from Qiskit but it doesn't generate a state with the same amplitudes passed as an argument, instead, it creates a state that when compared to the wanted state will have fidelity equals $1$. (described here)
My question is: Is there any method that can generate a state that will have numerically same wanted amplitudes ?
Edit: Just found the PrepareArbitraryState in Q# that does the same thing, they are based in the same paper but some results seen different between then. If someone could explain me the technical differences between then it will be perfect.
Edit(2): Here is the test cited in the Qiskit tutorial:
$\left|\psi\right\rangle = \frac{i}{4}\left|000\right\rangle + \frac{1}{\sqrt{8}}\left|001\right\rangle + \frac{1+i}{4}\left|010\right\rangle + \frac{1+2i}{\sqrt{8}}\left|101\right\rangle + \frac{1}{4}\left|110\right\rangle$
Applied to Q# (this result is the same as input and is what I want):
|0⟩ 5.970914908063292E-17 + 0.25000000000000017𝑖
|1⟩ 0.3535533905932739 + 3.251767952832691E-17𝑖
|2⟩ 0.2500000000000002 + 0.25000000000000017𝑖
|3⟩ -2.4061305817955694E-17 + -4.7860913024955035E-18𝑖
|4⟩ -4.845288669732255E-17 + 1.506300336842906E-16𝑖
|5⟩ 0.3535533905932743 + 0.7071067811865478𝑖
|6⟩ 0.2500000000000002 + -7.897235558417238E-17𝑖
|7⟩ 4.7022165029227935E-18 + -4.194489669218219E-17𝑖
Applied to Qiskit (same as the cited tutorial, have fidelity(input, output) = 1, but it doesn't match with the Q# result and it is not what I want):
|0⟩ 2.50000000e-01 + 0.j
|1⟩ 2.77555756e-17 - 0.35355339j,
|2⟩ 2.50000000e-01 - 0.25j
|3⟩ 0.00000000e+00 + 0.j
|4⟩ 0.00000000e+00 + 0.j
|5⟩ 7.07106781e-01 - 0.35355339j
|6⟩ 5.89805982e-17 - 0.25j
|7⟩ 0.00000000e+00 + 0.j
"
"['qiskit', 'programming', 'simulation']"," Title: How to run an approximate simulation, and whyBody: I'm looking at the Qiskit getting started documentation, https://qiskit.org/documentation/getting_started.html. They create a quantum circuit and run an approximate simulation on it 1000 times:
- Why bother with an approximate solution when you can get an exact solution? In this case, you can simulate everything with matrices and get this result:
$$
\begin{bmatrix}{1 \over {\sqrt 2}} \\ 0 \\ 0 \\ {1 \over {\sqrt 2}}\end{bmatrix}
$$
From this you know the exact probabilities of each output: 00 occurs $1 \over 2$ the time, 11 occurs $1 \over 2$ the time. Is an exact simulator available in Qiskit?
- How does an approximate simulator work? For instance, after passing through the Hadamard gate, we have the qubit
$$
\begin{bmatrix}
{1 \over {\sqrt 2}} \\
{1 \over {\sqrt 2}}
\end{bmatrix}
$$
At that point, does the simulator immediately collapse the qubit to $|0\rangle$ or $|1\rangle$ to avoid potential superpositions? Or would that not be sufficient, and an approximate simulator is more complicated?
"
"['qiskit', 'programming']"," Title: Jordan-Wigner $\leftrightarrow$ Bravyi-Kitaev transformation in QiskitBody: A couple of questions regarding the conversion between Jordan-Wigner (JW) and Bravyi-Kitaev (BK) states in Qiskit.
The JW $\rightarrow$ BK conversion matrix I refer to below is the one from equation (29) here. (I'm not referring to equation (24) in Ibid. for it contains a typo.)
- Is there a way to generate a circuit which would map JW-encoded states to BK-encoded states? (The circuit is actually very simple since it multiplies the input $n$-qubit vector by a $n\times n$ matrix $\operatorname{mod} 2$; since the matrix is upper-triangular, it is rather trivial to construct it out of CNOTs.)
- Assuming that the answer to the previous question is NO: is there a way to, at least, generate the matrix implementing the conversion between the Jordan-Wigner and Bravyi-Kitaev states, for a given number of qubits $n$?
"
"['ibm-q-experience', 'qasm']"," Title: Who cares about Transpiled Circuit Text?Body: At any result of a job in this last version of the Circuit Composer, at the OpenQasm tab inside the Circuit Diagram, I am unable to use the tradicional copy or ctrl-c to get the transpiled circuit selected text for further studies.
Is this an error or it is functioning correctly, because in before versions it was possible doing it?
"
"['quantum-state', 'simulation']"," Title: A question about how to emulate quantum states and computation on classical computerBody: I have understood the concept of ""universal quantum gates"" in real quantum computer, and the quantum gates and states can be emulated as matrix in classical computer, and the matrix operation can be regarded as gate operation. In real quantum system, we can realize a set of universal quantum gates to decompose any unitary quantum gates to reduce the complexity.
So I want to know is if in a quantum emulator there is the same procedure of decomposition, or just matrix operations without any decomposition? Because from my perspective, if it can be emulated as a matrix operation, it seems there is no need to do the procedure of decomposition.
"
"['quantum-gate', 'mathematics', 'pauli-gates', 'terminology', 'clifford-group']"," Title: What are boost and shift operators and why are they called so?Body: In some texts I see $X$ and $Z$ Pauli operators as being said as boost and shift operators respectively.
But I came across some text that defines its own operators, namely:
$$
X \vert j\rangle = \vert j+1\,\mod\,d\rangle \\
Z \vert j\rangle = \omega^j\vert j\rangle, \quad \omega = \exp \left( \frac{2\pi i}{d} \right)
$$
I am confused as to what is the standard meaning of it, and why such a name.
Update: I realized Boost operator has something to do with quantum mechanics, where it is said to:
shift expectation value of momentum
Since I am not from physics background, it would be great if someone could explain it in simple words.
"
['hamiltonian-simulation']," Title: Why does one need a non-commuting Hamiltonian for an algorithm to exhibit ""quantumness""Body: In two places so far, I've heard statements of the sort ""... and we need the Hamiltonian to be non-commuting. If not, the algorithm is classical, and we get no benefit from using a quantum computer.""
For reference, here are two timestamped youtube links to my examples:
So why is this the case? Looking for any good answers, but for me 1 to 3 intuitive ""ways of looking at it"" works best, even if they aren't airtight explanations.
"
"['qiskit', 'programming']"," Title: Trotterizing a Pauli sum in QiskitBody: In Qiskit, how do I construct a circuit corresponding to the Trotter expansion of a Pauli sum $A+B+C+\ldots$ given as a WightedPauliSum object?
$$
\operatorname{e}^{A + B + C + \ldots } \overset{?}{\mapsto}
\left\{\begin{alignedat}{9}
U &= \operatorname{e}^{A}\operatorname{e}^{B}\operatorname{e}^{C}\ldots \ &&, \quad &&\text{(first order)}\\
U &= \operatorname{e}^{A/2}\operatorname{e}^{B/2}\operatorname{e}^{C/2}\ldots\operatorname{e}^{C/2}\operatorname{e}^{B/2}\operatorname{e}^{A/2} \ &&, \quad &&\text{(second order)}\\
& \ldots
\end{alignedat}\right.
$$
I guess, PauliTrotterEvolution should do the job, but I have not found a tutorial.
"
"['pauli-gates', 'qaoa']"," Title: Why do we transform a Boolean variable into a a Pauli Z matrixBody: Under Qiskit QAOA's tutorial (https://qiskit.org/textbook/ch-applications/qaoa.html), the authors specify that a cost function $C(x)$ representing the optimization objective of a Binary Combinatorial Optimization problem (x is a vector or list of Boolean variables) can be mapped to a hamiltonian in $H^{2^n}$ via the transformation
$x_i \rightarrow \frac{1}{2}(1-Z_{i})$ where $x_i$ is a Boolean variable of $x$ and $Z_i$ is the pauli-Z operator applied to qubit i.
I was wondering what was the intuition behind the transformation and if there is a way to propose different alternatives.
Thank you!
"
"['qiskit', 'programming', 'textbook-and-exercises']"," Title: Unable to use qiskit_textbook moduleBody: When I tried to use the Qiskit textbook module, it threw the following error:
Command was:
from qiskit_textbook.tools import array_to_latex
array_to_latex(final_state, pretext=""\\text{Statevector} = "")
Error was:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-9-fe86c66f7ae0> in <module>
----> 1 from qiskit_textbook.tools import array_to_latex
2 array_to_latex(final_state, pretext=""\\text{Statevector} = "")
ModuleNotFoundError: **No module named 'qiskit_textbook'**
When I looked up the version I had, it showed the following:
{'qiskit-terra': '0.12.0',
'qiskit-aer': '0.4.1',
'qiskit-ignis': '0.2.0',
'qiskit-ibmq-provider': '0.5.0',
'qiskit-aqua': '0.6.4',
'qiskit': '0.16.1'}
Can someone help me in resolving the issue?
"
"['quantum-gate', 'programming', 'algorithm']"," Title: How to decompose unitary quantum gate in current simulator or emulator?Body: I have a question about how to decompose a unitary quantum gate in a currently existing simulator or emulator. I have read some papers about SK algorithm and other algorithms which aim to decompose unitary quantum gates. Is there any specific method to decompose a quantum gate in a currently existing simulator? Some papers about decomposition methods mention Trotter-Suzuki decomposition but I don't exactly know if this is true? To be more specific, what is the decomposition algorithm in Qiskit or Project Q?
"
"['mathematics', 'quantum-fourier-transform']"," Title: Proof of QFT for a Periodic FunctionBody: For Mosca Keynes, ex 7.1.5:
You are asked to prove:
$\text{QFT}^{-1}_{mr}|\phi_{r,b}\rangle = \frac{1}{\sqrt{r}}\sum_{k=0}^{r-1}e^{-2\pi i \frac{b}{r}k}|mk\rangle$
where
$|\phi_{r,b}\rangle = \frac{1}{\sqrt{m}}\sum_{z=0}^{m-1}|zr + b\rangle$
with period $r$, shift $b$ and $m$ repetitions.
I have an answer, I don't want to write my full workings so not to ruin the exercise for others, but I am looking to clarify a step in my workings to make sure I didn't just 'force' the proof.
I get to a point where I can factor to QFT result into two parts where get:
$\frac{1}{m\sqrt{r}}\sum_{z=0}^{m-1}\sum_{k=0}^{r-1}e^{-2\pi izk}e^{-2\pi i \frac{b}{r}k}|mk\rangle$
To get the final result I assume that:
$\sum_{z=0}^{m-1}\sum_{k=0}^{r-1}e^{-2\pi izk} = m$, given that $e^{-2\pi izk} = 1$ where $z,k\in\mathbb{Z}$, is this final stage of my proof correct or have I gone in completely the wrong direction?
"
"['circuit-construction', 'superposition']"," Title: CNOT in reversible computing and entanglementBody: We have a classical reversible circuit $U$ implementing a classical boolean function $f: \left\{0, 1\right\}^n \to \left\{0, 1\right\}$, which also takes some $a$ ancilla bits, and has side effect of outputting garbage $g(x)$. Then we have the following circuit diagram for uncomputing the garbage.
The trick is to CNOT the answer qubit (which I'll call the 2nd qubit) $f(x)$ with a fresh ancilla (the 1st qubit) initialized to $|0\rangle$, which changes the state of the first qubit to $f(x)$. Then we use the inverse of the circuit and get back $|x\rangle$ and other ancilla qubits back to $|0\rangle$.
If we are using this circuit with classical inputs, then it is clear that $f(x) \in \left\{0, 1\right\}$. Then, $f(x)$ CNOT $0$ is the same as taking the XOR of the two bits.
If we feed the input a uniform superposition of all the inputs, then we want the circuit to behave as follows: $$\frac{1}{\sqrt{2^n}}\sum_{x \in \left\{0,1\right\}^n} |x\rangle \otimes |0\rangle^{\otimes a+1} \mapsto \frac{1}{\sqrt{2^n}}\sum_{x \in \left\{0,1^n \right\}} |x\rangle \otimes |f(x)\rangle \otimes |0\rangle^{\otimes a}.$$
Now this is the part I don't understand. In the quantum case, $|f(x)\rangle$ can be a general quantum state $a|0\rangle + b|1\rangle$, and CNOT has the effect of entangling the first qubit with the second one, such that the joint state of the two qubits is now $a |00\rangle + b|11\rangle$. Now, $U^{-1}$ undoes everything done inside $U$, but it does not undo the CNOT between the first two bits. Therefore, after everything, the first two qubits should still be entangled, right? In that case, why can we write each term in the output as $|x\rangle \otimes |f(x)\rangle$, which indicates that they are not entangled.
"
"['density-matrix', 'quantum-operation', 'textbook-and-exercises']"," Title: Quantum operation to get rid of small but nonzero eigenvaluesBody: Updated and edited question:
Let $N_{\delta}:P(\mathcal{H}_A)\rightarrow P(\mathcal{H}_B)$ be a completely positive trace nonincreasing map from the set of positive semidefinite operators in $\mathcal{H}_A$ to positive semidefinite operators in $\mathcal{H}_B$. For any $\rho\in P(\mathcal{H}_{A})$, we want $\sigma = N_{\delta}(\rho)$ such that all its positive eigenvalues are greater than $\delta$ and all remamining eigenvalues are zero.
Can such a map $N_\delta$ be constructed?
Based on a previous version of the question, the comment of @Rammus and the answer of @NorbertSchuch suggested using a projection operation $P$ into the eigenspace with eigenvalues larger than $\delta$. However, the required projector depends on the input state $\rho$, which I would like to avoid.
"
"['error-correction', 'fidelity', 'gate-fidelity']"," Title: What is a difference between error rates and qubit/gate fidelity?Body: What is a difference between error rates and qubit/gate fidelity? A bit of maths in the explanation is fine but I am an A Level student doing a research project so definitions would be preferred.
"
"['quantum-gate', 'algorithm', 'programming', 'solovay-kitaev-algorithm']"," Title: a question about quantum gate decomposition on simulator or emulatorBody: I have read a paper about ""approximated decomposition"" of a unitary single gate (Solovay-Kitaev algorithm) which told us a any unitary single gate can be decomposed into {Hadamard, Phase} with any accuracy $\epsilon$ . The number of {Hadamard, Phase} grows exponentially as the $\epsilon$ becomes lower and the result is a better approximation of the gate. However, in simulator or emulator such as project Q and Qiskit, the $U3$ gate seems exacted decomposition which means only one parameterized $U3$ gate can realize any unitary single gate.
So if we can realize ""exact unitary single gate"" in quantum computer, why still so many people focus on the ""approximated one"" and try to optimized the sequence after decomposition?
"
"['qiskit', 'hhl-algorithm']"," Title: The maximum depth possible on quantum computersBody: I hope you don't mind me having two questions.
Firstly, I was running a Qiskit HHL simulation on a 12x12 matrix and a 12x1 vector, leading to a 16x16 matrix after expansion, and it resulted in a circuit width of 10 qubits and depth of 198 gates.
What is the maximum depth possible on a quantum computer?
Secondly, on a smaller problem in the HHL of size 2x2 the depth is 326 and width of 7 qubits. Are my results wrong? It seems odd to have a lower depth than such a small problem.
[1] https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#implementationsim
"
"['ibm-q-experience', 'optimization', 'qasm']"," Title: How to stop optimization of a circuit during transpiling in web-interface of IBM Q?Body: I was playing with approximation of gates with Clifford+T group on IBM Q. Everything works well on simulator, however, when I tried to run my circuit on actual quantum processor, a transpiler optimized circuit so only one $U3$ gate remained. Hence, I was not able to run my original circuit and assess effect of decoherence etc based on depth of the circuit.
To given an example, my original circuit is
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[1];
creg c[1];
h q[0];
s q[0];
t q[0];
sdg q[0];
h q[0];
measure q[0] -> c[0];
After transpiling (on IBM Q Armonk), the resulting QASM code is as follows:
OPENQASM 2.0;
include ""qelib1.inc"";
qreg q[1];
creg c[1];
u3(-0.7853981633974483, 1.5707963267948966, 4.71238898038469) q[0];
measure q[0] -> c[0];
I tried to add barriers before first h q[0]; and after last h q[0]; to prevent optimizer from working, however, without success.
I understand that basic gates on IBM Q are $I$, $U1$, $U2$ and $U3$ and that $H$, $S$, $S^\dagger$ and $T$ are eventually impleted by these $U$ gates.
However, is it possible to avoid optimization so that the original number of gates is preserved? In other words, Hadamard will be presented by one $U3$ gate, phase gate and $T$ by one $U1$ gate each etc.
"
"['quantum-gate', 'bloch-sphere', 'unitarity']"," Title: Is $e^{i\beta} R_Z(-2\beta)$ equivalent to $U_1(2\beta)$?Body: As far as I know the single qubit gate
$$
e^{i\beta\sigma_z} =
\begin{bmatrix}
e^{i\beta} & 0 \\
0 & e^{-i\beta}
\end{bmatrix}
= e^{i\beta}
\begin{bmatrix}
1 & 0 \\
0 & e^{-i2\beta}
\end{bmatrix} = e^{i\beta} R_Z(-2\beta).
$$
However, I have seen the above gate implemented using $U_1(2\beta)$, where
$
U_1(\lambda) =
\begin{bmatrix}
1 & 0 \\
0 & e^{i\lambda}
\end{bmatrix}
$
Is $e^{i\beta} R_Z(-2\beta)$ equivalent to $U_1(2\beta)$?
Update:
As Davit explains below, $e^{i\theta/2} R_Z(\theta) = U_1(\theta)$, so with $\frac{\theta}{2}=\beta$ we have $e^{i\beta} R_Z(2\beta) = U_1(2\beta)$. Note the difference: in this case the $Z$-rotation is positive, whereas in my original question it is negative.
"
"['algorithm', 'circuit-construction', 'q#']"," Title: Creating a W state for $2^k$ qubitsBody: This question is available in Quantum Katas here
In Task 2.6 of this notebook, we are required to create the W State for $2^k$ qubits.
Input: $𝑁=2^𝑘$ qubits in the |0…0⟩ state.
Goal: Change the state of the qubits to the W state - an equal superposition of 𝑁 basis states on 𝑁 qubits which have Hamming weight of 1.
For example, for $𝑁=4$ the required state is $\frac{1}{2}(|1000⟩+|0100⟩+|0010⟩+|0001⟩)$
And since this problem is taken from Katas, it came with a solution which is as follows:
s
operation WState_PowerOfTwo (qs : Qubit[]) : Unit is Adj+Ctl {
let N = Length(qs);
if (N == 1) {
// base of recursion: |1⟩
X(qs[0]);
} else {
let K = N / 2;
using (anc = Qubit()) {
H(anc);
(ControlledOnInt(0, WState_PowerOfTwo))([anc], qs[0 .. K - 1]);
(ControlledOnInt(1, WState_PowerOfTwo))([anc], qs[K .. N - 1]);
for (i in K .. N - 1) {
CNOT(qs[i], anc);
}
}
}
}
While there is absolutely nothing wrong with the proposed answer, I was trying to solve this task without using an ancilla qubit, here's my approach to this question:
operation WState_PowerOfTwo (qs : Qubit[]) : Unit {
let length_qs = Length(qs);
if (length_qs == 1){
X(qs[0]);
}
else{
H(qs[0]);
for(i in 1..length_qs-1){
if(i != length_qs-1){
for (j in 0..i-1){
X(qs[j]);
}
Controlled H(qs[0..i-1], qs[i]);
for (j in 0..i-1){
X(qs[j]);
}
}
else{
for (j in 0..i-1){
X(qs[j]);
}
Controlled X(qs[0..i-1], qs[i]);
for (j in 0..i-1){
X(qs[j]);
}
}
}
}
}
This logics works fine till N=2 but it shows the following error when testing for hidden cases:
The desired state for N = 1
# wave function for qubits with ids (least to most significant): 0
∣0❭: 0.000000 + 0.000000 i == [ 0.000000 ]
∣1❭: 1.000000 + 0.000000 i == ******************** [ 1.000000 ] --- [ 0.00000 rad ]
The actual state:
# wave function for qubits with ids (least to most significant): 0
∣0❭: 0.000000 + 0.000000 i == [ 0.000000 ]
∣1❭: 1.000000 + 0.000000 i == ******************** [ 1.000000 ] --- [ 0.00000 rad ]
Test case passed
The desired state for N = 2
# wave function for qubits with ids (least to most significant): 0;1
∣0❭: 0.000000 + 0.000000 i == [ 0.000000 ]
∣1❭: 0.707107 + 0.000000 i == *********** [ 0.500000 ] --- [ 0.00000 rad ]
∣2❭: 0.707107 + 0.000000 i == *********** [ 0.500000 ] --- [ 0.00000 rad ]
∣3❭: 0.000000 + 0.000000 i == [ 0.000000 ]
The actual state:
# wave function for qubits with ids (least to most significant): 0;1
∣0❭: 0.000000 + 0.000000 i == [ 0.000000 ]
∣1❭: 0.707107 + 0.000000 i == *********** [ 0.500000 ] --- [ 0.00000 rad ]
∣2❭: 0.707107 + 0.000000 i == *********** [ 0.500000 ] --- [ 0.00000 rad ]
∣3❭: 0.000000 + 0.000000 i == [ 0.000000 ]
Test case passed
Testing on hidden test cases...
Released qubits are not in zero state.
Try again!
I cannot find a root for this problem, is there any error in my logic or am I missing something here?
"
"['quantum-gate', 'algorithm', 'physical-realization']"," Title: Is it possible to create a quantum computer with a double-slit or Stern-Gerlach apparatus?Body: If we choose double-slit, can we put multiple ""slits"" and create calculation for just one algorithm (problem, solution...)?
Not general purpose quantum CPU, just for one.
Same question for Stern-Gerlach.
"
"['quantum-state', 'textbook-and-exercises', 'dynamics']"," Title: What is the physical meaning of the Hamiltonian $H = \alpha ( |01 \rangle \langle10| + | 10 \rangle \langle 01| )$?Body: In natural basis $| 0 \rangle = \begin{pmatrix} 1 \\0 \end{pmatrix}$, $| 1 \rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$, what physical situation/model does the following Hamiltonian represent: $H = \alpha \Big( |01 \rangle \langle10| + | 10 \rangle \langle 01| \Big)$?. Here, $\alpha$ has the dimensions of energy.
"
"['quantum-gate', 'ibm-q-experience', 'physical-realization', 'universal-gates', 'google-sycamore']"," Title: Do all physical architectures for quantum computers use the same universal gate sets?Body: Now I have understood that physical implementation of quantum computer need a universal quantum gate set like Clifford+T to realize any unitary quantum gate. However, I don't know if it is all the same gate sets for different physical implementation of quantum computer. For example, if the trapped ion and photonic implementation of quantum computer own the same universal quantum gate set. On the other hand, can the quantum computer of IBM and Google implement the same universal quantum gate?
I am interested in quantum simulator now, and I know that any unitary quantum gate will be decomposed into single qubit gate, and this process is done in simulator. After that, the simulation will send the after-decomposed single qubit gate into backend, which is a really physical implementation of quantum computer or emulator of classical computer and during this procedure the single qubit gates will be decomposed approximately into a sequence of gates within the universal quantum gates.
I don't know if my understanding of this issue is right.
"
"['programming', 'circuit-construction', 'machine-learning', 'research', 'initialization']"," Title: Is there a ""parameterized initialization"" that I can apply to a QuantumRegister to re-use a circuit?Body: I'm working on a QuantumCircuit which measures the fidelity of one point (my ""test vector"") and two other points (my ""data set"", containing of states phi_1 and phi_2) at once. I'm using Afham; Basheer, Afrad; Goyal, Sandeep (2020) to reproduce their circuit. My circuit right now looks as follows:
░ ┌───┐ ┌───┐ ░ ┌─┐
control_0: ─────────────────────░─┤ H ├────────────■──■──■─┤ H ├─░─┤M├───
┌──────────────────┐ ░ └───┘ │ │ │ └───┘ ░ └╥┘
state_to_classify_0: ┤0 ├─░──────────────────X──┼──┼───────░──╫────
│ │ ░ │ │ │ ░ ║
state_to_classify_1: ┤1 INIT TEST STATE ├─░──────────────────┼──X──┼───────░──╫────
│ │ ░ │ │ │ ░ ║
state_to_classify_2: ┤2 ├─░──────────────────┼──┼──X───────░──╫────
└──────────────────┘ ░ ┌─────────┐ │ │ │ ░ ║
train_states_0: ─────────────────────░──────┤0 ├─X──┼──┼───────░──╫────
░ │ │ │ │ ░ ║
train_states_1: ─────────────────────░──────┤1 ├────X──┼───────░──╫────
░ │ oracle │ │ ░ ║
train_states_2: ─────────────────────░──────┤2 ├───────X───────░──╫────
░ ┌───┐│ │ ░ ║ ┌─┐
comp_basis_0: ─────────────────────░─┤ H ├┤3 ├───────────────░──╫─┤M├
░ └───┘└─────────┘ ░ ║ └╥┘
meas_control_0: ═════════════════════════════════════════════════════════╩══╬═
║
meas_comp_basis_0: ════════════════════════════════════════════════════════════╩═
Where the INIT TEST STATE is used to initialise my test state on a 3-qubit register, and my oracle is defined as follows:
┌────────┐ ┌────────┐
train_states_0: ─────┤0 ├─────┤0 ├
│ │ │ │
train_states_1: ─────┤1 phi_0 ├─────┤1 phi_1 ├
│ │ │ │
train_states_2: ─────┤2 ├─────┤2 ├
┌───┐└───┬────┘┌───┐└───┬────┘
comp_basis_0: ┤ X ├────■─────┤ X ├────■─────
└───┘ └───┘
So that my train_states register is in a superposition of my full data set. I want to be able to measure the fidelity between multiple points, so what I'm doing right now is just create my circuit where I call qiskit.extensions.quantum_initializer.Isometry to initialize my registers into the desired state. If I want to test another test state, I reproduce my entire circuit.
For now this works, but eventually I want to move onto larger datasets with thousands of points, I can imagine that recreating a QuantumCircuit from scratch for every data point can become a bottleneck. Hence my question: can I make INIT TEST STATE in such a way that I can define an example function like:
def apply_new_datapoint(new_init_gate, old_circuit):
old_circuit.data.replace(0, new_init_gate)
I have no idea if the above works, but this is what I'm trying to reach eventually.
"
"['programming', 'ibm-q-experience', 'ibm', 'qasm']"," Title: How can I install the 'ibmq_qasm_simulator' backend?Body: I'm having trouble running the following cell:
The system told me ""The 'ibmq_qasm_simulator' backend is not installed in your system."" I'm so confused. Is there a way I can install this backend in my system? Thanks!
"
"['quantum-gate', 'classical-quantum']"," Title: The effect of available information on random quantum channelsBody: This question is about the effect of available information on random quantum channels.
Suppose there are two black box devices.
Device 1.
We have a black box device with a single qubit in it. Once we turn it on, this device does the following noisy quantum channel on the qubit $\rho \to (1-p) I \rho I^\dagger + p X \rho X^\dagger$, with certainty. Here $p \in (0,1)$. No measurement takes place after this device.
Device 2. This black box device has an identically prepared qubit in it. Furthermore, within this device there is a physical switch hidden that can be in state 'Heads' or 'Tails'. If the switch is in state Heads, nothing is guaranteed to happen; and if it is in state Tails, then the quantum bit-flip channel is guaranteed to happen. The switch is operated internally according to the outcome of a classical probability distribution, for example by a biased coin that flips Tails say with probability $q \in (0,1)$. Once we turn this device on, the device flips the coin internally, and therefore thus executes either $\rho \to \rho$ with probability $q$ or $\rho \to X \rho X^\dagger$ with probability $1-q$. No measurement takes place after this device.
We haven't yet but are about to turn on both devices.
Question 1. Suppose we will be informed of the outcome of the coin flip. If $p = q$, in this moment in time (so prior to turning on either device), are the two processes that are about to happen different or identical from a modeling perspective? Critically, assume that we do have access to all of the information above.
Question 2. Suppose we will not be informed of the outcome of the coin flip. What would be the answer now?
"
"['entanglement', 'entropy']"," Title: Under what situation is $\sum_{i} p_{i}S(\rho_i)$ > 0Body: Concerning the Von Neumann Entropy $S(\rho) = H(pi) + \sum_{i}p_{i}S(\rho_{i})$, under what circumstances does $\sum_{i}piS(\rho_{i})$ become greater than 0? I am aware it occurs when $\rho_{i}$ is not pure itself. However. under what circumstances does this actually occur? Most of my experience with the Von Neumann Entropy up to this point has been when $\rho$ is the result of tracing out a larger system that it was correlated with, and as a result it is mixed. But when does this result in not only an uncertainty of which of the index i, but also what $\rho$ itself is?
For context I am only just learning this stuff, and none of my sources seem to comment on this or ask any questions regarding it.
"
"['annealing', 'adiabatic-model']"," Title: Is it absolutely necessary for Hamiltonians to not commute in QAA?Body: I have already read through the answers here.
So I understand that if the Hamiltonians commute, then they have the same eigenstates but not necessarily the same energy eigenvalues.
To formulate my question (skip to last paragraph if you prefer), we have the Hamiltonian $H_B$ with known lowest energy eigenstate $|\psi_{B_0}\rangle$ and corresponding energy eigenvalue $E_{B_0}$. Then our time-depenent Hamiltonian is
$$
H(t) = (1-\alpha(t))H_B + \alpha(t) H_C
$$
where $H_C$ is the problem Hamiltonian with lowest energy eigenstate $|\psi_{C_0}\rangle$ and corresponding energy eigenvalue $E_{C_0}$, and $\alpha \in [0,1]$ is a time varying function that gradually moves from $0$ to $1$.
As I understand, if $H_C$ and $H_B$ don't commute, then $|\psi_{B_0}\rangle$ is an eigenstate of both of them, and therefore also of $H$. So the state won't evolve out of $|\psi_{B_0}\rangle$, and we aren't guaranteed that it is equal to $|\psi_{C_0}\rangle$. Another way people state it, which to me feels equivalent, is that there will be a crossover of energy bands and this degeneracy will cause the adiabatic speed limit to go to 0.
Here's my question. As I said we aren't guaranteed that $|\psi_{B_0}\rangle = |\psi_{C_0}\rangle$. But does that mean that we are sure $|\psi_{B_0}\rangle \neq |\psi_{C_0}\rangle$? Are there situations where $H_C$ and $H_B$ commute and we can know in advance that $|\psi_{B_0}\rangle = |\psi_{C_0}\rangle$ and can do QAA anyway?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'linear-algebra']"," Title: How do you decompose an arbitrary quantum state into its corresponding projection subspaces such that their direct sum is the quantum state?Body: I understand that every Hilbert space $H$ can be decomposed into two mutually orthogonal subspaces $H_1$ and $H_2$ whose direct sum is $H$.
Therefore, every vector $v\in H$ can be decomposed into $v_1\in H_1$ and $v_2\in H_2$ such that direct sum of $v_1$ and $v_2$ is $v$.
I just want to see the mathematical procedure for an arbitrary quantum state.
"
"['circuit-construction', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Procedures and intuition for designing simple quantum circuits?Body: I'm working my way through one of the quantum circuits sections in Nielsen and Chuang and I'm struggling to get a feel for the basics of circuit construction. For example, one of the exercises is as follows:
This exercise seems really simple on the surface, however I'm struggling to figure out how to go from a question posed like this to implementation. I can obviously write down the action in terms of the computational basis, but after this I get stuck.
I'm not so much looking for a specific solution to this exercise but rather using this as an instance of how to get into the correct frame of mind / use the correct procedures to solve problems with circuits.
"
"['qiskit', 'programming', 'textbook-and-exercises']"," Title: Example of Simple phase Change Using 2 QubitsBody: I need to manipulate phases in 2 qubits. I will eventually create 34 distinct phase sets to map to an alphabet I built.
I see https://github.com/oreilly-qc/oreilly-qc.github.io/blob/master/samples/Qiskit/ch07_08_qft_rotating_phases.py
Is there a simple qiskit or qc example of a 2 qubit program that results in the following by using 45, and 90 degree phasing(see pic added)?:
As the letters change, so will each phase in each qubit. Any help appreciated. Here is the first ""letter"" (>)
"
"['quantum-gate', 'algorithm', 'quantum-state', 'deutsch-jozsa-algorithm', 'classical-quantum']"," Title: Example of a quantum algorithm better than its classical counterpart which involves only $1$ qubit?Body: I was reading over the proof of the Deutsch-Jozsa algorithm, which in its simplest case, involves at least 2 qubits.
Is there an example of a quantum algorithm that is better than it's classical counterpart which only involves a single qubit?
If not, could you provide an explanation of why such an algorithm cannot exist?
Thank you very much. I have only recently started my journey into quantum computing.
"
"['grovers-algorithm', 'oracles']"," Title: Equality comparator for two qubits eachBody: I'm trying to implement Grover's algorithm. For the oracle I have three nodes which are represented by two qubits for each node. How can I check if the states of two nodes are not equal?
"
"['quantum-state', 'textbook-and-exercises']"," Title: How do two qubit states differing by a global phase relate to each other?Body: I have looked at the following:
What is the difference between a relative phase and a global phase? In particular, what is a phase?
Global and relative phases of kets in QM
Global phases and indistinguishable quantum states, mathematical understanding
If two states differ by a scalar of magnitude of 1, then they are indistinguishable. Consider:
\begin{align}
\vert \psi_1 \rangle &= \dfrac{1}{\sqrt{2}} \vert 0 \rangle + \dfrac{i}{\sqrt{2}} \vert 1 \rangle\\
\vert \psi_2 \rangle &= \color{red}{i}\left(\dfrac{-i}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle\right).
\end{align}
Which of the following is true about $\vert \psi_1 \rangle$ and $\vert \psi_2 \rangle$?
- $\vert \psi_1 \rangle = \vert \psi_2 \rangle$
- $\vert \psi_1 \rangle \neq \dfrac{-i}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$
- $\vert \psi_1 \rangle = \dfrac{-i}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$ up to global phase.
- If we just ignore the global phase in $\vert \psi_2 \rangle$ and only deal with $\dfrac{-i}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$ , do we still have the state vector on a Bloch sphere yields the same projection as $\vert \psi_1 \rangle$?
Lastly, since the global phase is not physically observable, is it mathematically evident?
"
"['programming', 'q#']"," Title: How to apply a gate to a LittleEndian in Q#Body: I have been given a LittleEndian register. I want to know the following things:
- How many bits there are in the LittleEndian?
- How to convert the LittleEndian into a Qubit[] Array.
- How to access individual qubits of LittleEndian?
- How to apply simple and controlled gates onto individual qubits of LittleEndian?
"
"['quantum-state', 'mathematics', 'measurement']"," Title: Computing variance under the action of a unitary operatorBody: I wish to calculate the expectation and variance for an observable on a particular qubit of a multi qubit quantum state. I'm using a quantum computing simulation library which allows me to apply operators to a state vector and perform calculations such as computing inner products between state vectors.
To compute the expectation value:
I can use the definition of expectation value $\langle\psi|O|\psi\rangle$ to achieve this computation as follows:
- Create a copy of the given state vector $\psi$, apply the observable to the required qubit to obtain $O|\psi\rangle$.
- Calculate the inner product of the state calculated in 1 with the conjugate transpose of $|\psi\rangle$ that is $\langle\psi|O|\psi\rangle$.
Is the method for computing the expectation values correct ?
For computing the variance:
I'm thinking of using the following definition:
$$\text{Variance}(O) = \text{Expectation}(O^2) - \text{Expectation}(O)^2.$$
If I understand correctly, I need to compute the following two quantities:
a. $\text{Expectation}(O)^2$: This is simply the square of the expectation value that I can calculate using the method stated earlier.
b. $\text{Expectation}(O^2)$: For calculating this, I think I need to apply the observable to the target qubit in the state vector twice (Is that right?). If so, in case my observable is unitary, I can avoid applying the unitary altogether. So this value should simply be $\langle\psi|\psi\rangle$ (which should be 1 since my state is normalized).
- Is this correct?
- Is there a better (more efficient) way to accomplish this?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: Find the probability of a measurement outcome in terms of the coefficients of the stateBody:
Suppose we have a quantum state $|\psi \rangle$ of $n$ qubits, where $|\psi\rangle=\sum_{x∈\{0,1\}^n}\alpha_x |x\rangle$,and we measure the first qubit of $|\psi\rangle$ in the computational basis. What is the probability that the measurement outcome is $1$, in terms of the $\alpha_x $ coefficients?
I'm not quite sure how to approach this. Usually the computational basis is $\{|0\rangle,|1\rangle\}$ and I'm not sure what ket I am meant to apply to the $|\psi\rangle$.
I'm also not sure what matrix I need to use to do the measurement.
"
"['programming', 'q#']"," Title: Q# Quantum.MachineLearning namespace doesn't exist errorBody: I am trying to use the HalfMoon Classifier in Quantum Machine Learning Sample Examples. I am trying to run it locally. However I keep getting this error.
No namespace with the name ""Microsoft.Quantum.MachineLearning"" exists.
This error is then followed by multiple errors of the identifiers under this namespace not existing.
In my python Host.py file
I have the following Import Lines
import qsharp
qsharp.packages.add(""Microsoft.Quantum.MachineLearning::0.11.2006.403"")
qsharp.reload()
Edit:
Replacing Package Version and Making it same as dotnet iqsharp --version did work. However I still seem to getting fail: warnings saying identifiers don't exist and
No namespace with the name ""Microsoft.Quantum.MachineLearning"" exists.
The program runs correctly but the warnings don't go away.
Hence I ask is there anyway to fix these warnings?
"
"['quantum-gate', 'circuit-construction', 'matrix-representation', 'tensor-product', 'textbook-and-exercises']"," Title: Show that a $CZ$ gate can be implemented using a $CNOT$ gate and Hadamard gatesBody:
Show that a $CZ$ gate can be implemented using a $CNOT$ gate and Hadamard gates and write down the corresponding circuit.
Recall from Quantum Information Theory that $Z=HXH$. As $CNOT$ is a controlled-$X$ operation, we would expect that $CZ= (I \otimes H)CNOT(I\otimes H)$.
Why would we expect this form? Where does this come from?
"
"['quantum-gate', 'matrix-representation', 'textbook-and-exercises']"," Title: How to spot the matrix representation of the quantum NOT operationBody:
Applying the above construction to AND we get the map $(x1,x2,y) \rightarrow (x1,x2,y⊕(x1∧x2))$ for $x1,x2,y \in \{0,1\}$. The unitaryoperator which implements this is then simply the map $|x1〉|x2〉|y> \rightarrow |x1〉|x2〉|y \oplus (x1∧x2)〉$.
Written as a matrix with respect to the computational basis this is
$$\begin{bmatrix} 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{bmatrix}$$
How can you just spot what the matrix is with respect to the computational basis?
"
"['programming', 'q#']"," Title: qsharp.reload() throws error in pythonBody: I'm trying to add the Q# machine learning library to my program by
import qsharp
qsharp.packages.add(""Microsoft.Quantum.MachineLearning::0.11.2004.2825"")
qsharp.reload()
but it throws the errors below. Any solutions?
P.S. I have the qsharp package and iqsharp installed. Normal programs in python that use qsharp work correctly.
dotnet iqsharp --version
iqsharp: 0.11.2006.403
Jupyter Core: 1.3.60623.0
.NET Runtime: .NETCoreApp,Version=v3.1
and
'iqsharp': LooseVersion ('0.11.2006.403'),
'Jupyter Core': LooseVersion ('1.3.60623.0'),
'.NET Runtime': LooseVersion ('.NETCoreApp,Version=v3.1'),
'qsharp': LooseVersion ('0.11.2006.403')
Also even if I don't add the Machine Learning library and just run
import qsharp
qsharp.reload()
It still throws the same error
Errors:
Adding package Microsoft.Quantum.MachineLearning::0.11.2004.2825.
---------------------------------------------------------------------------
IQSharpError Traceback (most recent call last)
<ipython-input-15-b3244a777be2> in <module>
1 import qsharp
2 qsharp.packages.add(""Microsoft.Quantum.MachineLearning::0.11.2004.2825"")
----> 3 qsharp.reload()
~\anaconda3\lib\site-packages\qsharp\__init__.py in reload()
70 Q# compilation errors are raised as an exception.
71 """"""
---> 72 client.reload()
73
74 def get_available_operations() -> List[str]:
~\anaconda3\lib\site-packages\qsharp\clients\iqsharp.py in reload(self)
117
118 def reload(self) -> None:
--> 119 return self._execute(f""%workspace reload"", raise_on_stderr=True)
120
121 def add_package(self, name : str) -> None:
~\anaconda3\lib\site-packages\qsharp\clients\iqsharp.py in _execute(self, input, return_full_result, raise_on_stderr, output_hook, **kwargs)
207 # There should be either zero or one execute_result messages.
208 if errors:
--> 209 raise IQSharpError(errors)
210 if results:
211 assert len(results) == 1
IQSharpError: The Q# kernel raised the following errors:
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(2,10): error QS6104: No namespace with the name ""Microsoft.Quantum.Convert"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(3,10): error QS6104: No namespace with the name ""Microsoft.Quantum.Intrinsic"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(60,21): error QS5022: No identifier with the name ""Default"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(61,16): error QS5022: No identifier with the name ""Structure"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(62,16): error QS5022: No identifier with the name ""Parameters"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(63,16): error QS5022: No identifier with the name ""Bias"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(11,16): error QS5022: No identifier with the name ""Length"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(30,23): error QS5022: No identifier with the name ""Mapped"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(32,13): error QS5022: No identifier with the name ""Zip"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(35,13): error QS5022: No identifier with the name ""Mapped"" exists.
C:/Users/Shreyas/Documents/jupyter/Quantum/MLADS2020-QuantumClassification-master/MLADS2020-QuantumClassification-master/test/Operation.qs(46,9): error QS5022: No identifier with the name ""Message"" exists.
"
"['quantum-gate', 'entanglement', 'superdense-coding', 'classical-quantum']"," Title: Question about the practical use of super dense coding in information transmissionBody: Question about the practical use of super dense coding in information transmission:
We know that by using super dense coding it is possible to transmit 2n classical bits transmitting n qubits, belonging to a set of 2n entangled qubits.
Problem is, it is necessary, before starting the transmission, to deliver n qubits to Alice and n qubits to Bob, entangled together. In my opinion this fact makes super dense coding of no practical interest because normally in a transmission system the sequence of information (classical) bits is of indefinite length and consequently the length n of entangled bits given to Alice (the transmitter) should be equally of indefinite length. Which is practically very difficult!
Am I correct or am I missing something?
Thanks.
"
"['entanglement', 'textbook-and-exercises']"," Title: Can $U(\rho_1\otimes\rho_2)U^\dagger$ be entangled if either of $\rho_1$ or $\rho_2$ is a maximally mixed state?Body: Given two qubit states $\rho_1$ and $\rho_2$. By applying some unitary $U$ we get $\rho = U(\rho_1 \otimes \rho_2)U^\dagger$. Can $\rho$ be entangled if either of $\rho_1$ or $\rho_2$ is a maximally mixed state?
"
['error-correction']," Title: Where can I find tutorials about correcting gate errors in the quantum circuit?Body: I just have a question about where can I find tutorials/examples about correcting gate errors (amplitude errors and phase errors) in a quantum circuit? Are there any resources I can learn from? Thanks!
"
"['programming', 'q#']"," Title: How do I encode integers into BigEndian in Q#?Body: https://export.arxiv.org/ftp/arxiv/papers/1908/1908.07943.pdf
page 4 point 1 states that we use the bits of an integer as a basis in our space. I understand that BigEndian grabs our largest bit and creates a qubit. I am wondering if there is a function within Q# that does this for me.
"
"['entanglement', 'simulation', 'classical-computing', 'games', 'non-locality']"," Title: How does a classical computer simulate nonclassical correlations?Body: This may be a dumb question, if so please forgive me, it is late at night.
I have learned that a classical computer can simulate a quantum computer in exponential time and space, but classical computers are bound to non-quantum phenomenon.
How then, would one be able to simulate say CHSH, which produces fundamentally quantum probabilities that cannot be explained locally/classically? Am I misinterpreting the meaning of simulate?
In general, how could a classical computer simulate quantum phenomena that cannot be explained classically (such as the dynamics of more than a single particle)? I would think that one could not generate random numbers violating any of Bell's inequalities, i.e. necessarily quantum correlations are off limits.
"
"['measurement', 'complexity-theory']"," Title: Efficient diagonalisation of low-rank observablesBody: Let $n$ be the number of qubits we're using, and let $$\mathrm H=\sum_{i=1}^T\alpha_i\mathrm U_i|0\rangle\langle0|\mathrm U_i^\dagger$$ be an $n$-qubit hermitian observable where $T=O(\mathrm{poly}(n))$, $\alpha_i\in\mathbb R\!\setminus\!\{0\}$ and $\mathrm U_i$ a unitary that can be implemented as a circuit of size $O(\mathrm{poly}(n))$.
For my purposes, I would like to express $\mathrm H$ as an observable consisting of only a single term, without any ancillary qubits; thus, the most general desired form is $\mathrm H=\mathrm W\mathrm D\mathrm W^\dagger$ with $\mathrm W$ an $n$-qubit unitary and $\mathrm D$ a $2^n\times2^n$ real diagonal matrix.
Question: is there a construction of $\mathrm W$ and $\mathrm D$ that can be computed in time $O(\mathrm{poly}(n))$, possibly exploiting that $\mathrm H$ is of low rank (namely polynomial in $n$)? Clearly, $\mathrm W$ and $\mathrm D$ can be brute forced by diagonalising $\mathrm H$, but from what I have found even the fastest diagonalisation algorithms still run in time proportional to the dimensionality of $\mathrm H$, which is exponential.
Of course, if you know of any papers related to this question, sharing would be highly appreciated. Thanks!
"
"['quantum-state', 'measurement', 'machine-learning']"," Title: How many samples are required to estimate the probabilities of a state?Body: Suppose that we have a quantum state of the form:
$$|\psi\rangle = \sqrt{p}|0\rangle + \sqrt{1-p}|1\rangle$$
In order to get an estimate of the probability of reading $|0\rangle$ or $|1\rangle$, we need to sample $|\psi\rangle$. How many times do we need to sample to have an $\epsilon$-estimate ? Keep in mind that this is different from quantum tomography because i we don't want to reconstruct the state from measurements, i just want to find an approximation of the probability of reading some state. In Supervised Learning with Quantum Computers, Schuld,M, et.al, the authors say that sampling from a qubit is equivalent to sampling from a bernoulli distribution,thus we can use the Wald interval:
$$\epsilon = z\sqrt{{\bar{p}(1-\bar{p})}\over S}$$ where $z$ is the confidence level, $\bar{p}$ is the average and $S$ the number of samples.
In the case of $p$ being close to either 0 or 1, we can use Wilson Score interval:
$$
\epsilon = {z \over {1 + {z^2\over S}}}\sqrt{{{\bar{p}(1-\bar{p})}\over S} + {z^2 \over 4S^2}}
$$
Now, the i ask the following question: What if i have a state with multiple qubits? How do i get an $\epsilon$-estimate of the probability of reading some state? If you can suggest some references, i would appreciateit. Thank you very much.
"
"['programming', 'q#']"," Title: dotnet iqsharp install gives error ""FileNotFoundError: The system cannot find the path specified""Body:
installing Q# version g --version 0.1.2.3 in jupyter. but this command line dotnet iqsharp install responds system cannot find path specified . what should i do .
i have also installed vscode 2019 is it the cause.
i need help please
"
"['non-locality', 'nonclassicality']"," Title: Understanding Hardy's proof of ""nonlocality without inequalities""Body: I'm reading the proof of ""nonlocality without inequality"" presented in (Hardy 1992).
In this protocol, we consider two particles (say, an electron and a positron) evolving almost independently: they both pass through one of two beamsplitters independently from the other's path, but can cross paths. If that happens, they annihilate each other with unit probability, and therefore are not measured at the end.
Here is the setup as given in the paper:
Here, $C^\pm$ and $D^\pm$ are the possible output events, and $P$ is the point at which $e_+$ and $e_-$ interact if they both pass through it. Note how, if there was no point of interaction $P$, the two particles would evolve independently, and the beamsplitters cancel each other out.
We focus on the output events in four scenarios: 1) when all BSs are as in the above figure, 2) when BS2$^+$ is removed, 3) when BS2$^-$ is removed, 4) when both BS2$^+$ and BS2$^-$ are removed.
Using the convention for beamsplitter evolutions in which a phase $i$ is introduced upon reflection, $a_1\to a_1 + i a_2$ and $a_2 \to ia_1 + a_2$, we can compute the output states in the four cases, and find the following
\begin{align}
&\,\,\,\,\,\text{both BS}\,: &&-3|cc\rangle + \,\,\,i |cd\rangle + \,\,\,i |dc\rangle - |dd\rangle, \\
&\text{only BS2$^+$}: &&\phantom3-|cc\rangle + 2i |cd\rangle + \,\,\,i|dc\rangle, \\
&\text{only BS2$^-$}: &&\phantom3-|cc\rangle + \,\,\,i| cd\rangle + 2i |dc\rangle, \\
&\,\,\,\,\,\text{no BS2$^\pm$}: &&\phantom1 \qquad\qquad\,\,\, i| cd\rangle + \,\,\,i |dc\rangle + |dd\rangle.
\end{align}
We now consider what happens when the output $|dd\rangle$ is observed when both BSs are used. This happens with probability $1/16$. Then, the author remarks that
- From the only BS2$^+$ case, we conclude that observing $d_+$ (i.e. $d$ for the first particle) implies that we should observe $c_-$ when no BS2$^-$ is used.
- From the only BS2$^-$ case, we conclude that observing $d_-$ (i.e. $d$ for the second particle) implies that we should observe $c_+$ when no BS2$^+$ is used.
- The above two observations tell us that, when neither BS2$^+$ nor BS2$^-$ are used, we should observe the output $|cc\rangle$. But this is incompatible with the output state we know we have in this instance, which assigns zero probability to such event.
We then conclude that observing $|dd\rangle$ contradicts local realistic explanations.
The latter conclusion is what I'm trying to understand. I follow all the calculations, but fail to see clearly the connection with the local realistic hypothesis.
Why can we mix the output states in the four different scenarios (yes/no BS$^+$/BS$^-$) like this? Why does it matter what we would observe when one of the two BSs is removed, when both of them are present in the considered experimental run?
"
['entanglement']," Title: Can we say that an $n$-qubit system is entangled if at least one basis vector is missing?Body: Can we say, in general, that the qubits of a system of n-qubits are entangled if at least one basis vector is missing from the probability distribution?
For example, in a system of 3-qubits, after a certain circuitry, I measure all the qubits. I found that
c1% probability of |000>,
c2% of |001>,
c3% of |010>,
c4% of |101>,
c5% of |111>
so that c1+c2+c3+c4+c5 = 100.
Can I then say that the system of 3-qubits is an entangled one?
"
"['quantum-gate', 'algorithm', 'quantum-state', 'programming']"," Title: A question about a real programmable quantum computerBody: In the theory of universal quantum gates,I have known a common universal gate set is the Clifford + T gate set, which is composed of the CNOT, H, S and T gates. Then there is a concept called ""accuracy"", which means use the composition of this set of gates can achieve any accuracy of the gate we want to approximately simulate.
However, in real quantum computer hardware, for example, ion-trapped quantum computers, the two parameterized gates in this paper can be regareded as universal quantum gates to realize any quantum gates (https://arxiv.org/pdf/1603.07678.pdf), and the concept of ""accuracy"" is also no longer mentioned.
It mentioned a concept of ""fidelity"" instead. So does that means, the process of simulation will be 100% right if we don't take the influence of hardware realization into account? If so, why do we still need to learn so much about ""universal quantum gates""?
"
"['programming', 'q#']"," Title: Attempting to use the QuantumMachineLearning Repositry with vscode and now import qsharp is reporting 'Fail'Body: I have been trying to follow the Quantum machine learning kata by using vscode and jupyter notebook, I was using the wrong version of iqsharp so changed it in the code like so:
As can be seen the attempt to import the machine learning package returns an error and also attempting to use it does not work.
I then went back to try and use the code on vscode but now even attempting to import qsharp is giving this error (it worked before attempting to change the jupyter code):
I have tried uninstalling and reinstalling iqsharp and the QDK, but that doesn't work. Does anyone know what I might have done to break it and how to fix it?
"
"['qiskit', 'grovers-algorithm']"," Title: XOR gate for n control qubits in qiskitBody: I am currently creating a blackbox for a grover search algorithm to solve the graph colouring problem with qiskit. One of my search criteria is that one node can only have one color. Therefore, with my current problem having 4 colours and 8 nodes, I need to design something like an XOR gate with 4 control qubits. So that the target qubit flips, only if one of the control qubits is |1>.
What would be an efficient way to design such a gate (best case for n control qubits)?
"
"['measurement', 'error-correction']"," Title: Can Shor's 9 Qubit Code Correct for a measurement on the first qubit?Body: Start with Shor's codeword for $|0 \rangle$:
$|\psi\rangle = \frac{1}{\sqrt{8}}(|000\rangle + |111\rangle)\otimes(|000\rangle + |111\rangle)\otimes(|000\rangle + |111\rangle)$.
Now, assume that instead of an $X$ flip or a $Z$ flip, the first qubit is measured.
Can Shor's error correction algorithm correct for this error and recover the original $|0\rangle$? Show the calculations to justify your answer.
My guess is that it can succesfully correct, because of the Deferred Measurement Principle.
My attempt at a solution:
Let's say that the result of the measurement of the first qubit is $|0\rangle$. Thus the entire state collapses to:
$|\psi_0\rangle = \frac{1}{\sqrt{4}}(|000\rangle)\otimes(|000\rangle + |111\rangle)\otimes(|000\rangle + |111\rangle)$.
In step 1 we detect and correct for $X$ errors. Since there is no bit flip, this step doesn't change the state.
In step 2 we look for $Z$ errors. My question is, how to calculate a phase-flip check on $|\psi_0\rangle$, and how do I interpret the result to correct the error? Same question for the state after measuring $|1\rangle$.
Thanks!
"
"['algorithm', 'quantum-state', 'deutsch-jozsa-algorithm', 'textbook-and-exercises', 'oracles']"," Title: Why is the function $f_s(x)=\sum_i x_i s_i \pmod 2$ balanced?Body:
A parity function $f_s:\{0,1\}^{n}\rightarrow\{0,1\}$, for some $s\in \{0,1\}^n$, is a function of the form $f_s(x) = x \cdot s$, where the inner product is taken modulo 2.
Show that $f_s$ is a balanced function for all $s$
We have $f_s(x) =\sum_i x_is_i \mod 2$. If $s \neq 0^n$, then there exist $i$ such that $s_i \neq 0$. So, for all $x$, $f_s(x) \neq f_s(x^i)$, where $x^i$ the string obtained from by inverting bit $i$. Hence $f_s$ is balanced.
I really don't understand the second from last sentence. Why this does this imply the function is balanced?
"
['cryptocurrency']," Title: Will quantum computing kill cryptocurrencies, ecommerce and private communications (Signal, TOR, etc)?Body: And if a specific country or nation-state gets a breakthrough and keeps quiet about it, can they go about quietly decrypting everything online with us none the wiser and expecting/thinking we're safe?
EDIT:
A previous question with link was presented. I've read it but it doesn't address a couple things:
- the top answer states ""...just elect to do a hard fork to post-quantum cryptography."" Will PQC be easily available to crypto creators/admins and is it really that trivial and easy to do? Is it as simple as switching certs or will software have to be rewritten?
- can someone (person, entity, organization) get a breakthrough and keeps quiet about it and be quietly decrypting everything online (crypto, ecommerce, private comms) without anyone noticing?
EDIT 2:
What TinaS said about a nation or company intercepting and storing current communications and decrypting it later when the technology is available worries me. Crypto wallet keys and mnenomic seeds are immutable and will be the same years from now when the QC breakthrough happens. Credit card numbers, expiration dates and security codes are good for the life of the card which is usually 4 years. Bank account info, private conversations (phone, videochat, etc), sensitive info (members list, contacts, etc) and private documents (archives, photos, signatures) are also long-term.
The solution cannot be reactive, it can't be ""post-quantum"". It can't simply be ""electing to do a hard fork"" or installing new certs. It certainly won't be flipping a switch. It will be too late then.
Once it is revealed, both the direct and collateral damage will result in carnage along with the scramble to rewrite a ton of software. I'm skeptical of this redesign & rewrite of software - what I consider the ""adapt & survive"" phase. As Michele Amoretti says, there will be a collapse in the markets and unpredictable consequences. Just think of all the things that hackers can do with the strong encryption and layers of security that we have now. The consequences of bad actors getting a hold of the info I listed above would be anyone's guess but it would be likely that some businesses, organizations and entities will cease to exist. What happens if we can't transact in cryptocurrencies or do ecommerce for 12-18 months? What happens to people who depend on TOR or Signal to get things done?
EDIT 3:
Can current non-QC software be modified or rewritten (moving away from RSA based encryption) to prevent decryption by quantum computing or will everyone implementing cryptocurrencies, ecommerce, and private communications have to upgrade to QC software AND hardware to be able to implement encryption that can hold up to decryption attempts by quantum computing?
Let's say a person or lab working on QC achieves a breakthrough and publishes it in a scientific journal for everyone to see, what exactly are the steps we take to secure our current encrypted systems? If the answer to my question above is the latter, maybe would things play out this way:
1. chip makers start working on a QC chip or chipset
2. when #1 is achieved, OS vendors would start rewriting code for an operating system for that chip
3. when #2 is achieved, vendors for software development platform (Java, .NET, etc) would start rewriting their code
4. when #3 is achieved, vendors for software for cryptocurrencies, ecommerce, and private comms would start (re)writing code
"
"['programming', 'classical-computing']"," Title: Compiling a classical function to a quantum circuit in practiceBody: It can be shown that any classical function $f$ can be implemented by a quantum circuit $Q_f$, so that
$$
\sum_{x}|x,0^k\rangle \xrightarrow{\mathit{Q_f}} \sum_{x}|x,f(x)\rangle
$$
where $f$ has $k$ output bits, and ingnoring normalization. I have seen such circuits called quantum oracles and treated
as black boxes in quantum algorithms. If I want to write a
quantum computer program that includes the circuit $Q_f$, it is convenient to write a classical program for $f$
in a high level language (like C or Java or python) and have it compiled to a quantum circuit.
My question is: is there an implementation of a compiler (preferably open source) that will compile my classical high-level program for $f$
into some representation of the quantum circuit $Q_f$ (e.g. using OpenQASM)? If not, is there a compiler that will
compile into reversible gates?
Thanks!
kgi
"
"['programming', 'q#']"," Title: Is there a way to grab probablities of my qubits in Q#?Body: https://qiskit.org/textbook/ch-algorithms/grover.html
I am looking for a visual, or just probabilities like the ones given in the link.Is this possible on Q#?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'bell-basis']"," Title: How to apply the Schmidt Decomposition to a Bell state?Body: I am trying to understand the Schmidt Decomposition, currently in my QC class. We had a tutorial where we were told if $|\psi\rangle$ is a pure state of a composite system A then there exists $|i_A\rangle$ and $|i_B\rangle$ which are orthonomral states for systems A and B respectively.
$$|\psi\rangle = \sum_i \lambda_i |i_A\rangle|i_B\rangle$$
I more or less understand that we write $|\psi\rangle$ as:
$$ |\psi\rangle = \sum_{j,k} c_{jk}|a_j\rangle|b_k\rangle$$
Where $|a_j\rangle_j$ and $|b_k\rangle_k$ are orthonormal bases for A and B and $C=(c_{jk})$ a complex matrix. Then proceed by using singular value decomposition on C. My question is how should I move on to apply the Schmidt decomposition on a numerical example such as the $|\beta_{00}\rangle$. Some pointers would be lovely as I struggle to understand, and would prefer it if there were no direct answers as I want to struggle through it myself as much as possible. Thanks!
"
"['qiskit', 'programming']"," Title: Installing Qiskit Error: Building wheel for ecos errorBody:
How can I fix this error? I am installing the newest version of Qiskit.
"
"['programming', 'q#', 'machine-learning']"," Title: Q# Error: No namespace with the name ""Microsoft.Quantum.MachineLearning"" existsBody: I'm having trouble getting the namespace Microsoft.Quantum.MachineLearning.
Here is an example Q# code:
namespace Temp {
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.MachineLearning;
operation Hello () : Unit{
Message(""Hello"");
}
}
Here is the python script which drives the code:
import qsharp
from qsharp import Result
import json
import os
from Temp import Hello
Hello.simulate()
Here's the error that the VSCode terminal shows:
Preparing Q# environment...
fail: Microsoft.Quantum.IQSharp.Workspace[0]
QS6104: No namespace with the name ""Microsoft.Quantum.MachineLearning"" exists.
Traceback (most recent call last):
File ""Driver.py"", line 5, in <module>
from Temp import Hello
ModuleNotFoundError: No module named 'Temp'
Here are my component versions:
>>> qsharp.component_versions()
{'iqsharp': LooseVersion ('0.11.2004.2825'), 'Jupyter Core': LooseVersion ('1.3.52077.0'), '.NET Runtime': LooseVersion ('.NETCoreApp,Version=v3.1'), 'qsharp': LooseVersion ('0.11.2004.2825')}
I've tried adding the package manually into my conda environment:
>>> qsharp.packages.add(""Microsoft.Quantum.MachineLearning::0.11.2004.2825"")
Adding package Microsoft.Quantum.MachineLearning::0.11.2004.2825.>>> qsharp.reload()
But that doesn't help.
Also, it's worth to note that there is no such problem when I try to do the same in a local Jupyter Notebook which is weird since they run in the same environment.
"
"['qiskit', 'ibm-q-experience', 'error-correction', 'ibm']"," Title: Quantum error correction on IBM devices?Body: I'm wondering if the gate errors on any of the IBM devices are low enough so that we could use some error correcting codes which do not require too many qubits? (such as 5- or 7-qubit codes). Even running programs with on little as 2 logical qubits would be cool.
"
"['quantum-state', 'fidelity', 'trace-distance']"," Title: What can be said about the closeness of two states if the difference of their fidelity measured with respect to a fixed state is close to 0?Body: Suppose I have two states $\rho$ and $\sigma$. We are given that,
$$Tr((\rho - \sigma)|\psi\rangle\langle\psi|) \geq \epsilon$$
where $|\psi\rangle$ is a fixed state and $\epsilon \rightarrow 0$,
Then can we conclude anything about the closeness of two states $\rho$ and $\sigma$ in any distance measure?
"
"['ibm-q-experience', 'qasm']"," Title: Problem with comments and code rearranging in IBM Q web interfaceBody: I wrote some code in QASM in the IBM Q Experience web interface and then I added some comments. After that I saved the code and run it. However, the code was rearranged (for example some gates were moved on other places - probably because of optimization). Moreover, all comments were removed. The same occurs when I save the code and return to it later Fortunately more recent codes are intact, i.e. there are comments I put there previously, but I was afraid to run them because of a risk of losing comments.
I am used to this behavior when I write a code and then do some edits in composer. In that case comments are also removed and the code is rearranged. But the above described issue seems to be a bug.
Does anyone face similar problems? Can anybody from IBM check this and fix?
EDIT:
As there was a misunderstanding when the comments disappear, here is a screenshot which place of web interface I meant. The code is of course rearranged during transpiling process. However, the problem is that IBM Q erase comments and rearrange code in Circuit editor.
EDIT 2:
This code I wrote to Circuit editor:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[5];
x q[1]; //ancila
h q[0]; //init
h q[1];
h q[2];
//Oracle f = 11.x
cx q[0],q[1];
cx q[2],q[1];
//measurement in Hadamard basis
h q[0];
h q[2];
measure q[0] -> c[1];
measure q[2] -> c[0];
Then I clicked on Save, closed the the circuit, opened again from Dashboard and the code changed to this:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[5];
h q[0];
x q[1];
h q[2];
h q[1];
cx q[0],q[1];
h q[0];
cx q[2],q[1];
h q[2];
measure q[0] -> c[1];
measure q[2] -> c[0];
So, the code is changed to transpiled code. I would like to avoid this behavior.
"
"['algorithm', 'quantum-walks']"," Title: Quantum walk for quantum simulated annealing in arXiv: 1512.03806Body: I'm studying quantum walk and quantum simulated annealing. While reading the paper Quantum algorithms for simulated annealing, I feel a little confused about the quantum walk they gave in Sec 2.1 Quantum walks for QSA, which is
$W=X^\dagger PXPRPX^\dagger PXR,$
where $P$ is the swapping opertor, $R=\mathbb{I}-2|\vec{0}\rangle\langle \vec{0}|$, and $X$ satisfies
$$X|\sigma_i\rangle |\vec{0}\rangle =\sum_{j=0}^{d-1} \sqrt{Pr_\beta (\sigma_j|\sigma_i)} |\sigma_i\rangle
|\sigma_j\rangle, \qquad
\vec{0}=\sigma_0,$$
and $\{\sigma_i\}_{i=0}^{d-1}$ can be considered as the full space of configurations.
As mentioned in the paper,
the detailed balance condition implies $W\sum_{i=0}^{d-1} \sqrt{\pi_\beta(\sigma_i)} |\sigma_i\rangle|\vec{0}\rangle=\sum_{i=0}^{d-1} \sqrt{\pi_\beta(\sigma_i)} |\sigma_i\rangle|\vec{0}\rangle$
where $\pi_\beta(\sigma_i)$ in the eigenstate are the probabilities given by the Gibbs distribution dependent on $\beta$. And
the goal of QSA is to prepare the corresponding eigenstate of $W$.
My questions are:
- How do we write $X$ in the operator form? Is $$\sum_{i=0}^{d-1} \sum_{j=0}^{d-1} \sqrt{Pr_{\beta}(\sigma_j|\sigma_i)} |\sigma_i\rangle\langle \sigma_i| \otimes |\sigma_j\rangle\langle \vec{0}|$$ correct?
- Which qubits do the $R$s act on? I think it's the first qubit for the first $R$ and the second one for the second, otherwise, the $R$s would make no sense...
- What does this walk mean? With the assumptions about $X$ and $R$, I tried to compute $$W\sum_{i=0}^{d-1} \sqrt{\pi_\beta(\sigma_i)} |\sigma_i\rangle|\vec{0}\rangle,$$
which seems to be
$$\sum_{i=0}^{d-1}\sqrt{\pi_\beta(\sigma_i)} \sum_{b=0}^{d-1} \sum_{c=0}^{d-1} (-1)^{I(i=0)+I(b=0)} \sqrt{Pr_\beta(\sigma_b|\sigma_i) Pr_\beta(\sigma_i|\sigma_b) Pr_\beta(\sigma_c|\sigma_b) Pr_\beta(\sigma_b|\sigma_c)} |c\rangle|0\rangle$$ ($(-1)^{I(i=0)+I(b=0)}$ could take different forms due to the location of $R$s). But is there any relationship between the balance condition and the walk c->b->i->b->c ?
Thanks!
"
"['quantum-state', 'qiskit', 'simulation']"," Title: Why do I get positive amplitudes when I create a qiskit StateVectorCircuit from only negative amplitudes?Body: I am using amplitude encoding to encode my features in a quantum circuit. With this I expect to encode e.g. 32 features in five qubits.
For the encoding I use qiskit's StateVectorCircuit. I expect to receive the same state vector when using the StateVectorCircuit with the 'statevector_simulator' as I put in.
However, I experienced, that the sign of the real part (I don't use complex numbers) doesn't matches.
Here is a small example:
state_vector = [-1/2, -1/2, -1/2, -1/2]
state_vector_circuit = StateVectorCircuit(state_vector).construct_circuit()
job = execute(state_vector_circuit, Aer.get_backend('statevector_simulator'), optimization_level=0)
result = job.result()
outputstate = result.get_statevector(state_vector_circuit)
print(outputstate)
print(state_vector)
Running this code, I receive the following output, where the second line is the expected one:
[0.5+0.j 0.5+0.j 0.5+0.j 0.5+0.j]
[-0.5, -0.5, -0.5, -0.5]
Measuring the circuit will have the same results. However, I don't want to measure it immediately instead I have this circuit as an input for my Quantum Neural Network. And, in this case I guess the sign matters.
Where is the wrong sign coming from? Is it the StateVectorCircuit or the 'statevector_simulator'? And more importantly is there a way from preventing this?
On the other hand, I figured I could use only positive amplitudes. However, I feel this would be a limitation.
Edit: I created an example jupyter notebook on my GitHub page: StateVectorCircuitTest.ipynb
"
"['machine-learning', 'neural-network', 'nisq']"," Title: How is back-propagation done in ""Transfer learning in hybrid classical-quantum neural networks""Body: Just read this paper from Xanadu on Quantum Transfer Learning and a couple of things are unclear to me regarding the optimisation step.
- How is back-propagation done through the classical weights feeding into the quantum unitaries?
- How do they even calculate cross-entropy loss without adding some sort of squashing function to the final output to give outputs in $[0,1]$ (my best guess is that the squashing function is implicit in the fact that you have to measure multiple times to get an expectation value).
PS: I know this might be overly-specific for SE but I suppose this is the best avenue short of writing the authors.
"
"['quantum-operation', 'information-theory', 'mutual-information']"," Title: What does vanishishing mutual information of the Choi imply about the channel?Body: Classically, if the mutual information between the input and output of some channel or circuit $= 0$, it means the output is independent of the input, and the circuit is in a way 'useless'.
For the quantum case, defining the mutual information between an input $\rho_A$ and the output $\rho_B$, where $\rho_B = \mathcal{E}_{B|A}(\rho_A)$ is not so straightforward.
Let the Choi state be $\rho_{A'B}=\mathbb{I}_{A'}\otimes \mathcal{E}_{B|A}(\Omega_{A'A})$, where $\Omega_{A'A}$ is a maximally entangled state. If $I(A';B)=0$, can one make a similar conclusion about 'independence' of input and output or 'usefulness' of the circuit in the classical case? Or what can one conclude here?
Thanks in advance!
"
"['quantum-gate', 'qiskit', 'gate-synthesis']"," Title: Is it possible to express $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? In Qiskit for exampleBody: Is it possible to express gate $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? Both in principle and in practice (in Qiskit for example)?
The single gate $R_z(\lambda)$ is not suitable, because it loses phase. In qiskit the transpile function throws an error:
Cannot unroll the circuit to the given basis, ['rx', 'ry', 'rz']. No rule to expand instruction u1.
"
"['quantum-state', 'bell-experiment']"," Title: How to prepare an arbitrary two-qubit state?Body: I know that to prepare a Bell state say $|\phi^+\rangle$, we need to initial state $|0\rangle,|0\rangle$ and then perform a Hadamard on the first and then use it as control to do a NOT gate on the second to obtain $$\dfrac{|00\rangle+|11\rangle}{\sqrt{2}}.$$ But what if wanted to create the state $$\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\eta|10\rangle.$$ How does one create this state?
"
"['programming', 'q#']"," Title: Graph coloring - Q# -Body: I am checking Q# - Graph coloring
for (C in 0 .. (1 <<< N) - 1) {
InitializeColor(C, register);
Can you help me explain this part of the code?
Thnx
for (N in 1 .. 4) {
using (register = Qubit[N]) {
for (C in 0 .. (1 <<< N) - 1) {
InitializeColor(C, register);
let measurementResults = MultiM(register);
Fact(ResultArrayAsInt(measurementResults) == C,
$"Unexpected initialization result for N = {N}, C = {C} : {measurementResults}");
ResetAll(register);
}
}
}
}
"
"['programming', 'cirq']"," Title: How to assign values to the symbols in a parametrized Cirq circuit without running it?Body: Is there a way to use a ParamResolver or Sweep to assign values to the symbols in a parameterized Cirq circuit without running it?
For example, something like:
#set up parameterized circuit
simulator = cirq.Simulator()
circuit = cirq.Circuit()
alpha = sympy.Symbol('alpha')
beta = sympy.Symbol('beta')
circuit.append(one_step(alpha, beta))
circuit.append(cirq.measure(*qubits, key='x'))
sweep = (cirq.Linspace(key='alpha', start=0.1, stop=0.9, length=5)
* cirq.Linspace(key='beta', start=0.1, stop=0.9, length=5))
for param_resolver in study.to_resolvers(sweep):
#resolve parameters
*line that resolves the symbolic parameters in circuit using param_resolver*
#run measurement simulations
measurements = simulator.run(circuit=circuit, repetitions=100)
Instead of:
#set up parametrized circuit
simulator = cirq.Simulator()
circuit = cirq.Circuit()
alpha = sympy.Symbol('alpha')
beta = sympy.Symbol('beta')
circuit.append(one_step(alpha, beta))
circuit.append(cirq.measure(*qubits, key='x'))
sweep = (cirq.Linspace(key='alpha', start=0.1, stop=0.9, length=5)
* cirq.Linspace(key='beta', start=0.1, stop=0.9, length=5))
for param_resolver in study.to_resolvers(sweep):
#resolve parameters and run measurement simulations in one step
measurements = simulator.run(circuit=circuit, param_resolver=param_resolver, repetitions=100)
"
"['quantum-gate', 'algorithm', 'qiskit', 'programming', 'circuit-construction']"," Title: How to append an Instruction to a QuantumCircuit with variable length of QuantumRegisters as qargs?Body: I think it is a bug but I'm not really sure. Basically, what I'm trying to do is the following: I have an Oracle Instruction which I want to append to my QuantumCircuit, looks as follows:
# initialising registers for readability
[control, train_register] = circ.qregs
circ.h(control)
# create and append oracle
oracle = create_oracle(train_register, control) # returns an Instruction
circ.append(oracle, [train_register, control])
If my train_register and control are both QuantumRegisters with length 1, this works perfectly fine. But I want to make this work for variable length of these registers, I get the error qiskit.circuit.exceptions.CircuitError: 'The amount of qubit arguments does not match the instruction expectation.'.
This is logical, since this error occurs because qiskit checks the length of my provided qargs in QuantumCircuit.append(), and I provided two registers in a list with both one qubit, so the length of the list happens to be the same as the number of qubits.
However, I want this to work for variable length. If I know what the length of my QuantumRegisters are, say len(train_register) is 3 and len(control) is 1 I can use
circ.append(oracle, [0, 1, 2, 3])
Or to make it work for unspecified lengths, I can write something like:
indices_to_append_to = list(np.arange(len(train_register) + len(control)))
circ.append(oracle, indices_to_append_to)
But I just really like the idea of just plugging in the names of the qregs as qargs. Is there something to make this work like that?
"
"['circuit-construction', 'graph-states']"," Title: Quantum Circuit explainationBody: I have a circuit that generates a 4 qubit linear cluster.
The steps i understand are
- Initialize the 4 qubits to $|0000\rangle$.
- Apply Hadamard $H$ on all.
- Then apply a controlled $Z$ gate .
All this is clear, but what is not clear to me is
- What are the two Hadamards doing on wire 1 and 4? what does this mean?
At the end of the circuit we get the state as $$|a\rangle=\frac{1}{2}(|0000\rangle+|0011\rangle+|1100\rangle-|1111\rangle)$$
Can somebody explain the two hadamards to me?
"
"['algorithm', 'quantum-state', 'entanglement', 'quantum-fourier-transform', 'phase-estimation']"," Title: Indexing an ""unknown"" quantum stateBody: Assuming I have a state
$$|x\rangle = \frac{1}{\sqrt{n}}\sum_n |x_n\rangle$$
where $|x_n\rangle$ are quantum state vectors
$$|x_n\rangle = \frac{1}{\|x_n\|}\sum_i x_{in}|i\rangle$$
and that I have a unitary $U:|x_n\rangle \mapsto e^{2\pi i\theta_n}|x_n\rangle$ such that I can use the phase estimation procedure to get the state
$$|x\rangle = \frac{1}{\sqrt{n}}\sum_n |x_n\rangle|\theta_n\rangle$$
Question:
I am wondering whether there is a way to compute the state
$$|x\rangle = \frac{1}{\sqrt{n}}\sum_n |x_n\rangle|n\rangle$$
I was thinking to modify the Phase Estimation Algorithm, but I still find it difficult to understand if I can prepare a unitary $U = \sum_n e^{2\pi in}|x_n\rangle\langle x_n|$ for instance.
I am not insterested in ordering the vectors $|x_n\rangle$ in any way, I just wonder if there is a way to index them easily.
I don't know if this problem has been raised before in literature and I don't know where to look at. I'd be glad if someone had some insights.
"
"['quantum-state', 'entanglement', 'non-locality', 'locc-operation']"," Title: Are Bell states distinguishable through LOCC?Body: Define $|\psi^{00}\rangle = \frac{1}{\sqrt2}(|00\rangle + |11\rangle)$ and $|\psi^{01}\rangle = \frac{1}{\sqrt2}(|00\rangle - |11\rangle)$, and consider the state
$$ |0\rangle\langle 0|^C\otimes |\psi^{00}\rangle\langle\psi^{00}|^{AB} + |1\rangle\langle 1|^C\otimes |\psi^{01}\rangle\langle\psi^{01}|^{AB}, $$
where the subsystems are distributed among three parties Alice, Bob and Charlie. Is it possible for Alice and Bob to extract Charlies bit through LOCC?
Essentially, I am asking if Bell states are locally distinguishable. If we consider $|\psi^{00}\rangle$ and $|\psi^{10}\rangle = \frac{1}{\sqrt2}(|01\rangle + |10\rangle)$, it is easy to see they are indeed locally distinguishable, but I have not been able to come up with a measurement that reveals the phase.
Any help is appreciated.
"
"['quantum-state', 'quantum-operation', 'nielsen-and-chuang']"," Title: Confusion over HSW theorem depicted in Nielsen and ChuangBody: On page 560, it states that
$$C^{(1)} \geq S(\frac{\varepsilon(|{\psi}\rangle\langle{\psi}|) +\varepsilon(|{\varphi}\rangle\langle{\varphi}|)}{2} - \frac{1}{2}\varepsilon(|{\psi}\rangle\langle{\psi}|)-\frac{1}{2}\varepsilon(|{\varphi}\rangle\langle{\varphi}|)).$$
However, shouldn't this be
$$C^{(1)} \geq S(\frac{\varepsilon(|{\psi}\rangle\langle{\psi}|) +\varepsilon(|{\varphi}\rangle\langle{\varphi}|)}{2} - \frac{1}{2}S(\varepsilon(|{\psi}\rangle\langle{\psi}|))-\frac{1}{2}S(\varepsilon(|{\varphi}\rangle\langle{\varphi}|)).$$
as on the same page it states that if $\varepsilon(|{\psi_{j}}\rangle\langle{\psi_{j}}|) = p|{\psi_{j}}\rangle\langle{\psi_{j}}|+(1-p)\frac{I}{2}$ then $S(\varepsilon(|{\psi_{j}}\rangle\langle{\psi_{j}}|)) = H(\frac{1+p}{2})$, so $C(\varepsilon)=1-H(\frac{1-p}{2})$, which can't come about unless it's the entropy of the two states, not just the channel acting on them, or am I misreading this completely?
"
"['qiskit', 'programming', 'hhl-algorithm']"," Title: How do I optimize HHL algorithm in Qiskit?Body: How do I optimize HHL algorithm in Qiskit?
I tried to follow this tutorial on HHL in Qiskit. My project requires solving a very specific type of linear equations $Ax=b$ like the one below.
b = np.array( [ 0. , 0. , 2.25 , 0. , 0. , 0. , -4.285, 0. ])
A = np.array([[ 1. , 0.333, 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.143, 1. , 0. , 0. , 0. , 0. ],
[-0.333, -1. , 0. , 0. , 1. , 0.333, 0. , 0. ],
[-0.25 , -1.5 , -0.25 , 0. , 0. , 1. , 0. , 0. ],
[ 0. , -0.562, -0.875, -0.562, 0. , 0. , 1. , 0. ],
[ 0. , 0. , -1. , -0.143, 0. , 0. , 0.143, 1. ]])
However, I only obtain a fidelity of around 0.7 - 0.8, which is not good enough for what I would like to do.
I notice the tutorial has a function called create_eigs with input parameters num_ancillae, num_time_slices, negative_evals.
def create_eigs(matrix, num_ancillae, num_time_slices, negative_evals):
...
What are they really? And what are their appropriate values?
"
"['quantum-gate', 'q#']"," Title: Difference between $Rz$ and $R1$ gateBody: You are given an operation that implements a single-qubit unitary transformation: either the Rz gate or the R1 gate. The operation will have Adjoint and Controlled variants defined.
Your task is to perform necessary operations and measurements to figure out which unitary it was and to return 0 if it was the Rz gate or 1 if it was the R1 gate.
"
"['programming', 'q#', 'machine-learning']"," Title: How do you decide which rotations to use in a Quantum Machine Learning model?Body: I am trying to design a model using Q#'s machine learning library that takes in two features (real numbers from 0 to 1) and classifies as 0 or 1.
So how do I decide which Rotations and what seeds to use?
ControlledRotation((0, new Int[0]), PauliY, 0)
I tried using this as the rotation gate but it gave an inaccurate model for many different seed values.
I also tried combining gates:
ControlledRotation((0, new Int[0]), PauliY, 0),
ControlledRotation((0, new Int[0]), PauliX, 1)
but this also gave an inaccurate model.
There must surely be a way to analyse what kind of gates to use and not just trial and error.
What kind of analysis would be appropriate?
"
"['quantum-operation', 'noise', 'textbook-and-exercises', 'kraus-representation']"," Title: Prove that the depolarizing channel is completely positiveBody: In two dimensions, for a density operator $\rho$ and probability $\lambda$, a depolarizing channel can be written as:
$$\mathcal{E}(\rho) = (1-\lambda) \frac{\mathbb{I}}{2} + \lambda\rho$$
In wikipedia page about Quantum depolarizing channel, it is mentioned that this channel can be viewed as a completely positive trace preserving (CPTP) map. But there is no reference about how to prove this statement? It only says that the range of $\lambda$ should be:
$$
-\frac{1}{d^2 - 1} \le \lambda \le 1
$$
Any pointers about how to prove that a depolarizing channel is CPTP?
"
"['quantum-gate', 'gate-synthesis', 'quantum-fourier-transform']"," Title: How to find a circuit for the roots of QFT?Body: After reading about using quantum gates instead of ancillas, it asserts that every quantum circuit has a square root. Theoretically, they do, but is there a practical method to generate the quantum circuit of the square root of arbitrary gates? Specifically, I'm interested in knowing if
$$\sqrt[2^k]{QFT}$$
Has a concise, practical representation as a quantum circuit. Besides from diagonalizing the matrix by hand and then using the sledgehammer of quantum circuits for arbitrary isometries, i see no other possible method.
Wikipedia says: "Squared root-gates can be constructed for all other gates by finding a unitary matrix that, multiplied by itself, yields the gate one wishes to construct the squared root gate of. All rational exponents of all gates can be found similarly" but provides no proof or associated reference to that claim.
Help and insights are greatly appreciated.
"
"['quantum-gate', 'programming', 'circuit-construction', 'q#']"," Title: Is it possible to create a gate in Q# that is dictated by a matrix?Body: When observing the Hadamard gate it is simply a transformation matrix. I am wondering if there is functionality to hard code an arbitrary transformation matrix and its family members up till $m \times n$ size depending on the limitations of the simulation. From here I would like the hard coded gate to transform my register of qubits.
"
"['quantum-state', 'programming', 'q#']"," Title: How can I create a basis state of $n$ qubits in Q#?Body: I would like to create a set of basis qubits. For example if I have $n=2$ I should get 4 states being 01 10 11 00. Generalized for $2^n$. Is there a way to do this in Q#?
"
"['measurement', 'resource-request', 'adiabatic-model']"," Title: Books about the measurement for Hamiltonian EnergyBody: I am searching for articles/books about the measurement energy of Hamiltonians in adiabatic quantum computing. Do you know of any good resources?
"
"['complexity-theory', 'speedup', 'annealing', 'adiabatic-model']"," Title: Is either the adiabatic or the diabatic version of quantum annealing known to be theoretically more powerful than the other?Body: Quantum annealing can be considered either in the perfectly adiabatic "slow" limit (in which case it's usually referred as "adiabatic quantum computing" (AQC) instead of "quantum annealing"), or in the diabatic regime of diabatic quantum annealing (DQA).
If you ignore all experimental practicalities and consider a theoretical perfect quantum annealer that can operate at any speed without decohering, then my intuition is that the perfectly adiabatic version would be the most theoretically powerful, in the sense that it can solve any problem faster than the diabatic version.
On the other hand, I could also imaging telling a heuristic story in which in some cases the diabatic effects can help, by either (a) simply allowing you to tune your transverse field qualitatively faster than possible if you need to maintain adiabaticity, or (b) taking advantage of quantum fluctuations out of the ground state to tunnel through some intermediate excited states that end up taking you to the final ground state faster than if you stayed in the ground state the whole time.
Are either of these two intuitions known to be correct? That is, is it known or suspected which of these three claims is correct from the perspective of theoretical computational complexity?
- For all problems, AQC is at least as powerful as DQA.
- For all problems, DQA is at least as powerful as AQC.
- For some problems, AQC gives a qualitative speedup over DQA, and for other problems, DQA gives a qualitative speedup over AQC.
"
"['qiskit', 'programming', 'circuit-construction', 'hamiltonian-simulation', 'matrix-representation']"," Title: Representation of rotation operators $e^{-i\theta(I-Z_1\otimes Z_2 \otimes Z_3)}$ about arbitrary axis for $3$ qubitsBody: I was wondering in how to interpret and represent the operator $e^{-i\theta(I-Z_1\otimes Z_2 \otimes Z_3)}$ for a 3 qubit system in a circuit using qiskit.
I was thinking I could just perform an individual $\theta$ degree rotation about each qubit Z axis but what about the identity? $e^{-i\theta I} = \begin{bmatrix}
e^{-i \theta } & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & e^{-i\theta}& 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & e^{-i\theta} & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & e^{-i\theta} & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & e^{-i\theta} & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 &e^{-i\theta} & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 &e^{-i\theta} & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & e^{-i\theta}
\end{bmatrix} $
I can construct this operator with the identity operator in 2 qubits and one identity with a global phase $e^{-i\theta}$. Isn't this just an identity with a global phase factor?
"
"['q#', 'machine-learning']"," Title: What's the relationship between output of qubit measurements and classification of data in Quantum Machine Learning?Body: I'm training a model in Q# which has more than 2 features.
I have trouble understanding the following things:
- How is the data classified based on the qubit states?
For example: If I have only 2 features (and want to classify our input as class A and class B) then only a single qubit would be used.
After measuring if the qubit turns out to be in the 0 state then its class A and in case of 1 its class B (or vice-versa).
But now if I have say 4 features then 2 qubits would be used and i could have 4 possible outcomes:
$$
|00\rangle,\quad |01\rangle,\quad |10\rangle,\quad |11\rangle.
$$
So how would the data be classified based on these states?
- Also am I correct in thinking that all the qubits are measured or is only 1 qubit measured and classified as class A/B?
"
['complexity-theory']," Title: State of the art of SAT on a quantum computerBody: Disclaimer: I don't understand quantum computing.
Given a CNF boolean formula $\phi$ in $n$ variables
and quantum computer with $q$ qubits, what is the
complexity of solving $\phi$ as a function of $n,q$?
I am mainly interested when $q$ is polynomial in $n$.
Can we get $2^{o(n)}$ (small Oh, Exponential time hypothesis)?
I believe on a traditional computer the complexity is $C^n$
for a constant $C < 2$.
"
"['measurement', 'superconducting-quantum-computing']"," Title: Many-photon limit of dispersive shift HamiltionianBody: In the context of superconducting quantum computing measuments, consider the dispersive shift Hamiltonian:
$$ H/\hbar = \omega_R a^\dagger a + \frac{1}{2} (\omega_Q + \frac{2g^2}{\Delta} a^\dagger a)\sigma^z $$
where we interpret the dispersive shift as a change in the qubit frequency. What happens when we just keep adding photons into the resonator?
The first thing I would guess is that the qubit's frequency gets higher and higher, but it doesn't seem to me that it can just get higher indefinitely. So what's the limiting behavior? I once had a quantum computing guy say that the qubit stops affecting the dynamics of the system, and if you were there measuring, you would only notice a resonator.
I'm looking to connect that statement to the math. Is it that some assumption we've made to get here breaks down, RWA for example? Why can we just ignore the high-frequency qubit?
"
"['quantum-gate', 'quantum-state', 'programming']"," Title: What is the shortest sequence of decomposition a given single-qubit unitary gateBody: Given a single-qubit unitary matrix, can we find the shortest sequence of Clifford + T gates that correspond to that unitary?
According to Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates , which is Solovay-Kitaev decomposition, I learned single-qubit decomposition may need $O(\log^{3.97} (1/\delta))$ clifford+T gates with the accuracy $\delta$.
And later many optimization is worked on it.
For example:
Synthesis of unitaries with Clifford+T circuits
So I want to know if there exists a shortest sequence of Clifford + T gates that correspond to decompose any single-qubit unitary into Clifford+T?
If it existed, what is commonly used in current compiler?
"
"['quantum-state', 'entanglement', 'q#', 'phase-estimation']"," Title: Finding phase angle in Q#Body: I've trying to measure the phase angle from X axis of a qubit, but unable to find any function in Q# documentation, can anyone help me with this?
"
"['qiskit', 'programming']"," Title: Qiskit textbook install errorBody: I'm trying to install the qiskit_textbook repository (https://github.com/qiskit-community/qiskit-textbook) and I keep getting this error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mb/sbqp79dx7zj7jpd6mfc1vdbh0000gn/T/pip-req-build-gqjhv69q/setup.py'"'"'; __file__='"'"'/private/var/folders/mb/sbqp79dx7zj7jpd6mfc1vdbh0000gn/T/pip-req-build-gqjhv69q/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/mb/sbqp79dx7zj7jpd6mfc1vdbh0000gn/T/pip-pip-egg-info-wn16yzlv
cwd: /private/var/folders/mb/sbqp79dx7zj7jpd6mfc1vdbh0000gn/T/pip-req-build-gqjhv69q/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/mb/sbqp79dx7zj7jpd6mfc1vdbh0000gn/T/pip-req-build-gqjhv69q/setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
"
"['programming', 'q#']"," Title: Quantum Katas - Tutorials - SingleQubitGates - Exercise 2 - GlobalPhaseIBody: Program.qs
namespace Quantum.Kata.SingleQubitGates {
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Math;
operation GlobalPhaseI (q : Qubit) : Unit is Adj+Ctl {
X(q);
Z(q);
Y(q);
}
}
Reference.qs
namespace Quantum.Kata.SingleQubitGates {
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Math;
operation GlobalPhaseI_Reference (q : Qubit) : Unit is Adj+Ctl {
X(q);
Z(q);
Y(q);
}
}
Test.qs
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Convert;
operation ControlledArrayWrapperOperation (op : (Qubit => Unit is Adj+Ctl), qs : Qubit[]) : Unit is Adj+Ctl {
Controlled op([qs[0]], qs[1]);
}
operation AssertEqualOnZeroState (testImpl : (Qubit => Unit is Ctl), refImpl : (Qubit => Unit is Adj+Ctl)) : Unit {
using (qs = Qubit[2]) {
within {
H(qs[0]);
}
apply {
Controlled testImpl([qs[0]], qs[1]);
Adjoint Controlled refImpl([qs[0]], qs[1]);
}
AssertAllZero(qs);
}
}
operation T2_GlobalPhaseI_Test () : Unit {
AssertOperationsEqualReferenced(2, ControlledArrayWrapperOperation(GlobalPhaseI, _), ControlledArrayWrapperOperation(GlobalPhaseI_Reference, _));
}
Driver.cs
using Microsoft.Quantum.Simulation.XUnit;
using Microsoft.Quantum.Simulation.Simulators;
using Xunit.Abstractions;
namespace Quantum.Kata.SingleQubitGates
{
public class TestSuiteRunner
{
private readonly ITestOutputHelper output;
public TestSuiteRunner(ITestOutputHelper output)
{
this.output = output;
}
/// <summary>
/// </summary>
[OperationDriver(TestNamespace = "Quantum.Kata.SingleQubitGates")]
public void TestTarget(TestOperation op)
{
using (var sim = new QuantumSimulator())
{
sim.OnLog += (msg) => { output.WriteLine(msg); };
sim.OnLog += (msg) => { Debug.WriteLine(msg); };
op.TestOperationRunner(sim);
}
}
}
}
"
"['programming', 'cirq', 'hhl-algorithm', 'tomography']"," Title: Adding Quantum State Tomography Step to HHL Algorithm (Cirq)Body: Over the past month, I have been learning about the HHL algorithm and am interested in extending the Cirq implementation to include the quantum state tomography step to extract the amplitudes or solutions of $|x\rangle$. How would I do this in Cirq?
Thanks!
"
"['teleportation', 'graph-states']"," Title: Cluster/Graph state teleportationBody: I came across somewhere about the circuit diagram that depicts the teleportation of a 4-qubit cluster state. Here it is
Let me tell what i understood.
- The qubits on the first two wires give the state $\dfrac{1}{\sqrt{2}}(|0\rangle|0\rangle+|1\rangle|1\rangle)$, which is a bell stae. This state i guess is teleported with the help of the 4 qubits cluster state, anyways ( i am not sure).
- The qubits on wires 3,4,5,6 after Hadamards and controlled phase give the cluster state
$$|a\rangle=\frac{1}{2}(|0000\rangle+|0011\rangle+|1100\rangle-|1111\rangle)$$
Now after this i am not able to understand the circuit, apart from the measurement. For example why is Hadamard on the 3rd wire?
Is there any specific way to make this circuit, any sequential procedure?
Can somebody explain?
"
"['classical-computing', 'superconducting-quantum-computing']"," Title: STO-3G Basis SetBody: Can someone please explain why STO-3G is considered to be a good basis set for quantum computing, while it does not help in classical computing?
I would also be very grateful for any references to read about as I could not find the needed information.
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Hamming Weight algorithmBody: Is there any quantum algorithm that can improve a calculation time for determining the Hamming weight of an arbitrary bit string? The Deutsch-Jozsa algorithm seems like it would be useful for this algorithm. I could not find any papers on this though.
"
"['qiskit', 'programming']"," Title: Error code: 3458Body: I ran my qsvm code on the quantum computer and I'm facing the following error:
FAILURE: Can not get job id, Resubmit the qobj to get job id. Terra job error: "Error submitting job: '400 Client Error: Bad Request for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs. Reached maximum number (5) of concurrent jobs, **Error code: 3458.**'"
Job limit reached, waiting for job 5ef1bc3ecd20b1001387fa06 to finish before submitting the next one.
FAILURE: Job id: 5ef1bc4edab6ee0013416233 is cancelled. Re-submit the Qobj.
FAILURE: Job id: 5ef1bc546daf510014814cd8 is cancelled. Re-submit the Qobj.
FAILURE: Job id: 5ef1bc5a13b5f900139e97c5 is cancelled. Re-submit the Qobj.
FAILURE: Job id: 5ef1bc62c7453600138726d0 is cancelled. Re-submit the Qobj.
The last line is repeating every few minutes. The url does not exist. I did run my code on the simulator and it worked.
It uses 5 features and hence 5 qubits. Could anyone please help me out?
The code:
data = np.genfromtxt('diabetes.csv', delimiter=',', names=True, case_sensitive=True)
data = np.array(data.tolist()) # was an array of arrays earlier
data = np.delete(data, 7, axis = 1)
data = np.delete(data, 3, axis = 1)
data = np.delete(data, 2, axis = 1)
print(data.shape)
x = np.copy(data[:,0:5]) #features
y = np.copy(data[:,5]) #targets
features = 5
from sklearn.model_selection import train_test_split
import qiskit
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.aqua.algorithms import QSVM
from qiskit.aqua.components.multiclass_extensions import one_against_rest, all_pairs
from qiskit.aqua.components.feature_maps import SecondOrderExpansion
provider = qiskit.IBMQ.load_account()
backend = provider.get_backend('ibmq_16_melbourne')
train_x, test_x, train_y, test_y = train_test_split(x[0:101], y[0:101], test_size=0.2)
training_data = {'A':train_x[train_y==0],'B':train_x[train_y==1]}
testing_data = {'A':test_x[test_y==0],'B':test_x[test_y==1]}
feature_map = SecondOrderExpansion(feature_dimension=features,depth=2,entanglement='full')
svm = QSVM(feature_map,training_data,testing_data)
shots = 1
quantum_instance = QuantumInstance(backend,shots=shots,skip_qobj_validation=False)
%%time
result = svm.run(quantum_instance)
"
"['mathematics', 'tensor-product', 'textbook-and-exercises']"," Title: Is the tensor product of two states commutative?Body: I'm reading "Quantum Computing Expained" of David McMahon, and encountered a confusing concept.
In the beginning of Chapter 4, author described the tensor product as below:
To construct a basis for the larger Hilbert space, we simply form the
tensor products of basis vectors from the spaces $H_1$ and $H_2$. Let
us denote the basis of $H_1$ by $|u_i\rangle$ and the basis of $H_2$ by
$|v_i\rangle$. Then it follows that we can construct a basis $|w_i\rangle$ for $H=H_1\otimes H_2$ using $|w_i\rangle = |u_i\rangle \otimes |v_i\rangle$ (4.6)
Note that the order of the tensor product is not relevant, meaning
$|\phi\rangle\otimes |\chi\rangle = |\phi\rangle \otimes |\chi\rangle$.
In last equation, I think it implies that tensor product of two state vector is commutative. However, with simple computation to prove this sentence, I could hardly understand why this holds.
Can anyone help me to understand what author want to explain?
"
"['quantum-state', 'density-matrix']"," Title: Density matrix of spatially (i.e., at the same time instant) vs. causally ( i.e., one evolves into the other) correlated quantum systemsBody: In the classical case, if Y is the output of a classical channel whose input is X, it makes sense to speak of a joint distribution $P_{XY}$. In the quantum case, if a state $\rho_A$ is input to a channel $\mathcal{E}_{B|A}$ producing $\rho_B$, speaking of a quantum state $\rho_{AB}$ is not consistent. However, if A and B are spatially correlated systems, and it makes sense in that case to speak of $\rho_{AB}$. Why is that?
"
['ibm-q-experience']," Title: Time taken on IBM Q qasm_simulator vs real backendBody: Running the same quantum circuit (example picture below, I've tried similar circuits too), both on a simulator and real backend, I've found than the simulator is always faster (sometimes by order of 100 times). I expected real backends to be faster than the simulators (at least on relatively complex circuits), please tell me why are they slower?
PS: I tried on ibmq_london and ibmq_burlington and ibmq_qasm_simulator was always faster with the run time (given by result.time_taken()) to be 7s, 7s and 0.03s respectively
"
"['quantum-state', 'programming', 'entanglement', 'random-quantum-circuit']"," Title: If two reduced density matrices are equal, does that mean that the two subsystems are the same?Body: Suppose we have a $3$-qubit system at time $t_0$ in the state
$$\vert{\psi(t_0)}\rangle= \vert{q_0}\rangle \otimes \vert{q_1} \rangle \otimes \vert{q_2}\rangle.
$$
We want to check if, for instance, the first qubit at time $t_1$ is equals to itself at time $t_0$:
$$\vert{\psi(t_1)} \rangle = \vert{q_0} \rangle \otimes \vert{\phi} \rangle,
$$
where $\vert{\phi} \rangle$ is the state of the qubits $q_1, q_2$ after the operations.
My first attempt is to calculate the reduced density matrix using the partial trace over the two other qubits, to get the reduced density matrix at $t_0$ and $t_1$:
$$\rho^0(t_0) = \operatorname{Tr}_{12}(\rho(t_0)),\\
\rho^0(t_1) = \operatorname{Tr}_{12}(\rho(t_1)).$$
So my question is:
is there an equivalence relation between the equality of the reduced matrices and the two subsystems being in the same state?
$$\rho^0(t_0) = \rho^0(t_1) \Leftrightarrow \vert{q_0}\rangle = \text{the state of the subsystem at }t_1 $$
"
"['quantum-state', 'algorithm', 'programming', 'entanglement']"," Title: How can I print out a state vector of a specific wire?Body: Suppose we start from 2 wires (q0 and q1) and through some quantum gates, suppose we measure q1 wire only.
As we measure the q1 wire, the state vector of this quantum state would be determined immediately. How can I print out this state vector?
In addition, I would like to print out the state vector of q0 wire only. Does anyone know how to do this task via qiskit or cirq or pyquil? (Any other package language is also fine!)
"
"['quantum-gate', 'algorithm', 'quantum-state']"," Title: How do I encode a classical vector into the input qubits?Body: Does anyone know how to encode a classical vector into a quantum state? For instance, I would like to encoder a classical vector $(0, 0.1, 0.4, 0.9)$ into 2 qubits by adding some quantum gates on 2 $|0\rangle$ starting states. Any program package including Qiskit, pyquil, cirq... is fine.
"
"['quantum-gate', 'quantum-fourier-transform']"," Title: Is there a quantum operation to change a phase $e^{(0.q_0 q_1 q_2 q_3)}$ into $e^{(0.q_1 q_2 q_3)}$?Body: Given a set of four qubits, say $q_{0},q_{1},q_{2},q_{3}$ which represent a $4$-bit binary number with $q_{0}$ as the MSB. After applying QFT on these qubits the phase of $q_{0}$using the concept of binary fractions ($e^{\frac{a}{2^{n}}} = e^{0..an...a1}$) becomes:
$Q(q_0) = \frac{1}{\sqrt{2}}\big(|0\rangle + e^{(0.q_{0}q_{1}q_{2}q_{3})}|1\rangle\big)$
My question is: Is there a quantum operation to change the phase of $Q(q_0)$ from $e^{(0.q_{0}q_{1}q_{2}q_{3})}$ to $e^{(0.q_{1}q_{2}q_{3})}$?
"
"['teleportation', 'tomography', 'graph-states', 'ghz-state']"," Title: Transferring GHZ state onto some qubitsBody: This question is just my effort that I made by understanding the previous answers to my questions . I have a GHZ state $|000\rangle+|111\rangle$ (please ignore the normalizing constant). For teleportaion of these three qubits (GHZ state) I make use of a 8 qubit cluster channel. I do this in the following way
Can this be the extension of the case when we teleport a Bell state (two-qubit) using 4 qubits cluster state?
Can somebody just check on this circuit? What should be the outcome? Can anybody suggest a possible reference to read?
"
"['algorithm', 'programming', 'qutip']"," Title: Find orthogonal state for random 7 qubit stateBody: I have a system that generates a random 7 qubit state and I need a method to always find the orthogonal state.
I'm currently using python and qutip for this, representing this 7 qubit state by a 128-dimensional vector.
"
"['quantum-operation', 'kraus-representation', 'channel-capacity']"," Title: How to compute the capacity of a quantum channel from its Kraus operators?Body: Is there a working rule to compute the capacity of a quantum channel described by a set of Kraus operators $\{K_i\}$?
"
"['quantum-state', 'measurement', 'non-locality', 'locc-operation']"," Title: Are separable, orthogonal states LOCC distinguishable?Body: Consider two states $\sigma_0,\sigma_1\in\text{L}(\mathcal{H}_{AB})$, and suppose $\sigma_0,\sigma_1$ are separable and orthogonal. Is it possible to distinguish between $\sigma_0,\sigma_1$ through LOCC?
My approach so far har been to write out
$$ \sigma_0 = \sum_{i=1}^n p_i |a_ib_i\rangle\langle a_ib_i| \quad\text{and}\quad
\sigma_1 = \sum_{j=1}^n q_j |a_jb_j\rangle\langle a_jb_j|, \quad
\text{where } p_i,q_j\geq 0, $$
and since
$$ 0 = \text{Tr}(\sigma_0^\dagger\sigma_1)
= \sum_{i,j}^n p_iq_j \lvert\langle a_ib_i | a_jb_j\rangle\rvert^2, $$
it follows that all terms in the decomposition of $\sigma_0$ are orthogonal to all terms in the decomposition of $\sigma_1$. My idea was now to measure using projections onto the two subspaces spanned by the terms in each decomposition, and these are separable projections. I am stuck at implementing this as an LOCC protocol, so any help with this or giving an alternative approach is appreciated!
"
"['qiskit', 'programming', 'noise']"," Title: I want to create a depolarizing channel on IBM qiskitBody: I want to replicate the depolarizing noise channel
for a 4 qubit circuit system, where p is the probability for an error.
I tried doing this:
But I get the error WARNING: all-qubit error already exists for instruction "measure", composing with additional error.
I have looked at Qiskits documentation on the depolarizing_error function but it is not clear, or I don't understand the maths.
Could anyone please shed more light on this?
Edit:
I might have found a solution, but I'm not sure if my logic is right.
For my 4 qubit system, I want to apply the depolarizing channel noise to the measurement of the qubits $q_{0}$ and $q_{2}$ in the z-direction:
Edit:
I realized that the single-qubit depolarizing channel above acts separately on the two qubits:
"
"['algorithm', 'complexity-theory']"," Title: Rings or algebras with many nilpotent elements and efficient computationBody: Searching the web for '"quantum computer" nilpotent'
returns many results, so maybe the question is ontopic
for this site.
Can a quantum computer solve the following mathematical
problem:
This is related to an open problem, so likely the answer is negative.
The problem is Cycle Enumeration using Nilpotent Adjacency
Matrices with Algorithm Runtime Comparisons pp 2-3 about zeon algebra.
Is there commutative ring or commutative algebra $R$ with the following properties:
- There are $n$ nilpotent elements $a_i$ satisfying $a_i^2=0$
- $a_1 a_2 \cdots a_n \ne 0$.
- Computation in $R$ is efficient: for an $n$ by $n$ matrix $M$
with entries zero and $a_i$, for natural $m$ we can compute
$M^m$ in time polynomial in $nm$.
If we omit the efficiency constraint, the answer is easy:
Take $R=K[a_1,a_2,...a_n]/(a_1^2,a_2^2,...a_n^2)$ for any ring $K$.
"
"['error-correction', 'research']"," Title: Quantum channels and error correction research groupsBody: I am wondering which are the top universities or research groups through the world that are doing research in the topic of quantum error correction or quantum channels (decoherence noise models). I think this is interesting in order to know which are the main tendencies that the quantum community is following concerning those fields.
"
['cirq']," Title: Can not build circuit unitary for a three-qubit gate in CirqBody: I am trying to implement a three-qubit gate in an eight-qubit circuit. The method I use is the same by which I create my two-qubit gates with no issues. I produce the unitary of the gate and then introduce it to the _unitary_(self) method. I did the same for the three-qubit gate:
import cirq
import numpy as np
class CsAgate(cirq.ThreeQubitGate):
def __init__(self, theta):
self.theta = theta
def _unitary_(self):
st = np.sin(self.theta)
ct = np.cos(self.theta)
return np.array([
[1., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, ct, st,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, st,-ct,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, ct,st, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, st,-ct,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, 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, 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, 0],
]
)
def _circuit_diagram_info_(self, args):
return 'o','theta({})'.format(round(self.theta, 2)), '0'
def __str__(self):
return 'test'
n_qubits = 8
qubits = cirq.LineQubit.range(n_qubits)
my_circuit=cirq.Circuit([CsAgate(2.)(qubits[0], qubits[1], qubits[2])])
print(my_circuit)
print(my_circuit.unitary())
The circuit is generated successfully but Cirq throws an error when calculating the circuit unitary. Any idea how to solve this issue?
Traceback (most recent call last):
File "/Users/mjahanpo/Desktop/opt_api/test.py", line 46, in <module>
print(my_circuit.unitary())
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/circuits/circuit.py", line 1418, in unitary
result = _apply_unitary_circuit(self, state, qs, dtype)
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/circuits/circuit.py", line 1960, in _apply_unitary_circuit
return protocols.apply_unitaries(
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/protocols/apply_unitary_protocol.py", line 492, in apply_unitaries
result = apply_unitary(unitary_value=op,
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/protocols/apply_unitary_protocol.py", line 347, in apply_unitary
result = strat(unitary_value, args)
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/protocols/apply_unitary_protocol.py", line 384, in _strat_apply_unitary_from_apply_unitary
sub_result = func(sub_args)
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/ops/gate_operation.py", line 113, in _apply_unitary_
return protocols.apply_unitary(self.gate, args, default=None)
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/protocols/apply_unitary_protocol.py", line 347, in apply_unitary
result = strat(unitary_value, args)
File "/Users/mjahanpo/opt/anaconda3/envs/opt_api/lib/python3.8/site-packages/cirq/protocols/apply_unitary_protocol.py", line 419, in _strat_apply_unitary_from_unitary
matrix.reshape(val_qid_shape * 2),
ValueError: cannot reshape array of size 256 into shape (2,2,2,2,2,2)
"
"['algorithm', 'qiskit', 'programming', 'ibm-q-experience', 'grovers-algorithm']"," Title: Why is the number of solutions given in Qiskit textbook(Quantum Counting Algorithm) as N-M instead of M?Body: I'm following the Qiskit textbook for Quantum Counting. We have assumed $M$ as the number of states containing solutions throughout the algorithm but at last, $N-M$ has been taken as the solution. What am I missing?
Here $|w\rangle$ corresponds to the number of states that contain solutions and $|𝑠'\rangle$ corresponds to the number of states that don't contain solutions.
$\langle s'|s\rangle = \cos \frac{\theta}{2}$
$\langle s'|s\rangle = \sqrt \frac{N-M}{N}$
We combine these equations to obtain:
$N \sin^2 \frac{\eta}{2} = M$
The theory part is understandable, and it clearly shows that $M$ is the number of states containing solutions, yet, the answer is given as $N-M$.
Can anyone help me with it?
"
['cirq']," Title: How to build a controlled two-qubit gate?Body: I have a two-qubit gate with below unitary:
def _unitary_(self):
st = np.sin(self.theta)
ct = np.cos(self.theta)
ei = np.exp(1j*self.phi)
emi = np.exp(-1j*self.phi)
return np.array([
[1., 0, 0, 0],
[0, ct, ei*st, 0],
[0, emi*st, -ct, 0],
[0, 0, 0, 1.]
]
)
I want to build a three-qubit gate in which one qubit serves as the control qubit on the above two-qubit gate while the gate is applied on the other two qubits.
Here is an example of such gate: Say the gate is applied on q0, q1, and q2 where q0 is the control qubit. The above 4*4 unitary should be applied to q1 and q2 if and only if q0 is 0.
How would the unitary of such three-qubit gate look like? (I'm doing this in Cirq)
"
"['fidelity', 'trace-distance']"," Title: Saturating the Fuchs-van de Graaf inequalityBody: It is well-known that one side of the Fuchs-van de Graaf inequality is saturated for pure states, i.e. $F(\rho,\sigma)^2 = 1-d(\rho,\sigma)^2$ when $\rho$ and $\sigma$ are pure (here we are using the definition $F(\rho, \sigma) := \|\sqrt{\rho}\sqrt{\sigma}\|_1$ for fidelity). However, are there other situations where it is known that this equality holds? How far has this been characterized?
As a starting point, I am aware that when the states are qubits, it can be shown that $F(\rho,\sigma)^2 = 1-d(\rho,\sigma)^2$ holds if and only if the states have the same eigenvalues. (This is not too difficult to prove using specialized qubit expressions for the fidelity, but as far as I am aware, it does not seem to be well-known.) The "have the same eigenvalues" condition does not generalize even to qutrits, however, and hence it may perhaps not be the best approach to characterizing the conditions.
"
"['quantum-gate', 'quantum-state']"," Title: Are quantum operations reversible?Body: If We perform some unitary operations on a Quantum State $|A\rangle$ after which it becomes$|A'\rangle$. Then if we perform the inverse of all those unitary operations on the state $|A'\rangle$ in reverse order, can we roll back to the state $|A\rangle$?
"
"['entanglement', 'key-distribution', 'state-distillation']"," Title: What is the intuition behind the following entanglement distillation protocol for continuous variable systems?Body: The protocol is:
We start with a supply
of identically prepared bipartite non-Gaussian states. The overall protocol then amounts to an iteration of the following
basic steps.
- The states will be mixed pairwise locally at 50:50
beam splitters.
- On one of the outputs of each beam splitter, a photon
detector distinguishes between the absence and presence of
photons. It should be noted that we do not require photon
counters that can discriminate between different photon
numbers.
- In case of absence of photons at both detectors for a
particular pair, one keeps the remaining modes as an input
for the next iteration, otherwise the state is discarded.
This is one iteration of the protocol which we will continue
until we finally end up with a small number of states
that closely resemble Gaussian states.
![]()
This protocol is presented in the paper: https://journals.aps.org/pra/abstract/10.1103/PhysRevA.67.062320
Specifically, what I am trying to understand is: why does vacuum detection at both outputs lead to distillation? What is the motivation for this step?
"
['q#']," Title: How can I create an n-dimensional Hadamard transform in Q#?Body: I would like to create a n-dimensional Hadamard transform in Q# with n in set of even integers.
"
"['nielsen-and-chuang', 'matrix-representation', 'textbook-and-exercises']"," Title: How to find the matrix representation of an operator from its action on a basis?Body: First, I apologize if something is poorly written but English is not my first language.
I know that these exercises have been solved in this question. But I do not agree. Inner product and concrete vectors are used and I think that this question has to be solved only with information we have from the beginning of chapter 2 until the exercise.
So I think we only have to use eq. 2.12 in this way:
if we write $\left|0\right>=\left|v_{0}\right>$ and $\left|1\right>=\left|v_{1}\right>$ and we use them as input and output basis, we can write (2.12) as $A\left|v_{j}\right> = \sum_{i} A_{ij} \left|v_{i}\right>$; so,
$A\left|v_{0}\right> = A_{00}\left|v_{0}\right> + A_{10}\left|v_{1}\right> = \left|v_{1}\right> \Rightarrow A_{00}=0; A_{10}=1$
$A\left|v_{1}\right> = A_{01}\left|v_{0}\right> + A_{11}\left|v_{1}\right> = \left|v_{0}\right> \Rightarrow A_{01}=1; A_{11}=0$
$$
A = \begin{bmatrix}
0 & 1\\
1 & 0
\end{bmatrix}
$$
As we can see I don't use concrete basis vectors and this works for basis $\begin{pmatrix}0 \\1 \end{pmatrix}$ and $\begin{pmatrix}1 \\0 \end{pmatrix}$.
But not with basis like $\frac{1}{\sqrt{2}}\begin{pmatrix}1 \\1 \end{pmatrix}$ and $\frac{1}{\sqrt{2}}\begin{pmatrix}1 \\-1 \end{pmatrix}$.
My feeling was that this solution doesn't depend on the basis but it does. So why?
"
"['entanglement', 'textbook-and-exercises', 'partial-transpose', 'entanglement-negativity']"," Title: Why does the entanglement negativity equal (in magnitude) the sum of the negative eigenvalues?Body: The entanglement negativity, introduced in (Vidal and Werner 2002), is defined as
$$\mathcal N(\rho) \equiv \frac{\|\rho^{T_B}\|_1-1}{2}.$$
It is mentioned there that this equals the sum of the absolute values of the negative values of the eigenvalues of the partial transpose $\rho^{T_B}$:
$\mathcal N(\rho)=\sum_{\lambda<0} \lvert\lambda\rvert$.
How does one show the equivalence of these two quantities?
"
"['entanglement', 'textbook-and-exercises', 'partial-transpose', 'entanglement-negativity']"," Title: Compute the negativity of maximally entangled bipartite statesBody: The entanglement negativity $\mathcal N(\rho)$ of a (bipartite) state $\rho$ is defined as the absolute value of the sum of the negative eigenvalues of the partial transpose of a state, or equivalently, $2\mathcal N(\rho)=\|\rho^{T_B}\|_1-1$.
Consider a maximally entangled pure state: $|\psi\rangle \simeq \sum_{k=1}^N |k,k\rangle$. What is the entanglement negativity of such states? What are good ways to derive this quantity?
"
"['quantum-state', 'physical-realization', 'physical-qubit']"," Title: Can we have multiple-state unit for quantum computer?Body: All quantum computers now are working with qubit which is zero or one.
Can we have quantum computer with multiple-state unit? Such as trit (trinary, 3 states), digit (10 states) instead of qubit (2 states)?
"
"['quantum-gate', 'error-correction', 'stabilizer-code']"," Title: What are generators for a ""real"" Clifford group?Body: I work with stabilizer codes using the real version of Pauli matrices:
$X=((0,1),(1,0))$, $Z=((1,0),(0,-1))$, $Y=XZ$ (not $\imath XZ$).
I know the encoders for these codes lie in the Clifford group which is generated by the matrices (P,H,CX) described here:
Presentation of the Clifford group by generators and relations
Are H and CX enough to generate a real version of the Clifford group? Or is there an additional gate to replace the "P" gate? (This would be the group of real $2^n \times 2^n$ orthogonal matrices that normalize the group generated by the real Pauli matrices.)
"
"['algorithm', 'entanglement', 'measurement']"," Title: Bra-Ket Notation and Proof of a Ket Equation in Two-Party Shared-Entanglement SettingBody: Disclaimer: I had posted this question previously on the physics StackExchange, but received no response there.
My question is two-part. First, imagine a bipartite quantum state $|\Phi \rangle_{AB}$, made of $2n$-qubits, shared between Alice and Bob (with $n$-qubits each). Alice performs some unitary operation $U$ on her part of the state and then performs $Z$-basis measurements. As a result, Bob's state collapses to a mixed superposition of states. Now, if Alice measures her state to be $|0\rangle^{\otimes n}$, how do I write the state that Bob's share has collapsed to, in bra-ket notation? At first, I thought it would be $\langle 0 |^{\otimes n} (U \otimes I_n) | \Phi \rangle_{AB}$ but that is, of course, incorrect (dimensional mismatch tells me that). I should probably be using some projection operators instead of simply $\langle 0 |^{\otimes n}$ but I can't figure out exactly what.
Second, assume that $| \Phi \rangle_{AB} = \left ( \frac{|00\rangle_{AB} + |11 \rangle_{AB}}{\sqrt{2}} \right )^{\otimes n}$ so that Alice owns the first qubit from every term and Bob owns the second (essentially, they share $n$ copies of the $|\Phi^+\rangle$ Bell state between them). Now what I want to prove is $$U^{\dagger} | 0 \rangle^{\otimes n} = \color{red}{\langle 0 |^{\otimes n} (U \otimes I_n) | \Phi \rangle_{AB}} $$
where I've colored the RHS red to emphasize that I know it is wrong, but it should be replaced by the properly notated answer to my first question. How do I go about proving this? I'm only asking for a hint, not a full proof. Thanks.
(This is by no means homework; my QM skills have grown somewhat rusty but I need to use this proof in a paper that I'm working on)
"
"['simulation', 'q#']"," Title: What would be the difference between using qsharp library on python vs learning the Q# langauge?Body: One difference of course is the syntax. But I'm guessing the idea is eventually quantum computers will be able run Q#, whereas now it uses simulations. Will code written in Python with the qSharp library also be able to do this?
"
['entanglement']," Title: Creative way to clone quantum data?Body: My goal is to think of a creative way to clone quantum data, specifically, forensically examine a quantum hard drive or memory of the future.
No, I don't think I can violate the No Cloning Theorem or bypass the Measurement issue. But I was wondering if a creative addition, such as using quantum teleportation or something like that could be used?
For example, what if with every qubit of data (X) on a quantum hard drive, we also required a separate, "assigned" Bell pair (A=B). So every time we create X we also entangle it with A (A=X=B). Could B, outside the hard drive be used to read X? Or am I begging the question...because it would be impossible to entangle X without changing X from it's original state or something like that? Could some mechanism like redundant probability "reads" be used...like something borrowed from quantum error correction ideas?
"
"['error-correction', 'stabilizer-code']"," Title: Other than distance, what other metrics can be used to compare quantum error correcting codes?Body: Using classical error correction (or channel coding) as a reference, I'd like to be able to compare QECC's from different constructions. Distance is a reasonable measure and you can argue that an $[[n_1,k_1,d_1]]$ is a better code than an $[[n_2,k_2,d_2]]$ if for example $k_1/n_1 = k_2/n_2$ and $d_1>d_2$ (same rate, larger distance); or maybe $d_1 = d_2$ and $k_1/n_1 \gt k_2/n_2$, (same distance, higher rate),or $n_1/k_1=n_2/k_2, d_1=d_2$ and $n_1 \lt n_2$, (same rate and distance, smaller number of physical qubits). However, just like the classical case, I'm sure that distance doesn't tell the whole story. The "channel" (or error model) has to enter the picture as well as the decoding algorithm. Distance can also be difficult to calculate for large $n$. In classical ECC, a plot of BER vs SNR in AWGN channel can quickly tell you if a code/decoder combination gives better performance than another. What would be possible equivalents for QECC? (to simplify things you can ignore decoder complexity as a parameter; you can also limit QECC's to stabilizer codes)
"
"['quantum-state', 'circuit-construction', 'graph-states']"," Title: Creating a specific cluster stateBody: I have a state $$\dfrac{1}{2}(|00000\rangle+|00111\rangle+|11101\rangle+|11010\rangle).$$ How does one create this state? In general, how does one create for instance an $n$-bit cluster state, is there any particular rule? And by looking at a particular cluster state, how can one construct the quantum circuit that created the state?
"
"['quantum-gate', 'entanglement', 'physical-qubit', 'deutsch-jozsa-algorithm', 'photonics']"," Title: Question about DIY Quantum Computer PrototypeBody: I recently came across these 2 videos on Coursera which show how to build a simple quantum computer that can implement the simplest case of the Deutsch-Jozsa algorithm (which uses only 2 qubits).
https://www.coursera.org/lecture/quantum-computing-algorithms/quantum-computer-prototype-diy-dCKRO
https://www.coursera.org/lecture/quantum-computing-algorithms/quantum-computer-prototype-solving-the-deutschs-problem-7EuD2
Since my only knowledge of quantum computing comes from this online textbook: https://qiskit.org/textbook/ch-states/introduction.html, which doesn't focus on the underlying physics), I was having trouble understanding the underlying physics used in those 2 videos.
I will try to explain the device's function in my own words. Please critique any incorrect statements I make.
2 qubits are encoded using a single photon.
Qubit 1's state is described by the path the photon is on and Qubit 2's state is described by the polarization of the photon.
Once the photon has passed from the laser past the 1st polarizing filter and beam splitter, it is equivalent to a Hadamard gate being applied to both Qubit 1 and Qubit 2.
After the photon passes through the waveplates, it is equivalent to the quantum oracle being applied to both Qubit 1 and Qubit 2.
Lastly, the photon passes through one final beam splitter, which is equivalent to a Hadamard gate being applied to both Qubit 1 and Qubit 2.
The difference in the interference pattern on the wall shows whether the quantum oracle was balanced or constant.
Am I interpreting this experiment correctly and can someone explain the physics underlying this system? I found the two videos to be very confusing, although very fascinating.
Thank you very much for your time and I apologize for the long question.
Cross posted on Physics.SE
"
"['textbook-and-exercises', 'bell-experiment', 'bell-basis', 'entanglement-swapping']"," Title: Problem about entanglement swappingBody: I have been learning about the concept of entanglement swapping and found an equation mentioned in the textbook, Mathematics Of Quantum Computing: An Introduction written by Wolfgang Scherer.
At section 4.13, equation (4.13),
\begin{equation}
\begin{split}
{|\Phi\rangle}^{ABCD} & = |\Psi^{-}\rangle^{AB} \otimes |\Psi^{-}\rangle^{CD} \\
& = \frac{1}{2} \left( |0101\rangle - |0110\rangle -|1001\rangle + |1010\rangle \right)\\
& = \frac{1}{2} \left( |\Psi^{+}\rangle^{AD} \otimes |\Psi^{+}\rangle^{BC}
- |\Psi^{-}\rangle^{AD} \otimes |\Psi^{-}\rangle^{BC}\\
\quad - |\Phi^{+}\rangle^{AD} \otimes |\Phi^{+}\rangle^{BC}
+ |\Phi^{-}\rangle^{AD} \otimes |\Phi^{-}\rangle^{BC}
\right)\\
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
|\Phi^{+}\rangle = \frac{1}{\sqrt{2}} \left( |00\rangle + |11\rangle \right)\\
|\Phi^{-}\rangle = \frac{1}{\sqrt{2}} \left( |00\rangle - |11\rangle \right)\\
|\Psi^{+}\rangle = \frac{1}{\sqrt{2}} \left( |01\rangle + |10\rangle \right)\\
|\Psi^{-}\rangle = \frac{1}{\sqrt{2}} \left( |01\rangle - |10\rangle \right)
\end{split}
\end{equation}
and the supernotes $\{ A,B,C,D \}$ outside the ket indicate the qubits forming the bell state. Therefore, by doing bell measurement on qubits $(B,C)$, qubits $(A,D)$ are in bell state. This result is also mentioned in Multiparticle generalization of entanglement swapping by S. Bose et al (PhysRevA.57.822), but without derivation.
So my question is that how to derive other similar equations efficiently instead of expand the bell states back into computational basis $| x \rangle^{\otimes n}$ where $x \in \{0,1\}$ and go through the tedious algebras step by step? For example, how to do the entanglement swapping of ${|\Phi\rangle}^{ABCD} = |\Psi^{-}\rangle^{AB} \otimes |\Phi^{+}\rangle^{CD}$ from $(A,B)$ and $(C,D)$ to $(A,D)$ and $(B,C)$ or even $(A,C)$ and $(B,D)$?
"
"['quantum-gate', 'physical-realization', 'architecture']"," Title: What are the practical limitations of complementing quantum computations with memristors?Body: Considering the current state of research into quantum memristors, and the advantages/disadvantages of quantum and memristor driven computing architectures:
Quantum Memristors
Quantum Memristor Circuits
Quantum Computing vs. Memory focused computation of Memristors
From a practical implementation point of view, what are current the limits of 'boosting' or 'complementing' quantum computations with memristors?
"
"['quantum-gate', 'algorithm']"," Title: Quantum operations as sparse matricesBody: What are examples of quantum operators or evolutions of quantum states that can be modeled as sparse matrices?
"
"['quantum-gate', 'circuit-construction']"," Title: Prove expressions for visibilities $\operatorname{Tr}(\rho_a^2\rho_b^2), \operatorname{Tr}[(\rho_a \rho_b)^2]$ in terms of SWAP operationsBody: Given two states $\rho_a$ and $\rho_b$, and knowing that the SWAP gate swaps two qubits, how can one prove that visibilities
$v_1=Tr[\rho_a^2 \rho_b^2] = Tr[S_{AB} S_{BC} S_{CD} \rho_a \otimes \rho_a \otimes \rho_b \otimes \rho_b ]$
$v_2=Tr[(\rho_a \rho_b)^2] = Tr[S_{BC} S_{CD} S_{AB} S_{BC} S_{AB} \rho_a \otimes \rho_a \otimes \rho_b \otimes \rho_b]$
Reference: https://arxiv.org/pdf/1501.03099.pdf
"
['entanglement']," Title: Predicting rotations with many EPR pairsBody: I was explaining to a colleague that you can't use EPR pairs to communicate information, as it violates the no-communication theorem. This lead me to thinking... If I have let's say 1,000,000 EPR pairs shared with someone far away. We agree ahead of time that if I perform a rotation $\theta$ on my qubit, then I mean to communicate the bit $0$, and when I perform the rotation $\phi$, then I mean to communicate the bit 1.
We agree that at some time in the future (assume we have synchronized clocks), that I will perform the same rotation on all 1,000,000 of my EPR pair halves. After some agreed upon time, the holder of the other 1,000,000 pair halves measures his qubits to predict which rotation I made on my qubits. Then with high probability they can guess the message I wanted to send.
I know there is something wrong in this configuration, but I can't point it down. If this would be possible, then I could communicate faster than light...
Can anyone point out the error in my reasoning?
Thanks.
"
"['ibm-q-experience', 'qasm']"," Title: Post-selection in QASMBody: In some quantum algorithms (for example HHL or quantum machine learning algorithms) an ancilla qubit(s) is measured firstly and based on result of the measurement other qubit(s) are measured or not. For example, in this case, qubit $|c\rangle$ is measured if the ancilla is in state $|0\rangle$:
So far, I did post-selection manually. This means that I took all results with ancilla being in a particular state ($|0\rangle$ in the example above), removed others and finally normalized remained distribution to have sum of probabilities equal to 1.
My question is whether is it possible to do so in more elegant way in QASM on IBM Q Experience.
This means to define which qubit is the ancilla, set which values of the ancilla has to be measured in order to measure other qubit(s) and get a conditional distribution of measured qubits under condition that ancilla is in some predfined state.
"
"['programming', 'q#']"," Title: Entangling a register with another register using phase flipsBody:
operation Algorithm() : Unit
{
using (register = Qubit[4])
{
within
{
PrepareUniformSuperposition(4,LittleEndian(register));
ApplyToEach(register[2],register);
}
I am having trouble with the ApplyToEach line. I am wondering if there is a way to entangle all the qubits in my register with another qubit, more broadly the 2(a) line 1. To my understanding I am satisfying the j term with uniform superposition. I am under the impression that when I apply the y-th qubit to my register I will entangle them. Maybe I am using the term entanglement wrong.
"
"['quantum-gate', 'algorithm', 'error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: How to calculate destabilizer group of toric and other codesBody: Some papers use the "destabilizer group" for more efficient simulations; see for example (page 3):
https://www.scottaaronson.com/showcase2/report/ted-yoder.pdf
"In addition to stabilizers, we also make use of destabilizers, introduced by Aaronson and Gottesman [10]. While the
stabilizer generators can be thought of as virtual Z operators, the destabilizers can be thought of as their conjugate,
virtual X operators."
Given the stabilizers $S_i$ of an $[n,k,d]$ code I know of algorithms to put them in standard form
and calculate the encoded $\bar X$'s and $\bar Z$'s (also in standard forms). This gives me $m+k+k$ operators. The destabilizers are an additional $m$ operators on top of these; how are these calculated? Are there standard forms possibly related to the other generators'? Also, the $[2d^2,2,d]$ toric code is usually
described with $2d^2$ stabilizers (2 of them redundant); how is the redundancy handled?
"
"['algorithm', 'programming', 'error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: Algorithm to find stabilizer statesBody: I'm working on a project in which I have to find stabilizer states based on a few criteria, the main one being that it has to have a certain amount of coherence, I'm using the following equation to calculate my coherence based on the density matrix of the state.
$$
C_r(\rho) = S_{VN}(\rho_{diag}) - S_{VN}(\rho)
$$
Where S is the Von Neumann entropy and rho diag is the matrix with the main diagonal equal the density matrix's main diagonal, and every other term is zero.
I'm also defining this to be a 5-qubit stabilizer state.
I'm using python and qutip to do these calculations.
Is there a better-than-brute-force algorithm to generate stabilizer states? Is there a way to generate stabilizer states at random based on some criteria?
"
"['quantum-gate', 'quantum-state', 'programming', 'simulation']"," Title: A question about how does the single qubit gate simulated in simulator?Body: I have found the procedure of simulation process as this picture :
Image reference. So in the low-level compilers, all single-qubit gates are approximated by the universal gate set (CNOT, H, T, S).
When implementing arbitrary gates, I want to know if all simulators (like Qiskit) will do the low-level compilers job in this picture with a fixed accuracy. If so, what is the algorithm during this process? Are they using the Solovay-Kitaev Decomposition strategy (or some improved algorithm)?
"
"['qiskit', 'programming', 'ibm-q-experience', 'error-correction', 'error-mitigation']"," Title: How to do error mitigation on the ibmq_16_melbourne?Body: I'm trying to make a calibration matrix using CompleteMeasFitter as in here on IBMQ Melbourne, but I need to use all 15 qubits, which mean it has to run 32768 calibration circuit, far exceeding the 75 limit of the deivce (It returns The number of experiments in the Qobj (32768) is higher than the number of experiments supported by the device (75) [1102].)
Is there any way for me to retrieve the mitigation matrix in this case? Maybe something IBM generates every time they calibrate the machine? Thank you!
"
"['qiskit', 'quantum-fourier-transform']"," Title: QFT on timeseries Data and compare results with classical FFTBody: Intention - To learn and apply QFT on time-series data and compare the result with classical FFT.
Data Used - Small timeseries data of 16 points -
array([
669., 589.95, 659.9, 998.85, 690.8, 390.75, 633.7, 457.65, 581.6,
662.55, 1105.5, 1237.45, 537.4, 464.35, 685.3, 499.25
])
Detrended the linear component and used the residual data for my experiment.
Encoded the values as amplitudes of the 16 basis states -
def get_quantum_amplitude(signal):
sum_squared_signal = sum(signal**2)
divider = np.sqrt(sum_squared_signal)
amplitude_values = signal/divider
no_of_qubit = np.log2(signal.size),
return int(no_of_qubit[0]), amplitude_values, divider
no_of_qubit, amplitude_values, divider = get_quantum_amplitude(x_notrend)
amplitude_values,no_of_qubit, divider
qc = QuantumCircuit(no_of_qubit)
qft_circuit = QFT(no_of_qubit)
print(qft_circuit.qregs)
qc.initialize( amplitude_values, [i for i in reversed(qc.qubits)])
qc = qc.compose(qft_circuit, [0,1,2,3])
qc.draw()
Now if I consider - the resultant state-vectors multiplied by the divider (mentioned above used for converting to normalized amplitudes) of the above circuit as the quantum Fourier transform values and compare it with the classical FFT output values(fft_vals = fft.fft(sample)) of the same signal, I see there is a mismatch.
But, if I multiply the Quantum FFT output value with the number of qubits (4 in this case) it is matching with the classical FFT values.
Can anybody explain this behaviour?
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: Joint system of RAB after purification of A into RBody: Given a pure state $|\psi\rangle_{AB}$ on a joint system $AB$, we can consider the reduced density operator $\sigma_A = Tr_B(|\psi \rangle \langle \psi|)$ on $A$ and subsequently purify this state into $|\phi\rangle_{RA}$ using a new register $R$ (ie $\sigma_A = Tr_R(|\phi \rangle \langle \phi|)$. My question is: what is the joint system on $RAB$? Is it the product state $|\phi \rangle \langle \phi|_{RA} \otimes \sigma_{B}$ where $\sigma_B = Tr_A(|\psi \rangle \langle \psi|)$.
"
['error-correction']," Title: Qubit relaxation time dependenciesBody: The qubit relaxation time $T_1$ is an important parameter in order to describe the coherence time that a qubit presents, that is, the time in which its coherence quantum state is not compromised by decoherence. Such parameter is important in order to see the needed actuation of a quantum error correction code so that the information can be corrected properly.
Literature often presents this parameter for different qubit technologies as average, max and min times. However, I am wondering if this parameter is dependent to some other parameters such as temperature fluctuations, magnetic fields etc. If so it would be interesting to provide references to research about such effects.
"
"['quantum-state', 'entanglement']"," Title: Visualizing ""interference"" in Quantum ProgramsBody: I'd like to develop an intuition about interference in QC programs and was hopeful that some visualization vehicle (like the bloch sphere) would be available to assist in developing an intuition of that (in phase kickback for example). I've searched but didn't find anything suitable.
Is there any vehicles or frameworks, (or math techniques) that could be helpful?
"
"['algorithm', 'programming', 'physical-realization']"," Title: How to implement a while loop in a quantum computer?Body: How can a while loop be implemented in a quantum computer?
If quantum computing consists of :
- preparing a state
- applying a unitary operator
- measuring,
then it seems like it's not possible to wait for an indefinite amount of time before measuring.
How can one know that the while loop ended and that it's time to mesure ?
"
"['density-matrix', 'decoherence', 'experiment']"," Title: What experiments can distinguish between mixed and pure states?Body: To distinguish between a coherent and de-cohered stage of the same system
what experiments can provide the answer? The term Experiment is used here in the Bohr-Einstein-debate sense, a realizable physically sensible procedure, not necessarily practical in current labs.
Assumptions: Suppose the system initially is in a true superposition state |ψ⟩ = 1/√2(|0⟩+|1⟩), thus its density matrix initially has coherences (off diagonal) terms.
Also assume that If we decide to switch-on an external auxiliary apparatus, and bring it into interaction with our system then, due to the interaction with that auxiliary apparatus its density matrix becomes
\begin{bmatrix}0.5 & 0 \\ 0 & 0.5\end{bmatrix} We'll call that new stage 'the system has decohered'.
The question is - what experimental test can determine whether the system has decohered or not.
(*As the model-system any convenient physical 2- state model can be used i.e. spins, energy levels etc.)
"
"['quantum-state', 'photonics', 'qutrit', 'quantum-optics', 'orbital-angular-momentum']"," Title: How do we restrict to a limited number of dimensions, say 3 for qutrits, while using OAM states of light?Body: When a azimuthal phase $\mathrm{e}^{il\phi}$ is applied to gaussian beams having plane wavefront, they develop a corkscrew sort of structure and therefore possess an orbital angular momentum in addition to the spin angular momentum. Due to the continuity of the function, it should have the same value after a $2\pi$ rotation hence $l$ can only take integer values. One can create these states by passing Gaussian beams into spiral wave plates.
I want to know if we want to perform say a QKD protocol using let's say qutrits how do we restrict ourselves to just 3 dimensions?
"
"['qiskit', 'ibm-q-experience']"," Title: Why are IBM QE backend results different from the qasm simulator for a simple quantum circuit?Body: I have looked at other questions that ask pretty much the same thing such as this and from what I gathered the significant difference in simulation and actual results is due to decoherence and compounding quantum noise effects especially due to the depth/complexity of the quantum circuit, however in my case the circuit is relatively simple and has only 3 Qubits.
The circuit that I am running is exactly the same as the Coding with Qiskit Episode 6 Tutorial, however I decreased the length of the secret number string from 6 to 3 to decrease circuit complexity as I had even worse results with length 6. My understanding is that the qasm_simulator produces the expected theoretical results of an ideal quantum computer, however when I ran the 6 length string on the IBM QE backend ibmq_16_melbourne I didn't even get a single count for the ONLY theoretically expected result, for example if the secret number is num='101010' then the qasm_simulator correctly returned num with a single shot whereas the IBM QE backend returned everything but num even with a few dozen shots. When I lowered the string length to 3, I at least got num returned in the results but it wasn't significant and had a probability similar to the rest of the counts.
I would imagine that the issue is not with the quantum computer due to the simplicity of the quantum circuit, meaning that I must be doing something wrong.
"
"['density-matrix', 'semidefinite-programming', 'matlab']"," Title: Semi-definite program for smooth min-entropyBody: The conditional min-entropy is defined as (wiki):
$$
H_{\min}(A|B)_{\rho} \equiv -\inf_{\sigma_B}\inf_{\lambda}\{\lambda \in \mathbb{R}:\rho_{AB} \leq 2^{\lambda} \mathbb{I} \otimes \sigma_B\}
$$
And the smooth min-entropy is defined as:
$$
H_{\min}^{\epsilon}(A|B)_{\rho} \equiv \sup_{\rho'} H_{\min}(A|B)_{\rho'}
$$
Which just means that $\rho'_{AB}$ is some $\epsilon$-bounded distance away from $\rho_{AB}$. I know how to write a semi-definite program of the conditional min-entropy, which is:
$$
\text{min } \text{tr}(X) \\
\text{such that:} \\
\mathbb{I} \otimes X \ge \rho_{AB}\\
X \in \text{Herm}(\mathcal{H_B})
$$
I can implement this program in cvx(matlab). But the trouble is, in order to calculate the smooth min-entropy, I have to take a maximization over all $\rho'_{AB}$ who are $\epsilon$-distance away from $\rho_{AB}$. This means I need to write a double objective function in the semidefinite program. Something like:
$$
\text{max } \rho'_{AB} \\
\text{min } \text{tr}(X) \\
\text{such that:} \\
\mathbb{I} \otimes X \ge \rho'_{AB}\\
X \in \text{Herm}(\mathcal{H_B}) \\
\rho'_{AB} \in \mathcal{B}^\epsilon(\rho_{AB})
$$
What is the correct form of this double objective function? Is there any hope of writing it in cvx (matlab)?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: What is the difference between Qiskit execute and the IBMQJobManager?Body: I was researching how to submit multiple pulse schedules/circuits in the same job and came across 2 methods:
- Executing Experiments with
qiskit.execute
- and
IBMQJobManager.run
What are the advantages and disadvantages of using either over the other?
"
"['quantum-gate', 'physical-realization', 'physical-qubit', 'classical-computing']"," Title: What are some general concepts of how a classical computer would interface with a quantum computer?Body: Very general question so I'm not looking for an exact answer.
I just want a basic description of certain ways it can be done and then if possible the names of those ways, so that I can look them up further.
But I want to know, if I was to run some code in a quantum computing language, how would a classical computer interface with the quantum one to instruct it?
Contact the machinery that directly builds a full circuit and then run it?
Does it go line by line and apply the gate at each stage?
Can it just directly communicate with the qubits?
Note: I am looking for answers for both gate based and continous computing
"
"['fidelity', 'trace-distance']"," Title: Can the fidelity $F(\rho,\sigma)$ be computed knowing only $\rho - \sigma$?Body: The motivation for this question comes from trace distance. For any two states $\rho, \sigma$, the trace distance $T(\rho, \sigma)$ is given by
$$T(\rho, \sigma) = |\rho - \sigma|_1,$$
where $|\cdot|_1$ is the 1-norm and given by $|X|_1 = \text{Tr}(\sqrt{X^\dagger X})$. The point here is that I do not need to know $\rho$ or $\sigma$ to compute the trace distance between them. All I need to know is $\rho - \sigma$.
Can one also compute $F(\rho,\sigma)$ where $F$ is the fidelity if one is only given $\rho - \sigma$? I am aware of bounds that can be placed using the trace distance on $F(\rho,\sigma)$ but was wondering if it could be exactly computed.
"
"['resource-request', 'cryptography']"," Title: Tips on quantum cryptography?Body: Can you please recommend some good papers on quantum cryptography? I really need to learn more about this topic (any tips will be very helpful).
Thanks!
"
"['qiskit', 'resource-request', 'grovers-algorithm', 'bernstein-vazirani-algorithm']"," Title: Does anyone know of Qiskit source code for a Bernstein Vazirani grover's algorithm for N bits? If so please shareBody: I'm just getting started in the space of quantum computing, I've built a 5 qubit program for Bernstein-Vazirani, but am trying to figure out how to go about building an N bit version of Bernstein-Vazirani, and/ or Grover's algorithm given only 5 qubits to work with. I'm currently working in the Bioinformatics field, and for my work I thought it would be a good idea to use Bernstein Vazirani or Grover's to guess/ brute force genomes. If not any suggestions with source code is much appreciated.
"
"['programming', 'q#']"," Title: Microsoft Q#: ""Namespace declarations can only occur at a global scope"" errorBody:
I am having challenges with Microsoft Q#. I wrote this short code and it says it can only occur at a global scope.
How do I fix this error? Any ideas? Thank you
"
['quantum-state']," Title: What's the purpose of phases in quantum mechanics?Body: I know this it's perhaps, a little "stupid" question, but... What's the purpose of phase in Quantum?
Per example, in quantum Computing, the phase don't seems to be very important in the amplitudes and probability of the outcomes, before a qubit be measured. But I know that phase it's important for something, I just don't know exactly for what (quantum entanglement, perhaps?)
"
"['quantum-gate', 'quantum-state', 'qiskit', 'programming']"," Title: Expectation value of an operator error: Composition is not defined over operators of different dimensions,Body: I am trying to calculate the expectation value of a customized operator on two similar but differently constructed states $\phi = \phi_2 =\frac{1}{\sqrt{2}}\left( |001⟩ + |011⟩\right)$ which consist of more qubits than the operator. (via Qiskit)
import numpy as np
from qiskit import QuantumCircuit
from qiskit.aqua.operators import CircuitOp, state_fns, Zero, One
circuit = QuantumCircuit(2)
circuit.z(0)
circuit.z(1)
op = CircuitOp(circuit)
psi = QuantumCircuit(3)
psi.h(1)
psi.x(2)
psi = state_fns.CircuitStateFn(circuit)
psi2 = 1 / np.sqrt(2) * ((Zero ^ Zero ^ One) + (Zero ^ One ^ One))
print('Expectation for phi:', psi.adjoint().compose(op).compose(psi).eval().real) # Expectation for phi: 1.0
print('Expectation for phi2:', psi2.adjoint().compose(op).compose(psi2).eval().real) # Error
The second expectation raises an error:
ValueError: Composition is not defined over Operators of different dimensions, 3 and 2, respectively.
Why is this happening? Why the first expectation is executed fine but not the second one?
"
['quantum-operation']," Title: Coherent Information and Entanglement Breaking channelsBody: The book by John Watrous, "The Theory of Quantum Information" is an exciting read for anyone wanting to research quantum information theory. The following question presumes some background covered in the book, which I will do my best to explain.
Question:
If $\mathcal{X}_0, \mathcal{X}_1, \mathcal{Y}_0, \mathcal{Y}_1$ are complex Euclidean spaces (Finite dimensional Hilbert spaces on complex field) and $\Phi_0 \in C(\mathcal{X}_0,\mathcal{Y}_0)$ $\Phi_1 \in C(\mathcal{X}_1,\mathcal{Y}_1)$ are two quantum channels, with $\Phi_0$ being entanglement breaking, then show that
\begin{equation}
I_C(\Phi_0\otimes\Phi_1) = I_C(\Phi_1).
\end{equation}
Background:
Here, the space of channels $C(\mathcal{X}_0, \mathcal{Y}_0)$ consists of linear, completely positive trace-preserving (CPTP) maps on $L(\mathcal{X}_0)$ (linear operators on $\mathcal{X}_0$) returning operators in $L(\mathcal{Y}_0)$. For any channel $\Phi$ and state $S$ (states are non-negative operators with unit trace), the coherent information $I_C(\Phi;S) = H(\Phi(S)) - H((\Phi\otimes I)(vec(\sqrt{S})vec(\sqrt{S})^\dagger))$ and $I_C(\Phi) = \max_S I_C(\Phi;S)$, where the maximum is taken with respect to all states. For any operator $A = \sum_{i,j}a_{ij}|e_i\rangle\langle f_j|$, $vec(A) = \sum_{i,j}a_{ij}|e_i\rangle \otimes |f_j\rangle$.
A separable state is a state of the form $\sum_i p_i P_i\otimes Q_i$, where $P_i$ and $Q_i$ are states with $\sum_i p_i = 1$ with $p_i\ge 0$. States that do not have this kind of representation are called entangled. An entanglement breaking channel is one whose output state is always separable even if the input is entangled.
There is a theorem that may prove useful: The following are equivalent.
- $\Phi$ is entanglement breaking (EB).
- For any finite-dimensional Hilbert space $\mathcal{Z}$, $\Phi\otimes I_\mathcal{Z}$ is separable where $I_\mathcal{Z}$ is the identity map in $\mathcal{Z}$.
- There exist states $\rho_i$ and non-negative operators $M_i$ such that $\sum_{i}M_i = I$ (called a POVM) such that $\Phi(S) = \sum_i \rho_i Tr(SM_i)$.
I was able to show $I_C(\Phi_0 \otimes\Phi_1) \ge I_C(\Phi_0) + I_C(\Phi_1)$ for any two channels $\Phi_0$ and $\Phi_1$. The book does prove that $I_C(\Phi) \le 0$ for $\Phi$ EB. But I've been unable to make any progress beyond that.
I will be happy to offer any clarification if required. This problem has been bugging me for quite some time now and I cannot see a way through. This problem would interest students and professors working in Quantum Information Theory.
Cross-posted on math.SE
"
['programming']," Title: Can you transform a quantum program into an arrangement of slits?Body: Is it possible (in theory) to convert any problem that can be solved on a quantum computer into an arrangement of slits carved into a piece of metal foil, and then to run the program by shining light on the foil and observing the pattern of light that it produces?
It seems to me that this should be possible, just as any program on a conventional computer can be transformed into a boolean circuit (in theory).
"
"['quantum-gate', 'deutsch-jozsa-algorithm', 'photonics']"," Title: How can a half-wave plate affect the position qubit and not the polarization qubit of a photon?Body: I recently was watching these 2 videos on Coursera which show how to build a simple quantum computer that can implement the simplest case of the Deutsch-Jozsa algorithm (which uses only 2 qubits).
https://www.coursera.org/lecture/quantum-computing-algorithms/quantum-computer-prototype-diy-dCKRO
https://www.coursera.org/lecture/quantum-computing-algorithms/quantum-computer-prototype-solving-the-deutschs-problem-7EuD2
In it, the professor mentioned that the photon represented 2 qubits: one was the polarization qubit and one was the path/position qubit. Later, the professor stated that a half-wave plate affected the path/position qubit (not the polarization qubit). I found this really strange as I thought half waveplates only affected polarization.
How can a half-wave plate affect the position qubit and not the polarization qubit?
"
"['algorithm', 'hhl-algorithm']"," Title: Confusion regarding time complexity in the HHL algorithmBody: In the paper of HHL algorithm (Quantum algorithm for linear systems of equations), the time complexity of simulating $e^{i A t}$ for a hermitian matrix A is $\tilde{O}\left(\log (N) s^{2} t_0\right)$. Let $T$ be the time required for the phase estimation subroutine. Then, the total-time of simulation should be $T \cdot \tilde{O}\left(\log (N) s^{2} t_0\right)$.
Why, then, is the time complexity $\tilde{O}\left(\log (N) s^{2} \kappa^{2} / \epsilon\right)$?
In the subsection of error and run-time, they said that the run-time is $\tilde{O}\left(\kappa \left(T_B + t_0 s^2 \log (N) \right) \right)$; why is it not $T \cdot \log (N) s^{2} t_0$ in the run-time, just $\log (N) s^{2} t_0$? Does that mean they just simulate $e^{i A t}$ one time?
Why does this paper needs T times simulation?
"
"['quantum-gate', 'textbook-and-exercises', 'unitarity', 'povm']"," Title: How do you embed a POVM matrix in a Unitary?Body: In QuantumKatas Measurement Task 2.3 - Peres-Wooter's Game, we are given 3 states A,B and C.
We construct a POVM of these states. But how do we convert that POVM into a Unitary that we can apply.
Basically what I am asking is How do we get from
$M = \frac{1}{\sqrt{2}}\left(\begin{array}{rrr}1 & 1 & 1 \\\ 1 & \omega & \omega^2 \end{array}\right)$
to
$M' = \frac{1}{\sqrt{3}}\left(\begin{array}{cccc}1 & -1 & 1 & 0 \\\ 1 & -\omega^2 & \omega & 0 \\\ 1 & -\omega & \omega^2 & 0 \\\ 0 & 0 & 0 & -i\sqrt3\end{array}\right)$
"
"['quantum-gate', 'algorithm', 'grovers-algorithm']"," Title: Grover's Algorithm on a Database with more than 50% matching entriesBody: The Setup for Grover's Algorithm is the following:
Given an oracle $f_O^{\pm}$ representing a Query on a Database with total $N$ entries $N$ of which $k$ are matching. Grover's Algorithm is used to find with high probability a matching entry $x^*$.
In most papers researching Grover's Algorithm, the underlying assumption is that $k\lt\lt N$. Under the above assumption the optimal number of iterations is estimated to be $\frac{\pi}{4}\sqrt{\frac{N}{k}}$.
My questions is the following - What happens when Grover's Algorithm is applied to a database where this assumption is seriously violated? What's the optimal number of iterations in these cases? What happens in cases where $\frac{k}{N} \ge 0.5$?
"
"['quantum-gate', 'circuit-construction']"," Title: Interconnection clarification?Body: I just want to clear what seems to be a bit confusing to me with quantum gates and their corresponding output. below are 3 scenarios implementing two hadamard gates
- two hadamard gates on one qubit
- Hadamard gates on two qubits
- Interconnected Hadamard gates on two qubits
with the first scenario, I am sure the case is
$$ H \cdot H = H^2 = \begin{pmatrix}
\frac{\sqrt{2}}{2}&\frac{\sqrt{2}}{2} \\
\frac{\sqrt{2}}{2}&\frac{-\sqrt{2}}{2} \\
\end{pmatrix}. \begin{pmatrix}
\frac{\sqrt{2}}{2}&\frac{\sqrt{2}}{2} \\
\frac{\sqrt{2}}{2}&\frac{-\sqrt{2}}{2} \\
\end{pmatrix} = \begin{pmatrix}
1&0 \\
0&1 \\
\end{pmatrix} = I $$
with the second scenario, I am sure the case is
$$H \otimes H = H_2 = \begin{pmatrix}
\frac{\sqrt{2}}{2}&\frac{\sqrt{2}}{2} \\
\frac{\sqrt{2}}{2}&\frac{-\sqrt{2}}{2} \\
\end{pmatrix} \otimes \begin{pmatrix}
\frac{\sqrt{2}}{2}&\frac{\sqrt{2}}{2} \\
\frac{\sqrt{2}}{2}&\frac{-\sqrt{2}}{2} \\
\end{pmatrix} = \begin{pmatrix}
\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}&\frac{-1}{2}&\frac{-1}{2}&\frac{1}{2} \\
\end{pmatrix}$$
What seems to be the case with scenario 3 or what does the interconnection do to the qubits?
P.S I haven't noticed Hadamard gates in a circuit as in scenario 3 but have seen Pauli-X and Pauli-Z gates used in this manner, for example the magic-state-distillation on Quirk
"
"['error-correction', 'graph-states']"," Title: Quantum Error Correcting Codes and GraphsBody: Couple of weeks ago I asked this question on theory CS but I didn't get an answer. So trying it here.
I was reading combinatorial approach towards quantum correction. A lot of work in this is on finding diagonal distance of a graph. Let me add definition of diagonal distance so that this remains self-contained.
Given a labeling $L$ (a map where each vertex is is assigned 1 or 0) we define two operations on this:
- $X(v,L)$: you flip labeling of vertex v that is if it was zero make it 1 if it was 1 make it 0.
- $Z(v,L)$: you flip labeling of every neighbor of vertex v
Then diagonal distance is defined as length of minimal non-trivial sequence of operation so that $L$ is taken back to itself.
How is this exactly related to the quantum error correction property?
"
"['algorithm', 'entanglement']"," Title: Are the skills learned for a degree in Computer Engineering helpful in learning Quantum Computing?Body: Next year, I will be a senior Computer Engineering student. Saying that, I have studied computer organization, electrical circuits, electronics and data structures.
Our university provides an opportunity to get a concentration on quantum computing.
So, my question is:
Are the subjects I mentioned helpful in learning about quantum computing?
Are there other prerequisites that may also be helpful?
"
"['quantum-gate', 'algorithm', 'machine-learning', 'neural-network']"," Title: Quantum Circuit To Compute Any Inner ProductBody: I'm currently reading the paper Classification with Quantum Neural Networks on Near Term Processors
It shows a method to determine the following quantity:
Where U is a unitary operator acting on $|z,1\rangle$. The paper states the following:
I am wondering if there is a way to calculate any general inner product like $\langle z_2, 1|U|z, 1\rangle$ or just $\langle a | b \rangle $ in general? How could I modify the circuit to do so? (or is there a different methodology to calculate the inner product with different vectors?)
"
"['quantum-state', 'measurement', 'tomography']"," Title: How to measure the sign of quantum amplitudesBody: I have a quantum state on $ n $ qubits ($ 2^n $ amplitudes) for which I know the amplitudes are real numbers. I want to take the state out as a vector. I can estimate the magnitude of the amplitudes by doing some measurements and taking the square root of the probabilities, but I loose the sign information.
What kind of measurements do I need to make to recover the sign information? I read a little about state tomography, but it looks really unpractical for $n>2$ (my scale is $n > 10$). Is there an easier way?
"
"['mathematics', 'matrix-representation', 'textbook-and-exercises']"," Title: Step-by-step passages in calculationBody: I would like to better understand some passages in a paper (Appendix A):
Properties of Tensor Product
- Bilinearity: $A\otimes(B+ C) = A \otimes B + A \otimes C $
- Mixed-product property: $(A\otimes B)(C \otimes D) = AC \otimes BD$
- $ (|a\rangle \otimes|b\rangle) (\langle c| \otimes \langle d|) = |a\rangle \langle c| \otimes |b\rangle \langle d| $
For a unitary $U_p |0\rangle |0\rangle \mapsto \sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle|j\rangle $, we have a matrix $A$ defined as such:
$$A = \Pi U\widetilde{\Pi}=\Pi\left(U_p\otimes I\right)\widetilde{\Pi}=\Big(\sum_{i=1}^{n}I\otimes|i\rangle\langle i|\otimes |i\rangle\langle i| \Big)(U_{p}\otimes I)\big(|0\rangle\langle 0|\otimes |0 \rangle\langle 0|\otimes I\big) $$
We used the mixed-product property
$$=\sum_{i=1}^{n}\Big((I\otimes |i \rangle \langle i|)U_{p}(|0 \rangle \langle 0|\otimes |0 \rangle \langle 0|)\Big)\otimes |i \rangle \langle i| $$
Here we applied the definition of $U_p$.
$$=\sum_{i=1}^{n}\Big((I\otimes |i \rangle \langle i|)\sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle|j\rangle\langle 0| \langle 0|\Big)\otimes |i \rangle \langle i| $$
My steps are:
$$=\sum_{i=1}^{n}\Big((I\otimes |i \rangle \langle i|)\sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle \langle 0| \otimes |j\rangle\langle 0|\Big)\otimes |i \rangle \langle i| $$
Because of the third property (name?)
$$=\sum_{i=1}^{n}\left((I\otimes |i \rangle \langle i|) \left( \sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle \langle 0| \otimes |j\rangle\langle 0|\right)\right)\otimes |i \rangle \langle i| $$
Because of associativity property of matrix product
$$=\sum_{i=1}^{n}\left((I\otimes |i \rangle \langle i|) \left( \sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle \langle 0| \otimes |j\rangle\langle 0|\right)\right)\otimes |i \rangle \langle i| $$
$$=\sum_{i=1}^{n}\left((\sum_{j=1}^{n}\sqrt{p_{j}}|\phi_{j}\rangle \langle 0| \otimes |i \rangle \langle i| |j\rangle\langle 0|)\right)\otimes |i \rangle \langle i| $$
As $\langle i | j \rangle = \delta_{ij}$, the final result is:
$$=\sum_{i=1}^{n}\sqrt{p_i}|\phi_i \rangle \langle 0|\otimes |i \rangle \langle 0|\otimes |i \rangle \langle i|.$$
Can you check that my answer is indeed correct and I have made explicit all the properties of the operations that are used in these passages? I think passages are correct, and there are no other properties that I have used.
Thanks!
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'entanglement']"," Title: How to prepare a quantum circuit for $\frac{1}{\sqrt{3}}(|00\rangle+|01\rangle+|10\rangle)$ starting from $|00\rangle$Body: How do I prepare a quantum circuit for $\frac{1}{\sqrt{3}}(|00\rangle+|01\rangle+|10\rangle)$ state starting from the $|00\rangle$ state?
I have no clue how to do it. I tried with controlled Hadamard gate but of no use here. Can someone help?
Furthermore, can it be constructed with only one CNOT and any number of single-qubit gates?
"
"['cryptography', 'bb84']"," Title: Is there a notion of “computational security” in quantum cryptography?Body: In classical cryptography, security proofs are often based on the (assumed) computational hardness of some mathematical problem. Using the principles of quantum mechanics might provide means to design cryptographic protocols for which it is impossible to realise them classically (information-theoretically) securely. But is there also a notion of computational security in quantum cryptography (assuming a polynomial-time quantum adversary) where fully quantum information is being processed to begin with? Why does or doesn't this notion of security make sense?
"
"['cryptography', 'shors-algorithm', 'entropy']"," Title: Energy cost of quantum computationBody: A quantum computer can be modeled as a single unitary transition of a (large) effective quantum state to another. In order to get errors under control, quantum error correction is assumed. A logical qbit lives in a "logical heat bath" which must have an effective entropy and temperature far below that of the ambient world in order for the error rate of the computation to be below unity.
Thus it should be possible to compute the energy cost of any quantum computation as the entropy difference between the required effective "logical heat bath" and the ambient environment. As entropy scales as $$dS = \frac{dQ}{T_A} - \frac{dQ}{T_B},$$ this would imply that an arbitrarily long/large calculation requires zero temperature and an infinite amount of energy, in apparent contradiction with the quantum threshold theorem. Such an energy cost would apply to classical calculations as well.
Is there an error in my reasoning? If not, has anyone published actual calculations of the required energy to perform a computation of a given size or have a formula for the entropy of the needed heat bath that satisfies the threshold theorem? This would seem to imply that cryptographically relevant computations like Shor's algorithm will never be practical on energy grounds. The required precision on the logical state is exponential in the number of bits, and the corresponding requirement on the heat bath should be also.
"
['quantum-state']," Title: Correct interpretation of a Quantum StateBody: If a quantum system is described to be only in Quantum states $s_1$ and $s_2$ (described by computational basis $\vert {0} \rangle$ and $\vert {1}\rangle$) or a combination of both (for a qubit system for example), should not all the operators, which we interpret as representations of measurable properties of the system, be only diagonal matrices? What happens if we have an operator whose basis is not the computational basis?
If we measure a property of the quantum system (operator O) and measure an eigenvalue for an eigenvector which is not associated to $s_1$ nor $s_2$, but an eigenvector which is a linear combination of both, does this mean the quantum state collapsed to such eigenstate? Would not that be contradictory to the fact that the only observed states from the Quantum System are $s_1$ and $s_2$?
"
"['quantum-gate', 'qiskit', 'programming', 'ibm-q-experience', 'measurement']"," Title: Question About How Qiskit Reset Gate Affects Other Entangled QubitsBody: I am trying to understand how the reset gate in Qiskit affects qubits its entangled with. Consider the following circuit with qubits $q_0$ and $q_1$:
Where circuit240 takes $|0\rangle$ to $a|0\rangle + b|1\rangle$ and circuit 244 takes $|0\rangle$ to $c|0\rangle + d|1\rangle$. Right before the reset gate on qubit $q_1$ the state of this circuit is $$\frac{1}{\sqrt{2}}(c|1\rangle + d|0\rangle)|0\rangle + \frac{1}{\sqrt{2}}(a|1\rangle + b|0\rangle)|1\rangle \tag{1}$$
I'm not quite sure how to mathematically represent what this quantum reset gate does to the quantum entangled state. For example, I tried a few tests with this circuit where I played with the values $a$ and $c$ and tested how the quantum reset gate affects the measurement of the qubit $q_0$. It seems that whether or not the quantum reset gate is added, it doesn't affect the measurements of the other entangled qubit. Does this generally hold?
Furthermore, when I take the qubit expression above and just reset qubit $q_1$to $|0\rangle$ I get the following:
$$\frac{1}{\sqrt{2}}(c|1\rangle + d|0\rangle)|0\rangle + \frac{1}{\sqrt{2}}(a|1\rangle + b|0\rangle)|0\rangle \tag{2}$$
$$= \frac{1}{\sqrt{2}}((a + c)|1\rangle + (b + d)|0\rangle)|0\rangle \tag{3}$$
But, mathematically, the probability of measuring $q_0$ as $|0\rangle$ in $(3)$ is not the same as the probability in qubit expression $(1)$(even though the tests show that removing the reset gate did not change the probability of measuring a $|0\rangle$ in the qubit $q_0$. What is the correct way to represent what the qubit reset gate does to an entangled qubit?
"
"['quantum-state', 'programming', 'q#']"," Title: How can I represent mixed states in Q#?Body: I have a mixed state with a density matrices corresponding to $\rho=\sum_0^{2^n-1}p_i|i\rangle\langle i|$. How would i represent this in Q#? How would I go about applying Unitary Operations $U$ on this mixed state in Q#?
"
"['qiskit', 'programming', 'ibm-q-experience', 'ibm']"," Title: What extra functionality is available to an IBM Q Network member over a regular IBM Q Experience userBody: I've been trying to figure out the extra functionality available to IBM Q Network members that are not available to normal IBM Q Experience users.
I couldn't find anything that says that Network members have access to better quantum processors or perhaps access to functionality within the Qiskit library that isn't available to Experience users.
Could someone please list all the benefits of having Network membership?
"
"['measurement', 'textbook-and-exercises', 'bell-basis']"," Title: What is the representative matrix for a measurement in the Bell-state basis?Body: I have a few questions about measurement in Bell-state basis. In particular, if $Z = \begin{bmatrix}
1 & 0\\
0 & -1
\end{bmatrix}$
is for a measurement on the computational basis, then what is the representative matrix for a measurement in Bell-state basis.
I know that such a matrix can be constructed using spectral decomposition, but my Professor says the eigenvalues corresponding to 4 Bell-states remain unknown, so basically there is currently no physical quantity that helps on this kind of measurement.
However, Nielsen and Chuang (p.27) give a circuit for teleportation (basically Bell-basis measurement)
I wondered if $U^\dagger (Z\otimes Z)U$, where $U = (H\otimes I)CNOT$, is the needed matrix. It turns out that its eigenvectors are not Bell states. Can someone explain where I'm wrong here?
"
"['error-correction', 'nielsen-and-chuang']"," Title: Question regarding part of the proof for the typical subspace theoremBody: Part three (going by N&C page 544) states that
$$tr(S(n)\rho^{\otimes n})=tr(S(n)\rho^{\otimes n}P(n,\epsilon))+tr(S(n)\rho^{\otimes n}(I-P(n,\epsilon))).$$
Now I understand how the term on the left of + goes to 0 as n $\to \infty$. However, I am confused how the term on the right does. N&I states that you can set
$$0 \le tr(S(n)\rho^{\otimes n}(I-P(n,\epsilon))) \le tr(\rho^{\otimes n}(I-P(n,\epsilon))) \rightarrow 0\,\,\text{ as } n\to \infty.$$
I don't quite understand why this is the case. My only assumption is that the eigenvalues of $\rho^{\otimes n}(I-P(n,\epsilon))$ are bounded in such a way that as $n \to \infty$ it will go to zero. However, I am unsure how to go about calculating this bound, though I assume it is of a similar form to the eigenvalues of $\rho^{\otimes n}P(n,\epsilon)), 2^{-n(S(\rho)-\epsilon)}$
"
"['quantum-state', 'resource-request']"," Title: Are there any resources of lists of attempts at non-probabilistic models of quantum mechanics, with debunking?Body: For example, some introductory resource I was reading years ago (forget which one) brought up such an attempt: imagine if a qbit wasn't a complex state vector which collapses probabilistically on measurement, but rather functioned as a tiny "coin" as follows (forgive the crude drawing):
As far as I can recall, whenever the qbit goes through a quantum gate the coin is rotated some amount, then when "measuring" the qbit you basically just look from the perspective of the basis you're measuring (say the |0>/|1> basis) and the result you see is whichever side of the coin is facing that basis (in the diagram, heads). Honestly I think I got half the details wrong on this, but it was something like that.
This was entertaining to learn about, so does anyone know of a good collection of such half-baked (or full-baked) attempts at de-probability-izing quantum mechanics? Bonus if it actually includes this coin example.
"
"['algorithm', 'grovers-algorithm', 'textbook-and-exercises']"," Title: Calcuate $\langle x | D | y \rangle$ for arbitrary $x,y \in \{0,1\}^n$Body: We are considering Grover's algorithm with a search space of size $2^n$ for an arbitrary integer $n$ for arbitrary $n$, and a unique marked element $x_0$.
Question: Calculate $\langle x | D | y \rangle$ for arbitrary $x,y \in \{0,1\}^n$
Answer: Using the expression $D = -(I-2|+^n\rangle\langle+^n|)$, we have
$$\langle x | D | y \rangle =
\begin{cases}
\frac{2}{N}-1 &\quad\text{if x=y}\\
\frac{2}{N} &\quad\text{if x $\neq$ y}
\end{cases}
$$
How has the equality $D = -(I-2|+\rangle\langle+|)$ been derived? Its from these notes https://people.maths.bris.ac.uk/~csxam/teaching/qc2020/lecturenotes.pdf
How do derive the split function? I cannot see the route to start to evaluate this.
"
"['quantum-gate', 'programming', 'cirq']"," Title: Visualizing custom gates in CirqBody: I'm trying to visualize a custom gate in Cirq. I have through this page, which briefly mentions how to create custom gates in Cirq. However, I'm getting errors when trying to visualize it.
My current code defines a class CustomGate, which inherits from cirq.Gate class.
import numpy as np
import cirq
class CustomGate(cirq.Gate):
def __init__(self, unitary):
self.unitary = unitary
self.numQubits = int(np.log2(unitary.shape[0]))
def _num_qubits_(self):
return self.numQubits
def _unitary_(self):
return self.unitary
def _circuit_diagram_info_(self, args='cirq.CircuitDiagramInfoArgs') -> 'cirq.CircuitDiagramInfo':
return cirq.CircuitDiagramInfo(wire_symbols=("CG",), exponent=1.0, connected=True)
The usage is as follows:
# Define custom gate
customUnitary = np.eye(4) # The custom unitary matrix would go here
CG = CustomGate(customUnitary)
# Setup circuit
q = cirq.LineQubit.range(2)
circuit=cirq.Circuit()
circuit.append(CG(q[0], q[1]))
# Visualize circuit
print(circuit)
I'm getting the following error:
Traceback (most recent call last):
File "test.py", line 42, in <module>
print(circuit)
File "/Users/pgu/opt/anaconda3/lib/python3.7/site-packages/cirq/circuits/circuit.py", line 338, in __str__
return self.to_text_diagram()
File "/Users/pgu/opt/anaconda3/lib/python3.7/site-packages/cirq/circuits/circuit.py", line 1609, in to_text_diagram
transpose=transpose)
File "/Users/pgu/opt/anaconda3/lib/python3.7/site-packages/cirq/circuits/circuit.py", line 1668, in to_text_diagram_drawer
get_circuit_diagram_info, include_tags)
File "/Users/pgu/opt/anaconda3/lib/python3.7/site-packages/cirq/circuits/circuit.py", line 1924, in _draw_moment_in_diagram
info = get_circuit_diagram_info(op, args)
File "/Users/pgu/opt/anaconda3/lib/python3.7/site-packages/cirq/circuits/circuit.py", line 1818, in _get_operation_circuit_diagram_info_with_fallback
info))
ValueError: Wanted diagram info from <__main__.CustomGate object at 0x10379bb90>.on(cirq.LineQubit(0), cirq.LineQubit(1)) for 2 qubits but got cirq.CircuitDiagramInfo(wire_symbols=('CG',), exponent=1.0, connected=True, exponent_qubit_index=None, auto_exponent_parens=True)
"
"['quantum-gate', 'programming', 'circuit-construction', 'cirq']"," Title: Applying a gate to all line qubits without explicitly listing them in CirqBody: Say we have a custom gate CG, defined by a unitary matrix U, and line qubits qubits in Cirq. Something like this:
import numpy
import cirq
U = np.eye(8) # The custom unitary matrix goes here
CG = cirq.MatrixGate(U)
qubits = cirq.LineQubit.range(3)
We build the circuit as follows:
circuit = cirq.Circuit()
circuit.append(CG(qubits[0], qubits[1], qubits[2]))
Is it possible to build the circuit without explicitly specifying all the qubits? Something like circuit.append(CG(qubits)), which would apply the CG gate to all the qubits?
"
"['quantum-gate', 'quantum-state', 'qiskit', 'programming', 'simulation']"," Title: How the simulator work?Body: Recently I focused on how to simulate in classical computer, and I found Qiskit offers qasmsimulator and statevector simulator. And others such as project Q also can simulate on classical computer. So is there a general way to simulate on classical computer? And what are differences among simulators? I mean actually it seems like we just need to multiply gate operation as matrixes.
"
['qiskit']," Title: Feedback on Deutsch-Josza alg. homework prob. in Learning Quantum computation using QiskitBody: In Learning Quantum Computation using Qiskit chapter 3.4 I encountered the Deutsch-Josza Algorithm.
At the end of the chapter I was presented with a homework problem where the code:
from qiskit_textbook.problems import dj_problem_oracle
oracle = dj_problem_oracle(1)
gives me a gate called 'oracle' and I was supposed to do find out whether it was balanced or constant.
I encountered a problem when appending 'oracle' into my circuit, it kept telling me that 'The amount of qubit/clbit arguments does not match the gate expectation.'
After alot of headscratching and try and error I found out that the gate was stuck at a size of 5 (or n=4 if you've done the problem).
Because the entire chapter was taught from the view of n qbits, I tried to solve the problem by writing an algorithm for n qbits(so that I can choose how many qbits my circuit contains).
I think that some more detail should be added into the text of that chapter so that things like this don't confuse newcomers like me, or just make it an n sized gate. I'd be grateful if someone could pass this message on to the good men and women managing the site.
"
"['qiskit', 'programming', 'ibm-q-experience', 'quantum-fourier-transform', 'initialization']"," Title: Why after transpiling a Qiskit circuit we obtain a different result?Body: I am trying to obtain the correct circuit transpiled for the ibmq_london device, as I want to know what the real gates applied in the quantum computer are. I am implementing the QFT circuit for 5 qubits. My code is the following one (DAQC and qnoise are modules that I have created but they do not affect the transpilation, they are used to show the pictures or to create initial states):
import numpy as np
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister, IBMQ, execute
from qiskit.providers.aer import QasmSimulator
from qiskit.visualization import plot_histogram
from qiskit.compiler import transpile
import DAQC
provider = IBMQ.load_account()
# Get properties and coupling map of the desired device
device = provider.get_backend('ibmq_london')
properties = device.properties()
coupling_map = device.configuration().coupling_map
basis_gates=device.configuration().basis_gates
# Circuit
n=5
beta=0
state=DAQC.initial_state_QFT(n,beta)
qr=QuantumRegister(n)
cr=ClassicalRegister(n)
qc=QuantumCircuit(qr,cr)
qc.initialize(state,qr)
qft(qc,n)
qc.measure(qr,cr)
backend = QasmSimulator()
job = execute(qc, backend=backend,shots=100000)
result_ideal = job.result()
qiskit_counts=result_ideal.get_counts()
qnoise.show_figure(plot_histogram(qiskit_counts, title='Results for qiskit ideal simulator'))
# Transpiled circuit
qr2=QuantumRegister(n)
cr2=ClassicalRegister(n)
qc2=QuantumCircuit(qr2,cr2)
qc2.initialize(state,qr2)
qft(qc2,n)
qc2=transpile(qc2,basis_gates=basis_gates,coupling_map=coupling_map)
qc2.measure(0,0)
qc2.measure(1,1)
qc2.measure(2,2)
qc2.measure(3,3)
qc2.measure(4,4)
job = execute(qc2, backend=backend,shots=100000)
result_ideal = job.result()
qiskit_counts=result_ideal.get_counts()
qnoise.show_figure(plot_histogram(qiskit_counts, title='Results for qiskit ideal simulator (transpiled)'))
The problem is that when I obtain the results, although they should be the same because the circuit is just transpiled, I obtain completely different outcomes:
I think that the problem is with the initialize command, as when I remove it I obtain the same result for both cases. Is it possible to use the initialize command with the transpile one? Is there any other option to obtain the transpiled circuit when it is initialized in a concrete state?
Thank you
"
"['algorithm', 'qiskit', 'programming', 'circuit-construction', 'shors-algorithm']"," Title: How to implement Cx mod N unitaryBody: The following links provides circuts for $a\in\{2,7,8,11,13\}$ and $N=15$: https://qiskit.org/textbook/ch-algorithms/shor.html#3.-Qiskit-Implementation
https://arxiv.org/abs/1202.6614v3.
I am interested in implementing circuts for the case when $a=2$, $N=21$ and $a=3$, $N=14$ or a generic way to generate them.
I've tried to generate the unitary matrix by classical computation classically, but I don't know how to fill remaining space and when input state 0 is treat it as state 15 output.
"
"['nielsen-and-chuang', 'matrix-representation', 'textbook-and-exercises']"," Title: Nielsen and Chuang: Demonstration of equation 2.12Body: Reproduced from Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition) in page 64:
We've seen that matrices can be regarded as linear operators. [...] Suppose $A: V \rightarrow W$ is a linear operator between vector spaces $V$ and $W$. Suppose $|v_{1}\rangle,...,|v_{m}\rangle$ is a basis for $V$ and $|w_{1}\rangle,...,|w_{m}\rangle$ is a basis for $W$. Then for each j in the range 1,...,m, there exist complex numbers $A_{1j}$ through $A_{nj}$ such that
$$A|v_{j}\rangle = \sum_{i} A_{ij} |w_{i}\rangle \tag{2.12} $$
Looking for information about this equation, I was not able to find any demonstration. I saw in other websites and books that they use this equation, but not where it comes from.
I'm presenting this question because I made a mistake with equation (2.12) in this other question.
But I'm still not understanding why, once I've got members of the matrix of the operator, I can't use it directly with vector components. And I believe the problem comes from equation (2.12).
Thanks for all information or advice you can give to me.
"
"['error-correction', 'quantum-operation', 'textbook-and-exercises', 'kraus-representation']"," Title: Find the Kraus operators of a combined amplitude and phase damping channelBody: I am going through the paper Surface code with decoherence: An analysis of three superconducting architectures and I have a doubt about how the authors get what they refer to as the combined channel of amplitude and phase damping. In the section IIA, the authors discuss amplitude damping and dephasing channels with their Kraus operators in order to describe decoherence first, and afterwards they combine their effects. They state that the combined channel is represented by 3 Krauss operators depending on the amplitude damping and dephasing parameters.
I am wondering how such Kraus operators are obtained from the Kraus operators describing the individual channels, as the authors do not explain nor give any reference to such statement. My initial approach has been to consider a sequential combination of the channels, but my results are not successful (probably because the simultaneous action of the channels is not equivalent to their sequential actions on the quantum information).
"
"['algorithm', 'quantum-state', 'machine-learning']"," Title: Quantum-Assisted Neural Network Training (Is my design reasonable?)Body: I'm a college student with a slight interest in quantum mechanics. I think I have a decent understanding of the Copenhagen and Many Worlds interpretations of quantum mechanics, and was considering how this could be used to improve machine learning efficiency. I want to check my understanding of quantum mechanics/computing using a design I came up with for a neural network training algorithm.
The following is a graphical representation of my algorithm. To read the diagram, follow the colored circles. The arrows show the direction in which data flows, not sequential steps in the program. The sequential steps are represented by the colored circles. Note that all state in this system would be finite.
- The user pre-configures their training data into the system. This consists of network input and expected network output pairs.
- The user pre-configures the cost threshold, a guess for the lowest accumulated cost value.
- The algorithm starts the iteration over training data pairs. The network input is fed into the neural network, along with the weights which are represented in qbits. This produces a network output, which is also represented in qbits. (Each superposition of the network output should be entangled with a particular superposition of the weights.) A cost function then computes a cost (represented in qbits) based on the expected network output and the network output. An accumulator accumulates these costs over each iteration.
- Once the iteration is finished, we compare the accumulated cost with the cost threshold. If it is less than the cost threshold, we display the weights that are entangled with the accumulated cost to the outside world. There may be multiple branches that pass the threshold, but it doesn't matter which one we output. From the outside world's perspective, the machine should have collapsed to a single set of weights that produce an accumulated cost that is less than the cost threshold. If nothing is displayed, it means no branch passed the cost threshold, so the user should start from step 2 with a higher cost threshold.
- Repeat steps 2, 3, 4 until satisfied with the displayed weights and cost threshold.
My idea is that by setting up the system in this way, you could reduce the problem of finding weights to a linear guess and see process (gradually increment the cost threshold one unit at a time until the machine stops displaying an output, at that point you should have found the optimal configuration of weights according to your cost function). Would this work in practice, and are there any glaring flaws with my design or understanding of quantum mechanics?
"
['oracles']," Title: Recording Quantum QueriesBody: Question is about techniques from this paper. Essentially the paper provides a way to record what queries were asked to a quantum-accessible oracle. We have the oracles: \begin{aligned}
&\text { Standard oracle }(\mathrm{StO}):|x\rangle_{X}|y\rangle_{Y} \mapsto|x\rangle_{X}|y \oplus f(x)\rangle_{Y}\\
&\text { Phase oracle (PhO): } \quad|x\rangle_{X}|\eta\rangle_{Y} \mapsto(-1)^{\eta \cdot f(x)}|x\rangle_{X}|\eta\rangle_{Y}
\end{aligned}
The fourier oracle is defined as:
$\text { Fourier Oracle }(\mathrm{FO}): F O:=H^{F} \circ P h O \circ H^{F}$ (where $H^F$ stands for $QFT$)
The problem is decoding what happens in the last step here:
\begin{array}{l}
|x\rangle|\eta\rangle\left|0^{n} \cdots 0^{n}\right\rangle \stackrel{H^{F}}{\rightarrow} \sum_{f}|x\rangle|\eta\rangle|f\rangle \stackrel{P h O}{\longrightarrow} \sum_{f}(-1)^{\eta \cdot f(x)}|x\rangle|\eta\rangle|f\rangle \\
\stackrel{H^{F}}{\rightarrow} \sum_{f, \phi}(-1)^{\phi \cdot f}(-1)^{\eta \cdot f(x)}|x\rangle|\eta\rangle|\phi\rangle=\ldots \\
=|x\rangle|\eta\rangle\left|0^{n} \cdots 0^{n} \eta 0^{n} \cdots 0^{n}\right\rangle
\end{array}
$|f\rangle$ is the superposition of all possible $f$ in the corresponding domain and range. The claim is that after the last step at the $x$'th position you get $\eta$. Which indicates at which point the oracle was queried. How does the register containing $f$ transform to the register with $\eta$ in the $x$'th position?
"
['quantum-state']," Title: Can you encode two values in a single qubit state, say its phase and orientation?Body: I had an interesting talk with someone who said that we can use a single qubit to encode two different values. We encode the first value in its orientation (up/down) of particle/wave (electron, photon, etc.) and we encode the second value in the phase of that particle/wave. What do you think about that?
"
"['quantum-gate', 'circuit-construction']"," Title: Is there anything Quantikz can do that Tikz cannot do?Body: I am learning how to draw quantum circuits. I was checking the options available and I could see that Tikz and Quantikz are suitable for making circuits diagrams but I want to know if there are some tasks that Quantikz can do but Tikz cannot. Thanks.
Cross-posted on Tex.SE
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: Is the Hilbert-Schmidt probability simply zero that a generic rank-2 two-qubit (""pseudo-pure"") density matrix is separable?Body: The multifacted evidence is very compelling--although not yet presented in a formal proof--that the Hilbert-Schmidt probability that a generic (full rank/rank-4) two-qubit density matrix is separable is $\frac{8}{33}$
(MasterLovas-AndaiFormula)
Assuming this proposition, it follows from the interesting 2005 analysis of Szarek, Bengtsson and Zyczkowski structure of the body of states with positive partial transpose that
the Hilbert-Schmidt probability that a generic boundary (rank-3) two-qubit density matrix is separable/PPT is simply one-half, that is $\frac{4}{33}$.
So, what can be said in such regards for generic rank-2 two-qubit density matrices? (I suspect the associated separability probability is zero--as some current numerical analyses of mine appear to indicate--but also surmise that there is a manner in which to demonstrate such a proposition formally. Perhaps there is some literature to this effect that I would appreciate having indicated.)
Of course, one can pose parallel questions--which I am also investigating--for higher-dimensional qubit-qutrit, two-qutrit,...states (for which the Szarek, Bengtsson, Zyczkowski boundary-state PPT result still holds). The Hilbert-Schmidt separability/PPT probability for generic (full rank) qubit-qutrit states has been conjectured to be $\frac{27}{1000}$.
NumericalExact (It was also speculated there that the Hilbert-Schmidt PPT-probability for generic two-qutrit states might be $\frac{323}{3161088}=\frac{17 \cdot 19}{2^{10} \cdot 3^2 \cdot 7^3} \approx 0.000102180009$ or $\frac{11}{107653} = \frac{11}{7^2 \cdot 13^3} \approx 0.000102180153$.)
Rank-2 two-qubit states have been studied in considerable depth by Horia Scutaru
in "On the pseudo-pure states of two qubits." Proceedings of the Romanian Academy. Series A. Mathematics, Physics, Technical Sciences, Information Science 5.2 (2004): 136-140. pseudo-pure state article (I considered sending him this question, but found that he is deceased.)
Let us also point out that in our 2005 paper qubit-qutrit ratios a value (33.9982) of close to 34 was reported for the ratio of the Hilbert-Schmidt separability probability of rank-6 to rank-4 qubit-qutrit states. This would appear to be a further topic for updated analyses.
Theorem 1 of the 2001 paper LowRankSeparable,
"Low Rank Separable States Are A Set Of Measure Zero Within The Set of Low Rank States" of R. B. Lockhart deals with general cases of the type raised here, but appears to apply only to rank-1 (pure) two-qubit states and not to rank-2 such states, so leaving the question put forth here still not apparently answered.
"
"['quantum-state', 'density-matrix', 'fidelity', 'partial-trace']"," Title: What can be inferred about the closeness of reduced qubit states from the closeness of the bipartite quantum state?Body: Given a qubit state $|\psi\rangle \in \mathcal{H}$, and two bipartite general mixed states $\rho$ and $\sigma$, such that,
$$\langle \psi|\otimes \langle \psi|\rho - \sigma |\psi\rangle \otimes |\psi \rangle \ \leqslant \epsilon$$
Now suppose the reduced state of $\rho, \sigma$ be such that,
$$ \rho_r = Tr_1(\rho) = Tr_2(\rho), \hspace{5mm} \sigma_r = Tr_1(\sigma) = Tr_2(\sigma)$$
Then can we say something about the closeness of the reduced state in terms of epsilon? In other words,
$$\langle \psi| \rho_r - \sigma_r|\psi\rangle \leqslant ? $$
"
"['quantum-operation', 'nielsen-and-chuang']"," Title: Confused regarding explanation of Schumachers compression in N&CBody: On page 547 of N&C, for $|\psi_{0}\rangle=|0\rangle$ and $|\psi_{1}\rangle=(|0\rangle+|1\rangle)/\sqrt{2}$ and for $|\tilde{0}\rangle=\cos(\pi/8)|0\rangle+\sin(\pi/8)|1\rangle$ and $|\tilde{1}\rangle=-\sin(\pi/8)|0\rangle + \cos(\pi/8)|1\rangle$, that $|\langle\tilde{0}|\psi_{k}\rangle| = \cos(\pi/8)$ and $|\langle\tilde{1}|\psi_{k}\rangle| = \sin(\pi/8)$ for k = $\{0,1\}$. I just don't see how this can be the case for either of them.
I get $\cos(\pi/8)$ and $\cos(\pi/8)/\sqrt{2}+\sin(\pi/8)\sqrt{2}$ for $|\langle\tilde{0}|\psi_{k}\rangle|$ and for $|\langle\tilde{1}|\psi_{k}\rangle|$ I get $-\sin(\pi/8)$ and $-\sin(\pi/8)/\sqrt{2}+\cos(\pi/8)/\sqrt{2}$.
The inner product only produce these for $|\psi_{0}\rangle$. Is this a typo, and what they mean to say is that the inner product $|\langle\tilde{0}|\psi_{k}\rangle|$ is much larger than $|\langle\tilde{1}|\psi_{k}\rangle|$. But even in this case, that isn't completely true, as it's only just larger in the case of $|\langle\tilde{1}|\psi_{k}\rangle|$
For context, $|\tilde{0}\rangle$ and $|\tilde{1}\rangle$ come from the spectral decomposition of the density operator representing the source that generates $|\psi_{0}\rangle$ and $|\psi_{1}\rangle$ with probability a half for each.
What am I missing here? It seems like a simple inner product should be used but I can't get their results.
"
"['error-correction', 'stabilizer-code', 'terminology', 'fault-tolerance']"," Title: What is the pseudo threshold of a QECC using stabilizer formalismBody: Can someone explain what is the threshold and the pseudo threshold of a Quantum Error Correction Code , for instance the 9-qubit code, and how to calculate it using the stabilizer formalism simulation .
I'm familiar with quantum information and quantum circuit and beginners to quantum error correction codes, when i studied the Shor's 9-qubit code and my supervisor asked me to calculate the pseudo-threshold of the 9-qubit code using stabilizer formalism, I didn't found any simple explanation to initiate my research, all I found is related with fault tolerance
"
['programming']," Title: Can quantum computing help to recover a lost private key?Body: I lost a private key for an ethereum wallet. While seeking for information I found out that only quantum computers can decrypt a public key. Is this really a possibility? Thanks in advance.
"
"['algorithm', 'programming']"," Title: Is running a for loop faster on a quantum computer than a classical computer?Body: Curious to understand if I run for loop within a quantum algorithm, and lets say I want the quantum algorithm to run in classical run time of O(1). Can this be done?
"
"['algorithm', 'optimization', 'dynamics']"," Title: Computing the expectation values of a Hamiltonian constructed from a cost functions in combinatorial optimizationBody: One of the main steps in Hybrid Quantum algorithms for solving Combinatorial Optimization problems is the calculation of the expected value of a hermitian operator $H = \sum{H_i}$ (where $H_i$ are products of Pauli Matrices on a subset of the qubits) constructed from the structure of the optimization function $C(z)$ with respect to some parametrized state $\newcommand{\ket}[1]{\lvert#1\rangle}\ket{\theta}$.
As far as I've read, in practice one of the main procedures in calculating this expectation value is through sampling, where you basically measure $\ket{\theta}$ on the computational basis and use the proportions of observed outcomes as the probability of each solution and then evaluating $C(z)$ on each outcome (https://qiskit.org/textbook/ch-applications/qaoa.html).
Wouldn't this procedure be infeasible when $n$ grows too big? If anyone knows of other alternatives it would be greatly appreciated
"
"['quantum-gate', 'matrix-representation', 'textbook-and-exercises', 'notation']"," Title: How does the graphical notation used to denote doubly-controlled gates work?Body:
$\qquad$
$\qquad$
What is the difference between solid and hollow? How to express the corresponding matrix of these figures? In addition, if they are not adjacent, what should be done in the middle of several qubits (such as in more than 3 qubits)
"
"['programming', 'circuit-construction']"," Title: How to construct quantum circuit to count number of 0-qubits and 1-qubitsBody: Suppose we have a 3-qubit input; each bit is either 0 or 1. How to decide if there are more 1's than 0's? Only 1 extra qubit may be used for the output. (Yes I know this can be achieved using 3 Toffoli gates, but can it be done without Toffoli gates?)
Now suppose we have an answer to the above question, then, how to extend the above circuit to deal with a 5-qubit input?
"
"['measurement', 'hadamard', 'random-quantum-circuit', 'error-mitigation']"," Title: Randomness using simple parallel Hadamard circuitBody: I've recently tried to build a Random generator using 5 hadamard gates (shown as U2 below) measured to 5 classical bits in parallel as shown in the circuit image.
I've executed this circuit for 8192 shots (and repeated this many times) hoping to get somehow flat histogram of every of 32 possible states. Yet, instead i've found that probability decreases in almost linear fassion from |00000> -> |11111> which is bizare. I'm very new to quantum computing - could someone explain me why there is visible such strong linear dependence?
Or maybe this is expected, but why?
What I tried up til now:
- I've tried to change measurment order and using/not using barrier before measurements. Everything was calculated on ibmq_burlington mashine.
- I've also tried error mitigation (CompleteMeasFitter prepared and applied to results, with no luck - as before I can see a strong linear relation).
Can anybody help me to understand this behaviour?
Regards
Konrad
"
"['mathematics', 'quantum-operation', 'textbook-and-exercises', 'kraus-representation']"," Title: Can a Kraus representation act as the identity on any operator?Body: In the textbook “Quantum Computation and Quantum Information” by Nielsen and Chuang, it is stated that there exists a set of unitaries $U_i$ and a probability distribution $p_i$ for any matrix A,
$$\sum_i p_i U_i A U_i^\dagger =tr(A) I/d,$$
where $d$ is the dimension of the Hilbert space. (This is on page 517; Exercise 11.19; equation (11.85)) The left-hand side is a Kraus representation given A.
But is this possible for a general non-diagonalizable (i.e. non-normal) matrix A? For a normal matrix A, I found it is indeed the case.
"
"['qiskit', 'programming', 'error-mitigation']"," Title: Am I doing anything wrong when trying to calculate the expectation value in Qiskit on the real hardware?Body: I am trying to use the method of calculating the expectation values of Pauli operators in Qiskit which I found here.
However, the results obtained via IBMQ sampling differ significantly from the exact value, even though I perform measurement error mitigation.
The state, in which I am trying to calculate the expectation values, is prepared using a simple circuit
┌─────────────┐ ┌───┐
q_0: ─────┤ RY(-1.8018) ├──■────────■───────┤ X ├────────────────────
┌───┐└──────┬──────┘┌─┴─┐ │ └─┬─┘
q_1: ┤ X ├───────■───────┤ X ├──────┼─────────┼──────────────────────
└───┘ └───┘┌─────┴──────┐ │ ┌───┐
q_2: ─────────────────────────┤ RY(2.2489) ├──■─────────■───────┤ X ├
└────────────┘ ┌──────┴──────┐└─┬─┘
q_3: ────────────────────────────────────────────┤ RY(0.99778) ├──■──
└─────────────┘
which after transpiling looks as follows:
For reference, for each Pauli operator I print the exact expectation value and also calculate it a few times using the QASM simulator.
Here's the code:
circuit = QuantumCircuit(4)
circuit.x(1)
circuit.cry(-1.80184863, 1, 0)
circuit.cx(0,1)
circuit.cry(2.24892942,0,2)
circuit.cx(2,0)
circuit.cry(0.9977846,2,3)
circuit.cx(3,2)
psi = CircuitStateFn( circuit )
paulis = [ Pauli([1,1,0,0],[1,1,0,0]), Pauli([1,1,1,1],[1,0,0,1]) ]
shots = 8000
reps = 3
backend_qasm = qiskit.Aer.get_backend( 'qasm_simulator' )
q_instance_qasm = QuantumInstance( backend_qasm, shots = shots )
load_account()
provider = get_provider( hub='ibm-q' )
backend_ibmq = least_busy( provider.backends(filters=lambda x: x.configuration().n_qubits >= 4 and not x.configuration().simulator) )
q_instance_ibmq = QuantumInstance( backend = backend_ibmq,
shots = shots,
measurement_error_mitigation_cls = CompleteMeasFitter,
measurement_error_mitigation_shots = shots )
print(f'IBMQ backend: {backend_ibmq}.\n')
for pauli in paulis:
print(f'Pauli operator: {pauli}.')
pauli = WeightedPauliOperator([[1., pauli]]).to_opflow()
measurable_expression = StateFn( pauli, is_measurement = True ).compose( psi )
expectation = PauliExpectation().convert( measurable_expression )
expect_exact = psi.adjoint().compose( pauli ).compose( psi ).eval().real
print( f'Exact expectation value: {expect_exact}.' )
for r in range(reps):
sampler_qasm = CircuitSampler( q_instance_qasm ).convert( expectation )
expect_sampling_qasm = sampler_qasm.eval().real
print( f'Exact expectation, QASM sampling: {expect_sampling_qasm}.' )
for r in range( reps ):
sampler_ibmq = CircuitSampler( q_instance_ibmq ).convert( expectation )
expect_sampling_ibmq = sampler_ibmq.eval().real
print( f'Exact expectation, IBMQ sampling: {expect_sampling_ibmq}.' )
print()
And here's the output:
IBMQ backend: ibmq_ourense.
Pauli operator: IIYY.
WARNING - The skip Qobj validation does not work for IBMQ provider. Disable it.
Exact expectation value: -0.4201884924852.
Exact expectation, QASM sampling: -0.42275.
Exact expectation, QASM sampling: -0.4175.
Exact expectation, QASM sampling: -0.4165.
Exact expectation, IBMQ sampling: -0.19053720838213.
Exact expectation, IBMQ sampling: -0.33771371840093.
Exact expectation, IBMQ sampling: 0.14870401826006.
Pauli operator: YZZY.
Exact expectation value: 0.22895884311365.
Exact expectation, QASM sampling: 0.237.
Exact expectation, QASM sampling: 0.2385.
Exact expectation, QASM sampling: 0.2345.
Exact expectation, IBMQ sampling: 0.06862734682344.
Exact expectation, IBMQ sampling: 0.10246703115813.
Exact expectation, IBMQ sampling: 0.13078427261863.
Am I doing something conceptually wrong?
Is there an obvious way to improve the results? (except for doing more shots) Or is it what I should expect to get, given the device's gate fidelities?
Any thoughts/suggestions/corrections greatly appreciated.
"
"['teleportation', 'textbook-and-exercises']"," Title: In quantum teleportation what is the need for the extra X/Z gate after classical information is sent from Alice to Bob?Body: In the Qiskit textbook, at step 4, Bob who has received the classical bits from Alice then needs to apply a X and/or Z gate depending on what the classical bits received are, why is that?
"
"['quantum-gate', 'programming', 'circuit-construction', 'hamiltonian-simulation']"," Title: Is there a tool to get the quantum circuit corresponding to a sparse matrix?Body: If I know a sparse matrix, is there any tool that allows me to get the corresponding quantum circuit directly?
If not what should I do?
For example,I want to try hamilton simulation and I have the sparse matrix. How can I get the corresponding quantum circuit? By code or by some software? Or get enough training?
I'm new in this field.
Need your help
"
"['measurement', 'textbook-and-exercises', 'quantum-operation']"," Title: Representing a von Neumann measurement as $[\mathcal{I} \otimes P_i] U(\rho_s \otimes \rho_a)U^{-1} [\mathcal{I} \otimes P_i]$, how do we choose $U$?Body: Given the state of a system as $\rho_s$ and that of the ancilla (pointer) as $\rho_a$, the Von-Neumann measurement involves entangling a system with ancilla and then performing a projective measurement on the ancilla. This is often represented as
$$[\mathcal{I} \otimes P_i] U(\rho_s \otimes \rho_a)U^{-1} [\mathcal{I} \otimes P_i],$$
where $\mathcal{I}$ is the identity on system space, $P_i$ is the projector corresponding to $i$-th outcome, and $U$ is the combined unitary.
My question: How to choose the form of $U$?
"
"['density-matrix', 'continuous-variable', 'quantum-optics', 'wigner-function']"," Title: Relation between Wigner quasi-probability distribution and statistical second-momentBody: Is there any relation between the Wigner quasi-probability distribution function $W$ and the statistical second-moment (also known as covariance matrix) of a density matrix of a continuous variable state, such as Gaussian state?
"
"['physical-realization', 'noise', 'superconducting-quantum-computing']"," Title: Why attenuator and not filters for QC driving lineBody: In all the cold quantum computer designs (superconducting qubits, spin qubits) attenuators are put on the driving lines. Their role is to kill the noise spectral density that comes from higher temperature stages, such as the Johnson-Nyquist noise. Indeed the pulses are generated at high temperature and may contain a lot of noise that is required to be killed.
My question is simple: Why do people put attenuators which dissipate a lot of heat, and not simply filters? Indeed the goal is to kill the noise at qubit frequencies. Filter that do not let pass this frequency would be enough and can not be dissipative.
[edit2]: Actually to be safe we should reflect signal at all frequencies to mimic an attenuator. A two port device would be problematic as it would I think reflect signal coming from the lab to the qubit (left port), but also signal coming from qubit (which is a problem if we want to drive). In this case I guess a 3-port device would work.
"
['quantum-operation']," Title: What does the adjoint of a channel represent physically?Body: Given a quantum channel (CPTP map) $\Phi:\mathcal X\to\mathcal Y$, its adjoint is the CPTP map $\Phi^\dagger:\mathcal Y\to\mathcal X$ such that, for all $X\in\mathcal X$ and $Y\in\mathcal Y$,
$$\langle Y,\Phi(X)\rangle= \langle \Phi^\dagger(Y),X\rangle,$$
where $\newcommand{\tr}{\operatorname{tr}}\langle X,Y\rangle\equiv \tr(X^\dagger Y)$.
For example, if $\Phi$ is the trace map, $\Phi(X)=\tr(X)$, then $\Phi^\dagger(\alpha)=\alpha I$ for $\alpha\in\mathbb C$, as follows from
$\langle \alpha,\Phi(Y)\rangle = \tr(Y) \alpha^* = \langle \Phi^\dagger(\alpha),Y\rangle$.
Another example is the partial trace map. If $\Phi(X)\equiv\tr_2(X)$, then $\Phi^\dagger(Y)=Y\otimes I$.
Is there any general physical interpretation for the adjoint channel?
"
"['quantum-state', 'programming', 'measurement', 'phase-estimation']"," Title: Is it possible to detect the phase $\pi$ or 0 for the single qubit circuit X H P?Body: I found an answer that shows how to detect the phase in cases like $0$, $\pi/8$, $\pi/2$, $\pi/4$ or $\pi$ for circuit to prepare state as H P, where P is a phase gate like $I$, $U1(\pi/8)$, $S$, $T$ or $Z$.
But in my case the circuit to prepare state is $X H P$, where $P$ is $X$ gate (conditionally phase $\pi$) or $ID$ (conditionally phase 0).
This circuit in Qasm with conditionally phase equal to $\pi$:
x q[0];
h q[0];
x q[0];
with conditionally phase equal to $0$:
x q[0];
h q[0];
id q[0];
Appending $H$ gate (as in the above answer) don't detect a difference for conditionally phase $\pi$ and phase $0$ (but does detect for phases $\pi/2$, $\pi/4$, $\pi/8$ if $P$ is $S$, $T$, $U1(\pi/8)$, respectively).
Is it possible to detect the conditionally phase $P$ $\pi$ or 0 for this circuit to prepare state?
"
"['programming', 'ibm-q-experience']"," Title: How do you turn the CX gate upside down on ibm-q-experience?Body: I am learning how to make Grover's algorithm but the last cx gate needs to be the opposite way around. It always makes the top qubit the control, so how do you turn it around?
"
"['quantum-gate', 'circuit-construction', 'complexity-theory', 'gate-synthesis']"," Title: Equivalence checking of quantum circuits up to errorBody: Suppose you are given two circuit descriptions $A$ and $B$ where by a circuit description I mean a sequence of gates (in the order they are applied) and the qubits they are applied on. (For the sake of simplicity lets have the number of qubits fixed to $n$ and the circuit is measured in the computational basis).
Are there techniques to check from the circuit descriptions $A,B$ that the sampled output probability distributions induced by the computational basis measurements are
- a) equal
- b) more interesting to me: $\epsilon$-close in total variation distance
Even more ambitious, are there results about the complexity of this task? Are there such results for classical boolean circuits?
To clarify, if the circuit descriptions would only differ in the sequence of gates and not otherwise, i.e. each gate is replaced by a different gate but the positions of the gates in the circuit (the architecture) are the same in $A,B$, then it is known that operator norm errors $||U_j-V_j||=\epsilon_j$ of the individual gates just add up.
A "brute-force" way to solve this question is of course to classically simulate the output states of both circuits (by say a tensor network contraction) and compare those but this is certainly exponential time, so I am looking for smarter approaches.
"
"['programming', 'clifford-group']"," Title: Defining a Grassmann Algebra in PythonBody: I am trying to implement a Grassmann algebra in Python and was wondering if anyone could recommend any packages or suggest how to do so?
I want to define the following multiplication rules over $\Bbb{C}^{2n}$ with standard basis vectors $e_j$ via $$e_j^2=0 \text{ and the anti-commutation rule } e_ie_j+e_je_i=0$$
I then plan on defining an exponential function of quadratic terms in these basis vectors in a way that respects the relations above, ie $\exp{(ie_ae_b)}$, via the power series definition.
I would be very grateful for any suggestions on how to program this!
"
"['quantum-state', 'textbook-and-exercises', 'hadamard']"," Title: Why do we divide by $\sqrt2$ in the qubit states $\lvert\pm\rangle=\frac{1}{\sqrt2}(\lvert0\rangle\pm\lvert1\rangle)$?Body: I have a very basic question. I have found qubits are represented as complex vectors. I get it totally. I understand bracket notation and vector\matrix algebra. However, I cannot move further from here. It is often referred like the equation below.
$$
|+\rangle=\frac{1}{\sqrt{2}} ( |0\rangle+ |1\rangle)
$$
$$
|-\rangle=\frac{1}{\sqrt{2}} ( |0\rangle- |1\rangle)
$$
My questions are:
- Why is divided by $\frac{1}{\sqrt{2}} $ ?
- What does this symbol mean $|+\rangle$, $|-\rangle$? I understand what $|0\rangle$ and $|1\rangle$ means.
"
"['entanglement', 'teleportation', 'communication', 'faster-than-light']"," Title: Does entanglement allow enhanced communication efficiency?Body: From what I gather, communication is not possible with quantum mechanics. With the experiment on teleportation, entanglement is referred to as coordination and not communication. However, my belief is that communication is taking place. For example, given if a qubit has more information than a bit, this will mean that after Alice entangles/sends the qubit and prior to Bob measuring it, information is communicated. Am I missing something?
Yes. I have studied superdense coding. I also understand about the 2 classical bits. Let me add clarity to my question. Alice has a qubit which is sent to Bob. The qubit is not a regular bit and it contains more information than a bit. So, at the end of the day, Bob ends up receiving a qubit. And what I was saying in my original question, let's assume Bob does not read it but rather uses this qubit in a circuit. Hence, Bob is able to harness the information of a qubit which contains more information than regular classical bits. Hence, I see that communication of information is taking place. Is there something I am missing and/or can I clarify further my question. Thank you!
"
['entanglement']," Title: Separability Criterion for Multipartite GHZ Quantum StatesBody: In "SEPARABILITY CRITERION FOR MULTIPARTITE QUANTUM STATES BASED ON THE BLOCH REPRESENTATION OF DENSITY MATRICES" by Hassan and Joag, I found this remarkable thing about entanglement of mixed GHZ states, saying:
We consider [a] $N$-qubit state
$$\rho_{noisy}^{N} = \frac{1-p}{2^N}I + p|\psi\rangle\langle\psi|, 0\le p\le1 $$
where $|\psi\rangle$ is a $N$-qubit ... GHZ state.
$\hskip2.0in$
Does anyone know how these value would evolve when $N$ grows?
Their entanglement/separability criterion is given as Theorem 1.
If a $N$-partite quantum state of dimension $d_1d_2...d_N$ with Bloch representation $(8)$ is fully separable, then
$$
||\mathcal{T}^{(N)}||_{KF}\le \sqrt{\frac1{2^N}\prod_{k=1}^N d_k(d_k-1)}
$$
$\mathcal{T}^{(N)}$ is given as last term in $(8)$:
$||\mathcal T||_{KF} = max\{||T_{(n)}^N||_{KF}\}, n=1,...,N;$ is a Ky-Fan norm, which is the sum of the $k$ largest singular values of the matrix unfoldings of $\mathcal T$.
I'm not interested in $|W\rangle$ states...
"
"['information-theory', 'entropy', 'fidelity', 'relative-entropy', 'min-entropy']"," Title: Is the quantum min-relative entropy $D_{\min}(\rho\|\sigma)=-\log(F(\rho, \sigma)^2)$ or $D_{\min}(\rho\|\sigma)=-\log(tr(\Pi_\rho\sigma))$?Body: In John Watrous' lectures, he defines the quantum min-relative entropy as
$$D_{\min}(\rho\|\sigma) = -\log(F(\rho, \sigma)^2),$$
where $F(\rho,\sigma) = tr(\sqrt{\rho\sigma})$. Here, I use this question and answer to make the definition simpler although one should note that the linked question uses a different definition of fidelity (squared vs not squared).
On the other hand, one of the early papers introducing this quantity (see Definition 2 of this paper) defines it as
$$D_{\min}(\rho\|\sigma) = -\log(tr(\Pi_\rho\sigma)),$$
where $\Pi_\rho$ is the projector onto the support of $\rho$. It's not clear if these definitions are equivalent since I can change $\rho$ without altering its support.
How are the two definitions related to each other, if at all?
"
"['quantum-gate', 'quantum-state']"," Title: How to compute the inverse of a unitary B when it's defined only by B|0⟩=XXXX?Body: I got confused when reading an article about linear combination of unitary method. It shows its process as the following:
I can't figure out how the effect of $B^{\dagger}$ is calculated with the limited information of $B$.
Here
is the article mentioned.
Thanks to you all!
"
"['measurement', 'quantum-operation', 'textbook-and-exercises', 'kraus-representation']"," Title: What is the Kraus representation of quantum-to-classical channels?Body: As discussed in Watrous' book, quantum-to-classical channels are CPTP maps whose output is always fully depolarised. These can always be written as
$$\Phi_\mu(X) = \sum_a \langle X,\mu(a)\rangle E_{a,a}$$
for some set of positive operators $\mu(a)\ge0$ satisfying $\sum_a \mu(a)=I$.
What is the (a) Kraus representation of these maps?
"
"['mathematics', 'entropy']"," Title: How well defined is $\log(P)$ for $P$ projection?Body: Whenever we calculate entropy we make use, for example, $\log(P)$ for $P$ a projection defined for some arbitrary finite dimensional Hilbert space.
But for projection operators this is not well-defined by means of the functional calculus. My question is: although we are more interested in the terms $P \log(P)$ what is really happening is that we use this only for a symbol whenever we have projections and write $0\log(0)=0$ as the eigenvalue description using the functional calculus for the operator $P\log(P)$?
Is there a way to make $\log(P)$ a valid, well-defined, mathematical description?
"
"['quantum-gate', 'quantum-state']"," Title: How do I ""add"" two qubit states?Body: I have two states $|{\psi}\rangle = \begin{pmatrix} a_1\\a_2 \end{pmatrix}$ and $|{\phi}\rangle = \begin{pmatrix} b_1 \\ b_2 \end{pmatrix} $ that I want to "add" together. By "add," I of course mean perform the xor operation $|{\psi} \oplus {\phi}\rangle$.
I have an intuitive understanding of what this means since I'm familiar with bitwise operations, but I'm struggling to understand what the resulting state would look like.
My initial thought was to split the states into the logical basis and sum the components.
$a_1|{0}\rangle + a_2|{1}\rangle + b_1|{0}\rangle + b_2|{1}\rangle$
But this doesn't seem right. If my assumption that $|{0}\rangle + |{\psi}\rangle = |{\psi}\rangle$ is correct, then $a_1|{0}\rangle + b_1|{0}\rangle = a_1(|{0}\rangle + \frac{b_1}{a_1}|{0}\rangle) = a_1(\frac{b_1}{a_1}|{0}\rangle) = b_1|{0}\rangle$ which misses the point of the sum altogether.
What is my misunderstanding, and what is $|{\psi} \oplus {\phi}\rangle$ is in terms of $a_1, b_1, a_2, b_2$?
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How to transform a state with amplitude squared or to any power?Body: Suppose I have an unknown state $|\psi\rangle = \sum_i \alpha_i|{\lambda_i}\rangle$, is it possible that I can transform it into $|\psi\rangle = \frac{1}{\sqrt{\sum_i|\alpha_i|^{2r}}} \sum_i \alpha_i^r|{\lambda_i}\rangle$?
I have an idea for one qubit with a measurement, which would be better without measurements.
Suppose the input state is $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$ and can be prepared with two copies. An ancilla qubit is provided with state $|0\rangle$, such that
$
(\alpha|0\rangle+\beta|1\rangle)(\alpha|0\rangle+\beta|1\rangle)|0\rangle=
\alpha^2|000\rangle + \alpha\beta|010\rangle+\beta\alpha|100\rangle+\beta^2|110\rangle.
$
With two CNOT gates in a row, the ancilla qubit is the target qubit, such that
$
\alpha^2|000\rangle+\alpha\beta|011\rangle+\beta\alpha|101\rangle+\beta^2|110\rangle.
$
This is followed by a measurement on ancilla qubit if we happen to measure 0, which the state on the first two qubits will be
$
\frac{\alpha^2}{\sqrt{|\alpha|^4+|\beta|^4}}|000\rangle+\frac{\beta^2}{\sqrt{|\alpha|^4+|\beta|^4}}|110\rangle.
$
With an CNOT gate on the second qubit, using the first qubit as control, such that
$
\frac{\alpha^2}{\sqrt{|\alpha|^4+|\beta|^4}}|00\rangle+\frac{\beta^2}{\sqrt{|\alpha|^4+|\beta|^4}}|10\rangle=
(\frac{\alpha^2}{\sqrt{|\alpha|^4+|\beta|^4}}|0\rangle+\frac{\beta^2}{\sqrt{|\alpha|^4+|\beta|^4}}|1\rangle)|0\rangle
$
The state in the first qubit will be
$
\frac{\alpha^2}{\sqrt{|\alpha|^4+|\beta|^4}} |0\rangle+\frac{\beta^2}{\sqrt{|\alpha|^4+|\beta|^4}} |1\rangle
$
However, the measurement on ancilla qubit is a nuisance. Can I obtain the powered amplitude state without measurement on arbitrary number of qubits?
"
"['algorithm', 'research']"," Title: Where to publish quantum algorithm related paperBody: I am an undergraduate student and I wrote a paper for my research program on quantum information. To be more specific, it is about using a novel quantum algorithm to do signal/image processing. It won me a distinction in the research program so I thought I might want to try to publish it somewhere. However, I found it quite hard to find a suitable journal/conference to publish this paper on such a interdisciplinary topic. Anyone could give some suggestions as to where I can try to submit it to? Thanks.
"
"['quantum-operation', 'kraus-representation']"," Title: Can any channel be written as $\Phi(X)=\operatorname{Tr}_{\mathcal Z}[U(X\otimes \sigma)U^\dagger]$ for any state $\sigma$?Body: We know that every CPTP map $\Phi:\mathcal X\to\mathcal Y$ can be represented via an isometry $U:\mathcal X\otimes\mathcal Z\to\mathcal Y\otimes\mathcal Z$, as
$$\Phi(X) = \operatorname{Tr}_{\mathcal Z}[U(X\otimes E_{0,0})U^\dagger],\quad\text{where}\quad E_{a,b}\equiv \lvert a\rangle\!\langle b\rvert.\tag1$$
Showing this is quite easy e.g. from the Kraus representation.
If $A_a:\mathcal X\to\mathcal Y$ are Kraus operators for $\Phi$, then
$$U_{\alpha a,i0} \equiv \langle \alpha,a\rvert U\lvert i,0\rangle = \langle \alpha\rvert A_a\lvert i \rangle \equiv (A_a)_{\alpha,0}.\tag2$$
We can, of course, replace $E_{0,0}$ with any pure state in (1) without affecting the result.
This shows that, given any channel $\Phi$ and any pure state $\lvert\psi\rangle\in\mathcal Z$, we can represent $\Phi$ as in (1) (with $E_{0,0}\to\lvert\psi\rangle$).
However, what about the more general case of $E_{0,0}\to\sigma$ with $\sigma$ not pure?
To analyse this case, consider a channel written as
$$\Phi(X)=\operatorname{Tr}_{\mathcal Z}[U(X\otimes \sigma)U^\dagger]\tag3$$
for some state $\sigma=\sum_k p_k E_{k,k}\in\mathrm{Lin}(\mathcal Z)$ (appropriately choosing the computational basis for $\mathcal Z$).
The relation with the Kraus operators reads in this case
$$\Phi(X)_{\alpha,\beta} = \sum_{\ell k ij} p_\ell U_{\alpha \ell,i k} X_{ij} U^*_{\beta\ell,jk}
= \sum_{\ell,k} (A_{\ell,k}XA_{\ell,k}^\dagger)_{\alpha\beta}\tag4$$
with
$$(A_{\ell,k})_{\alpha,i} \equiv \sqrt{p_\ell} U_{\alpha\ell,ik},
\qquad A_{\ell,k} = \sqrt{p_\ell} (I\otimes \langle \ell\rvert)U(I\otimes \lvert k\rangle).\tag5$$
There is now a difference: the number of Kraus operators must be larger than the rank of $\sigma$ (which determines the number elements spanned by the index $k$ in $A_{\ell,k}$).
Indeed, a different way to state this same fact is to notice that the $\Phi$ in (3) is a convex combination of several channels:
$$\Phi(X) = \sum_k p_k \Phi_k(X), \qquad \Phi_k(X)\equiv \operatorname{Tr}_{\mathcal Z}[U(X\otimes E_{k,k})U^\dagger]. \tag 6$$
This leads me to the question: can any $\Phi$ be written as in (3) for any $\sigma$? More precisely, given $\Phi$ and $\sigma$, can I always find an isometry $U$ such that (3) holds?
The question arises from the fact that, because when $\sigma$ is not pure (3) leads to $\Phi$ be a convex combination of other maps as shown in (6), I would think that there should be maps that are "extremal", in the sense that they cannot be written as convex combinations of other maps, and that such maps shouldn't be writable as (3) for $\sigma$ not pure.
"
['ibm-q-experience']," Title: How to remove ancilla bits from results?Body: I have a circuit with 2 ancilla bits. I have only asked that the circuit measure the 4 other qubits, but the results keep including the ancilla bits. How to remove the ancilla bits from the results?
"
"['mathematics', 'deutsch-jozsa-algorithm']"," Title: What is the set of all functions from ℤ to ℤ?Body: In David Deutsch's classic paper Quantum theory, the Church-Turing principle and the universal quantum computer (1985), Deutsch writes on p. 99:
(I thought that this might be in typo in the original publication, but it is also present in the version that was retypeset in 1999 which is easily findable on the Internet.)
Since ℤ=ℤ, what is "the set of all functions from ℤ to ℤ?"
"
"['quantum-gate', 'quantum-state', 'simulation', 'noise']"," Title: Why should we use density matrices to simulate quantum systems with noise?Body: Why we should use density matrices to simulate quantum systems with noise?
I found that the any QEC circuit is included by some quantum gates just like normal cases, which means the state vector can also be used to simulate it, but all of the simulator only can realize noise model with density matrix, can someone help me with that?
"
"['qaoa', 'nisq']"," Title: What is the implication of locality in QAOA?Body: Suppose I am solving the TSP formulated as a QUBO problem using QAOA. I understand from the original paper that there is a parameter $p$ which sets the number of steps used in the alternating ansatz. Also, $p$ represents the locality of the terms in the ansatz.
So what does this "locality" mean for our real world TSP problem? Does it mean that we can only find optimal paths that are locally optimised up to $p$ edges radius?
"
"['entanglement', 'state-distillation', 'entanglement-negativity']"," Title: What is the deep physical reason behind the existence of bound entanglement?Body: In Quantum Information processing, we can extract entanglement from $n$-copies of a weakly entangled state to produce a fully or highly entangled states in $d$-dimensions, using the known distillation protocols.
However, there are states from which no entanglement can be extracted out using the known distillation protocols for no value of $n$. Such states contain bound entanglement.
For qubits, PPT is a necessary and sufficient criterion for separability. In higher dimensions, i.e qudits, there are states which satisfy PPT but are entangled and such states contain bound i.e non-distillable entanglement. I am not sure but I guess there are states which are NPT but bound entangled.
What is the deep physical reason behind the existence of bound entanglement?
"
"['measurement', 'quantum-operation']"," Title: Given a channel $\Phi(X)=\sum_k c_k(X)\sigma_k$, are there always $F_k\ge0$ such that $\Phi(X)=\sum_k \operatorname{tr}(F_k X)\sigma_k$?Body: Fix a finite number of states $\sigma_k$, and consider a channel of the form
$$\Phi(X)=\sum_k c_{k}(X)\sigma_k.$$
For $\Phi$ to be linear and trace-preserving we must have:
$$c_k(X+X') = c_k(X) + c_k(X'), \qquad \sum_k c_k(X)=1.$$
In other words, the coefficients must be linear functionals $c_k\in\mathrm{Lin}(\mathcal X)^*$ for all $k$.
Does this imply that there must be some positive operators $F_k\ge0$ such that $c_k(X)=\operatorname{Tr}(F_k X)$ for all $k$ (which in turn would imply $\sum_k F_k=I$ and thus that $\{F_k\}_k$ is a POVM)? What's a good way to show this?
"
"['quantum-state', 'noise']"," Title: Frequency collision and crosstalk errorBody: As the number of qubit increasing, the frequency of qubit will be crowded and there will become the frequency collision. I was wondering that is there any relation between frequency collision and crosstalk error? Does frequency collision lead to crosstalk error? If not, what's the difference between them?
"
['quantum-parallelism']," Title: Is Deutsch 1985b wrong about and Quantum Parallelism?Body: "Quantum theory, the Church-Turing principle and the universal quantum computer" (Deutsch 1985b) appears to introduce the term of "quantum parallelism" (the term is not in "Quantum Theory as a Universal Physical Theory" (Deutsch 1985a)). He makes two obvious (to me) claims:
- "Quantum parallelism cannot be used to improve the mean running time of parallelizable algorithms." (p. 112, top)
- Quantum parallelism could be used to prove the many-worlds interpretation of quantum mechanics, specifically:
Interpretational implications
I have described elsewhere (Deutsch 1985; cf. also Albert 1983) how it would be possible to make a crucial experimental test of the Everett (‘many-universes’) interpretation of quantum theory by using a quantum computer (thus contradicting the widely held belief that it is not experimentally distinguish- able from other interpretations). However, the performance of such experiments must await both the construction of quantum computers and the development of true artificial intelligence programs. In explaining the operation of quantum computers I have, where necessary, assumed Everett’s ontology. Of course the explanations could always be ‘translated’ into the conventional interpretation, but not without entirely losing their explanatory power. Suppose, for example, a quantum computer were programmed as in the Stock Exchange problem described. Each day it is given different data. The Everett interpretation explains well how the computer’s behaviour follows from its having delegated subtasks to copies of itself in other universes. On the days when the computer succeeds in performing two processor-days of computation, how would the conventional interpretations explain the presence of the correct answer? Where was it computed?
My reading of the paper is the Deutsch, in 1985, thinks that quantum turing machines are fundamentally more powerful than classical turing machines, because QTMs can simulate a CTM but CTMs cannot simulate a QTM.
My reason for asking the question is that Deutsch seems to be implying that quantum parallelism is real, and that it can be used for significant speedup, but my understanding is that quantum parallelism, in this sense, does not exist.
So is this early article wrong and, if so, how can it be wrong? Are the proofs wrong? Or is the quantum parallelism something that is conjectured and not proven?
And what about the many worlds?
"
"['quantum-gate', 'algorithm']"," Title: Computing cross-correlations on a quantum computerBody: I am trying to compute cross-correlation on a quantum computer, and I have found a research paper describing the cross-correlation algorithm.
The terms used in the algorithm are not clear, and it would be great if someone can help me with it. The algorithm has many formating and special characters that I cannot copy and paste in the browser from the PDF.
The link to access the research paper is Cross-Correlations computation through quantum computing. On page number 4 the cross-correlation algorithm is mentioned.
I am not able to understand that in the second step of the algorithm, what is the j^ register, and what does it consist of?
"
"['entanglement', 'partial-transpose', 'entanglement-witness', 'ppt-criterion']"," Title: Finding a class $C$ of bipartite PPT states such that entanglement of $\rho \in C$ implies entanglement of $\rho + \rho^{\Gamma}$Body: Consider an entangled bipartite quantum state $\rho \in \mathcal{M}_d(\mathbb{C}) \otimes \mathcal{M}_{d'}(\mathbb{C})$ which is positive under partial transposition, i.e., $\rho^\Gamma \geq 0$. As separability of $\rho$ is equivalent to separability of its partial transpose $\rho^\Gamma$, we know that $\rho^\Gamma$ is entangled. What are the conditions on $\rho$ which will guarantee that the sum $\rho + \rho^\Gamma$ (ignoring trace normalization) is also entangled?
It turns out that the above proposition does not hold for arbitrary PPT entangled states. Easiest counterexamples can be found in $\mathcal{M}_2(\mathbb{C}) \otimes \mathcal{M}_{d}(\mathbb{C})$, where $\rho + \rho^\Gamma$ is separable for all quantum states $\rho \in \mathcal{M}_2(\mathbb{C}) \otimes \mathcal{M}_d(\mathbb{C})$ (see separability in 2xN systems).
In the language of entanglement witnesses, the problem reduces to finding a common witness that detects both $\rho$ and $\rho^\Gamma$. Let $W$ be the entanglement witness detecting $\rho$, i.e., $\text{Tr} (W\rho) < 0$. Then $W$ is non-decomposable (as $\rho$ is PPT) and is of the canonical form $P+Q^\Gamma - \epsilon \mathbb{I}$, where $P, Q \geq 0$ are such that $\text{range}(P) \subseteq\text{ker}(\delta)$ and $\text{range}(Q) \subseteq \text{ker}(\delta^\Gamma)$ for some bipartite edge state $\delta$ (these are special states that violate the range criterion for separability in an extreme manner, see edge states) and $0 < \epsilon \leq \text{inf}_{|e,f\rangle} \langle e,f | P+Q^\Gamma | e,f \rangle$. If $\delta$ is such that $\text{ker}(\delta) \cap \text{ker}(\delta^\Gamma)$ is not empty, then we can choose $P=Q$ to be the orthogonal projector on $\text{ker}(\delta) \cap \text{ker}(\delta^\Gamma)$, in which case $W=W^\Gamma$ is the common witness. Can we find a class of PPT entangled states for which the previous statement holds? Can optimization of entanglement witnesses be somehow used to ensure this condition?
Cross-posted on math.SE
Cross-posted on physics.SE
"
"['algorithm', 'circuit-construction', 'oracles']"," Title: How to implement an OracleBody: Often when reading about QC algorithms the Authors assume the existence of an Oracle. I understand this is so that they can focus on the overall structure of the algorithm, and an Oracle can be seen as a subroutine that depends on the application. (One famous example is Grover's algorithm)
However, I imagine that if you were to try to implement one algorithm yourself for some applications, it would be necessary to assemble the oracle yourself for the algorithm to work. Thus, how do you do it? To make the question more specific I will refer to a particular one I am trying to implement: it's equation 41, 42 of Quantum algorithms for systems of linear equations inspired by adiabatic quantum computing.
The idea is the following, Imagine you have an s-sparse matrix of which you know the entries, then they assume there exist an oracle that given the row $|j\rangle$, and column indices $|i\rangle$ returns the matrix entry:
\begin{equation}
|j\rangle|i\rangle |z\rangle \rightarrow |j\rangle|i\rangle |z \oplus A_{ji}\rangle
\end{equation}
where (I guess) the column and row indices are in binary notation. Moreover, imagine that I would like to implement a sparse matrix with the following shape (1 on two diagonals)
\begin{equation}
A=\left[ \begin{array}{cccccc}
0 & 1 & 0 & 0 & \ldots & 0 \\
1 & 0 & 1 & 0 & \ldots & 0 \\
. & & & & & . \\
. & & & & & 1 \\
0 & 0 & 0 & \ldots & 1 & 0
\end{array} \right]
\end{equation}
Thus, how do I build this oracle? I thought I could try to manually compute cases until I get a matrix, that is to say: I would take a few vectors that encode $|j\rangle$, $|i\rangle$ and try to manually assign values to a matrix that multiplied to those vectors would return either 1 or 0 depending on the indices I have chosen. For instance you if you pick $i,j=3,4$ then $A_{j,i}=1$, whereas it's 0 for $i,j=3,3$ and so on.
After trying different indices and matrix multiplication by hand I might be able to identify the shape of this matrix and successively try to guess the gates that would implement that operation. However, this seems time-consuming and I am not sure I can easily generalize it to an arbitrary sized matrix, and probably guessing the necessary gates from the matrix wouldn't be easy either.
Is there a smart way to proceed in this case, and is there a general strategy one uses to implement Oracles?
"
"['qiskit', 'programming', 'ibm-q-experience', 'vqe', 'chemistry']"," Title: VQE jobs do not appear in queueBody: I am trying to calculate the ground state energy of some simple molecules using 'MolecularGroundStateEnergy' tools in qiskit. When I run the calculations for very small molecules (e.g. H2, HeH+) the jobs appear in the queue very quickly and the calculations work independent of which backend I select. However, running the same code with slightly larger molecules (e.g. LiH, BeH2 and water) the jupyter notebook runs indefinitely and the jobs do not show in the IMBQ queue.
Note: I have run successful calculations for all these molecules using the state-vector simulator with no issues.
Here is the function i use to calculate energy via VQE given a molecule (created from PySCF driver):
def calc_vqe_energy(molecule):
driver = molecule
energy = MolecularGroundStateEnergy(driver = driver,
transformation=TransformationType('full'),
qubit_mapping=QubitMappingType('parity'),
two_qubit_reduction=True,
freeze_core=False,
z2symmetry_reduction='auto')
solver = energy.get_default_solver(quantum_instance)
#calculate energy using the above solver
calc = energy.compute_energy(solver)
return calc
this is set up to run using the quantum instance:
IBMQ.save_account(token)
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend("ibmq_qasm_simulator")
coupling_map = backend.configuration().coupling_map
quantum_instance = QuantumInstance(backend=backend, shots=1000,
coupling_map=coupling_map,
measurement_error_mitigation_cls=CompleteMeasFitter,
cals_matrix_refresh_period=30, skip_qobj_validation=False)
Thanks for the help!
"
"['mathematics', 'measurement', 'textbook-and-exercises']"," Title: Meaning behind obtaining a hermitian operator for measurement in another basis?Body: If
$$P_{+} = |+\rangle\langle+|=\frac{1}{2}(|0\rangle\langle0|+|0\rangle\langle1|+|1\rangle\langle0| +|1\rangle\langle1|)$$
and
$$P_{-} = |-\rangle\langle-|=\frac{1}{2}(|0\rangle\langle0|-|0\rangle\langle1|-|1\rangle\langle0| +|1\rangle\langle1|),$$
then we can choose $\lambda_{+}=1$ and $\lambda_{-}=-1$, so that $\begin {bmatrix}0&1\\ 1&0\end{bmatrix}$ is a hermitian operator for single qubit measurement in the hadamard basis.
My confusion is about what this even means? Surely measurement in the hadamard basis simply involves the application of the associated projectors $P_{+}$ and $P_{-}$ to whatever state you possess, with $\frac{P_{i}|\psi\rangle}{\sqrt{tr(P_{i}|\psi\rangle\langle\psi|P_{i})}}$ giving the new state and $\langle\psi|P_{i}|\psi\rangle$ giving the associated probability of obtaining said state. What does the above operator even do? How is it even applied in the role of measurement.
I just don't see what use the above operator has, beyond maybe making it clear that $|+\rangle\to|+\rangle$ and $|-\rangle\to-|-\rangle$
"
"['teleportation', 'textbook-and-exercises', 'bell-basis']"," Title: How does Bell measurement work in the teleportation?Body: I'm a complete beginner and one of the first things I was taught was the teleportation protocol. In the protocol, the party sending its state (which we call say $|\phi\rangle$) makes a Bell measurement on a Bell state it has from before along with $|\phi\rangle$. From this, it finds the indices of its Bell state which it sends to the receiver. But my question is why does the fact that it is measuring $|\phi\rangle$ together with its Bell state have any bearing on the indices of the Bell state, considering $|\phi\rangle$ is not involved in the Bell measurement?
"
"['qiskit', 'programming', 'qasm', 'openpulse']"," Title: Is there a standard way to save pulse schedules akin to a qasm for a circuit?Body: If I create a QuantumCircuit, I can save all the information necessary to reconstruct the circuit using the qasm method. In addition, these qasm strings can be sent directly to the IBM quantum computers (and some others). This makes it convenient for storing these circuits locally and passing them around to collaborators when I want them to test the same circuit unambiguously. In addition, it's faster to load in and send qasms than it is to create circuits every time I want to create the same (large) circuit to run over different calibration cycles.
Is there an analogous method for OpenPulse Schedules?
The closest I could find was the .instructions method, but this creates an unwieldy tuple which cannot be sent directly to the QCs. This means I cannot just call the instructions method, save the string to a text file, and pass this to a collaborator. While I could write a file parser which reads these strings, this would take a long time and would break if the API is changed. Furthermore, even if I did do this, these tuples saved as a string to a .txt file take up an enormous amount of disk space, so it's actually not faster to manipulate the instructions, and I'm better of re-creating the pulses from scratch every time (which is also slow).
If not, has anyone come up with a "schedule qasm" workaround/hack for the time being?
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: IBMQ / Qiskit slack links are brokenBody: It appears the Slack links to IBMQ slack pages are broken (The link is no longer active). This is case for links on both Qiskit and IBMQ support pages.
What is the best way to gain access to the Slack group?
Thank you.
Link to IBMQ support page: https://quantum-computing.ibm.com/support
"
['entanglement']," Title: Lower Bound to Measure Entanglement in Mixed StatesBody: Given a mixed state with a $n$ qubit density matrix of the following structure:
$$
\rho=\pmatrix{\lambda_1&&&&\nu\\&\lambda_2\\ &&\lambda_{\dots}\\ &&&\lambda_2\\ \nu&&&&\lambda_1},
$$
so a mixture of a GHZ state and a sum of diagonal contributions of the form: $\prod Z_k^{x_k}$, where $x_k$ is the $k$th bit of the binary number $x\in\{0,1\}^n$, which is restricted to contain an even number of $1$s. The latter restriction ensures that the matrix is symmetric w.r.t. the anti-diagonal.
If all $\lambda_k$ are equal, there is a way to measure exponentially small amounts of the GHZ state, as proposed here. It looks to me, that my states don't respect the graph diagonal state requirement given in the comments.
What is the best lower bound for $\nu$, that is efficiently measurable (involving polynomially many measurements)?
"
"['algorithm', 'quantum-state', 'entanglement', 'oracles']"," Title: Is there a way to construct a quantum circuit/oracle to check if 2 qubits in an unknown pure state are entangled?Body: I have 2 qubits which are in an unknown pure state i.e. their density matrix $\rho$ can be expressed as $|\psi\rangle\langle\psi|$.
Let the initial state be $|\psi\rangle = c_{00}|00\rangle + c_{01}|01\rangle + c_{10}|10\rangle + c_{11}|11\rangle$. These coefficients $c_{i}$ are unknown.
I wish to find out if they are entangled or seperable? Can this be done by constructing a Quantum Oracle or some other circuit?
The Rules are:
- We do not have access to the circuit which created this state $|\psi\rangle$.
- The initial state of the qubits can be destroyed at the end of the measurement.
- Any method which has $>0.5$ chance of success is acceptable.
- Free to use ancillary qubits.
Edit: I have tried to rewrite the question in order to clarify it as per suggestions in the comments.
"
"['quantum-fourier-transform', 'hadamard', 'simons-algorithm']"," Title: N-Qubit Hadamard vs Quantum Fourier TransformBody: Both Simon's algorithm and the algorithm for period finding begin by placing qubits in the equal superposition state, but Simon's algorithm uses the n-qubit Hadamard $H^{\otimes n}$ while the period finding algorithm uses the quantum Fourier transform. My understanding is both QFT and the n-qubit Hadamard perform the same operation on the $|00...0\rangle$ state, creating the $\frac{1}{\sqrt{2^n}} \sum_{x\in\{0,1\}^n}|x\rangle$ state. I'm reading this from the Qiskit textbook.
When the result is the same, why do the two algorithms use different ways to achieve the equal superposition? More generally, when would one use the n-qubit Hadamard, and when would one use the QFT?
"
"['algorithm', 'entanglement', 'phase-estimation']"," Title: How to get the relative phase of an entangled pair of qubitsBody: I have an extension to the following question: How to get the relative phase of a qubit?
How do I get the relative phase of a pair of entangled qubits such as $$\frac{1}{\sqrt{2}}(|00\rangle+e^{i\theta}|11\rangle)$$
in which I want to find theta. I tried to use a similar methodology as the answer in the linked question above, but with no success.
"
['ibm-q-experience']," Title: CSV files cut results short in ibm-q-experience?Body: I have noticed that the csv files exported for results don’t have the resolution to correctly describe the output states for larger sets of qubits. It looks like it only exports numbers up to 15 digits long without cutting them. For example, if I try to get results on 17 qubits, it doesn’t carry the information about the last two numbers, so when I change the format to “custom”, in Excel, with 17 0’s, and I have done a circuit with qubits 0, 1, 15 and 16 in superposition and the rest left as 0, there will be, for example, 4 results at the end listed as “11000000000000000”.
Has this been addressed before? Am I doing something wrong? Is there a solution?
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: How do I measure a single qubit in a two-qubit state?Body: Let us suppose that I have the state
\begin{equation}
\frac{1}{\sqrt2}(\alpha|0\rangle|+\rangle+\beta|1\rangle|-\rangle)
\end{equation}
and I choose to measure the first qubit in the basis $\{(1/\sqrt{2})(|0\rangle\pm e^{i\phi}|1\rangle)\}$.
How can I perform this measurement and how can I find the related outcomes (i.e. the eigenvalues) provided only the basis in which I have to measure the system? Being kinda new to quantum mechanics I am really confused about the algebraic aspects of this problem, but I have an intuitive idea of what performing a measurement is.
"
"['quantum-gate', 'quantum-state', 'error-correction', 'noise']"," Title: A question about quantum noise modelBody: Now, I try to understand some concept of Quantum Noise Model and Quantum Channel. The Quantum Noise can be represented as a quantum operator with their own probability. As far as I concerned,(I dont know if it is right), it totally included Bit Flip, Phase Flip, Bit-phase Flip, Amplitude damping and Phase damping. and all the five noise can happen with their own probability so that the quantum status can be represented as a mixed state.
However, there is a question, The five error below is happened because of systematic gate error and environmental decoherence. So systematic gate error and environmental decoherence can both cause the five error or each of them match some of the error?
And the five noise or error from above can happen independently or not, in other word, can the five error happen in the same time with their own probability?
"
"['quantum-gate', 'quantum-operation']"," Title: Why do quantum operations need to be reversible?Body: Why do quantum operations need to be reversible?
Is it because of the physical implementation of the qubits or operators neesd to be unitary so that the resultant states fit in the Bloch sphere?
"
['entanglement']," Title: How does one go about constructing a mixed entangled state?Body: In general, an entangled state is one which cannot be decomposed as $\sum_{i}p_{i} \bigl(\rho_{i}^A\otimes\rho_{i}^B\bigr)$. But such an entangled state could still be mixed in principle.
How would one create a mixed entangled state? For instance, can one create such a state by tracing out one qubit or a subsystem of a pure state?
"
"['entanglement', 'textbook-and-exercises', 'quantum-operation', 'locc-operation', 'majorization']"," Title: Prove that $A\preceq B$ implies $A=\Psi(B)$ for some channel $\Psi$Body: Define $\newcommand{\PP}{\mathbb{P}}\newcommand{\ket}[1]{\lvert #1\rangle}\newcommand{\tr}{\operatorname{tr}}\newcommand{\ketbra}[1]{\lvert #1\rangle\!\langle #1\rvert}\PP_\psi\equiv\ketbra\psi$, and let $\ket\psi,\ket\phi$ be two bipartite states such that $\tr_2(\PP_\psi)\prec\tr_2(\PP_\phi)$.
Here, $A\prec B$ with $A,B$ positive operators means that the vector of eigenvalues of $A$ is majorised by that of $B$: $A\preceq B\Longleftrightarrow\lambda(A)\preceq\lambda(B)$.
A step to prove Nielsen's theorem, used in the proof of the theorem given here (pdf alert) is that $\tr_2(\PP_\psi)\prec\tr_2(\PP_\phi)$ implies $\tr_2(\PP_\psi)=\Psi(\tr_2(\PP_\phi))$ for some mixed unitary channel $\Psi$.
More precisely, it implies that $\tr_2(\PP_\psi)=\Psi( W\tr_2(\PP_\phi)W^\dagger)$ for some mixed unitary channel $\Psi$ and isometry $W$ (though these two statements seem pretty much equivalent to me).
To show this, an important observation seems to be the fact that, introducing the operators $X,Y$ with components $X_{ij}=\psi_{ij}, Y_{ij}=\phi_{ij}$ (that is, $\ket\psi= \operatorname{vec}(X)$ and $\ket\phi= \operatorname{vec}(Y)$), we have
$$\tr_2(\PP_\psi) = XX^\dagger,\qquad \tr_2(\PP_\phi) = YY^\dagger.$$
Suitably defining the underlying vector spaces, we can always assume $XX^\dagger ,YY^\dagger >0$. Moreover, $XX^\dagger\prec YY^\dagger$ implies $\operatorname{rank}(XX^\dagger)\ge\operatorname{rank}(YY^\dagger)$.
Why does this imply that the existence of a mixed unitary channel $\Phi$ and isometry $W$ such that $XX^\dagger = \Psi(WYY^\dagger W^\dagger)$? The reason is probably trivial but I'm not seeing it right now.
"
['bb84']," Title: Can Eve randomly guess the correct bases in the BB84 exchange of a one-time pad?Body: I'm learning about Quantum Key Distribution, and just learned about the BB84 exchange. I learned that it can be used to exchange a key for a one-time pad, which would allow for information-theoretically secure communication. As I understand the algorithm:
- Bob and Alice decide on 2 different bases to encode quantum states
- Alice chooses a basis and a random bit to prepare a qubit and transmits the prepared qubit to Bob.
- Bob randomly chooses a basis to measure the received qubit in
- Alice and Bob communicate over a classical channel and figure out which bits they measured with the same basis
Eve can try to intercept the qubit Alice sends, but Eve has to randomly guess which basis to measure in because she has no information about which basis Alice prepared the qubit in. This means Eve has a 50% chance of choosing the right basis for any given transmitted qubit and a 75% chance of not introducing a disagreement between Alice and Bob by collapsing the state of the qubit.
Let $n$ be the number of qubits Alice and Bob measure in the same basis. This means that Eve has $0.75^n$ chance of getting lucky and getting the key while going unnoticed. She could then check if Alice and Bob continue to communicate to see if she went unnoticed. Eve can also eavesdrop over the classical channel Alice and Bob use to communicate the bases they used to throw out measurements she made that were not included in the key. Now Eve has constructed the key and knows it's the correct key.
While the probability of Eve measuring the key correctly scales exponentially with respect to $n$, it seems like this algorithm is not safe unless roughly $n > 1000$.
Is there something I'm misunderstanding, or is the above argument valid? Is there any way to guarantee Eve has no chance of guessing the correct key?
This is an answer to a similar question but does not answer my final question.
"
['error-correction']," Title: Circuit for implementing Steane's code for Quantum Error CorrectionBody: I was reading about the Steane's code for QEC. However I could not find any implementation or circuit describing its creation. Can anyone share/explain how the Steane's code could be implemented.
The answer can be Circuit Diagram or Implementation in any Quantum Programming Language (Q#, Qiskit etc)
"
"['quantum-gate', 'universal-gates']"," Title: Is the gate-based model of QC universal?Body: I have heard this is the case but can not find a source even discussing this.
Can any problem that can be solved by a Quantum Computer, also be solved by the quantum circuit model?
I realise that even if this is true, it won't always be the best option, I mean theoretically.
And I have heard that CNOT gate combined with arbitrary rotations allow to implement any gate. But nothing that makes it clear that the circuit can do anything.
"
"['quantum-state', 'entanglement']"," Title: What separable $\rho$ only admit separable pure decompositions with more than $\mathrm{rank}(\rho)$ terms?Body: As shown e.g. in Watrous' book (Proposition 6.6, page 314), a separable state $\rho$ can always be written as a convex combination of at most $\mathrm{rank}(\rho)^2$ pure, separable states.
More precisely, using the notation in the book, any separable state $\xi\in\mathcal X\otimes\mathcal Y$ can be decomposed as
$$\xi = \sum_{a\in\Sigma} p(a) \, x_a x_a^*\otimes y_a y_a^*,\tag1$$
for some probability distribution $p$, sets of pure states $\{x_a: a\in\Sigma\}\subset\mathcal X$ and $\{y_a: a\in\Sigma\}\subset\mathcal Y$, and alphabet $\Sigma$ with $\lvert\Sigma\rvert\le \mathrm{rank}(\xi)^2$.
This is shown by observing that $\xi$ is an element of the real affine space of hermitian operators $H\in\mathrm{Herm}(\mathcal X\otimes\mathcal Y)$ such that $\mathrm{im}(H)\subseteq\mathrm{im}(\xi)$ and $\mathrm{Tr}(H)=1$. This space has dimension $\mathrm{rank}(\xi)^2-1$, and thus from Carathéodory we get the conclusion.
Consider the case of the totally mixed state in a space $\mathcal X\otimes\mathcal Y$ with $\mathrm{dim}(\mathcal X)=d, \mathrm{dim}(\mathcal Y)=d'$. For this state, $\xi\equiv \frac{1}{dd'}I = \frac{I}{d}\otimes\frac{I}{d'}$, we have $\mathrm{rank}(\xi)=\lvert\Sigma\rvert=dd'$ for the standard choice of decomposition.
Generating random convex combinations of product states I also always find $\lvert\Sigma\rvert=\mathrm{rank}(\xi)$ (albeit, clearly, the numerics doesn't check for the existence of an alternative decomposition with less than ${\rm rank}(\xi)$ components). In the case $\lvert\Sigma\rvert=1$, it is trivial to see that we must also always have $\lvert\Sigma\rvert=\mathrm{rank}(\rho)$.
What are examples in which this is not the case?
More precisely, what are examples of states for which there is no alphabet $\Sigma$ with $\lvert\Sigma\rvert\le\mathrm{rank}(\xi)$, such that $\xi=\sum_{a\in\Sigma}p(a)x_a x_a^*\otimes y_a y_a^*$?
The following is the Mathematica snippet I used to generate random convex combinations of product states:
RandomUnitary[m_] := Orthogonalize[
Map[#[[1]] + I #[[2]]&, #, {2}]& @ RandomReal[
NormalDistribution[0, 1], {m, m, 2}
]
];
randomPureDM[dim_] := First@RandomUnitary@dim // KroneckerProduct[#, Conjugate@#] &;
With[{numComponents = 4, bigDim = 10},
With[{
mats = Table[KroneckerProduct[randomPureDM@bigDim, randomPureDM@bigDim], numComponents],
probs = RandomReal[{0, 1}, numComponents] // #/Total@# &
},
Total[probs*mats] // Eigenvalues // Chop
]
]
A related question on physics.SE is What is the minimum number of separable pure states needed to decompose arbitrary separable states?.
"
"['quantum-state', 'qiskit', 'ibm-q-experience', 'error-correction']"," Title: How to create the logical $|0_L\rangle$ state for the Steane's 7-qubit code?Body: I don't know how to prepare using Qiskit the following state in order to implement a Steane's 7-qubit code circuit (I omit the normalization factor):
\begin{align*} |0_L\rangle =&|0000000\rangle+|1010101\rangle+|0110011\rangle+|1100110\rangle+
\\
+&|0001111\rangle+|1011010\rangle+|0111100\rangle+|1101001\rangle
\end{align*}
Furthermore, I was wondering if it exists a general procedure in order to prepare an arbitrary multipartite state like $|0_L\rangle$.
"
"['qiskit', 'programming', 'architecture', 'experiment', 'qasm']"," Title: What is the executable opcode for Qiskit quantum hardware, as the quantum circuits or the transpiled/compiled QObj/ QASMQObj are assembly languages?Body: When we write a QASM code or build quantum circuit on Qiskit GUI, it converts it into QObj/QASMQObj (refering paper Qiskit Backend Specifications for OpenQASM and OpenPulse Experiments) or its transpiled version, before executing. However this is assembly language, how it is converted into opcode/bytecode before executing on the hardware?
"
"['quantum-gate', 'quantum-state']"," Title: SWAP specific phase components of two qubitsBody: Is it possible to perform an operation on two qubits with initial states as follows:
$$q_1: 1/\sqrt(2)(|0\rangle + exp(0.a_1a_2a_3)|1\rangle)$$
$$q_2: 1/\sqrt(2)(|0\rangle + |1\rangle)$$
To resultant state:-
$$q_1: 1/\sqrt(2)(|0\rangle + exp(0.a_1a_2)|1\rangle)$$
$$q_2: 1/\sqrt(2)(|0\rangle + exp(0.a_3)|1\rangle)$$
Without knowing the value of $a_3$. Where $a_1,a_2,a_3 ∈ [0, 1].$
The idea is to shift the phase of $q_1$ by $exp(-0.00a_3)$ and $q_2$ by $exp(0.a_3)$ with the unitary operation not being aware of the value of $a_3$.
"
['quantum-fourier-transform']," Title: Are there any common applications where one can replace FFT with Quantum Fourier Transform?Body: I want to apply QFT to some common applications like on wave equations. I haven't found any applications of QFT except Shor's algorithm and I am yet to build an intuition for its use cases. I am a beginner in QC. It would be great if someone can help!
"
"['circuit-construction', 'ibm-q-experience']"," Title: The analogous IBM circuit representation for the quantum schemeBody:
I am trying to implement a quantum scheme of sharing a secret via EPR states. Here is my initial state of 6 qubits \begin{equation} |\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)\end{equation},
- The qubits $(1,4)$ belong to $P_1$, $(2,6)$ to $P_2$, $(3,5)$ to $P_3$.
- An operator is applied to qubit $1$ say the Pauli $Z$ gate, to get \begin{equation}|\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)\end{equation}. Now after each party measures his qubits the operator is revealed.
For instance say if $P_1$ measures $|\alpha^+\rangle_{14}$, and $P_2$ and $P_3$ measure $|\beta^-\rangle_{26}$ and $|\beta^+\rangle_{35}$ respectively, they write their state as after swapping as
\begin{equation}
|\alpha^-\rangle_{12}|\alpha^+\rangle_{34} |\alpha^+\rangle_{56}
\end{equation}, now they know the initial state of the qubits $(1,2)$, hence they deduce the operator as $Z$.
I have tried hard, but how to make the circuit for this scheme on an IBM-QE or for that matter any hardware.
The circuit provided is my try.
- The part before the first barrier is where the initial state is prepared with the operator $\mathbb{Z}$, (this the operator that the parties have to find out by combing their measurements).
- $(2,6)$ undergoes a Bell Basis measurement with the C-NOT and hadamard.
- This makes $(1,5)$ entangled, represented by the C-NOT between (1,5) (a kind of reverse C-NOT- I don't know why i did this reverse, just out of intuition).
- $(3,5)$ undergoes a Bell Basis measurement with the C-NOT and Hadamard.
- This makes $(1,4)$ entangled, represented by the reverse C-NOT between (1,4) (again intuition).
- Then the Bell basis measurement on $(1,4)$ with the C-NOT and Hadamard.
But, i am still not knowing how to proceed, the theoretical calculations say that the final state should be
\begin{equation}
|\alpha^-\rangle_{12}|\alpha^+\rangle_{34}|\alpha^+\rangle_{56}
\end{equation} so that they apply the $Z$ on the first qubit to get
\begin{equation}|\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)\end{equation}
Can't somebody atleast hint at where to start from?
Do i have to use conditional statements , because that is what the theory says, but how does one use these statements? I know for instance that the state 0000 on the 2,6 ,3,5 qubits will correspond to an identity operator on the 1st qubit and similarly we do these for others but does one code this on a simulator
"
"['programming', 'q#']"," Title: How to create a C# host program for a Q# program in Visual Studio Community 2019?Body: I have been trying to create a C# host program for a Q# program in Visual Studio Community 2019 by following these instructions: https://docs.microsoft.com/en-us/quantum/quickstarts/install-cs?tabs=tabid-vs2019%2Ctabid-csharp.
But when I click "Create", I cannot complete the process, and this message pops up:
I have followed the instructions from the message, have restarted my computer, and have reopened Visual Studio. However, that same message still pops up, and I still cannot create the C# host program.
Any idea?
Thanks.
"
"['quantum-state', 'quantum-operation', 'density-matrix', 'textbook-and-exercises']"," Title: Calculate probability of a state after depolarizationBody: Let's say I have a particle in the quantum state $|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$, represented as a density operator (1st matrix) that went through a depolarizing chanel (2nd matrix). Let's call the depolarized matrix $D_p$.
$$
\begin{bmatrix}
.5 & .5 \\
.5 & .5
\end{bmatrix}
\rightarrow
\begin{bmatrix}
.5 & .43 \\
.43 & .5
\end{bmatrix}
$$
Now, I have two of these $D_p$, and their resulting product state is:
$$
D_p^{\otimes 2} = \begin{bmatrix}
.5 & .43 \\
.43 & .5
\end{bmatrix}
\otimes
\begin{bmatrix}
.5 & .43 \\
.43 & .5
\end{bmatrix}.
$$
Now, if I want want to calculate the probability of finding some state $|\psi\rangle = |0\rangle \otimes |0\rangle$ in the above mentioned product system, then this is what I do:
$$
p(|\psi\rangle | D_p^{\otimes 2}) = trace(\psi\rangle\langle \psi | D_p^{\otimes 2}).
$$
As you can see, calculating this trace is a $O(N^3)$ complexity operation and becomes very slow for even a small number of particles, i.e. for $D_p^{\otimes 10}$ or higher. Is there a principled way to calculate these probabilities? Without using any matrix multiplication?
Cross-posted on Physics.SE
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: Preparation of states that correspond to efficiently integrable probability distributionsBody: I have been trying to implement methods from paper Creating superpositions that correspond to efficiently integrable probability distributions by Grover and Rudolph.
It is stated that there exists an efficient (polynomial) process for the preparation of certain probability density functions (e.g. log-concave distributions).
Specifically, in equation 5. It is stated that
$$\sqrt{p_i^{(m)}}|i\rangle |0...0\rangle \rightarrow \sqrt{p_i^{(m)}}|i\rangle |\theta_i\rangle$$
Can be done efficiently under these assumptions.
I have not found any details on how this can actully be done, either with and example or with the details of how such an efficient circuit could be composed.
Would highly appreciate any insights on this.
"
"['qiskit', 'ibm-q-experience']"," Title: What is the buffer time between gates of the ibmq_essex in nanoseconds?Body: This is a question that I asked on Qiskit ignis section of slack, with a very interesting answer by A Kapila, but I also need to get a short answer in nanoseconds.
I want to evaluate decoherence in function of a waiting time introduced by adding identity gates before the measurement phase (using barriers before and after the series of id gates)
For instance for the Essex device, I can obtain the id gate length value using the following code:
device = provider.get_backend('ibmq_essex')
properties = device.properties()
from qiskit.providers.aer.noise.device.parameters import gate_length_values
gate_times_out = gate_length_values(properties)
print(gate_times_out[0])
('id', [0], 64.0)
Note that this method of creating a delay was used in a published paper about decoherence.
https://arxiv.org/pdf/1712.07080.pdf
In the methods section the authors give the following description:
« A delay τ is realized via the application of multiple identity operations. Each identity operation has the same duration as a single-qubit rotation gate (80 ns) and is followed by a 10-ns buffer time, which corresponds to a total delay of 90 ns per identity operation. »
For the circuit presented here, the waiting time is 4 * 64 ns = 256 ns plus four times the additional buffer time between gate for the device.
I can find the buffer times in older descriptions of some devices, like the Yorktown (see: https://github.com/Qiskit/ibmq-device-information/blob/master/backends/yorktown/V1/version_log.md).
But I cannot find it for the Essex device.What is it? Or where can I find it?
Or maybe the waiting time is already included in the gate length values?
Thanks by advance for helping.
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: How is it possible to guess what state the qubit was in by measuring it?Body: Let's say that the qubit is in the state $\psi = \alpha|0\rangle+\beta|1\rangle$. We want to find out the values $\alpha$ and $\beta$.
If we measure it in, say, the standard basis, then the outcome we get is either $|0\rangle$ or $|1\rangle$. So, how do we find out the given values?
I recently came across the problem that asked to compare the probabilities of finding out the $\alpha$ and $\beta$ if we measured the qubit in two different bases and I'm not sure how to calculate them.
"
['qaoa']," Title: How to do the direct evaluation by hand in QAOA algorithmBody: In QAOA algorithm, for $p=1$ layer of gates and at most degree $d=3$, the expectation value can be calculated by hand. I think I can convince myself the idea of commutability. In this qiskit example, the author evaluated
$$f_A(\gamma,\beta) = \frac{1}{2}\left(1 - \langle +^3|U_{21}(\gamma)U_{02}(\gamma)U_{01}(\gamma)X_{0}(\beta)X_{1}(\beta)\;Z_0Z_1\; X^\dagger_{1}(\beta)X^\dagger_{0}(\beta)U^\dagger_{01}(\gamma)U^\dagger_{02}(\gamma)U^\dagger_{12}(\gamma) | +^3 \rangle \right)$$
as
$$f_A(\gamma,\beta) = \frac{1}{2}\left(sin(4\gamma)sin(4\beta) + sin^2(2\beta)sin^2(2\gamma)\right).$$
I believe I can write these unitaries explicitly as tensor product of $U1$ and $U3$ gate. However, when we evaluate this by hand, the states $|+^3\rangle$ or $|+^5\rangle$ what I can imagine is an 8-dimensional vector or 32-dimensional vector. For the 8-dimension case, these gates are two-qubit gates. All I can think of is that I need to expand these two-qubit gates into a three-qubit gate by tensor product with an identity operator. Even though, I still don't know how to handle these gates like $U_{02}$. How can I sandwich an identity operator into a two-qubit operator?
My question is how to evaluate this explicitly by hand.
I found a paper Quantum Algorithms for Fixed Qubit Architectures and it provided some operator identity which I think can help understand how this evaluation worked.
But I still have no idea how these identities hold.
I copied the original text here:
5.2 Optimal trial state parameters
In this example we consider the case for $p = 1$, i.e. only layer of gates. The expectation value $F_1(\gamma,\beta) = \langle \psi_1(\beta,\gamma)|H|\psi_1(\beta,\gamma) \rangle$ can be calculated analytically for this simple setting. Let us discuss the steps explicitly for the Hamiltonian $H = \sum_{(j,k) \in E} \frac{1}{2}\left(1 - Z_i Z_k\right)$. Due to the linearity of the expectation value we can compute the expectation value for the edges individually
$$f_{(i,k)}(\beta,\alpha) = \langle \psi_1(\gamma,\beta)|\;\frac{1}{2}\left(1 - Z_i Z_k\right)\;|\psi_1(\gamma,\beta)\rangle. $$
For the butterfly graph as plotted above, we observe that there are only two kinds of edges $A = \{(0,1),(3,4)\}$ and $B = \{(0,2),(1,2),(2,3),(2,4)\}$. The edges in $A$ only have two neighboring edges, while the edges in $B$ have four. You can convince yourself that we only need to compute the expectation of a single edge in each set since the other expectation values will be the same. This means that we can compute $F_1(\gamma,\beta) = 2 f_A(\gamma,\beta) + 4f_B(\gamma,\beta)$ by evaluating only computing two expectation values. Note, that following the argument as outlined in section 4.2.2, all the gates that do not intersect with the Pauli opertor $Z_0Z_1$ or $Z_0Z_2$ commute and cancel out so that we only need to compute
$$f_A(\gamma,\beta) = \frac{1}{2}\left(1 - \langle +^3|U_{21}(\gamma)U_{02}(\gamma)U_{01}(\gamma)X_{0}(\beta)X_{1}(\beta)\;Z_0Z_1\; X^\dagger_{1}(\beta)X^\dagger_{0}(\beta)U^\dagger_{01}(\gamma)U^\dagger_{02}(\gamma)U^\dagger_{12}(\gamma) | +^3 \rangle \right)$$
and
$$f_B(\gamma,\beta) = \frac{1}{2}\left(1 - \langle +^5|U_{21}(\gamma)U_{24}(\gamma)U_{23}(\gamma)U_{01}(\gamma)U_{02}(\gamma)X_{0}(\beta)X_{2}(\beta)\;Z_0Z_2\; X^\dagger_{0}(\beta)X^\dagger_{2}(\beta)U^\dagger_{02}(\gamma)U^\dagger_{01}(\gamma)U^\dagger_{12}(\gamma)U^\dagger_{23}(\gamma)U^\dagger_{24}(\gamma) | +^5 \rangle \right)$$
How complex these expectation values become in general depend only on the degree of the graph we are considering and is independent of the size of the full graph if the degree is bounded. A direct evaluation of this expression with $U_{k,l}(\gamma) = \exp\frac{i\gamma}{2}\left(1 - Z_kZ_l\right)$ and
$X_k(\beta) = \exp(i\beta X_k)$ yields
$$f_A(\gamma,\beta) = \frac{1}{2}\left(sin(4\gamma)sin(4\beta) + sin^2(2\beta)sin^2(2\gamma)\right)$$
and
$$f_B(\gamma,\beta) = \frac{1}{2}\left(1 - sin^2(2\beta)sin^2(2\gamma)cos^2(4\gamma) - \frac{1}{4}sin(4\beta)sin(4\gamma)(1+cos^2(4\gamma))\right) $$
These results can now be combined as described above, and the expectation value is therefore given by
$$ F_1(\gamma,\beta) = 3 - \left(sin^2(2\beta)sin^2(2\gamma)- \frac{1}{2}sin(4\beta)sin(4\gamma)\right)\left(1 + cos^2(4\gamma)\right),$$
We plot the function $F_1(\gamma,\beta)$ and use a simple grid search to find the parameters $(\gamma^*,\beta^*)$ that maximize the expectation value.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Queue disabled and HTTP 403 errorBody: I have already visited this What does it mean to get 403 error when running a code on Qiskit? which did not help me fix my problem.
I want to test the quantum circuit that I have designed using the following code, (the histogram of the circuit is being plotted perfectly so I don't believe that there is any problem with it)
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')
qcomp = provider.get_backend('ibmq_16_melbourne')
job = execute(circuit, backend=qcomp)
I do not understand the problem with the above code. The last line is not executing in the Jupiter notebook cell. Is it a location problem of Melbourne, because me residence is India? What would I do?
"
['adiabatic-model']," Title: Is the Elitzur-Vaidman bomb tester an example of adiabatic evolution?Body: I'm trying to grok more of the adiabatic model. I also really enjoyed O'Donnell's lecture on the Elitzur-Vaidman bomb tester.
The familiar setup involves a test for the presence (or absence) of a bomb. The bomb goes off if a qubit passes through in the $\vert 1\rangle$ state, and does nothing if going through in the $\vert 0\rangle$ state.
Conventionally a qubit is prepared in the $\vert +\rangle$ state to go through the bomb tester, and if it doesn't trigger the bomb, it is measured in the $\{\vert +\rangle,\vert -\rangle\}$ basis. If the bomb is present, there's a 50% it will go off, a 25% chance that it might be inconclusive but a 25% chance that the qubit will be measured as $\vert -\rangle$, proving the presence of the bomb.
In O'Donnell's description of the improved test, a qubit without a bomb present is slowly rotated by $\epsilon$ degrees, from $\vert 0\rangle$ to $\vert 1\rangle$. However if a bomb is present, the qubit will remain in $\vert 0\rangle$ with high probability.
This slow rotation of the qubit feels, to me, a bit like a slowroll of a changing Hamiltonian used in the adiabatic model. But that's where my intuition hits a road-block of not understanding the adiabatic theorem well enough.
Is my intuition close to correct? How would one frame the Elitzur-Vaidman bomb tester in terms of the adiabatic theorem? For example what would be the initial and final Hamiltonians?
"
['complexity-theory']," Title: Can quantum computers be used to solve P = NPBody: The P versus NP problem is a major unsolved problem in computer science. It asks whether every problem whose solution can be quickly verified can also be solved quickly. It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute, each of which carries a US$1,000,000 prize for the first correct solution. My question is, can a quantum computer be used to solve P = NP?
"
"['algorithm', 'classical-computing']"," Title: Is it possible to convert classical algorithms to quantum ones?Body: I am new in this field and I am considering to do research for my engineering degree.
First, I would like to have an opinion from more experienced people. Do you think it is possible to convert classic algorithms to quantum algorithms? Having in mind that the conversion will take in consideration the particularities of quantum algorithms.
If so, can you explain your point of view and if it is possible, an example?
"
"['quantum-state', 'information-theory']"," Title: How is a bit field represented in Quantum Computing?Body: For example, a computer represent a variable named "A" as 01000001. How does a quantum computer represent "A"?
I am a newbie having difficulty understanding quantum computers. I watched a lot of videos but unable to understand the basics. Please recommend some resources which can clear my basic concepts.
"
"['quantum-state', 'error-correction', 'quantum-operation', 'trace-distance']"," Title: Is the restriction of a strictly contractive channel (SCC) to a subspace necessarily still SCC? (impossibility of perfect QEC for SCCs)Body: This paper shows the impossibility of perfect error correction for strictly contractive quantum channels, i.e., for channels such that $||\mathcal{E}(\rho)-\mathcal{E}(\sigma) ||\leq k ||\rho-\sigma||$, for $0\leq k <1$.
The requirement for perfect error correction of a subspace $K$ is that there exists a channel $S$ such that $S$ is the inverse of the restriction of $\mathcal{E}$ to the subspace $K$.
The proof of impossibility uses the fact that this would require $||S\mathcal{E}(|u\rangle\langle u|)-S\mathcal{E}(|v\rangle\langle v|)|| = |||u\rangle\langle u|-|v\rangle\langle v|||$, for some basis vectors $u,v$, which would contradict strict contractivity.
My confusion is concerning how this contradiction argument doesn't seem take into consideration the fact that we should restrict to the subspace $K$. In other words, if $P$ is the projector onto the subspace $K$, is it generally true that if $\mathcal{E}$ is strictly contractive, then
$||P(\mathcal{E}(\rho))-P(\mathcal{E}(\sigma)) ||<||P(\rho)-P(\sigma)||$?
Thank you in advance.
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Making custom gate in Qiskit?Body: I have been trying to make a gate in qiskit in terms of the basic gates, but I keep on getting an error when I apply it to a circuit.
This is my gate:
class LGate(Gate):
def __init__(self, label=None):
super().__init__('l', 1, [], label=label)
def _define(self):
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit.library import U3Gate
q = QuantumRegister(1, 'q')
qc = QuantumCircuit(q, name=self.name)
rules = [
(U3Gate(pi, 0, pi), [q[0]], [])
]
qc._data = rules
self.definition = qc
Of course this is just an X gate, but I was just trying a basic example.
Running the program:
circ = QuantumCircuit(2)
circ.l(0)
print(circ)
Error:
AttributeError: 'QuantumCircuit' object has no attribute 'l'
"
['hhl-algorithm']," Title: Using matrix inversion and summation together. How to compute $(A+B^{-1})^{-1}|x\rangle$Body: I need to compute $(A+B^{-1})^{-1}|x\rangle$, where A and B is hermitian for simplicity.
I read out about matrix inversion algorithms (HHL, QSVE,...), and algorithms of summing up of matrices(LCU, Lie–Trotter product formula,...) but I don't understand how to glue this two parts together.
"
"['quantum-gate', 'mathematics', 'quantum-fourier-transform', 'hadamard']"," Title: Prove that QFT and Walsh-Hadamard gates give the same output when acting on $\lvert x\rangle\lvert 0\rangle$Body: I know that $QFT_n|0\rangle$ is equivalent to $H_n|0\rangle$
(mathematical proof).
And it is also easy to prove that $QFT_1$ is equivalent to $H_1$ (applied to one QuBit).
From looking at the circuit below it seems clear to me that the gates should also be equivalent if $|x_1\rangle$ is in any state and all other QuBits are $|0\rangle$.
This should be true because none of the controlled $R$ gates are applied to $|x_1\rangle$.
I do not know how to prove this mathematically. Can anyone provide an elegant proof?
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'entanglement']"," Title: Generalized construction of W basisBody: Although this question deals with the construction of a W-state, I was looking for a general way to find all the orthogonal W-states, given a number of qubits. For example, for three qubits, the first W-state I find is:
$$
W_3^1 = \frac{1}{\sqrt{3}}(|001\rangle + |010\rangle + |100\rangle).
$$
An orthogonal state to this state would be (from this paper, page 4):
$$
W_3^2 = \frac{1}{\sqrt{3}}(|001\rangle - |010\rangle + |111\rangle).
$$
But I am not sure whether this state qualifies as a W-state or not. I want to find all the other 6 orthogonal basis states like this. Also, I would like to be able to generate such orthogonal basis states in any dimension. Of course, I can use Gram–Schmidt process to find a set of orthogonal vectors. But I'm not sure whether they would be W-states or not. What is the proper way to generate such W-basis states given a number of qubits? TIA.
"
"['qiskit', 'programming', 'hadamard']"," Title: How to undo an operation in qiskit on jupyter notebook?Body: I am not able to undo an operation. For example, I want a single Hadamard gate on a single qubit but by mistake two Hadamard gate added. Now I want to remove one of them without interrupting kernel. Is there any easy way. Please help me. Thank you.
"
"['partial-trace', 'quantum-process-tomography']"," Title: Is it possible to partial trace the $\chi$-matrix of $4$ qubits $q_0,q_1,q_2,q_3$ to obtain a description of what happens to $q_1$?Body: Considering a $\chi$-matrix of a circuit with, say, 4 qubits, is it possible to trace out 3 of them from $\chi$ - for example qubits $q_0$, $q_2$ and $q_3$ - thus gaining the process matrix describing what happens to $q_1$?
If yes, since it seems to me different from partial trace for a density matrix, could you please give me the definition?
The $\chi$-matrix of an $n$-qubit quantum channel $\mathcal{E}$ is a matrix $\chi$ such that the evolution of a density matrix $\rho$ is given by
\begin{gather}
\mathcal{E}(\rho) = \sum_{i,j}\chi_{i,j}P_i \rho P_j
\end{gather}
where $\{P_0, P_1,\dots ,P_{d^{2}−1}\}$ is the $n$-qubit Pauli basis containing $d^{2} = 4^{n}$ elements.
An estimation method to compute the $\chi$-matrix is available at 8.4.2 of Nielsen & Chuang's Quantum Computation and Quantum Information.
"
['quantum-state']," Title: Can quantum states have negative probability?Body: I know that when a qubit is described in a superposition state as $\alpha|0⟩ + \beta|1⟩$, then the probability of measuring $|0⟩$ is $\alpha^2$ and probability of measuring $|1⟩$ is $\beta^2$ and $\alpha$ and $\beta$ belong to the complex number set, $C$.
So let's say that, the amplitude of state, say, $|0⟩$ is $\alpha=i$, which means that the probabilty of measuring the $|0⟩$ state will be $\alpha^2=i^2=-1$.
So, my question is, does the mean that the probability here can also be negative? Since, as far as I knew, negative probability does not exist? Or is my understanding wrong?
"
"['algorithm', 'deutsch-jozsa-algorithm', 'oracles']"," Title: Deutsch-Jozsa: why is only one evaluation of $f$ needed?Body: I might be asking something quite obvious but why is it stated that only one evaluation of $f$ is needed in the Deutsch-Jozsa algorithm?
If we have a quantum oracle for $f:\{0,1\}^n\rightarrow\{0,1\}$ and we apply the oracle to the $(n+1)$-qubit state, we get the quantum state $\frac{1}{\sqrt{2^{n+1}}}\sum_{n=0}^{2^n-1}|x\rangle (|f(x)\rangle-|1\oplus f(x)\rangle)$.
Why does the algorithm involve only a single evaluation of $f$? In order to apply the quantum oracle, doesn't the application of the quantum oracle involve full knowledge of the function $f$? Don't we have to calculate $f$ for $x=0,1,2,...,2^n-1$?
"
"['communication', 'qkd']"," Title: How do I compare the secret key rate (kbps) with the secret key rate per channel use?Body: I am doing some research for an undergrad project and have hit a conceptual stumbling block. I have recently been looking at some of the achievements in practical QKD using trusted node quantum networks. The achieved secret key rates are usually measured in kbps (SECOQC, DARPA, Tokyo QKD etc.)
I know that there is an upper-bound for the secret key rate based for any repeaterless QKD protocol, the PLOB limit. In the paper (Pirandola et al., 2017), they plot the secret key rate against distance. But here the secret key rate is measured in bits per channel use and it is several orders of magnitude lower than the secret key rate mentioned in the practical papers mentioned above.
Sadly, I don't have time to delve into this, but would like to understand how I can compare these numbers. In a practical QKD protocol between two parties, as far as I know, there is usually a single channel (a fibre cable perhaps). So, would I be right in thinking that, depending on the protocol, the channel will be used many times a second in order to share information, hence, the secret key rate (in kbps) when looked at per channel use would actually be a much lower value?
All I need is enough information, perhaps a paper which I could look at, which would help me understand the PLOB limits use of secret key rate (as measured in bits per channel use) versus the practical QKD usage which measures the secret key rate in kbps.
Thanks in advance to anyone who can help
"
"['programming', 'ibm-q-experience', 'simulation']"," Title: IBMQ_Melbourne Readout errorBody: I am trying to simulate an experiment on IBM's melbourne quantum computer and here are the results
- Qasm simulator :
- ibmq_16_melbourne:
- error
why is there such high probability of unwanted states i.e 01 and 10. Also when the circuit is transpiled on the melbourne computer the circuit operates between $q[4]$ and $q[10]$, is these usual.
"
"['quantum-gate', 'quantum-state', 'error-correction', 'quantum-operation']"," Title: What is the standard noise channel that is applied in simulations?Body: I know there are various quantum noise channels, which include the depolarizing channel, the dephasing channel and the bit-flip channel; We can apply them in simulators easily.
However, is there any standard to choose the model we apply?
I mean, why we should (for instance) choose a flip channel over a depolarizing channel and when should we choose a specific channel? Why is the depolarizing channel commonly used?
"
"['qiskit', 'shors-algorithm']"," Title: Is there a general order finding quantum algorithm for a given a and N?Body: I'm trying to construct a general circuit for Shor's algorithm in Qiskit. I understood the later parts of the circuit (inverse QFT and QPE), but can't really understand the order finding.
For example, if we consider $N=15$, we have all the $\text{gcd}$ of 15 to be 2, 7, 8, 11, 13 (although I suspect that 4 is not considered as it is $2^2$). For $a=2$ or $13$, we swap qubits 0 and 1, 1 and 2, 2 and 3. If $a=7$ or $8$, we swap 2 and 3, 1 and 2, 0 and 1. If $a=11$, we swap 1 and 3, 0 and 2. Also, if $a=7, 11$ or $13$, we add an $X$ gate on all the 4 added qubits.
I want to know how we chose which qubits to swap for a particular number, and how we can generalize it, if possible.
"
['density-matrix']," Title: Can we compute a full density operator $\rho_{AB}$ from its reduced density operators $\rho_A$ and $\rho_B$?Body: Given density operator of a composite system, say $\rho_{AB}$, we can always calculate reduced density operators of individual system i.e. $\rho_{A}=Tr_{B}(\rho_{AB})$ and $\rho_{B}=Tr_{A}(\rho_{AB})$.
Can we calculate density matrix of a composite system, $\rho_{AB}$, given reduced density operators $\rho_{A}$ and $\rho_{B}$ and also knowing that $\rho_{A}$ and $\rho_{B}$ are mixed state density operators? If yes, then how?
"
"['qiskit', 'programming', 'circuit-construction', 'quantum-computing-for-finance']"," Title: How can I load a probability distribution using a quantum circuit in Qiskit?Body: Can someone suggest me a way to load a distribution (for example a discretized Gaussian distribution) into a quantum computer using a quantum circuit?
I tried to implement the code using Qiskit.
"
"['qiskit', 'ibm-q-experience', 'physical-realization', 'ibm']"," Title: Form and effect of the intrinsic Hamiltonian on the IBM machinesBody: I want to understand the form of the intrinsic Hamiltonian of the IBM machines, such as ibmq_16_melbourne, and how this affects the data I get out when waiting using identity gates.
From the ZZ-characterisation tutorial in the documentation, it seems like the general form of the intrinsic Hamiltonian is
$$
\mathcal{H} = \sum_i^N \frac{2\pi\nu_i}{2} (1-\sigma_i^z)+\sum_{ij}^N\frac{\xi_{ij}}{4}\left(1-\sigma_i^z\right)\left(1-\sigma_j^z\right),$$
with sums in theory over all $N$ qubits. Here $\nu_i\approx 5\,\text{GHz}$ and $\xi_{ij}$ seem to take values up to $\sim 100\,\text{kHz}$, but only significantly above $0$ for nearest neighbours. Is this correctly understood?
Now, if I prepare an initial state $\frac{1}{\sqrt2}\left(|0\rangle +|1\rangle\right)\otimes|0\rangle^{N-1}$ I do not see oscillations with a frequency anywhere near $5\,\text{GHz}$, but rather something closer to $100\,\text{kHz}$. Does this mean that the measurements are being taken in the co-moving frame with frequencies for each qubit being $\nu_i$? If so, why do I have these residual oscillations?
"
"['quantum-gate', 'quantum-fourier-transform']"," Title: Intuitively, what does the quantum Fourier transform do?Body: I somewhat understand its practical use in phase estimation and algorithms like Shor's algorithm but is there some more intuitive way of understanding what it does?
More concretely, I'd like to know if there is there some way of thinking about how it effects the probability of the base states and similarly, is there a way of considering how it effects the probability of the outcome of measurement of each input qubit?
"
"['qiskit', 'programming']"," Title: qiskit.QuantumCircuit and qiskit.QuantumCircuit.draw()Body: The first time I create a two qubits, two bits circuit and draw it the output is:
q0_0
q0_1
c0_0
c0_1
Each subsequent time I run my script (even after clearing all the variables) I get the following:
q1_0
q1_1
c1_0
c1_1
.
.
.
qn_0
qn_1
cn_0
cn_1
The number next to the qubit or classical bit increases every time. Is this a bug, is there a way to avoid this?
I am using Qiskit 0.19.6.
"
"['communication', 'entanglement-swapping']"," Title: Entanglement and teleportation transmission costsBody: Let say we have a product state $$|\phi^+\rangle_{12}|\phi^+\rangle_{34}$$ with particles (1,4) belong to $A$ and (2,3) belong to $B$. Where $A$ and $B$ are say at distance of $L$ from each other. When particle $A$ measures his qubits $(1,4)$ in the BSM (Bell state measurement), there is correlation to the BSM of the $(2,3)$ qubits of $B$. Suppose this was part of some secret sharing scheme, what cost does it incur, starting from the initial creation of the state, to the transmission of data (quantum) which includes communication the classical information.
Does the distance between these two parties $A$ and $B$ have some role to play? My feeling is that it should have a role since the quantum data when transmitted over the channel may be exposed to noise or any other errors, so the longer the distance the higher is the probability of the error in transmission.
Is this cost some function of $L$ and the number of qubits (in this case $4$). And if there is some transmission cost how does one reduce this?
Can somebody atleast give some references?
"
"['measurement', 'tomography']"," Title: Calculating bipartite state from joint probability distributionBody: We can calculate single qubit state by measuring it in pauli observables {$\sigma_{x},\sigma_{y},\sigma_{z}$} and then looking at its probability distribution. How to do this when we are having joint probability distribution for multiqubit state? Specifically, I want to know the procedure for calculating 2-qubit state when it's measured in $\sigma_{x}\otimes\sigma_{x}$, $\sigma_{y}\otimes\sigma_{y}$ and $\sigma_{z}\otimes\sigma_{z}$ observables?
"
"['quantum-gate', 'textbook-and-exercises']"," Title: What does the unitary $[|0\rangle\langle 0|\otimes I+|1\rangle\langle1|\otimes(|1\rangle\langle 0|+|0\rangle\langle1|)]\otimes I$ represent?Body: Consider the following unitary defined for a system $A$ interacting with a bipartite system $BB^\prime$
$$U_{AB} = \Big[|0\rangle \langle 0|_{A} \otimes \mathbf{I}_{B} + |1\rangle \langle 1|_{A} \otimes \big(|1\rangle \langle 0|_{B} + |0\rangle \langle 1|_{B} \big) \Big] \otimes \mathbf{I}_{B^\prime},$$ with
$\mathbf{I}_i$ being the identity.
My question:
- What is the physical meaning of operation $U_{AB}$?
- Can one represent $U_{AB}$ in terms of quantum logic gates ( a circuit diagram)?
"
"['qiskit', 'programming', 'ibm-q-experience', 'graph-states']"," Title: Does Qiskit offer a stack of functions to generate and manipulate graph states?Body: I'm looking for a way to test graph state verification protocols on the IBM Q. Has anyone yet written code to generate a graph state on IBM Q and also generate its stabilizer generators given the adjacency matrix of the graph as input?
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: How to get the state of an individual qubit in a composite system?Body: Given a composite system with $N$ qubits represented by some $2^N$-dimensional vector, how would I get the quantum state of an individual qubit?
Note that I understand some states are not separable given quantum entanglement. My question is whether there is a set of steps, an algorithm, for generally determining whether a qubit's state is separable, and then getting the state itself if it is separable.
The wikipedia entry provides a somewhat brief answer to this question but doesn't expand on the general case for separating quantum states.
"
"['quantum-gate', 'quantum-state']"," Title: How do we perform a measurement of an arbitrary 1-qubit quantum state in any arbitrary orientation?Body: Let's imagine we have an arbitrary 1-qubit quantum system $\alpha \vert 0 \rangle + \beta \vert 1 \rangle$ Making a measurement in the +/- basis is equivalent to performing a Hadamard gate and then making a measurement in the standard computational basis.
Can we extend this notion generally for measurement of an arbitrary 1-qubit state in any arbitrary orientation? So, if we want to make a measurement of an arbitrary 1-qubit quantum state in some arbitrary orientation in the 2-dimensional Bloch sphere, can we perform some unitary transformation $U$ (supposing such $U$ can be composed theoretically) that transforms the basis state into orthonormal states of that orientation and then perform a measurement in the computational basis?
Let's say we have unitary transformation $U$ that maps $\vert 0 \rangle$ to $\vert a \rangle$ and $\vert 1 \rangle $ to $\vert b \rangle$ with $\langle a \vert b \rangle = 0$ (where $\vert a \rangle$ and $\vert b \rangle$ have certain orientation with respect to the standard basis states) the same way $H$ transforms $\vert 0 \rangle$ to $\vert + \rangle$
and $\vert 1 \rangle $ to $\vert - \rangle$ state. One difference could be that $H$ is Hermitian too while $U$ may not be.
Another sub question is whether $U$ needs to be Hermitian also to make this generalization.
"
"['entanglement', 'error-correction', 'noise']"," Title: In the three-qubit bit flip code, why can the first bit flip without impacting the entanglement with the other qubits?Body: The principle of the three-qubit Bit Flip Code is straight forward at first sight. Using CNOT you basically encode
$$a|0\rangle + b|1\rangle $$
to
$$ a|000\rangle + b|111\rangle$$
using entanglement. Now we assume that noise flips one of the qubits so that the state becomes
$$ a|100\rangle + b|011\rangle.$$
Since the three bits are entangled, I was wondering why the first bit can flip by noise without any impact on the other two bits (assuming a higher probability for one bit to flip than two or three).
In the case of decoherence, I would assume that the first bit would not be entangled to the other two bits anymore due to noise.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: What is the maximum circuit depth for Qiskit Aer Simulator?Body: I'm running some simulator circuit on my computer, and I see that (using 3 qubits, and thousands of classical registers), the max cap seems to be about qc.depth() slightly less than 150000 before the kernel crash into oblivion (with or without optimization_level = 3, so I don't think that helps). I have plenty of RAM left and I don't see them filling up, and the circuits always only take a few seconds to run since I only do 1 shot so I doubt if it's a CPU problem. What is the cause of this, and is there any way to be able to run at higher depth? Thanks!
"
"['qiskit', 'tomography']"," Title: How to do state tomography when using sampling in Qiskit?Body: Could anyone please explain how do I do state tomography when using sampling (on real device or QASM) in Qiskit? I know there's a special method for this, but I could not find a working example.
More precisely, I would be interested in two cases: when the full state tomography is performed (all the $2^n$ amplitudes are measured) and when it's known apriori that the wave function has support in a certain subspace (say, only $|10\rangle$ and $|01\rangle$ for a two-qubit system).
BTW, is $3^n$ a lower bound on the number of operators which have to be measured in order to perform the state tomography? ($X$, $Y$, $Z$ for each qubit.)
"
"['quantum-gate', 'circuit-construction']"," Title: How can we implement controlled-T gate using CNOT and H, S and T gates?Body: In general, is there any way to implement a controlled version of an arbitrary gate U if we are given only CNOT and U gate?
"
"['quantum-state', 'entropy', 'information-theory']"," Title: How can the Holevo bound be used to show that $n$ qubits cannot transmit more than $n$ classical bits?Body: The inequality $\chi \le H(X)$ gives the upper bound on accessible information.
This much is clear to me. However, what isn't clear is how this tells me I cannot transmit more than $n$ bits of information.
I understand that if $\chi < H(X)$, then reliable in-ferment isn't possible, with the Fano inequality giving the lower bound for the chance of an error being made.
However, I've seen some examples state that $\chi\le n$ proves this, which I can only see being the case of $H(X)$ is maximum for each qubit. Do they mean that if $\chi = H(X)$ then given that this is all the information about one qubit, then for $n$ qubits, if $\chi=H(X)$ for all of them then $\chi =n$?
Is it taking the $H(X)$ as all the information of a single qubit/bit, regardless of its value, and as such if $\chi$ is equal to it, it is said to have access to all that information as well?
Edit: Maybe to make this clearer, I am asking where $n$ comes from if we take $\chi \le H(X)$, as in many cases $H(X)$ will not be maximum.
"
"['qiskit', 'programming']"," Title: Problem with installing Qiskit on Android with Termux emulatorBody: Termux has some issues with cmake, therefore qiskit-aer-0.5.2 installation returns error 1.
Collecting qiskit
Downloading qiskit-0.19.6.tar.gz (4.0 kB)
Collecting qiskit-terra==0.14.2
Downloading qiskit-terra-0.14.2.tar.gz (6.3 MB)
|████████████████████████████████| 6.3 MB 110 kB/s
Collecting qiskit-aer==0.5.2
Downloading qiskit-aer-0.5.2.tar.gz (10.3 MB)
|████████████████████████████████| 10.3 MB 60 kB/s
ERROR: Command errored out with exit status 1:
command: /data/data/com.termux/files/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-891uqs3t/qiskit-aer/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-891uqs3t/qiskit-aer/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-v59grdvz
cwd: /data/data/com.termux/files/usr/tmp/pip-install-891uqs3t/qiskit-aer/
Complete output (559 lines):
ERROR: Command errored out with exit status 1:
command: /data/data/com.termux/files/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/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 /data/data/com.termux/files/usr/tmp/pip-wheel-76sn2q3h
cwd: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/
Complete output (520 lines):
--------------------------------------------------------------------------------
-- Trying "Ninja" 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.
-- Configuring incomplete, errors occurred!
See also "/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying "Unix Makefiles" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is Clang 10.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is Clang 10.0.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Unix Makefiles" generator - success
--------------------------------------------------------------------------------
Configuring Project
Working directory:
/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build
Command:
cmake /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-install/cmake/data -DPYTHON_EXECUTABLE:FILEPATH=/data/data/com.termux/files/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.8.5 -DPYTHON_INCLUDE_DIR:PATH=/data/data/com.termux/files/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/data/data/com.termux/files/usr/lib/libpython3.8.so -DSKBUILD:BOOL=TRUE -DCMAKE_MODULE_PATH:PATH=/data/data/com.termux/files/usr/lib/python3.8/site-packages/skbuild/resources/cmake -DCMAKE_BUILD_TYPE:STRING=Release
-- The CXX compiler identification is Clang 10.0.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ***************************************************
-- Build CMake from source: ON
-- ***************************************************
-- SuperBuild - CMakeProject-src-download
-- SuperBuild - CMakeProject-src-download - URL: https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0.tar.gz
-- SuperBuild - CMakeProject-src-download - CMakeProject_SOURCE_DIR: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/src
-- SuperBuild - CMakeProject-build
-- SuperBuild - CMakeProject-build - CMakeProject_BINARY_DIR: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build
-- SuperBuild - CMakePythonDistributions
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
PYTHON_INCLUDE_DIR
PYTHON_LIBRARY
PYTHON_VERSION_STRING
SKBUILD
-- Build files have been written to: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build
Scanning dependencies of target CMakeProject-src-download
[ 3%] Creating directories for 'CMakeProject-src-download'
[ 6%] Performing download step (download, verify and extract) for 'CMakeProject-src-download'
-- Downloading...
dst='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/cmake-3.18.0.tar.gz'
timeout='none'
-- Using src='https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0.tar.gz'
-- [download 0% complete]
-- [download 100% complete]
-- [download 0% complete]
-- [download 1% complete]
...
-- [download 100% complete]
-- verifying file...
file='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/cmake-3.18.0.tar.gz'
-- Downloading... done
-- extracting...
src='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/cmake-3.18.0.tar.gz'
dst='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 9%] No update step for 'CMakeProject-src-download'
[ 12%] No patch step for 'CMakeProject-src-download'
[ 15%] No configure step for 'CMakeProject-src-download'
[ 18%] No build step for 'CMakeProject-src-download'
[ 21%] No install step for 'CMakeProject-src-download'
[ 24%] Completed 'CMakeProject-src-download'
[ 24%] Built target CMakeProject-src-download
Scanning dependencies of target LibUV
[ 27%] Creating directories for 'LibUV'
[ 30%] Performing download step (download, verify and extract) for 'LibUV'
-- Downloading...
dst='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-prefix/src/libuv-v1.23.0.tar.gz'
timeout='none'
-- Using src='https://dist.libuv.org/dist/v1.23.0/libuv-v1.23.0.tar.gz'
-- [download 0% complete]
-- [download 1% complete]
....
-- [download 98% complete]
-- [download 100% complete]
-- verifying file...
file='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-prefix/src/libuv-v1.23.0.tar.gz'
-- Downloading... done
-- extracting...
src='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-prefix/src/libuv-v1.23.0.tar.gz'
dst='/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'LibUV'
[ 36%] No patch step for 'LibUV'
[ 39%] Performing configure step for 'LibUV'
loading initial cache file /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/initial-cache.txt
loading initial cache file /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-prefix/tmp/LibUV-cache-Release.cmake
-- The C compiler identification is Clang 10.0.1
-- The CXX compiler identification is Clang 10.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-build
[ 42%] Performing build step for 'LibUV'
Scanning dependencies of target uv
[ 1%] Building C object CMakeFiles/uv.dir/src/fs-poll.c.o
[ 2%] Building C object CMakeFiles/uv.dir/src/inet.c.o
[ 4%] Building C object CMakeFiles/uv.dir/src/threadpool.c.o
[ 5%] Building C object CMakeFiles/uv.dir/src/timer.c.o
[ 7%] Building C object CMakeFiles/uv.dir/src/uv-common.c.o
[ 8%] Building C object CMakeFiles/uv.dir/src/uv-data-getter-setters.c.o
[ 10%] Building C object CMakeFiles/uv.dir/src/version.c.o
[ 11%] Building C object CMakeFiles/uv.dir/src/unix/async.c.o
[ 13%] Building C object CMakeFiles/uv.dir/src/unix/core.c.o
[ 14%] Building C object CMakeFiles/uv.dir/src/unix/dl.c.o
[ 16%] Building C object CMakeFiles/uv.dir/src/unix/fs.c.o
[ 17%] Building C object CMakeFiles/uv.dir/src/unix/getaddrinfo.c.o
[ 19%] Building C object CMakeFiles/uv.dir/src/unix/getnameinfo.c.o
[ 20%] Building C object CMakeFiles/uv.dir/src/unix/loop-watcher.c.o
[ 22%] Building C object CMakeFiles/uv.dir/src/unix/loop.c.o
[ 23%] Building C object CMakeFiles/uv.dir/src/unix/pipe.c.o
/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-src/src/unix/pipe.c:252:15: warning: comparison of integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 'unsigned int') [-Wsign-compare]
if (addrlen >= *size) {
~~~~~~~ ^ ~~~~~
1 warning generated.
[ 25%] Building C object CMakeFiles/uv.dir/src/unix/poll.c.o
[ 26%] Building C object CMakeFiles/uv.dir/src/unix/process.c.o
[ 27%] Building C object CMakeFiles/uv.dir/src/unix/signal.c.o
[ 29%] Building C object CMakeFiles/uv.dir/src/unix/stream.c.o
[ 30%] Building C object CMakeFiles/uv.dir/src/unix/tcp.c.o
[ 32%] Building C object CMakeFiles/uv.dir/src/unix/thread.c.o
[ 33%] Building C object CMakeFiles/uv.dir/src/unix/tty.c.o
[ 35%] Building C object CMakeFiles/uv.dir/src/unix/udp.c.o
[ 36%] Building C object CMakeFiles/uv.dir/src/unix/android-ifaddrs.c.o
[ 38%] Building C object CMakeFiles/uv.dir/src/unix/linux-core.c.o
[ 39%] Building C object CMakeFiles/uv.dir/src/unix/linux-inotify.c.o
[ 41%] Building C object CMakeFiles/uv.dir/src/unix/linux-syscalls.c.o
[ 42%] Building C object CMakeFiles/uv.dir/src/unix/procfs-exepath.c.o
[ 44%] Building C object CMakeFiles/uv.dir/src/unix/pthread-fixes.c.o
[ 45%] Building C object CMakeFiles/uv.dir/src/unix/sysinfo-loadavg.c.o
[ 47%] Building C object CMakeFiles/uv.dir/src/unix/sysinfo-memory.c.o
[ 48%] Building C object CMakeFiles/uv.dir/src/unix/proctitle.c.o
[ 50%] Linking C shared library libuv.so
[ 50%] Built target uv
Scanning dependencies of target uv_a
[ 51%] Building C object CMakeFiles/uv_a.dir/src/fs-poll.c.o
[ 52%] Building C object CMakeFiles/uv_a.dir/src/inet.c.o
[ 54%] Building C object CMakeFiles/uv_a.dir/src/threadpool.c.o
[ 55%] Building C object CMakeFiles/uv_a.dir/src/timer.c.o
[ 57%] Building C object CMakeFiles/uv_a.dir/src/uv-common.c.o
[ 58%] Building C object CMakeFiles/uv_a.dir/src/uv-data-getter-setters.c.o
[ 60%] Building C object CMakeFiles/uv_a.dir/src/version.c.o
[ 61%] Building C object CMakeFiles/uv_a.dir/src/unix/async.c.o
[ 63%] Building C object CMakeFiles/uv_a.dir/src/unix/core.c.o
[ 64%] Building C object CMakeFiles/uv_a.dir/src/unix/dl.c.o
[ 66%] Building C object CMakeFiles/uv_a.dir/src/unix/fs.c.o
[ 67%] Building C object CMakeFiles/uv_a.dir/src/unix/getaddrinfo.c.o
[ 69%] Building C object CMakeFiles/uv_a.dir/src/unix/getnameinfo.c.o
[ 70%] Building C object CMakeFiles/uv_a.dir/src/unix/loop-watcher.c.o
[ 72%] Building C object CMakeFiles/uv_a.dir/src/unix/loop.c.o
[ 73%] Building C object CMakeFiles/uv_a.dir/src/unix/pipe.c.o
/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-src/src/unix/pipe.c:252:15: warning: comparison of integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 'unsigned int') [-Wsign-compare]
if (addrlen >= *size) {
~~~~~~~ ^ ~~~~~
1 warning generated.
[ 75%] Building C object CMakeFiles/uv_a.dir/src/unix/poll.c.o
[ 76%] Building C object CMakeFiles/uv_a.dir/src/unix/process.c.o
[ 77%] Building C object CMakeFiles/uv_a.dir/src/unix/signal.c.o
[ 79%] Building C object CMakeFiles/uv_a.dir/src/unix/stream.c.o
[ 80%] Building C object CMakeFiles/uv_a.dir/src/unix/tcp.c.o
[ 82%] Building C object CMakeFiles/uv_a.dir/src/unix/thread.c.o
[ 83%] Building C object CMakeFiles/uv_a.dir/src/unix/tty.c.o
[ 85%] Building C object CMakeFiles/uv_a.dir/src/unix/udp.c.o
[ 86%] Building C object CMakeFiles/uv_a.dir/src/unix/android-ifaddrs.c.o
[ 88%] Building C object CMakeFiles/uv_a.dir/src/unix/linux-core.c.o
[ 89%] Building C object CMakeFiles/uv_a.dir/src/unix/linux-inotify.c.o
[ 91%] Building C object CMakeFiles/uv_a.dir/src/unix/linux-syscalls.c.o
[ 92%] Building C object CMakeFiles/uv_a.dir/src/unix/procfs-exepath.c.o
[ 94%] Building C object CMakeFiles/uv_a.dir/src/unix/pthread-fixes.c.o
[ 95%] Building C object CMakeFiles/uv_a.dir/src/unix/sysinfo-loadavg.c.o
[ 97%] Building C object CMakeFiles/uv_a.dir/src/unix/sysinfo-memory.c.o
[ 98%] Building C object CMakeFiles/uv_a.dir/src/unix/proctitle.c.o
[100%] Linking C static library libuv_a.a
[100%] Built target uv_a
[ 45%] Performing install step for 'LibUV'
[ 50%] Built target uv
[100%] Built target uv_a
Install the project...
-- Install configuration: "Release"
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/os390.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/android-ifaddrs.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/tree.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/darwin.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/pthread-barrier.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/version.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/unix.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/errno.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/linux.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/aix.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/stdint-msvc2008.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/bsd.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/sunos.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/threadpool.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/posix.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/include/uv/win.h
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/share/doc/libuv/LICENSE
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/lib/pkgconfig/LICENSE
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/lib/pkgconfig/libuv.pc
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/lib/libuv.so
-- Installing: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/LibUV-install/lib/libuv_a.a
[ 48%] Completed 'LibUV'
[ 48%] Built target LibUV
Scanning dependencies of target CMakeProject-build
[ 51%] Creating directories for 'CMakeProject-build'
[ 54%] No download step for 'CMakeProject-build'
[ 57%] No update step for 'CMakeProject-build'
[ 60%] No patch step for 'CMakeProject-build'
[ 63%] Performing configure step for 'CMakeProject-build'
loading initial cache file /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/initial-cache.txt
loading initial cache file /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build-prefix/tmp/CMakeProject-build-cache-Release.cmake
-- The C compiler identification is Clang 10.0.1
-- The CXX compiler identification is Clang 10.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++
-- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ - broken
CMake Error at /data/data/com.termux/files/usr/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler
"/data/data/com.termux/files/usr/bin/c++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp
Run Build Command(s):/data/data/com.termux/files/usr/bin/make cmTC_793bc/fast && make[3]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp'
/data/data/com.termux/files/usr/bin/make -f CMakeFiles/cmTC_793bc.dir/build.make CMakeFiles/cmTC_793bc.dir/build
make[4]: Entering directory '/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_793bc.dir/testCXXCompiler.cxx.o
/data/data/com.termux/files/usr/bin/c++ -g -o CMakeFiles/cmTC_793bc.dir/testCXXCompiler.cxx.o -c /data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_793bc
/data/data/com.termux/files/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_793bc.dir/link.txt --verbose=1
/data/data/com.termux/files/usr/bin/c++ -g -static-libstdc++ -static-libgcc -lrt CMakeFiles/cmTC_793bc.dir/testCXXCompiler.cxx.o -o cmTC_793bc
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: cannot find -lc++_shared
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [CMakeFiles/cmTC_793bc.dir/build.make:106: cmTC_793bc] Error 1
make[4]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp'
make[3]: *** [Makefile:140: cmTC_793bc/fast] Error 2
make[3]: Leaving directory '/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeTmp'
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
-- Configuring incomplete, errors occurred!
See also "/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeOutput.log".
See also "/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build/CMakeProject-build/CMakeFiles/CMakeError.log".
make[2]: *** [CMakeFiles/CMakeProject-build.dir/build.make:131: CMakeProject-build-prefix/src/CMakeProject-build-stamp/CMakeProject-build-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:130: CMakeFiles/CMakeProject-build.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 589, in setup
cmkr.make(make_args, env=env)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/skbuild/cmaker.py", line 496, in make
raise SKBuildError(
An error occurred while building with CMake.
Command:
cmake --build . --target install --config Release --
Source directory:
/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake
Working directory:
/data/data/com.termux/files/usr/tmp/pip-wheel-3e9istkf/cmake/_skbuild/linux-armv8l-3.8/cmake-build
Please see CMake's output for more information.
----------------------------------------
ERROR: Failed building wheel for cmake
ERROR: Failed to build one or more wheels
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
subprocess.check_call(cmd)
File "/data/data/com.termux/files/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/data/data/com.termux/files/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/data/data/com.termux/files/usr/tmp/tmp1hbw_d_z', '--quiet', 'cmake!=3.17,!=3.17.0']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/data/data/com.termux/files/usr/tmp/pip-install-891uqs3t/qiskit-aer/setup.py", line 56, in <module>
setup(
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 468, in setup
return upstream_setup(*args, **kw)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/dist.py", line 695, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 781, in resolve
dist = best[req.key] = env.best_match(
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
return fetch_build_egg(self, req)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e))
distutils.errors.DistutilsError: Command '['/data/data/com.termux/files/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/data/data/com.termux/files/usr/tmp/tmp1hbw_d_z', '--quiet', 'cmake!=3.17,!=3.17.0']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Is there any way how to get Qiskit running on my mobile?
"
"['quantum-gate', 'programming', 'error-correction', 'quantum-operation']"," Title: What is the certain error rate in a quantum channel?Body: Quantum error correction is a fundamental aspect of quantum computation. I have read some material about "Quantum Channel" and "Quantum error correction".
I have known the formula of gate error which has close relationship with decoherence time. However, no one tell me what is the certain probability of each error is reliable or what is the exact possibility in real environment.
For example, in depolarizing channel, each error can be approximated into pauli error, which is X,Y,Z error with their own possibility $p_x$,$p_y$ and $p_z$. So is that a certain scale of possibility (just for example, $1\%<p_x<10\%$) of each error is reliable or something close to that?
"
"['quantum-gate', 'matrix-representation']"," Title: How to make Toffoli gate using matrix form in multi qubits system?Body: I wonder that there is generalized form to make Toffoli gate in multi-qubits system even if the two control qubits and one target qubit are not adjacent. In Wikipedia there is one way to make Toffoli gate with Hadamard, T gate and CNOTs, but I want to know how to make it for any case (i.e generalized version).
"
['quantum-fourier-transform']," Title: How to apply QFT to a quantum state in superposition?Body: Given the following quantum state:
$\frac{1}{2}(|0000\rangle + |0100\rangle + |1000\rangle + |1100\rangle)$
How do I apply a QFT (given by the formula below) to that state in superposition?
$QFT_n|j\rangle = \frac{1}{\sqrt{N}}\sum_{k=0}^{N-1}\omega_{N}^{j \times k} |k\rangle$ where $N = 2^n$
"
"['resource-request', 'hhl-algorithm', 'quantum-enhanced-machine-learning']"," Title: Comparison of matrix inversion algorithmsBody: Since 2009, many matrix inversion algorithms have appeared.
Is there somewhere a table, or recently released overview, comparing the speed of matrix inversion algorithms, like done in this table taken from Shao comparing different algorithms for quantum state preparation?
"
"['qiskit', 'measurement', 'error-mitigation']"," Title: Error mitigation matrix as backend property: Are any ""reliable"" mitigation matrices publicly available?Body: Given that the error mitigation matrix (meas_fitter.filter) does not vary so much for a given backend and number of qubits, then what are the advantages and disadvantages in the determination of the calibration matrix each time that we do an experiment and mitigate its error? Is any reliable error mitigation matrix available for us to use without having to calculate it ourselves? Thanks.
"
"['algorithm', 'complexity-theory', 'clifford-group']"," Title: How do I check if a gate represented by Unitary $U$ is a Clifford Gate?Body: The Gottesman–Knill theorem states that stabilizer circuits, circuits that only consist of gates from Clifford group, can be perfectly simulated in polynomial time on a probabilistic classical computer. Clifford Gates are hence extremely useful in Quantum Computing.
Is there a way to identify if an arbitrary Unitary $U$ of size $2^n \times 2^n$ is a Clifford Gate.
If such an algorithm(s) exists, what is the best computational complexity achieved thus far? Are there lower bounds on this problem?
"
"['qiskit', 'resource-request']"," Title: Where can I find the Qiskit tutorial as a pdf?Body: A documentation of Qiskit language is provided on qiskit.org/documentation/. However, this is an on-line source and sometimes I would apprecite to have an off-line version at hand.
My questions are:
- Is it possible to download the documentation I mentioned above in PDF? Or is it available somewhere?
- Could you please recommend me any other Qiskit textbook for beginers in Qiskit?
"
"['quantum-state', 'mathematics', 'bloch-sphere']"," Title: Why an element of SU(2) acts as a rotation for Majorana representation of states?Body: I know that for a given spin-j quantum state, say $\vert\psi\rangle = (\psi_0 , \psi_1 , \cdots , \psi_{2j})$, we can construct a polynomial as follows
$
w(z) = \sum_{k = 0}^{2j} (-1)^k \psi_k \sqrt{\binom{2j}{k} } z^{2j-k}
$
and by means of the inverse stereographic projection of the roots of $w(z)$, the Majorana's representation of $\vert\psi\rangle$ is obtained on sphere. I also know that the Majorana's representation for the eigen-state of $\mathbf{J.n}$ operator with eigen-value $m$ is the configuration of points on sphere in which there are $j+m$ points in the $\mathbf{n}$ direction and other $j-m$ points in the antipodal point (equivalently $-\mathbf{n}$ direction).
My question is why the Majorana's representation of $e^{i\mathbf{n.J} \theta} \vert \psi \rangle$ is just that of $\vert\psi\rangle$ rotated around $\mathbf{n}$ by an angle of $\theta$? (This is transparent when $\vert \psi \rangle$ is an eigen-vector of angular momentum in some direction but I do not see why this is true in general.)
Thank you
"
"['quantum-state', 'entanglement']"," Title: Are all pure entangled states `robust'?Body: Let $\mathcal{H}_A \otimes \mathcal{H}_B$ be the tensor product of two finite dimensional Hilbert spaces, let $d = \operatorname{dim}(\mathcal{H}_A \otimes \mathcal{H}_B)$ and let $| \psi \rangle \in \mathcal{H}_A \otimes \mathcal{H}_B$ be a pure entangled state.
We say the entanglement in $| \psi \rangle$ is $\epsilon_0$-robust, for some $\epsilon_0 \in [0,1]$, if $ (1-\epsilon) | \psi \rangle \langle \psi | + \epsilon \, \mathbb{I}/d$ is entangled for all $\epsilon \in [0, \epsilon_0]$. More generally we say the entanglement in $| \psi \rangle$ is completely $\epsilon_0$-robust if $ (1-\epsilon) | \psi \rangle \langle \psi | + \epsilon \, \tau$ is entangled for all $\epsilon \in [0, \epsilon_0]$ and all states $\tau$ on $\mathcal{H}_A \otimes \mathcal{H}_B$.
Are there any pure entangled states that are not $\epsilon_0$-robust (or completely $\epsilon_0$-robust) for all $\epsilon_0 > 0$?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: My Bloch sphere/ qsphere is appearing as an ellipse/ovalBody: I tried to plot a Bloch vector. However, my Bloch sphere is appearing as an ellipse/oval instead of a circle. I am having the same issues with qsphere also.
instead of
from qiskit.visualization import plot_bloch_vector
%matplotlib inline
plot_bloch_vector([0,1,0], title="New Bloch Sphere")
"
"['qiskit', 'programming', 'error-correction']"," Title: Is it possible to implement c_if statement based on a measurement in a single specified classical bit in qiskit?Body: I'm trying to write a 1-bit teleportation error correction code and there is one part in it where I need to add a gate that's dependent on a measurement from earlier in the circuit. The measurement is stored on a single classical bit, and I'm trying to use c_if to apply the gate based on the measurement result of that bit.
Intuitively I would think this could be written as: qc.h(q[0]).c_if(c[3], 1) but that only returns an error while qc.h(q[0]).c_if(c, 1) gives no error (though it doesn't give the result I'm looking for). Is there a way to link c_if to a single classical bit instead of the classical register?
This question is similar and the answer seems to imply that it isn't possible to use c_if this way.
If c_if can't do this, would something like what they mentioned in their question: if(c[3]==1) qc.h(q[0]) work in qiskit? For my purposes the operation needs to be integrated into the circuit, so if it does work would the gate be applied automatically?
"
"['quantum-state', 'measurement', 'matrix-representation']"," Title: What is the matrix for measuring a superposition of general number of qubits in standard basis?Body: Let's say I have the state of the system of 2 qubits: $\frac{1}{\sqrt{3}}|00\rangle+\frac{2}{\sqrt{3}}|10\rangle$, and I want to measure it in the standard basis. How would I write it mathematically? What is the $n$ number of qubits version of it?
"
"['quantum-state', 'correlations', 'many-body-systems']"," Title: Quantum Ising model correlation function queryBody: In this paper on quantum Ising model dynamics, they consider the Hamiltonian
$$\mathcal{H} = \sum_{j < k} J_{jk} \hat{\sigma}_{j}^{z}\hat{\sigma}_{k}^{z}$$
and the correlation function
$$\mathcal{G} = \langle \mathcal{T}_C(\hat{\sigma}^{a_n}_{j_n}(t_n^*)\cdot\cdot\cdot \hat{\sigma}^{a_1}_{j_1}(t_1^*)\hat{\sigma}^{b_m}_{k_m}(t_m) \cdot\cdot\cdot \hat{\sigma}^{b_1}_{k_1}(t_1)) \rangle$$
where $a,b= \pm$ and the time dependence of the Heisenberg picture
$$\hat{\sigma}_{j}^{a}(t) = e^{it\mathcal{H}}\hat{\sigma}_{j}^{a}e^{-it\mathcal{H}}$$
where the time ordering operator $\mathcal{T_C}$ orders operators along a closed path $\mathcal{C}$.
Question:
Can anyone see the reasoning behind the subsequent statement on page 6:
If an operator $\hat{\sigma}^{a=\pm}_{j}$ occurs in $\mathcal{G}$ one or more times, the operator $\hat{\sigma}^{z}_{j}$ (appearing in the time evolution operator) is forced to take on a well defined value $\sigma_{j}^{z}(t)$ at all points in time.
I understand why it would be well-defined for all times after $t_1$ (denoting the first occurrence of the operator $\hat{\sigma}^{a=\pm}_{j}$) since this results in the state on site $j$ being an eigenstate of $\hat{\sigma}_{j}^{z}$, hence it commutes with the Ising Hamiltonian above. But surely before $t_1$ the state on site $j$ could be in any spin orientation and hence would be affected by the Ising interaction?
Thanks for any assistance.
"
"['qiskit', 'programming', 'vqe']"," Title: Suppress deprecation warnings from QiskitBody: I am running a standard VQE from the example shown in here https://qiskit.org/textbook/ch-applications/vqe-molecules.html, however I keep getting this output constantly (as many times the vqe runs which is a lot).
DeprecationWarning: The Python built-in `round` is deprecated for complex scalars,
and will raise a `TypeError` in a future release. Use `np.round` or `scalar.round`
instead.
is there any way to suppress this without suppressing the entire python terminal as I need the output for other things.
"
"['programming', 'q#']"," Title: Is there a Q# funtion which returns the type of a variable?Body: As the title says, I am asking myself is there is a specific function which returns the type of something. Ideally, I would work as follows :
let a = 4.0;
Message(Type(a));
This would print :
double
Is there anything similar to this ? I tried to look at the api, but didn't find anything, I could definitely have missed something there.
"
"['programming', 'q#']"," Title: Usage of partial application in Q#Body: I am working with multiple operations and used partial application in different cases in Q#. I have 2 questions :
- Can a partial applicated operation be passed as an argument ?
- Lets say you have an operation with 3 parameters. Can you first fill one argument, store it, fill another argument, store it, and then finally call the operation by filling the last argument ?
Of course, I you need clarifications, I will comment and edit appropriately. Thanks for reading !
"
['quantum-gate']," Title: The results of Toffoli gate are quite different from those of simulationBody:
The simulation result is 111, but the actual result is 000 001 010 011 100 101 110 111
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: Calculating gradient of a gate using Parameter shift ruleBody: I've been following this website to check out how parameter-shift works for calculation of gradients for backpropagation in Variational Quantum Machine Learning Circuits
Most of it made makes sense until I got to the example part where they started explaining how one could calculate the gradient in case of a Pauli gate:
$$ U_i(\theta_i) = exp(-i\frac{\theta_i}{2}\hat P_i) $$
The Gradient of this unitary is:
$$ \nabla_{\theta_i}U_i(\theta_i) = -\frac{i}{2}\hat P_i U_i(\theta_i) = -\frac{i}{2}U_i(\theta_i)\hat P_i $$
which makes sense, the problem starts with the following sentence:
Substituting this into the quantum circuit function $f(x;\theta_i)$, we get:
$$ \nabla_{\theta_i}f(x;\theta) = \frac{i}{2} \langle \psi_{i-1}|U_i^{\dagger}(\theta_i)(P_i \hat B_{i+1} - \hat B_{i+1}P_i)U_i(\theta_i)|\psi_{i-1}\rangle$$
where $f(x;\theta)$ was given by the following:
$$ \langle 0 | U_0^{\dagger}(x)U_i^{\dagger}(\theta_i)\hat BU_i(\theta_i)U_0(x)|0\rangle$$
Now I have no idea how that came to be, what am I missing?
"
"['qiskit', 'grovers-algorithm']"," Title: Grover search with different diffusion operatorsBody: I was reading about the Grover Search algorithm on https://qiskit.org/textbook/ch-algorithms/grover.html#example. I understood the method but I have a few questions. My question regards the two-qubit case.
Does the diffusion operator $D=2|s\rangle\langle s|-1$, depend upon the initial state i.e $|+\rangle|+\rangle$ and the marked state?
Actually I was reading an article https://journals.aps.org/pra/pdf/10.1103/PhysRevA.68.022306, which had an equation
\begin{equation}
-U_{S_j}|S_j\rangle_{w}=|w\rangle
\end{equation}
with $U_x=1-2|x\rangle\langle x|$, $S_1=\left(\dfrac{0+1}{\sqrt{2}}\right)^{\otimes 2}$, and $w$ is the marked state. The other $S_{j's}$ can be the states for instance $|+\rangle|-\rangle$, $|-\rangle|-\rangle$, $|-\rangle|+\rangle$ etc. with total such $S_j$ being $16$. My question is how does one make the diffusion operator for a state $|+\rangle|-\rangle$. As an example from the table in the article it states for instance if $j=2$, $S_2=|+\rangle|-\rangle$
$$-U_{S_2}|S_1\rangle_{10}=-|00\rangle,$$
where $10=w$ is the marked state.
Can somebody explain how this equation came? can somebody atleast hint at some references?
"
"['entanglement', 'density-matrix', 'bloch-sphere']"," Title: Reduced Density Matrix Equation of Motion to describe an EllipseBody: Given a pure two qubit state $|\psi_{AB}\rangle$. If we trace out system $B$, the remaining density matrix $\rho_A = Tr_B|\psi_{AB}\rangle\langle\psi_{AB}|$, can be represented as a point lying anywhere on or inside a Blochsphere.
When you're on the Bloch sphere you have a separable state; when you're in the center, your state is maximally entangled. So by entanglement you can affect the distance from the center.
How do have to steer (by applying timevarying unitaries $U(t)$) the composite system $|\psi_{AB}\rangle$, such that the resulting trajectory on or inside the Bloch sphere of system $A$ is an ellipse?
$$
\rho_A(t)=Tr_B \left( U(t)|\psi_{AB}\rangle\langle\psi_{AB}|U'(t)\right) \sim\pmatrix{x(t)\\y(t)\\z(t)}_{\text{Bloch}_A} \text{ with } \frac{x^2(t)}{a^2}+\frac{y^2(t)}{b^2}=1
$$
"
"['quantum-gate', 'fidelity', 'gate-fidelity']"," Title: What does quantum gate fidelity mean?Body: The formal definition states that it's the distance between two quantum states. What does that mean experimentally? Does distance here mean the distance between two states on the Bloch Sphere? I am a little confused about the meaning of gate fidelity.
"
"['quantum-gate', 'quantum-state', 'noise']"," Title: How does noise affect the implementation of quantum gates?Body: I am trying to think about quantum noise visually here. If, for example, one wants to implement an X-gate to perform a 180-degree rotation around the Bloch Sphere. In a perfect world, the X-gate will move the quantum state from the |0> state to the |1> state.
My question is, how does the existence of noise affect the implementation of gates (i.e. the X-gate)?
Does it make the quantum state rotate some angle that's is slightly greater than or smaller than 180 degrees? In short, how can one visualize noise on the Bloch Sphere?
"
"['programming', 'q#']"," Title: How can I mesure a register of qubits and grab the index of the qubit with the highest probability in Q#?Body: I have an array of qubits, with indices to represent each such that if we have 3 qubits, we have 0, 1, 2 representing each. From here I would like to measure the probability of our qubits after running it through some gates. How can I grab these probabilities and spit out one of the indices based on which has the highest probability?
Cheers!
"
"['quantum-gate', 'quantum-state', 'physical-realization', 'physical-qubit', 'ibm']"," Title: How do you CNOT between qubits faraway from each other?Body: I'm just curious. Say I have 3 qubits on a straight line 0-1-2. How do you guys (on the IBMQ or Rigetti team for example, or anyone who actually works on quantum computer) entangle 0-2 if I, say, am busy on the 1 qubit already (maybe I already have a CNOT between 0-1)? Is there a circuit for it, or is it purely hardware technique with no circuit equivalent? Say if I have:
2-1-0-3
| |
4-5
would it be better to CNOT 0 with 2, or 0 with 5, given that they have the same distance? Thank you!
"
"['quantum-state', 'qiskit', 'programming', 'ibm', 'initialization']"," Title: Qiskit: Initializing $n$ qubits with binary values ($0$s and $1$s)Body: Is there a way in Qiskit to initialize $n$ qubits with binary values (0s and 1s)? For example, how can I initialize two qubits in the state $|11\rangle$? Here is a code snippet:
from qiskit import QuantumCircuit
import numpy as np
n = 2
circuit = QuantumCircuit(n, n)
# Seeking some sort of initialization routine like this
circuit.initializeQubits(initialState=np.ones(n), ...)
# Define rest of the circuit
...
I am aware of the method in this tutorial, which is also referenced here and here. This method creates an arbitrary qubit state by defining an $N$ dimensional ($N = 2^n$) state vector of amplitudes. The problem with this method is it requires creating a state vector which is exponentially large. I'm trying to initialize the qubits by defining an $n$ dimensional binary vector, which for the above example would be [1, 1].
"
"['ibm-q-experience', 'measurement', 'error-correction', 'physical-realization', 'ibm']"," Title: Dose Quantum threshold theorem apply to IBM Quantum ExperienceBody: According to Quantum threshold theorem, error rate can be arbitrarily low. But when I use IBM Quantum Experience to measure a simple $|+\rangle$, it gives result of $|1\rangle$ with probability of 52.148%.
"
"['density-matrix', 'partial-trace']"," Title: Is the partial trace $\mathrm{Tr}_B(\rho)$ equal to $\sum_k \mathrm{Tr}[(\sigma_k\otimes I)^\dagger \rho]\sigma_k$?Body: Assume a composite quantum systes with state $|\psi_{AB}\rangle$ or better $\rho=|\psi_{AB}\rangle\langle\psi_{AB}|$. I want to know the state of system $A$ only, i.e. $\rho_A$.
Is there any difference if I trace out system $B$, i.e. $\rho_A=Tr_B\rho$ compared to building up $\rho_A$ from projections on the Pauli operators, i.e. $\displaystyle\rho_A=\sum_{k=1,x,y,z}Tr\big((\sigma_k\otimes 1\big)^\dagger \rho)\sigma_k$.
Some numerics indicate, that this is the same...
"
"['quantum-gate', 'partial-trace']"," Title: Can SWAP operators change trace of a product state?Body: I am currently reading https://arxiv.org/abs/1501.03099.
In the third part of the paper, "Measuring and detecting quantumness", the authors define the SWAP operators, use them on the initial state $\rho_a \otimes \rho_a \otimes \rho_b\otimes \rho_b $ and take the trace.
Now, I know that $\mathrm{Tr}(\rho_a \otimes \rho_b)$ = $\mathrm{Tr}(\rho_a)\mathrm{Tr}(\rho_b)$ according to the property of the Trace operator on a product state.
Does this mean that the SWAP operator acting on these two qubits must also preserve the trace?
Therefore if my interpretation is correct, I have two questions regarding this.
- Why would the SWAP operator $S_{CD}$ change the whole system state as the states of the qubits C and D are the same in equation (12)?
- How is the trace in equations (12) and (13) different if the SWAP operators must preserve trace? And how do these equations hold?
"
"['applications', 'boson-sampling']"," Title: What are known applications of quantum sampling?Body: I'm inspired by [1] which clearly lays out near term applications of quantum computing: optimization, simulation and sampling. They claim that quantum sampling is likely to be the first application that achieves quantum supremacy "Our calculations show that, for relatively small circuits involving high-fidelity quantum gates, it will be possible to sample from probability distributions that are inaccessible classically, using a circuit of just 7 × 7 qubits in layers that are around 25 deep"
However, the authors only loosely describe potential applications of quantum sampling, viz. "inference and pattern recognition in machine learning". Can anyone describe the utility of quantum sampling in further depth?
[1] Mohseni, M., Read, P., Neven, H., Boixo, S., Denchev, V., Babbush, R., ... & Martinis, J. (2017). Commercialize quantum technologies in five years. Nature, 543(7644), 171-174.
"
"['programming', 'q#', 'superposition']"," Title: Testing superposition states in Q#Body: I am learning Q# so, as I often do, I am writing some unit tests to play with quantum gates.
I was able to write these tests for X gate:
@Test("QuantumSimulator")
operation XGateAppliedToZeroShouldTransformIntoOne() : Unit {
using (q = Qubit()) {
X(q);
Assert([PauliZ], [q], One, "X gate transform |0> state in |1> state.");
X(q);
Assert([PauliZ], [q], Zero, "X gate transform |1> state in |0> state.");
}
Message("Test passed.");
}
I am wondering how to write similar tests for the H gate: from what I know it will put the system in a superposition state that will give me 0 or 1 with a probability of 50%. How can I test an expected probability? Am I completely in the wrong direction here?
"
['mathematics']," Title: Alternative derivation of $P(\text{First qubit}=0)$ for the swap testBody: I'm trying to derive $P(\text{First qubit}=0) = \frac{1}{2} + \frac{1}{2}|⟨a|b⟩|^2$ for the swap test.
The wiki page shows one way, but the result should also be obtainable via direct expansion of the tensor products, as attempted here. Present question is about bringing this process to completion as I — rather disappointingly — wasn't able to finish the proof myself.
To summarize the thought process (adapted from here), let's assume we start out with:
$$
|a \rangle = a_0 |0\rangle + a_1 |1\rangle \\
|b \rangle = b_0 |0\rangle + b_1 |1\rangle \\
|\phi_0 \rangle = |0 \rangle |a \rangle |b \rangle
$$
Applying $H$ to $|\phi_0\rangle$, we get:
$$
|\phi_1 \rangle = H|0\rangle|a\rangle|b\rangle = \frac{1}{\sqrt{2}}|0\rangle|a\rangle|b\rangle + \frac{1}{\sqrt{2}}|1\rangle|a\rangle|b\rangle
$$
Applying the swap, we get:
$$
|\phi_2 \rangle = \frac{1}{\sqrt{2}}|0\rangle|a\rangle|b\rangle + \frac{1}{\sqrt{2}}|1\rangle|b\rangle|a\rangle
$$
Applying the second H, we get:
$$
|\phi_3 \rangle = H|\phi_2\rangle = \\
\frac{1}{2}|0\rangle|a\rangle|b\rangle + \frac{1}{2}|1\rangle|a\rangle|b\rangle + \frac{1}{2}|0\rangle|b\rangle|a\rangle - \frac{1}{2}|1\rangle|b\rangle|a\rangle =
$$
$$
\frac{1}{2}|0\rangle \left[|a\rangle|b\rangle + |b\rangle|a\rangle\right] + \frac{1}{2}|1\rangle \left[|a\rangle|b\rangle - |b\rangle|a\rangle \right] \tag{1}\label{1}
$$
If we want to calculate $P(\text{First qubit}=0)$, then the interesting quantity from $|\phi_3\rangle$ is the first term of \eqref{1}:
$$
\frac{1}{2}|0\rangle \left[|a\rangle|b\rangle + |b\rangle|a\rangle\right]
= \\
\frac{1}{2} \left[
2 a_0 b_0 |0,0\rangle
+ \left( a_0 b_1 + a_1 b_0 \right) |0,1\rangle
+ \left( a_0 b_1 + a_1 b_0 \right) |1,0\rangle
+ 2 a_1 b_1 |1,1\rangle
\right] =
$$
$$
a_0 b_0 |0,0\rangle
+ \frac{1}{2} \left( a_0 b_1 + a_1 b_0 \right) |0,1\rangle
+ \frac{1}{2} \left( a_0 b_1 + a_1 b_0 \right) |1,0\rangle
+ a_1 b_1 |1,1\rangle \tag{2}\label{2}
$$
Where I used:
$$
|a \rangle |b \rangle =
a_0 b_0 |0,0\rangle
+ a_0 b_1 |0,1\rangle
+ a_1 b_0 |1,0\rangle
+ a_1 b_1 |1,1\rangle
\\
|b \rangle |a \rangle =
a_0 b_0 |0,0\rangle
+ a_1 b_0 |0,1\rangle
+ a_0 b_1 |1,0\rangle
+ a_1 b_1 |1,1\rangle
$$
Squaring the amplitudes from \eqref{2}, we get:
$$
|a_0 b_0|^2
+ \frac{1}{4} | a_0 b_1 + a_1 b_0 |^2
+ \frac{1}{4} | a_0 b_1 + a_1 b_0 |^2
+ |a_1 b_1|^2 =
$$
$$
|a_0 b_0|^2
+ \frac{1}{2} | a_0 b_1 + a_1 b_0 |^2
+ |a_1 b_1|^2 \tag{3}\label{3}
$$
I'm trying to prove that \eqref{3} equals $\frac{1}{2} + \frac{1}{2}|⟨a|b⟩|^2$ but I could not.
I tried using:
EDIT: The following equations do not hold, as explained by C. Kang in the answers.
$$
|\langle a| b \rangle|^2 =
\langle a| b \rangle\langle a| b \rangle^\dagger =
\langle a| b \rangle\langle b| a \rangle =
\langle b| \langle a| b \rangle |a\rangle =
|a_0 b_0|^2 + |a_1 b_0|^2 + |a_0 b_1|^2 + |a_1 b_1|^2
$$
$$
|a_0 b_0|^2 + |a_1 b_1|^2 = |\langle a| b \rangle|^2 - |a_1 b_0|^2 - |a_0 b_1|^2 \tag{4}\label{4}
$$
Substituting \eqref{4} into \eqref{3}, I got:
$$
|\langle a| b \rangle|^2 - |a_1 b_0|^2 - |a_0 b_1|^2 + \frac{1}{2} | a_0 b_1 + a_1 b_0 |^2
$$
But I'm not sure how to turn this into $\frac{1}{2} + \frac{1}{2}|⟨a|b⟩|^2$. Any thoughts?
"
"['qiskit', 'programming']"," Title: provider.backends( ) not responding in Qiskit?Body:
please in need some help I want to get a list of the providers in Qiskit and i use the command providers.backends() yet it says provider not defined. any suggestions.
thank you
"
['grovers-algorithm']," Title: Can we use different oracles for each (extended) Grover iteration?Body: Within the context of Grover's algorithm, if there are $N/4$ elements marked instead of just one ($N = 2^n$) , if we run one iteration of Grover's algorithm (one phase inversion and one inversion about the mean ) and then measure, the probability that we see a marked element is 1 (simple calculation).
I propose the following extension.
The extension of Grover's algorithm.
First iteration. We use an oracle that marks $2^{n-2} - 1$ elements (chosen at random or otherwise) plus the element x* that we are interested in. We run one iteration of Grover and we end up with a superposition of $2^{n-2}$ marked states including x*.
Second iteration. We use another oracle that marks $2^{n-4}-1$ elements (from the $2^{n-2}-1$ above) and x*. We run another Grover iteration and we end up with a superposition of $2^{n-4}$ marked states including x*.
And so on..........
At the k-th step we use an oracle that marks $ 2^{n-2k}-1$ elements and x* and we end up with a superposition of
$2^{n-2k}$ marked states, including x*.
We continue this process for about O(log N ) = O(n) steps. The difference is that at each iteration we use a different oracle.
At the end, when we measure we will find x* with high probability.
If correct (big IF here ) this would be an exponential speedup compared to Grover.
Question. What am I missing here? Is implementation possible?
"
"['quantum-gate', 'error-correction', 'quantum-operation', 'fault-tolerance']"," Title: How is it not a contradiction that it is possible to build fault tolerant circuits with strictly contractive (e.g.: depolarizing noise) channels?Body: This paper discusses strictly contractive channels, i.e. channels that strictly decrease the trace distance between any two input quantum states.
It is shown that if a quantum circuit is composed of rounds of gates followed by strictly contractive channels then the trace distance between any two input states would decay exponentially with circuit depth, which means we would not be able to distinguish outputs corresponding to any two different inputs.
In light of this, how is it even possible to build any kind of fault-tolerant circuit which is capable of "arbitrarily long" computations, given that the standard noise model, the depolarizing channel, is strictly contractive?
"
"['quantum-state', 'noise']"," Title: Is spontaneous excitation possible?Body: I know the $|1\rangle$ state can relax spontaneously to the $|0\rangle$ state, but can the opposite also happen?
"
"['nielsen-and-chuang', 'textbook-and-exercises', 'entropy']"," Title: Proof of quantum data processing inequality in N&C on pg 566Body: On page 566, it states that using $S(\rho^{'})-S(\rho,\varepsilon) \ge S(\rho)$ and combining this with $S(\rho) \ge S(\rho^{'})-S(\rho,\varepsilon))$, we get $S(\rho^{'})=S(\rho)-S(\rho,\varepsilon)$. I can see no way in which this case holds, as by subbing this back in you'd end up getting either $S(\rho)-2S(\rho,\varepsilon) \ge S(\rho)$ or $S(\rho) \ge S(\rho)-2S(\rho,\varepsilon)$
The first inequality should never hold, with equality only when $S(\rho,\varepsilon)=0$, and the second should hold, but contradicts the first.
This is meant to be a way to show the necessity of $S(\rho)=S(\rho^{'})-S(\rho,\varepsilon)$
If feel like it should actually be $S(\rho^{'})=S(\rho)+S(\rho,\varepsilon))$, as subbing this back in gives equality in the two cases I stated, which is what you want to show. But I am assuming here that the book is right and I am wrong, so where am I going wrong?
"
"['qiskit', 'programming']"," Title: Can a Qubit belong to 2 different registers?Body: I'm starting with Qiskit in Python.
My question is regarding to have registers and sub-register. Something like this
axreg=QuantumRegister(4,name='ax')
ahreg=QuantumRegister(axreg[:2],name='ah')
alreg=QuantumRegister(axreg[2:],name='al')
The constructor of QuantumRegister has only the number of qubits to create, and I find no way to add previously existing qubit to other register
"
"['teleportation', 'postselection']"," Title: Post-selection applied to quantum teleportationBody: In this answer, it is stated that applying post-selection to quantum teleportation results in Alice communicating to Bob backwards in time. Could someone explain how this works?
I am particularly confused by how Alice decides what to post-select on. For example, if she wanted to teleport
$$\newcommand{\ket}[1]{\lvert #1\rangle}\ket{-} = \frac{1}{\sqrt{2}}(\ket{0}-\ket{1})$$
then she could not post select on $\ket{00}$ because the amplitude of this state in the first two qubits would be zero.
So, it seems like what state she post-selects on depends on what state she wants to teleport. This means she needs to tell Bob what state she is going to post-select on after deciding what state to send him. This seems equivalent to sending him the two classical bits in the usual quantum teleportation.
What am I missing here?
"
"['quantum-state', 'qiskit', 'programming', 'q#']"," Title: What is the right way to prepare a specific qubit state in Qiskit / Q#?Body: There are two possibilities to prepare a qubit in a particular state like $ | - \rangle $ in Qiskit.
The first approach is using the initialize function:
qc = QuantumCircuit(1)
initial_state = [1/sqrt(2),-1/sqrt(2)]
qc.initialize(initial_state, 0)
The second approach is using standard quantum gates:
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
qc = QuantumCircuit(qreg_q, creg_c)
qc.x(qreg_q[0])
qc.h(qreg_q[0])
Are these two possibilities different? What is the "best practice" for preparing an arbitrary qubit state?
Is there a comparable initialize function in Q#?
"
"['quantum-state', 'entanglement']"," Title: Is there a name for $Z_{1}(|\mathrm{GHZ}\rangle)$?Body: The GHZ state is defined as $|\mathrm{GHZ}\rangle = \frac{|000\rangle + |111\rangle}{\sqrt{2}}$. Is there a name for the phase flipped GHZ state, i.e. $Z_1(|\mathrm{GHZ}\rangle)=\frac{|000\rangle - |111\rangle}{\sqrt{2}}$ ?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Why is declared that $0 \le \theta \le \pi$ for Qiskit's U3 gate?Body: It stated in Qiskit's documentation.
This question arose after I accidentally called the U3 gate with parameter $\theta$=$2\pi$ in the program and Qiskit executed the program without error:
tetha = 2 * np.pi
qc.u3(theta, phi, lam, reg)
I checked other values out of bounds and every time it worked (including looping at a distance of $4\pi$) according to the formula for U from the documentation (judging by the resulting unitary operator) but ignoring violation of declared boundaries for $\theta$, e.g:
print(Operator(U3Gate(1.5 * np.pi, 0, 0)))
print(Operator(U3Gate(5.5 * np.pi, 0, 0)))
print(Operator(U3Gate(-.5 * np.pi, 0, 0)))
print(Operator(U3Gate(3.5 * np.pi, 0, 0)))
Operator([[-0.70710678+0.j, -0.70710678+0.j],
[ 0.70710678+0.j, -0.70710678+0.j]],
input_dims=(2,), output_dims=(2,))
Operator([[-0.70710678+0.j, -0.70710678+0.j],
[ 0.70710678+0.j, -0.70710678+0.j]],
input_dims=(2,), output_dims=(2,))
Operator([[ 0.70710678+0.j, 0.70710678+0.j],
[-0.70710678+0.j, 0.70710678+0.j]],
input_dims=(2,), output_dims=(2,))
Operator([[ 0.70710678+0.j, 0.70710678+0.j],
[-0.70710678+0.j, 0.70710678+0.j]],
input_dims=(2,), output_dims=(2,))
But do $\theta$ values outside the declared range make any real sense in quantum computing?
Or is it just a little flaw in Qiskit?
Just in case, the formula for the U3 gate is
$$
\mathrm{U3}=
\begin{pmatrix}
\cos(\theta/2) & -\mathrm{e}^{i\lambda}\sin(\theta/2) \\
\mathrm{e}^{i\phi}\sin(\theta/2) & \mathrm{e}^{i(\phi+\lambda)}\cos(\theta/2)
\end{pmatrix}.
$$
"
"['quantum-gate', 'quantum-state', 'hadamard']"," Title: What are the I, X, Z gates in quantum gates?Body: Can someone please explan how the $\rm I$, $\rm X$ and $\rm Z$ gates work?
If $\rm{I = X^2 = Z^2}$, can you explain why this is the case or why it wouldn't work?
"
"['circuit-construction', 'simulation']"," Title: Preparing any superposition of fixed Hamming weight statesBody: There exists a nice way of preparing any superposition (with real amplitudes — this is the case I'm interested in) of states $\{\ldots0001\rangle,\,|\ldots0010\rangle,\,|\ldots0100\rangle,\ldots\}$, etc. This can be achieved with an $O(\log_2 n)$-depth circuit having $O(n)$ gates. To do so, one takes the circuit from Fig. 5 here, and replaces the $G(1/2)$ gate with $R_y$ rotations.
I'm wondering if this idea can be somehow generalized in order to prepare any superposition (with real coefficients) of constant Hamming weight states. Clearly, such a circuit will contain at least $O\left({n}\choose{m}\right)$ parametric gates. Would be cool if the depth could be made, similarly to the case above, significantly smaller than the number of gates.
Please do not suggest the UCC ansatz :D
UPDATE
In the comments below, Mark S pointed out a paper in which the preparation of Dicke states is discussed. Those are the equal-weight superpositions of constant Hamming weight states. The circuit contains only $O(kn)$ gates, and cannot be generalized to case of interest in an obvious way, as it can be done in the first paper cited above. Still, may be useful.
"
"['qiskit', 'programming']"," Title: How to initialize a random state in Qiskit?Body: I know I can make a random_circuit, but I see that Qiskit has random_statevector. I'd like to optimize computation time by initializing a state by that instead of putting a random circuit at the beginning. Is it possible and how do I do it? Thank you!
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Qiskit error on get_backend()Body: Im trying to use IBM quantum machine instead of qiskit aer simulator with the following command:
backend = IBMQ.get_backend('ibmq_16_melbourne', 'ibm-q')
It's giving me the following error:
AttributeError Traceback (most recent call last)
<ipython-input-22-39269ac2204d> in <module>
----> 1 backend = IBMQ.get_backend('ibmq_16_melbourne', 'ibm-q')
AttributeError: 'IBMQFactory' object has no attribute 'get_backend'
What syntax I should try to submit the job to designated quantum machine?
"
"['qiskit', 'programming', 'optimization', 'quantum-computing-for-finance']"," Title: Qiskit Portfolio Optimization ApplicationBody: I recently got flung into the world of quantum computing and I'm a beginner at coding. I was assigned to do the Portfolio Optimization tutorial of the Qiskit Finance Tutorials and input real data. Truth be told, I'm clueless. It's my understanding that I have to replace the "TICKER" and "RandomDataProvider" parts of the code in order to generate a real-life portfolio.
# Generate expected return and covariance matrix from (random) time-series
stocks = [("TICKER%s" % i) for i in range(num_assets)]
data = RandomDataProvider(tickers=stocks,
start=datetime.datetime(2016,1,1),
end=datetime.datetime(2016,1,30))
data.run()
mu = data.get_period_return_mean_vector()
sigma = data.get_period_return_covariance_matrix()
I've imported Quandl and WikipediaDataProvider. I want to keep the number of assets the same, using Microsoft "MSFT", Disney "DIS", Nike "NKE", and Home Depot "HD" stocks. How might I apply this financial from Quandl to the tutorial? I've tried this so far:
num_assets = 4
# Generate expected return and covariance matrix from (random) time-series
stocks = [("MSFT%s" , "DIS%s" , "NKE%s" , "HD%s" % i) for i in range(num_assets)]
data = WikipediaDataProvider(tickers=stocks,
token="xeesvko2fu6Bt9jg-B1T",
start=datetime.datetime(2016,1,1),
end=datetime.datetime(2016,1,30))
data.run()
mu = data.get_period_return_mean_vector()
sigma = data.get_period_return_covariance_matrix()
But get the error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-59-19e4d9cde1e3> in <module>
3 # Generate expected return and covariance matrix from (random) time-series
4 stocks = [("MSFT%s" , "DIS%s" , "NKE%s" , "HD%s" % i) for i in range(num_assets)]
----> 5 data = WikipediaDataProvider(tickers=stocks,
6 token="xeesvko2fu6Bt9jg-B1T",
7 start=datetime.datetime(2016,1,1),
TypeError: Can't instantiate abstract class WikipediaDataProvider with abstract methods run
I apologize for my limited coding skills - I'm very new to all of this! Thank you in advance.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Existence of multiple job monitor in qiskitBody: I can see in example code of qiskit, to implement job monitors on IBM Quantum machines, example uses any of the following
from qiskit.tools.monitor import job_monitor
from qiskit.providers.ibmq.job import job_monitor
I have downloaded qiskit in my laptop and used both of them. Could not see any differences.
What is the difference between them? Does the invocation vary depending on the Quantum machine on which job is being executed?
"
"['complexity-theory', 'quantum-turing-machine']"," Title: Hardwiring the output in black box separationBody: In this paper, while using a diagonalization argument in Section $5$, the authors write:
Fix some enumeration over all $poly(n)$-size quantum verifiers $M_{1},
M_{2},...$ which we can do because the number of such machines is
countably infinite (by the Solovay-Kitaev theorem [15]). Some of these
verifiers may try to decide a language by trivially “hardwiring” its
outputs; for example, by returning 1 independent of the input. We
start by fixing a unary language $L$ such that no machine $M_{i}$ hardwires
the language. We can always do this because there are more languages
than $poly(n)$-sized machines.
Maybe I am missing something very basic, but:
- Why do we care if some of the verifiers have the output hardwired?
- How can we find an $L$, like in the description? Why will this $L$ even be decidable? I know there are more languages than there are Turing machines; but those extra languages aren't decidable.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Type object 'AllPairs' has no attribute 'params'Body: When I try QSVM over Iris data, it needs multiclass extension, but when I provide it, a following error is returned:
AttributeError Traceback (most recent call last)
<ipython-input-18-86cd4e7dd846> in <module>
2
3 feature_map = ZZFeatureMap(feature_dimension=feature_dim, reps=2, entanglement='linear')
----> 4 qsvm = QSVM(feature_map, training_input, test_input, multiclass_extension=AllPairs)
d:\anaconda\envs\ai\lib\site-packages\qiskit\aqua\algorithms\classifiers\qsvm\qsvm.py in __init__(self, feature_map, training_dataset, test_dataset, datapoints, multiclass_extension, quantum_instance)
148 else:
149 multiclass_extension.set_estimator(_QSVM_Estimator, [feature_map])
--> 150 qsvm_instance = _QSVM_Multiclass(self, multiclass_extension)
151
152 self.instance = qsvm_instance
d:\anaconda\envs\ai\lib\site-packages\qiskit\aqua\algorithms\classifiers\qsvm\_qsvm_multiclass.py in __init__(self, qalgo, multiclass_classifier)
37 super().__init__(qalgo)
38 self.multiclass_classifier = multiclass_classifier
---> 39 self.multiclass_classifier.params.append(qalgo)
40
41 def train(self, data, labels):
AttributeError: type object 'AllPairs' has no attribute 'params'
The code is :
seed = 10598
feature_map = ZZFeatureMap(feature_dimension=feature_dim, reps=2, entanglement='linear')
qsvm = QSVM(feature_map, training_input, test_input, multiclass_extension=AllPairs)
```
"
"['quantum-gate', 'quantum-state', 'cluster-states']"," Title: Limitations on the number of qubits for a $\mathrm{CNOT}$-gate in cluster statesBody: I'm reading about cluster states using this online source. It is explained that a CNOT can be performed on cluster states using as little as $4$ qubits. However, the standard implementation is with $15$ qubits. Why is that the case?
Is it also possible with any number of qubits beyond $4$? So can I implement a CNOT in a cluster state with $5$ qubits for instance, and if yes, how?
"
"['mathematics', 'bloch-sphere', 'textbook-and-exercises']"," Title: How are eigenvectors and eigenvalues expressed in the Bloch sphere?Body: I'm relatively new to the subject of quantum computing, and I recently came across the idea of eigenvalues and eigenvectors. I believe I understand the relationship between the two, where eigenvalues determine the factor by which an eigenvector is stretched, and eigenvectors represent the direction that the transformation is pointing towards, but I was wondering how exactly eigenvectors and eigenvalues would be expressed in the Bloch sphere.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: Defining a custom parametric gate in Qiskit in terms of standard gates?Body: Here it is explained how to define a custom non-parametric gate in Qiskit. How do I define a new parametric gate?
For example, I want to have the $CCR_y$ gate defined as
in order to use it as
qc.ccry(theta, c1, c2, targ)
Is this possible?
"
"['mathematics', 'unitarity', 'probability', 'haar-distribution']"," Title: What is the probability $\Pr(\|U-I\|_{\rm op}<\varepsilon)$ of a Haar-random unitary being close to the identity?Body: If one generates an $n\times n$ Haar random unitary $U$, then clearly $\Pr(U=I)=0$. However, for every $\epsilon>0$, the probability
$$\Pr(\|U-I\|_{\rm op}<\varepsilon)$$
should be positive.
How can this quantity be computed?
"
"['programming', 'simulation', 'communication', 'quantum-networks']"," Title: Simulating a Quantum Network over a real Classical Network Using SimulaqronBody: I'm trying to simulate a quantum network over a real classical network using the Simulaqron framework. I know the documentations says this is possible but I am having trouble finding examples of how to do this exactly. What are the steps to simulating a quantum network over a classical network in Simulaqron?
Also are there other frameworks that can do this?
"
"['algorithm', 'circuit-construction', 'grovers-algorithm']"," Title: Can anyone provide me with an example of the for Grover's algorithm on one qubit?Body: I'm having trouble understanding Grover's Algorithm, so I'd like to start with the case with 1 qubit. But I don't see anyone build it for 1 qubit, only 2 is the minimum. Is it because that's impossible or too trivial? Can anyone provide me with an example of the circuit if it's trivial? Thank you!
"
"['qiskit', 'programming', 'quantum-enhanced-machine-learning']"," Title: Qiskit QSVM - Alphas and Support VectorsBody: I just started using Qiskit and I have implemented the QSVM example. However, I having trouble with the return. The qsvm.predict() results are reasonable but when trying to calculate the margin myself, this does not make sense. I was hoping someone could help me:
xData = qsvm_res['svm']['support_vectors']
yData = qsvm_res['svm']['yin']
qsvm_alphas = qsvm_res['svm']['alphas']
w = np.zeros(n_features)
for n in range(len(qsvm_alphas)):
w += qsvm_alphas[n]*yData[n]*xData[n]
Thanks,
Matthias
"
['complexity-theory']," Title: Does finding an algorithm that solves an NP-Problem in Polynomial time in a Quantum Computer imply P = NP?Body: I was wondering if the complexity of a quantum circuit that solves a problem that is in NP implies P=NP?
"
"['qiskit', 'programming']"," Title: Updating qiskit doesn't update qiskit version using jupyter notebook/terminalBody: I installed qiskit using qiskit documents from here https://qiskit.org/documentation/install.html. When I first installed qiskit the version was 0.12.xx on ubuntu with python installed. Everything was working great.
yesterday I needed qiskit version 0.19.6 for "IBM Advocate Test". When I run qiskit.__qiskit_version__
it shows
{'qiskit-terra': '0.xx.xx',
'qiskit-aer': '0.x.x',
'qiskit-ignis': '0.x.x',
'qiskit-ibmq-provider': '0.x.x',
'qiskit-aqua': '0.x.x',
'qiskit': '0.12.xx'}
Then I run some commands that were in the test file so everyone trying to give the test have updated qiskit version.
Commands are:
!pip install --upgrade qiskit==0.19.6
!pip install --upgrade metakernel
!pip install --upgrade portalocker
!pip install --upgrade matplotlib
So after running them there were some sort of errors I don't remember, then I seek on internet and found something useful here
Updating qiskit doesn't update qiskit version from Spyder
But Qiskit just updated to version 0.13.xx. I have tried this Q&A but didn't work for me. I rebooted the kernel, restarted pc after running every aspect of command, tried on jupyter notebook and terminal.
Plz help me for what else needs to be done.
"
"['algorithm', 'shors-algorithm', 'phase-estimation']"," Title: Why can I use the Sum of Eigenvectors for Phase Estimation in ShorBody: In phase estimation, we start by using an eigenvector $\newcommand{\ket}[1]{\lvert#1\rangle}\ket u$ to find the corresponding eigenvalue lambda. So far so good. In the order finding algorithm, we also use phase estimation to find the eigenvalues for the unitary $\ket{xy\bmod N}$.
However, the eigenvectors/eigenvalues depend on the order $r$, which we don't know.
As a solution, textbooks note that the eigenvectors add up to $\ket1$ and then use that to initialize the phase estimation circuit.
My question is - why does that work? Why can I use the sum of eigenvectors and not just a specific eigenvector?
"
"['d-wave', 'adiabatic-model']"," Title: The commutation relation $[H_d, \sum_{i = 1}^n \sigma_i^z] = 0$ from the paper about the constrained quantum annealing (CQA)Body: A quote from the paper "Quantum annealing for constrained optimization" by I. Hen, F. M. Spedalieri:
Let us now consider the driver Hamiltonian
$$H_d = - \sum_{i=1}^n \left( \sigma_i^x \sigma_{i+1}^x + \sigma_i^y \sigma_{i+1}^y \right)$$
where the label $i = n + 1$ is identified with $i = 1$ ... This driver has the following atractive properties (i) as can easily be verified, it obeys $[H_d, \sum_{i = 1}^n \sigma_i^z] = 0$; (ii)...
I don't see why $[H_d, \sum_{i = 1}^2 \sigma_i^z] = 0$. Note that for $n=2$ from this commutation relation we have:
$$H_d \left(\sigma_1^z + \sigma_2^z \right) = \left(\sigma_1^z + \sigma_2^z \right) H_d$$
and
$$H_d = -2\left(\sigma_1^x \sigma_{2}^x + \sigma_1^y \sigma_{2}^y \right)$$
but actually:
$$H_d \left(\sigma_1^z + \sigma_2^z \right) = -\left(\sigma_1^z + \sigma_2^z \right) H_d$$
because $\sigma^x \sigma^z = -\sigma^z \sigma^x$ and $\sigma^y \sigma^z = -\sigma^z \sigma^y$, hence $\sigma_1^x \sigma_{2}^x \sigma_1^z = -\sigma_1^z \sigma_1^x \sigma_{2}^x$ and the similar for other terms. So, in contradiction, instead of commuting operators, we have anticommuting operators $\{H_d, \sum_{i = 1}^2 \sigma_i^z \} = 0$. Where is my mistake(s)?
Edit
According to the answers below indeed $[H_d, \sum_{i = 1}^2 \sigma_i^z] = 0$. Also, the operators $H_d$ and $ \sum_{i = 1}^2 \sigma_i^z$ (for $n=2$) commute and anticommute at the same time and there is no contradiction (as I have wrongly stated above). This is because:
$$H_d \left(\sigma_1^z + \sigma_2^z \right) = \left(\sigma_1^z + \sigma_2^z \right) H_d = 0$$
Let's prove for the first part:
$$H_d \left(\sigma_1^z + \sigma_2^z \right) = -2\left(\sigma_1^x \sigma_{2}^x + \sigma_1^y \sigma_{2}^y \right) \left(\sigma_1^z + \sigma_2^z \right) =
\\
=-2\left(-i \sigma_1^y \sigma_{2}^x + i \sigma_1^x \sigma_{2}^y \right) -2\left(-i \sigma_1^x \sigma_{2}^y + i\sigma_1^y \sigma_{2}^x \right) = 0
$$
"
"['quantum-gate', 'mathematics', 'grovers-algorithm', 'gate-synthesis']"," Title: How can you decompose Grover's diffusion operator into gates?Body: I know how Grover's diffusion operator works ($U_s = 2|s\rangle\langle s|-I$) with the inversion around the mean. However, I want to implement it in simpler gates, to use the algorithm. How can I do this ?
"
"['quantum-state', 'tomography', 'mub']"," Title: Why does full state reconstruction require at least $N+1$ MUBs?Body: Consider an $N$-dimensional space $\mathcal H$. Two orthonormal bases $\newcommand{\ket}[1]{\lvert #1\rangle}\{\ket{u_j}\}_{j=1}^N,\{\ket{v_j}\}_{j=1}^N\subset\mathcal H$ are said to be Mutually Unbiased Bases (MUBs) if $\lvert\langle u_i\lvert v_j\rangle\rvert =1/\sqrt N$ for all $i,j$.
Suppose we want to fully reconstruct a state $\rho$ by means of projective measurements. A single basis provides us with $N-1$ real parameters (the $N$ outcome probabilities associated with the measurement, minus one for the normalisation constraint).
Intuitively, if two bases are mutually unbiased, they provide fully uncorrelated information (finding a state in some $\ket{u_j}$ says nothing about which $\ket{v_k}$ would have been found), and thus measuring the probabilities in two different MUBs should characterise $2(N-1)$ real parameters.
If we can measure in $N+1$ different MUBs (assuming they exist), it thus stands to reason that we characterised $(N-1)(N+1)=N^2-1$ independent real parameters of the state, and thus obtained tomographically complete information.
This is also mentioned in passing in this paper (page 2, second column, arXiv:0808.0944).
What is a more rigorous way to see why this is the case?
"
"['ibm-q-experience', 'machine-learning', 'ibm', 'pennylane']"," Title: What are the differences between the IBM machines?Body: I'm quite new to this field, and have started sending jobs to IBM's quantum computers. I have access to around 11 locations. I can see that these have different numbers of qubits within them, and then different layouts of them as well.
I am trying to test a quantum machine learning network I have trained. However, when I test it on real hardware the different machines are giving me quite different results. For example, with ibmq_essex I get around 62% accuracy, while with ibmq_london I get around 70%.
I am curious to know:
- is there a particular reason for this, outside of just the inherent "randomness" of QM?
- Are different IBM pieces of hardware better for different tasks?
Thanks
"
"['algorithm', 'grovers-algorithm', 'textbook-and-exercises']"," Title: What to do when the amount of solutions is not known before applying Grovers Algorithm?Body: When running Grovers Algorithm one has to know how many solutions there are right? When the number of solutions are not known is then what do you do then?
"
"['quantum-state', 'error-correction', 'density-matrix']"," Title: Is there a proof or example to show that a noiseless subsystem is not necessarily closed under addition?Body: In a text (section 3.6 page 92) about noiseless subsystems by D. Lidar, it is mentioned:'A subsystem is a tensor factor in a tensor product, and this does not have to be a subspace (e.g., in general it is not closed under addition).'
I do not understand how if some quantum states $\rho, \sigma \in \mathbb{C}^n \otimes \mathbb{C}^m$
then how can their addition not be in $\mathbb{C}^n \otimes \mathbb{C}^m$?
Thank you in advance.
"
"['mathematics', 'textbook-and-exercises', 'deutsch-jozsa-algorithm']"," Title: Why does the Hadamard gate satisfy $H|x\rangle=\frac{1}{\sqrt2}\sum_{z\in\{0,1\}}(-1)^{xz}\lvert z\rangle$?Body: I'm studying Deutsch–Jozsa algorithm and I don't understand this passage about Hadamard gate result:
$$\newcommand{\ket}[1]{\lvert #1\rangle}H\ket x=\frac{1}{\sqrt2}(\ket0+(-1)^x\ket1)=\frac{1}{\sqrt2}\sum_{z\in\{0,1\}}(-1)^{xz}\ket z$$
Why this equivalence is true? In particular, what is $z$?
"
['fidelity']," Title: Calculating fidelity for mixed states: are there tricks or it is ""brute force"" calculations?Body: The fidelity between two density matrix $\rho$ and $\sigma$ is the following:
$$F(\rho,\sigma)=\operatorname{Tr}\left[\sqrt{\sqrt{\rho} \sigma \sqrt{\rho}} \right]^2$$
If one of the two state is a pure state the expression is very easy, but in general it is this one.
To compute it I would naïvely diagonalise $\rho$ to find $\sqrt{\rho}$, then compute $\sqrt{\rho} \sigma \sqrt{\rho}$, then diagonalize again to find the square root: $ \sqrt{\sqrt{\rho} \sigma \sqrt{\rho}}$, take the trace and square.
It is a "complicated" thing to do.
I wondered if there are tricks to compute fidelity between two mixed states ? Also, are there some "usual" tricks to make proof based on that (like proving inequalities).
Again my "confusion" is that this formula for two mixed state is not easy to handle so I wondered if I see it under the wrong angle ?
"
"['quantum-gate', 'error-correction', 'textbook-and-exercises']"," Title: Why is the action of controlled-Z unaltered by exchanging target control qubits?Body: In the book "Quantum Computer Science", when explaining the error correction code, it uses this picture and says "the action of controlled-z is unaltered by exchanging the target and control qubits".
Does this mean that the act of cZ(control ancilla qubit and target codeword qubit) is equal to cz(control codeword qubit and target ancilla qubit)? If this is the case, why is that?
In my understanding, |1>Z|0>(first qubit is control qubit) is not equal to Z|0>|1>(second qubit is control qubit).
"
"['resource-request', 'simulation', 'cryptography', 'bb84', 'quantum-networks']"," Title: Any good resources for learning about quantum networks and how to do a simulation of BB84 protocol?Body: I'm a communication engineering student. And I'm thinking of doing my project on BB84 protocol but I don't know where to start. As a beginner, are there any documents or tutorials about quantum networks and how to use simulators like QuISP or Simulaqron?
"
"['programming', 'quantum-state', 'entanglement', 'qutip', 'partial-transpose']"," Title: Defining dimension of an operator in qutipBody: My main question: Can someone please explain to me how the list of array is used to define the dimension in qutip?
Context:
If I have my density operator A = Qobj(np.arange(1,65).reshape(8,8)) of 3 qubits, how do I take the partial transpose such that I want to make bipartite entanglement between qubit 1 with qubit 2 and 3?
I am guessing that I would have to define my mask as X.dims = [[2,4],[2,4]] and take qt.partial_transpose(X, [1,0]) which taking partial transposition over the second subsystem. But what does this X.dims = [[2,4],[2,4]] mean in qutip?
If this is correct then how would I define my dimension for entanglement between qubit 1 and 3 and qubit 2?
"
"['algorithm', 'classical-computing', 'speedup', 'information-theory']"," Title: Can classical linear algebra solvers implement quantum algorithms with similar speed-ups?Body: A quantum algorithm begins with a register of qubits in an initial state, a unitary operator (the algorithm) manipulates the state of those qubits, and then the state of the qubits is read out (or at least some information about the state on a single run of the algorithm).
It seems to me that a quantum computer answers the question of the unitary acts on the quantum state. This is "just" a matter of linear algebra. It strikes me, then, that quantum computers can be seen as linear algebra calculators.
Why then do we need quantum mechanics? Can we not find a classical system which implements linear algebra operations and use this to implement the algorithms which have been designed for quantum computers? Of course classical digital computers will not suffice, these machines are based on binary processing of information rather than the manipulation of vectors in a high dimensional space.
Question: Are there any candidates for classical linear algebra solvers (classical analog computers) which could implement the "quantum computer" algorithms whiles enjoying a similar speedup over digital classical computers?
Question 2: Perhaps I'm over simplifying by reducing a quantum computer to being simply a linear algebra solver. Is this the case? What complexity am I glossing over?
"
"['algorithm', 'resource-request', 'communication']"," Title: Distributed quantum computing with classical communicationBody: I'm interested in the field of distributed quantum computing, i.e. using multiple smaller quantum devices/circuits to cooperate to be able to perform some task that would require a larger device (where large/small refers to the total number of qubits the device has).
I'm looking for simple, abstract problems that could be solved when such a paradigm is utilized.
To be even more specific, I wonder if sharing entangled states between such devices is a must in this type of problems, or are there tasks that could be broken down in such a way that each device performs some quantum computation independently from the others, and they all use classical communication to share partial results etc.
Does anyone know any articles on the subject? Thanks!
"
"['circuit-construction', 'complexity-theory', 'mip-star']"," Title: Consequences of $MIP^\ast=RE$ Regarding Quantum AlgorithmsBody: The (pending-peer review) proof of $MIP^\ast=RE$ in this pre-print has been hailed as a significant breakthrough. The significance of this result is addressed by Henry Yuen (one of the authors) in this blog post. Scott Aaronson also lists some of the major implications in this blog post.
For a non-local game ($G$), define the supremum of success probabilities for non-relativistic tensor product strategies as $\omega^\ast(G)$, and the supremum of success probabilities for a relativistic commuting operator (QFT) strategy as $\omega^{co}(G)$. Since non-relativistic QM is a special case of QFT, it's clear that an optimal commuting operator-based strategy is at least as good as an optimal tensor product-based strategy, $\omega^\ast(G) \le \omega^{co}(G)$.
My understanding of Yuen's post is that one consequence of $MIP^\ast=RE$ is that non-local games exist for which $\omega^\ast(G) < \omega^{co}(G)$. Specifically, he says
There must be a game $G$, then, for which the quantum value is different
from the commuting operator value. But this implies Tsirelson’s
problem has a negative answer, and therefore Connes’ embedding
conjecture is false.
I understand this to mean that there is a class of problems for which algorithms using techniques from QFT (commuting operators) have higher success probabilities than algorithms using techniques from non-relativistic QM (tensor products, quantum circuit formalism).
The first part of my question is, assuming this proof stands:
- Does $MIP^\ast=RE$ imply that there is a set of problems that can be solved more efficiently by employing the mathematical formalism of QFT (commuting operators) rather than non-relativistic QM formalism (conventional quantum circuits)?
Unless I am misinterpreting, this seems to follow directly from Yuen's statements. If that's so, is it possible that there exists a set of non-local games for which $\omega^\ast(G) < 0.5$ and $\omega^{co}(G) > 0.5$? Specifically, the second part of my question is:
- Does $MIP^\ast=RE$ imply that there is (or might be) a set of problems that can be solved using commuting operators that cannot be solved using quantum circuits, or is this possibility forclosed by the universality of the quantum circuit model?
EDIT: Henry Yuen has created an MIP* Wiki for those interested in better understanding this complexity class or the $MIP^\ast = RE$ result.
"
"['fidelity', 'state-space-geometry']"," Title: What is the intuition behind Bures and angle metrics?Body: I am reading Distance measures to compare real and ideal quantum processes and it is explained the motivation behind Bures metric and angle metric.
Bures metric is defined as:
$$B(\rho,\sigma)=\sqrt{2-2 F(\rho,\sigma)}$$
Angle metric is defined as:
$$A(\rho,\sigma)=\arccos(\sqrt{F(\rho,\sigma)})$$
Where $F(\rho,\sigma)$ is the fidelity between $\rho$ and $\sigma$ density matrices. He says that we can understand such motivation on pure states: we would see it comes from the usual euclidian distance.
If I do such calculations, I would define the euclidian distance as:
$$d(X,Y)=||X-Y||=\sqrt{\langle X-Y | X-Y \rangle}=\sqrt{2-2 Re(\langle X | Y \rangle)} $$
To find the Bure metric I have to assume $\langle X | Y \rangle \geq 0$.
But why would it be the case ? For instance if I consider:
$$|\psi \rangle = | a \rangle + |b \rangle $$
I cannot change the relative phase between $|a \rangle$ and $|b \rangle$ as I want (because it would change the physical state $|\psi \rangle$). Thus if $\langle a | b \rangle $ is not a positive number I guess there is nothing much I can do for that.
How to understand the intuition behind such metric then? Should I actually consider it as an "abstract" definition on which I verify that it satisfies the axioms of a metric? But it would be weird in the way the paper explains the motivation behind.
Similar question for the angle metric.
[edit]: I think it might come from the fact we want to define a distance between physical states. Considering $|\Phi \rangle$ and $| \Psi \rangle$ two physical state, their global phase do not matter. Thus, to have a simple formula we can choose their phases $\phi_{\Psi}, \phi_{\Phi}$ so that $\langle \Psi | \Phi \rangle \geq 0$ which correspond to the upper bound: $\sup_{\phi_{\Psi}, \phi_{\Phi}}(Re[\langle \Psi | \Phi \rangle])=\langle \Psi | \Phi \rangle$. It somehow makes sense because we are interested into distance between physical
and not mathematical states. We can thus fix the global phases of the two states as we would like.
Does that make sense ?
"
['quantum-state']," Title: Is there a nice characterisation for the set of extensions of a given state?Body: Let $\rho\in\mathrm{D}(\mathcal H)$ be a state in some (finite-dimensional) Hilbert space $\mathcal H$ and suppose that $\operatorname{rank}(\rho)=r$.
This means that we can write it as
$$\rho = \sum_{k=1}^r p_k \mathbb P_{u_k}, \quad\text{with}\quad p_k>0, \,\,\sum_k p_k=1, \,\, \mathbb P_{u_k}\equiv \lvert u_k\rangle\!\langle u_k\rvert.\tag1$$
The set of purifications of $\rho$ is easily characterised as the set of states $\newcommand{\ket}[1]{\lvert #1\rangle}\ket\psi\in\mathcal H\otimes \mathcal H_A$, with $\dim\mathcal H_A=r$, that have the form
$$\ket\psi=\sum_{k=1}^r \sqrt{p_k} \ket{u_k}\otimes\ket{v_k},\tag2$$
for any orthonormal basis $\{\ket{v_k}\}_{k=1}^r\subset \mathcal H_{A}$.
We can of course also consider purifications with larger ancillary spaces, but those would be trivially reducible to the case with $\dim\mathcal H_A=r$.
Consider now the more general set of extensions of $\rho$.
This is the set of states $\tilde\rho\in\mathrm{D}(\mathcal H\otimes\mathcal H_A)$, for some auxiliary space $\mathcal H_A$, such that $\operatorname{Tr}_A\tilde\rho=\rho$. An example of a non-pure extension for a qubit can be found e.g. in this answer.
One way to characterise extensions is to observe that any extension can be written as the partial trace of a purification. As per our observation above about purifications, we can take a purification $\ket\psi$ that uses a bipartite auxiliary space, $\mathcal H_A=\mathcal H_B\otimes\mathcal H_C$, so that $\ket{v_k}\in\mathcal H_B\otimes\mathcal H_C$, and then tracing out $\mathcal H_C$ gives
\begin{align}\newcommand{\ketbra}[2]{\lvert #1\rangle\!\langle #2\rvert}
\tilde\rho
= \sum_k \sqrt{p_j p_k} \ketbra{u_j}{u_k}\otimes \operatorname{Tr}_C[\ketbra{v_j}{v_k}]
= \sum_k \sqrt{p_j p_k} \ketbra{u_j}{u_k}\otimes \sigma_{jk},
\tag3
\end{align}
where $\sigma_{jk}\equiv \operatorname{Tr}_C[\ketbra{v_j}{v_k}]\in\mathrm{Lin}(\mathcal H_B)$ is such that $\operatorname{Tr}(\sigma_{jk})=\delta_{jk}$.
Any extension can be written as (3), as if $\tilde\rho$ is a generic extension, then its purification has the form in Eq. (2), and then partial tracing we get the form in Eq. (3).
Are there nicer/more elegant/terser characterisations for the set of extensions of $\rho$?
"
"['qiskit', 'programming']"," Title: Qiskit IBMQ.load_account fails on version 0.20.0Body: So when trying to load my account I get this error:
ibmqfactory._initialize_providers:WARNING:2020-08-16 17:47:17,410: Unable to instantiate provider for {'hub': 'ibm-q', 'group': 'open', 'project': 'main'}: "{'online_date': ['Not a valid datetime.']}"
ibmqfactory.load_account:WARNING:2020-08-16 17:47:17,411: No Hub/Group/Projects could be found for this account.
I have tried changing the date format on my machine but other than that I'm lost.
"
"['quantum-gate', 'circuit-construction', 'pauli-gates']"," Title: Can you take infinitely many square roots of Pauli-X?Body: I am trying to find the cost for a n-bit Toffoli gate based on the recurrent circuit presented on Barenco's Work in Lemma 7.5 (Elementary gates for quantum computation)
The construction requires that we iteratively take the square root of Pauli X. I was wondering if there is some proof that we can always take the square root of Pauli X as many times as possible?
"
"['error-correction', 'stabilizer-code']"," Title: How to calculate distance of $k=0$ stabilizer code?Body: This could be seen as a followup to the question "How to calculate the distance of stabilizer code?". Summarizing the accepted answer : distance is the minimum weight of the set
$$E = \bigl\{e : e \not \in S, e \in \mathrm{Nor}(P_N,S)/(\pm I) \bigr\}$$
where $S$ is the stabilizer group (generated by $K_n$'s in the previous question), and $\mathrm{Nor}(P_N,S)$ is its
normalizer in the Pauli group of order $2^{2N+1}$ (where $N$=number of qubits; using real version of group here).
My question is the following: does this hold for $k=0$ stabilizer codes? I suspect that it doesn't always hold but can't find a reference for it... it does seem to work for most cases, but some simple counter examples are also easy to find : take the GHZ state $\tfrac{1}{\sqrt 2}\bigl(\lvert00\rangle + \lvert11\rangle\bigr)$, with $K_1=X_1X_2$ and $K_2=Z_1Z_2$. In this case, $\mathrm{Nor}(P,S)=\pm S$, so the set $E$ is empty. Something is obviously broken in this process: I think that the distance should be 2. What's going on here?
"
"['quantum-gate', 'qiskit', 'measurement', 'noise', 'error-mitigation']"," Title: There seems to be a bias against states with more 1s, in IBM's calibration matrix generator: What are the consequences and possible solutions?Body: Qiskit's function CompleteMeasFitter builds a calibration matrix in this way (2 qubit case):
- Everything is initialized in the state $|00\rangle$, which is the usual case for IBM hardware.
- For $|00\rangle$, it just measures the proportion of counts for $|00\rangle, |01\rangle, |10\rangle, |11\rangle$.
- For $|01\rangle$, it applies an $X$ gate to the second qubit, then measures the counts for all 4 states.
- For $|10\rangle$, it applies an $X$ gate to the first qubit, then measures the counts for all 4 states.
- For $|11\rangle$, it applies an $X$ gate to both qubits, then measures the counts for all 4 states.
In the $|00\rangle$ case the calibration matrix is picking up the measurement error.
In all other cases, the calibration matrix is picking up measurement error plus some gate error.
For states involving more 1s, the calibration matrix elements are less pure (there's more errors).
- Is there a consequence of this? E.g. the $|00\rangle$ counts will be corrected better than the others?
- Is there any way to mitigate this bias?
"
"['quantum-gate', 'qiskit', 'gate-synthesis', 'ibm', 'compiling']"," Title: Would IBM's ""compiler"" turn my identity circuit into nothing?Body: If I were to create a circuit with the following gate:
$$\tag{1}R_\phi = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{bmatrix},$$
with $\phi$ specified to be equal to 0, then the gate that I am running is just the identity gate, and the circuit is to do nothing to the qubits. Would the IBM hardware actually "run" some gate with some parameter being set as close as possible to 0? Or would IBM's compilers recognize that nothing is to be done, and just not "apply" any gate at all?
While the two cases would ideally be equivalent, in practice the one where "nothing" is done, would be less susceptible to error, which could make a significant difference in the outcomes we observe.
Likewise, if we put two $X$ gates next to each other in a circuit to be run on the IBM hardware, would IBM's compilers notice that the circuit is just the identity circuit, and decide to do nothing rather than apply two gates that cancel each other out?
To what extent does IBM's software and firmware "compile" circuits like this?
"
"['quantum-gate', 'qiskit', 'error-mitigation']"," Title: How to implement gate error mitigation in Qiskit?Body: I have been using the Ignis module for performing error mitigation but it accounts only for the measurement errors. For this reason, I want to know if there is some way to perform gate error mitigation using Qiskit.
"
['research']," Title: Is a 2nd course on Quantum Mechanics helpful for research in Quantum Information/Computing?Body: I'm wavering between taking 2nd Quantum Mechanics course and not. I've just completed the 1st course that already covered fundamentals of QC. I intend to take Quantum Information Processing along with Quantum Mechanics 2 next semester, but recently I've read some opinions that advanced QM will not be very helpful for doing (serious) research in Quantum Information/Computing. Can someone confirm whether perturbation theory has anything to do with QI/QC? I really want to expand my knowledge in QM, but the course is very challenging so I don't want to waste much time for something I'll barely use.
"
['error-correction']," Title: What's the relation between the sign of error correction code and commute of operators?Body: For example, the 5-qubit QECC.
If $X_i, Y_i, Z_i$ commutes with $M_i$, the eigenvalue will be +1. Otherwise, the eigenvalue will be -1. What's the relation between the commute and the sign of the eigenvalue? Moreover, since the control qubit is the ancilla qubit and the target qubit is $\psi$, how comes that a change in the target qubit could influence the measurement of the control qubit? For example, if $X_0$ appears, why is the measurement result of ancilla qubit be 0100?
"
"['ibm-q-experience', 'optimization']"," Title: How can I solve the problem of optimisation the quantum computer?Body: I am trying to solve the problem of optimization (VRP) with genetic algorithm and quantum computing in the platform IBM Q Experience.
But I am unable to advance on this. How can I do it?
According to my understanding of quantum computing, we cannot apply the two processes of crossover and mutation in their classic sense.
"
"['machine-learning', 'quantum-enhanced-machine-learning', 'pennylane']"," Title: What are the benefits of using quantum machine learning?Body: I have been investigating uses for quantum machine learning, and have made a few working examples (variations of variational quantum classifiers using PennyLane). However, my issue now is its relationship with classical machine learning. At the moment (in my tests, at least), QML seems to not provide any major improvement in performance (compared to a classical network) and is significantly slower when running on real hardware.
I understand that this is a young field people are still exploring, but I'm curious as to why you would not just always use a classical ML algorithm for problems. Therefore, my questions are:
- What benefits (or predicted benefits) are there using quantum machine learning?
- Is there little benefit now, but the potential for performance increases when hardware improves?
- It wouldn't surprise me to learn there are examples where QML outperforms classical ML. Here, my question is why is this the case? How would moving to a quantum regime improve performance?
"
"['quantum-state', 'quantum-operation']"," Title: Some questions to get intuition on Choi isomorphismBody: I have some questions about the Choi-Jamiolkowski isomorphism.
I remind how it can be defined. First, we define $|\mathcal{I}_{H_0} \rangle \rangle \in H_0 \otimes H_0$
$$|\mathcal{I}_{H_0} \rangle \rangle = \sum_i |i i \rangle$$
Where the family $\{ |i\rangle \}_i $ is an orthonormal basis of $H_0$.
C.J isomorphism: pure case
Let $X \in \mathcal{L}(H_0, H_1)$, the C.J isomorphism consist in associating to this linear operator, a kets $|X \rangle \rangle \in H_1 \otimes H_0 $:
$$ |X \rangle \rangle \equiv ( X \otimes I_{H_0} ) |\mathcal{I}_{H_0} \rangle \rangle$$
A little calculation shows that the isomorphism simply consists in performing the following mapping:
$$ \sum_{i,j} \langle i | X | j \rangle |i \rangle \langle j | \leftrightarrow \sum_{i,j} \langle i | X | j \rangle |i, j \rangle \rangle$$
Basically we replace: $|i\rangle \langle j | \in \mathcal{L}(H_0,H_1) \leftrightarrow |i,j \rangle \rangle \in H_1 \otimes H_0$
C.J isomorphism: mixed case
The mixed case consist in associating linear operator to quantum map. Let $\mathcal{M} \in \mathcal{L}(\mathcal{L}(H_0),\mathcal{L}(H_1))$. We define the Choi matrix $M \in \mathcal{L}(H_1 \otimes H_0)$ such that:
$$\mathcal{C}(\mathcal{M}) \equiv (\mathcal{M} \otimes \mathcal{I}_{H_0}) (|\mathcal{I}_{H_0} \rangle \rangle \langle \langle \mathcal{I}_{H_0} | )$$
We notice the strong analogy with the definition of the Choi isomorphism for the pure case.
My questions
- Is there an analog "easy" definition for the Choi isomorphism in the mixed case as there were in the pure case with $|i \rangle \langle j| \leftrightarrow |i,j \rangle \rangle$ ? Or should we always take the "brute force" definition to calculate the isomorphism ?
- Why is this isomorphism important ? I have seen this post which talks about the intuition from quantum teleportation (I did not really understand the answer, I would need to dig in). But my question is more related on why this isomorphism is often used and not another one to perform calculation.
- Are there typical relationship between the pure and mixed case ? I managed to prove that if $\mathcal{U}(\rho)=U \rho U^{\dagger}$ is a unitary map, then $\mathcal{C}(\mathcal{U})=|U \rangle \rangle \langle \langle U |$. But are there some other usefull relationship ?
- (related to my second question): I checked and it seems that the mixed isomorphism is different from the "natural" isomorphism we would consider to associate matrix to quantum map. Basically where the inputs (density matrices) would be replaced by vector: $|i \rangle \langle j | \rightarrow |i,j\rangle$ and the quantum map would then just be a matrix eating vector and giving vector. The resulting matrix seem to not be the same as the mixed case choi matrix. Would you confirm ?
"
"['quantum-state', 'terminology']"," Title: Terminology: what do $|i\rangle$ and $|\mbox{-}i\rangle$ represent?Body: $|0⟩$ and $|1⟩$ are usually referred as the computational basis. $|+⟩$ and $|-⟩$, the polar basis.
What about $|i\rangle$ and $|\mbox{-}i\rangle$?
And collectively? Orthonormal states?
References are welcomed!
"
"['quantum-state', 'bloch-sphere']"," Title: $N(\frac{1}{2},2)=3$ for vectors in a Hilbert SpaceBody: Came across This question regarding the maximum number of almost orthogonal vectors one can embed in a Hilbert space. They state that $N(\frac{1}{2},2)=3$, and that explicit construction of the vectors using the Bloch sphere shows this. However, I cannot seem to grasp what they mean by this. Their further example of $N(\frac{1}{\sqrt{2}},2)=6$ does make sense to me, as these are simply the eigenvectors of the pauli operators. But how does one show that the number of vectors which meet the following criteria is only 3?
$$\langle V_i|V_i\rangle = 1$$
$$|\langle V_i|V_j\rangle| \leq \epsilon, i \neq j$$
"
"['quantum-gate', 'tensor-product']"," Title: Is there a good way to mathematically write a CNOT operation over non-neighboring qubits in a circuit?Body: I was wondering if there is any way to present the CNOT matrix as we usually present single qubit operations
$$... 1 \otimes NOT \otimes 1 ...$$
I know that for adjacent qubits in a circuit we can present it identically
$$... 1 \otimes CNOT \otimes 1 ...$$
But is there a way to present the operation mathematically if there are several CNOTs acting on not neighboring wires?
"
"['mathematics', 'quantum-operation', 'textbook-and-exercises']"," Title: Why can every $|X\rangle\in H_1\otimes H_0$ be written as $|X\rangle=(X\otimes I_{H_0})|\Omega \rangle$ for some $X\in\mathcal L(H_0,H_1)$?Body: In A theoretical framework for quantum networks is proven that a linear map $\mathcal{M} \in \mathcal{L}(\mathcal{H_0},\mathcal{H_1})$ is CP (completely positive) iff its Choi operator $M$ is semi definite positive. Something confuses me in this derivation.
First, some definition reminders.
Let $X \in \mathcal{L}(H_0,H_1)$, let $\{|i \rangle \}_i$ be an orthonormal basis of $H_0$, we have:
$$ | \mathcal{I} \rangle \rangle \equiv \sum_i |ii \rangle$$
$$|X \rangle \rangle \equiv (X \otimes \mathcal{I}) | \mathcal{I} \rangle \rangle$$
The Choi operator is defined as:
$$ M = \mathcal{M} \otimes \mathcal{I}_{H_0} | \mathcal{I} \rangle \rangle \langle \langle \mathcal{I} |$$
In his proof, he assumes $M \geq 0$ the goal is to show that it implies $\mathcal{M}$ is CP.
$M$ is semi definite positive which implies it is hermitian with positive eigenvalues. It can thus be diagonalized. With $\lambda_i \geq 0$, we have:
$$ M = \sum_i \lambda_i |u_i \rangle \langle u_i |=\sum_i | K_i \rangle \langle K_i |$$
With $|K_i \rangle = \sqrt{\lambda_i} |u_i \rangle$
But he seems to "automatically" consider that $|K_i \rangle = |K_i \rangle \rangle$. I don't understand that. Why would we necesseraly have $|K_i \rangle = (K_i \otimes \mathcal{I}) | \mathcal{I} \rangle \rangle$. It is a very particular case. Why can the state be written as a local operation acting on a maximally entangled state ?
I have a super vague memory that any quantum state can be written as $(K \otimes \mathbb{I}) | \mathcal{I} \rangle \rangle$. Said differently, there always exist a linear operation $K$ (not necesseraly unitary of course) such that any vector in $H_1 \otimes H_0$ can be written as $K \otimes \mathcal{I} | \mathcal{I} \rangle \rangle$ I guess it would solve the problem. But I cannot find the source of that and I may be totally wrong.
In the end, why can we write: $|K_i \rangle = |K_i \rangle \rangle$. I would like a proof of that (and if the property I just talked about holds I would like a link to a reference expressing it or a proof of that as well in the answer)
"
"['programming', 'circuit-construction', 'cirq', 'bell-experiment']"," Title: What is the analysis of the Bell Inequality protocol in Cirq's 'examples'?Body: This question is taken from https://github.com/quantumlib/Cirq/issues/3032.
The "standard" protocol measures Alice's and Bob's qubits in different bases, while the one in Cirq measures in the same basis. I can't prove the equivalence of these seemly different protocols that violate Bell's inequality.
"
"['quantum-gate', 'circuit-construction', 'measurement', 'superdense-coding', 'qrac']"," Title: Gate definitions for quantum random access codesBody: I would like to know how the gates are defined in quantum random access codes? Consider the $2 \to 1$ code described in Lemma 3.1 of this paper.
The section defines the encoding and decoding circuits. But it is not clear to me how to define gates. Say, I want to apply an $Rz(\theta)$ on the first qubit or a CNOT gate on both qubits.
How do I do that?
"
"['qiskit', 'programming', 'q#', 'pauli-gates', 'stabilizer-state']"," Title: Is there a function in Qiskit to measure tensor products of Pauli operators?Body: Is there a function in Qiskit similar to this function in Q# which measures strings of Pauli operators applied to different qubits?
"
"['circuit-construction', 'error-correction', 'fault-tolerance']"," Title: Circuit of quantum error correction codeBody: I read an interesting paper of QEC with only two extra qubits.
In the paper, there is a circuit. Note that
.
Here are some contexts of the paper:
"The stablizer is $XZZXI$. If the second gate fails and introduces an $IZ$ fault, then this fault will propagate through the subsequent gates to become an $IIZXI$ error on the data."
Since the stablizer on the second gate is $Z$, how could it introduce the $IZ$ fault? $IZ$ is equal to $Z$, isn't it? Why the subsequent gate becomes $IIZXI$?
"
"['measurement', 'terminology', 'projection-operator']"," Title: What's the observable when measuring multiple qubits in the computational basis?Body: In Nielsen and Chuang (Quantum Computing and Quantum Information) the following definition is given to a projective measurement:
Projective measurements are described by an observable $M$:
$$M = \sum_m m P_m$$
with $P_m$ a projector onto the Eigenspace of $M$ with eigenvalue $m$.
My question now is, when we say we measure a system of $n$ qubits in the computational basis, to which observable do we refer precisely?
For 1 qubit, I know that this refer to the Z observable:
$$Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = |0 \rangle \langle 0| - |1\rangle \langle 1|.$$
For $n$ qubits,my intuition would be:
\begin{align*}
P_1 & = \underbrace{Z \otimes I \otimes ... \otimes I}_{n \textrm{ terms}}. \\
P_2 & = I \otimes Z \otimes ... \otimes I. \\
& ... \\
P_n & = I \otimes I \otimes ... \otimes Z.
\end{align*}
with $I$ being the identity matrix.
Then the observable would be as in the definition. Is that correct?
"
"['physical-realization', 'physical-qubit', 'photonics']"," Title: Why do we use two optical modes per qubit in the KLM scheme?Body: The original KLM paper says:
The basic states of a bosonic qubit encoded in modes $l_1$ and $l_2$ are $|0\rangle\mapsto|0\rangle_{l_1}|1\rangle_{l_2}$ and $|1\rangle\mapsto|1\rangle_{l_1}|0\rangle_{l_2}$.
Why couldn't we simply encode qubits as $|0\rangle\mapsto|0\rangle_{l_1}$ and $|1\rangle\mapsto|1\rangle_{l_1}$?
"
"['physical-qubit', 'architecture', 'decoherence']"," Title: What determines the topology/connectedness of quantum computers?Body: Some quantum computers hold their qubits in a 2D array. I've even seen a 1D topology I think.
On IBM Q, you can see which qubits talk to which qubit. I would like to know what determines/limits the connectedness of each qubit.
I would imagine it has something to do with decoherence? But any other specific reason?
"
"['complexity-theory', 'hhl-algorithm', 'bqp']"," Title: Is HHL still BQP-complete when the matrix entries are only in {0,1}?Body: I'm studying BQP-completeness proofs of a number of interesting problems of Janzing and Wocjan, and Wocjan and Zhang. Janzing and Wocjan show that estimating entries of matrix powers $(A^m)_{ij}$ with $A_{ij}\in\{-1,0,1\}$ is (promise) BQP-complete. That is, the problem is both in BQP, and can simulate other problems in BQP.
Janzing and Wocjan emphasize that their BQP-hardness reduction requires a negative-sign in an entry of $A$ to simulate interference afforded by BQP algorithms. At a critical point in their reduction they apply a (conditional)-$Z$ rotation, which leads to a matrix $A$ with a negative entry.
I don't think their proof of BQP-hardness would carry over when entries $A_{ij}$ are strictly non-negative, e.g. in $\{0,1\}$. Indeed, I believe that such a restricted matrix-powers problem may be amenable to some form of Stockmeyer approximation, e.g. in $\mathsf{AM}$, and hence not BQP-complete under the reasonable hypothesis that $\mathsf{BQP}\not\subseteq\mathsf{AM}$.
The proof of BQP-hardness of matrix powers appears initially to be similar to the BQP-hardness of the HHL algorithm, which was wonderfully summarized by @DaftWullie here.
However, HHL considers the Taylor-series expansion of $A^{-1}$, where $A=I-Ue^{-1/T}$ and $U$ is a unitary operator which simulates a given unitary circuit with a clock register construction — so that $U$ (and powers of $U$) will have negative or complex entries, if any of the gates in the circuit do. For the case $\tilde A = U \mathrm{e}^{-1/T}$, this again suggests that the BQP-completeness of estimating entries of matrix powers $\tilde A^m$ is associated with whether $\tilde A$ has entries apart from non-negative reals.
Given this, considered as a special case of HHL which is motivated by the comparison to the problem of Janzing and Wocjan, I'd like to know: is HHL still BQP-complete if all of the entries of $A$ and $\lvert b \rangle$ are in $\{0,1\}$ ?
"
"['bell-experiment', 'locc-operation']"," Title: CHSH test using unbounded operatorsBody: I want to perform a CHSH inequalities test using operators $A \, \& B$ and their combinations each possessed by Alice and Bob, which obey the following commutator relation.
$$[A, B] = 2C$$
Consider that the eigenvalue spectrum of all three operators is unbounded. I now want to recast them in the standard CHSH form by defining new operators such that their norm is less than or equal to unity. Given that the above operator relation holds, do there exist operators $A'$, $B'$ and $C'$ such that their eigenvalues lie between $-1$ and $1$, i.e.
$$||A'||\leq 1,\quad ||B'||\leq 1, \quad ||C'|| \leq 1,$$
such that
$$A' = f_1(A), \quad B' = f_2(B), \quad C' = f_3(C)$$
and the following relation holds?
$$[A', B'] = 2 C'$$
Note that this transformation will allow me to write down operators which replicate standard spin operators, using which the CHSH bound of "2" can be possibly violated on an entangled state in textbook fashion, as this relation is now similar to relation between spin generators. Is there a convenient algorithm to generate these new operator relations from the given commutator structure in the first equation? Or is there an easier way to perform the CHSH test using operators in the first equation?
"
"['quantum-gate', 'qiskit', 'ibm-q-experience', 'physical-realization']"," Title: Why are there such different UGate and U3Gate implementations in the Qiskit documentation?Body: The documentation for the new version Qiskit 0.20.0 states that:
- UGate is "Implemented using two X90 pulses on IBM Quantum systems:
$U(θ,ϕ,λ)=RZ(ϕ−π/2)RX(π/2)RZ(π−θ)RX(π/2)RZ(λ−π/2)$"
- U3Gate is "Implemented using two X90 pulses on IBM Quantum systems:
$U3(θ,ϕ,λ)=RZ(ϕ)RX(−π/2)RZ(θ)RX(π/2)RZ(λ)$"
It looks like only the latter matches the known rotation sequence for U3:
$z$-rotation ($\lambda$), $y$-rotation ($\theta$), $z$-rotation ($\varphi$)
Although their presentation matrices completely coincide:
$$
\mathrm{U3}=
\mathrm{U}=
\begin{pmatrix}
\cos(\theta/2) & -\mathrm{e}^{i\lambda}\sin(\theta/2) \\
\mathrm{e}^{i\phi}\sin(\theta/2) & \mathrm{e}^{i(\phi+\lambda)}\cos(\theta/2)
\end{pmatrix}.
$$
Is this an inaccuracy in the documentation or am I missing something and these gates are actually different?
Just in case, the aforementioned difference stated in the documentation refers to the hardware (not software) implementation of these gates on IBM Q systems.
"
"['quantum-gate', 'textbook-and-exercises', 'hadamard']"," Title: Hadamard direct mapping of input to output in $\theta$ and $\varphi$ formBody: I was wondering what would be an equation for Hadamard operation for a single qubit, given the input as the current $\theta$ (0 to $+\pi/2$) and $\varphi$ ($-\pi$ to $+\pi$) and output expected in $\theta$ and $\varphi$ with same ranges. Most expressions of Hadamard that I saw use Cartesian transformation, but not $\theta/\varphi$ transform.
I could convert the input to Cartesian form, and convert the output back into $\theta/\varphi$ form well, but I'm looking for an equation that does it without using Cartesian conversion step? The goal is to understand direct relation between input and output. I tried interpreting Hadamard as subtracting $\pi/4$ from $\theta$ and adding $\pi$ to phase, but I see that it doesn't quite work for arbitrary input.
Note: here $\varphi$ refers to relative phase ($-\pi$ to $+\pi$) and $\theta$ refers to component amplitude factor (0 to $+\pi/2$).
"
"['quantum-gate', 'gate-synthesis']"," Title: Adding a phase to qubit: why is it necessary for arbitrary single qubit gateBody: By convention, we often write a single qubit gate as:
$$U=e^{i \alpha} R_z(\beta) R_y(\gamma) R_z(\delta)$$
We notice that in addition to the three rotations, there is a coefficient $e^{i \alpha}$. What disturbs me is that this extra phase $e^{i \alpha}$ shouldn't really matter as it will only add a global phase in the computation. Thus, why is it usually written ? It it because we want to "mathematically" identify the expression of the unitary but in term of physics this phase will never be added in practice on a quantum computer ?
"
"['qiskit', 'programming', 'initialization']"," Title: Using QuantumCircuit.initialize() on a real quantum computerBody: Can the qiskit function QuantumCircuit.initialize be used to initiate any number of qubits (which exist currently on the quantum computers) and can it be used on a real quantum computer?
"
"['quantum-gate', 'speedup', 'continuous-variable']"," Title: Are there already hypothetical durations of how long a continuous-variable gate would take on a continuous-variable quantum computer?Body: I've heard that you run up against the very large constant factors when comparing run times of quantum and classical computers -- things simply take much longer in a carefully controlled quantum setup than in a GHz CPU. So even though a quantum algorithm may have exponential speed-up, we will start with a big constant-factor disadvantage and only realize an actual speed-up once the problem is large enough that the scaling advantage overcomes the constant factor. But what are these constant factors? So this question is actually two:
- Are there already hypothetical durations of how long a continuous-variable gate would take on a continuous-variable quantum computer?
- What are these constant factors that makes the speed up for quantum algorithms on qc more difficult?
"
"['quantum-state', 'programming', 'q#']"," Title: How to get state vector probabilities in Q#Body: Is there a similare function in Q# like Statevector.probabilities in Qiskit to get state vector probability, for example, if my circuit contains one qubit with one $H$ gate, the function returns something like [0.5, 0.5].
"
"['mathematics', 'textbook-and-exercises']"," Title: Confused about associativity of outer product notationBody: Consider this expression where $A$ and $B$ are matrices, $|i \rangle$ is a ket (column vector) and $\langle j |$ is a bra (row vector) :
$$
A | i \rangle \langle j | B \tag1\label1
$$
Due to the general associative properties of the bra-ket notation, this can be interpreted as the inner product of 2 vectors:
$$
\left( A | i \rangle \right) \left( \langle j | B \right) \tag2\label2
$$
But by regrouping the terms and considering that outer products can be given a matrix representation, \eqref{1} can also be interpreted as the product of 3 matrices:
$$
A (| i \rangle \langle j |) B \tag3\label3
$$
My confusion comes from the mismatch of the dimensions of expressions \eqref{2} and \eqref{3}. \eqref{2} yields a complex scalar, while \eqref{3} yields a matrix. If the associative property holds, I'd expect the dimensions not to depend on the grouping of the terms. Could somebody please shed some light where I am getting confused?
"
"['measurement', 'textbook-and-exercises', 'povm']"," Title: What are examples of non-trivial POVM measurements?Body: We know that generalized (POVM) measurement is defined by matrices $M_i$ which are
- Positive semidefinite
- Add up to a unit matrix, $\sum_i M_i = \mathbb{I}$
and the probability of obtaining outcome $i$ on state $\rho$ is
I can easily construct POVM example on a qubit by choosing
- $M_0 = |\Psi\rangle\langle\Psi|$
- $M_1 = \mathbb{I}- |\Psi\rangle\langle\Psi|$
But this is simply a projective measurement (on state $\Psi$).
How to construct a non-trivial (non-projective) POVM measurement example?
"
['amplitude-amplification']," Title: Amplitude amplification for known state but unknown amplitudeBody: I have a circuit that prepares a state $|s\rangle$ which is a superposition of the basis states $$\sum_{x=0}^{2^{n-1}}\alpha_x|x\rangle$$
with amplitude $\alpha_x$ for a circuit of $n$ qubits. Particularly, the solution to the problem I'm looking is on the state $|0\rangle$.
The challenge is that, $|0\rangle$ usually has a really low probability (and sometimes its not even present in the superposition).
I was wondering if there was a simple way to boost the amplitude of $|0\rangle$ given I know specifically location of my solution?
"
"['quantum-gate', 'quantum-state', 'unitarity']"," Title: Can we always find a unitary operation connecting qubit states with given eigendecompositions?Body: Consider the density matrices $\rho_0 = |0 \rangle \langle 0|$ and $\rho_1 = |1 \rangle \langle 1|$. Let $\{p_1, p_2\}$, and $\{p_3, p_4\}$ be two probability distributions, that is,
$$0 \leq p_1, p_2, p_3, p_4 \leq 1$$
$$p_1 + p_2 = 1$$
$$~\text{and}~ p_3 + p_4 = 1.$$
These probability distributions refers two mixed states $\rho = p_1 \rho_0 + p_2 \rho_1$ and $\rho' = p_3 \rho_0 + p_4 \rho_1$. Now I have the following questions:
- Is there is a unitary matrix $U$ such that $\rho' = U^\dagger \rho U$ ?
- How to calculate $U$ when all $p_1, p_2, p_3$ and $p_4$ are known, if $U$ exists?
- Can we represent $U$ with a quantum circuit with qubits if $U$ exists?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Implementing block of gates at different times in a same qiskit programBody: I am implementing an Ising chain over 8 qubits. It involves pair-wise CNOT between all the qubits. In the first time step, I am doing CNOTs between qubits 0 and 1, 2 and 3, 4 and 5, and 6 and 7. In the second time step, I would do CNOTs between qubits 1 and 2, 3 and 4, and 5 and 6. I have written the code as follows:
# Block A for the first time step
qp.cx(q0,q1)
qp.cx(q2,q3)
qp.cx(q4,q5)
qp.cx(q6,q7)
# Block B for the second time step
qp.cx(q1,q2)
qp.cx(q3,q4)
qp.cx(q5,q6)
I would like the gates in Block A to be applied simultaneously. Then, in the next step, gates in Block B should be applied simultaneously. How to convey to the compiler that I do not want the above written code to be compiled sequentially, rather I want it to be applied block-wise.
"
"['error-correction', 'quantum-operation', 'decoherence', 'kraus-representation']"," Title: Finding the irreducible representation of Kraus operators of a dephasing channelBody: I would like to understand an example of finding a noiseless subsystem of a quantum channel from the irreducible representation of its Kraus operators.
Assume we have $2$ dephasing channels acting on two qubits, then
$$\mathcal{E}(\rho_{AB})= \sum_{i=1}^4 K_i \rho_{AB} K_i^\dagger,$$
where the Kraus operators are
$$K_1=\mathbf{1}_{AB}/2,
\qquad K_2= \frac{1}{2}\mathbf{1}_{A}\otimes Z_B,
\qquad K_3=\frac{1}{2}Z_A\otimes \mathbf{1}_{B},
\qquad K_4=\frac{1}{2}Z_{A}\otimes Z_B.$$
How do I decompose this as $\bigoplus_j \mathbf{1}_{n_j}\otimes M(d_j) $? Will each Kraus operator be expressible in this decomposition?
I can see they are diagonal, and this channel has three decoherence-free subspaces; one spanned by $|00\rangle$, one spanned by $|11\rangle$,and one spanned by $\{|01\rangle,|10\rangle\}$.
As mentioned in this book, decoherence free subspaces are a special case of noiseless subsystems, where $M(d_j)$ is just a constant, and $n_j$ is the dimension of the decoherence-free subspace. How do I extract these $n_j$'s from the Kraus operators or their irreps?
Thanks in advance.
"
"['quantum-gate', 'complexity-theory', 'classical-quantum']"," Title: What is known about the quantum version of Schoening's algorithm for 3SAT?Body: Schoening's algorithm for 3SAT can be converted to a quantum algorithm. The classical circuit representing a 3SAT expression in CNF form can be converted to a quantum version involving reversible unitary gates and a lot of ancillary qubits. Flipping a variable (if the clause is not satisfied) can be done using CNOT, CCNOT, CCCNOT gates properly placed (also involving ancillary qubits ). The random choices that the algorithm makes can be implemented by "flipping a coin " and choosing what branches of the large quantum circuit to be activated at a given stage of the computation. In principle I see no problem in the implementation.
A related approach can be found here.
Two simplistic computations involving simple expressions with 1-clauses and 2-clauses are described here (in order to see what I'm looking for ):
first simplistic sample computation
second simplistic sample computation
Note that at each step a lot of states are affected. In terms of classical truth assignments it's like running a lot of classical Schoening algorithms in parallel. I am not talking about applying Grover's algorithm for 3SAT, I am thinking about translating Schoning's algorithm into a quantum algorithm.
Question. Have these types of algorithms been studied extensively, in order to assess their efficiency? What are the known results in this direction, and the open problems? More importantly (this is the main question), could anyone provide a proof that these algorithms are not polynomial?
"
"['mathematics', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Deriving $\left( A | v \rangle \right)^\dagger = \langle v | A^\dagger$ without using $A^\dagger=\left(A^* \right)^T$Body: From Nielsen & Chuang (10th edition), page 69:
Suppose $A$ is any linear operator on a Hilbert space, $V$. It turns
out that there exists a unique linear operator $A^\dagger$ on $V$ such
that for all vectors $|v\rangle$, $|w\rangle \in V$,
$$ (|v, A|w\rangle)=(A^\dagger|v\rangle, |w\rangle). \tag{2.32} $$
This linear operator is known as the adjoint or Hermitian conjugate of
the operator $A$. From the definition it is easy to see that $(AB)^\dagger = B^\dagger A^\dagger$. By convention, if $|v\rangle$ is a vector, then we define $|v\rangle^\dagger \equiv \langle v|$. With this definition it is not difficult to see that $(A|v\rangle)^\dagger = \langle v|A^\dagger$.
Well, to me it is difficult to see that
$$
(A|v\rangle)^\dagger = \langle v|A^\dagger \tag1\label1
$$
at least without invoking
$$
A^\dagger=\left(A^* \right)^T \tag2\label2
$$
which I don't want to do because the book haven't introduced \eqref{2} at this point!
I realise that by using the definition $|v\rangle^\dagger \equiv \langle v|$ and right multiplying it by $A^\dagger$ I get:
$$
|v\rangle^\dagger A^\dagger = \langle v| A^\dagger \tag3
$$
This is pretty close to \eqref{1} and I only need to show that
$$
|v\rangle^\dagger A^\dagger = (A|v\rangle)^\dagger \tag4\label4
$$
My first instinct was to use $(AB)^\dagger = B^\dagger A^\dagger$ here. However, this does not feel quite right because $A$ and $B$ are both linear operators but in \eqref{4} I'm dealing with a linear operator and a vector. I tried getting around this by going to the matrix representation of linear operators and extending the vector $|v \rangle$ into a matrix such as:
$$
B =
\begin{bmatrix}
\vert & \vert & \dots & \vert \\
|v \rangle & 0 & \dots & 0 \\
\vert & \vert & \dots & \vert \\
\end{bmatrix}
$$
Then I could invoke $(AB)^\dagger = B^\dagger A^\dagger$ but I'm not sure what to do with this because at this point in the book we don't know that $B^\dagger = \left(B^* \right)^T$. Therefore, we don't know that the first row of $B^\dagger$ will be $\langle v|$. Does anybody know how to proceed?
"
"['quantum-gate', 'circuit-construction']"," Title: Can low-rank factorizations approximate quantum circuits?Body: Quantum circuits can be expressed as the matrix product of each gate in the circuit, where each gate is a unitary matrix (say) $G_i$. So, the whole circuit is $S = G_n G_{n-1} \cdots G_1$.
Since $S$ is unitary there isn't a non-lossy decomposition that reduces the rank (and would therefore be more efficient), but it seems like we might be able to get a close approximation, which could potentially speed up any circuit.
Note: I'm very new to QC so it's very likely this question has a lot of misunderstandings - I just want some help clarifying my knowledge! Thanks!
"
"['qiskit', 'programming']"," Title: Trouble importing QiskitBody: When trying to import qiskit I obtain following error:
/opt/anaconda3/lib/python3.8/site-packages/qiskit/__init__.py:63: RuntimeWarning: Could not import the Aer provider from the qiskit-aer package. Install qiskit-aer or check your installation.
warnings.warn('Could not import the Aer provider from the qiskit-aer '
/opt/anaconda3/lib/python3.8/site-packages/qiskit/__init__.py:73: RuntimeWarning: Could not import the IBMQ provider from the qiskit-ibmq-provider package. Install qiskit-ibmq-provider or check your installation.
warnings.warn('Could not import the IBMQ provider from the '
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-578b7f7e9727> in <module>
----> 1 import qiskit
/opt/anaconda3/lib/python3.8/site-packages/qiskit/__init__.py in <module>
78 # Moved to after IBMQ and Aer imports due to import issues
79 # with other modules that check for IBMQ (tools)
---> 80 from qiskit.execute import execute # noqa
81 from qiskit.compiler import transpile, assemble, schedule # noqa
82
/opt/anaconda3/lib/python3.8/site-packages/qiskit/execute.py in <module>
24 import logging
25 from time import time
---> 26 from qiskit.compiler import transpile, assemble, schedule
27 from qiskit.qobj.utils import MeasLevel, MeasReturnType
28 from qiskit.pulse import Schedule
/opt/anaconda3/lib/python3.8/site-packages/qiskit/compiler/__init__.py in <module>
33
34 from .assemble import assemble
---> 35 from .transpile import transpile
36 from .schedule import schedule
/opt/anaconda3/lib/python3.8/site-packages/qiskit/compiler/transpile.py in <module>
22 from qiskit.providers.models import BackendProperties
23 from qiskit.providers.models.backendproperties import Gate
---> 24 from qiskit.transpiler import Layout, CouplingMap, PropertySet, PassManager
25 from qiskit.transpiler.basepasses import BasePass
26 from qiskit.dagcircuit import DAGCircuit
/opt/anaconda3/lib/python3.8/site-packages/qiskit/transpiler/__init__.py in <module>
412 """
413
--> 414 from .runningpassmanager import FlowController
415 from .passmanager import PassManager
416 from .passmanager_config import PassManagerConfig
/opt/anaconda3/lib/python3.8/site-packages/qiskit/transpiler/runningpassmanager.py in <module>
21 from time import time
22
---> 23 from qiskit.dagcircuit import DAGCircuit
24 from qiskit.converters import circuit_to_dag, dag_to_circuit
25 from .propertyset import PropertySet
/opt/anaconda3/lib/python3.8/site-packages/qiskit/dagcircuit/__init__.py in <module>
39 DAGCircuitError
40 """
---> 41 from .dagcircuit import DAGCircuit
42 from .dagnode import DAGNode
43 from .dagdepnode import DAGDepNode
/opt/anaconda3/lib/python3.8/site-packages/qiskit/dagcircuit/dagcircuit.py in <module>
29 import math
30
---> 31 import retworkx as rx
32 import networkx as nx
33
/opt/anaconda3/lib/python3.8/site-packages/retworkx/__init__.py in <module>
7 # that they have been altered from the originals.
8
----> 9 from .retworkx import *
10
11
ModuleNotFoundError: No module named 'retworkx.retworkx'
Have I installed Qiskit to the target directory incorrectly?
I attempted to install Qiskit in Terminal using:
python3 -m pip install qiskit -t /opt/anaconda3/lib/python3.8/site-packages.
I navigated to the path manually and I could find all the qiskit modules, including the retworkx modules (whatever it may be).
If anybody has experienced this sort of error before and happens to know a fix, I would appreciate it very much.
"
['circuit-construction']," Title: Difference between a Non-Gaussian Circuit and Gaussian CircuitBody: I am fairly new to this topic and I couldn't find resources that were beginner-friendly. So basically what are the differences between these two?
"
"['mathematics', 'textbook-and-exercises', 'entropy']"," Title: How is $S(\rho)=H(p_{i})+\sum_{i}p_{i}S(\rho_{i})\le \log(d)$ possible if $\rho_{i}$ are not pure states?Body: I know how this can be proved using the quantum relative entropy. However, even with this proof, and am still confused about how this emerges.
Say I have a source that produces two states $\rho_1$ and $\rho_{2}$ with probability a half each, and both are mixed states, ie $S(\rho_i)>0$ for each of them. The dimensions of the Hilbert space is $2$.
How can $S(\rho)=H(p_{i})+\sum_{i}p_{i}S(\rho_{i})\le \log(d)$, given that $H(p_{i})=1$ and $S(\rho_i)>0$, given that $\log(d)=\log(2)=1?$
I am assuming that I am missing something obvious in the actual construction of $\rho$, in that something is bounding $H(p_{i})$ away from 1. I am assuming this has something to do with orthogonal supports, as $S(\rho) \le H(p)+\sum_{i}p_iS(\rho_{i})$ if they are not orthogonal.
"
"['quantum-operation', 'quantum-process-tomography']"," Title: Why the chi-matrix fidelity of the process is the fidelity of the chi-matrix noise mapBody: I am following this paper, and I am stuggling with a derivation.
Basically, I consider an orthonormal basis $\{B_i \}$ with respect to Hilbert-Schmidt scalar product, on the density matrix space $\mathcal{L}(H)$.
I have a noisy process: $\mathcal{E}=\mathcal{N} \circ \mathcal{U}$ which tries to implement the unitary map $\mathcal{U}$. The noise map $\mathcal{N}$ is actually defined from this last equation.
We can decompose those process on the basis $\{B_i\}$ which define the so-called $\chi$ matrix. We have:
$$ \mathcal{E}(\rho) = \sum_{ij} \chi_{\mathcal{E}}^{ij} B_i \rho B_j^{\dagger} $$
$$ \mathcal{U}(\rho) = \sum_{ij} \chi_{\mathcal{U}}^{ij} B_i \rho B_j^{\dagger} $$
$$ \mathcal{N}(\rho) = \sum_{ij} \chi_{\mathcal{N}}^{ij} B_i \rho B_j^{\dagger} $$
I am struggling to prove that the fidelity of the process which is defined as: $F(\mathcal{E},\mathcal{U})=Tr(\chi_{\mathcal{E}}\chi_{\mathcal{U}})$ verifies:
$$F(\mathcal{E},\mathcal{U})=F(\mathcal{N},\mathcal{I})$$
$\mathcal{I}$ being the identity map.
In the paper he work with the particular basis $\{B_i\}$ being the Pauli basis. I considered a general orthonormal basis in my derivation. I don't know if it is why I don't find the appropriate result. I would like to avoid using any external result such as the fidelity of the process is equal to the average fidelity of the output state with respect to the ideal one.
Is it possible to have a simple proof of that ? Does it indeed works even without considering the particular Pauli basis as the orthonormal basis ?
[edit]: I just realized that chi matrix associated to different basis of $\mathcal{L}(H)$ are related via unitary transformation. Thus prooving it on the Pauli basis is enough. So I just need to understand how to derive it on the Pauli basis.
"
"['algorithm', 'hadamard']"," Title: Hadamard Test to calculate imaginary partBody: I am trying to understand the Hadamard Test by finding the average value of $U_1$, which is a diagonal matrix with $1$ everywhere except on the first element.
I performed the regular Hadamard Test as presented in the wiki page:
and so far so good, everything works as it should.
What is the circuit variant to perform the Hadamard Test to calculate the imaginary part? The wiki page says you only have to start with $\frac{1}{\sqrt{2}}(|0\rangle-i |1\rangle)$ instead of $H|0\rangle$, I attempted doing the test adding a phase shift of -i on $|0\rangle$ by applying $U_s$ = $\begin{bmatrix}\ 1 & 0 \\ 0 & -i \end{bmatrix}$ on the control qubit after $H$, but all im getting is random measurements
"
"['fidelity', 'partial-trace']"," Title: Given $\rho,\sigma$ such that $F(\rho,\sigma)=0$, what can we say about $F(\text{Tr}_A(\rho),\text{Tr}_B(\sigma))$?Body: Lets say $\rho,\sigma$ satisfy $F(\rho,\sigma)=0$, i.e., they are quantum states living on orthogonal supports. What can we say about $F(\text{Tr}_A(\rho),\text{Tr}_B(\sigma))$?
I am looking for upper bounds here, so we clearly know that $$F(\text{Tr}_A(\rho),\text{Tr}_B(\sigma))\geq F(\rho,\sigma)=0$$
but this is trivial. Can we prove any upper bound? I don't mind if we also assume $\rho,\sigma$ are pure states, in which case can we give a non-trivial upper bound?
One example I tried was orthogonal EPR pairs which satisfied RHS=0 and LHS (i.e., after taking partial trace)=$\frac{1}{2}$. But is this the maximum one can achieve for orthogonal quantum states?
"
"['qiskit', 'grovers-algorithm']"," Title: Grover's 3-qubits tutorial: Why we need the last X gatesBody: I'm following the tutorial in Grover's Algorithm - Example 3 qubits
I'm trying to understand the amplitude amplification using the reflection. But I cannot understand if we really need the step 3d (apply X gates to the 3 qubits).
As described in the tutorial, the state before and after are the same (and I have checked using the 'statevector_simulator'
Why do we need this step?
This is my code (doubt in line DO WE REALLY NEED?!?)
def oracle(qc: QuantumCircuit, qr: QuantumRegister):
# Combined: Negate |101> and |110>
qc.cz(qr[0],qr[2]) # Negate |101> and |111>
qc.cz(qr[1], qr[2]) # Negate |110> and |111>
qc.barrier(qr[0]) # stetic only
# Perform the reflection around the average amplitude
def diffuser(qc: QuantumCircuit, qr: QuantumRegister):
# |𝜓3𝑎⟩=1/2(|000⟩+|011⟩+|100⟩−|111⟩)
qc.h(qr)
# |𝜓3𝑏⟩=1/2(−|000⟩+|011⟩+|100⟩+|111⟩)
qc.x(qr)
# |𝜓3𝑐⟩=1/2(−|000⟩+|011⟩+|100⟩−|111⟩)
# Do controlled-Z
qc.barrier(qr[0])
qc.barrier(qr[1])
qc.h(2)
qc.ccx(0,1,2)
qc.barrier(qr[0])
qc.barrier(qr[1])
qc.h(2)
# DO WE REALLY NEED?!?
# |𝜓3𝑑⟩=1/2(−|000⟩+|011⟩+|100⟩−|111⟩)
# qc.x(qr)
# |𝜓3𝑒⟩=1/√2(−|101⟩−|110⟩)
qc.h(qr)
# endregion oracles/checkers
# 3 Qubits circuit
n = 3
qr = QuantumRegister(n)
qc = QuantumCircuit(qr)
# for qubit in range(n):
# grover_circuit.h(qubit)
# Initialize: All inputs in uniform superposition
# |𝜓1⟩=1/√8(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩+|101⟩+|110⟩+|111⟩)
qc.h(qr)
# Apply oracle
# |𝜓2⟩=1/√8(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩−|101⟩−|110⟩+|111⟩)
oracle(qc, qr)
# Apply augmentation
diffuser(qc, qr)
# Plot circuit
qc.draw('mpl')
plt.show()
# Get state vector (simulated one run)
backend_sv = Aer.get_backend('statevector_simulator')
job_sv = execute(qc, backend_sv)
statevec = job_sv.result().get_statevector()
print('Qiskit statevector')
for cn in statevec:
rcn = complex(round(cn.real, 8), round(cn.imag, 8))
print(f'{rcn:+.2g}')
# Get unitary (simulated one run)
backend_uni = Aer.get_backend('unitary_simulator')
job_uni = execute(qc, backend_uni)
unitary = job_uni.result().get_unitary()
print('Qiskit unitary')
print(unitary)
# Add measure and simulate
qc.measure_all()
backend_sim = Aer.get_backend('qasm_simulator')
shots = 1024
results = execute(qc, backend=backend_sim, shots=shots).result()
answer = results.get_counts()
plot_histogram(answer)
plt.show()
"
"['entanglement', 'textbook-and-exercises', 'deutsch-jozsa-algorithm']"," Title: Prove entanglement in the final state of the Deutsch-Jozsa circuitBody: I am asked to prove the following:
Consider the Deutsch-Jozsa circuit. The output of the circuit is of the form $|\psi\rangle \otimes \frac{1}{\sqrt{2}}(|0\rangle-|1\rangle)$. Prove that the state$|\psi\rangle$ right before the measure is entangled if and only if it is entangled right before applying the final series of $H$ gates (Hadamard gates)
Here's my attempt.
Let $|\psi_m\rangle$ be the state right before the measure and $|\psi_h\rangle$ be the state right before applying the final Hadamard gates (i.e $|\psi_m\rangle = H^{\otimes n}|\psi_h\rangle$)
$|\psi_m\rangle$ entangled $\Rightarrow |\psi_h\rangle$ entangled :
Assume $|\psi_h\rangle$ is not entangled. Then $|\psi_h\rangle$ can be written as:$$|\psi_h\rangle
=|x_1\rangle \otimes...\otimes|x_n\rangle$$
If we now apply the $H$ gates, we get:$$H|x_1\rangle \otimes...\otimes H|x_n\rangle$$ $$=\frac{1}{2^{n/2}}\big[(|0\rangle+(-1)^{x_1}|1\rangle) \otimes ... \otimes (|0\rangle+(-1)^{x_n}|1\rangle) \big] $$
Unless there's something I misunderstood or miscalculated, I do not see how this could be not entangled.
Could you please help me out there, please?
Also, I have no idea how to prove the if-part.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: Asymmetry in distributing phase change across componentsBody: The quantum computing text books and theory in general seems to have added an asymmetry in the distribution of change in phase across the components in the context of a qubit. Is there any reason for this? I know that global phase can be ignored and it allows us to assign all change to only one component. But I have observed that the impact would be different in multi-qubit contexts. For example, a controlled phase rotation between two qubits would no longer be symmetrical, if the phase distribution is symmetrical, in contradiction to what the textbook and many algorithms consider.
Is this asymmetry introduced due to any physics/hardware related problem which forbids distributing the phase change equally? Or is it only a software trick to reduce the operations (one instead of two with half change)?
I'm generally concerned about any loss of symmetry in such a beautiful and natural science. I don't think the nature itself pushes any changes entirely to one component. If it is a reference frame issue (we want to align our reference frame with one of the component for our convenience), then I'm afraid that this reference frame needs to a global one (single one for all qubits), but I see that this reference frame is local to each qubit, which appears quite artificial to me.
"
"['qiskit', 'programming', 'measurement']"," Title: Can we measure the quantum circuit sequently when using Qiskit?Body: In some quantum algorithms, the output of the quanutm circuit is probabilistic. For example. the measurement outcome (once) for a specific qubit "0" indicates success, which means that the resulting state is what we desired. Therefore, we can first measure that special qubit for once, if the outcome is "0", then we measure the rest, othervise, we will not record this time. Can this be done in Qiskit?
I tried to solve this in another way. I don't care the qubit, after the measurement is finished, the indicater and the working system will be a joint state $\rho_{is}$, where i and s represents the indicater and system. Then we can project this state as:
$$\rho_s=P\rho_{is}P^{\dagger}$$
with $P=|0\rangle \langle 0|\otimes I_s$ the projector operator. But when I put this into a function called "state_fidelity" with one other density matrix, it is error with information that the input is not a valid. Is there any points that I was wrong?
Thanks for help!
"
['quantum-operation']," Title: Are two outputs of a quantum operation (CPTP map) themselves related by a quantum operation?Body: $\def\ket#1{|#1\rangle}
\def\bra#1{\langle#1|}
\def\mt#1{\mathrm{#1}}
\def\E{\mathcal E}
\def\F{\mathcal F}$
Let $\ket\phi$ and $\ket\psi$ be pure states on the same quantum system, so that $\ket\psi=\mt U\ket\phi$ for some unitary $\mt U$.
Say we have a quantum operation (CPTP map) $\E$, and write $\sigma_\phi=\E(\ket\phi\bra\phi)$, $\sigma_\psi=\E(\ket\psi\bra\psi)$.
Question: given that $\ket\psi$ and $\ket\phi$ are related by a unitary $\mt U$, are $\sigma_\psi$ and $\sigma_\phi$ related by a quantum operation? I.e. does there exist a quantum operation $\F$ such that $\sigma_\psi=\F(\sigma_\phi)$ (or the other way around)?
My feeling says this has to be true, but I'm struggling to prove it.
"
"['quantum-state', 'programming', 'mathematics', 'cirq']"," Title: Create this state using CIRQ Coding languageBody: I needed help with CIRQ coding as I'm quite new to Quantum Computing.
I read the tutorials on CIRQ but don't really understand it.
I'd be very thankful if someone could help.
A program to create the state using CIRQ coding.
A program to create the state $\frac{1}{\sqrt 2}(|00\rangle+|11\rangle)$.
"
"['qiskit', 'hamiltonian-simulation', 'pauli-gates', 'tensor-product', 'vqe']"," Title: Changing the BasisBody: I am attempting to use a VQE algorithm to find the ground state of a deuterium nucleus by applying a constructed hamiltonian to an ansatz state with one parameter created by a circuit. While I am getting a different expectation value for different parameters, it does not line up with what I am supposed to get (from the paper I am attempting to replicate). I think the basis is wrong. How should I change the basis to fit the hamiltonian I am using? Should I change the basis of the hamiltonian (which I got from tensor products of pauli operators)? Or should I change the basis of the ansatz itself to fit that of the hamiltonian?
PS: https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.120.210501 this is the paper whose results I am trying to replicate (The H2 graph to be specific). They are using ↑ and ↓ as their basis while I am still on qiskit's default 0 and 1
"
"['qiskit', 'programming', 'noise', 'fidelity', 'qasm']"," Title: Is there any way we get the state vector/density matrix of a noisy simulation in qiskit?Body: In Qiskit we can't use noise models in the 'state vector_simulator' or the 'unitary simulator', hence making it impossible to compute fidelity of the output of the noisy circuit and the noiseless circuit. We can, of course, do a noisy simulation using the qasm simulator but it gives us the probability distribution instead of a state vector/density matrix. How do we compare the fidelity in this case?
Or is there any other way to do it?
"
"['nielsen-and-chuang', 'textbook-and-exercises', 'unitarity']"," Title: Nielsen & Chuang Theorem 2.6 ProofBody: I got a problem in understanding the proof of the Theorem 2.6 (Unitary freedom in the ensenble for density matrices), 2.168 and 2.169 in the Nielsen and Chuang book
Equation 2.168
Suppose $|{\tilde\psi_i}\rangle = \sum_j{u_{ij}|{\tilde\varphi_j}\rangle}$ for some unitary $u_{ij}$. Then
$\sum_i{|{\tilde\psi_i}\rangle\langle\tilde\psi_i|} = \sum_{ijk}{u_{ij}u_{ik}^*|\tilde\varphi_j\rangle\langle\tilde\varphi_j|}$ (2.168)
I don't get this step. If I take $\langle\tilde\psi_i|=(|\tilde\psi_i\rangle)^\dagger=\sum_j(u_{ij}|\tilde\varphi_j\rangle)^\dagger=\sum_j{\langle\tilde\varphi_j|u_{ij}^\dagger}$ and substitute this in the outer product I receive $\sum_i{|{\tilde\psi_i}\rangle\langle\tilde\psi_i|} = \sum_{ijk}{u_{ij}|\tilde\varphi_j\rangle\langle\tilde\varphi_j|u_{ik}^\dagger}$
Can someone explain this to me please?
Equation 2.169 -> 2.170
$$\sum_{jk}{(\sum_i{u_{ki}^\dagger u_{ij})}|\tilde\varphi_j\rangle\langle\tilde\varphi_k|} = \sum_{jk}{\delta_{kj}|\tilde\varphi_j\rangle\langle\tilde\varphi_k|}$$
I can't understand why $(\sum_i{u_{ki}^\dagger u_{ij}}) = \delta_{kj}$.
I understand that $u_{ki}^\dagger u_{ij} = I$ for $k=j$, but why is it zero otherwise?
It would be so kind if someone could enlighten me.
"
"['programming', 'ibm-q-experience', 'simulation', 'vqe']"," Title: Unable to retrieve result for Job Error during VQE simulationBody: I am attempting to run a VQE calculation on the 'ibmq_qasm_simulator'. The job is failing with a series of errors caused by:
qiskit.providers.ibmq.job.exceptions.IBMQJobApiError: "Unable to retrieve result for job 5f46829baa801d001a09d0d7: '404 Client Error: Not Found for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs/5f46829baa801d001a09d0d7/resultDownloadUrl. Cannot get presigned download url., Error code: 3202.'"
I have used the same code on the statevector simulator successfully. I have copied the full error message below:
FAILURE: Can not get job id, Resubmit the qobj to get job id. Terra job error: 'Error submitting job: \'(\\\'Connection aborted.\\\', OSError("(110, \\\'ETIMEDOUT\\\')"))\''
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/api/session.py", line 250, in request
response.raise_for_status()
File "/opt/conda/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs/5f46829baa801d001a09d0d7/resultDownloadUrl
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py", line 856, in _retrieve_result
result_response = self._api.job_result(self.job_id(), self._use_object_storage)
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/api/clients/account.py", line 243, in job_result
return self._job_result_object_storage(job_id)
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/api/clients/account.py", line 263, in _job_result_object_storage
download_url = job_api.result_url()['url']
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/api/rest/job.py", line 147, in result_url
return self.session.get(url).json()
File "/opt/conda/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/api/session.py", line 270, in request
raise RequestsApiError(message) from ex
qiskit.providers.ibmq.api.exceptions.RequestsApiError: '404 Client Error: Not Found for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs/5f46829baa801d001a09d0d7/resultDownloadUrl. Cannot get presigned download url., Error code: 3202.'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "OH-_iqs_length.py", line 90, in <module>
ret = vqe.run(quantum_instance)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py", line 70, in run
return self._run()
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 362, in _run
optimizer=self.optimizer)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/vq_algorithm.py", line 201, in find_minimum
gradient_function=gradient_fn)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/components/optimizers/slsqp.py", line 87, in optimize
options=self._options)
File "/opt/conda/lib/python3.7/site-packages/scipy/optimize/_minimize.py", line 618, in minimize
constraints, callback=callback, **options)
File "/opt/conda/lib/python3.7/site-packages/scipy/optimize/slsqp.py", line 423, in _minimize_slsqp
g = append(fprime(x), 0.0)
File "/opt/conda/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 327, in function_wrapper
return function(*(wrapper_args + args))
File "/opt/conda/lib/python3.7/site-packages/scipy/optimize/slsqp.py", line 63, in approx_jacobian
jac[i] = (func(*((x0+dx,)+args)) - f0)/epsilon
File "/opt/conda/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 327, in function_wrapper
return function(*(wrapper_args + args))
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 450, in _energy_evaluation
sampled_expect_op = self._circuit_sampler.convert(self._expect_op, params=param_bindings)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/operators/converters/circuit_sampler.py", line 194, in convert
param_bindings=param_bindings)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/operators/converters/circuit_sampler.py", line 272, in sample_circuits
had_transpiled=self._transpile_before_bind)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/quantum_instance.py", line 374, in execute
self._skip_qobj_validation, self._job_callback)
File "/opt/conda/lib/python3.7/site-packages/qiskit/aqua/utils/run_circuits.py", line 302, in run_qobj
results.append(job.result(**qjob_config))
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py", line 276, in result
return self._retrieve_result(refresh=refresh)
File "/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/job/ibmqjob.py", line 869, in _retrieve_result
'job {}: {}'.format(self.job_id(), str(err))) from err
qiskit.providers.ibmq.job.exceptions.IBMQJobApiError: "Unable to retrieve result for job 5f46829baa801d001a09d0d7: '404 Client Error: Not Found for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs/5f46829baa801d001a09d0d7/resultDownloadUrl. Cannot get presigned download url., Error code: 3202.'"
How can i do about fixing this? Any help would be greatly appreciated!
"
"['quantum-gate', 'quantum-state', 'qiskit', 'programming']"," Title: Optimize chains of single-qubit u1, u2, u3 gates by combining them into a single gate in QikistBody: Can anyone explain how Qiskit does the merging of single-qubit gates for the purpose of optimization?
u1(lambda1) * u1(lambda2) = u1(lambda1 + lambda2)
u1(lambda1) * u2(phi2, lambda2) = u2(phi2 + lambda1, lambda2)
u2(phi1, lambda1) * u1(lambda2) = u2(phi1, lambda1 + lambda2)
u1(lambda1) * u3(theta2, phi2, lambda2) = u3(theta2, phi2 + lambda1, lambda2)
u3(theta1, phi1, lambda1) * u1(lambda2) = u3(theta1, phi1, lambda1 + lambda2)
- Using Ry(pi/2).Rz(2lambda).Ry(pi/2) = Rz(pi/2).Ry(pi 2lambda).Rz(pi/2),
u2(phi1, lambda1) * u2(phi2,lambda2) = u3(pi - lambda1 - phi2, phi1 + pi/2, lambda2 + pi/2)
- For composing u3's or u2's with u3's,u2(phi,lambda) = u3(pi/2, phi, lambda)
How do they come up with these equations? Is there a property to derive them?
"
"['qiskit', 'programming', 'resource-request', 'optimization']"," Title: Optimization using Quantum LogicsBody: Is it possible to solve the following kind of optimization using Quantum Computing?
Minimize
5*x1 - 7*x2
binary
x1
x2
If yes, is it possible to have a sample code using QISKit?
"
"['quantum-state', 'physical-qubit', 'interpretations']"," Title: In $|x_1,...,x_n\rangle$, can the individual constituents be called qubits?Body:
A qubit is a quantum system in which the Boolean states 0 and 1 are
rep- resented by a prescribed pair of normalised and mutually
orthogonal quantum states labeled as ${|0⟩, |1⟩}$
According to [1]. Then a quantum register $\mid x_1x_2...x_n\rangle, x_i\in\{0,1\}$ is defined to be collection of n qubits.
Now I often see expressions like $\mid x_1, ... x_n \rangle$ where the $x_i$ belong to some $S \subset \mathbf{Z}$.
- Can the individual constituents $\mid x_i \rangle$ be called qubits even though they are non-binary?
- Would it be appropriate to call $\mid x_1, ... x_n \rangle$ a qubit register in this case?
- What is the physical interpretation of such a register?
"
"['quantum-gate', 'qiskit']"," Title: Unexpected Relative Phase while making the Toffoli GateBody: I was trying to build the Toffoli gate using the following diagram (found in the qiskit textbook):
So, I set V := Rx(pi/2) (as shown in the following diagram) (Note: that I am switching now to the little-endian format)
However, the unitary matrix equivalent to the previous was
$$
\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 & -i\\
0 & 0 & 0 & 0 & 0 & 0 & -i & 0\\
\end{pmatrix}
$$
That will lead to a relative phase of $(-i)$ in the states $\lvert 110 \rangle$ and $\lvert 111 \rangle$
What is the reason for that?
"
"['programming', 'cirq']"," Title: Reordering commuting gates in cirq to reduce circuit depth?Body: The main functionality for ordering gates in a cirq circuit that I'm aware of is using the predefined insert strategies of cirq.Circuit.insert(). As far as I see, none of the predefined strategies use the possibility to shuffle commuting gates to reduce circuit depth, i.e. that CNOTs that share the same target or control commute, etc. The docs also don't seem to mention anything like this.
I'd like to specifically use the commutation rules of CNOTs to reduce the depth of my circuits, and before I start writing my own code, my question is: does cirq provide any functionality of this sort?
"
"['mathematics', 'textbook-and-exercises', 'shors-algorithm']"," Title: Eigenvectors and eigenvalues of the gate $U_a:|s\rangle\mapsto|sa \bmod N\rangle$Body: I'm studying Shor algorithm. This is a demostration about the eigenvectors and eigenvalues of $U_a$ gate:
Can somebody explain me from the third step to the last?
"
"['quantum-state', 'entanglement', 'correlations']"," Title: Example of a two-qudit state whose measurement outcomes are independent in one basis but dependent in anotherBody: If you have a pure composite system whose two subsystems are in a product state, then the outcomes of measuring the subsystems (in any basis) are statistically independent. If the subsystems are entangled, then the measurement outcomes will generically be correlated.
Is there an example of an entangled state of a composite system of two isomorphic qudits, such that if you measure both subsystems in one basis, then the subsystems' measurement outcomes in that basis are independent, but if you measure both subsystems in another basis, then the outcomes are correlated?
For example, is there an entangled state $|\psi\rangle$ of two qubits such that for the joint probability mass function for a measurement in the $Z$-basis
$$\left\{ P(\uparrow, \uparrow) = |\langle \uparrow \uparrow | \psi\rangle|^2, P(\uparrow, \downarrow) = |\langle \uparrow \downarrow | \psi\rangle|^2, P(\downarrow, \uparrow) = |\langle \downarrow \uparrow | \psi\rangle|^2, P(\downarrow, \downarrow) = |\langle \downarrow \downarrow | \psi\rangle|^2 \right\},$$
the measurement outcomes of the two qubits are independent, but for the joint probability mass function for a measurement of the same state in the $X$-basis
$$\left\{ P(+, +) = |\langle + + | \psi\rangle|^2, P(+, -) = |\langle + - | \psi\rangle|^2,\\ P(-, +) = |\langle - + | \psi\rangle|^2, P(-, -) = |\langle - - | \psi\rangle|^2 \right\},$$
the measurement outcomes of the two qubits are dependent?
I don't see why this shouldn't be possible, but I can't think of an example.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: IBMQFactory object has not attribute backendsBody: I try to run simple circuit measurement program using Qiskit in Visual Code. I received this error:
AttributeError: 'IBMQFactory' object has no attribute 'backend'
from the line of code print(IBMQ.backends())
Does anyone know what this mean and how to solve it?
"
"['mathematics', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Nielsen & Chuang Exercise 2.32: Show that the tensor product of two projectors is a projectorBody: $\newcommand{\bra}[1]{\left<#1\right|}
\newcommand{\ket}[1]{\left|#1\right>}$Here is what I tried:
Given that we have two projectors:
$$
A = \sum_i \ket{i} \bra{i}, \hspace{2em}
B = \sum_j \ket{j} \bra{j}
$$
The goal is to prove that:
$$
A \otimes B = \sum_k \ket{k} \bra{k}. \tag1\label1
$$
Plugging into \eqref{1}, we get:
$$
A \otimes B
= \left( \sum_i \ket{i} \bra{i} \right) \otimes \left( \sum_j \ket{j} \bra{j} \right)
= \sum_{i,j} \ket{i} \bra{i} \otimes \ket{j} \bra{j}
\tag{2}\label{2}
$$
I'm not sure how to proceed from \eqref{2}. It would be convenient if for every $\ket{i}$ and $\ket{j}$ there is a $\ket{k}$ for which the following identity is true:
$$
\ket{k} \bra{k} = \ket{i} \bra{i} \otimes \ket{j} \bra{j} \tag{3}\label{3}
$$
This would prove \eqref{1} immediately. Is \eqref{3} true though? If yes, why? If not, how else can we proceed to prove \eqref{1}?
"
"['textbook-and-exercises', 'trace-distance']"," Title: Relation between trace distance and inner product between pure statesBody: Let $|\phi\rangle,|\psi\rangle$ be two state vectors, and let $d=\frac{1}{2}\mathrm{Tr}(\sqrt{(|\phi\rangle\langle\phi|-|\psi\rangle\langle\psi|)^2})$ be their trace distance. Then it will always hold that $d = \sqrt{1-|\langle\phi|\psi\rangle|^2}$.
I'm looking for a reference for this result. A textbook reference would be optimal, but any papers mentioning the result would be fine as well.
"
"['qiskit', 'programming']"," Title: When defining the state vector of a qubit in qiskit, what difference does putting ""j"" make?Body: I'm following the Qiskit textbook. I'm currently here: https://quantum-computing.ibm.com/jupyter/user/qiskit-textbook/content/ch-states/representing-qubit-states.ipynb
Here's an example of my initialization code:
initial_state = [1/sqrt(2), 1j/sqrt(2)]
qc = QuantumCircuit(1)
qc.initialize(initial_state, 0)
state = execute(qc,backend).result().get_statevector()
print(state)
[0.70710678+0.j 0. +0.70710678j]
results = execute(qc,backend).result().get_counts()
plot_histogram(results)
When I plot this to a histogram, the same 50/50 distribution occurs as when I remove the imaginary "j" from the initialization. Why is the j in there?
"
"['quantum-operation', 'superposition']"," Title: Can I switch $\alpha_0$ and $\alpha_1$ conditionally to $\alpha_0>0$ in a state $\alpha_0|0\rangle+\alpha_1|1\rangle$?Body: I have a single qubit $a$ in state
$$ |s\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle $$
$\alpha_0$ may be 0 whereas $\alpha_1$ is always positive and above $0$. Almost always $$\alpha_0 << \alpha_1$$
Is there any way to flip $\alpha_0$ and $\alpha_1$ if and only if $\alpha_0 > 0$?
I was thinking of having two ancillary qubits and perform two controlled CNOTs to detect both state $0$ and state $1$ and then CCNOT with those two ancillary qubits to flip $a_0$ and $a_1$
But does this make sense? I am not sure if detecting a superposition is possible in this way
"
"['classical-computing', 'speedup']"," Title: Can hash functions speed up quantum simulation? (Generalizing May and Schlieper's idea)Body: Recently May and Schlieper have published a preprint (https://arxiv.org/abs/1905.10074) arguing that the modular exponential register in Shor's algorithms can be replaced with a universally hashed modular exponential register. I've previously asked here ( Shor's Discrete Logarithm Algorithm with a QFT with a small prime base) whether Shor's algorithm for discrete logarithms (which can be used for factoring semiprimes) can be modified to only output the logarithm modulo some small prime $w$ (it seems it can). If further, the QFT can be factored into $\bmod w$ and $\bmod L$ (where $N=Lw$ is about the size of the group order) QFTs, (see the later comments and the second answer) the output qubits can be found through a quantum circuit with only $\mathrm{O(\log N)}$ qubits. $\mathrm{O(\log N)}$ runs with different small prime bases suffice to reconstruct using the Chinese Remainder Theorem the entire logarithm in polynomial time (roughly quintic).
Obviously this could be wrong, but while that's open, one can ask whether May and Schlieper's hashing trick can be extended to estimating probability amplitudes for general quantum circuits. I've tried to make my argument as terse for Stack Exchange and I've focused on the proof of compressibility and left out details about how Markov random fields should represent hashed quantum circuits.
A quantum circuit can be treated as an exponentially large Factor Analysis (FA) problem. The variables and factors are the basis vectors at each layer of the quantum circuit. The quantum gates are linear transformations from factors (which can also be variable) to variables (which can also be factors). The gates are assumed to have (an arbitrary, non-physical) Gaussian noise, which allows FA to work. Factors and variables are related by
\begin{equation}
x_{i+1,b} = G_ix_{i,a} + n_{i+1,b}
\end{equation}
where $n$ is Gaussian noise, $x_i$ are the values of variables representing the probability amplitudes at each layer and $G_i$ is the unitary quantum gate. This implies Gaussian distributions like
\begin{equation}
p(x_{i+1,a}) = \frac{1}{\sqrt{2\pi\sigma_{i,a}^2}} \exp{\bigg( -\frac{[x_{i+1,a} - G_{i}x_{i,b}]^2}{\sigma_{i,a}^2} \bigg)}
\end{equation}
which can then be converted to a MRF.
(Explanation of Factor Analysis)
http://users.ics.aalto.fi/harri/thesis/valpola_thesis/node37.html
https://www.cs.ubc.ca/~murphyk/Teaching/CS532c_Fall04/Lectures/lec17.pdf
This FA problem can, by the Hammersley–Clifford theorem, be converted into a Markov Random Field (MRF) whose nodes are variables and whose edges are shared variance between the nodes. This MRF can be solved in polynomial time in the size of the MRF (which is still exponential size in the number of qubits) by Gaussian Belief Propagation (GaBP). Unlike general Belief Propagation, GaBP can be guaranteed to converge exponentially quickly in polynomial time by using diagonal loading.
(GaBP explained here: https://arxiv.org/abs/0811.2518)
The 4 Clifford+T gates for a universal set of quantum gates. They are
$H = \frac{1}{\sqrt{2}}$ \begin{pmatrix}
1 & 1 \\
1 & -1
\end{pmatrix}
$X = $ \begin{pmatrix}
0 & 1 \\
1 & 0
\end{pmatrix}
$CX = $
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{pmatrix}
$T = $ \begin{pmatrix}
1 & 0 \\
0 & \omega
\end{pmatrix}
where $\omega = e^{\frac{i \pi}{4}}$
X Gate:
\begin{equation}
p(x'_{0,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Re} - x_{1,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{0,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Im} - x_{1,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Re} - x_{0,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Im} - x_{0,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
T Gate:
\begin{equation}
p(x'_{0,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Re} - x_{0,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{0,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Im} - x_{0,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Re} - \frac{1}{\sqrt{2}}(x_{0,Re}-x_{0,Im})]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Im} - \frac{1}{\sqrt{2}}(x_{0,Im}+x_{0,Re})]^2}{\sigma^2} \bigg)}
\end{equation}
CX Gate:
\begin{equation}
p(x'_{0,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Re} - x_{0,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{0,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Im} - x_{0,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Re} - x_{1,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Im} - x_{1,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{2,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{2,Re} - x_{3,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{2,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{2,Im} - x_{3,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{3,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{3,Re} - x_{2,Re}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{3,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{3,Im} - x_{2,Im}]^2}{\sigma^2} \bigg)}
\end{equation}
H Gate:
\begin{equation}
p(x'_{0,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Re} - \frac{1}{\sqrt{2}}(x_{0,Re}+x_{1,Re})]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{0,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{0,Im} - \frac{1}{\sqrt{2}}(x_{0,Im}+x_{1,Im})]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Re}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Re} - \frac{1}{\sqrt{2}}(x_{0,Re}-x_{1,Re})]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{1,Im}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{[x'_{1,Im} -\frac{1}{\sqrt{2}}(x_{0,Im}-x_{1,Im})]^2}{\sigma^2} \bigg)}
\end{equation}
To apply the hashing trick, we would like to hash each layer, sending qubits to hashed qubits according to some universal hash function and minimize the number of edges connecting the nodes representing hashed states to minimize the runtime of GaBP. To prove that the hashing trick does approximate transition amplitudes, we need to show that each approximation of the action of a quantum gate on hashed qubits (which necessarily forgets some information containing entanglement) produces at most a certain error in probabilities and transition amplitudes. The extra structure of quantum circuits means that the proof of compressibility will be easier with quantum states than with belief propagation and MRFs, but GaBP can nail down computational complexity bounds. Unitarity is and should be necessary to show that errors per layer are additive and independent because linear non-unitary "quantum" circuits can be used to solve $\mathrm{PP-Complete}$ problems.
A natural hashing strategy is to use a non-cryptographic hash function family like $(ax+b) \bmod 2^n \div 2^{(n-p)}$ which is
well adapted to hashing qubits, but for each layer keep up to 2 "windows" open on the qubits acted on by the preceding and following quantum gates. Conveniently, the shared covariance between layers can be represented sparsely by $\mathrm{O}(m=2^p)$ edges. Qubits from this hash function can be "wrapped" and "unwrapped" out of the hashed qubits for gates to act on them because the hash function is non-cryptographic.
For ordinary qubits, the universal hash function family $(ax+b) \mod 2^n \div 2^{n-p}$, where $m=2^p$ is effective. $m$, here, is the number of hashed variables (to be multiplied by the unwrapped variables for the total number of variables in the layers). These hash functions make it possible to sparsely 'wrap' and 'unwrap' hashed variables describing unhashed qubits used by gates (we can assume that at most 2 qubits are used by each gate) and the hashed remaining qubits. Each layer of variables borders two quantum gates with at most 2 qubits each, so neighboring layers will differ by at most 4 qubits and 8 variables in terms of which qubits are hashed or not hashed. Each variable is specified by a certain bit of $x$, so mapping nodes from one layer to the next entails hashing a pair of qubits from the former layer and unhashing a pair of qubits from the next layer (which is used in the gate in the layer after next). The qubits that aren't wrapped or unwrapped in neighboring layers can be specified by a 'bitfield' $x_{constant}$, the 'bitfield' to be wrapped into the hashed qubits can be specified as $x_{wrap}$, and the 'bitfield' to be unwrapped can be specified as $x_{unwrap}$. For fixed bases of both pair of qubits, the hashed qubits differ by $a(x_{wrap} - x_{unwrap}) \mod 2^n \div 2^{n-p}$. This quantity, added to the normal prehashed quantity, can result in two neighboring hashed outputs. The fraction of qubit bases going to each possible output can then be calculated. This means that each unhashed node has at most 17 neighbors including itself, but each hashed node has up to $8 \times 2 \times 2 + 2 + 1 = 35$ neighbors including itself and each layer of the MRF is sparse, so $2^p = O(m)$. If some of the wrapped and unwrapped qubits overlap, the overlapping 'bitfields' will cancel, resulting in the correct difference.
Hashed precisions $A^h_{ij}$ can be computed as multiple of the unhashed precisions $A_{ij}$ up to the point that the precision is split among adjacent hashed qubits. This is because $A_{ij}$ in unhashed form consists of copies of $A_{ij}$ restricted to qubits which are acted on by a quantum gate.
Let $B_{\alpha} = a(x_{wrap} - x_{unwrap}) \bmod 2^n \div 2^{n-p}$ and \newline
$C_{\alpha}= a(x_{wrap} - x_{unwrap}) \bmod 2^{n-p} / 2^{n-p}$.
The wrapping and unwrapping affects hashed variables like
$x^h_{a,b,h(i)+B_{\alpha}+1} = C_{\alpha}\sum_i x_{a,c,i}$
$x^h_{a,b,h(i)+B_{\alpha}} = (1-C_{\alpha}) \sum_i x_{a,c,i}$
%$k$ is a normalization constant equal to the number of unhashed qubits mapped to hashed qubits.
$x'$ represents the next layer. $x$ represents the current layer. The variances can be taken to be identical across the MRF , except where very small variances are used to fix the value of a variable (which is outside of the part of the MRF used to encode quantum gates). The $\mu$s are hashed $i$s, but there is no need to specify which $i$ because each layer is homogeneous. $G$ is the unitary gate, $a,b$ represent the unwrapped variables. In most cases, $a$ and $b$ will represent different unwrapped qubits.
The noise model is
$$
C_{\alpha}x'_{a,\mu+B_{\alpha}+1} = C_{\alpha}Gx_{b,\mu} + n_{\mu}
$$
and
$$
(1-C_{\alpha})x'_{a,\mu+B_{\alpha}} = (1-C_{\alpha})Gx_{b,\mu} + n_{\mu}
$$
The $x'$ $x$ are sums of the unhashed variables. The $C_{\alpha}$ and $1-C_{\alpha}$ weights are the fractions of the variables which map to each pattern. The noise $n_{\mu}$ is the sum of the noise for each variable with the same hash value ($C_{\alpha}\sum_{h^{-1}(\mu)} n_i$ or $(1-C_{\alpha})\sum_{h^{-1}(\mu)} n_i$) and, as such, grows quadratically, while variables grow linearly. This means the noise variables are proportional to $\sqrt{C_{\alpha}}$ or $\sqrt{1-C_{\alpha}}$ and the variance is proportional to $C_{\alpha}$ or $1-C_{\alpha}$. The linear weighting on the variance partially cancels out the quadratic weighting on the variables, resulting in a linear factor for the precision matrix.
This results in Gaussians
\begin{equation}
p(x'_{a,\mu+B_{\alpha}+1}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{C_{\alpha}[x'_{a,\mu+B_{\alpha}+1} - Gx_{b,\mu}]^2}{\sigma^2} \bigg)}
\end{equation}
\begin{equation}
p(x'_{a,\mu+B_{\alpha}}) \propto \frac{1}{\sqrt{2\pi\sigma^2}} \exp{\bigg( -\frac{(1-C_{\alpha})[x'_{a,\mu+B_{\alpha}} - Gx_{b,\mu}]^2}{\sigma^2} \bigg)}
\end{equation}
There are 4 cases over first layer precision and second layer precision and interlayer precision. The variances aren't necessarily complete, except for the interlayer precisions, and precisions from other gates may have to be added.
First and second layer precisions are the same as the unhashed precisions.
$A^h_{x,x,a,b,\mu,\mu} = A_{x,x,a,b,i,i}$
The second layer precisions are
$A^h_{x',x',a,b,\mu,\mu} = A_{x',x',a,b,i,i}$
The interlayer precisions are
$A^h_{x',x,a,b,\mu,\mu+B_{\alpha}+1} = C_{\alpha}A_{x',x,a,b,i,i}$
$A^h_{x',x,a,b,\mu,\mu+B_{\alpha}}= (1-C_{\alpha})A_{x',x,a,b,i,i}$
In other words only the interlayer precisions change.
We need to estimate the error caused by one quantum gate on a hashed quantum gate. This error is induced because, going from one layer to the next, part of the state is forgotten (that is, wrapped back into the hashed states) and part of the state is unwrapped (revealing unknown information). For a universal set of two qubit quantum gates, 4 qubits will be unwrapped in each layer, so that $32m$ variables will be used at each layer. (We can set $m = 2^{ p }$, where $m$ is the needed number of hashed variables.) Each layer will be predictable from the previous layer through a unitary transformation up to the variables representing the 2 qubits forgotten changing layers.
The error estimates in Theorem 6.1 in May and Schlieper may be adapted for hashed applications of quantum gates. The probability of observing the desired qubits $z$ may be given a lower bound of $\frac{m-1}{m}p(x)$ and, since the number of levels in $z$ is small, $c$ (usually 4), there is an upper bound of $\frac{m-1}{m}p(x)+\frac{1}{m}$ from the available probality and and upper bound of $\frac{m-1}{m}p(x)+\frac{c^2}{m}$ from summing out forgotten qubits.
Here, $x$ stands for the unwrapped qubits in the following layer. This can include the qubits unwrapped for the next gate. $y$ are the hashed qubits which are preserved going from one gate to another. $z$ are the unwrapped qubits in the previous layer that are hashed into $y$ and forgotten. $y'$ is $y$ hashed with $z$. $z'$ are the $z$ which correspond to the hashed with $z$ basis $y'$. The transformation between $w_{x,y',z'}$ and $w_{x,y,z}$ is unitary.
The weights for $w_{x,y',z'}$ are calculated from the universal hash function $(ax+b) \bmod 2^n \div 2^{n-p}$. Each basis vector can be encoded as an unsigned integer and hashed into a smaller unsigned integer, like a bitfield. To hash the $z$ qubits into the $y$ qubits, add the bitfield represening the $z$ qubits and apply the hash function. The $\bmod 2^n$ differs by $ax_z \bmod 2^n$. The resulting $y'$ value will then shift by either $\lfloor ax_z \bmod 2^n \div 2^{n-p} \rfloor$ or $\lfloor ax_z \bmod 2^n \div 2^{n-p} \rfloor +1$. The fractions of the two shifts are
$$1 - \frac{ax_z \bmod 2^{n-p} }{2^{n-p}} $$ and
$$\frac{ax_z \bmod 2^{n-p} }{2^{n-p}}$$, respectively.
The state after the last quantum gate is applied, but before the $z$ qubits are hashed in and discarded is:
\begin{equation}
\psi = \sum_x \sum_y \sum_z w_{x,y,z}|x \rangle | y \rangle |z \rangle
\end{equation}
The state remembered by the next layer after $z$ is hashed into $y$ and forgotten is
\begin{equation}
\psi' = \sum_x \sum_{y'} w_{x,y'}|x \rangle | y' \rangle
\end{equation}
This differs from May and Schlieper because $z$s originally with the same $(x,y)$ will be randomly sent to a different $(x,y')$.
The condition in Theorem 6.1
\begin{equation}
W_{x,y} := \sum_z w_{x,y,z} = 0
\end{equation}
does not hold in general in our case. Instead we are forced to forget a only a small number of qubits each layer of the MRF to keep this sum from becoming too large. And, in any case, the formula becomes
\begin{equation}
W_{x,y'} := \sum_{z'} w_{x,y',z'}
\end{equation}
The probability of observing a hashed state is
\begin{equation}
p_h(x,y') = \frac{1}{\mathcal{H}} \sum_{h \in \mathcal{H}} (\sum_{i = 0}^{m-1} |\sum_{z'} w_{x,y',z'}|^2)
\end{equation}
$\mathcal{H}$ is a normalization factor over all possible hash functions in the given family. The sum over $z'$ is correct because the $ w_{x,y',z'}$ are unitary transformations of $ w_{x,y,z}$. The universality of the hash function allows the expression to be simplified to
\begin{equation}
p_h(x,y') = \sum_{z'} |w_{x,y',z'}|^2 + \frac{1}{m} \sum_{z'_1 \neq z'_2} w_{x,y',z'_1}\overline{w_{x,y',z'_2}}
\end{equation}
The derivation of the error in probability is almost the same, except that there is a range in possible errors and, unlike May and Schlieper's proof the errors aren't packed into $x=0$ basis vectors.
\begin{equation}
W_{x,y'} = \frac{1}{m} |\sum_{z'} w_{x,y',z'}|^2 = \frac{1}{m} \sum_{z'} |w_{x,y',z'}|^2 + \frac{1}{m} \sum_{z'_1 \neq z'_2} w_{x,y',z'_1}\overline{w_{x,y',z'_2}} = p_h(x,y') - \frac{1}{m} \sum_{z'} |w_{x,y',z'}|^2
\end{equation}
\begin{equation}
\frac{m-1}{m} p(x,y') \leq p_h(x,y') \leq \frac{m-1}{m} p(x,y') + W_{x,y'} \leq\frac{m-1}{m} p(x,y') + \frac{c^2}{m}
\end{equation}
Since $p_h$ is a probability, there is a different logical upper bound
\begin{equation}
\frac{m-1}{m} p(x,y') \leq p_h(x,y') \leq \frac{m-1}{m} p(x,y') + \frac{1}{m}
\end{equation}
On average, this second inequality should hold, although I don't know how to prove it can't be violated. Since both these upper bounds are an absolute cap on the error in probability, summing out $y$ will still leave the same error margins and the desired single qubit probability amplitude estimates will be accurate to $\mathrm{O}(\frac{1}{m})$.
Summing over only the $z$ qubits is necessary because it can be that $W_x > 1$ even with only polynomially many hashed variables which cannot be interpreted as a probability. For instance, one layer of $n$ Hadamard gates with state to be hashed $\sum^{2^n -1}_{i=0}\frac{1}{\sqrt{2^n}} x_i$, would have $W_x = 2^n$ which is nonsensically large. Even a hashed state would still have $W_x = m$. To control $W$ one needs to work only with small unitary transform that affect a constantly bounded number of qubits, like ordinary quantum gates which necessitates only summing out one quantum gate at a time.
To guarantee $W_{x,y'}$ is small enough, we need to reduce the number of $z'$ per $x,y'$ to a constant so that increasing $m$ will make them inconsequential. The terms summed in $W_{x,y'}$ will always be $|w_{x,y'}| \leq 1$ so $W_{x,y'} \leq \frac{c^2}{m}$. On average, the $w_{x,y',z'}$ will be much smaller, on the order of $\mathrm{O}(\frac{1}{\sqrt{m}})$ which results in an average error in probability around $\mathrm{O}(\frac{1}{m^2})$.
This argument narrows down the range of error in probability, but perhaps there could still be large error margins in phase. To narrow the range of error in phase, perform Hadamard(s) on the $y'$ qubits and extract the phase. The probability estimates then make comparable restrictions the range of phase error. So the restriction on errors in probability is also a restriction on errors in probability amplitude.
We can then use the unitarity of quantum gates to show that quantum gates preserve the magnitude of errors in amplitude. Since unitary transformations preserve inner products, the correlation between the correct state and the approximate state will remain the same. Non-unitary linear transformations can also be represented as FA problems and hashed and it must be because errors can be amplified by non-unitary gates that the hashing trick will fail on them. Otherwise, the hashing trick could be used to solve $\mathrm{PP-Complete}$ counting problems which are considerably hard than $\mathrm{NP}$.
In the worst case, amplitude errors will add up over $g$ gates, so amplitude and probability errors at the end of the circuit will be at most $\mathrm{O}(\frac{g}{m})$. Likewise, the independence of errors between implies that the total error for the circuit are roughly bounded by multiplying the probability error margins together and assuming $m$ is large enough for the linear approximation to hold to get
\begin{equation}
\frac{m-g}{m} p^{total}(x,y') \leq p^{total}_h(x,y') \leq \frac{m-g}{m} p^{total}(x,y') + \frac{g}{m}
\end{equation}
So, as long as $m \gg g \epsilon$, the final error in probability and probability amplitude will be $< \epsilon$.
Using the broadcast variant of GaBP, the runtime to calculate probability amplitudes is $\mathrm{O}(E \log N)$, where $E$ is the number of edges and $N$ is the number of nodes in the MRF. For quantum circuits the running time is roughly quadratic log. For estimates of probability amplitudes which are accurate up to $\pm \epsilon$, the running time is $\mathrm{O}((\frac{g^2+gn\log g}{\epsilon})\log{(\frac{g^2+gn\log g}{\epsilon}}))$, where $n$ is the number of qubits and $g$ is the number of gates.
"
['quantum-operation']," Title: Is there a physical interpretation for the diagonal terms of a $\chi$ matrix?Body: I assume $\mathcal{E} \in \mathcal{L}(\mathcal{L}(H))$ is a CPTP map. I call $\{B_i\}$ an orthonormal basis for Hilbert-Schmidt scalar product of $\mathcal{L}(H)$
This quantum map can be decomposed as:
$$\mathcal{E}(\rho)=\sum_{ij} \chi_{ij} B_i \rho B_j^{\dagger}$$
The matrix having for element $\chi_{ij}$ is called the chi-matrix of the process.
My question are:
Is there a physical interpretation for the diagonal coefficients of this chi matrix in a general case (i.e interpretation valid for any basis). I know that in quantum error correction theory they might have an importance, but even without Q.E.C can we relate them to some physical property ?
Same question in the particular case the chi-matrix is actually diagonal, is there a general interpretation of the $\chi_{ii}$ ?
"
['quantum-gate']," Title: Is a 0 degree rotation around an axis meaningless?Body: For example, if I had a gate rz(0), it holds no value in a circuit. It comes out to a matrix of [[1,0], [0,1]], which seems to be of no value, but I am wondering if there is any purpose of such gate in a circuit.
"
"['qiskit', 'applications', 'chemistry']"," Title: What are some current applications of Quantum Computing in drug discovery? Are there any test examples of this?Body: I am interested in applying the power of Quantum Computing to drug discovery. Although I realize that quantum computing is limited in regards to modeling drug-like compounds and their interactions right now, I was curious as to any useful resources in the space. Thanks.
"
"['mathematics', 'quantum-advantage', 'google-sycamore']"," Title: When we do a linear fit, what is the correlation coefficient of the estimated parameters?Body:
In Google's quantum supremacy experiment, supplementary Section VIIIH, they calculate the correlation coefficient of the linear fit coefficients $p_0$,$p_1$. I can't figure out the definition of this quantity. Is this the same as the Pearson correlation coefficient?
"
"['qiskit', 'entanglement', 'bell-experiment']"," Title: Is this a Bell test?Body: Inspired by this article which uses a $|+\rangle$ state as a control for a $CSWAP$, I realised you can conditionally measure a qubit by (maybe) swapping it with an empty ancilla, measuring it and (maybe) swapping it back.
As such, you could prepare a Bell pair, (maybe) measure half of it and then check if the other half was affected as follows:
If measurement changes the top qubit then the second $H$ gate should put it back into the |+> state and we should measure random results. If the measurement doesn't change the top qubit, then it should turn the $|+\rangle$ back to $|0\rangle$, deterministically measuring 0. Right?
If so, then I'm hoping there's some extension of the uncertainty principle that would imply that because there is no knowledge about whether the second qubit was measured, we could learn something about the first qubit. I hope.
Of course I've tried to test this but I don't believe the qiskit simulator and none of the IBM devices allow operations to take place after measurement ("Qubit measurement not the final instruction. [7006]").
So can anyone think of a way I could test it?
Does this count as a Bell Test?
Has this been tried before?
Am I missing something obvious?
Not sure if this is the right place to post this but just interested to hear people's thoughts/predictions.
"
['stabilizer-code']," Title: The commutativity of $I$ and $Y$ in a stabilizer codeBody: Let $P_1 = \lbrace I, -I, iI, -iI, X, -X, iX, -iX, Y, -Y, iY, -iY, Z, -Z, iZ, -iZ\rbrace$. Let $P_n$ be the $n$-tensor fold of $P_1$. It is said that two operators either commute if $AB = BA$ or anti-commute if $AB = -BA$ for all $A,B \in P_n$.
Let us have $n=1$ and $A=I$ and $B=Y$, then we have:
\begin{align*}
IY &\stackrel{\text{true}}{=} YI,\\
IY &\stackrel{\text{true}}{=} -YI.
\end{align*}
In other words, $I$ and $Y$ both commute and anti-commute. I have also added a matlab code snippet for completeness.
I = [1 0; 0 1];
Y = [0 -i;i 0];
if isequal(I*Y,Y*I)
disp('commute')
end
if isequal(I*Y,-Y*I)
disp('ANTI-commute')
end
I am referring to Daniel Gottesman's PhD thesis.
What am I missing?
Edit:
My Matlab code should run only one of the if statements (not both). It seems that my machine was caching the answers from previously. A restart of the program has fixed the issue.
"
"['qiskit', 'programming', 'simulation']"," Title: How to fix “QiskitChemistryError:PySCF is not installed”Body: I’m trying to simulate LiH using VQE. But I keep getting the error
QiskitChemistryError:PySCF is not installed
And I tried several ways to see whether my driver for the molecule was typed wrong. But couldn’t find any. I again downloaded the VQE molecule Jupyter notebook from the qiskit documentation and tried running it without any modification. It still gives me the same error.
(Running with the updated qiskit version 0.20.0 on Windows10)
"
"['quantum-gate', 'algorithm', 'qiskit', 'gate-synthesis', 'amplitude-amplification']"," Title: How to define Q-operator in Quantum Amplitude EstimationBody: I'm trying to implement a circuit for Quantum Amplitude Estimation in Qiskit using elementary gates.
I have created the circuit that represent my algorithm $A$ but now from the theory I know that I have to create the Q-operator defined as: $Q = A S_0 A^{-1} S_{\psi_{0}}$ , where $S_0$ and $S_{\psi_{0}}$ are two reflections.
How can I implement these two reflections in the circuit using Qiskit gates?
UPDATE
I built a quantum circuit for reproducing an algorithm $A$ for computing expected value of a random variable, given by:
- Load a random variable X as a quantum state
$$
L|0\rangle_n = |\psi\rangle_n = \sum_{i=0}^{2^n - 1}\sqrt{p_i} |i\rangle_n
\ \ \ such \ that \ \sum_{i=0}^{2^n - 1}p_i = 1
$$
- Create an operator for the encoding
$$
F|i\rangle_n |0\rangle = \sqrt{1 - f(i)} |i\rangle_n |0\rangle + \sqrt{f(i)} |i\rangle_n |1\rangle
$$
So my algorithm $A$ is given by the final state:
$$
F (L|0\rangle_n)|0\rangle = F|\psi\rangle_n|0\rangle = \sum_{i=0}^{2^n-1} \sqrt{1 - f(i)} \sqrt{p_i} |i\rangle_n |0\rangle + \sum_{i=0}^{2^n-1} \sqrt{f(i)} \sqrt{p_i} |i\rangle_n |1\rangle
$$
I used 3 qubits for loading distribution and one ancilla qubit; so my Qiskit circuit is the following
From this I would create $Q$ operator for Amplitude Estimation.
How can I procede?
"
"['quantum-gate', 'quantum-state', 'physical-qubit']"," Title: How do quantum gates work on qubits in the physical world?Body: How do quantum gates work on qubits in the physical world?
What are different ways through which qubits can be manipulated in the physical world?
For example, by analogy a classical NOT gate uses electric volts as signals to change the state of the input bit to a (classical) NOT gate.
Accordingly, how would one implement an $X$ gate acting on a qubit?
"
"['quantum-gate', 'qiskit', 'pauli-gates', 'universal-gates', 'phase-kickback']"," Title: controlled-Z rotation gates in symmetrical fashionBody: I was going through the qiskit textbook and in this chapter I came across a statement under the topic "Kickback with the T-gate" related to the Controlled-Z gate that
the controlled-Z rotation gates are symmetrical in fashion (two controls instead of a control and a target). There is no clear control or target qubit for all cases.
What does it imply exactly?
"
"['qiskit', 'programming']"," Title: How can I create an arbitrary superposition state of two qubits in Qiskit?Body: I am trying to produce any arbitrary superposition state of two qubits, for example $a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$, such that $a^2 + b^2 + c^2 + d^2 = 1$ . How can I do that with Qiskit?
One way that I have found out is to use $U_3(\theta, 0, 0)$ gates for suitable values of $\theta$ on both of the qubits. Is there another way?
"
"['qiskit', 'programming', 'circuit-construction', 'vqe']"," Title: What is the best way to handle parametric circuits in Qiskit?Body: What is the best way to handle parametric circuits in Qiskit? When I create a variational form like TwoLocal and then do var_form.parameters it returns a set but that is an unordered structure so I fear that it will give me different results upon different calls.
Here is what I have:
var_form = TwoLocal(num_qubits=4,
rotation_blocks=["ry","rx"],
entanglement_blocks=["cx"],
entanglement="full",
reps=1,
skip_final_rotation_layer=False,
insert_barriers=True)
parameters=np.random.random(var_form.num_parameters)
param_dict={}
for i in range(var_form.num_parameters):
param_dict[list(var_form.parameters)[i]]=parameters[i]
Here is what I want:
def get_var_form(parameters):
"""parameters is a list like [0,1,2,3,4....]"""
##
# DO MAGIC HERE
var_form = TwoLocal(num_qubits=4,
rotation_blocks=["ry","rx"],
entanglement_blocks=["cx"],
entanglement="full",
reps=1,
skip_final_rotation_layer=False,
insert_barriers=True)
#I want to insert parameters----->var_form
##
return var_form #with given parameters
How can I do this?
"
"['machine-learning', 'quantum-advantage', 'quantum-enhanced-machine-learning']"," Title: What is the advantage of quantum machine learning over traditional machine learning?Body: Why exactly is machine learning on quantum computers different than classical machine learning? Is there a specific difference that allows quantum machine learning to outperform classical machine learning?
"
"['quantum-gate', 'qiskit', 'programming', 'gate-synthesis', 'pauli-gates']"," Title: Principal square root of Pauli Y gate in Qiskit?Body: I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of other building blocks, if it is possible.
Is there a way to use the gate $Y^{\frac{1}{2}} = \begin{bmatrix}
\frac{1}{2}
+ \frac{1}{2}i & -\frac{1}{2} - \frac{1}{2}i\\
\frac{1}{2} + \frac{1}{2}i & \frac{1}{2} + \frac{1}{2}i
\end{bmatrix}$ in Qiskit? I can say that $Y = iRY(\pi)$ and compute the square root manually, but how can I describe such an operation, if possible, in Qiskit?
"
"['quantum-state', 'trace-distance']"," Title: Relationship between trace distance and total variation distanceBody: Consider two quantum states $\rho$ and $\sigma$ and the probability distributions induced by measuring both of them in the standard basis. Let’s call the probability distributions $p_{\rho}$ and $p_{\sigma}$ respectively. What is the relation between the trace distance between $\rho$ and $\sigma$ and the total variation distance between $p_{\rho}$ and $p_{\sigma}$?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Can I append gates in a certain position in a Qiskit circuitBody: I have a question regarding modifying Qiskit circuits. I have a set of circuits that are pretty similar to each other. The only difference being some gates in the beginning of each circuit. I was wondering if instead of creating new circuits each time, I could just append gates to the beginning of the circuit. However, currently, all the methods I am aware of that act on the QuantumCircuit only append to the end of the circuit.
Is there a way I can add certain gates to the beginning of a Qiskit Circuit as opposed to creating new ones each time?
"
"['resource-request', 'nielsen-and-chuang']"," Title: Is there any 'official' list of errata for Nielsen & Chuang?Body: The book Quantum Computing and Quantum Information by Nielsen and Chuang is a well-known and celebrated text book that can act as a resource in a wide variety of topics. Of course, in such a vast textbook there might arise small errors.
Its own preface (at least in the $10$th anniversary edition) addresses this as well, and links to the website http://www.squint.org/qci/ for a list of errata and requests any newly found errors to be send to qci@squint.org. Neither links are still functional, let alone maintained.
There is also the list of errata to be found on the website of Dr. Nielsen, although this doesn't seem to be maintained anymore either: there is a time-stamp from back in $2014$ and the list refers to the first until the fifth print of the book, which is not the last print of the book.
A google search provides some other resources, sometimes PDF documents, which all seem to be one version or another of the list of errata linked above.
My question is: Is there (still) an 'official' or 'semi-official' list of errata, preferably for the $10$th anniversary edition, and also preferably still being maintained?
As a follow up question, is there also a way to notify the maintainers about any as of yet unnoticed errors?
"
"['qiskit', 'programming', 'vqe']"," Title: How to build an ExpectationBase object?Body: I'm trying to wrap my head around the expectation argument in Qiskit's VQE class, so to understand it I'm trying to create an ExpectationBase object to understand it better, but I'm getting nowhere. Can anyone give a hand?
"
"['algorithm', 'entropy', 'tomography', 'information-theory']"," Title: How can one estimate the von Neumann entropy of an unknown quantum state?Body: Given many copies of some unknown quantum state $\rho$, I would like to compute its von Neumann entropy $S(\rho)$. What algorithm could be used for this that minimizes the number of copies required? We require that the estimate of the entropy has to be $\varepsilon-$close and one will need more copies as $\varepsilon\rightarrow 0$.
The naive solution is to do tomography and obtain a classical description of the state. This would require exponentially many copies as we increase the dimension of $\rho$. But the classical description of the state has a lot more information so perhaps there is a smarter way?
"
"['hamiltonian-simulation', 'chemistry']"," Title: Impact of ordering Hamiltonian terms for TrotterizationBody: In Trotterization, the typical Hamiltonian considered is:
$$ H = \sum_{p, q} h_{pq} a^{\dagger}_p a_q + \sum_{p, q, r, s} a^{\dagger}_p a^{\dagger}_q a_r a_s $$
Which is then converted into a sequence of gates by the Jordan Wigner transformation.
However, how do we choose the ordering of the $ pq$ and $pqrs$ terms? For example, if our Hamiltonian was:
$$ H = (a^{\dagger}_1 a_2 + a^{\dagger}_2 a_1) + (a^{\dagger}_2 a_3 + a^{\dagger}_3 a_2) + (a^{\dagger}_1 a^{\dagger}_2 a_2 a_3 + a^{\dagger}_3 a^{\dagger}_2 a_2 a_1)$$
There are at least $ 3! = 6$ ways to order the Hamiltonian, a number which quickly explodes as the size of the Hamiltonian grows.
Note that the terms don't have clean commutation rules - sometimes the terms will commute or anticommute. Is there an approach to ordering the Hamiltonian that maximizes simulation accuracy?
"
"['quantum-operation', 'textbook-and-exercises', 'unitarity', 'kraus-representation']"," Title: How to find the unitary operation of a depolarizing channel?Body: Suppose we have a depolarizing channel operation
$$E(\rho)=\frac{p}{2}\textbf{1}+(1-p)\rho$$
acting on a Spin$\frac{1}{2}$ density matrix of the form $\rho=\frac{1}{2}(\textbf{1}+\textbf{s}\cdot\textbf{$\sigma$})$. I have found the Kraus operators to be:
$$E_1=\sqrt{\left(1-\frac{3}{4}p\right)}\textbf{1}, E_2=\frac{\sqrt{p}}{2}\sigma_x,E_3=\frac{\sqrt{p}}{2}\sigma_y \text{ and } E_4=\frac{\sqrt{p}}{2}\sigma_z$$
I am now supposed to find the unitary matrix U such that the Operation can be expressed in a bigger system i.e. after adding a System S. As far as I understand it, the new operation can be written as:
$$E(\rho)=\sum_kE_k\rho E_k^\dagger=\text{Tr}_S(U\rho\otimes\rho_EU^\dagger)$$
Supposing the new system S is prepared on a state $|e_0\rangle$, How do I find the correct unitary matrix?
I appreciate your cooperation.
Crossposted to physics: https://physics.stackexchange.com/questions/576952/how-to-find-the-unitary-operation-of-a-depolarizing-channel
"
"['qiskit', 'programming']"," Title: Command errored out with exit status 1 while installing the editable env for qiskit terraBody: I was installing the editable version of qiskit-terra from source in my conda environment using the following command
pip install -e .
and I got the following error:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Tanya Garg\Anaconda3\envs\fixissueenv\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Tanya Garg\\qiskit-terra\\setup.py'"'"'; __file__='"'"'C:\\Users\\Tanya Garg\\qiskit-terra\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: C:\Users\Tanya Garg\qiskit-terra\
Complete output (13 lines):
running develop
running egg_info
writing qiskit_terra.egg-info\PKG-INFO
writing dependency_links to qiskit_terra.egg-info\dependency_links.txt
writing requirements to qiskit_terra.egg-info\requires.txt
writing top-level names to qiskit_terra.egg-info\top_level.txt
reading manifest file 'qiskit_terra.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'test\python\pickles\*.pickle'
writing manifest file 'qiskit_terra.egg-info\SOURCES.txt'
running build_ext
building 'qiskit.transpiler.passes.routing.cython.stochastic_swap.utils' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
What does this error mean and how can I address it?
"
"['complexity-theory', 'optimization', 'd-wave']"," Title: What is the query complexity of the QUBO algorithm?Body: What is the complexity of the quantum unconstrained binary optimization (QUBO) algorithm in the number of queries to the quantum processor?
To clarify, I'm asking about the complexity on quantum annealers.
"
"['qiskit', 'programming', 'vqe']"," Title: How to add several parameters in qiskit circuit?Body: I want to construct an ansatz circuit in Qiskit, so I need some parameters to act on the gates (e.g. RX(a), RY(b)). In the Qiskit tutorials I find a way to implement a parameter:
import numpy as np
theta_range = np.linspace(0, 2 * np.pi, 128)
circuits = [qc.bind_parameters({theta: theta_val})
for theta_val in theta_range]
circuits[-1].draw()
There is only one parameter, theta. I want more parameters in the some range. How can I achieve that?
"
"['qiskit', 'resource-request', 'vqe']"," Title: Examples of VQE on QiskitBody: I'm a quantum beginner, and I really need some examples to help me understand quantum computing. In particular, how to get the ground energy of Hubbard or using model with VQE in Qiskit.
Code examples would be great.
"
"['programming', 'qiskit', 'quantum-operation', 'noise', 'kraus-representation']"," Title: Qiskit function phase_amplitude_damping_errorBody: I am reading about the noise models that can be simulated in Qiskit and I found out the phase_amplitude_damping_error function. I read about it and it seems to be a function that simulates a combined dephasing and generalized amplitude damping channel (amplitude damping with finite temperature). I am pretty sure that the function implements such channel. However, I am wondering where do the Kraus operators that are described there come from (it is a Kraus rank 6 channel), as I have not been able to find any bibliography regarding such combined channel.
"
"['quantum-gate', 'entanglement']"," Title: Is the square root of SWAP gate ""maximally entangling""?Body: I'm not sure if this is a good question for the site, but here goes.
On the "Quantum logic gate" Wikipedia page, it is said that:
The $\sqrt{\mathrm{SWAP}}$ gate is not, however maximally entangling; more than one application of it is required to produce a Bell state from product states.
I'm a bit confused by this remark, its definition for the gate in the $|00\rangle, |01\rangle, |10\rangle, |11\rangle$ basis is
$$
\sqrt{\mathrm{SWAP}} = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & \frac{1}{2}(1+i) & \frac{1}{2}(1-i) & 0 \\
0 & \frac{1}{2}(1-i) & \frac{1}{2}(1+i) & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix} \,.
$$
It seems like if I apply the gate on the product state $|01\rangle$ I should end up with something proportional to $\frac{1}{\sqrt2}|01\rangle - \frac{i}{\sqrt2}|10\rangle$ which looks maximally entangled to me? Am I misunderstanding something?
"
"['physical-realization', 'nv-centers']"," Title: Why isn't NV-center-based quantum computing mainstream?Body: One can rattle off names of implementations of Superconducting Qubits, transmon qubits, etc
For example, see Physical realizations used by Google
But NV centre Qubits as in this question, Is there any company that backs and implements diamond vacancy quantum computers? have no large company spending money on it.
Any research on it is relegated to academia or the companies in stealth mode.
What about its implementation makes it unattractive?
One would think that since it operates at near room temperatures should make it more appealing?
For reference See Quantum computing book by Nielsen and Chuang
Disclaimer This question is completely produced by a comment in this answer.
"
"['physical-realization', 'ion-trap-quantum-computing']"," Title: Is there any company trying out ion trap qubits?Body: Analogous to this question Is there any company that backs and implements diamond vacancy quantum computers?
"
"['algorithm', 'grovers-algorithm', 'amplitude-amplification']"," Title: Lemma 1 in the paper by Brassard, Hoyer, Tapp (1998) on Quantum countingBody: In the paper by Brassard, Hoyer, Tapp (1998) on Quantum Counting we have the following expression for the state:
$$|Y\rangle =\sum_{i\in\mathbb{Z}}x_i|i\rangle |Y_i\rangle.$$
Now we have a quantum algorithm $\mathcal{A}$. Then we have the operator $S_0^{\phi}$ which changes the phase of the state by a factor of $\phi$ if and only the first register holds a zero. The paper goes into more detail about the setup.
Lemma 1 claims that
$$\mathcal{A}S_0^{\phi}\mathcal{A}^{-1}|Y\rangle=|Y\rangle-(1-\phi)\langle Y|\mathcal{A}|0\rangle ^*\mathcal{A}|0\rangle.$$
How is this lemma arising? What is the proof for that lemma?
"
['noise']," Title: Do we expect similar results in form of measurement histogram for both (1 run with 100 shots) and (100 runs with 1 shot each)?Body: 100 runs of 1 shot each were executed one by one over a single qubit initialised with 0 (default) and no quantum gate implemented on top of it. All measurement results were found to be noise free i.e. 100% of measurements yielded 0.
However, runs with 100 shots rarely yield 100% accuracy.
"
['qaoa']," Title: What is meant by ""local minimum"" in QAOA?Body: I am trying to understand what exactly happens in QAOA. I am reading this blog which says,
We would be just repetitively applying $U_C$. But once we got into a state which is the eigenstate of $H_C$ we wouldn’t get any further. This is basic linear algebra — if we apply an operator to its eigenvector, it can change its length, but not direction. The same applies if we had a $H_B$ which commutes with $H_C$. So we need this intermediate step of applying $H_B$ which allows us to escape from the local minimum. How do we make sure we escape it? Well, that’s where the classical optimization loop is useful – we try to find the right values of the parameters $β$ and $γ$ which make it happen.
I want to know what do they mean by local minimum?
It also says,
It doesn’t need to be just $\sum_i^N \sigma_i^x$. We want it to be something that does not commute with $H_C$ and this choice of $H_B$ meets this requirement and is super easy to implement.
What does that mean?
$H_C$ is the cost hamiltonian which corresponds to the objective function to be optimized and $H_B$ is the operator which is summation of Pauli-z operators on $i$-th qubit. $H_B$ is the mixing operator.
"
"['programming', 'pyquil', 'rigetti']"," Title: How to create a qubit in an arbitrary state in PyQuilBody: In PyQuil, a qubit is initialised as $|0\rangle$ by default. Suppose, I want to initialise a qubit in an arbitrary state, say $\frac{1}{\sqrt{3}}|0\rangle+\sqrt{\frac{2}{3}}|1\rangle$. How to do this arbitrary qubit initialisation in PyQuil?
"
"['programming', 'q#', 'matrix-representation']"," Title: How to implement quantum gate from matrix in Q#Body: Is it possible to implement a quantum gate from a matrix in Q#, the equivalent of unitary function in Qiskit ? My final goal is to implement cirq CZPowGate in Q#.
Thank you.
"
['foundations']," Title: What happens to Quantum computing if Schroedingers equation gets a correction term to account for some new changes in fundamental physics?Body: We all know the current form of Schroedinger's equation. Due to some new observations, let's say it gets modified in a way that a correction term gets added. What are the ramifications for Quantum computing?
Note I am not talking about relativistic or other corrections already present.
"
"['quantum-state', 'qiskit', 'programming', 'simulation']"," Title: How can I print out the probability of a certain state in histogram?Body:
This is a simulation I did in my program. I'm hoping to print out the probability of the state $|0001\rangle$ (which is $0.052$), and store this number in a letter (a). How can I do this? Thanks!!
"
"['mathematics', 'quantum-operation']"," Title: Equivalence of two ways to recover a map from its Choi stateBody: Let $\Phi\in\mathrm T(\mathcal X,\mathcal Y)$ be a quantum channel, $\Phi:\mathrm{Lin}(\mathcal X)\to\operatorname{Lin}(\mathcal Y)$.
We define its Choi representation as the operator $J(\Phi)\in \mathrm{Lin}(\mathcal{Y})\otimes \mathrm{Lin}(\mathcal{X})$ defined by
$$J(\Phi) = (\Phi\otimes I) \,d\,\mathbb P_+= \sum_{a,b}\Phi(E_{a,b})\otimes E_{a,b},\tag1$$
where $\mathbb P_+\equiv \lvert +\rangle\!\langle +|$ with $\sqrt d|+\rangle=\sum_i |i,i\rangle$, and $E_{a,b}\equiv |a\rangle\!\langle b|$.
One way to retrieve the map from the Choi, used for example in Watrous, Eq. (2.66), is
$$\Phi(X) = \operatorname{Tr}_{\mathcal X}[J(\Phi)(I_{\mathcal Y}\otimes X^T)].\tag2$$
Verifying the equivalence between these two isn't too hard:
$$
\operatorname{Tr}_{\mathcal X}[J(\Phi)(I_{\mathcal Y}\otimes X^T)]
= \sum_{a,b} \operatorname{Tr}_{\mathcal X} [
\Phi(E_{a,b})\otimes E_{a,b} X^T
]
= \Phi(X).
$$
More generally, this gives us a way to associate to each bipartite state $\rho$ a map $\Phi_\rho$ such that $J(\Phi_\rho)=d\,\rho$, and if $\operatorname{Tr}_{\mathcal Y}\rho=I/d$, then $\Phi_\rho$ is trace-preserving (and thus CPTP).
In (Horodecki, Horodecki, Horodecki 1998) the authors mention another way to associate a map to a state $\rho$. Writing its eigendecomposition as $\rho=\sum_i p_k \mathbb P_{\psi_k}$, and writing with $\psi$ the operator whose vectorisation is $|\psi\rangle$, i.e. $\operatorname{vec}(\psi)\equiv |\psi\rangle$, we have $|\psi_k\rangle=(\psi_k\otimes I)\,\sqrt d |+\rangle$, and thus
$$\rho = \sum_k p_k (\psi_k \otimes I) \,d\,\mathbb P_+(\psi_k^\dagger\otimes I)
= (\Phi_\rho\otimes I) \mathbb P_+,\tag3$$
where $\Phi_\rho(X) = d\sum_k p_k \psi_k X \psi_k^\dagger.$
I presume (2) and (3) should be equivalent, provided $d \,\rho=J(\Phi)$. What's a good way to show this equivalence?
"
"['mathematics', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Nielsen & Chuang Exercise 2.55: Prove that $\exp \left[ -\frac{iH(t_2 - t_1)}{\hbar} \right]$ is unitaryBody: $\newcommand{\expterm}[0]{\frac{-iH(t_2 - t_1)}{\hbar}}
\newcommand{\exptermp}[0]{\frac{iH(t_2 - t_1)}{\hbar}}$Nielsen & Chuang (10th edition, page 82) states that $H$ is a fixed Hermitian operator known as the Hamiltonian. In exercise 2.54, we prove that if $A$ and $B$ are commuting Hermitian operators, then the following holds:
$$
\exp(A)\exp(B)=\exp(A+B) \tag{1}\label{1}
$$
The goal is to prove
$$\exp \left[ \expterm \right] \exp \left[ \exptermp \right] = I.\tag{2}\label{2}$$
If $\expterm$ is Hermitian, then we can plug $A=\expterm$ and its Hermitian conjugate $B = \exptermp$ into \eqref{1} to prove \eqref{2}. However, I don't see why $\expterm$ is necessarily Hermitian. Take $H=I$ for example: $H$ is Hermitian but $\expterm$ is not, so we can't use \eqref{1}. Any thoughts?
"
"['ibm-q-experience', 'error-correction', 'decoherence']"," Title: Need mathematical Calculation of input(T1,T2,f) and output(Readout Error)Body: I would like to know about the mathematical relations among T1, T2, frequency, readout error, and single-qubit error?
This screenshot is from the ibmq-16 Melbourne excel data file.
"
['bloch-sphere']," Title: when we specify quantum states in $\mathbb C^2$, why do we only have $2$ basis states?Body: I am just starting to get up to speed with quantum computing via the Quiskit learning path: online tutorial
Here they explain the Dirac notation and use it to describe quantum states as elements in $\mathbb{C}^2$ (square could be for the initial lesson but my question holds in n.
i.e a quantum state $| a \rangle = \begin{pmatrix}a_1 \\ a_2 \end{pmatrix}$ where $a_1, a_2 \in \mathbb{C}$
Shortly after this the concept of the basis is introduced, with the x, y and z examples given. Their orthonormality is stressed. In all three cases this 'basis' is two dimensional.
So as a concrete example $ \{| 0 \rangle , | 1 \rangle \}$ is given as an orthonormal basis for the space to describe and measure quantum states.
Clearly this pair of basis is not an orthonormal basis of $\mathbb{C}^2$ so I understand there may be additional constraints on the space of possible valid quantum states. But then I have not yet seen why it is necessary to embed this apparently two dimensional space into teh 4-dimension $\mathbb{C}^2$.
We have touched on the Bloch Sphere which is a two dimensional representation of pure states but that is derived from the two dimensional orthonormal basis rather than the other way around - but perhaps this is a more profound representation of the space than it seems at this point.
What is the reason we both need a 4-dimensional space to describe our possible quantum states and can work with a two dimensional basis?
"
"['information-theory', 'entropy', 'max-entropy', 'smooth-entropies']"," Title: Connection between smooth max-relative entropy and smooth max-informationBody: The max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\},$$
where $\rho\leq \sigma$ should be read as $\sigma - \rho$ is positive semidefinite. There is also a smoothed version of this quantity and this is given by taking the infimum of $D_{\max}(\rho\|\sigma)$ over all states $\bar{\rho}$ which are within an $\varepsilon$ ball of $\rho$ according to some metric. For example, one may require that the trace distance between $\rho$ and $\bar{\rho}$ is at most $\varepsilon$ and define a ball this way. So we have
$$D^{\varepsilon}_{\max}(\rho\|\sigma) = \inf\limits_{\bar{\rho}\in\mathcal{B}^{\varepsilon}(\rho)}D_{\max}(\bar{\rho}\|\sigma)$$
Now consider the case where $\rho = \rho_{AB}$ (some bipartite state) and $\sigma = \rho_A\otimes\rho_B$. A quantity known as the max-information that $B$ has about $A$ is given by
$$I_{\max}(A:B)_\rho = D_{\max}(\rho_{AB}||\rho_A\otimes\rho_B)$$
Note that this is not the only definition of the max-information (there are several as shown here but they are all equivalent after smoothing). The smoothed max-information for our definition of the max-information is
$$I^{\varepsilon}_{\max}(A:B)_{\rho_{AB}} = \inf\limits_{\bar{\rho}_{AB}\in\mathcal{B}^{\varepsilon}(\rho_{AB})} I(A:B)_{\bar{\rho}} = \inf\limits_{\bar{\rho}_{AB}\in\mathcal{B}^{\varepsilon}(\rho_{AB})}D_{\max}(\bar{\rho}_{AB}\|\bar{\rho}_A\otimes\bar{\rho}_B)$$
In contrast, the smoothed max-relative entropy is
$$D^{\varepsilon}_{\max}(\rho_{AB}\|\rho_A\otimes\rho_B) = \inf\limits_{\bar{\rho}_{AB}\in\mathcal{B}^{\varepsilon}(\rho_{AB})} D_{\max}(\bar{\rho}_{AB}\|\rho_A\otimes\rho_B)$$
Are the two quantities $D^{\varepsilon}_{\max}(\rho_{AB}\|\rho_A\otimes\rho_B)$ and $I^{\varepsilon}_{\max}(A:B)_{\rho_{AB}}$ close to each other (e.g. the difference is some function of $\varepsilon$) such that they are qualitatively equivalent?
"
"['measurement', 'entropy', 'information-theory']"," Title: Prove that Shannon and von Neumann entropies satisfy $H(P)\ge S(\rho)$ with $P$ diagonal of $\rho$Body: Suppose there is some $n$-qubit state $\rho$. It is well known fact that, given some orthonormal basis $U = \{|u_i\rangle\}$, if $p_i = \langle u_i| \rho |u_i \rangle$ (that is, measuring $\rho$ with $U$ produce the result $u_i$ with probability $p_i$) and $P = (p_1,...)$, then $H(P) \geq S(\rho)$.
Although that statement is written in papers and even in Wikipedia, I haven't found any proper proof nor I have been able to prove it myself.
I would be glad for some help.
"
"['qiskit', 'programming', 'circuit-construction', 'measurement']"," Title: How to measure in another basisBody: I am new to qiskit and I have to simulate a quantum circuit. I read this documentation https://qiskit.org/textbook/ch-states/single-qubit-gates.html where it is left as an exercise to the reader to write a function to measure in the $|+i\rangle$ and $|-i\rangle$ or the y-basis. I want to know if I've done it correctly or not.
I need to measure a state in the y-basis after preparing it in an equal superposition the $|0\rangle$ and $|1\rangle$ states. To do this, I first applied the Hadamard gate which does the first part and takes the $|0\rangle$ state to the $|+\rangle$ state. Now comes the measurement part. To do this I applied an $S^\dagger$ and then the $H$ gate again.
Now I simply measure the state
def Y_measurement(qc,qubit,cbit):
qc.sdg(qubit)
qc.h(qubit)
qc.measure(qubit,cbit)
return qc
circuit = QuantumCircuit(1,1)
circuit.h(0)
circuit.barrier()
Y_measurement(circuit, 0, 0)
circuit.draw(output='mpl')
Is this correct?
"
"['mathematics', 'unitarity', 'haar-distribution']"," Title: Is the Haar measure invariant under conjugation?Body: Denote the Haar measure on the unitary group $U(\mathcal X)$ by $\eta$. Does this equation hold (assuming the integral exists):
$\int d\eta(U) f(U) = \int d\eta(U) f(U^\dagger)$?
Intuitively this makes sense because choosing a random $U$ seems to be the same as choosing a random $U^\dagger$, but I'm not sure how to prove this.
"
"['physical-realization', 'topological-quantum-computing', 'anyons']"," Title: Does this experimental discovery of anyons enables the topological quantum computer (e.g. Microsoft) to become a reality?Body: Microsoft has its own agenda regarding quantum computer - it is topological quantum computer being invented by the team lead by Michael Freedman https://www.microsoft.com/en-us/research/project/topological-quantum-computing/
While this idea is very efficient implementation, it still required experimental proof of anyons. At last such proof has arrived, see New evidence that the quantum world is even stranger than we thought (original publication in Nature Physics, article Direct observation of anyonic braiding statistics).
My question is this: Does this experimental observation and manipulation of anyons solve the main obstacles towards topological quantum computer (e.g. as being implemented by Microsoft)? Or is any fundamental (not technical) challenge remain towards topological quantum computer?
"
"['quantum-state', 'measurement']"," Title: Preparing a state given access to projectorBody: Let's say I am given access to a magical box that lets me apply a projector $|\psi\rangle \langle\psi|$, where $|\psi\rangle$ is a quantum state. I do not know anything about $|\psi\rangle$: just that I am given this magical box. Can I prepare $|\psi\rangle$, in a polynomial amount of time, using it?
One way to do it is: start with any arbitrary efficiently preparable quantum state, apply the projector. If the outcome is $1$, you have $|\psi\rangle$ as your post-measurement state. If not, repeat. Is this intuition correct? A problem I see with it is, the arbitrary quantum state can be almost orthogonal to $|\psi\rangle$. There is no way of knowing whether or not it would be beforehand, as we know nothing about $|\psi\rangle$. Hence, the probability of succeeding in successfully projecting onto $|\psi\rangle$ can be exponentially small, and it will take us an exponentially large time to prepare the state.
Also, is the opposite true? If we can efficiently prepare a state, can we efficiently project onto that state?
"
"['qiskit', 'programming', 'optimization', 'quantum-computing-for-finance']"," Title: Qiskit sample - Portfolio optimizationBody: I've recently tried to run this sample from Qiskit (Portfolio Optimization)
I was able to change RandomDataProvider to YahooDataProvider and able to run it on real stock prices.
However, there is one peculiar challenge I'm facing - I'm not sure if it is my lack of understanding. At this particular code
budget = num_assets // 2 # set budget
penalty = num_assets # set parameter to scale the budget penalty term
qubitOp, offset = portfolio.get_operator(mu, sigma, q, budget, penalty)
No matter what budget or penalty I set this to, I always receive portfolio with about half of the total number of assets.
For example, if my total number of assets is 5, then my budget is 2 (from above code). The result always contains 2 assets [0 0 1 1 0]
If I change my budget to
budget = num_assets // 3
and my total assets are 5, then I expect to see only 1 asset in the resulting portfolio. However, I see 2
If I increase my num_assets to 10 and make
budget = num_assets
I still get a portfolio of 5 or 6 stocks (close to half of 10) and not a portfolio of 10.
Note - I'm running on qasm_simulator
Is there a gap in my understanding? What role do these variables - budget and penalty - play while building the portfolio?
"
"['qiskit', 'programming']"," Title: Qiskit plot_state_qsphere phase errorBody: I'm trying to visualize a simple circuit in Qiskit. A single gate $Y$ is applied to the single-qubit register. The expected state is:
$$ Y |0\rangle
= \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}
= \begin{bmatrix} 0 \\ i \end{bmatrix}
= i |1\rangle $$
Then I visualize the final state with plot_state_qsphere function (documentation). Since the coefficient of $|1\rangle$ is $i$ I'm expecting phase $\pi/2$ since $i = e^{i \pi/2}$.
from qiskit import *
from qiskit.tools.visualization import plot_state_qsphere
print(qiskit.__qiskit_version__) # {'qiskit-terra': '0.15.1', 'qiskit-aer': '0.6.1', 'qiskit-ignis': '0.4.0', 'qiskit-ibmq-provider': '0.8.0', 'qiskit-aqua': '0.7.5', 'qiskit': '0.20.0'}
circuit = QuantumCircuit(1)
circuit.y(0)
statevector = execute(circuit, backend=Aer.get_backend('statevector_simulator')).result().get_statevector()
print(statevector) # [0.-0.j 0.+1.j]
plot_state_qsphere(statevector)
In this representation, $\pi/2$ phase corresponds to green color. However, I visualize the red color ($0$ phase). Is it a known bug? Am I missing something?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: Alternative Grover's Diffuse OperatorBody: I was wondering if there is any good references where I could read to understand the construction of Unitary Operators such as the Diffuse Operator in Grover's Algorithm.
I am looking to build my own set of unitary operators with the objective of boosting the amplitude of specific quantum states for which there is no access to oracles to perform the phase flip prior to the inversion about the mean.
"
"['qiskit', 'stabilizer-code', 'stabilizer-state']"," Title: What is a Qiskit stabilizerBody: I wonder what is a Qiskit stabilizer and why we need it. Also I want to know the difference between stabilizer and extended stabilizer.
"
"['qiskit', 'ibm-q-experience']"," Title: Do I need to download Qiskit from IBM Quantum Experience?Body: Do I need to download Qiskit separately or can I learn and write programs as well as practically view possible visualizations in IBM Quantum Experience itself?
"
"['textbook-and-exercises', 'hadamard']"," Title: What is the output of applying the Hadamard matrix to $\sum_{y\in\{0,1\}^n} (-1)^{xy}|y\rangle$?Body: If, for some $x$, I have the $n$-qubit state
$$\sum_{y\in\{0,1\}^n} (-1)^{xy}|y\rangle,$$
and I would like to apply to that the $n$-qubit Hadamard transform, with the aim of calculating the final state.
I understand I can continue like following:
$$\sum_{y\in\{0,1\}^n}\sum_{j\in\{0,1\}^n}(-1)^{xy}(-1)^{jy} |j\rangle
= \sum_{y\in\{0,1\}^n}\sum_{j\in\{0,1\}^n}(-1)^{y(x+j)}|j\rangle, $$
but what cancels out here and why?
"
"['programming', 'q#']"," Title: Run circuit N times in Q#Body: I use dotnet run command to run my .qs quantum circuit. Is there a way to run my circuit N times, and get results of each run (like the shots parameter in Qiskit) ?
Thank you.
"
"['quantum-gate', 'quantum-state', 'error-correction', 'universal-gates', 'fault-tolerance']"," Title: What are magic states?Body: I wonder what are magic states, and a magic state gadget. While I'm reading a paper, these terms frequently appear.
"
"['qiskit', 'programming', 'circuit-construction', 'random-quantum-circuit', 'randomised-benchmarking']"," Title: How to split a Quantum Circuit on a barrier in Qiskit?Body: Let's say I have a QuantumCircuit with multiple barriers as shown in the visual below:
How would I split up the QuantumCircuit on the barriers into a list of 3 QuantumCircuits in Qiskit?
NB: Not directly relevant to the question, but the circuit is a random Unitary circuit, as I'm doing randomised-benchmarking. The circuit is generated as shown in the Qiskit Textbook: 5.3 Randomized Benchmarking.
"
"['quantum-gate', 'programming', 'q#']"," Title: Implement U2 and U3 gate in Q#Body: I know that U1 equivalent gate of Qiskit in Q# is R1, but I would like to implement U2 and U3 gate of Qiskit in Q#, what is the best way ?
Thank you.
"
"['quantum-gate', 'algorithm', 'ion-trap-quantum-computing']"," Title: What is the elementary gate set for ion-trap quantum computers?Body: I asked earlier Which quantum gates can we use in terms of depth?. In the question, I asked
I want to measure the depth of a circuit, but I do not know which quantum gates should be used when the circuit is decomposed.
and the answers is
depending on hardware.
If we use the quantum computer made of ion trap, what is the gate set, especially two-qubit gate? I have heard that $XX$ rotation is one of them, is it right?
"
['clifford-group']," Title: Is the Clifford group finite?Body: For any fixed $n$, how do we prove that the $n$-qubit Clifford group (subgroup of $ U(2^n) $ generated by Hadmard gates, phase-shift gates and CNOT gates) is finte or not? I know that for the single qubit case, where only H gate and S gate are involved, it is a finite group since these two gates correspond to $\pi$ rotations on the Bloch sphere along axes that manifest symmetry. I guess it remains to be finite in multi-qubit case but I couldn't find a way to prove that rigorously.
Moreover, if it is finite, what is the expression of the number of elements in the group as a function of $n$?
"
"['qiskit', 'gate-synthesis']"," Title: Decomposition of $|110\rangle \leftrightarrow |000\rangle$ Exchange GateBody: How to implement a 3 qubit gate, that exchanges the level $|110\rangle$ and $|000\rangle$, with elementary gates (CNOT, SWAP, Toffoli, local gates, etc.(everything Qiskit allows)):
$$
U=\pmatrix{
0 & 0 & 0 & 0 & 0 & 0 & 1 & 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\\
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\
}=?
$$
I tried to decompose the unitaries hamiltonian $U=\exp(-i\pi $$H$$)$ in the Zeeman basis, but it doesn't looks not very promising.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Getting an error running a program in IBM Q Experience Quantum labBody: Running the program in Quantum Lab, it shows error. I am looking for solution.
Here is a code I run:
circ = QuantumCircuit(3)
circ.h(0)
circ.cx(0, 1)
circ.cx(0, 2)
circ.draw('mpl')
from qiskit import Aer
backend = Aer.get_backend('statevector_simulator')
job = execute(circ, backend)
result = job.result()
outputstate =result.get_statevector(circ, decimals=3)
print(outputstate)
An here is an error I got:
NameError Traceback (most recent call last)
<ipython-input-3-17b8e431afa9> in <module>
----> 1 circ = QuantumCircuit(3)
2 # Add a H gate on qubit 0, putting this qubit in superposition.
3 circ.h(0)
4 # Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
5 # the qubits in a Bell state.
NameError: name 'QuantumCircuit' is not defined
```
"
"['algorithm', 'quantum-parallelism']"," Title: How one would implement the circuit to create superpositions corresponding to efficiently integrable probability distributions?Body: See article here: https://arxiv.org/abs/quant-ph/0208112
There are two steps in this procedure that I am curious about. First off, they suppose one can construct a circuit which efficiently performs the computation
$$\sqrt{p_i^{(m)} } |i\rangle|0\cdots 0\rangle \rightarrow \sqrt{p_i^{(m)} } |i\rangle|\theta_i\rangle.$$
How would one implement such a circuit? My guess is that one implements it in a similar way that one would on a classical computer, but quantum parallelism allows for $\theta_i$ to be calculated for all bit-combinations simultaneously. However, I have no idea how one starts when designing such circuits. Is there any place I can learn this so I can implement this procedure for any function $f(i) = \theta_i$?
My next question is regarding the next step of the procedure. That is
$$\sqrt{p_i^{(m)} } |i\rangle|\theta_i\rangle|0\rangle \rightarrow \sqrt{p_i^{(m)} } |i\rangle|\theta_i\rangle(\cos\theta_i|0\rangle + \sin \theta_i|1\rangle). $$
This step is also completely unfamiliar to me. How does one perform a rotation on an ancilla qubit, where the rotation angle is given by the binary number represented by the state $|\theta_i\rangle$?
Any literature or answers getting me closer to learning this would be highly appreciated.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: How to remove last n layers of Quantum Circuit in Qiskit?Body: Let's say I have a QuantumCircuit with depth $d$ layers. How can I generate a new QuantumCircuit with the last n layers removed. For example, let's say the QuantumCircuit has $d=8$ layers as follows:
And let's say the last n=4 layers are desired to be removed then the resulting QuantumCircuit should be as follows leaving only the first 4 layers of the above QuantumCircuit:
How can this be done in Qiskit?
"
"['qiskit', 'programming', 'ibm-q-experience', 'fidelity']"," Title: How do I compute the fidelity on the IBM Q using qiskit without the statevector simulator?Body: I want to compare the fidelity of a circuit implemented on IBMQ Santiago with the ideal circuit simulated using the statevector backend. Is there a way to do this? So far I have only seen examples where both circuits involve the statevector backend.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: qiskit - MCMT - base gate acting on only one qubitBody: I want to reduce the depth of a ucrz gate acting on multiple qubits with ancilla qubits in qiskit. One way to do this could be the mcmt implementation with method='v-chain'. However, it seems that mcmt is incompatible with base gates acting on multiple qubits. How can I reduce the circuit depth with ancillas?
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.extensions.quantum_initializer.ucrz import UCRZGate
import numpy as np
nqbits=3 # the number of qubits
qr = QuantumRegister(nqbits) #initialize register
QM = QuantumCircuit(qr) #initialize circuits
ang_li=list([np.pi,np.pi,-np.pi,np.pi])# list of angles
QM.ucrz(ang_li,q_controls=[qr[1],qr[2]],q_target=[qr[0]])#apply the gate
on the first register
display(QM.draw())#This is the full circuit
display(QM.decompose().decompose().decompose().draw()) #This is the decomposed circuit whose depth I wanna reduce with ancillas
qr2 = QuantumRegister(2*nqbits-1) #initialize the second register
ancilla = QuantumCircuit(qr2) #initialize the second circuit
ancilla.mcmt(UCRZGate(ang_li),[1,2],0,[4,5], mode='v-chain') #try to apply the same gate with 'vchain'+ ancilas. it gives an error!! Seens mcmt is incompatible with base gates acting on multiple qubits
display(ancilla.decompose().decompose().decompose().decompose().draw())
print(ancilla.decompose().decompose().decompose().decompose().count_ops())
print(ancilla.decompose().decompose().decompose().decompose().depth())
"
"['algorithm', 'quantum-state', 'qiskit', 'programming', 'graph-states']"," Title: QiskitError: 'No statevector for experimentBody: This is the code that I have used. Why can't i use get_statevecto when i use quantum computer. I got a state_vector when i have used qasm_simulator.
qcomp = provider.get_backend('ibmq_5_yorktown')
fidelitycount = 0
shots = 1
for i in range(shots):
num_qubits = 5
adj_matrix_fcg = np.ones((num_qubits,num_qubits),dtype=int)
circuit_fcg_5 = qiskit.circuit.library.GraphState(adj_matrix_fcg)
sv2 = execute(circuit_fcg_5, qcomp).result().get_statevector(circuit_fcg_5)
#fidelity = qiskit.quantum_info.state_fidelity(sv1)
#fidelitycount += fidelity
print(sv2)
and this is the error
"
"['measurement', 'vqe']"," Title: Circuit for VQE Expectation Value FindingBody: I'm looking into the circuit for the VQE, but am stumped at how we can identify the expectation value of the Pauli series. Essentially, how do we find:
$$ \langle \psi | H_i | \psi \rangle $$
Given $H_i$ can be decomposed into Paulis?
The first strategy that comes to mind is simply applying the adjoint of the state prep routine and finding the average number of 0s measured, but this doubles the number of state prep calls necessary. Is there an alternative circuit I'm missing?
"
"['quantum-state', 'entanglement', 'foundations']"," Title: Effect of quantum entanglement on measurementBody: I'm taking a quantum information systems class and thought of this while trying to wrap my head around some material, so I apologize if this comes off as dumb or founded on misunderstandings.
Say you have a system consisting of three qubits a, b, and c, where qubits b and c are entangled in a Bell state, but you're not aware of this fact. You take a measurement of qubits a and b, inherently losing the information/collapsing the wavefunction (?).
As qubit c was in an entangled state with qubit b, but was never directly or knowingly measured, does the measurement also affect the third qubit, causing it to lose its information as well? I feel like the answer is yes but it's interesting to think about.
TLDR: If a qubit is measured in a forest, but no one is around to take the measurement it, does it still affect its state?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Error while running Qiskit code on real quantum hardwareBody: I started to learn Qiskit, so sorry if my question is very basic. So far I used qasm_simulator or state_vectorsimulator, however, now I would like to run my circuit on real IBM Q processor.
Here is my code, I wanted to execute:
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
provider = IBMQ.load_account()
backend = provider.backends(name='ibmq_ourense')
q = QuantumRegister(5, name = 'q')
c = ClassicalRegister(2,name = 'c')
circuit = QuantumCircuit(q,c)
circuit.h(q[0])
circuit.cx(q[0],q[1])
circuit.measure(q[0],c[0])
circuit.measure(q[1],c[1])
job = execute(circuit, backend, shots = 1024)
counts = job.result().get_counts()
plot_histogram(counts)
However, this error was shown:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-26-b48ae13f56aa> in <module>
11 circuit.measure(q[1],c[1])
12
---> 13 job = execute(circuit, backend, shots = 1024)
14 counts = job.result().get_couns()
15 plot_histogram(counts)
/opt/conda/lib/python3.7/site-packages/qiskit/execute.py in execute(experiments, backend, basis_gates, coupling_map, backend_properties, initial_layout, seed_transpiler, optimization_level, pass_manager, qobj_id, qobj_header, shots, memory, max_credits, seed_simulator, default_qubit_los, default_meas_los, schedule_los, meas_level, meas_return, memory_slots, memory_slot_size, rep_time, rep_delay, parameter_binds, schedule_circuit, inst_map, meas_map, scheduling_method, init_qubits, **run_config)
258 seed_transpiler=seed_transpiler,
259 optimization_level=optimization_level,
--> 260 backend=backend)
261
262 if schedule_circuit:
/opt/conda/lib/python3.7/site-packages/qiskit/compiler/transpile.py in transpile(circuits, backend, basis_gates, coupling_map, backend_properties, initial_layout, layout_method, routing_method, translation_method, seed_transpiler, optimization_level, pass_manager, callback, output_name)
211 callback, output_name)
212
--> 213 _check_circuits_coupling_map(circuits, transpile_args, backend)
214
215 # Transpile circuits in parallel
/opt/conda/lib/python3.7/site-packages/qiskit/compiler/transpile.py in _check_circuits_coupling_map(circuits, transpile_args, backend)
244
245 # If coupling_map is None, the limit might be in the backend (like in 1Q devices)
--> 246 elif backend is not None and not backend.configuration().simulator:
247 max_qubits = backend.configuration().n_qubits
248
AttributeError: 'list' object has no attribute 'configuration'
I think that the problem is hidden in getting backends or execute command.
Note: I run my code in Quantum Lab on IBM Q website interface.
Could any please help me how to change my code to run it on real IBM Q processor?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Qiskit: Get gates from circuit objectBody: Is there a way in Qiskit to take a circuit object and return a list of tuples where each tuple consists of a gate and the qubit(s) they act on? The list obeys some partial order since the gate order cannot be swapped unless they commute.
"
"['qiskit', 'ibm-q-experience']"," Title: Error associated with HTTPSConnectionPoolBody: How can I solve this situation?
I'm using the IBMQX2 chip. When I run my simulation some circuits are executed and the following WARNING message is displayed:
account._job_result_object_storage:WARNING:2020-09-10 05:31:30,318: An error occurred while sending download completion acknowledgement: "HTTPSConnectionPool(host='api.quantum-computing.ibm.com', port=443): Read timed out. (read timeout=None)"
After a long time a few more circuits are run and the following error message is displayed:
IBMQBackendApiError: 'Error sending job: "HTTPSConnectionPool (host = \ 'api .quantum -computing.ibm.com \', port = 443): Reading timeout. (reading timeout = None) ".
At this point, the entire simulation is permanently stopped. When I used Windows 10 this type of message did not appear but, recently, I changed the operating system to Ubuntu 20.04. I don't know if it is necessary to do some kind of configuration on Linux.
"
['measurement']," Title: How can we only use 8192 shots for an experiment with 14 or more qubits?Body: Let's say you want to do an experiment with 14+ qubits. You apply some arbitrary unitary operator $U \in (\mathbb{C}^2)^{\otimes n} \times (\mathbb{C}^2)^{\otimes n}$ to the state $|\psi\rangle \in (\mathbb{C}^2)^{\otimes n} $. That is
$$ U|\psi \rangle = |\phi \rangle $$
We can take $|\psi \rangle = |0\rangle^{\otimes n} $ to fits with current quantum computing setting. Now, if we do this experiment with $2^{13} = 8192$ shots, how is this enough to build up the statistical distribution as we have more than $2^{14}$ slots to distribute them to. If your output state $|\phi\rangle$ is particular eigenstate, says $|0110\cdots 1 \rangle$, then this many shots is more than enough. But if $|\phi\rangle$ is in a $2^n$ superposition state, then how is this enough? We wouldn't have enough experimental data to build up an accurate statistical distribution. Of course, I can repeat my experiment/job with 8192 shots a bunch of times and average out the results but even then it would still take a huge amount of experiments to have enough number of shots to get meaningful results... especially for variational type quantum algorithms... where one would need millions of shots to get within chemical precision.
"
"['qiskit', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: What is the advantage of QSVM over the classical SVM?Body: I am mainly talking about QSVM from Qiskit (https://qiskit.org/documentation/stubs/qiskit.aqua.algorithms.QSVM.html#qiskit.aqua.algorithms.QSVM) versus a classical SVM. Is it just a time complexity speed-up?
"
['stabilizer-state']," Title: Inner Product of Stabilizer StatesBody: The end of Section III in the paper Improved Simulation of Stabilizer Circuits by Aaronson and Gottesman shows how to compute the inner product of stabilizer states $|\psi\rangle$ and $|\varphi\rangle$ represented by sets of generators of their stabilizer group.
Given generators for $|\psi\rangle$ and $|\varphi\rangle$, it suggests to compute the inner product of $U |\psi\rangle$ and $U |\varphi\rangle$, where $U$ is chosen to ensure that $U |\psi\rangle=|0\rangle^{\otimes n}$. It then computes generators for $U |\varphi\rangle$ represented as a tableau and applies Gaussian elimination to this tableau.
I don't understand the following aspects of this algorithm:
- How does the algorithm conclude? (The final steps of the algorithm are not clear to me)
- Why is this algorithm correct? (The reasoning in the paper is not clear to me)
"
"['qiskit', 'programming']"," Title: Qiskit: Add a standard gate to circuit from a stringBody: Given a circuit, if one wishes to add a gate, it is done through a line like the one below
mycircuit.cx(0, 1)
Here, we have added a control-X gate on the 0 and 1 qubits. This is probably a Python question but how can one do this given the string 'cx' and integers 0 and 1 i.e. without manually typing them?
I tried using https://stackoverflow.com/questions/3061/calling-a-function-of-a-module-by-using-its-name-a-string but getattr did not work for me.
from qiskit import QuantumCircuit
circ = QuantumCircuit(2)
circ.draw()
a = ('cx', 0, 1)
circ = getattr(circ, a[0])(a[1], a[2])
circ.draw()
"
"['qiskit', 'mathematics', 'textbook-and-exercises']"," Title: How to calculate spherical angles for Bloch vectorBody: I am doing the 5th exercise on https://qiskit.org/textbook/ch-states/representing-qubit-states.html#Quick-Exercise (all the way at the bottom).
Which states find the angle for the vector $\frac{1}{\sqrt2}\begin{pmatrix}i\\ 1\end{pmatrix}$.
I find that $$\cos\left(\frac{\theta}{2}\right) = \frac{i}{\sqrt{2}}
\qquad\text{and}\qquad e^{i\phi} \sin\left(\frac{\theta}{2}\right) = \frac{1}{\sqrt{2}}.$$
I don't know how to find the angles. Or do I just leave it in the form of cosine and sine inverse?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to execute many circuits on an IBMQ backend?Body: I attempted to execute a list of $3200$ QuantumCircuits in Qiskit, each with the max_shots of $8096$ as follows:
ibmq_manhattan = provider.get_backend('ibmq_manhattan')
job = execute(all_qc, backend=ibmq_manhattan, shots=8096)
job_monitor(job)
and got the following response:
Job Status: job has been cancelled
Furthermore, I successfully performed the exact same execution locally using the Aer qasm_simulator. Presumably this is because there is a runtime timeout on the IBMQ backend device which is triggered as one might expect for such a large list. Is this correct? and if so how can I bypass this limitation?
This is a summary of the job on IBMQ:
"
"['quantum-state', 'simulation', 'qasm']"," Title: How to plot histogram using statevector simulator?Body: I'm trying to run my quantum circuit and plot the simulation result (counts) using the statevector simulator (to avoid 'shot noise'). However, instead of a 2-d histogram, the examples on Qiskit textbook associated with statevector simulator used 'plot_state_city' (which generates 3-d pictures). I'm wondering how can I generate the histogram. Here's part of my code:
The output statevector isn't the correct one, so the corresponding histogram (and counts) is not what I desired. However, if I use the qasm-simulator, I can get the result I want:
Is there a way I can get the similar histogram using the statevector simulator? Thanks!!
"
"['quantum-gate', 'phase-kickback']"," Title: How to understand intuitively the quantum gate phase kickback?Body: I do understand the math behind phase kickback. The math makes sense. For more context, I find this document very helpful.
But I’m struggling a lot to intuitively understand, why the conditional phase change to the second qubit will end up change the phase of the first qubit (the control qubit)?
Can somebody help to explain this in an intuitive way?
"
"['qiskit', 'programming']"," Title: How to initialise a qubit in the state $\frac{1}{\sqrt2}(|0\rangle+|1\rangle)$ in qiskit?Body: In qiskit, how can I initialise a qubit in a complex state, specifically in the state:
$$\left|q\right> = \frac{1}{\sqrt2} \left|0\right> + i \frac{1}{\sqrt2} \left|1\right>$$
"
"['quantum-state', 'bloch-sphere', 'notation']"," Title: What is the ""phase"" of a state in terms of the Bloch sphere?Body: I am pretty new to Quantum Computing and am not exactly sure what the phase is.
Could you please explain in terms of the Bloch sphere and point out how to mathematically calculate and represent the phase?
"
"['qiskit', 'ibm-q-experience']"," Title: quantum random number generator implementation in quantum labBody: How can I generate and print a 32 bit sequence of 0s and 1s in Qiskit or IBM Q experience quantum lab using quantum random number generator implementation?
"
"['algorithm', 'complexity-theory']"," Title: Question regarding soundness bound in QMA versus QCMA separationBody: I am trying to understand the soundness bound reached in Theorem 4 of this paper, which deals with separating $QMA$ and $QCMA$ with respect to an in-place oracle. To state just the part I am confused with:
For some fixed integer $n$, let $N = 2^{{n}}$. Let $S \subseteq
[N^{2}]$ be a set such that $|S| = N$. Let
$$A = \frac{1}{2^{n}}~~ \Big| \sum_{i \in S} \beta_{i} \Big|^{2}$$
and
$$B = \sum_{i \in Z_{even} \cap S} | \beta_{i} |^{2}.$$
where each $\beta_{i}$ is a complex number, $[n] = \{1, 2, \ldots,
n \}$ and
$$\sum_{i \in [N^{2}]} | \beta_{i} |^{2} = 1.$$
$Z_{even}$ is the set of all even integers, where we know that $|Z_{even} \cap S| = \frac{1}{3} |S|$. I am trying to prove that
$$1 \geq \frac{\sqrt{3A} +(\sqrt{2} - 1)B}{\sqrt{2}}.$$
As per the paper, I am using the triangle and Cauchy Schwarz inequalities but I get stuck after a point. Here is my incomplete attempt at a solution:
$$A \leq \frac{1}{2^{n}}~ \Bigg(\sum_{i \in S} |\beta_{i}|\Bigg)^{2} \leq ~ \sum_{i \in S} |\beta_{i}|^{2} = B + \sum_{i \in Z_{odd} \cap S} | \beta_{i} |^{2}.$$
I am stuck after this.
"
"['quantum-gate', 'programming']"," Title: What is the connection between $RX$ gates and $X$ gates (similar for $Y$ and $Z$)?Body: I am new to quantum gates but do not understand the connection between the $RX$ and $X$ gates. I know that
$$R X(\theta)=\exp \left(-i \frac{\theta}{2} X\right)=\left(\begin{array}{cc}
\cos \frac{\theta}{2} & -i \sin \frac{\theta}{2} \\
-i \sin \frac{\theta}{2} & \cos \frac{\theta}{2}
\end{array}\right)$$
Meanwhile the $X$ gate is given by
$$X = \left(\begin{array}{cc}
0 & 1 \\
1 & 0
\end{array}\right)$$
Is there a value of $\theta$ such that the two are the same? I see that choosing $\theta = \pi/2$ gives the result upto an overall factor of $-i$. Is that it or is there a deeper connection between the two gates? Is there a similar connection between the $Y$ and $RY$ gates and the $Z$ and $RZ$ gates such that the rotated gates are more general than the $X, Y$ and $Z$ gates?
"
"['programming', 'cirq']"," Title: Running Google Cirq example code from their webpage -- where do I find information about PROCESSOR_ID?Body: I'm just ttrying to run the simple example code in Google's Cirq startup page:
https://cirq.readthedocs.io/en/stable/google/engine.html
I think I have the access authorized correctly via Google's Console, but can someone help me understand where I would find the information for the PROCESSOR_ID? Thanks.
Code cut/paste from their webpage here:
import cirq
import cirq.google as cg
# A simple sample circuit
qubit = cirq.GridQubit(5, 2)
circuit = cirq.Circuit(
cirq.X(qubit)**0.5, # Square root of NOT.
cirq.measure(qubit, key='result') # Measurement.
)
# Create an Engine object to use.
# Replace YOUR_PROJECT_ID with the id from your cloud project.
engine = cg.Engine(project_id=YOUR_PROJECT_ID, proto_version=cg.ProtoVersion.V2)
# Create a sampler from the engine
sampler = engine.sampler(processor_id='PROCESSOR_ID', gate_set=cg.SYC_GATESET)
# This will run the circuit and return the results in a 'TrialResult'
results = sampler.run(circuit, repetitions=1000)
# Sampler results can be accessed several ways
# For instance, to see the histogram of results
print(results.histogram(key='result'))
# Or the data itself
print(results.data)
"
"['qiskit', 'programming']"," Title: Qiskit job not giving the right result after executionBody: Here is my code
import numpy as np
import qiskit
from qiskit import *
number_of_qubits = 3
backend_sim = Aer.get_backend('qasm_simulator')
#Generate a circuit in qiskit
input_circuit = QuantumCircuit(number_of_qubits, number_of_qubits)
input_circuit.x(0)
input_circuit.h(1)
input_circuit.cx(0,1)
input_circuit.i(1)
input_circuit.x(1)
job_sim = execute(input_circuit, backend_sim, shots=1024)
result_sim = job_sim.result()
counts = result_sim.get_counts(input_circuit)
print(counts)
No matter what gates I try (e.g. I can remove the last X gate), the result is always '000': 1024. What am I doing wrong?
"
"['qiskit', 'programming']"," Title: How many shots are executed when using the IBMQJobManager?Body: When using qiskit execute it is possible to stipulate the number of shots for each experiment/QuantumCircuit, however when using IBMJobManager this is seemingly not possible.
Is this correct and if so how many shots are executed by default? and if not how can the number of shots be specified?
"
"['qiskit', 'programming']"," Title: Is the combine_results method deprecated in qiskit v0.20.0Body: According to the ManagedResults Documentation the class has a combine_results method, however when attempting to use it as follows:
job_set = IBMQJobManager().run(circs, backend=ibmq_backend, name='job-set-abc')
job_results = job_set.results()
job_results_combined = job_results.combine_results() # fails on this line
job_counts_combined = job_results_combined.get_counts()
I get the following error:
AttributeError: 'ManagedResults' object has no attribute 'combine_results'
Furthermore, the combine_results method is not listed under help(type(job_results)):
Does this mean that the method has been deprecated? If so how can I overcome this?
"
"['ibm-q-experience', 'measurement', 'noise', 'qasm']"," Title: What causes the random variations in the probabilities with respect to the theoretical values, in IBM and QASM simulators?Body: When I measure 2 and 3 qubits after putting H gate on all of them, there is a variation in probabilities of results in comparison with theoretical values (25% and 12.5%, respectively).
This occurs on different IBM machines and QASM simulators. What causes these differences?
"
"['qiskit', 'mathematics', 'qaoa']"," Title: Deriving Expression For QAOA Optimal Trial State ParametersBody: I am going through the QAOA section in the Qiskit Textbook - QAOA and am stuck in one of the steps. In section 5.2, the method for getting the Optimal Trial State Parameters are discussed. I do not follow how does Eq 2 follow from Eq 1.
I have done some digging and have read other useful posts like Quantum Approximate Optimization Algorithm explained and How to do the direct evaluation by hand in QAOA algorithm, and they have helped understand the problem better; but I am still unable to derive Equation 2 from 1. Any help or guidance would be appreciated. I am trying to find the optimal parameters of beta and gamma for different kind of graphs.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: What is the significance of varying the number of shots while running a circuit in a quantum machine and qasm simulator?Body: what is the significance of varying the number of shots while running a circuit in a quantum machine and qasm simulator?
Does more number of shots give better/accurate result?
I am running a simple 2 qubit measurement circuit after Hadamard gates on both qubits.
"
"['entanglement', 'quantum-operation']"," Title: Is entanglement nonincreasing on average by local operations for all possible ensemble decompositions?Body: We know for a pure state conversion $|\psi \rangle \rightarrow_\textrm{LOCC} |\phi \rangle$ via local operation and classical communication (LOCC), an entanglement monotone should not increase, that is, $E(|\psi \rangle) \geq E(|\phi \rangle)$.
Say for a pure to mixed state conversion $|\psi \rangle \rightarrow_\textrm{LOCC} \rho$ given by the unique ensemble $l = \{ q_l, |\xi_l \rangle \} \in \mathcal{D}$ fixed by pointer states (which are omitted), where $\mathcal{D}$ is the set of all decompositions for $\rho$.
Naturally, the convex roof extension $E_\textrm{min}(\rho) = \min_\mathcal{D} \Sigma_i q_i |\xi_i \rangle \langle \xi_i|$ should not increase, nor should that of the obtained ensemble $l$ on average, i.e., $E(|\psi \rangle) \geq E_l(\rho) \geq E_\textrm{min}(\rho)$.
So, is it for certain there is not some decomposition $j = \{ q_j, |\xi_j \rangle \}$ that violates the nonincreasing criterion for $E$ on average, i.e., $E_j(|\rho \rangle) \geq E(\psi \rangle)$?
"
"['quantum-state', 'entanglement', 'measurement', 'density-matrix']"," Title: Can Alice and Bob distinguish entangled state coefficients?Body: Suppose Alice and Bob share the quantum state $\frac{1}{\sqrt 2}(|x\rangle + (-1)^b |y\rangle)$ for some $x\neq y \in \{0,1\}^2$ and $b \in \{0,1\}$. They both do not know $x,y$, and use some middlemen who wishes to learn $b$. They are allowed to send only classical messages to him (i.e. not quantum states). The marginal density matrix of Alice, for example, is
$$
\rho_A = tr_B(\rho_{AB}) = \frac{1}{2}( |x_1\rangle \langle x_1| +|y_1\rangle \langle y_1|
+ (-1)^b |x_1 \rangle \langle y_1| \cdot \langle x_2 | y_2 \rangle
+ (-1)^b |y_1 \rangle \langle x_1| \cdot \langle y_2 | x_2 \rangle
)
$$
Note that when $x_2 \neq y_2$, then $\rho_A$ does not depends on $b$. Moreover, if also $x_1 \neq y_1$, from symmetry arguments, $\rho_B$ does not depends on $b$.
In such case, it seems to me that they can not send any data to the middleman (such as measurements), to help him deduce $b$, as the marginal density matrix, i.e. their personal view of the system, is oblivous of $b$. Is it correct to say so?
Of course when $x_2 = y_2$ for example, then Alice marginal density matrix does depends on $b$, and she can apply Hadamard gate + measure, to obtain exactly $b$, and send it to the middleman.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: Is there a way to generate random circuits in qiskit with only certain allowed gates?Body: It seems like I can use https://qiskit.org/documentation/stubs/qiskit.circuit.random.random_circuit.html but I would like to control the gates that are allowed.
What is an efficient way to make random circuits with a fixed set of gates?
"
"['qiskit', 'programming', 'circuit-construction']"," Title: Test equivalence of circuits exactly on qiskitBody: I have two circuits that I believe are equivalent. When I say 'equivalent' I mean that they have equivalent unitary representations up to a global phase. How can one check this using Qiskit? How I would show equivalence isn't clear to me.
"
"['qiskit', 'programming', 'quantum-operation', 'gate-synthesis', 'projection-operator']"," Title: How to code a projector operator in qiskit?Body: I'm new to qiskit and I want to know how do I define a projector operator in qiskit? Specifically, I have prepared a 3 qubit system, and after applying a whole lot of gates and measuring it in a state vector simulator, I have to apply the projector operator $|0\rangle_{1}|0\rangle_{2} \langle0|_{1}\langle0|_{2}$ on the state that I get after I measured all the qubits in the circuit. I do know the physics and math behind it, and the tensor product it represents but I'm unable to code this successfully. I was thinking maybe a 4x4 matrix representation of this operator might help but I'm not sure about it.
So I'm asking 2 questions here-
- How do I define a projector operator like this in qiskit
- How do I apply that operator to a state that I have measured with a state vector simulator?
Thanks in advance
"
"['quantum-gate', 'quantum-state', 'qiskit', 'circuit-construction']"," Title: Google Colab - ImportError: The class MatplotlibDrawer needs pylatexencBody: When I run the following command
qc.draw(output='mpl')
for my circuit qc, I get this error:
ImportError: The class MatplotlibDrawer needs pylatexenc
How do I address this issue? Below an image of my problem
Update ------
Installation steps on Google Colaboratoy:
!pip install pylatexenc ?.
The installation attempt (was successful and the installed pylatexenc has version 2.7.)
"
"['algorithm', 'qiskit', 'circuit-construction', 'grovers-algorithm']"," Title: Can one use a quantum circuit as a pathfinding algorithm?Body: I've been learning about quantum computing, and I noticed that another way to describe the state vector is as a path in a binary tree where each level of tree represents another qubit, each node represents a state, and the edge weights represent the probability amplitude of moving from one state to another. Here's an example: (Sorry for MS Paint!)
Now what's interesting is that if you start with a state vector of |0>, placing qubits into superposition opens paths in the tree, while entanglement and "measurement" close paths. I was working this out with the sudoku example in the qiskit textbook at Qiskit Grover's Algorithm Example, and I found that if you adhere to the following principles, you can find the solution state while avoiding false paths in the tree just by following the quantum circuit:
- Start with a linear tree with every bit in the 0 state.
- Place a single variable qubit into superposition, creating a single sub-tree/branch.
- Apply all CNOT gates related to that qubit to close off any potential branching and adjust the states of the nodes appropriately.
- Whenever a "clause bit" (as described in the link above) no longer has any more gates attached to it, or is no longer being interacted with, close all branches where the nodes do not have the "clause bit" in a position of 1.
- Place the next variable qubit into superposition and repeat 3 & 4, until all variable qubits have been placed into superposition.
So, the circuit design would look like this (forget about the diffuser and toffoli for the moment):
I did a step-by-step implementation of this in excel, drawing out all of the trees, and I found that only two main sub-trees form (one for each solution) and that at most only four sub-trees/branches are present at any one time. Furthermore, at the end, all of the clause bits were in the state 1. Now considering that there are a total of 8 qubits in this system, a total of 256 different paths are possible. Is this just a trivial example or could this actually be implemented as a viable algorithm for path finding?
Edit:
P.S. Could this answer P = NP?
Also I noticed my quantum circuit isn't quite correct.
"
"['algorithm', 'quantum-state']"," Title: Question on output of SWAP testBody: Let's say I have two arbitrary quantum states $|\psi\rangle$ and $|\phi\rangle$. I apply the SWAP test circuit (something like what is given here), and measure the first qubit to get either $0$ or $1$. Is there any way to get back the states $|\psi\rangle$ and $|\phi\rangle$, in an unentangled form, after this measurement? From what I understand, measuring the output entangles the two states.
"
"['quantum-gate', 'programming', 'circuit-construction', 'optimization', 'random-quantum-circuit']"," Title: Implementing a circuit that returns $|01\rangle$ and $|10\rangle$ with equal probabilityBody: Using Python how can I implement a quantum circuit that returns $|01\rangle$ or $|10\rangle$ using only $CX$, $RX$ and $RY$ gates, starting with random parametric gates as parameters and optimizing it using gradient descent or other optimization algorithm?
"
"['algorithm', 'noise', 'quantum-parallelism']"," Title: Splitting a quantum task between multiple devicesBody: I've been wondering, are there any known tasks/algorithms that can be performed on 1 quantum device, but also be somehow modified and split between several smaller devices?
The thought behind the idea, is that if creating large quantum computers (meaning computers with large number of qubits to work with) that are also stable and noise-tolerant to some degree is a hard task, maybe we could utilize several smaller devices, which are naturally less prone to noise and perform algorithms that would require a larger device.
For instance, instead of using a computer with 10 qubits, we could maybe use 2 computer with 5 to 6 qubits each, or something in that direction.
If there is, by chance, a sub-field in quantum computation that deals with such questions, I'd really like to know about it and explore it more.
"
"['entanglement', 'measurement']"," Title: What would be measured if you measure two entangled qubits at exactly the same time?Body: What would be measured if you measure two entangled qubits at exactly the same time?
"
"['mathematics', 'error-correction']"," Title: Obtaining hermitian matrix using Knill and Laflamme condition?Body: Let $E$ be the set of all correctable errors and $E_a, E_b \in E$. Let $\lbrace \vert c_1\rangle, \vert c_2\rangle, \ldots \vert c_k\rangle\rbrace$ be the basis of codewords in the codespace. It is necessary that $$ \langle c_i \vert E^{\dagger}_{a}E_b \vert c_j\rangle = 0, \tag{1}$$
for all $i, j \in \lbrace 1, 2, \ldots, k \rbrace \;\land i \neq j$. This is equivalent to
$$ \langle c_i \vert E^{\dagger}_{a}E_b \vert c_i\rangle = \langle c_j \vert E^{\dagger}_{a}E_b \vert c_j\rangle, \tag{2}$$
for all $i, j \in \lbrace 1, 2, \ldots, k \rbrace$. Equation $(1)$ and $(2)$ can be combined as (Knill and Laflamme)
$$ \langle c_i \vert E^{\dagger}_{a}E_b \vert c_j\rangle = C_{ab} \delta_{ij},$$
where $C_{ab} \in \mathbb{C}$ and
$\delta_{ij} = \begin{cases} 1 \text{ if }\, i = j, \\0 \text{ if }\, i \neq j.
\end{cases}$
Furthermore, since
$$\langle c_i \vert E^{\dagger}_{a}E_b \vert c_i\rangle = (\langle c_i \vert E^{\dagger}_{b}E_a \vert c_i\rangle)^*,$$
for all the codewords in the codespace, we can write $C_{ab}$ as a Hermitian matrix.
The source of the above can be found in 2.1.3 Criteria for quantum error correction (page 11).
Questions
- I cannot figure out how equations $(1)$ and $(2)$ are equivalent. My humble explanation suggests that for $(1)$, they are equivalent since $E^{\dagger}_a E_b$ would cancel out to $I$ and we are left with $\langle c_i\vert c_j \rangle = 0$, since they are orthogonal. For $(2)$ we have $E^{\dagger}_a E_b$ would cancel out to $I$ and we are left with $\langle c_i\vert c_i \rangle = \langle c_j\vert c_j \rangle = 1$, since we are projecting a state on itself.
- How can we convert $C_{ab}$ to matrix, what is the matrix dimension and what is the nature of the elements in the cells of this matrix (a binary matrix or elements in $\mathbb{C}$ or something else)?
- Links to questions two, how would $\delta_{ij}$ affect the matrix?
I am certainly not looking for complete answers, I am trying to understand this myself. I am open to any suggestions and scholarly articles that helps. Any hints and tips are appreciated :).
"
"['quantum-gate', 'algorithm', 'circuit-construction']"," Title: How to implement linear combination of two unitary gates in a quantum circuit?Body: I wanted to implement a non-unitary operation. I came to know that I can do it as a linear combination of unitaries from this paper (published version). Let us say I want to implement an operation like $\alpha_1 A_1 + i \alpha_2 A_2$ in a quantum circuit,
where $A_1$ and $A_2$ and unitary operators. Coeffient $\alpha$ are real. How do you do that
"
"['quantum-gate', 'circuit-construction', 'machine-learning', 'optimization', 'qaoa']"," Title: Quantum Circuit Optimization with Machine LearningBody: I read some paper about Quantum Circuit Optimization but I am on a low level.
And have some experience in ML.
But what I don't understand is it possible that ML can help to optimize Quantum Circuits and how does that work ?
Maybe in QAOA case , what does it bring us to optimize the Circuits ?
"
"['qiskit', 'hhl-algorithm']"," Title: Is it required to input full matrix when using Qiskit HHL algorithm for sparse matrices?Body: I am working with a very sparse matrix and it seems inefficient to load the full matrix as input into the Qiskit HHL algorithm. Is it possible to input only the non-zero elements, instead ? I am working with a "clean" banded, tri-diagonal matrix.
"
"['entanglement', 'mathematics', 'density-matrix']"," Title: Give an explicit derivation of the exact formula for the two-qubit absolute separability Hilbert-Schmidt probability $\approx 0.00365826$Body: The two-qubit eigenvalue ($\lambda_i$ >= 0, $i=1,\ldots,4$, $\lambda_4=1-\lambda_1-\lambda_2-\lambda_3$) condition of Verstraete, Audenaert, de Bie and de Moor
AbsoluteSeparability
(p. 6) for absolute separability is
\begin{equation}
\lambda_1-\lambda_3 < 2 \sqrt{\lambda_2 \lambda_4},\hspace{.5in}\lambda_1 >\lambda_2 >\lambda_3>\lambda_4.
\end{equation}
Implementing this condition,
2009paper
I presented an explicit formula
\begin{equation}
1-\frac{3217542976-5120883075 \pi +16386825840 \tan ^{-1}\left(\sqrt{2}\right)}{32768
\sqrt{2}}-\frac{29901918259}{497664} \approx 0.00365826
\end{equation}
for the two-qubit absolute separability probability in terms of the Hilbert-Schmidt measure. (``[C]opious use was made of trigonometric identities involving the tetrahedral dihedral angle $\phi=\cos ^{-1}\left(\frac{1}{3}\right)$, assisted by V. Jovovic.")
A "typo" in this formula
was corrected, and a somewhat reexpressed pair of formulas,
\begin{equation} \label{HSabs}
\frac{29902415923}{497664}+\frac{-3217542976+5120883075 \pi -16386825840 \tan
^{-1}\left(\sqrt{2}\right)}{32768 \sqrt{2}} =
\end{equation}
\begin{equation}
\frac{32(29902415923 - 24433216974 \sqrt{2})+248874917445 \sqrt{2}(5 \pi - 16 \tan ^{-1}\left(\sqrt{2}\right))}{2^{16} \cdot 3^5} \approx 0.00365826
\end{equation}
were given in eq.(A2) in
"Quasirandom estimations of two-qubit operator-monotone-based separability probabilities"
Quasirandom
(We, incidentally observe here that
\begin{equation}
5 \pi -16 \tan ^{-1}\left(\sqrt{2}\right)=\cos ^{-1}\left(\frac{5983}{3^8}\right).)
\end{equation}
Relatedly, in Table 2 (based on eq. (75) there) of
ON THE GEOMETRIC PROBABILITY OF ENTANGLED MIXED STATES
KhvedelidzeRogojin
a fully consistent numerical value of $0.365826 \%$ was given for the Hilbert-Schmidt two-qubit absolute separability probability.
In regard to this result, A. Khvedelidze recently wrote in an email:
"As far I remember we got this result using two numerical methods:
- Evaluating integrals over the absolute separability area ;
- Generating HS random states and testing them on the absolute separability
Our attempts to evaluate all integrals analytically fell down."
So, let me pose the problem of giving an explicit analytic derivation of the two-qubit absolute Hilbert-Schmidt separability probability, as Khvedelidze and Rogojin were not able to do. ( Possibly, a somewhat different, but equivalent formula could emerge.)
The 2009 analytic derivation of mine was lengthy, "messy", with no full record of the step-by-step derivation given.
A Mathematica formulation of the problem, incorporating the Hilbert-Schmidt measure, proportional to (eq. (15.35) in GeometryOfQuantumStates)
\begin{equation}
\Pi_{j<k}^4 (\lambda_j-\lambda_k)^2
\end{equation}
is
I've so far been able to perform the first two integrations (with a large outcome), but not the full three.
"
"['ibm-q-experience', 'terminology']"," Title: What is the significance of transpiling time, validating time, in queue time and running time?Body: What is the significance of different transpiling time, validating time, in queue time, running time for the same circuit run on different quantum systems for same no. of shots in IBM Q experience?
What does longer transpiling time mean?
"
"['quantum-gate', 'classical-quantum']"," Title: Counting Achievable OperationsBody: I'm struggling to find an analytic way to solve this problem.
There are $4! = 24$ possible classical operations on the four 2-Cbit basis states. How many of these are achievable via the classical operations $S_{ij}, C_{ij}, X_j$ and compositions thereof.
I've thought about this in terms of permutation groups and counting the members of each class of these operations, but I am not getting anywhere.
Edit:
C-Bits refer to classical bits (binary states)
$S_{ij}$ is the swap operation between bits $0$ and $1$.
$C_{ij}$ is the control not operation with control $i$ and target $j$.
$X_j$ is the not operation with target $j$.
"
"['quantum-state', 'textbook-and-exercises']"," Title: What is meaning of 'up to a global phase'?Body: What is the importance of global phase? How it affect a unit vector if we see it on a Bloch sphere? What is the meaning of 'up to global phase' in exercise 4.3 of Nielsen and Chuang?
"
"['quantum-gate', 'circuit-construction', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: What is the thought process for circuit making after seeing input and output of a matrix?Body: Here is an exercise (4.27) from Nielsen and Chuang and I found the answer (given in the figure below) online without any explanation. The question was to construct a circuit by seeing a matrix (given in the figure).
So I want to know what should be the thought process after seeing the matrix?
"
"['entanglement', 'experiment', 'solid-state']"," Title: Is there a measurable of entanglement for a many-body system?Body: After having a discussion with a quantum computing colleague, a question came up: is there any meaningful way to measure entanglement (or something related to it) in a solid-state many body system where you don't have the luxury of individual qubit control? Specifically, I am interested in the case of the solid-state, not cold atoms where you can do quite marvelous things at the single qubit level. I suppose there might be various entanglement witnesses out there, but I am wondering which among them is (in-principle) measurable in a real-life solid-state experiment.
To explain what I mean by "meaningful", please not that, as the comments indicate, I acknowledge that measuring the true degree of entanglement of a solid-state system is extremely difficult for fundamental reasons. It is near impossible to put a physical cat into a superposition of two states, for example. However, I would contend that in solid-state systems one is only interested in low-energy phenomena, so entanglement is only of interest for a small subset of the total degrees of freedom. For example, core electrons make up the majority of the degrees of freedom in a solid, but play almost no role in most properties. On the other hand, valence electrons are much fewer in number, but dictate most of the interesting chemical and physical properties. So, by "meaningful" measure of entanglement, I mean a method which allows you to ignore the inactive degrees of freedom that don't contribute anything to the physics of the solid-state system of interest.
As an example of the use of such an entanglement measurable, quantum phase transitions are quite interesting in the context of solid-state systems, and are thought to give rise to enormous entanglement among degrees of freedom as one nears the critical point. If one had an experimentally measurable quantity describing the entanglement, one should be able to identify one of the key properties of quantum phase transitions.
A somewhat related question that I posted several years ago about Quantum Fisher Information
https://physics.stackexchange.com/questions/274891/interpreting-the-quantum-fisher-information
"
"['programming', 'ibm-q-experience', 'simulation', 'qasm']"," Title: Why running time of qasm simulator is significantly smaller in comparison with quantum machines?Body: I ran a 3-qubit measurement circuit on QASM simulator as well as on IBM Q Melbourne, Santiago and Vigo machines. The running time on the simulator is in few milliseconds (400-800) while in the case of all three quantum machines the running time is in seconds (4-13).
Why such a large difference as it does not give a clear picture of simulators' accuracy in comparison to realized of quantum hardware?
"
"['qiskit', 'programming']"," Title: How to get state vector from QasmSimulator in QiskitBody: I'm currently able to get state vector in Qiskit using state_vector backend using something like :
backend = Aer.get_backend('statevector_simulator')
job = execute(qc, backend=backend, shots=1, memory=True)
job_result = job.result()
print(job_result.get_statevector(qc))
But now I would like to get state vector using qasm_backend, I have seen in the Qiskit doc this sample code :
backend = QasmSimulator()
backend_options = {"method": "statevector"}
# Circuit execution
job = execute(qc, backend, backend_options=backend_options)
So I tried this backend implementation then trying to get state vector with :
job_result = job.result()
print(job_result.get_statevector(qc))
But it still gives me an error saying that get_statevector is not available, what is the right way to do that ?
Thank you.
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'unitarity']"," Title: How can I convert the unitary matrix $e^\frac{i\pi}{2}$ into a quantum circuit in Qiskit?Body: How can I put the unitary matrix $$e^\frac{i\pi}{2}I$$ to the quantum circuit?
I don't know if it is belong to $$U3(\theta, \phi, \lambda), U2(\phi, \lambda), U1(\lambda)$$
Thanks a lot.
"
"['error-correction', 'nielsen-and-chuang', 'fault-tolerance']"," Title: Where do errors occur during error syndrome and recovery?Body: I'm studying quantum error correction on Nielsen's Quantum Computation and Quantum Information, but I don't understand how it identifies the number of places where an error may occur.
It uses approximations and does not show how to identify those places.
I'm referencing pages 479 and 480, how does he know the values of the c and c0, c1, etc.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: My IBMQ job hangs forever?Body: I am running a very simple script just to learn how to use IBMQ, but my job will hang indefinitely and I am forced to terminate it.
from qiskit import *
from qiskit.compiler import transpile, assemble
from qiskit import IBMQ
from qiskit import QuantumCircuit, execute, BasicAer
import logging
logging.basicConfig(filename='log',level=logging.DEBUG)
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')
#SELECT A BACKEND
backend = provider.get_backend('ibmq_qasm_simulator')
#ALGO
qr = QuantumRegister(3)
cr = ClassicalRegister(3)
circuit = QuantumCircuit(qr, cr)
circuit.x(qr[0])
circuit.x(qr[1])
circuit.ccx(qr[0], qr[1], qr[2])
circuit.cx(qr[0], qr[1])
circuit.measure(qr, cr)
print('About to run job')
job = execute(circuit, backend)
print('Job Finished')
result = job.result()
counts = result.get_counts(circuit)
print(counts)
In an attempt to debug, I am using "logging.basicConfig" which stops at:
"websocket._connect:DEBUG:2020-09-16 11:26:57,813: Starting new websocket connection: wss://wss.quantum-computing.ibm.com/jobs/5f6258f09234fe0012dbd748/status/v/1"
When I go to my IBMQ home page it says that the job has run successfully. It is only at the line result = job.result() that it fails.
So it seems that the websocket is hanging forever. I'd appreciate any help I can get to fix this issue.
"
"['qiskit', 'programming', 'matrix-representation', 'unitarity', 'hadamard']"," Title: Hadamard gate for three qubits; inconsistency between IBM and MatlabBody: I am trying to build a large and quite complex three qubit quantum circuit on IBMs quantum computer. I have a specific unitary which I am trying to implement and I am building a circuit following the paper 'Realisation of a general three qubit quantum unitary'. I am checking the unitary at each stage of the circuit on Matlab, just to make sure I fully understand it, but I have come across something which I cannot explain. I have split the circuit into two unitaries, $U_a$ and $U_b$ and for each unitary separately my IBM unitary agrees with my Matlab unitary,however when I combine the two circuits in IBM and multiply the two unitaries in Matlab I get different results. The problem boils down to an issue I am having with the Hadamard gate. Consider the following two IBM circuits
#both independently correct
circuit2 = QuantumCircuit(3);
circuit2.u3(1,1,1,2);
job = execute(circuit2, backend)
job.result().get_unitary(circuit2, decimals=6)
i.e. a three qubit circuit where a unitary acts on the final qubit (IBM's final qubit is the first qubit in more widely used bra-ket notation), and the second circuit is:
#both independently correct
circuit2 = QuantumCircuit(3);
circuit2.h(2)
job = execute(circuit2, backend)
job.result().get_unitary(circuit2, decimals=6)
i.e. a three qubit circuit with a Hadamard gate on the final qubit. These produce the following two unitaries
0.8776 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.2590 - 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.8776 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.2590 - 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.8776 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.2590 - 0.4034i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.8776 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.2590 - 0.4034i
0.2590 + 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3652 + 0.7980i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.2590 + 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3652 + 0.7980i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.2590 + 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3652 + 0.7980i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.2590 + 0.4034i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3652 + 0.7980i
0.7071 0 0 0 0.7071 0 0 0
0 0.7071 0 0 0 0.7071 0 0
0 0 0.7071 0 0 0 0.7071 0
0 0 0 0.7071 0 0 0 0.7071
0.7071 0 0 0 -0.7071 0 0 0
0 0.7071 0 0 0 -0.7071 0 0
0 0 0.7071 0 0 0 -0.7071 0
0 0 0 0.7071 0 0 0 -0.7071
I have taken these unitaries from my Matlab code, not the IBM output but they are the same in both softwares. Now the bizarre part is when I multiply these unitaries in Matlab using the following code
function test=utottest(x)
x1=[1,1,1];
Hadamard=1/sqrt(2)*[1 1;1 -1];
R1=kron(U1IBM(x1),eye(4));
R12=kron(Hadamard,eye(4));
test=R12*R1;
function U1=U1IBM(x)
% single qubit unitary
th=x(1);
phi=x(2);
lam=x(3);
U1=[cos(th/2) -exp(i*lam)*sin(th/2); exp(i*phi)*sin(th/2) exp(i*lam+i*phi)*cos(th/2)];
end
end
the unitary produced is different to that produced by the following IBM circuit
circuit2 = QuantumCircuit(3);
circuit2.u3(1,1,1,2);
circuit2.h(2)
job = execute(circuit2, backend)
job.result().get_unitary(circuit2, decimals=6)
I do not understand what is happening here. Can anyone explain/reconcile this difference?
"
"['quantum-gate', 'programming', 'circuit-construction', 'cirq']"," Title: Implementing Cirq Coding GatesBody: Can someone please help me making these gates on CIRQ programming:
- Decrement Gate (-1)
- Splitter Gate (If possible)
I was having trouble implementing these and was not sure if it's possible either.
Thanks in advance.
"
"['programming', 'decoherence', 'partial-trace']"," Title: Implementing Partial Trace in IBMs quantum computerBody: I am trying to implement the partial trace operation on IBMs quantum computer. I am simulating the depolarising channel with the following code
#aim here is to build the decoherence channel
p=0.1;
z=0.5+0.5*math.sqrt(1-p);
desiredvec=[
math.sqrt(1-z),
math.sqrt(z)]
circuit2 = QuantumCircuit(4,3);
circuit2.initialize(desiredvec,0)
circuit2.initialize(desiredvec,1)
circuit2.initialize(desiredvec,2)
circuit2.cx(0,3)
circuit2.h(3)
circuit2.s(3)
circuit2.cx(1,3)
circuit2.h(3)
circuit2.s(3)
circuit2.cx(2,3)
circuit2.h(3)
circuit2.s(3)
circuit2.draw()
I would now like to trace out all but qubit 3 as it is the only qubit I am interested in. I can get around this by just ignoring the other qubits but I would rather not do this. Is there any easy way to trace out unwanted qubits?
Or equivalently is there a way to initalise the qubit in a mixed state so that the extra ancillary qubits aren't needed in the first place?
"
"['quantum-gate', 'gate-synthesis', 'pauli-gates']"," Title: CNOT expressed with CZ and H gates by taking into account HZH =XBody: From this link:
Where equation 1 is:
I can probably brute-force this by explicitly calculating this quantum circuit's effective 4x4 matrix and seeing that its equivalent to this teleportation operation - but what does this have to do with X=HZH? Where is x used here? Is X somehow equivalent to a cNOTgate? X, Z and H are all one-qubit gates...so I don't understand what they mean.
"
"['circuit-construction', 'gate-synthesis']"," Title: Reducing the depth of quantum circuits with ancilla qubitsBody: This question is two-fold and considers general $n$-qubit operations on a quantum computer.
First, can a general $n$-qubit operation be implemented on a quantum computer without the use of ancilla qubits?
Second, can ancilla qubits help in reducing the depth of such general $n$-qubit operations and if yes, what is the relation between the two?
"
"['qiskit', 'programming', 'ibm-q-experience', 'optimization']"," Title: Quadratic optimization in Qiskit: Error when QuadraticProgram with quadratic constraint converted to QUBOBody: I prepared a quadratic optimization task with binary and integer variables and linear and quadratic constraints. I fed it into QuadraticProgram in Qiskit. After that, I tried to convert the program to binary optimization task with constraints in form of equality only. I used InequalityToEquality and IntegerToBinary converters to do this. However, an error was returned. After some trial and error, I realized that the problem is caused by the quadratic constraint, so I removed it and everything is fine.
My questions are:
- Is the problem really in the quadratic constraint? Or in other words, are such constraints forbidden when I want to use converters?
- If so, is there any other way how to convert
QuadraticProgram to QUBO in Qiskit?
(note that QuadraticProgramToQubo also does not work since IntegerToBinary is part of it)
Here is my code:
%matplotlib inline
from qiskit.optimization import QuadraticProgram
from qiskit.optimization.converters import InequalityToEquality, IntegerToBinary, QuadraticProgramToQubo
#create empty optimization task (model)
mod = QuadraticProgram('Quadratic optimization problem') #string in brackets - user defined name of the task
#adding variables
mod.binary_var(name = 'x') #bin
mod.integer_var(name = 'y', lowerbound = 0, upperbound = 5)
mod.integer_var(name = 'z', lowerbound = 0, upperbound = 5)
#setting objective function
mod.minimize(constant = 3, linear = [1,0,1], quadratic = [[1, 0, 2],[0,1,0],[2,0,1]])
#adding constraints
mod.linear_constraint(linear = {'x': 1, 'y': 1, 'z':1}, sense = '==', rhs = 1, name = 'L1')
mod.linear_constraint(linear = {'x': -1, 'y': -1, 'z':2}, sense = '>=', rhs = 0, name = 'L2')
mod.linear_constraint(linear = {'x': 10, 'y': 20, 'z':30}, sense = '<=', rhs = 100, name = 'L3')
#PROBLEMATIC QUADRATIC CONSTAINT
mod.quadratic_constraint(linear = {'x':1, 'y':1}, quadratic = {('x','y'):1, ('x','z'):-1}, sense = '<=', rhs = 2, name = 'Q1')
modConverted = InequalityToEquality().convert(mod)
modConverted = IntegerToBinary().convert(modConverted)
print(modConverted.export_as_lp_string())
And here is the returned error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-13-f345029f5fa8> in <module>
20
21 modConverted = InequalityToEquality().convert(mod)
---> 22 modConverted = IntegerToBinary().convert(modConverted)
23 print(modConverted.export_as_lp_string())
/opt/conda/lib/python3.7/site-packages/qiskit/optimization/converters/integer_to_binary.py in convert(self, problem)
96 )
97
---> 98 self._substitute_int_var()
99
100 else:
/opt/conda/lib/python3.7/site-packages/qiskit/optimization/converters/integer_to_binary.py in _substitute_int_var(self)
199 )
200 quadratic, q_linear, q_constant = self._convert_quadratic_coefficients_dict(
--> 201 constraint.quadratic.to_dict()
202 )
203
/opt/conda/lib/python3.7/site-packages/qiskit/optimization/converters/integer_to_binary.py in _convert_quadratic_coefficients_dict(self, coefficients)
137 quadratic = {}
138 for (name_i, name_j), v in coefficients.items():
--> 139 x = self._src.get_variable(name_i)
140 y = self._src.get_variable(name_j)
141
/opt/conda/lib/python3.7/site-packages/qiskit/optimization/problems/quadratic_program.py in get_variable(self, i)
243 return self.variables[i]
244 else:
--> 245 return self.variables[self._variables_index[i]]
246
247 def get_num_vars(self, vartype: Optional[VarType] = None) -> int:
KeyError: 0
```
"
"['quantum-gate', 'textbook-and-exercises', 'hadamard']"," Title: What is the matrix representation of the Hadamard gate in the computational basis?Body: I read about Hadamard gate H and found it's matrix representation as follows:
$$H_1=\frac{1}{\sqrt 2}\begin{pmatrix}1 & 1 \\1 & -1\end{pmatrix}$$
I wanted to know what will be the matrix representation of H in computational basis.
"
"['quantum-gate', 'quantum-state', 'tensor-product', 'bell-basis']"," Title: Bell state preparationBody: I was watching some lectures on qubits. They were talking about how to generate a Bell state. They described it as follows:
- Prepare state 00:
$$\left |0 \right> \otimes \left |0 \right>$$
- Apply the Hadamard:
$$ (H \otimes I)(\left |0 \right> \otimes \left |0 \right> ) = \left |+0 \right> = \frac{\left|00 \right> + \left |10 \right>}{\sqrt{2}}$$
- Apply CNOT to go from state 00 + 10 to state 00 + 11,
$$ CNOT = \left |0 \right> \left <0 \right| \otimes I + \left |1 \right> \left<1 \right| \otimes X $$
such that:
$$CNOT\times\frac{\left|00 \right> + \left |10 \right>}{\sqrt{2}}=\frac{\left |0 \right> \left <0|0 \right> \otimes I \left |0 \right> + \left |0 \right> \left <0|1 \right> \otimes I\left |1 \right> + \left |1 \right> \left <1|0 \right> \otimes X \left |0 \right> + \left |1 \right> \left <1|1 \right> \otimes X \left |0 \right> }{\sqrt{2}} = \left | \Omega \right >$$
I am not sure I can follow how the product of the CNOT and the state $\left|00 \right> + \left |10 \right>$ can be expanded out as written above. Hope you guys can help me out.
"
"['qiskit', 'ibm-q-experience', 'hhl-algorithm', 'quantum-volume']"," Title: How can I use the quantum volume to design the scale of my experiment?Body: I am designing an experiment which involves solving a linear system of equations of the form $Ax=b$. To do this, I am using the HHL algorithm on the IBMQ system. My experiment is scalable such that the size of matrix $A$ can be as large or small as I choose it to be. I would like to tailor the size of my matrix $A$ to be as large as possible but still within the computation limit of the quantum computer that I use. My suspicion is that to determine this I need to account for the quantum volume of the IBMQ machine that I use, but I do not understand exactly how.
Here is a little more information that may be useful. My experiment is adapted from the code in this HHL tutorial describing the general method to run the algorithm (section 4A). This means that I have not optimized the algorithm in any way. That being said, an example of the resource requirements for a modestly sized matrix $A$ for my experiment are as follows:
circuit_width: 11
circuit_depth: 101
CNOT gates: 54
My question is, how can I use these numbers to determine the quantum volume required to run my experiment?
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Custom Gate/Instruction with classical bits in QiskitBody: In Qiskit, I need to define a custom gate or instruction that, once decomposed, turns into a series of basis gates, including measurements and classically controlled gates (this is the part that I can't get around).
I already tried using QuantumCircuit.to_gate(), but it does not work, maybe there is a way to it with the Instruction class?
Edit 1
I tried to do something like this:
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
def mygate():
qr = QuantumRegister(4)
cr1 = ClassicalRegister(1)
cr2 = ClassicalRegister(1)
qc = QuantumCircuit(qr, cr1, cr2, name='mygate')
qc.measure(qr[0], cr1[0])
qc.measure(qr[1], cr2[0])
qc.x(qr[-2]).c_if(cr1, 1)
qc.x(qr[-1]).c_if(cr2, 1)
return qc.to_instruction()
big = QuantumCircuit(5, 4)
big.append(mygate(), range(4), range(2))
But it does not work.
qiskit.exceptions.QiskitError: 'Cannot convert condition in circuit with multiple classical registers to instruction'
"
"['programming', 'ibm-q-experience', 'classical-computing']"," Title: What is the best way to use loop statements on a quantum computer?Body: I am interested in solving a time dependent linear partial differential equation of the form $Ax=b$ which, in classical computing, would amount to looping over solutions of $Ax=b$ where $b$ is updated each step.
My question is, is there a quantum analog to the looping procedure that I have described? If not, does that imply that to solve this one would need to write a loop on the classical system which calls the quantum solver each step? In case it is relevant, I am using the IBMQ system.
This question is related to this post.
"
"['qiskit', 'programming', 'chemistry']"," Title: What is the convention of indices for the one and two-body integrals in qiskitBody: I was able to calculate the one and two-body integrals for the H2 with the following code
from qiskit.chemistry.drivers import PySCFDriver, UnitsType
atom = 'H .0 .0 .0; H .0 .0 0.74'
distance_unit = UnitsType.ANGSTROM
basis = 'sto3g'
driver = PySCFDriver(atom, unit=distance_unit, basis=basis)
molecule = driver.run()
h1 = molecule.one_body_integrals
h2 = molecule.two_body_integrals
print( h1 )
print( h2 )
and the results is
[[-1.25330979 0. 0. 0. ]
[ 0. -0.47506885 0. 0. ]
[ 0. 0. -1.25330979 0. ]
[ 0. 0. 0. -0.47506885]]
[[[[-0.33737796 0. 0. 0. ]
[ 0. -0.09060523 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. -0.09060523 0. 0. ]
[-0.3318557 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[-0.33737796 0. 0. 0. ]
[ 0. -0.09060523 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. -0.09060523 0. 0. ]
[-0.3318557 0. 0. 0. ]]]
[[[ 0. -0.3318557 0. 0. ]
[-0.09060523 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[-0.09060523 0. 0. 0. ]
[ 0. -0.34882575 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. -0.3318557 0. 0. ]
[-0.09060523 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[-0.09060523 0. 0. 0. ]
[ 0. -0.34882575 0. 0. ]]]
[[[ 0. 0. -0.33737796 0. ]
[ 0. 0. 0. -0.09060523]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. -0.09060523]
[ 0. 0. -0.3318557 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. -0.33737796 0. ]
[ 0. 0. 0. -0.09060523]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. -0.09060523]
[ 0. 0. -0.3318557 0. ]]]
[[[ 0. 0. 0. -0.3318557 ]
[ 0. 0. -0.09060523 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. -0.09060523 0. ]
[ 0. 0. 0. -0.34882575]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. 0. -0.3318557 ]
[ 0. 0. -0.09060523 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]
[ 0. 0. -0.09060523 0. ]
[ 0. 0. 0. -0.34882575]]]]
This immediately raises the question of how qiskit labels the two-body integrals. If we look at the definition of second quantized Hamiltonian
$
H = \sum_{i,j}h_{ij}a^\dagger_i a_j + \frac{1}{2}\sum_{i,j,k,l}h_{ijkl}a^\dagger_ia^\dagger_ja_ka_l
$
then we realize that $h_{0000}=0$, whereas qiskit gives -0.33737796. The answer for the integrals is given in the following table. Any helps are really appreciated.
"
['error-correction']," Title: How to correct a phase error of the form $e^{ix}$Body: Is there a method to correct an error of the form of $e^{ix}$, acted on a two-qubit state without knowing the nature (the value of x) of the error?
For example,
$$\alpha|00\rangle +\beta|01\rangle+\gamma|10\rangle+e^{ix}\delta|11\rangle.$$
Also, can I rephrase the above question to:
Is there a method to correct an error that results an orthogonal state to deform into a non-orthogonal state?
"
"['vqe', 'qaoa', 'quantum-computing-for-finance']"," Title: How to construct Hamiltonian for combinatorial optimization problems and then convert into Pauli basis?Body: Suppose I have a portfolio optimization problem where I have to minimize,
$$qx^T\sum x - \mu^Tx$$
where q is the maximum risk and x is {0,1}^n and $\mu$ are the expected returns.
Now I have to convert this problem into Hamiltonian and subsequently find the Pauli Basis for it. How can I do so?
"
"['algorithm', 'amplitude-amplification']"," Title: Amplitude estimation over subspace of problemBody: I've been searching about quantum amplitude estimation techniques and read that it is customary to use an extra qubit to separate good and bad states using algorithm $A$ as
$$ A|{0} \rangle^{\otimes^{n+1}} = |0\rangle |\psi_0\rangle + |1\rangle |\psi_1\rangle $$
I was wondering the following:
a) If we don't have a guarantee that a solution $|\psi_1\rangle$ exists, what happens if we perform amplitude estimation/amplification?.
b) Is quantum amplitude estimation bounded by the initial probability of $|{\psi_1}\rangle$ or is it bounded with the size of the hillbert space? With the assumption that all $2^n$ possible states are initialized with the same amplitude, we would need $\sqrt{2^n}$ steps to boost the amplitude of $|{\psi_1}\rangle$, but wouldnt it be possible to perform quantum amplitude amplification if the inversion about the mean would be performed directly on the additional qubit? I was wondering this because if we look at the n qubits from our problem, initially, we would see the same amplitude for every state, but if we only focused on the additional qubit we only have two states and the inversion about the mean would be around $\sqrt{\frac{1}{2}}$ rather than $\sqrt{\frac{1}{2^n}}$ (using $\mathbf{Q} = -AS_oA^{-1}S_x$ but $S_o$ and $S_1$ only in the additional qubit). If this is not possible, could you give me some insight as to why it cant be done? I would really appreciate it.
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: Keeping data around in an entangled state: use casesBody: I'm following the IBM Quantum roadmap and really excited to see what the next 3 years bring. As part of the unveiling, they mentioned that the 1000 Qubit machine goal will really stabilize things with error correction and general stability in place. The advances from that point onwards switches to a software problem rather than a hardware one (notwithstanding lots of work will continue!).
I'm playing around with Qiskit and my limited understanding. In entanglement, due to the current fragility we don't want to hold that data any longer than is necessary for fear of losing it. In Classical we like to hold onto data in memory until we need it. Assuming the hardware gives us the stability to maintain a longer lived Quantum state, what benefits or scenarios could that unlock? I'm trying to think of use cases to explore in Qiskit and simulate a long lived state but my fundamental lack of knowledge here is holding me back. I'd love an insight into what you folks think we could do if we had that stability.
"
"['programming', 'ibm-q-experience', 'hhl-algorithm']"," Title: How to optimize my HHL algorithm on qiskit?Body: I am following this HHL tutorial to solve the $Ax=b$ problem and have been using the general (inefficient) approach with the BasicAer simulator that they describe in section 4a. I would now like to run on the actual IBMQ machines but I am finding that my circuit depth and CNOT counts are quite high. To solve this issue, I would like to optimize my circuit. In section 4b of the tutorial they outline a method of optimizing their specific problem which substantially reduces the qubit count, circuit depth, and CNOT count. The problem I am having is figuring out how to extend this to larger matrices $A$ than the $2$x$2$ that they use. Is there a general approach to optimizing an HHL circuit?
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: Generate a 3-qubit SWAP unitary in terms of elementary gatesBody: I wish to generate the following unitary
[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,0,0;
0,0,0,0,0,0,1,0;
0,0,0,0,0,0,0,1;]
However the three qubit Toffoli and Fredkin gates do not appear to generate this. Does anyone know a simple way to generate this unitary? It seems to me that it should not be hard to produce as it is so close to the identity.
"
"['programming', 'grovers-algorithm', 'q#']"," Title: Grover algorithm in Q#Body: I have this program derived from Microsoft Quantum Kata for quantum search (Grover algorithm) (see here)
namespace Quantum.Search {
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Convert;
open Microsoft.Quantum.Math;
open Microsoft.Quantum.Oracles;
open Microsoft.Quantum.Arithmetic;
open Microsoft.Quantum.Characterization;
open Microsoft.Quantum.Arrays;
open Microsoft.Quantum.Measurement;
operation SprinklerAnc (queryRegister: Qubit[], target : Qubit) : Unit is Adj+Ctl
{
using (ancilla=Qubit[3 ])
{
X(queryRegister[2]);
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]],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]);
}
}
operation ApplyMarkingOracleAsPhaseOracle (markingOracle : ((Qubit[], Qubit) => Unit is Adj+Ctl), register : Qubit[] ) : Unit is Adj+Ctl
{
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);
}
}
// The Grover iteration
operation GroverIteration (register : Qubit[], oracle : ((Qubit[],Qubit) => Unit is Adj+Ctl)) : Unit is Ctl+Adj
{
ApplyMarkingOracleAsPhaseOracle(oracle,register);
ApplyToEachCA(H, register);
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⟩
}
Ry(2.0 * PI(), register[0]);
ApplyToEachCA(H, register);
}
operation Search() : Result[]
{
using (reg=Qubit[4 ])
{
H(reg[0]);
H(reg[1]);
H(reg[2]);
H(reg[3]);
for (i in 1 ..2) {
GroverIteration(reg, SprinklerAnc);
}
let state = MultiM(reg);
ResetAll(reg);
return state;
}
}
}
with driver
using System;
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
using System.Collections.Generic;
namespace Quantum.Search
{
class Driver
{
static void Main(string[] args)
{
using (var qsim = new QuantumSimulator())
{
IDictionary<string, int> dict = new Dictionary<string, int>();
for (int i = 0; i < 1000; i++)
{
IQArray<Result> res = QMPE.Run(qsim).Result;
string s = Convert.ToString(res);
int result;
if (dict.TryGetValue(s, out result))
{
dict.Remove(s);
dict.Add(s, result + 1);
}
else
{
dict.Add(s, 1);
}
System.Console.WriteLine($"Res:{s}");
}
foreach (KeyValuePair<string, int> item in dict)
{
Console.WriteLine("Key: {0}, Value: {1}", item.Key, item.Value);
}
}
}
}
}
It should search for the solutions of the 3 bits formula (not reg[0] or reg[2]) and (not reg1 or reg[2]) and (not reg[0] or not reg1) and reg[3]. This formula has 4 solutions: 0001, 0011, 0111 and 1011. However, the distribution over the solutions that I get in 1000 execution is
Key: [One,One,One,Zero], Value: 57
Key: [One,One,Zero,Zero], Value: 63
Key: [Zero,One,One,One], Value: 58
Key: [Zero,One,One,Zero], Value: 74
Key: [One,Zero,One,One], Value: 70
Key: [One,Zero,One,Zero], Value: 70
Key: [Zero,Zero,One,Zero], Value: 76
Key: [One,Zero,Zero,One], Value: 47
Key: [Zero,Zero,Zero,Zero], Value: 79
Key: [Zero,One,Zero,Zero], Value: 66
Key: [One,One,One,One], Value: 52
Key: [Zero,Zero,Zero,One], Value: 55
Key: [One,Zero,Zero,Zero], Value: 58
Key: [Zero,One,Zero,One], Value: 58
Key: [Zero,Zero,One,One], Value: 63
Key: [One,One,Zero,One], Value: 54
so basically a uniform distribution over the whole set of 16 configurations. I don't understand why the solution of the equations are not getting higher frequencies.
"
['grovers-algorithm']," Title: Why does Grover's Diffusion Operator have the word ""diffusion"" in its name?Body: Where do I see the diffusion in the Grovers operator?
I would think there should be an analogy to classical diffusion but I am not able to see the correspondence.
"
"['algorithm', 'quantum-state', 'deutsch-jozsa-algorithm']"," Title: If I use probabilistic algorithm on a normal computer, can't I just input once a single $0$ in the oracle, then input once a single $1$?Body: I fail to understand Deutsch-Jozsa algorithm.
As wikipedia suggests: ${\displaystyle f\colon \{0,1\}^{n}\rightarrow \{0,1\}}$. The function takes n-digit binary values as input and produces either a 0 or a 1 as output for each such value. We are promised that the function is either constant (0 on all outputs or 1 on all outputs) or balanced (returns 1 for half of the input domain and 0 for the other half). The task then is to determine if {\displaystyle f}f is constant or balanced by using the oracle.
Question 1: If I use probabilistic algorithm on a normal computer, can't I just input once a single 0 in the oracle, then input once a single 1. And I am done.
I also read here: http://www.diva-portal.org/smash/get/diva2:840938/FULLTEXT01.pdf:
Consider that Bob generates a list of arbitrary length from a balanced function. Then the list will contain equally many zeros and
ones, thus if Alice draws a random element in the list it will be a
zero or one with a probability of 1/2. If she draws two elements. then she can obtain the outcomes ”00”, ”01”, ”10” and ”11”, each with
an equal probability of 1/4. If Alice now has to guess whether the
function was constant or balanced, she will guess correctly half of
the times. If she instead draws a third element the outcome will
be a uniform probability distribution over the following possible outcomes ”000”, ”001”, ”010”, ”011”, ”100”, ”101”, ”110” and ”111”. Alice
will now guess correctly six out of eight times.
Qurstion 2: So if she has ”001” (or eve "01"/"10") isn't that already a balanced function?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: Why does job execution time vary significantly across different IBMQ Backends?Body: I have run a batch of a few thousand random 2-qubit QuantumCircuits on multiple different IBMQ Backends, and the execution times seem to significantly vary across the backends (obviously excluding time in queue). The general trend seems to be that increased:
- Qubits or
- Quantum Volume(QV)
results in faster execution. As per my knowledge, this could be explained either by
- increased parallel execution of the batch with more qubits or
- systems with higher QV operate at proportionately higher clock speeds (I am more inclined to this explanation as the fastest job executed on
ibmq_montreal despite having fewer qubits than ibmq_rochester)
Are any of these explanations correct or is there an entirely different explanation for this observation?
I have used the following backends:
ibmq_montreal - 27 qubits with QV 32
ibmq_vigo - 5 qubits with QV 16
ibmq_rochester - 53 qubits QV 8
"
['research']," Title: Why is there so much hope around quantum computers?Body: The road towards quantum computers have so many obstacles, which are deeply different and more challenging than the problems that we had with the development of classical computers. There are reasons to believe that quantum computers with a "large enough" number of qubits and low decoherence to be actually useful.
Yet, there are so many investments and there's so much research around that to suggest that the whole community believes that it's certain that we will have quantum computers sooner or later.
Where does this belief come from? Are there factual, scientific arguments to support that?
"
"['qiskit', 'ibm-q-experience', 'measurement', 'hadamard']"," Title: Generate a random bit sequence of 512 bitsBody: How can I generate a random bit sequence of 512 bits on IBM Q experience using 3 or 5 qubits? Putting a hadammard gate and measuring would only give me smaller bit sequence due to limitation in number of qubits.
How to solve this problem?
"
"['qiskit', 'programming', 'qasm']"," Title: Qiskit implementation for MPSBody: Now, I'm implementing Matrix product state method with QasmSimulation in Qiskit.
following code
The problem arise when I set number of qubits. When running it with 27qubits is very fast
but, for 24, 25, 26qubits it take too much time. Why it happens?
"
"['qiskit', 'programming', 'grovers-algorithm', 'q#']"," Title: Different result between Q# and QiskitBody: I'm running a search program with custom initial state. I wrote a program in Q# and one in Qiskit but I get different results even if the code seems to be peforming the same operations. The Q# result is correct according to my calculations while the Qiskit one is not. Can you tell what I'm doing wrong in Qiskit?
The Boolean function is (not reg[0] or reg[2]) and (not reg[1] or reg[2]) and (not reg[0] or not reg[1]) and reg[3] and I'm measuring only the first 3 bits (reg[0] to reg[2]).
Here is the Q# code https://gist.github.com/friguzzi/833ded93a640ed97a3b281c5542e90ea
and Qiskit python notebook https://gist.github.com/friguzzi/6293793de3d53914dac9e1cb768f9817
The correct result should be 101 but the output of Qiskit over 1000 runs is
{'000': 179,
'001': 135,
'010': 36,
'011': 41,
'100': 152,
'101': 167,
'110': 165,
'111': 125}
"
"['quantum-state', 'simulation', 'vqe']"," Title: Why is the lowest energy important to simulate a quantum system?Body: Quantum computers promise that they will simulate complex quantum systems, and I keep hearing that finding the ground state of that system (using for example Variational quantum eigensolver) is important to simulate it.
I don't know why is this true, could you please explain that, and perhaps give some examples?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to re-execute failed jobs in qiskit?Body: When executing a batch of circuits using the IBMQJobManager and attempting to combine all the results of all jobs with combine_results I get the IBMQManagedResultDataNotAvailable exception as some of the jobs in the set have failed. Is it possible to re-execute only the failed jobs and then combine all the results?
job_set = IBMQJobManager().run(batch_of_circuits, backend=ibmq_foo)
job_set_results = job_set.results()
job_set_counts = job_set_results.combine_results() # exception thrown on this line
"
"['quantum-state', 'entanglement', 'quantum-operation']"," Title: Can local projections increase entanglement?Body: Consider a generic bipartite pure state $\newcommand{\ket}[1]{\lvert #1\rangle}\ket\Psi\equiv \sum_k \sqrt{p_k}\ket{u_k}\otimes\ket{v_k}\in\mathcal X\otimes\mathcal Y$,
where $p_k\ge0$ are the Schmidt coefficients, and $\{\ket{u_k}\}_k\subset\mathcal X,\{\ket{v_k}\}_k\subset\mathcal Y$ are orthonormal sets of states.
We known that, for any pair of unitary operations $U,V$, the state $(U\otimes V)\ket{\Psi}$ has the same amount of entanglement as $\ket\Psi$, as reflected by the invariance of the Schmidt coefficients under such operation.
Consider now a local projection operation. More precisely, suppose $\mathcal X$ also has a bipartite structure, $\mathcal X=\mathcal X_1\otimes\mathcal X_2$, take some state $\ket\gamma\in\mathcal X_1$, and consider the postselected state $\ket{\Psi'}\equiv \langle \gamma\rvert\Psi\rangle/\|\langle \gamma\rvert\Psi\rangle\|\in\mathcal X_2\otimes\mathcal Y$.
If I were to describe this as an operation, I guess this would amount to applying some non-unitary linear operator $A$ to $\ket\Psi$.
Can the amount of entanglement of $\ket{\Psi'}$ in the "residual bipartition" $\mathcal X_1\otimes\mathcal Y$ be larger than the initial entanglement in $\ket\Psi$?
If so, is there some kind of known characterisation of when this is possible?
Intuitively, this would mean that an initially low amount of entanglement can be "enhanced", or somehow "activated", conditionally to some observation (i.e. finding $\ket\gamma$) of one party. Such a situation seems strange to me but I'm not sure how to rule out the possibility.
"
"['qiskit', 'programming', 'circuit-construction']"," Title: Converting 'string' to a function/gate in QisKitBody: I want to give a list of Quantum gates in a .txt file from user an apply them to a Quantum circuit but the gates in notepad .txt file have 'string' type while in Qiskit I need functions/methods. For example:
In .txt file:
'h(0)'
In Qiskit:
qc=QuantumCircuit(2)
qc.h(0)
Which is a method.
What can I do?
"
"['density-matrix', 'entropy', 'semidefinite-programming', 'max-entropy']"," Title: Semi-definite program for conditional smooth max-entropyBody: I am aware of a SDP formulation for smooth min-entropy: question link. That program for smooth min-entropy was found in this book by Tomachiel: page 91. However, I am yet to come across a semi-definite formulation for smooth max-entropy. There is however, a formulation for the non-smoothed version of max-entropy, found in this link: page 4, lemma 8. Here is the detailed program for a bipartite density operator $\rho_{AB}$, $2^{H_{\text{max}}(A|B)_\rho}$ =
$$
\text{minimize }\lambda \\
\text{subject to} \\
Z_{AB} \otimes \mathbb{I} \ge \rho_{ABC} \\
\lambda \mathbb{I}_B \ge \text{tr}_A [Z_{AB}] \\
Z_{AB} \ge 0 \\
\lambda \ge 0
$$
Where $Z_{AB}$ runs over all positive semi-definite operators in $\mathcal{H}_{AB}$, $\lambda$ is a real number. The smooth max-entropy is then:
$$
H^{\epsilon}_{\text{max}}(A|B)ρ := \underset{\rho'_{AB} \in \mathcal{B}^\epsilon (\rho_{AB})}{\min}H_{\text{max}}(A|B)_{\rho'}
$$
i.e., just the minimum over all bipartite operators which are at most $\epsilon$ distance away from $\rho_{AB}$. But the primal or dual SDP formulation for the smooth version of max-entropy was not found anywhere. Is there one? How could I transform it into a smooth version? TIA.
"
"['quantum-state', 'circuit-construction', 'tomography']"," Title: Is there a circuit to compare two quantum states?Body: Lets have two quantum states (single qubits ones for simplicity) $|\psi\rangle$ and $|\phi\rangle$:
$$
|\psi\rangle = \alpha_\psi|0\rangle+\mathrm{e^{i\varphi_\psi}}\beta_\psi|1\rangle
$$
$$
|\phi\rangle = \alpha_\phi|0\rangle+\mathrm{e^{i\varphi_\phi}}\beta_\phi|1\rangle
$$
These states are equal in case
$$
\alpha_\psi = \alpha_\phi
$$
$$
\beta_\psi = \beta_\phi
$$
$$
\varphi_\psi = \varphi_\phi,
$$
i.e. they have same complex amplitudes or same amplitudes expressed by real parameters $\alpha$ and $\beta$ and same phase $\varphi$.
One way how to compare two state is to do a quantum tomography, however, to do so we would need many copies of the states and moreover, the quantum tomography complexity is exponential in number of qubits in case of multiqubit states.
So my question: Is there a circuit allowing to compare two quantum states? A result should be some ancilla qubit in state $|0\rangle$ if states are different and $|1\rangle$ if states are the same (in sense described above).
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Unable to instantiate provider for research account locallyBody: When I run IBMQ.load_account(). I have the error information:
C:\application\python\anaconda\lib\site-packages\qiskit\providers\ibmq\ibmqfactory.py:192: UserWarning: Timestamps in IBMQ backend properties, jobs, and job results are all now in local time instead of UTC.
warnings.warn('Timestamps in IBMQ backend properties, jobs, and job results '
ibmqfactory._initialize_providers:WARNING:2020-09-21 15:33:39,682: Unable to instantiate provider for {'hub': 'ibm-q-research', 'group': 'Cheng-Guo', 'project': 'main'}: string indices must be integers.
I want to ask about the second warning: Unable to instantiate provider for {'hub': 'ibm-q-research', 'group': 'Cheng-Guo', 'project': 'main'}: string indices must be integers.
My account have two provider:
(hub='ibm-q', group='open', project='main')
{hub: 'ibm-q-research', group: 'Cheng-Guo', project: 'main'}
I can only use the first provider locally. Because of these two questions: "https://quantumcomputing.stackexchange.com/questions/12183/ibmqfactory-initialize-providers-error" and "https://quantumcomputing.stackexchange.com/questions/13350/qiskit-ibmq-load-account-fails-on-version-0-20-0".
I have tried to delete my account then save it. But it didn't work.
I have tried to use qiskit 0.21.0, the newest version in Github. But it didn't work.
I have tried to use qiskit 0.20.1, the version in Quantum Lab(https://quantum-computing.ibm.com/jupyter). But it didn't work.
The same version of qiskit (0.20.1) cannot be used locally but can be used in the quantum lab, so I can only use the quantum lab to program now. But quantum lab requires a network connection, which is not very convenient.
I have tried to change a PC and install qiskit(version 0.21.0 in default), it didn't work.
I have read the source code and I still can't understand why only the research provider doesn't work, and only don't work locally.
Thank you very much if you can help me.
"
"['bell-experiment', 'non-locality']"," Title: Where does $xy = a + b \pmod 2$ come from in the context of CHSH inequalities?Body: I have been looking into the great! video lecture of "CSHS Inequality" by Prof. Umesh V. Vazirani.
There are a few things I have to clarify, hope someone will answer me.
Suppose Alice and Bob have measured some outcomes in their bases. I am not quite clear how this is linked to the statement $xy = a + b \pmod 2$. How are the outputs $a$ and $b$ of Alice and Bobs related to the basis of measurement output?
"
['phase-kickback']," Title: Phase Kickback and Controlled Rotation - Problem in proving symmetryBody: I am reading through the Phase Kickback chapter of the IBM online textbook about quantum computation. It is stated that, when applying any controlled Z-rotation, the concept of test and control qubit is lost. To show this phenomenon, the effect of a Controlled-T gate (Z-rotation of $\pi/4$) on the state $|1+ \rangle$ is demonstrated mathematically. The formal control qubit would be $|+\rangle$ while the target qubit would be $|1\rangle$. As I show in the image, the "target" qubit stays unchanged, while the "control" qubit has got rotated (it has now a relative phase).
I then wanted to prove myself that the same result would be delivered when applying the Controlled-T gate on the state $|+1 \rangle$, which physically would mean to swap the two qubits with respect to the former situation. I would then expect the same result as above, but with the two qubits "flipped" on opposite sides of the tensor product. In this case, however, I get a different result (a global phase). I think that I cannot commutate the tensor product, because this would mean physically swapping the two qubits, right? Can somebody explain to me the conceptual mistake that I am doing?
"
"['error-correction', 'stabilizer-code', 'fault-tolerance']"," Title: (Why) does every CSS code allow for transversal measurement?Body: I recently encountered the statement that
any CSS code [that encodes single-qubit logical states] has a property that measurements can be performed qubit-wise, but the measurement outcome of every qubit must be communicated classically to obtain the result of the logical measurement.
Can someone point me to some references about why that is and what kind of classical communication is used?
"
"['quantum-state', 'measurement', 'hamiltonian-simulation', 'cirq', 'vqe']"," Title: XX and YY and ZZ Hamiltonians in vqeBody: I'm trying to implement a vqe in cirq and I have sort of a brain knot.
I have a 4 qubit chain with periodic boundary condition.
So in fact a 2x2 qubit grid.
Now 2 of them each are coupled.
How do I get the correct measurements for the expectation value?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to get the CNOT error rate between 2 qubits on a given IBMQ Backend?Body: How can the CNOT gate error between 2 qubits as shown on visual qubit coupling map on the IBMQ Dashboard be retrieved in Qiskit using the BackendProperties.gate_error method ?
I have been able to retrieve the U2 error rates as follows:
properties = backend.properties()
properties.gate_error('u2', 0) # u2 error rate for qubit-0
"
"['complexity-theory', 'oracles', 'bbbv']"," Title: Proof using hybrid method that inverting a permutation requires exponential queries for BQP machinesBody: Let's say I am given a permutation $\sigma$ that maps $n$ bit strings to $n$ bit strings. I want to output $1$ if $\sigma^{-1}(000\cdots1)$ is even and $0$ if $\sigma^{-1}(000\cdots1)$ is odd. It can be proven that this problem requires an exponential number of queries, given access to just $\sigma$ and $000\cdots1$ (but, crucially, not $\sigma^{-1}$ or any oracle that calculates the parity of $\sigma^{-1}$). There are many ways to prove this lower bound, like using the hybrid argument, or the adversary method, or showing this problem is equivalent to Grover's search. I am specifically looking for a hybrid argument.
I found one here (Theorem $3.6$), but it deals with random permutation oracles instead of a fixed oracle. I don't think that condition should be necessary. Also, the proof seems very complicated. Can someone provide a simplified treatment?
"
"['qiskit', 'programming', 'simulation']"," Title: Inconsistency in Qiskit Aqua CircuitSampler from Operator FlowBody: I am trying to wrap my head around Qiskit Aqua Operators and I stumbled upon this:
My code
t=0.5
hamiltonian=get_hamiltonian(1,1) #a four 4 qubit hamiltonian (Transverse field Ising model)
evo_time=Parameter("t")
evo_op=(evo_time*hamiltonian).exp_i()
evo_op1 = evo_op @ (Zero^4)
trotter_op=PauliTrotterEvolution(trotter_mode=Suzuki(reps=10,order=1)).convert(evo_op1)
trotter_op_values=trotter_op.bind_parameters({evo_time: t})
circuit1=trotter_op_values.to_circuit()
backend=Aer.get_backend("qasm_simulator")
circuit1.measure_all()
counts1=execute(circuit1, backend=backend, shots=10024).result().get_counts()
for key in counts1.keys():
counts1[key]=counts1[key]/10024
a=0
# I had to instantiate again the trotter_op because trotter_op_values.to_circuit()
#didn't create a new circuit and instead, by having done circuit1.measure_all()
# trotter_op was modified as well.
trotter_op=PauliTrotterEvolution(trotter_mode=Suzuki(reps=10,order=1)).convert(evo_op1)
trotter_op_values=trotter_op.bind_parameters({evo_time: t})
sampler=CircuitSampler(backend=Aer.get_backend("qasm_simulator"))
sampler.quantum_instance.shots=10024
results1=sampler.convert(trotter_op_values).primitive
#normalize the results from the circuitsampler
for key in results1.keys():
a+=results1[key]
for key in results1.keys():
results1[key]=results1[key]/a
# assert counts1.keys()==results1.keys()
assert sum(counts1.values()) #check normalization
assert sum(results1.values()) #check normalization
for key in results1.keys():
print("state: {} | Counts1: {} | Results1: {}".format(key,counts1[key], results1[key]))
plot_histogram([counts1, results1], legend=["Running the circuit","CircuitSampler from aqua"])
What I expected
Since the evo_op1 is just a CircuitStateFn whose initialization was the zero state for the 4 qubits then, passing this into CircuitSampler the CircuitStateFn would be replaced by a DictStateFn whose amplitudes would be the same as measuring all 4 qubits in the trotterization circuit with a zero state initialization (my circuit1).
What I got
The histograms never match, for any value of t except t=0. However, there is always a clear similarity between the plots (for small t the probability for 0000 is always the biggest for example and all other states have similiar probabilities, but never exactly equal)
What am I missing? Was it a bad interpretation of the Operator Flow?
"
"['programming', 'ibm-q-experience']"," Title: Why does job appear to be stuck in queue on IBMQ backend?Body: I have submitted a batch of circuits to ibmq_vigo using the IBMQJobManager and the batch is correctly split properly into multiple jobs(as viewed on the dashboard), however the job at the front of the queue appears stuck at the front for multiple hours. The backend does not appear to be in reserve mode and I did not have this issue when I successfully executed the same batch of circuits on ibmq_rochester.
Does anyone know what might be the issue?
Also this is my second unsuccessful attempt at executing on ibmq_vigo.
"
"['quantum-state', 'mathematics', 'partial-trace']"," Title: Eigenvalues of a quantum state after partial tracingBody: I am interested in the smallest nonzero eigenvalue of a quantum state.
- Does this eigenvalue always increasing after a partial trace i.e.
the smallest nonzero eigenvalue of $\rho_A$ is always larger than
that of $\rho_{AB}$?
Intuitively, this seems like it must be true since the reduced state has fewer eigenvalues but its trace is still 1. On average,
the eigenvalues must be larger. How can one prove this statement (or
perhaps a more refined version of it)?
- Is there any bound on how much larger this eigenvalue can get? A
trivial bound is that it cannot increase by more than 1 but is there
anything better that can be said?
"
['quantum-advantage']," Title: What is the reason for the exponential speed-up of quantum computers?Body: In quantum computers the following two effects should be seen:
- If an operator acts on an arbitrary qubit $Q_n$ of a quantum system $S$ consisting of several qubits than we get a new quantum system $S'$ where the amplitudes of all qubits have changed.
- If an operator acts on one qubit of a quantum system $T$ consisting of two entangled QuBits than both qubits are affected.
So which one of these is the reason for the exponential speed-up expected from quantum computers?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Can I get the job variable from the job_id?Body: Suppose I run the following code:
job = execute(qc, backend = backend, shots = 1024, optimization_level = 0)
Then the job takes a long time to run. We know that job_id (from job.job_id()) is a unique identifier for a job. Can I just save job_id and then turn it off and restore the job variable with job_id the next day?
Or what information can I save that will allow me to get the job.result() after I drop the line?
The motivation for this problem is that I don't want to increase the workload due to network reasons when I am waiting for many tasks to run. It will be much easier to handle data when there is job.result(). Otherwise, I can only go to https://quantum-computing.ibm.com/ to download the result data, and the data format is not easy to use.
thank you for your help!
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to perform a time evolution of a quantum state with Qiskit Aqua?Body: How can we perform a time evolution of a quantum state for a given Hamiltonian with qiskit Aqua operator flow? I'm interested in it due to its higher efficiency.
"
"['qiskit', 'noise']"," Title: How can I implement a circuit that simulates white noise on $n$ qubits?Body: I want to test an error model of the convex form
$$t \times \text{ideal_state} + (1-t)\times \text{noisy_circuit}.$$
In terms of density matrices, this would look like
$$t\rho_{\text{idealState}}+(1-t)\times\text{Identity}.$$
However, I can only implement circuits on the simulator where I want to test and no density matrices.
"
"['entropy', 'partial-trace', 'information-theory', 'max-entropy']"," Title: Non-lockability of quantum max-entropyBody: Lockability and non-lockability are explained in this paper. A real valued function of a quantum state is called non-lockable if its value does not change by too much after discarding a subsystem. The max-entropy of a quantum state is defined as
$$H_{\max }(A)_{\rho}= \log \operatorname{tr}(\rho_{A}^{1 / 2})$$
For a bipartite quantum state $\rho_{AB}$, I would like to know if the max-entropy is non-lockable i.e. is there any relationship of the form
$$\text{tr}(\rho_{AB}^{1/2}) \leq \text{tr}(\rho_{A}^{1/2})\cdot|B|$$
which, after taking logs on both sides, would yield
$$H_{\max}(AB)\leq H_{\max}(A) + \log|B|$$
A couple of easy numerical examples suggests this might be true but I have not been able to prove it.
"
"['qiskit', 'programming', 'hamiltonian-simulation']"," Title: Simulate a random quantum state time evolution in Qiskit AquaBody: I am trying to evolve a quantum state through a PauliTrotterEvolution in aqua and I'm trying to do so by initializing a random state, by using random_statevector from qiskit.quantum_info.
My code:
op=get_hamiltonian(-1,h) # a 4 qubit operator
evo_op=(t*op).exp_i()
evo_op=evo_op
trotter_op=PauliTrotterEvolution(trotter_mode=Suzuki(reps=10,order=1)).convert(evo_op)
qinstance=QuantumInstance(backend=Aer.get_backend("qasm_simulator"), shots=2048)
sampler=CircuitSampler(qinstance)
trotter_op=trotter_op @ StateFn(state)
results1=sampler.convert(trotter_op).primitive
The error
this returns the following error: ValueError: Qiskit circuit Initializer cannot handle non-positive statevectors. however, by the source code, the Initializer comes from qiskit.extensions which I believe is from this .py file (file) whose docstring states:
"""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).
Note that Initialize is an Instruction and not a Gate since it contains a reset instruction,
which is not unitary.
"""
what am I missing?
"
"['qiskit', 'programming', 'ibm-q-experience', 'optimization']"," Title: Qiskit: Error when importing libraries for ADMM optimizerBody: I would like to try and ADMM optimizer as shown in Qiskit Tutorial in Quantum Lab. Firstly, I imported necessary libraries (copy/paste from the Tutorial):
import time
from typing import List, Optional, Any
import numpy as np
import matplotlib.pyplot as plt
from docplex.mp.model import Model
from qiskit import BasicAer
from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
from qiskit.optimization.algorithms import CobylaOptimizer, MinimumEigenOptimizer
from qiskit.optimization.problems import QuadraticProgram
from qiskit.optimization.algorithms.admm_optimizer import ADMMParameters, ADMMOptimizer
When I started the import this error appeared:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-32-c32e151d13df> in <module>
11
12 from qiskit import BasicAer
---> 13 from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
14 from qiskit.optimization.algorithms import CobylaOptimizer, MinimumEigenOptimizer
15 from qiskit.optimization.problems import QuadraticProgram
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/__init__.py in <module>
75 from .aqua_globals import aqua_globals
76 from .quantum_instance import QuantumInstance
---> 77 from .algorithms import QuantumAlgorithm
78 from ._logging import (QiskitLogDomains,
79 get_logging_level,
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/__init__.py in <module>
190 from .eigen_solvers import NumPyEigensolver, ExactEigensolver, EigensolverResult
191 from .factorizers import Shor
--> 192 from .linear_solvers import HHL, NumPyLSsolver, ExactLSsolver
193 from .minimum_eigen_solvers import (VQE, VQEResult, QAOA, IQPE, IQPEResult, QPE, QPEResult,
194 ClassicalCPLEX, CPLEX_Ising, NumPyMinimumEigensolver,
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/__init__.py in <module>
15 """ Linear Solvers Package """
16
---> 17 from .hhl import HHL
18 from .numpy_ls_solver import NumPyLSsolver, ExactLSsolver
19
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in <module>
24 from qiskit.aqua import QuantumInstance
25 from qiskit.aqua.algorithms import QuantumAlgorithm
---> 26 from qiskit.ignis.verification.tomography import state_tomography_circuits, \
27 StateTomographyFitter
28 from qiskit.converters import circuit_to_dag
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/__init__.py in <module>
98 """
99 from .quantum_volume import qv_circuits, QVFitter
--> 100 from .randomized_benchmarking import (CNOTDihedral,
101 randomized_benchmarking_seq,
102 RBFitter, InterleavedRBFitter,
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/randomized_benchmarking/__init__.py in <module>
19
20 # Randomized Benchmarking functions
---> 21 from .circuits import randomized_benchmarking_seq
22 from .dihedral import (CNOTDihedral, decompose_cnotdihedral, random_cnotdihedral)
23 from .fitters import (RBFitter, InterleavedRBFitter, PurityRBFitter,
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/randomized_benchmarking/circuits.py in <module>
204 is_purity: bool = False,
205 group_gates: Optional[str] = None,
--> 206 rand_seed: Optional[Union[int, RandomState]] = None) -> \
207 (List[List[qiskit.QuantumCircuit]], List[List[int]],
208 Optional[List[List[qiskit.QuantumCircuit]]],
AttributeError: module 'qiskit' has no attribute 'quantum_info'
Since I only copied the code, it seems there is some bug. Does anybody know how to solve this?
Note: I work in Quantum Lab in IBM Q Experience interface
"
"['ibm-q-experience', 'measurement', 'ibm', 'error-mitigation']"," Title: IBM Melbourne quantum computer performance and errorsBody: What is the reason for high variation in measurement probability results of a simple 3/4 qubit measurement circuit on IBM Melbourne machine in comparison with the same circuit being run on IBM Vigo/Santiago.
Variation in Vigo: approx. 0.7
Variation in Melbourne: approx. 2.6
"
"['quantum-gate', 'algorithm']"," Title: Is there a quantum gate that can do this?Body: Is there a quantum gate that can do the following?
Given a first set of N qbits, mutually entangled in such a way that each state in the superposition meets a given condition, generate a second set of N qbits entangled in such a way that NO superimposed state in the second set of qbits meets that condition, and ALL states that do not meet that condition ARE included in the superimposed states in the second set of qbits.
It seems that a combination of quantum NOT gates might do the trick, but I can't quite wrap my head around it. My apologies if the terminology is wrong: this is not my field.
"
"['entanglement', 'photonics', 'games', 'key-distribution', 'qkd']"," Title: How are Franson Interferometers used to prove security in Photonic QKD Experiments?Body: I am currently reading this paper about Quantum Key Distribution Protocols which use Franson Interferometers to secure against eavesdroppers. I am having trouble understanding how the interferometers implement the CHSH game in order to show the correlation between the photons in the experiment has not been tampered with.
I do not come from an experimentalist background and understanding the workings of the Franson interferometer vs other interferometers is proving difficult. I know that in the CHSH game both parties (Alice and Bob) will choose between two measurements to maximize the violation of Bells Inequality. With Franson interferometers what is the analog for these measurements? Is it just the counts of how many photons choose the long branch vs the short? I know some experiments use phase differences in the branch paths and Alice and Bob choose their own phase delays. Does this not destroy the temporal correlation between the two photons?
I know this is a long slew of questions so any help is greatly appreciated!
"
"['mathematics', 'measurement', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Show that for any measurement operator $M_m$ there exists unitary $U_m$ such that $M_m=U_m\sqrt{E_m}$ with $E_m$ POVMBody: Exercise 2.63 of Nielsen & Chuang asks one to show that if a measurement is described by measurement operators $M_m$, there exists unitary $U_m$ such that $M_m = U_m \sqrt{E_m}$ where $E_m$ are the POVM associated to the measurement (that is, $E_m = M^{\dagger}_m M_m$).
I can see that, if $\sqrt{E_m}$ is invertible, then $U_m = M_m \sqrt{E_m}^{-1}$ is unitary; indeed, we have (dropping the needless subscript for simplicity) $U^{\dagger} U = (\sqrt{E}^{-1})^\dagger M^\dagger M \sqrt{E}^{-1} = (\sqrt{E}^{-1})^\dagger E \sqrt{E}^{-1} = (\sqrt{E}^{-1})^\dagger \sqrt{E} = (\sqrt{E}^{-1})^\dagger \sqrt{E}^\dagger = (\sqrt{E} \sqrt{E}^{-1})^\dagger = I^\dagger = I$
where I used that $\sqrt{E}$ is Hermitian (since it is positive).
But what if it's not invertible? Perhaps some continuity argument would work?
"
"['programming', 'ibm-q-experience', 'textbook-and-exercises']"," Title: IF statement in OpenQASM on IBM Quantum ExperienceBody: This is a simple circuit introduced in Moran's book "Mastering Quantum Computing with IBM QX" to demonstrate how if works in OpenQASM:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5]; // Quantum Register
creg c[5]; // Classical Register
x q[0];
measure q[0] -> c[0];
if (c==1) x q[1];
measure q[1] -> c[1];
And this is how the circuit visually looks in IBM QX Circuit Composer:
The book states that at the end of the circuit, the classical register should read 00011 because after the first measurement it holds a value 1 (as a decimal number), thus satisfying the if condition. However, when I test this exact circuit in IBM QX's Circuit Composer, the result shows 00001 with 100% probability.
Interestingly enough, when if (c==1) is changed to if (c==0), the result is now 00011 with 100% probability, which I don't think is logically right.
What should be an explanation for this discrepancy? The book argues that the if statement is not supported by IBM QX (as of Jan 2019), so could this be a sort of bug?
Any help would be appreciated.
"
"['qiskit', 'ibm-q-experience']"," Title: Report measurement components for a given Hamiltonian measurementBody: I was wondering if there is a possibility to report measurement components when reporting the final expectation values of a qubit operator. For example, if we look at a simple Hydrogen molecule Hamiltonian (parity mapping, minimal basis, $0.7414$ Å) as follows:
$$H_{op} = -1.052\, II + 0.397\, IZ -0.397\, ZI -0.011 \, ZZ + 0.180 \,XX$$
To obtain the ground state energy, we need to calculate the expectation value of the above expression. To my understanding, this can be done using PauliExpectation() function from aqua. For this problem, I assume expectation values are computed for each component ($II$, $IZ$, $ZI$, $ZZ$, $XX$) of the above Hamiltonian (multiplied by the pre-factors: $-1.05, 0.39, 0.39, -0.01, 0.18$) and then summed up.
I am wondering if it's possible to report the expectation values for each component, ie just for the $IZ$, $ZI$, $ZZ$ and $XX$ terms, for example. I could very easily then multiply the pre-factors and compute the total expectation value classically.
"
['quantum-operation']," Title: What applications does single-shot state conversion have?Body: Many quantum processes are formulated in a resource theoretic approach like entanglement, athermality, asymmetry, coherence, etc.
Some of its topics have obvious applications, like distillation where you asymptotically convert resources to their maximal form, which is connected to the resource measure of von-Neumann entropy. However, I am not familiar with applications for single-shot (deterministic) conversion where a finite system is converted with exactness.
The center focus for single-shot conversion is which state can be converted to which state given some physical limitation. However, in quantum computing I do not see how this knowledge can be used, you apply quantum gates without having to figure out its state transformations beforehand. I also do not find catalysts to be very useful, since each transformation uses different catalysts, and you have to calculate which one to use so it does not get spent. Moreover, from an experimental perspective it is not very achievable.
So, the question is what are some applications for single-shot state conversion? (The most likely application I can think of is in one-way quantum processing.)
"
"['shors-algorithm', 'quantum-fourier-transform', 'hidden-subgroup-problem', 'fourier-sampling']"," Title: Constructing arbitrary functions for the Abelian HSPBody: My question might be similar to Hidden subgroup problem. However, I'm not exactly sure though. In addition, that question doesn't have an answer.
I'm trying to create some simple instances of the general abelian hidden subgroup problem to experiment with for learning purposes. This requires solving the following simpler (for small groups) 'reverse' problem:
Suppose we have a finite abelian group $G$. In addition, we
have an arbitrary subgroup $H$. Find a function, $f_H : G \to S$, for some set $S$. In addition, $f_H$
is constant, and for simplicity distinct on the cosets of $H$.
I know that WLOG, we can assume $G \ge H$ is such that $G \cong \mathbb{Z}_{p^{k_1}} \oplus \mathbb{Z}_{p^{k_2}} \dots \oplus \mathbb{Z}_{p^{k_n}}$, for the same $p$. Since the abelian HSP, and thus the problem I mentioned above, can be solved separately for the relatively prime components.
My question is about when $p$ is not a power of $2$. In which can we need to instead look at $G' \cong \mathbb{Z}_{2^{r_1}} \oplus \mathbb{Z}_{2^{r_2}} \dots \oplus \mathbb{Z}_{2^{r_n}}$ where for each $k_i$, $p^{2k_{i}} \le 2^{r_i} \le 2p^{2k_{i}}$, and use the continued fractions algorithm. Given, $f_H$ for $G$ ($G \ge H$), how do we extend the support of $f_H$ to $G'$ such that we can still sample from the dual of $H$?
In the case of the order-finding/Shor's function with support $\mathbb{Z}_{\phi(N)}$ ($\phi$ is Euler's totient function), the support of $f(x) = a^k mod N$ can be naturally extended from $\mathbb{Z}_{\phi(N)}$ to $\mathbb{Z}_N$ and then $\mathbb{Z}_{2^k}$, $N^2 \le 2^k \le 2N^2$. Also Shor proved the extension is valid for this function. But what about an arbitrary $f_H$?
The set of functions I'm looking at are ones that simply assign a distinct natural number to each coset.
I was thinking something like given $f_H$ as above extend to $f'_H$:
$\quad f'_H((x_1, x_2, \dots, x_n)) = f_H((x_1 mod \mathbb{Z}_{p^{k_1}}, x_2 mod \mathbb{Z}_{p^{k_2}}, \dots, x_n mod \mathbb{Z}_{p^{k_n}}))$, $(x_1, x_2, \dots, x_n) \in \mathbb{Z}_{2^{r_1}} \oplus \mathbb{Z}_{2^{r_2}} \dots \oplus \mathbb{Z}_{2^{r_n}}$.
This doesn't seem to work; I'm not sure it actually makes sense.
Any ideas?
Update
I realized I might be misunderstanding something. It seems like the setup is supposed to be the following: create a uniform superposition of the states of $G$, not $G'$, as I stated above. In which case we can apply $f_H$, as is. However, we still utilized the QFT of $G'$, which can be efficiently implemented. This seems to work for small groups, but it doesn't seem to be feasible to construct an arbitrary uniform superposition of a subset of all basis states, which is what we would need. To do this exactly, would require, to my knowledge, implementing the QFT for $G$ (or QFT for $\mathbb{Z}_r$ for arbirary $r$), which we can't do. I assume for small groups, this could be done through multiple applications of Grover to get an approximate uniform superposition.
Since, as mentioned here https://arxiv.org/pdf/quant-ph/0603140.pdf, the order-finding/Shor's function is somewhat of a special case. Since in Shor's we are actually dealing with free-abelian groups of finite rank (not finite), as the paper mentions.
I'm still not sure if this is correct. If it is, I'm not sure of an efficient way of implementing such superpositions.
Please let me know if anything isn't clear with my question.
"
"['error-correction', 'textbook-and-exercises']"," Title: Example of Quantum Error CorrectionBody: Shor's 9 Qubit code. Imagine that we encode the state $| \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle$ using Shor's 9 qubit code, then an X error occurs on the 8th qubit of the encoded state $| E ( \psi ) \rangle$.
a) Write down the state following the error.
Apparently the answer is
$$\frac{1}{2 \sqrt2}( \alpha (| 000 \rangle + | 111 \rangle) ( | 000 \rangle + | 111 \rangle) ( | 010 \rangle + | 101 \rangle) \\ + \beta ( | 000 \rangle - | 111 \rangle)( | 000 \rangle - | 111 \rangle)( | 010 \rangle - | 101 \rangle))$$
How has this been derived? I cant see how you do this with an error.
b) We now decode the encoded state, starting by applying the bit flip code decoding algorithm. What are the syndromes returned by the measurements in the algorithm?
Apparently the syndromes are $00, 00, 10$. How do I know what measurements to do?
c) Now imagine that $| E( \psi ) \rangle$ is affected by two $X$ errors, on the 7th and 8th qubits. What are the syndromes returned this time? What state does the decoding algorithm output?
Now the syndromes are $00, 00, 01$. The decoding algorithm thus thinks there has been an X error on the 9th qubit. So it "corrects" this by applying an X operation on this qubit, to give the state
$$\frac{1}{2 \sqrt2}( \alpha (| 000 \rangle + | 111 \rangle)( | 000 \rangle + | 111 \rangle)( | 000 \rangle + | 111 \rangle)\\ - \beta ( | 000 \rangle - | 111 \rangle)( | 000 \rangle - | 111 \rangle)( | 000 \rangle - | 111 \rangle))$$
Note that $\beta$ now has a minus sign in front of it. After the bit decoding, we are left with $\alpha | {+++} \rangle - \beta | {---} \rangle$, which is then decoded to $\alpha | 0 \rangle - \beta | 1 \rangle$.
Again how would I know what measurements to take? Also how could I know a priori that I have errors on the 7th and 8th qubits? Why do we apply a $X$ operation to the 9th qubit?
"
"['quantum-gate', 'algorithm', 'entanglement']"," Title: What does a quantum NOT operation do to an entangled set of qubits?Body: Quantum computing is not my field, so answers understandable to a layman will be most useful. Please forgive any incorrect terminology in my question!
Assume that a set of the states of N qubits exists as a superposition of M entangled qubit states, such that the possible states in the superposition comprise a subset B of the universal set comprising all possible states of N unentangled qubits.
If a quantum NOT operation is applied to each of the N qubits in B to obtain a new superposition R, what is the result? Is it the set complementary to B? I suspect it should be the set $R=B^C$, containing a superposition of 2^N - M different possible states.
"
"['qiskit', 'programming']"," Title: Change the position of a gate in Qiskit for better representationBody: I'm using Qiskit to demonstrate some circuits, and I want to change the position of some gates for better representation.
For example, look at this circuit:
I'd like for the last $R_x(\frac{-\pi}{2})$ to align with the last Hadamard gate. Is there a way to do this without using barriers?
"
"['pauli-gates', 'vqe']"," Title: In Variational Quantum Eigensolvers, what does ""grouping Pauli operators into tensor products requiring the same post-rotations"" mean?Body: In this paper (nature version), the authors state
We group the Pauli operators into tensor product basis sets that require the same post-rotations.
As a result, they have the table S2 in the suppl. I don’t understand this statement, could anyone please explain it, say for H2?
"
"['qiskit', 'mathematics', 'chemistry']"," Title: How is the Hartree accuracy calculated between the exact and VQE results?Body: In the Simulating Molecules using VQE section of the Qiskit textbook it states an accuracy of $0.0016$ Hartree between the exact and VQE results with Hartree energy values of $-1.86712098$ and $-1.80040360007339$ for the ground state of $H_2$, respectively.
How is $0.0016$ computed? and is it an error metric similar to absolute error?
"
"['qiskit', 'programming', 'textbook-and-exercises', 'vqe']"," Title: Why is local qasm simulation taking so long for VQE?Body: I've successfully run the $LiH$ VQE simulation detailed in Simulating Molecules using VQE using the statevector_simulator, however when attempting to run the same simulation on the quantum_instance(detailed in the same section) using the NoiseModel for ibmq_manhattan the simulation seems to run indefinitely without yielding results.
Is it expected that the quantum_instance simulation would be significantly longer ($>100\times$) than the statevector_simulator simulation?
Note: I'm using the following optimizer and variational form:
optimizer = SPSA(maxiter=100)
var_form = EfficientSU2(qubitOp.num_qubits, entanglement="linear")
"
"['quantum-gate', 'quantum-state', 'algorithm']"," Title: Is there a quantum operation that can transform a superposition of states into its complement?Body: Given a superposition of states "B" which is a subset of the suoerposition "A" of all possible states of a set of qbits, is there a quantum operation that produces superposition $R= B^C$, the complementary subset of "A", and in the process necessarily destroys "B", to avoid violating the no cloning theorem? If not, is there an operation that can produce an approximate complement ${B^C}(Approx)$?
Edit 1: @tsgeorgios has demonstrated in a comment that the proposed operation is not unitary in the general case, so wouldn't be possible in general. However, this challenge may be analogous to the challenge of cloning a superposition, which can't be done in general, but can be closely approximated if the set A of states are linearly independent. That means if there are N qbits, there can only be N states in the superposition A. Though cumbersome, any method for approximating the complement of information encoded in B would be potentially useful.
"
"['entanglement', 'mathematics', 'textbook-and-exercises']"," Title: What linear map is needed for acting on a maximally entangled state?Body: I was reading a textbook and I encountered this question. I was wondering why we don't consider $M^\dagger$ instead of $M^{T}$, so I didn't show this relation, could you please help me to show below relation?
Let $M: \mathcal{H}^{\tilde{A}} \rightarrow \mathcal{H}^{B}$ be a linear map and denote its transpose map by $M^{T}: \mathcal{H}^{\tilde{B}} \rightarrow \mathcal{H}^{A}$. Show that
$$
I \otimes M\left|\phi_{+}^{A \tilde{A}}\right\rangle=M^{T} \otimes I\left|\phi_{+}^{\tilde{B} B}\right\rangle
$$
where $\left|\phi_{+}^{\tilde{A} A}\right\rangle:=\sum_{y=1}^{|A|}|y y\rangle^{\tilde{A} A}$ and $\left|\phi_{+}^{\tilde{B} B}\right\rangle:=\sum_{y=1}^{|B|}|y y\rangle^{\tilde{B} B}$ and these are maximally entangled states.
"
"['complexity-theory', 'hamiltonian-simulation', 'models']"," Title: Proof that any unitary can be written as $U=e^{-iH}$ with $H$ Hamiltonian with bounded normBody: I am looking for a proof that any unitary matrix can be written as:
$$U = e^{-iH}$$
where $H$ is some Hamiltonian with bounded norm. That is $$||H||_{2} = O(1).$$
"
"['qiskit', 'programming', 'vqe']"," Title: On number of parameters and operators in UCCSD in qiskitBody: I have two questions on UCCSD in qiskit, please see the code below.
import numpy as np
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.drivers import PySCFDriver, UnitsType
from qiskit.chemistry import FermionicOperator
from qiskit.aqua import QuantumInstance
def get_qubit_op( atom , basis , map_type ):
driver = PySCFDriver(atom=atom, unit=UnitsType.ANGSTROM,
charge=0, spin=0, basis=basis)
molecule = driver.run()
repulsion_energy = molecule.nuclear_repulsion_energy
num_particles = molecule.num_alpha + molecule.num_beta
num_spin_orbitals = molecule.num_orbitals * 2
ferOp = FermionicOperator(h1=molecule.one_body_integrals, h2=molecule.two_body_integrals)
qubitOp = ferOp.mapping(map_type=map_type, threshold=0.00000001)
# qubitOp = Z2Symmetries.two_qubit_reduction(qubitOp, num_particles)
shift = repulsion_energy
return qubitOp, num_particles, num_spin_orbitals, shift
atom='H .0 .0 .0; H .0 .0 0.74'
qubitOp, num_particles, num_spin_orbitals, shift = get_qubit_op( atom , basis = 'sto3g' , map_type = 'parity' )
num_qubits = qubitOp.num_qubits
print( 'num_qubits = ' , num_qubits )
from qiskit.chemistry.components.initial_states import HartreeFock
init_state = HartreeFock( num_spin_orbitals , num_particles , 'parity' , two_qubit_reduction=False )
# setup the variational form for VQE
from qiskit.chemistry.components.variational_forms import UCCSD
var_form_vqe = UCCSD(
num_orbitals=num_spin_orbitals,
num_particles=num_particles,
initial_state=init_state,
qubit_mapping='parity' ,
two_qubit_reduction = False
)
print( 'var_form_vqe.num_parameters = ' , var_form_vqe.num_parameters )
var_form_vqe.construct_circuit([1,1,1]).draw() # Give some random para
The outputs are (without the plot of the circuit)
num_qubits = 4
var_form_vqe.num_parameters = 3
My questions are
1.
Why there are only 3 free parameters in UCCSD? Since I have 4 spin-orbs, I should expect there are at least 4^4 free parameters from the double excitation operators?
2.
Is there a way to see which operators are involved in UCCSD? I plot out the circuit, but there are “Evolution^1” block involved. If I use “decompose().“, it shows all the 1 and 2 qubit operations? Would it be possible to show something in between, by which I mean for example adding barrier for the decomposed circuit, or showing which fermionic excitation operators are involved?
Many thanks!
"
"['qiskit', 'algorithm', 'programming', 'density-matrix', 'matrix-representation']"," Title: Information about two algorithms of Matrix product stateBody: In qiskit backends, there is Matrix_product_state.
With this backend, I can simulate circuit for several qubits. And I found some mysterious problem about MPS. With 25,26,27 qubits, the simulating time takes really really much. So, I asked here why it happened, and I got some answer here. But I want to know more detail about this MPS part. Where can I found the information about two algorithm of MPS? Please help.
"
"['qiskit', 'programming', 'ibm-q-experience', 'vqe']"," Title: Why is circuit inverse not working for EfficientSU2?Body: For some reason I get the following error when attempting to find the inverse of the EfficientSU2 VQE variational form:
TypeError: 'NoneType' object is not reversible
My code is as follows:
var_form = EfficientSU2(6, entanglement="linear")
var_form_inv = var_form.inverse() # error thrown of this line
Is there a bug in the implementation of the inverse method? and if so how can I implement a working inverse function?
Note qiskit.__qiskit_version__:
{'qiskit-terra': '0.15.2',
'qiskit-aer': '0.6.1',
'qiskit-ignis': '0.4.0',
'qiskit-ibmq-provider': '0.9.0',
'qiskit-aqua': '0.7.5',
'qiskit': '0.21.0'}
"
"['qiskit', 'programming', 'vqe']"," Title: Why is there a significant variation between the exact and VQE energy results?Body: When running the VQE simulation for $H_2$ over a range of distances as detailed in the Simulating Molecules using VQE section of the Qiskit Textbook, the VQE energy deviation from the exact energy increases with distance as shown in the figure below:
How is this relation($Error \propto distance$) explained and how can it's effects be minimized?
My VQE code is as follows:
distances = np.arange(0.2, 5, 0.5) # for a finer exact_energies plot run with step of 0.1
exact_energies = []
vqe_energies = []
optimizer = SPSA(maxiter=1000)
for dist in distances:
molecule = "H .0 .0 -" + str(dist) + "; H .0 .0 " + str(dist)
driver = PySCFDriver(atom = molecule, unit=UnitsType.ANGSTROM, charge=0, spin=0, basis='sto3g')
qmolecule = driver.run()
num_particles = qmolecule.num_alpha + qmolecule.num_beta
qubitOp = FermionicOperator(h1=qmolecule.one_body_integrals, h2=qmolecule.two_body_integrals).mapping(map_type='parity')
qubitOp = Z2Symmetries.two_qubit_reduction(qubitOp, num_particles)
result = NumPyEigensolver(qubitOp).run()
exact_energies.append(np.real(result.eigenvalues))
var_form = EfficientSU2(qubitOp.num_qubits, entanglement="linear")
vqe = VQE(qubitOp, var_form, optimizer)
vqe_result = np.real(vqe.run(backend)['eigenvalue'])
vqe_energies.append(vqe_result)
I expected the error to be very low as maxiter = 1000. Also note the backend is a statevector_simulator.
"
"['complexity-theory', 'oracles']"," Title: What is the relationship between quantum circuit and quantum query complexities?Body: I am trying to ascertain a precise understanding of the relationship between the quantum query model of complexity and the quantum circuit model of complexity. Specifically, is there an established mapping between these two models of complexity?
I have yet to find a precise account of their relationship, but my reading of work by Yao (1993) is that they are polynomially related. Is this the extent of our understanding? Is it even sensible for a mapping between these two models of complexity to exist or should we be satisfied in the notion that they address two separate sets of questions (i.e. different tools for different jobs)?
I've considered that perhaps we may view the quantum circuit complexity as a component of the query complexity in that it might be used to establish the complexity of an quantum oracle as implemented in practice. While not a mapping, is that a plausible way of connecting the two or are there additional considerations?
P.S. I was not able to find a non-paywalled version of Yao's paper, if anyone has one they could link for the purpose of this question that would be excellent.
"
"['circuit-construction', 'entanglement', 'measurement', 'error-correction']"," Title: Is there any difference between a quantum- and classically-controlled gate if I know my basis?Body: Consider an unrealistic 2-qubit plus 1 ancilla bit-flip error correction code (images generated by quirk), where I know by some means or other that an error may have happen on qubit0 (represented by the octagon)
First, qubit1 is entangled with q0, then after the potential error, calculate the parity on q2 (the ancilla), and then apply a CNOT to q0.
Now I know that my ancilla MUST be either |0> or |1> because of how it has been prepared, independent of the initial state of q0. Does that mean I can perform the parity measurement classically, and get the same result? i.e.:
Are these two circuits completely equivalent? Or is there some subtlety of collapsing the entangled state that I am missing? Does the initial state of q0 matter? What if q0 is already entangled with some other qubit (not shown)?
"
"['programming', 'optimization', 'qaoa']"," Title: How does the classical optimization of the angles $\gamma$ and $\beta$ in QAOA work?Body: I have been trying to implement QAOA with classical optimization of the angles $\gamma$ and $\beta$, but I I'm failing at the classical part.
In paper Quantum Approximate Optimization Algorithm: Performance, Mechanism, and Implementation on Near-Term Devices QAOA works with variational parameters $\gamma$ and $\beta$ which are first chosen randomely and afer thar is in a loop of 3 steps.
Step1. Simulating $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ with the Quantum Computer.
Step2. Measure in the Z basis. And getting $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$.
Step3. Use a classical optimizesers to calculate new angles $\gamma$ and $\beta$.
In the paper it says that $F_p(\vec{\gamma},\vec{\beta}) = \langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ is maximized.
My Questions are:
- How does the measured expectiaon Value from step 2 is involved in the classical optimization?
- Are the old $\gamma$ and $\beta$ involved in the classical optimization?
- Are step 1 and step 2 only done once? Becuase then the measurement in step 2 will be very unreliable.
- How is the function $F_p(\vec{\gamma},\vec{\beta}) = \langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ written classicaly so that a classical optimizer can work with is?
- Is there a paper where this is explained or programmed?
"
"['quantum-gate', 'quantum-state', 'programming', 'simulation']"," Title: What is the best approach for classically simulating quantum devices?Body: Now I'm focusing on quantum simulation (especially on classical supercomputers), but I saw there exist so many simulators. Is there any criteria to judge which is the best?
https://www.quantiki.org/wiki/list-qc-simulators
Also, I'm doing some research on simulation approaches and read some papers, including:
https://arxiv.org/abs/1805.01450,
https://arxiv.org/abs/1802.06952,
and some others. I found that in these papers, they do not use the simulator toolkit in https://www.quantiki.org/wiki/list-qc-simulators, so I'm wondering which simulator should I follow now?
"
"['qiskit', 'programming', 'vqe']"," Title: Why is the local qasm_simulator significantly slower than the statevector_simulator?Body: I've been running VQE experiments locally using both the statevector_simulator and qasm_simulator, however I've noticed that the runtimes for the qasm_simulator are significantly longer than that of statevector_simulator. According to this answer the statevector_simulator produces ideal/deterministic results, whereas qasm_simulator produces non-ideal/probabilistic results. However I don't see why the simulation times should differ significantly($>\times 100$) if the number of shots=1 for the qasm_simulator even if a NoiseModel or measurement_error_mitigation_cls=CompleteMeasFitter is used.
Is this in fact expected and how is it explained?
"
"['qiskit', 'programming', 'ibm-q-experience', 'vqe']"," Title: How to run VQE experiments on IBMQ Backends?Body: The VQE.run method only takes a quantum_instance of type QuantumInstance or BaseBackend and NOT IBMQBackend. How then can I run VQE experiments on actual IBMQ Backends rather than just locally using a qasm_simulator with the NoiseModel of an IBMQBackend.
"
"['qiskit', 'programming', 'vqe']"," Title: Why do the qasm_simulator runtimes vary significantly for different IBMQ CouplingMap/NoiseModels?Body: I have been running VQE experiments locally using the qasm_simulator with actual IBMQBackend NoiseModels as shown in the Qiskit Textbook. I have noticed that the simulation runtimes for certain backends(e.g. ibmq_vigo - 5 qubits/ibmq_rome - 5 qubits) are significantly faster than others which in fact seem to run indefinitely and do not finish executing(e.g. ibmq_manhattan - 65 qubits/ibmq_montreal - 27 qubits).
Noting that I am running the same VQE experiments on all 4 NoiseModels I do not understand why this extreme simulation runtime variation exists.
How is this explained? and if not immediately resolvable would using the NoiseModel for ibmq_vigo in tandem with the coupling map of say ibmq_manhattan in the case that the desired VQE variational form exceeds 5 qubits(i.e. the number of qubit on ibmq_vigo) - e.g. VQE on $BeH_2$ - result in faster execution?
"
"['quantum-state', 'entanglement']"," Title: Can $|\Psi\rangle\simeq\sum_k |u_k\rangle|v_k\rangle$ be maximally entangled even if $\{|u_k\rangle\}_k,\{|v_k\rangle\}_k$ are not orthonormal?Body: Let $\newcommand{\ket}[1]{\lvert#1\rangle}\{\ket{u_k}\}_k,\{\ket{v_k}\}_k\subset\mathcal H$ be orthonormal bases in an $N$-dimensional space. It then follows that the state
$$\ket\Psi = C\sum_{k=1}^N \ket{u_k}\otimes\ket{v_k}\tag1$$
is maximally entangled (where $C$ is a normalisation constant).
Or more generally, it means that $|\Psi\rangle$ has rank $N$ (which if the embedding space is larger does not correspond to a maximally entangled state).
Does the opposite direction hold? In other words, if we know that a state $\ket\Psi$ is maximally entangled and can be written as (1), can we conclude that $\langle u_j|u_k\rangle=\langle v_j|v_k\rangle=\delta_{jk}$?
Equivalently, suppose $\ket\Psi$ has the form in (1) with $\{\ket{u_k}\}_k,\{\ket{v_k}\}_k$ not orthogonal. Can $\ket\Psi$ then be maximally entangled?
More generally, suppose $\dim\mathcal H=M$ with $M>N$ (the vectors are not a basis). If $|\Psi\rangle$ is as in (1), can it have rank $N$ even if $\{\ket{u_k}\}_k,\{\ket{v_k}\}_k$ are not orthogonal?
For example, in the simplest case with $M=2$ and $N>M$, the question is whether a state of the form
$$\frac{1}{\sqrt{2(1+\Re[\langle u_1|u_2\rangle\langle v_1|v_2\rangle])}} \left(\ket{u_1}\otimes\ket{v_1}+\ket{u_2}\otimes\ket{v_2}\right)$$
can be maximally entangled (or more precisely, have Schmidt coefficients $(1/\sqrt2,1/\sqrt2,0,...,0)$) even if $\langle u_1|u_2\rangle,\langle v_1|v_2\rangle\neq0$.
I'll show here that it is crucial that both bases are non-orthogonal for this to be possible.
If only one of the two sets, say $\{\ket{v_k}\}_k$, is orthonormal, then the matrix of coefficients of $\ket\Psi$, write it with $\Psi$, has the form $\Psi = U \sqrt D V^T$, where $U,V$ are the matrices whose columns equal $\ket{u_k}$ and $\ket{v_k}$, respectively, and $D$ is diagonal. The orthonormality of $\{\ket{v_k}\}_k$ (and thus of $\{\ket{\bar v_k}\}_k$) then implies that
$$\Psi\Psi^\dagger = UDU^\dagger,$$
which tells us that the Schmidt coefficients of $\ket\Psi$ majorize the diagonal of $\sqrt{D}$. E.g. if $D$ is a multiple of the identity then $\Psi\Psi^\dagger \simeq UU^\dagger\neq I$, and thus $\ket\Psi$ is not maximally entangled.
This would seem to suggest that, if at least one of the bases is orthonormal, then indeed $\ket\Psi$ is maximally entangled only if the other basis is also orthonormal.
But this still leaves open the possibility of it being possible when both bases are not orthonormal.
Here is an example of a pair of non-orthogonal states $|\psi\rangle$ and $|\phi\rangle$ such that $|\psi\psi\rangle+|\phi\phi\rangle$ has rank 2. Define
\begin{align}
2\sqrt2 \ket\psi &= \ket1 + (2+i)\ket2 - \ket3 + i \ket4, \\
2\sqrt2 \ket\phi &= \ket1 + i\ket2 + (1-2i)\ket3 - i \ket4.
\end{align}
Let $\ket\Psi\equiv (\ket{\psi\psi}+\ket{\phi\phi})/\sqrt{3/2}$.
You can then verify that the corresponding matrix of coefficients is
$$C = \frac{1}{2\sqrt{6}}\begin{pmatrix}
1 & 1+i & -i & 0 \\
1+i & 1+2 i & 0 & i \\
-i & 0 & -1-2 i & -1-i \\
0 & i & -1-i & -1
\end{pmatrix}.$$
As can be readily checked, the only non-vanishing eigenvalue of $C^\dagger C$ is a two-fold degenerate $+1/2$, hence $\ket\Psi$ has rank $2$.
It's possible that this is only possible because the states live in a larger space, i.e. $M=4$ but $N=2$. I'm wondering if there is a good way to understand why this can happen, and if it possible also when $N=M$.
"
"['qiskit', 'programming', 'density-matrix']"," Title: Initialising impure density matricesBody: I wish to initalise the state $\rho=(1-\frac{p}{2})|0\rangle \langle0|+\frac{p}{2}|1\rangle\langle1|$, where p is some measure of decoherence. This is a mixed state. There are some suggestions on here for how to implement this with ancilla qubits and extra gates. However I am now trying to run a quantum circuit with this as my initial state on the actual IBM quantum computers. The problem is that to intialise two qubits in this state requires 6 ancilla qubits using my current approach, meaning I have to use the Melbourne quantum computer which has moderately high gate error rates. It also increases my circuit depth. In order to simplify my circuit I tried something like this
r=random.choices([0,1],weights=(1-p/2,p/2),k=1)
r.append((r[0]+1)%2)
circuit2 = QuantumCircuit(3,3);
circuit2.initialize(r,0)
circuit2.initialize(r,1)
Although this is statistically correct over many runs it does not give what I want. In each run of the quantum circuit (say 1000 shots), the same intial state is used for all 1000 shots. Is there any way I can make it so that the circuit reevaluates what the initial state should be for each shot?
I do not wish to have to set the number of shots to 1 and evaluate the circuit thousands of times, as the queue time to get my circuit evaluated would be huge.
"
"['quantum-gate', 'hadamard']"," Title: Calculation of the system states and the individual wire states in a quantum circuitBody: I am bit confused with calculating the overall state of a quantum gate and the individual wire states.
For example, lets say there are two Qubits, where Q1 is in $\frac{1}{\sqrt{2}}(\vert 0\rangle + \vert 1\rangle)$ state and Q2 is in $\vert 0\rangle$ state. Then we have CNOT gate controlled by Q1 on Q2 followed by a Hadamard gate at the Q1 gate.
Just after the CNOT gate the total state of the system is $\frac{1}{\sqrt{2}}(\vert 00\rangle+\vert 11\rangle)$.
Then applying the Hadamard gate gives us: $\frac{1}{2}(\vert 00\rangle+\vert 10\rangle+ \vert 01\rangle - \vert 11\rangle)$. As you can see, we get four possibilities of states.
What if I perform the calculations on individual wires? i.e.
- We perform Hadamard on the first Q1 bit, $\frac{1}{\sqrt{2}}(\vert 0\rangle + \vert 1\rangle)$ state which gives us $\vert 0\rangle$ state
- Then for the Q2, apply CNOT which gives $\vert 0\rangle$
- Then we calculate the overall state which is $\vert 00\rangle$
But then we do not get the same answer as before. Are we allowed to calculate like this or am I doing something wrong here?
Thanks!
"
"['programming', 'textbook-and-exercises', 'cirq', 'vqe']"," Title: Wrong Expectation value when implementing a VQE for the Heisenberg HamiltonianBody: I tried to implement an extended Heisenberg-Hamiltonian as an extra exercise further than my homework.
My Hamiltonian is the following: $H = \sum_{NN} \sigma_x\sigma_x + \sigma_z\sigma_z$
I try to implement this in Cirq on a GridQubit-square with 4 qubits.
Following problem:
I calculated the ground state via the matrices analytically and tried to implement the problem in a circuit:
- I used cirq.XXPow- Gates and cirq.ZZPow Gates and cirq.XPow, cirq.ZPow.
- I used an if condition to determine if I measure in Z,Y or X basis. In Z, I append just the measurement, In Y I append X**0.5 to the circuit and in X, I append a Hadamard-Gate.
- Now I let the simulator run and get the probabilities and signs from the histograms. I sum the probabilities times the sign.
- Now I sum the expectation values in X-, Y- and Z-basis and use a classical optimizer.
My problem is that this does not work properly. Either the expectation value is way too big or way too small.
Where is my error in reasoning?
I think I did something wrong with the mechanism.
"
['quantum-state']," Title: Why is a conjugate transpose of $|+\rangle$ a vector $1/\sqrt{2} (\langle0| + \langle1|)$?Body: My understanding of the inner product is that it multiplies a vector by the conjugate transpose, but I don't understand why the conjugate transpose of $|+\rangle$ is $\frac{1}{\sqrt2}(\langle0| + \langle1|)$.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: ClassicalRegister gives out just one line instead of twoBody:
Why do we have just one line here in c0 and not 2?
"
"['programming', 'ibm-q-experience', 'measurement', 'noise']"," Title: Noise model for 3 Qubit $|GHZ \rangle$ state measurement circuitBody: I found this example code in Qiskit documentation.
Does this code signify that it is simulating noise as per the IBM Valencia quantum chip. If yes, what kinds of noise does it simulate? I executed the code below in the quantum lab and analyzed noise in qubit measurement in various quantum machines.
from qiskit import QuantumCircuit, execute
from qiskit import IBMQ, Aer
from qiskit.visualization import plot_histogram
from qiskit.providers.aer.noise import NoiseModel
provider = IBMQ.load_account()
backend = provider.get_backend('ibmq_valencia')
noise_model = NoiseModel.from_backend(backend)
coupling_map = backend.configuration().coupling_map
basis_gates = noise_model.basis_gates
circ = QuantumCircuit(3, 3)
circ.h(0)
circ.cx(0, 1)
circ.cx(1, 2)
circ.measure([0, 1, 2], [0, 1, 2])
result = execute(circ, Aer.get_backend('qasm_simulator'),
coupling_map=coupling_map,
basis_gates=basis_gates,
noise_model=noise_model).result()
counts = result.get_counts(0)
plot_histogram(counts)
"
"['physical-realization', 'ibm', 'quantum-volume', 'metrics']"," Title: Is there a straightforward way to calculate the quantum volume for simple systems?Body: There are a few people who ask how to calculate IBM's "quantum volume", but it's not clear what the actual mathematical definition of this is. In the answers here, people just point to running some program, which is not helpful for understanding or comparing with other technologies.
Is there a straightforward way of calculating this for a simple system?
For example, if I have n-1qubit gates with efficiency of 1, m-2qubit gates with efficiency B, and complete connectivity between qubits - what would my quantum volume be?
"
"['qiskit', 'programming', 'ibm-q-experience', 'hamiltonian-simulation']"," Title: How to realize Su-Schrieffer-Heeger model in QiskitBody: This is a very specific question, which I try to implement a simple dimerized tight-binding Hamiltonian on qiskit. The model is one dimensional, and defined as
$$
H = \sum_{\langle i,j\rangle} t_{ij} c^\dagger_i c_j
$$
where $\langle i,j\rangle$ denotes the nearest neighbor coupling with strength $t_{ij}$. The important aspect of the model is that the coupling is dimerized in the following sense. If we label the sites as 1,2,3,4...., then the nearest neighbor coupling $t_{ij}$ reads, for example,
$$
t_{1,2} = 1, t_{2,3} = 2 , t_{3,4} = 1 , t_{4,5} = 2, etc
$$
which is alternating.
I try to pretend this is a molecular Hamiltonian and realize it in the same way with "FermionicOperator". However, I am not sure how to properly index the "one-body" integral here, which is the nearest neighbor coupling $t_{ij}$ here.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: qasm_simulator generating identical results repeatedlyBody: I wish to run a very simple circuit on the qasm_simulator backend. My circuit is
circuit2 = QuantumCircuit(2,2);
circuit2.u3(pi/2,pi,3*pi/4,1)
circuit2.u3(pi/2,pi,7*pi/4,0)
#u2
circuit2.cx(0,1)
#u3
circuit2.rz(3*pi/4,1)
#u4
circuit2.cx(1,0)
#u5
circuit2.ry(pi/2,0)
#u6
circuit2.cx(0,1)
#u7
circuit2.u3(0,pi*0.8252172,-pi*0.4247820,1)
circuit2.u3(pi/2,0,pi/2,0)
circuit2.measure(0,0);
circuit2.measure(1,1);
The circuit works as I expect and generates the output I expect but I have a question about the workings of the simulator. When I run the following code:
backend = BasicAer.get_backend('qasm_simulator')
for x in range(10):
Cfin=circuit2;
job = execute(Cfin, backend, shots=1000)
res=job.result().get_counts(Cfin)
print(res)
I get a series of results that look something like this
{'11': 274, '10': 256, '01': 229, '00': 241}
{'11': 274, '10': 256, '01': 229, '00': 241}
{'11': 274, '10': 256, '01': 229, '00': 241}
{'11': 274, '10': 256, '01': 229, '00': 241}
{'11': 274, '10': 256, '01': 229, '00': 241}
{'11': 274, '10': 256, '01': 229, '00': 241}
{'10': 241, '01': 224, '00': 286, '11': 249}
{'11': 240, '01': 246, '10': 233, '00': 281}
{'11': 240, '01': 246, '10': 233, '00': 281}
{'11': 240, '01': 246, '10': 233, '00': 281}
I am curious as to why the simulator returns identical results for a few runs in a row. This happens regularly. The simulator appears to get stuck on one particular result for a while. Does anyone know what is the cause of this? Will there be a similar issue if I try to run this code on one of the real quantum computers?
"
"['qiskit', 'programming']"," Title: Qiskit - difference between qasm_simulator and statevector_simulator in terms of memory and speed?Body: I'm trying to profile qiskit backends and I use randomized_benchmarking provided by qiskit.ignis.
Initially I ran a circuit with 20 qubits 100 length on statevector_simulator, which takes around 180s and qubits can go up to 32 and then it runs out of memory. Then I tried qasm_simulator and it only takes 2s to finish and can run up to 54+ qubits.
Why does qasm_simulator perform so much better than statevector_simulator? Does this happen because the circuit only contains simple gates?
"
"['qiskit', 'programming', 'qaoa']"," Title: Custom Mixer for QAOA: Error 'Operator' object has no attribute 'primitive_strings'Body: I like to use as custom Mixer Hamiltonian for solving the TSP using QAOA.
The mixer and cost hamiltonians are described here: https://arxiv.org/pdf/1709.03489.pdf - Chapter 5.1.
Therefore I need to write the custom mixer hamiltonian from equations 54 -58.
Here is the code:
import numpy as np
from qiskit import Aer
from qiskit.aqua import QuantumInstance
from qiskit.quantum_info.operators import Operator, Pauli
from qiskit.aqua.operators.list_ops import SummedOp
from qiskit.aqua.algorithms import QAOA
from qiskit.aqua.components.optimizers import SPSA
from qiskit.optimization.applications.ising importtsp
def pauli(pos, num_qubits, label):
label = 'I'*(pos) + label + 'I'*(num_qubits-pos-1)
assert(len(label) == num_qubits)
return Operator(Pauli(label=label))
def s_plus(number_of_nodes, city, time):
num_qubits = number_of_nodes**2
qubit = time * number_of_nodes + city
return pauli(qubit, num_qubits, "X") + pauli(qubit, num_qubits, "Y")
def s_minus(number_of_nodes, city, time):
num_qubits = number_of_nodes**2
qubit = time * number_of_nodes + city
return pauli(qubit, num_qubits, "X") - pauli(qubit, num_qubits, "Y")
def create_mixer_operators(n):
"""
Creates mixer operators for the QAOA.
It's based on equations 54 - 58 from https://arxiv.org/pdf/1709.03489.pdf
Indexing here comes directly from section 4.1.2 from paper 1709.03489, equations 54 - 58.
"""
mixer_operators = []
for t in range(n - 1):
for city_1 in range(n):
for city_2 in range(n):
i = t
u = city_1
v = city_2
first_part = 1
first_part *= s_plus(n, u, i)
first_part *= s_plus(n, v, i+1)
first_part *= s_minus(n, u, i+1)
first_part *= s_minus(n, v, i)
second_part = 1
second_part *= s_minus(n, u, i)
second_part *= s_minus(n, v, i+1)
second_part *= s_plus(n, u, i+1)
second_part *= s_plus(n, v, i)
mixer_operators.append(first_part + second_part)
return mixer_operators
seed = 10598
n = 3
p = 2
num_qubits = n ** 2
# Generate random tsp
ins = tsp.random_tsp(n, seed=seed)
qubitOp, offset = tsp.get_operator(ins)
# Running in quantum simulation
aqua_globals.random_seed = np.random.default_rng(seed)
backend = Aer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, seed_simulator=seed, seed_transpiler=seed)
mixer = create_mixer_operators(n)
mixer_op = SummedOp(mixer)
spsa = SPSA(maxiter=300)
qaoa = QAOA(operator=qubitOp, mixer=mixer_op, p=p, optimizer=spsa, quantum_instance=quantum_instance)
circuits = qaoa.construct_circuit([0]*(2*p))
When runnning it I get:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-113-bd68aaa30bfc> in <module>
----> 1 circuits = qaoa.construct_circuit([0]*(2*p))
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py in construct_circuit(self, parameter)
358 A list of the circuits used to compute the expectation value.
359 """
--> 360 expect_op = self.construct_expectation(parameter).to_circuit_op()
361
362 circuits = []
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py in construct_expectation(self, parameter)
331 wave_function = self.var_form.assign_parameters(param_dict)
332 else:
--> 333 wave_function = self.var_form.construct_circuit(parameter)
334
335 # Expectation was never created, try to create one
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/qaoa/var_form.py in construct_circuit(self, parameters, q)
96
97 evolution = EvolutionFactory.build(self._cost_operator)
---> 98 circuit = evolution.convert(circuit)
99 return circuit.to_circuit()
100
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/evolutions/pauli_trotter_evolution.py in convert(self, operator)
100 # # Sort into commuting groups
101 # operator = self._grouper.convert(operator).reduce()
--> 102 return self._recursive_convert(operator)
103
104 def _recursive_convert(self, operator: OperatorBase) -> OperatorBase:
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/evolutions/pauli_trotter_evolution.py in _recursive_convert(self, operator)
127 return operator.primitive.__class__(converted_ops, coeff=operator.coeff)
128 elif isinstance(operator, ListOp):
--> 129 return operator.traverse(self.convert).reduce()
130
131 return operator
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/list_ops/list_op.py in traverse(self, convert_fn, coeff)
161 return ListOp([convert_fn(op) for op in self.oplist], # type: ignore
162 combo_fn=self.combo_fn, coeff=coeff, abelian=self.abelian)
--> 163 return self.__class__([convert_fn(op) for op in self.oplist], # type: ignore
164 coeff=coeff, abelian=self.abelian)
165
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/list_ops/list_op.py in <listcomp>(.0)
161 return ListOp([convert_fn(op) for op in self.oplist], # type: ignore
162 combo_fn=self.combo_fn, coeff=coeff, abelian=self.abelian)
--> 163 return self.__class__([convert_fn(op) for op in self.oplist], # type: ignore
164 coeff=coeff, abelian=self.abelian)
165
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/evolutions/pauli_trotter_evolution.py in convert(self, operator)
100 # # Sort into commuting groups
101 # operator = self._grouper.convert(operator).reduce()
--> 102 return self._recursive_convert(operator)
103
104 def _recursive_convert(self, operator: OperatorBase) -> OperatorBase:
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/evolutions/pauli_trotter_evolution.py in _recursive_convert(self, operator)
104 def _recursive_convert(self, operator: OperatorBase) -> OperatorBase:
105 if isinstance(operator, EvolvedOp):
--> 106 if not {'Pauli'} == operator.primitive_strings():
107 logger.warning('Evolved Hamiltonian is not composed of only Paulis, converting to '
108 'Pauli representation, which can be expensive.')
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/evolutions/evolved_op.py in primitive_strings(self)
53
54 def primitive_strings(self) -> Set[str]:
---> 55 return self.primitive.primitive_strings() # type: ignore
56
57 @property
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/list_ops/list_op.py in primitive_strings(self)
126
127 def primitive_strings(self) -> Set[str]:
--> 128 return reduce(set.union, [op.primitive_strings() for op in self.oplist])
129
130 @property
~/masterarbeit/code/venv/lib/python3.6/site-packages/qiskit/aqua/operators/list_ops/list_op.py in <listcomp>(.0)
126
127 def primitive_strings(self) -> Set[str]:
--> 128 return reduce(set.union, [op.primitive_strings() for op in self.oplist])
129
130 @property
AttributeError: 'Operator' object has no attribute 'primitive_strings'
How do I resolve the error? This is my first project with qiskit and I am not sure where to start.
"
"['resource-request', 'randomised-benchmarking']"," Title: Resources on randomized algorithms for analysis and design of quantum algorithmsBody: Are there any good resources (online courses, books, websites, etc) to study randomized algorithms that would help with an specific scope on the analysis and design of quantum algorithms?
"
"['resource-request', 'physical-qubit', 'quantum-dots']"," Title: What are some resources on qubits based on quantum dots?Body: I would like to learn a bit on the physics and details of manufacture of a qubits based on quantum dots. Can anyone recommend some papers?
"
"['qiskit', 'ibm-q-experience']"," Title: How can i run a quantum circuit with parameterized gates many times on quantum experience?Body: I want to run a quantum circuit many times on real hardware so that this circuit has some of the parameters that I must change them each time (some of the angles of gates must change each time). how can I run a circuit with these features on quantum experience?. can I use the "for" statement and the hardware can compile it? generally, How can I write the code for doing this work?. I would be very grateful if anyone helps me.
"
"['qiskit', 'amplitude-amplification']"," Title: Qiskit implementation of Brassard Amplitude implementaion's Q operatorBody: In Brassard's et al. work, the $Q$ operator is defined as
$$ Q =-\mathcal{A}\mathcal{S_0}\mathcal{A}^{-1}\mathcal{S_\chi}$$
I was wondering how is the negative sign at the leftmost side implemented within the operators in a quantum circuit? I already have a realization for $S_\chi$, $S_0$ and $\mathcal{A}$. I can think of it as a basic sign flip using a one qubit operator with -1 in the diagonals but I am not sure if that's a correct implementation.
"
"['quantum-state', 'error-correction']"," Title: How to measure syndromes in QECBody: Shor's $9$ Qubit code. Imagine that we encode the state $|\psi \rangle =α|0\rangle+β|1\rangle$ using Shor's $9$ qubit code, then an $X$ error occurs on the 8th qubit of the encoded state $|E(\psi) \rangle$
This is
$$\frac{1}{2 \sqrt2}( \alpha (| 000 \rangle + | 111 \rangle) ( | 000 \rangle + | 111 \rangle) ( | 010 \rangle + | 101 \rangle) \\ + \beta ( | 000 \rangle - | 111 \rangle)( | 000 \rangle - | 111 \rangle)( | 010 \rangle - | 101 \rangle))$$
We now decode the encoded state, starting by applying the bit-flip code decoding algorithm.
How do you find the syndromes measured by the algorithm, see https://people.maths.bris.ac.uk/~csxam/teaching/qc2020/lecturenotes.pdf?
"
"['q#', 'performance']"," Title: Best way to test the performance of a simulated quantum algorithm in Q#Body: for a student report about solving graph coloring with Grover's Algorithm, I have to talk about the performance of simulated Grover's Algorithm to solve graph coloring. I don't really know how to approach some of the points I have to talk about. I have many things to talk about :
- The execution time : this is hard to measure for "big" graphs like 7/8 node graphs, as the runtime can take more than half an hour and I cannot average running the same program many times. I can still do something less rigorous but do you have any tips ?
- The resources used : this is something I really don't know how to take on. I can guess the complexity can be calculated using Big-O notation, but how do I get this on a simulated problem ?
- Testing operations : this is something I don't know how to do, but I know there is a method for. I know my program works, but is there any rigorous testing for operations in Q# ?
- Estimate for a quantum computer. I know there is the quantum trace simulator, however I cannot see how to provide measurement probabilities for the graph coloring problem.
This is pretty packed in big questions. This is new terrain for me so I hope someone can help. If you have more suggestions about how to test the program, I am open :).
"
"['quantum-fourier-transform', 'quantum-circuit']"," Title: Quantum circuit, Fourier Transform/Decomposition?Body: Broadly speaking, can we say that quantum circuits are like Fourier Transform/Decomposition?
We use qbit like waves, tune it with quantum gates, to find answer.
https://ars.els-cdn.com/content/image/3-s2.0-B978075067444750042X-f05-16-9780750674447.gif
https://www.sciencedirect.com/topics/engineering/fourier-decomposition
https://youtu.be/spUNpyF58BY?t=106
"
['measurement']," Title: How to make a measurement in a subspace?Body: I am currently reading this paper by Xin et al. (2020) in which they perform a measurement in a particular subspace. In the caption of Figure 6 (last sentence) they say " At the end of the circuit, we measure the state of the work system in the subspace where all ancilla registers are $|0⟩|0⟩_k |0⟩_{kL}$." What I am having trouble understanding is how they ensure that the ancilla qubits are in the state $|0\rangle$. How do I design my circuit to transform them into this state?
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'hadamard', 'notation']"," Title: How to translate the Hadamard gate matrix into Dirac notation?Body: Hadamard gate matrix is:
$$\frac{1}{\sqrt 2}\begin{bmatrix}1 && 1 \\ 1 && -1\end{bmatrix}$$
The Dirac notation for it is:
$$\frac{|0\rangle+|1\rangle}{\sqrt 2}\langle0|+\frac{|0\rangle-|1\rangle}{\sqrt 2}\langle1|$$
I am unable to understand, how this gate matrix is translated into dirac notation?
"
"['mathematics', 'nielsen-and-chuang', 'bloch-sphere']"," Title: Does composition of two single qubit rotations yield a single rotation around a unit vector?Body: $
\newcommand{\coefcos}[0]{c_1 c_2 - s_1 s_2 \hat{n}_1 \cdot \hat{n}_2}
\newcommand{\coefsin}[0]{s_1 c_2 \hat{n}_1 + c_1 s_2 \hat{n}_2 - s_1 s_2 \hat{n}_2 \times \hat{n}_1}$This question relates to Exercise 4.15 from Nielsen & Chuang:
(Composition of single qubit operations) The Bloch
representation gives a nice way to visualize the effect of composing two rotations.
(1) Prove that if a rotation through an angle $\beta_1$ about the axis $\hat{n}_1$ is followed by a rotation through an angle $\beta_2$ about an axis $\hat{n}_2$, then the overall rotation is
through an angle $\beta_{12}$ about an axis $\hat{n}_{12}$ given by
$$c_{12} = \coefcos \tag{4.19}\label{4.19}$$
$$
s_{12} \hat{n}_{12} = \coefsin, \tag{4.20}\label{4.20}
$$
where $c_i = \cos \left( \beta_i/2 \right), s_i = \sin \left( \beta_i/2 \right), c_{12} = \cos \left( \beta_{12}/2 \right),$ and $s_{12}= \sin \left( \beta_{12}/2 \right)$.
Note that $\hat{n}_1$ and $\hat{n}_2$ are real unit vectors in three dimensions (as stated earlier in the book).
I managed to get the expressions on the RHS of \eqref{4.19} and \eqref{4.20} by expanding the rotation matrices into the form $R_{\hat{n}_i} \left( \beta_i \right) = \cos \left( \beta_i/2 \right) I - i \sin \left( \beta_i/2 \right) \hat{n}_i \cdot \vec{\sigma}$ (where $\vec{\sigma}$ denotes the three component vector $(X, Y, Z)$ of Pauli matrices) and taking the product.
Now, assume that $c_{12} \ne 1$. Then I'd expect to recover the unit vector $\hat{n}_{12}$ if I divide \eqref{4.20} through by $s_{12} = \pm \sqrt{1 - c_{12}^2}$:
$$
\hat{n}_{12} = \frac{\coefsin}{ \pm \sqrt{1 - c_{12}^2} } \tag{1}
$$
To check that $\hat{n}_{12}$ is of unit length, I take the dot product with itself:
$$
\hat{n}_{12} \cdot \hat{n}_{12} =
\frac{s_1^2 c_2^2 + c_1^2 s_2^2 + s_1^2 s_2^2 + 2 c_1 c_2 s_1 s_2 \cos (\theta) }{1 - c_{12}^2} \tag{2}
$$
where $\cos (\theta) = \hat{n}_1 \cdot \hat{n}_2 $. Expanding $c_{12}$ in the denominator, I get:
$$
\hat{n}_{12} \cdot \hat{n}_{12} =
\frac{s_1^2 c_2^2 + c_1^2 s_2^2 + s_1^2 s_2^2 + 2 c_1 c_2 s_1 s_2 \cos (\theta) }{1 - c_1^2 c_2^2 - s_1^2 s_2^2 \cos^2 (\theta) + 2 c_1 c_2 s_1 s_2 \cos (\theta) } \tag{3}
$$
which tells me that the following equation should hold in order for the numerator and denominator to balance to 1:
$$
s_1^2 c_2^2 + c_1^2 s_2^2 + s_1^2 s_2^2 \stackrel{?}{=} 1 - c_1^2 c_2^2 - s_1^2 s_2^2 \cos^2 (\theta) \tag{4}\label{4}
$$
However, I don't think \eqref{4} holds in general: $c_i$ and $s_i$ are functions of $\beta_i$. $\theta$ however is a function of $\hat{n}_i$ which I'm free to tune independently of $\beta_i$. So I should be able to conjure up values that violate \eqref{4} easily, which tells me that $\hat{n}_{12}$ is not a unit vector. This seems implausible to me. Where am I making a mistake?
"
"['quantum-gate', 'programming', 'pauli-gates']"," Title: How do I visualize the action of Pauli $X$ and $Y$ gates on $|0\rangle$?Body: I visualize Pauli Gates making rotations by π radians about the x, y, and z axes on the Bloch sphere.
If this is the case, then how Pauli-X and Pauli-Y gates applied to $|0\rangle$ differ? As both should rotate the $|0\rangle$ state to same location.
"
"['quantum-gate', 'mathematics', 'matrix-representation', 'hadamard']"," Title: How do I apply a Hadamard gate on a given qubit, in matrix formalism?Body: Hadamard gate matrix is:
$$\frac{1}{\sqrt2}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}$$
The matrix for $|0\rangle$ is:
$$\begin{bmatrix}1 \\ 0\end{bmatrix}$$
I am unable to understand, how can I apply Hadamard gate on $|0\rangle$? The matrix representing $|0\rangle$ is of dimension 2 * 1 and the matrix representing Hadamard gate is of dimension 2 * 2 (so the matrix multiplication is not possible)
"
['tensor-product']," Title: Quantum tensor product closer to Kronecker product?Body: Coming more from a computer science background, I never really studied tensor products, covariant/contravariant tensors etc. So until now, I was seeing the "tensor product" operation mostly as (what appears to be) a Kronecker product between the matrix representation (in some fixed basis) of my vector/linear operator, i.e. if I have two vectors/matrices
$$A = \begin{pmatrix}a_{11} & a_{12} & \cdots \\ a_{21} & a_{22} & \cdots \\ \vdots\end{pmatrix}$$
$$B = \begin{pmatrix}b_{11} & b_{12} & \cdots \\ b_{21} & b_{22} & \cdots \\ \vdots\end{pmatrix}$$
Then:
$$A \otimes B = \begin{pmatrix}a_{11}B & a_{12}B & \cdots \\ a_{21}B & a_{22}B & \cdots \\ \vdots\end{pmatrix} $$
i.e.
$$A \otimes B = \begin{pmatrix}
a_{11}b_{11} & a_{11} b_{12} & \cdots & a_{12}b_{11} & a_{12}b_{12} & \cdots \\ a_{11} b_{21} & a_{11} b_{22} & \cdots & a_{12}b_{21} & a_{12}b_{22} & \cdots \\
\vdots & \vdots & & \vdots & \vdots \\
a_{21}b_{11} & a_{21} b_{12} & \cdots & a_{22}b_{11} & a_{22}b_{12} & \cdots \\ a_{21} b_{21} & a_{21} b_{22} & \cdots & a_{22}b_{21} & a_{22}b_{22} & \cdots \\
\vdots & \vdots & & \vdots & \vdots \end{pmatrix}
$$
In particular, if we consider $|0\rangle = \begin{pmatrix}1\\0\end{pmatrix}$ and $|1\rangle = \begin{pmatrix}0\\1\end{pmatrix}$, then $|0\rangle \otimes |1\rangle = \begin{pmatrix}0\\0\\0\\1\end{pmatrix}$, i.e. $|0\rangle \otimes |1\rangle$ is a vector.
Now, if I look at the tensor product webpage of wikipedia, they seem to define $v \otimes w \colon= v w^T$, i.e. $v \otimes w$ is a matrix (ok, the matrix is just a reshape of the vector obtained by the Kronecher product so both of them are isomorphic, but in term of "type" isn't it a bit strange to define it like that?). But on the other hand, when $v$ and $w$ are matrices, we are back to the Kronecher product.
So here is my question: why do they define the tensor product like that for vector? Is there different "kinds" of tensors? How are they linked with tensors used in physics?
"
"['programming', 'circuit-construction']"," Title: Issue with running a circuit: Cannot read property 'idCode' of nullBody: I have been trying to run simple circuits from the Circuit Composer, both on a real quantum comp and on a simulator. Every time I get this error message:
Could not run circuit ""
Cannot read property 'idCode' of null
Could you please clarify what this means? I tried logging out and in, but nothing seems to work.
"
"['teleportation', 'key-distribution']"," Title: The Methodology of Quantum Key Distributions SystemsBody: While reading an answer in Cryptography.SE I saw this
As for security, that's one possible way to perform Quantum Key Distribution, another real thing. However, most current QKD systems sold today do not exchange entangled qubits (and hence can't be used for Quantum Teleportation), instead, they rely on Heisenberg's principle for security; this may change in the future.
- Is there any product that really uses quantum teleportation?
- Are there any other methods/principles commercially used other than Heisenberg's principle?
"
"['qiskit', 'programming', 'experiment']"," Title: Return outputs with zero countsBody: I am running a simple 3 qubit circuit which produces the following results:
{'000': 5, '001': 3, '010': 10, '100': 5, '101': 7, '110': 7, '111': 4}
There are no counts of 011. Is there a simple way within qiskit to also return the result '011': 0? So the final results would be
{'000': 5, '001': 3, '010': 10,'011': 0, '100': 5, '101': 7, '110': 7, '111': 4}
Currently when I run this circuit I get an error as I am trying to call res['011'], where res is the list of results. I cannot just increase the number of shots unfortunately I am constrained to this number of qubits.
"
['circuit-construction']," Title: Preparing arbitrary two- and multi-qubit states with real amplitudesBody:
- Is it correct that the following circuit can produce any two-qubit state with real amplitudes? (Meaning that for any set of the four real amplitudes there exists a set of angles...)
- If so, should I generally expect that arbitrary state preparation algorithms (such as this one) can be adapted to preparing real-amplitude states by replacing all the single-qubit rotations with $R_y$'s?
"
"['complexity-theory', 'quantum-advantage', 'probability', 'linear-algebra']"," Title: Dirichlet distribution: posteriors and priors of distributionBody: Let $|\psi\rangle \in \mathbb{C}^{2n}$ be a random quantum state such that $ |\langle z| \psi \rangle|^{2} $ is distributed according to a $\text{Dirichlet}(1, 1, \ldots, 1)$ distribution, for $z \in \{0, 1\}^{n}$.
Let $z_{1}, z_{2}, \ldots, z_{k}$ be $k$ samples from this distribution (not all unique). Choose a $z^{*}$ that appears most frequently.
- I am trying to prove:
$$\underset{|\psi\rangle}{\mathbb{E}}\big[|\langle z^{*}| \psi \rangle|^{2}\big] = \underset{|\psi\rangle}{\mathbb{E}}\bigg[\underset{m}{\mathbb{E}}\big[|\langle z^{*}| \psi \rangle|^{2} ~| ~m\big]\bigg] = \mathbb{E}\bigg[\frac{1+m}{2^{n}+k}\bigg],$$
where $m$ is a random variable that denotes the frequency of $z^{*}$.
- I am also trying to prove that for the collection $z_{1}, z_{2}, \ldots, z_{k}$
$$\sum_{i \neq j}\mathrm{Pr}[z_{i} = z_{j}] = {n \choose k}\frac{2}{2^{n} + 1}. $$
Basically, I am trying to trace the steps of Lemma $13$ (page 10) of this quantum paper. I realize that my questions have to deal with posteriors and priors of the chosen distribution (though I do not understand how they have been explicitly derived or used here. An explicit derivation will be helpful). Is there any resource where I can find quick formulas for calculating these for other distributions, like the Binomial distribution?
"
"['quantum-gate', 'qiskit', 'noise']"," Title: What do the ""gate errors rates"" mean physically for IBM's quantum computers?Body: I wish to simulate the gate errors from IBM's various quantum computers. However I am not sure what the gate error rate physically means. An error rate of say 0.01 for a particular means one in every 100 trials the gate will not return the desired outcome. But if I wish to simulate this myself I need to know what outcome is produced. Is it simply a random outcome? For example if I am implementing a CNOT gate on the state |11>, what happens when the gate fails? What is the state after this?
"
"['measurement', 'quantum-operation', 'density-matrix', 'locc-operation']"," Title: Are perfectly LOCC-indistinguishable states necessarily identical?Body: Let $\rho,\sigma\in\text{L}(\mathcal{H}_{XAB})$ be given by
$$ \rho = \sum_x |x\rangle\langle x|\otimes p_x\rho_x, \quad \sigma = \sum_x |x\rangle\langle x|\otimes q_x\sigma_x, $$
and consider operators $M$ be given by
$$ M = \sum_x |x\rangle\langle x|\otimes M_x, \quad\quad M_x\geq 0, \quad \sum_x M_x = id, $$
that is $\{M_x\}$ is a POVM measurement. Now suppose
$$ \lVert M(\rho-\sigma)\rVert_1 = \sum_x \left|\operatorname{Tr}M_x(p_x\rho_x - q_x\sigma_x)\right| = 0 $$
for all measurement operators $M$ given as above, where $\{M_x\}$ is implementable by LOCC. Do we necessarily have $\rho = \sigma$?
Using $M_x = id/|X|$ yields $p_x = q_x$, and I have shown it is true for $\rho,\sigma$ pure using Schmidt decomposition, so I do believe it should be possible to prove $\rho_x = \sigma_x$ for all $x$, but I have not managed to do so.
Any help is appreciated!
"
"['pauli-gates', 'optimization', 'annealing', 'qaoa']"," Title: Can QAOA be considered as simulation of a quantum annealer on a gate-based quantum computer?Body: Quantum annealers are single purpose machines allowing to solve quadratic unconstrained binary optimization (QUBO) problems. QUBO problems have following objective function:
$$
F=-\sum_{i<j}J_{ij}x_ix_j-\sum_{i=1}^N h_ix_i,
$$
where $x_i$ is a binary varibale and $h_i$ and $J_{ij}$ are coefficients.
Such objective function is equivalent to Ising Hamiltonian
$$
H_{\text{ISING}}=-\sum_{i<j}J_{ij}(\sigma^z_i\otimes\sigma^z_j)-\sum_{i=1}^N h_i\sigma^z_i,
$$
where $\sigma^z_i$ is Pauli Z gate acting on $i$th qubit and there are identity operators on other qubits, tensor product $\sigma^z_i\otimes\sigma^z_j$ means that Z gates act on $i$th and $j$th qubits and there are identity operators on other qubits.
Quantum annealers physically implements simulation of Hamiltonian
$$
H(t)=\Big(1-\frac{t}{T}\Big)\sum_{i=1}^N h_i\sigma^x_i+\frac{t}{T}H_{\text{ISING}},
$$
where $t$ is a time, $T$ total time of simulation and $\sigma^x_i$ is Pauli X gate acting on $i$th qubit.
Initial state of a quantum annealer is equal superposition of all qubits which is ground state of the Hamiltonian $H(0)$.
Quantum Approximate Optimization Algorithm (QAOA) is described by an operator
$$
U(\beta, \gamma) = \prod_{i=1}^{p}U_B(\beta_i)U_C(\gamma_i),
$$
where $p$ is number of iteration of QAOA,
$$
U_B(\beta) = \mathrm{e}^{-i\beta\sum_{i=1}^N \sigma^x_i},
$$
and
$$
U_C(\gamma) = \mathrm{e}^{-i\gamma(\sum_{i,j=1}J_{ij}(\sigma^z_i\otimes\sigma^z_j)+\sum_{i=1}^N h_i\sigma^z_i)}.
$$
Initial state for QAOA is $H^{\otimes n}|0\rangle ^{\otimes n}$, i.e. equally distributed superposition as in case of the quantum annealer.
Since time evolution of quantum system described by Hamiltonian $H$ from state $|\psi(0)\rangle$ to state $|\psi(t)\rangle$ is expressed by
$$
|\psi(t)\rangle = \mathrm{e}^{-iHt}|\psi(0)\rangle,
$$
it seems that operator $U(\beta, \gamma)$ from QAOA is simply simulation of Hamiltonian $H(t)$ describing quantum annealer beacause exponents of $\mathrm{e}$ are sums in Hamiltonian $H(t)$.
However, $H(t)$ is composed of two term containing Pauli matrices X and Z and $\mathrm{e}^{A+B}=\mathrm{e}^A\mathrm{e}^B$ is valid only for commuting matrices $[A,B]=O$. But Pauli matrices X and Z fulfil anti-commutation relation $\{X,Z\}=O$, not the commutation one.
So my questions are these:
- Can QAOA be realy considered as a simulation of quantum annealer on gate-based universal quantum computer?
- What I am missing in discussion above concerning commutation of Pauli matrices? Or is there any condition for matrices $A$ and $B$ allowing equality $\mathrm{e}^{A+B}=\mathrm{e}^A\mathrm{e}^B$?
"
"['qiskit', 'programming', 'hamiltonian-simulation', 'vqe', 'chemistry']"," Title: Why VQE gives an incorrect ground state energy for a chain of 4 hydrogen atoms?Body: I am a bit hesitant to ask this very specific question, as I feel other people need not benefit from it. But since I have struggled for a while, and I think I should get some help.
So I am using VQE in qiskit to calculate the ground sate energy of a chain of hydrogen atoms, but it appears that the result is in-consistent with the result from exact diagonalization. The code works well for other molecules like H2, LiH, so this is confusing. I guess the question boils down to how to set the threshold for the VQE. I have attached the code below, and many thanks for the help!
from qiskit import BasicAer
import logging
from qiskit.chemistry import set_qiskit_chemistry_logging
set_qiskit_chemistry_logging(logging.ERROR)
# chemistry related modules
from qiskit.chemistry import FermionicOperator
from qiskit.chemistry.drivers import PySCFDriver, UnitsType
from qiskit.aqua.algorithms import VQE, NumPyEigensolver
import numpy as np
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.aqua.components.optimizers import L_BFGS_B
from qiskit.aqua.operators import Z2Symmetries
def get_qubit_op(atom,basis,map_type ):
driver = PySCFDriver(atom=atom, unit=UnitsType.ANGSTROM,
charge=0, spin=0, basis=basis)
molecule = driver.run()
num_particles = molecule.num_alpha + molecule.num_beta
num_spin_orbitals = molecule.num_orbitals * 2
ferOp = FermionicOperator(h1=molecule.one_body_integrals, h2=molecule.two_body_integrals)
qubitOp = ferOp.mapping(map_type=map_type, threshold=0.00000001)
qubitOp = Z2Symmetries.two_qubit_reduction(qubitOp, num_particles)
return qubitOp, num_particles, num_spin_orbitals
import timeit
start = timeit.default_timer()
atom = 'H .0 .0 .0; H .0 .0 1.5 ; H .0 .0 3.0 ; H .0 .0 4.5 '
basis='sto3g'
map_type = 'parity'
qubitOp, num_particles, num_spin_orbitals = get_qubit_op(atom,basis,map_type )
print('Ground state energy is' , NumPyEigensolver( qubitOp ).run().eigenvalues )
init_state = HartreeFock( num_spin_orbitals , num_particles , map_type )
# set the backend for the quantum computation=
backend = BasicAer.get_backend('statevector_simulator')
# setup a classical optimizer for VQE
optimizer = L_BFGS_B()
print( init_state.bitstr )
var_form_vqe = UCCSD(
num_orbitals=num_spin_orbitals,
num_particles=num_particles,
initial_state=init_state,
qubit_mapping=map_type
)
algorithm_vqe = VQE(qubitOp, var_form_vqe, optimizer )
result_vqe = algorithm_vqe.run(backend)
print( 'eigenvalue = ' , result_vqe['eigenvalue' ] )
stop = timeit.default_timer()
print('The run time of this part: ', stop - start)
The output is below, and as you can see, they differ quite significantly.
Ground state energy is [-3.52488449+5.88070795e-18j]
[False False True False False True]
eigenvalue = (-3.523526951494827+0j)
The run time of this part: 57.303660957000034
"
"['quantum-gate', 'quantum-state', 'bloch-sphere', 'pauli-gates']"," Title: Benefit of phase shift in quantum computingBody: I am new to quantum computing.
I compare Pauli-X gate and Pauli-Y gate as equivalent to NOT gate in classical computers. Though I am not very sure when to use Pauli-X and Pauli-Y gates as the result only differ in global phase.
As per my understanding phase shift gates (like Pauli-Z gate) doesn't change the amplitude of the qubit but only changes the relative phase of the qubit on the bloch sphere.
I am unable to understand the benefit of phase change (global - like in Pauli-Y and relative - like in Pauli-Z gate) in quantum computer? I assume it is only the amplitude which determines the observed state during measurement of qubit.
"
"['programming', 'ibm-q-experience']"," Title: How can I run a job as offline on real hardware?Body: Can I run circuits on real hardware as offline? I mean that a job with 100 circuits may take a long time and I want to shot down my laptop in running time. In the meantime, can the real hardware run all of the circuits in the job, and in another time I can obtain my results? Or is it necessary my laptop to be turned on till I receive the last result? If I need any code for this issue, I would be very grateful anyone can provide it.
"
"['entanglement', 'superposition', 'qudit', 'qutrit']"," Title: Can a single qutrit in superposition be considered entangled?Body: Often in quantum computing the idea of quantum superposition is introduced well before the concept of entanglement. I suspect this may be because our conception of (classical) computing privileges bits, and hence we also privilege qubits in a Hilbert space of dimension $d=2$. It's easy enough to consider a single qubit in superposition, but transitioning to entanglement requires a plurality of such particles.
Or does it?
For example, suppose we lived in a world that privileged qudits, with $d=4$; e.g. four-level quantum systems as opposed to two-level qubits. We can think of our system (say, a particle-in-a-box or a harmonic-oscillator or what-have-you); our qudit could be in any superposition of $\{\vert 0\rangle,\vert 1\rangle,\vert 2\rangle,\vert 3\rangle\}$.
We can think of a particle in a superposition of $\vert \Psi\rangle=\frac{1}{\sqrt{2}}\vert 0\rangle\pm\vert 3\rangle$, or $\vert\Phi\rangle=\frac{1}{\sqrt{2}}\vert 1\rangle\pm\vert 2\rangle$.
Now if we envision our (single) qudit instead as two virtual qubits, with a mapping/isomorphism such as:
$$\vert 0\rangle_{qudit}=\vert 00\rangle_{qubit}$$
$$\vert 1\rangle_{qudit}=\vert 01\rangle_{qubit}$$
$$\vert 2\rangle_{qudit}=\vert 10\rangle_{qubit}$$
$$\vert 3\rangle_{qudit}=\vert 11\rangle_{qubit},$$
then we can see that both $\vert \Psi\rangle$ and $\vert \Phi\rangle$ are the Bell states, e.g. are entangled.
This works nicely for $d=4$ or any other power of $2$. But would it work for any other dimension, such as $d=3$?
Can we decompose a qutrit that is in superposition into smaller components, and ask whether the qutrit thusly is in some sense entangled?
"
"['quantum-state', 'fidelity', 'information-theory']"," Title: The proof of monotonicity of fidelity for channels and its meaningBody: I have two questions regarding the exercise 9.2.8 of Quantum information by Wilde, which is as follows:
Let $\rho,\sigma \in \mathcal{D}(\mathcal{H}_A)$ and let $\mathcal{N: L(H}_A)\rightarrow \mathcal{L(H}_B)$ be a quantum channel. Show that the fidelity is monotone w.r.t. the channel $\mathcal{N}$:
$$F(\rho,\sigma)\leq F(\mathcal{N}(\rho),\mathcal{N}(\sigma))$$
- The first question is how to prove this inequality. So my approach was to use the Uhlmann theorem by defining a purification of the states and using $\max_{U} <\phi^\rho|_{RA}(U_R\otimes I_A)|\phi^\sigma> $ and compare it with the same for the output of channel. But the problem is I don't know how to decompose the purification of the channel $\mathcal{N}(\rho)$. Even if using the canonical purification, it needs the square root of $\mathcal{N}(\rho)$ which I don't know how to obtain.
- The second question is about the meaning of this theorem. It actually seems counter-intuitive to me. Because, as I expect it, the channel is a form of noise-increasing operation on the states. So if two density operators go through a channel, their fidelity must have reduced due to the random noise that has been added to them. Not increased! Can you explain it for me?
Thanks a lot. I appreciate any help or comment.
"
"['qiskit', 'programming', 'random-quantum-circuit', 'randomised-benchmarking']"," Title: What is the Clifford gates selection probability distribution used in the generation of randomized benchmarking circuits?Body: I've read that in standard randomized benchmarking implementations the random quantum circuits are generated through random gate selection from a uniformly distributed Clifford set of either 1 or 2-qubit gates i.e. {H, X, Y, Z, S, T} and {iSWAP, CZ}, however the circuits generated using randomized_benchmarking_seq do not seem to follow this for the following reasons:
- Random circuits do NOT contain T, iSWAP and CZ gates
- Random circuits do contain CX gates
- There does not appear to be a uniform distribution in gate selection, for example gates H and S gates appear more frequently than X, Y, Z and CX gates
Is this observation correct? and if so what is the actual distribution for randomized_benchmarking_seq? and how can uniformly distributed random circuits be generated?
"
"['qiskit', 'programming']"," Title: Qiskit transpile with different set of basis gatesBody: I want to use the Qiskit transpile function to decompose an arbitrary unitary matrix/ quantum circuit into a special kind of basis gates.
(from qiskit.compiler import transpile)
But for me it seems the only accepted basis gates are 'u1', 'u2', 'u3' and 'cx'.
Is there a way to use for example 'rx', 'ry' and 'cx' as basis gates instead of 'u1', 'u2', 'u3' and 'cx'?
The following error
Exception has occurred: QiskitError
"Cannot unroll the circuit to the given basis, ['id', 'ry', 'rx', 'cx']. No rule to expand instruction h."
for example is obtained from the code:
from qiskit.quantum_info import Operator
from qiskit.compiler import transpile
import matplotlib.pyplot as plt
from qiskit.compiler.transpile import CouplingMap
coupling_string = [[0, 1], [0,2], [1,2]]
CM = CouplingMap(coupling_string)
qc = QuantumCircuit(3)
qc.h(0)
qc.h(1)
qc.h(2)
result = transpile(qc, coupling_map=CM, basis_gates=['id', 'ry', 'rx', 'cx'], optimization_level=1, seed_transpiler=1)
result.draw(output='mpl')
plt.show()
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: How does a projective measurement distinguish between two states in a $d$-dimensional Hilbert space?Body: Let $\mathcal{H}$ be a $d$ -dimensional Hilbert space, and let $|\psi\rangle,|\phi\rangle \in \mathcal{H}$ be two quantum states.
- Show that if $|\psi\rangle$ and $|\phi\rangle$ are orthogonal, then there exists a projective measurement that distinguishes them. That is, there exists a two-outcome projective measurement $\left\{P_{0}, P_{1}\right\}$ such that
$$
p_{\psi}\left(P_{0}\right)=1 \quad \text { and } \quad p_{\phi}\left(P_{1}\right)=1
$$
- Show that if $|\psi\rangle$ and $|\phi\rangle$ are not orthogonal, then there is no projective measurement that distinguishes them.
Attemps:
I form a general Projective operator an two General states, I tried it for a $2*2$ dimension and then I was wondering why do we say that $|\psi\rangle$ and $|\phi\rangle$ should be orthogonal?
"
"['mathematics', 'textbook-and-exercises', 'matrix-representation']"," Title: How are the Pauli $X$ and $Z$ matrices expressed in bra-ket notation?Body: For example:
$$\rm{X=\sigma_x=NOT=|0\rangle\langle 1|+|1\rangle\langle 0|=\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}}$$
$$\rm{Z=\sigma_Z=signflip=|0\rangle\langle 0|-|1\rangle\langle 1|=\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}}$$
I do no understand how the matrix can be expressed in bra-ket and the way around. I could not find any good teachings on this.
"
"['mathematics', 'hadamard']"," Title: How do I apply the Hadamard gate to one qubit in a two-qubit pure state?Body: So in lectures I see lots of these:
And somehow I intuitively understand it (at least for the 1 qubit case), but I don't understand the math – especially for 2 qubits.
"
['qiskit']," Title: Solving Poisson's equation with Quantum Fourier TransformBody: I found Quantum Fourier Transform in the Qiskit textbook, but I'm looking specifically for how to solve Poisson's equation with the Quantum Fourier transform.
Are there any references that talk about how to do this?
"
"['entanglement', 'matrix-representation']"," Title: How does a $d\times\ell$ matrix of rank $\ell$ and with singular values all equal to 1 imply it is maximally entangledBody: From this question, gls states that given $\Pi\equiv\sum_i |\eta_i\rangle\!\langle i|$ and $\Psi\equiv\sum_i|\psi_i\rangle\!\langle i|$, if $\Pi^\dagger\Psi=I_{d\times\ell}$, then $\Psi$ is "maximally entangled", ie has rank $\ell$ and all singular values are equal to 1. By maximal entanglement, what does that mean exactly, in the context used for matrices here? Is it referring to the inability to decompose it to a product of matrices on subsystems, or something else? Because if I recall correctly, CNOT, which is non-decomposable, doesn't have 1 for all it's singular values, yet it fits the criteria of non-decomposable, but then wouldn't be maximally entangled?
Edit: I am assuming "maximally entangled" means in this context it is diagonal up to a certain dimension $\ell$
"
['q#']," Title: How to get circuit run time in Q#Body: What is the best way to get the circuit run time in Q# ?
More precisely, I run a circuit using dotnet -run command and I would like to know how many time it took for running my circuit. Actually I compute the delay between the moment I start the command and the return, but I suppose it includes building time, I really just need the circuit running time.
Thank you.
Best regards.
"
['simulation']," Title: How is a quantum simulator able to simulate a quantum mechanical properties on a classical computer?Body: I'm confused as to how a classical computer can simulate quantum mechanical properties through the use of classical bits. Why do we need quantum computers if a quantum simulator can do it's job on a classical computer?
"
"['qiskit', 'programming', 'ibm-q-experience', 'vqe', 'qaoa']"," Title: An effective way to submit all the jobs for VQE/QAOA at a time to an IBMQ machine?Body: In Qiskit, I am solving a VRP for 5 nodes and it creates 20 variables for a QUBO. It runs in a 65 qubit machines (any machine below that many fails). Now, in such a typical solvers for optimization (VQE, QAOA etc.) more than 100 circuits are run in a machine. With max_evals we can run a bunch of these in the IBMQ machines to gain on wait time. I am wondering if there is pros/cons of using 1 circuit at a time or max_evals set to max_iter or is there a thumb-rule to select the optimum max_evals? One pro is obviously we can avoid the wait-time in queue. But is there any other cons?
Also, what is the most effective way to run such a QUBO, so that all the jobs cann be submitted at a time to the machine, so that there is no wait time?
"
"['qiskit', 'programming']"," Title: How to set 'max_parallel_threads', 'max_parallel_experiments' for BACKEND_OPTIONS in QuantumInstanceBody: In QuantumInstance there are max_parallel_threads, max_parallel_experiments in BACKEND_OPTIONS - Wondering whether the backend I am using supports parallel-threads or experiments and how to use this features? How do I find out whether my backend supports this?
"
"['quantum-gate', 'quantum-state']"," Title: Mathematical CNOT interpretationBody: I used to think that CNOT flips amplitudes of the target qubit with the chance of $b^2$ where $b$ is the $|1\rangle$ amplitude of the control qubit. This yields that the final(after CNOT) state of the target qubit will be :
$$
\sqrt{a_1^2 a_2^2 + b_1^2 b_2^2} \big|0 \big\rangle + \sqrt{a_1^2 b_2^2 + b_1^2 a_2^2} \big|1 \big\rangle
$$
(the intuition is that with probability $a^2$ there is no flip, and with probability $b^2$ flip occurs)
But in fact, after two sequential applies of such a formula on the target qubit, such a qubit will not end up at the initial state. So either the upper interpretation is wrong or I've blundered the math somewhere.
If my interpretation is incorrect, could you please provide a correct one? If it is correct, help me please to derive it in probability terms and to understand how CNOT unitary matrix makes it work.
"
"['quantum-state', 'textbook-and-exercises']"," Title: What is a basis (not necessarily orthogonal) of Herm(A) consisting of pure density matrices in D(A)?($A \cong \mathbb{C}^{n}$)Body: Let $A \cong \mathbb{C}^{n}$ be a Hilbert space $A,$ and let $\operatorname{Herm}(A)$ be the Hilbert space consisting of all Hermitian matrices on $A$. Give an example of a basis (not necessarily orthogonal) of Herm (A) consisting of pure density matrices in $\mathfrak{D}(A)$.
$\mathbf A\mathbf t\mathbf t\mathbf e\mathbf m\mathbf p\mathbf t$:
I Started with the case $n=2$ and considered the vectors $|0\rangle,|1\rangle,|+\rangle$ and $|+i\rangle$ , Because I think $\left|0\right\rangle\left\langle 0\right|$, $\left|1\right\rangle\left\langle 1\right|$, $\left|+\right\rangle\left\langle +\right|$, and $\left|+i\right\rangle\left\langle +i\right|$ are a non-orthogonal basis and all of them are pure density matrices. And as you know,
$|+\rangle=\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$
$|+i\rangle=\frac{1}{\sqrt{2}}(|0\rangle+i|1\rangle)$.
But my question is how can I prove or show that they are form a basis for $\operatorname{Herm}(A)$, in this case $A \cong \mathbb{C}^{2}$ and how can I expand it to $A \cong \mathbb{C}^{n}$? I mean how can I determine a basis for $A \cong \mathbb{C}^{n}$ which are pure density matrices and how can I show that it is a basis?
"
"['measurement', 'hamiltonian-simulation', 'povm']"," Title: How do I efficiently implement a POVM using a fixed universal gate set and the ability to measure in the standard basis?Body: Let's say I am given a Hamiltonian
\begin{equation}
H = \sum_{i = 1}^{m} H_{i},
\end{equation}
where $H$ acts on $n$-qubits, and each $H_{i}$ acts non-trivially on at most $k$ qubits. The eigenvalues of $H$ are between $0$ and $1$. As can be seen, $H$ is a $k$-local Hamiltonian. Now, let's say I am given any quantum state $|\psi\rangle$ over $n$ qubits. I want to implement the POVM
\begin{equation}
\{H_{i}, \mathbb{1} - H_{i}\}.
\end{equation}
- How do I implement this POVM using a fixed universal gate set and the ability to measure in the standard basis? What is the unitary that I have to apply before measuring in the standard basis and how much error can I tolerate?
- What is the guarantee this implementation is efficient?
- Is there any rule regarding when implementing such POVMs is efficient?
"
"['algorithm', 'speedup', 'quantum-advantage']"," Title: How do quantum bits increase computational power?Body: I'm new to quantum computing, I'm learning how to use Qiskit. I'm trying to understand better how exactly the quantum characteristics of quantum computer help to increase its computational power. I thought about the following example: If I'm writing a backtracking algorithm, writing this algorithm using quantum algorithms on a quantum computer allows me to check many paths in parallel, instead of checking all the possibilities in a row as would happen on classical computer. Is it correct to say that?
"
"['qiskit', 'programming']"," Title: Using the qiskit_textbook PackageBody: I've installed the qiskit_textbook package in Anaconda on Windows 10 using
pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src
based on the instructions at https://qiskit.org/textbook/ch-prerequisites/setting-the-environment.html .
But I don't see any jupyter notebooks to open. How do you begin working with the qiskit tutorial notebooks? Thanks for any guidance.
"
"['programming', 'vqe', 'optimization', 'qaoa']"," Title: QUBO, Ising Hamiltonians and VQABody: I understand that usually the combinatorial optimisation problems are turned into QUBO, which has a very simple mapping to Ising Hamiltonians. Ising Hamiltonians in turn have the desired properties of being diagonal in computational basis and the ground state is one of the computational basis vectors. It is thus easy to measure the state in the computational basis and obtain the bit string solution.
The problem is that Ising Hamiltonian and QUBO are quadratic in its terms and allows at most 2 body interactions. I recently came across a paper about integer factoring expressed as optimization problem (Quantum factorization of 56153 with only 4 qubits), where the cost function is a third degree polynomial. I was able to reduce this to 2 body interactions and thus make the problem QUBO, map it to Ising Hamiltonian and solve it on IBM machines using QAOA. However, this conversion between polynomial of degree 3 to degree 2 costs me extra qubits.
What is then the general approach when you have 3/4 body interactions, for example as in this paper I linked? The authors of this, as well as the authors of previous works they cite, are not concerned with the fact that this is not QUBO. Are there alternatives to Ising Hamiltonians and QUBOs in such cases? Is it correct that we could use any form of Hamiltonian (not necessarily Ising) for QAOA/VQE as long as it is decomposable into tensor products of Pauli Z operators (which makes it diagonal in computational basis)?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: In amplitude amplification, isn't the speedup hindered by the realization of $S_o$?Body: In brassard et al. Amplitude Amplification work, they define the Q operator as
$$\mathbf{Q} = -AS_{o}A^{-1}S_{\chi}$$
where $S_{o}$ is an operator which flips the sign of the $|0 \rangle$ state.
Which is basically a diagonal unitary matrix (in the computational basis) with -1 on the first diagonal element.
I was wondering, isn't Quantum amplification's quantum speedup hindered by the realization of $S_o$ when the number of qubits in the circuit is too big? Based on Barenco's et al work (Elementary gates for quantum computation), isn´t the number of gates required for a $n$-qubit controlled gate exponential in $n$?
"
"['shors-algorithm', 'phase-estimation', 'phase-kickback']"," Title: In Shor's algorithm, how can we guarantee that each controlled-U will kickback to the same eigenvalue?Body: I'm studying the Shor algorithm as part of my thesis and have a question about the "measured" phases after the QPE.
So, I take the controlled-U operations on the second register and in cause of phase kickback the relative phase of the controll qubit in register one will change with a multiple of the eigenvalue of $U$. I understand, that $cU$ has multiple eigenvalues with a factor $s$. How can be guaranteed that each of the controlled-Us will kickback the same eigenvalue? Or, why it is not important?
Second, if I run the controlled-U operations and make the QPE, why it is possible to get different results? I thought that the transformation between the bases is unique. So, if my controlled-U makes a specific "change" on the quibit, how it is possible that the QPE generates a superposition with specific probabilities? (e.g. in Nielsen/Chuang Box 5.4 the final measurement will give 0, 512, 1024, 1536)
Thank you for your help.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: Prove that different purifications of a state can be mapped into one another via local unitariesBody: Let $\rho \in \mathfrak{D}(A)$ be a density matrix.
Show that $\left|\psi^{A B}\right\rangle \in A B$ and $\left|\phi^{A C}\right\rangle \in A C$ (assuming $\left.|B| \leqslant|C|\right)$ are two purifications of $\rho \in \mathfrak{D}(A)$ if and only if there exists an isometry matrix $V: B \rightarrow C$ such that
$$
\left|\phi^{A C}\right\rangle=I^{A} \otimes V^{B \rightarrow C}\left|\psi^{A B}\right\rangle
$$
$\mathbf{attempt}$:
I first prove $\rightarrow$ side of this theorem. So I assume that $\left|\psi^{A B}\right\rangle \in A B$ and $\left|\phi^{A C}\right\rangle \in A C$ (assuming $\left.|B| \leqslant|C|\right)$ are two purifications of $\rho \in \mathfrak{D}(A)$. We can write $\left|\psi^{A B}\right\rangle $ and $\left|\phi^{A C}\right\rangle $ as follows
\begin{equation}
\begin{aligned}
&|\psi\rangle^{A B}=\sum_{x=1}^{|A|}|x\rangle^{A}\left(\sum_{y=1}^{|B|} m_{x y}|y\rangle^{B}\right)\\
&|\psi\rangle^{A C}=\sum_{z=1}^{|A|}|z\rangle^{A}\left(\sum_{w=1}^{|C|} m^{\prime}_{z w}|w\rangle^{C}\right)
\end{aligned}
\end{equation}
So then we can right them as follows
\begin{equation}
\begin{aligned}
&|\psi\rangle^{A B}=I \otimes M\left|\phi_{+}^{A \tilde{A}}\right\rangle\\
&|\psi\rangle^{A C}=I \otimes M^{\prime}\left|\phi_{+}^{A \tilde{A}}\right\rangle\\
\end{aligned}
\end{equation}
Which $M: H^{\tilde{A}} \rightarrow H^{B}$ and $M^{\prime}: H^{\tilde{A}} \rightarrow H^{C}$ and
\begin{equation}
\begin{aligned}
&M|x\rangle^{\tilde{A}}:=\sum_{y=1}^{|B|} m_{xy}|y\rangle^{B} \quad and \quad M^{\prime}|z\rangle^{\tilde{A}}:=\sum_{w=1}^{|c|} m^{\prime}_{zw}|y\rangle^{C} \\
&\left|\phi_{+}^{\tilde{A} A}\right\rangle:=\sum_{x=1}^{|A|} |xx\rangle^{\tilde{A} A}\\
\end{aligned}
\end{equation}
Now we want $|\psi\rangle^{A B}$ and $|\psi\rangle^{A c}$ to be purification of $\rho \in \mathfrak{D}(A)$. So according to the definition, we should have
\begin{equation}
\begin{aligned}
&\psi^{A}=MM^{*}=M^{\prime}(M^{\prime})^{*}=\rho \\
\end{aligned}
\end{equation}
And we assume $M^{\prime}=VM$, So
So we can write
\begin{equation}
\begin{aligned}
&M^{\prime}(M^{\prime})^{*}=VMM^{*}V^{*}=V\rho V^{*}
\end{aligned}
\end{equation}
Now, what should I do? Is my procedure correct?
$\mathbf{Note}$:
We know that $\left|\phi^{A B}\right\rangle=I^{A} \otimes M \left|\Phi^{A \tilde{A}}\right\rangle$ is called a purification of $\rho$ if reduced density matrix $\psi^A$
\begin{equation}
\begin{aligned}
&\psi^A := M M^* \in Pos(A)
\end{aligned}
\end{equation}
is equal to our density matrix $\rho$. And
\begin{equation}
\begin{aligned}
&\left|\phi_{+}^{\tilde{A} A}\right\rangle:=\sum_{x=1}^{|A|} |xx\rangle^{\tilde{A} A}
\end{aligned}
\end{equation}
at the end I should mention that $\tilde{A}$ is the same as $A$.
"
"['qiskit', 'programming', 'ibm-q-experience', 'measurement']"," Title: Difference in length of RNG implementation using same circuit structure but different sizesBody:
def random_bitstring_generator(bit_number, backend):
"""
Generate a bitstring with one qubit
:param bit_number: number of bits that we want to generate
:param backend: Qiskit hardware or simulator
:return: string object with random bits
"""
bitstring = ""
one_qubit_random_bit_generator_circuit = QuantumCircuit(1,1)
one_qubit_random_bit_generator_circuit.h(0)
one_qubit_random_bit_generator_circuit.measure(0,0)
for _ in range(bit_number):
counts = execute(one_qubit_random_bit_generator_circuit, backend, shots=1000).result().get_counts()
bit = list(counts.keys())[0] # we have only one key because shots=1
bitstring += bit
return bitstring
backend = BasicAer.get_backend('qasm_simulator')
print(random_bitstring_generator(512, backend))
Executed the above code for QRNG using 1 qubit and received a 512 bit sequence
Executing the same circuit for 3 qubit code as given in image received an output of increased length as shown in image
Also how can i change the backend from qasm_simulator to vigo/melbourne/any other quantum machine
"
"['programming', 'q#', 'hamiltonian-simulation', 'optimization', 'qaoa']"," Title: How to solve QUBO problems in Q#?Body: Short version:
I'm trying to solve a traveling salesman problem very similar to the traveling Santa example here: http://quantumalgorithmzoo.org/traveling_santa/, which is also included in the samples of the Microsoft Quantum samples here: https://github.com/microsoft/Quantum/tree/main/samples/simulation.
In that example, they assume some parameters beta and gamma that yield favorable odds of finding the optimal route. The problem is: how do you get these parameters? But a more general question that I have is: How would you solve a QUBO problem (with a Hamiltonian of the form
$H = -\sum_i h_i \sigma_i^z -\sum_{i,j} J_{i,j} \sigma_i^z \sigma_j^z$) in qsharp?
What I've tried:
- Building upon the QAOA sample, the first thing I did was cheat: I used a classical optimizer to solve for optimal values for beta and gamma, minimizing the energy. And I calculated the energy by dumping the quantum registry to a file. With the probabilities for each state, the estimated value for the energy is simply $\sum_{states} p_{state} E_{state}$.
- Of course, on Azure Quantum / on real quantum hardware you don't have access to the probabilities. So I tried to find ways to get precise estimates of the energy. This is where I'm struggling given the samples and documentation. I have a registry of qubits and a Hamiltonian equation that I would like to plug in, but the EstimateEnergy function in Q# either takes
JordanWignerEncodingData or a statePrepUnitary and qpeUnitary. In both cases I don't really understand how I would construct them and what they do/why I need them. Efforts to estimate the energy from the phase estimation failed, but that might be due to my lack of understanding. If this is indeed a good way to solve optimization problems, are there any good resources to understand this better?
- The final thing I tried was the principal of slowly changing the Hamiltonian from one that has an easy to prepare groundstate, to the Hamiltonian corresponding to the optimization problem you want to solve. The example and explanation are here: https://github.com/microsoft/Quantum/blob/main/samples/simulation/ising/adiabatic/AdiabaticIsing.qs#L14. Unfortunately, I seem to get stuck in different local minima depending on the rate, and none of them actually come close to the real solution. So I found this method to be not very reliable either.
I understand the question is very similar to this one, but even after reading the answer there, I'm still not sure if what I'm trying makes sense, and how to make it work in Q#. So I am hoping for more concrete answer, or literature suited for developers who followed a quantum physics course many many years ago.
"
"['mathematics', 'shors-algorithm']"," Title: Problem with Shor's factoring algorithmBody: I'm trying to figure out the Shor's factoring algorithm. References i've been using wikipedia page, the book Quantum Computer Science by David Mermin and the orignal paper(1996) By Peter Shor. I understand the basics of this algorithm, but wanted to know the details about the math working behind it. Now While reading through the paper i was unable to understand few things, they are:-
- In page 17, the probability[equation 5.7 & 5.8] was changed from summation to integral by introducing a error term in big-O notation and stating that $\{rc\}_q$ is small enough. Now my question is how it is done? I know that O(.) can be used to quantify algorithmic complexities.
$$ \Biggl|\frac{1}{q} \sum_{b=0}^{\left \lfloor \frac{ q-k-1}{r}\right \rfloor}\exp{(2i\pi b \{rc\}_q/q})\Biggr|^2$$
$$ \frac{1}{q} \int_0^{\left \lfloor \frac{ q-k-1}{r}\right \rfloor} \exp{(2i\pi b \{rc\}_q/q})db + O\Biggl(\frac{\left \lfloor \frac{ q-k-1}{r}\right \rfloor}{q}(\exp{(2i\pi b \{rc\}_q/q})-1) \Biggr)$$
Also it said
If $|\{rc\}_q| ≤ \frac{r}{2}$, the error term in the above expression
is easily seen to be bounded by O(1/q).
I could not understand how the above statement is true?
this probability is thus asymptotically bounded below by $\frac{4}{\pi^2r^2}$, and so is at least $\frac{1}{3r^2}$
for sufficiently large n.
I get the $\frac{4}{\pi^2r^2}$ part and how it is coming into picture, but what i dont get is $\frac{1}{3r^2}$,
How it is at least $\frac{1}{3r^2}$ for large n?
- Also i was wondering if it is possible to get the condition $|\frac{c}{q} - \frac{d}{r}| \le \frac{1}{2q}$ from the probability calculated from the actual summation that is
$$P(c) = \frac{1}{q^2} \frac{\sin^2{(\frac{\pi mrc}{q})}}{\sin^2{(\frac{\pi rc}{q})}}$$ Where $m\approx \frac{Q}{r}$.
It would be really helpful if anybody can help me clear my doubts. Thanks in advance!!
"
"['qiskit', 'programming']"," Title: I don't get anything when calling circuit.draw()Body: I'm following the YouTube tutorials for Programming on Quantum Computers and I've completed everything until I reach circuit.draw() since I don't get $|0\rangle$ or 0 next to q or c. Here's my code:
from qiskit import *
qr = QuantumRegister(2)
cr = ClassicalRegister(2)
circuit = QuantumCircuit(qr, cr)
%matplotlib inline
circuit.draw()
[
q0_0:
q0_1:
c0: 2/
]
and so when I attempt an H gate, I receive the error 'QuantumRegister' object is not callable:
circuit.h(qr(0))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-55-c8b4318b743b> in <module>
----> 1 circuit.h(qr(0))
TypeError: 'QuantumRegister' object is not callable
"
"['qiskit', 'programming', 'ibm-q-experience', 'hhl-algorithm']"," Title: Error when running HHL algorithm in QiskitBody: I tried to solve a simple system of two simultaneous linear equations in with HHL algorithm in Qiskit. In particular the system is $Ax=b$, where
$$
A = \begin{pmatrix}
1.5 & 0.5 \\
0.5 & 1.5
\end{pmatrix}
$$
and
$$
b = \begin{pmatrix}
0.9010 \\
-0.4339
\end{pmatrix}
$$
The matrix $A$ is Hermitian, so HHL should cope with it without any problems.
I wrote following code
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
import numpy as np
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
#HHL in Qiskit
from qiskit.aqua.algorithms import HHL
matrix_A = np.array([[1.5, 0.5],[0.5, 1.5]])
vector_b = [0.9010, -0.4339]
#x = [0.8184, -0.5747] #expected result
backend = Aer.get_backend('statevector_simulator')
#num_q – Number of qubits required for the matrix Operator instance
#num_a – Number of ancillary qubits for Eigenvalues instance
hhlObject = HHL(matrix = matrix_A, vector = vector_b, quantum_instance = backend, num_q = 2, num_a = 1)
res = hhlObject.run(quantum_instance = backend)
print(res)
However, this error occured
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-071684a21c97> in <module>
9 hhlObject = HHL(matrix = matrix_A, vector = vector_b, quantum_instance = backend, num_q = 2, num_a = 1)
10
---> 11 res = hhlObject.run(quantum_instance = backend)
12 print(res)
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py in run(self, quantum_instance, **kwargs)
68 self.quantum_instance = quantum_instance
69
---> 70 return self._run()
71
72 @abstractmethod
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in _run(self)
399 def _run(self):
400 if self._quantum_instance.is_statevector:
--> 401 self.construct_circuit(measurement=False)
402 self._statevector_simulation()
403 else:
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in construct_circuit(self, measurement)
204
205 # InitialState
--> 206 qc += self._init_state.construct_circuit("circuit", q)
207
208 # EigenvalueEstimation (QPE)
AttributeError: 'NoneType' object has no attribute 'construct_circuit'
I also tried to run construct_circuit method before run method, however, same error was returned.
Could you please tell me how to set parameters of HHL algorithm to run it correctly?
"
"['programming', 'ibm-q-experience']"," Title: Long running time at jobBody: I try to launch QSVM algorithm (from Qiskit example ) on all real quantum devices (that is IBM Q) and get running time 5-30 seconds on one job. But if I use ibmq_qasm_simulator, I get 5-20 ms (not always) on one job. I want to show comparison of time by QSVM and SVM for Big Data and I must use only real quantum devices (for QSVM). My friend did similar work and he got little running time on quantum device (ibmq_16_melbourne) in september (but It doesn't work today - the same longrunning time). What is changed?
"
"['programming', 'quantum-gate', 'qiskit', 'ibm-q-experience', 'stabilizer-code']"," Title: Syndrome showing unexpected results for the [5,1,3] QEC code in qiskitBody: I have used the encoding procedure mentioned on page 35 of https://arxiv.org/pdf/quant-ph/9705052.pdf for the [5,1,3] code and then built the circuit for measuring the stabilizers (XZZXI, IXZZX, XIXZZ, ZXIXZ). I have used the respective Hadamard transformations to convert the X measurements to the Z measurements and by connecting it with the ancilla qubits through the respective gates I constructed the circuit to measure the syndrome. But instead of showing '0000' as the syndrome(since I have included no errors), it is showing results like,
{'1111 00000': 628, '1011 00000': 659, '0100 00000': 616, '1001 00000': 626, '0000 00000': 648, '1101 00000': 653, '0001 00000': 657, '1010 00000': 641, '0011 00000': 598, '0101 00000': 624, '0010 00000': 649, '0110 00000': 601, '1100 00000': 643, '0111 00000': 694, '1110 00000': 637, '1000 00000': 666}
where the first four qubits are the ancilla qubits. To make matters simple I have used the encoded state directly(so that there is no fault in encoding). Could there be a problem in the syndrome measurement circuit or it has something to do with the way qiskit's qasm_simulator?
I have attached my code below,
from qiskit import *
import numpy as np
from sympy.physics.quantum.tensorproduct import TensorProduct
es=list(range(0,32))
import math
a=1/math.sqrt(2)
es[0]=es[18]=es[9]=es[20]=es[10]=a/4
es[27]=es[6]=es[24]=es[29]=es[3]=es[30]=es[15]=es[17]=es[12]=es[23]=-a/4
es[5]=a/4
b=1/math.sqrt(2)
es[31]=es[13]=es[22]=es[11]=es[21]=b/4
es[4]=es[25]=es[7]=es[2]=es[28]=es[1]=es[16]=es[14]=es[19]=es[8]=-b/4
es[26]=b/4
ph_qr=QuantumRegister(5,"physical_qubits")
ph_cr=ClassicalRegister(5,"measured_physical_bits")
an_qr=QuantumRegister(4,"ancilla_qubits")
an_cr=ClassicalRegister(4,"measured_ancilla_bits")
syndrome=QuantumCircuit(ph_qr, an_qr, ph_cr, an_cr)
syndrome.initialize(es, ph_qr)
syndrome_nf=syndrome.copy()
syndrome_nf.h(ph_qr[2])
syndrome_nf.h(ph_qr[3])
syndrome_nf.h(an_qr[0])
syndrome_nf.h(an_qr[1])
syndrome_nf.h(an_qr[2])
syndrome_nf.h(an_qr[3])
syndrome_nf.cz(ph_qr[4], an_qr[0])
syndrome_nf.cz(ph_qr[3], an_qr[0])
syndrome_nf.h(ph_qr[3])
syndrome_nf.cz(ph_qr[2], an_qr[0])
syndrome_nf.h(ph_qr[2])
syndrome_nf.cz(ph_qr[1], an_qr[0])
syndrome_nf.h(ph_qr[4])
syndrome_nf.cz(ph_qr[4], an_qr[1])
syndrome_nf.h(ph_qr[4])
syndrome_nf.h(ph_qr[3])
syndrome_nf.cz(ph_qr[3], an_qr[1])
syndrome_nf.h(ph_qr[3])
syndrome_nf.cz(ph_qr[2], an_qr[1])
syndrome_nf.cz(ph_qr[0], an_qr[1])
syndrome_nf.h(ph_qr[4])
syndrome_nf.cz(ph_qr[4], an_qr[2])
syndrome_nf.h(ph_qr[4])
syndrome_nf.cz(ph_qr[3], an_qr[2])
syndrome_nf.cz(ph_qr[1], an_qr[2])
syndrome_nf.h(ph_qr[0])
syndrome_nf.cz(ph_qr[0] ,an_qr[2])
syndrome_nf.cz(ph_qr[4], an_qr[3])
syndrome_nf.cz(ph_qr[2], an_qr[3])
syndrome_nf.h(ph_qr[1])
syndrome_nf.cz(ph_qr[1], an_qr[3])
syndrome_nf.h(ph_qr[1])
syndrome_nf.cz(ph_qr[0], an_qr[3])
syndrome_nf.h(ph_qr[0])
syndrome_nf.h(an_qr[0])
syndrome_nf.h(an_qr[1])
syndrome_nf.h(an_qr[2])
syndrome_nf.h(an_qr[3])
syndrome_nf.draw()
syndrome_nf.measure(an_qr, an_cr)
simulator=qiskit.Aer.get_backend('qasm_simulator')
result=execute(syndrome_nf, backend=simulator, shots=10240).result()
count=result.get_counts()
print(count)
"
"['measurement', 'entropy']"," Title: Conditional Time Evolution increases entropy?Body: Question
Does the below calculation conclusively show the idea of conditional time evolution (if state measured is $x$ I do $y$ else I do $z$ ) increases the Von Neumann entropy? Has this already been established in the literature?
Calculation
Let's say I have an isolated system containing a measuring apparatus, an experimenter and a Hamiltonian system:
Let the Hamiltonian be:
$$ H_{sys}= H = \begin{pmatrix}
E_0 + \mu \cdot E & - \Delta \\
- \Delta & E_0 - \mu \cdot E
\end{pmatrix}$$
where $\mu$ is the dipole moment , $E$ is the electric field and $E_0$ is the ground state energy and $\Delta$ is the tunnelling element.
Let the energy eigenstates be represented by:
$$ H | - \rangle = (E_0 - \sqrt{(\mu \cdot E)^2 + \Delta^2 }) | - \rangle $$
$$ H | + \rangle = (E_0 + \sqrt{(\mu \cdot E)^2 + \Delta^2 }) | + \rangle $$
Now, the experimenter play the following game, if he measures the energy and finds the energy in the lower of the $2$ energy states he will double the electric field else he will half the electric field. Hence,
$$ H'(\pm) = H + \lambda_{\pm} I(\mu \cdot E) $$
where $I$ is the identity matrix and $ \lambda_+ = - 1/2$ and $\lambda_- = 1$
Let the energy eigenstates of $H'(\pm)$ be represented by:
$$ H' (-) | 0 \rangle = (E_0 - \sqrt{(1+ \lambda_{-})^2(\mu \cdot E)^2 + \Delta^2 }) | 0 \rangle $$
$$ H' (-) | 1 \rangle = (E_0 + \sqrt{(1+ \lambda_{-})^2(\mu \cdot E)^2 + \Delta^2 }) | 1 \rangle $$
$$ H' (+) | \tilde 0 \rangle = (E_0- \sqrt{(1+ \lambda_{+})^2(\mu \cdot E)^2 + \Delta^2 }) | \tilde 0 \rangle $$
$$ H' (+) | \tilde 1 \rangle = (E_0 + \sqrt{(1+ \lambda_{+})^2(\mu \cdot E)^2 + \Delta^2 }) | \tilde 1 \rangle $$
Let use the density matrix formalism for a pure state $|+\rangle + |- \rangle $:
$$ \rho = \frac{1}{2} \Big (|- \rangle \langle -| + |- \rangle \langle +| + |+ \rangle \langle -| + |+ \rangle \langle +| \Big) $$
OR:
$$
\rho = \frac{1}{2}
\begin{bmatrix}
1 & 1 \\
1 & 1 \\
\end{bmatrix}
$$
Now lets say I measure the state and find it in $|- \rangle$ and the field is changed. Then using the sudden approximation:
$$ \rho' (-) = \Big (|0 \rangle \langle 0| \Big (|\langle -|0 \rangle |^2 \Big) + |1 \rangle \langle 0| \Big (|\langle -|0 \rangle ||\langle -|1 \rangle | \Big) + |0 \rangle \langle 1| \Big (|\langle -|0 \rangle ||\langle -|1 \rangle | \Big) + |1 \rangle \langle 1| \Big (\langle -|1 \rangle |^2 \Big) \Big) $$
OR:
$$ \rho' (-) =
\begin{bmatrix}
|\langle -|0 \rangle |^2 & |\langle -|0 \rangle \langle -|1 \rangle | \\
|\langle -|0 \rangle \langle -|1 \rangle | & \langle -|1 \rangle |^2 \\
\end{bmatrix}
$$
Similarly:
$$ \rho' (+) = \Big (| \tilde 0 \rangle \langle \tilde 0| \Big (|\langle -| \tilde
0 \rangle |^2 \Big) + | \tilde 1 \rangle \langle \tilde 0| \Big (|\langle -|\tilde 0 \rangle ||\langle -| \tilde 1 \rangle | \Big) + | \tilde 0 \rangle \langle \tilde 1| \Big (| \langle -| \tilde 0 \rangle ||\langle -|\tilde 1 \rangle | \Big) + | \tilde 1 \rangle \langle \tilde 1| \Big (\langle -| \tilde 1 \rangle |^2 \Big) \Big) $$
OR:
$$ \rho ' (+)=
\begin{bmatrix}
|\langle +|0 \rangle |^2 & |\langle -|0 \rangle \langle +|1 \rangle | \\
|\langle +|0 \rangle \langle -|1 \rangle | & \langle +|1 \rangle |^2 \\
\end{bmatrix}$$
Hence, the new density matrix is given by:
$$ \rho ' = \rho '(+)\Big ( \frac{| \langle - | + \rangle + \langle + | + \rangle |^2}{2} \Big) + \rho '(-)\Big ( \frac{ | \langle - | - \rangle + \langle + | - \rangle |^2}{2} \Big) = p_+ \rho '(+) + p_- \rho '(-)$$
Now, let write down the explicit Hamiltonian of the isolated system:
$$ H_{iso} = H \otimes I_{\text{experimenter + apparatus}} + I \otimes H_{\text{experimenter + apparatus}} + H_{\text{int}}$$
Since, we suddenly change the electric field $H$ is time dependent and since this energy is supplied by the apparatus and experimenter (since he will expend energy to "calculate" how much to change the energy field by) along with the interaction between the systems. Note: $H_{iso}$ is time independent (as it is an isolated system)
$$ \rho_{iso} = \rho(t) \otimes \rho_R(t) $$
Where $R$ is the rest of the isolated system excluding the Hamiltonian system. Since the $H_{iso}$ is time independent so is $S(\rho_{iso})$. Comparing before ($t_-$) and after ($t_+$) the field is turned on:
$$ S(\rho_{iso}) = S(\rho \otimes \rho_R(t_-)) = S(\rho ' \otimes \rho_R(t_+) ) $$
Where $S$ is the Von Neumann entropy of both sides:
$$ S(\rho ' \otimes \rho_R(t_+) ) = S(\rho \otimes \rho_R(t_-) ) $$
Hence,
$$ S(\rho ') + S( \rho_R(t_+) ) = S(\rho ) + S( \rho_R(t_-) ) $$
Substituting $\rho '$ and using $\Delta S_R = S( \rho_R(t_+) ) - S( \rho_R(t_-) ) $
$$ S(p_+ \rho '(+) + p_- \rho '(-)) + \Delta S_R - S(\rho ) = 0 $$
Using an entropy bound :
$$ p_+ S( \rho '(+)) + p_- S(\rho '(-)) + \Delta S_R - p_+ \ln p_+ - p_- \ln p_- - S(\rho ) \leq 0 $$
Hence,
$$ \Delta S_R \leq p_+ \ln p_+ + p_- \ln p_- + S(\rho ) - p_+ S( \rho '(+)) - p_- S(\rho '(-)) $$
Note the $p_+ \ln p_+ + p_- \ln p_- = -S_m $ is nothing but the entropy of the Hamiltonian system when measurement is done but the electric field is not changed. We define $\Delta S_m = S_m - S(\rho )$ and $\rho '(-)$ and $\rho '(+)$ are pure states:
$$ \Delta S_R \leq - \Delta S_m $$
"
"['entropy', 'information-theory']"," Title: Relative entropy inequality for many copies of a channelBody: Suppose we have two quantum channels $\mathcal{E}_{A\rightarrow B}, \mathcal{F}_{A\rightarrow B}$ that satisfy
$$D(\mathcal{E}(\rho_A)\|\mathcal{E}(\sigma_A))\geq D(\mathcal{F}(\rho_A)\|\mathcal{F}(\sigma_A)) \quad \forall \rho_A,\sigma_A\in \mathcal{H}_A,$$
where $D(\rho\|\sigma) = Tr(\rho\log\rho) - Tr(\rho\log\sigma)$. Is it then true that
$$D\left(\mathcal{E}^{\otimes n}(\rho_{A^n})\|\mathcal{E}^{\otimes n}(\sigma_{A^n})\right)\geq D\left(\mathcal{F}^{\otimes n}(\rho_{A^n})\|\mathcal{F}^{\otimes n}(\sigma_{A^n})\right) \quad \forall \rho_{A^n},\sigma_{A^n}\in \mathcal{H}_{A^n}$$
The question is due to a claim made in https://arxiv.org/abs/1110.5746. Proposition 4 is shown to hold for $n=1$ but on Page 3 (after Eq (8)), the claim is made for all $n$. I am not sure why. I understand it for the case where $\rho_{A^n}, \sigma_{A^n}$ are also $n$-fold tensor products i.e. $\rho_A^{\otimes n}$ but the statement here is for any pair of states in $\mathcal{H}_{A^n}$.
"
['superdense-coding']," Title: Significance of sharing an entangled state in Superdense CodingBody: The superdense coding protocol requires that A and B share an entangled state. Why is that?
That is, why does the shared state have to be entangled? Does the protocol (implicitly) use the fact that the state is entangled?
Thank you
"
"['algorithm', 'mathematics', 'noise', 'vqe', 'nisq']"," Title: Why is the VQE insensitive to noise?Body: I was going through the Grove documentation on the Variational Quantum Eigensolver. In one of the demonstrations with noisy gates, it is seen that resulting eigenvalue is quite close to the expected result, at least until the noise level exceeds a threshold. Is there a mathematical calculation which shows why the VQE is relatively insensitive to the low-level noise, and can the "threshold" (if it is indeed a threshold) be calculated for different ansätze?
"
"['complexity-theory', 'hamiltonian-simulation']"," Title: How precise are BQP measurements?Body: Let's say I am given a Hamiltonian $H$, whose ground state is efficiently preparable. We know that $||H|| \leq 1$. Let that ground state be $|\psi_{0}\rangle$, with energy $E_{0}$. We also know that the unitary $U$ such that
\begin{equation}
U |\psi_{0}\rangle |00\cdots0\rangle = |\psi_{0}\rangle |E_{0}\rangle,
\end{equation}
is efficiently preparable.
Consider the promise problem. For the yes instances,
\begin{equation}
E_{0} \geq c,
\end{equation}
and for the no instances,
\begin{equation}
E_{0} \leq s,
\end{equation}
where $c - s \geq \frac{1}{O\big(2^{poly(n)}\big)}$. Would this promise problem be in $BQP$?
"
"['simulation', 'chemistry']"," Title: Where can I get circuits of interest to quantum chemistry to try and simplify?Body: I am a computer science undergraduate working on a project in simplifying quantum circuits (using the ZX-calculus). I was hoping to try to simplify some circuits of interest rather than randomly generated circuits. I am uninitiated in the physics/chemistry. Where can I find ready-to-go circuits of interest or how can I easily generate circuits like this to try to simplify them?
"
"['programming', 'cirq']"," Title: Output a Cirq gate as a Numpy array?Body: How do I output a Cirq gate as a Numpy array? For example, I would like to print a Pauli X gate cirq.X as
numpy.array([[0,1],[1,0]])
Thank you.
"
"['quantum-gate', 'quantum-state', 'physical-realization']"," Title: How can I achieve single-qubit $T$ operation using spin resonance?Body: We know that $T$ gate is as follows
$T=\left(\begin{array}{cc}1 & 0 \\ 0 & e^{i \pi / 4}\end{array}\right)$
And on the other resultant spin-resonance hamiltonian is
$\frac{H}{\hbar}=\frac{1}{2} \omega_{0} Z+g(X \cos \omega t+Y \sin \omega t)$
And if we go into the rotating frame we will have
$\mathrm{i} \frac{\partial}{\partial t}|\varphi(t)\rangle=\underbrace{\left[\mathrm{e}^{\mathrm{i} \omega t Z / 2} \frac{H}{\hbar} \mathrm{e}^{-\mathrm{i} \omega t Z / 2}-\frac{\omega_{0}}{2} Z\right]}_{\left[\frac{\omega_{0}-\omega}{2} Z+g X\right]|\varphi(t)\rangle}|\varphi(t)\rangle$.
So for example we can construct NOT operation, if the frequency of the AC magnetic field ($\omega$) is equal to the larmor frequncy ($\omega_0$), and then we have only $X$ gate.
Notice that $\omega$ is adjustable and using that we want to achieve $T$ gate. What do you think about that?
"
"['complexity-theory', 'hamiltonian-simulation']"," Title: How precise are BQPSPACE measurements?Body: This is in a similar spirit to another question I asked here.
Let's say I am given a $k$-local Hamiltonian $H$. We know that $||H|| \leq 1$. Let the ground state be $|\psi_{0}\rangle$, with energy $E_{0}$. Let $U$ be an $n$-qubit unitary such that
\begin{equation}
U |\psi_{0}\rangle |00\cdots0\rangle = |\psi_{0}\rangle |E_{0}\rangle.
\end{equation}
Let $V$ be an $n$-qubit unitary such that
\begin{equation}
V |00\cdots0\rangle = |\psi_{0}\rangle,
\end{equation}
Can we implement both $U$ and $V$ in polynomial space (ie, with polynomially many qubits), with exponentially many gates from a universal gate set, upto an inverse exponential (in the number of qubits) precision? In other words, let $U'$ and $V'$ be what we can actually implement with exponentially many gates, and let $|\psi_{0}'\rangle$ and $E_{0}'$ be the ground state and the ground energy we get by applying $V'$ and $U'$ respectively. What is the relation between $|\psi_{0}\rangle$ and $|\psi_{0}'\rangle$, and $E_{0}$ and $E_{0}'$? Are they also within an inverse exponential additive error to each other?
If so, is this an alternative proof that the $k$-local Hamiltonian problem, which is complete for QMA, can be solved in BQPSPACE (the quantum analogue of PSPACE)?
Is this also why we do not know if QMA is contained in BQP? In other words, we do not know if there is a description of $U$ and $V$ which requires only polynomially many gates.
"
"['programming', 'quantum-operation', 'kraus-representation', 'diamond-norm', 'qetlab']"," Title: Choi matrix in QETLABBody: I am using QETLAB, a package for working with quantum information theory in Matlab and I have some doubts. I am trying to calculate diamond norms using such for some quantum channels. However, when doing so, it is said that a superoperator must be the input to the function. I know the Kraus representation of the channels I am testing, so I am not sure how to get the superoperator form of such. In the example they put in their wiki for their diamond norm they use a function called ChoiMatrix that calculates the Choi matrix of a supeorperator, but I am not sure if inputing the Kraus operators there will give me what I need.
An insight about the usage of the functions would be helpful, so as the relationship between superoperators, Kraus operators and Choi matrices.
"
"['qiskit', 'programming', 'circuit-construction', 'qasm']"," Title: Odd behavior with Qiskit Pauli operatorsBody: I was creating a simple implementation of the Hadamard test when I came across the following, what seems like, strange behavior.
Consider the following snippet, which is part of the computating the expected value of the Pauli-$X$ operator with respect to the state $|\psi\rangle = \frac{1}{2}|0\rangle + \frac{\sqrt{3}}{2}|1\rangle$. After measuring the ancillary, we compute $Prob(|0\rangle) - Prob(|1\rangle) = Re(\langle \psi |X|\psi\rangle)$ (see https://en.wikipedia.org/wiki/Hadamard_test_(quantum_computation))
Circuit 1:
reg = QuantumRegister(2)
classical = ClassicalRegister(1)
qc = QuantumCircuit(reg, classical)
def op():
r = QuantumRegister(1)
gate = QuantumCircuit(r)
gate.append(Operator(Pauli(label='X')), [*r])
return gate.to_gate()
qc.initialize([1/2, np.sqrt(3)/2], [reg[1]])
qc.barrier()
qc.h(reg[0])
qc.append(op().control(),[*reg])
qc.h(reg[0])
qc.barrier()
qc.measure(reg[0], classical)
job = execute(qc, Aer.get_backend('qasm_simulator'), shots=1024)
print(job.result().get_counts())
The result from QASM is $\{'0': 499, '1': 525\}$, which is not correct. I verified with Qiskit's snapshot expectation that expected value is $\frac{\sqrt{3}}{2}$. This was also verified through density matrix computation with numpy.
However, if I replace this with the $CX$ as opposed to the Pauli-$X$ from the quantum info package of qiskit.
Circuit 2
reg = QuantumRegister(2)
classical = ClassicalRegister(1)
qc = QuantumCircuit(reg, classical)
qc.initialize([1/2, np.sqrt(3)/2], [reg[1]])
qc.barrier()
qc.h(reg[0])
qc.cx(reg[0], reg[1])
qc.h(reg[0])
qc.barrier()
qc.measure(reg[0], classical)
job = execute(qc, Aer.get_backend('qasm_simulator'), shots=1024)
print(job.result().get_counts())
I got the following: $\{'0': 962, '1': 62\}$, which taking $(962-62)/1024$ produces an approximation to the correct result.
Next I printed out the transpilation of Circui1
t = transpile(qc, Aer.get_backend('qasm_simulator'), basis_gates=['u1','u2','u3','cx'])
t.draw(output='mpl')
I verified that this circuit does in fact produce the same result as Circuit 1. However, I then did a density matrix computation using numpy, which also produced the same result. However, this revealed that there is an incorrect phase difference, not a global phase difference.
If we view the bipartite system as $reg[0] \otimes reg[1]$ where $reg[0]$ is the ancillary control bit, we get a unitary matrix for the gates in between the second set of barriers above (not including the Hadamards) like the following:
$\begin{bmatrix}
-1 & 0 &0 & 0 \\
0 & -1 &0 & 0 \\
0 & 0 &0 & -i \\
0 & 0 &-i & 0 \\
\end{bmatrix}$
I verified that my computation in numpy was correct through multiple test; as a sanity check I compared my the matrices in the numpy simulation against those printed out by qiskit in the transpilation.
So this circuit is not the same as $CX$.
Any ideas as to why I am seeing this?
I thought this might be a Qiskit issue, but I posted it here in case I am missing something, which most likely the case.
"
['bloch-sphere']," Title: Why is the Bloch sphere three-dimensional?Body: I can understand the intuition behind a two dimensional bloch circle, as it represents the probability distribution of a certain state vector. However, I fail to grasp what the third dimension adds to the visualization when it comes to probabilities. How does it help? What is it supposed to add to the model that the Bloch circle didn't?
Since length is always 1, then what's the point of adding a z axis?
"
"['quantum-state', 'entropy', 'information-theory']"," Title: Quantum relative entropy with respect to a pure stateBody: I want to evalualte the quantum relative entropy $S(\rho|| \sigma)=-{\rm tr}(\rho {\rm log}(\sigma))-S(\rho)$, where $\sigma=|\Psi\rangle\langle\Psi|$ is a density matrix corresponding to a pure state and $\rho$ is a density matrix corresponding to an arbitrary mixed state. Here, $S(\rho)$ simply denotes the Von Neumann entropy of $\rho$. Given that $\sigma$ is diagonal, with eigenvalues $0$ and $1$ it seems that the first term in the quantum relative entropy will in general be infinite. As $S(\rho)\leq {\rm log}(d)$, where $\rho \in L({\mathcal H}^{d})$, the first term dominates and the quantum relative entropy is also infinite. Is this correct? And if so, what's the intuition behind this fact?
"
['qiskit']," Title: Solving mathematical physics equations with Quantum Fourier TransformBody: Has qiskit already realised(solved) mathematical physics equations? For example, Laplace's equation,Poisson's equation or other? if it is yes, where can i find it?
"
"['qiskit', 'programming', 'vqe']"," Title: How to use VQE function in QiskitBody: As part of a project I'm working on, I want to use VQE algorithm to calculate the minimal eigenvalue for given Hamiltonian. I use Qiskit on IBM UI online.
The Hamiltonian is given as a sum of tensor products
$H = Z\otimes Z + Z \otimes X + ...$
I don't understand two main points:
- How should I pass the Hamiltonian to the VQE? should I pass it as a list? i.e. $ H = [Z\^Z, X\^Z]$?
- I understand that I need to create N circuits, where N is the number of tensor products which constitute the Hamiltonian, so that each circuit will handle another part of the Hamiltonian. Do I understand this correctly?
Thank you.
"
['quantum-state']," Title: Given $\rho\in L(\mathcal H_A)$, can we find $\mathcal H_B\le \mathcal H_A$ such that ${\rm tr}_C(\rho)=\sigma$, for fixed $\sigma$?Body: Given an arbitrary density matrix $\rho \in L({\mathcal H_{A}})$, can one always find a subspace ${\mathcal H_{B}}$ of ${\mathcal H_{A}}$ such that ${\mathcal H_{A}}={\mathcal H_{B}}\otimes{\mathcal H_{C}}$ and ${\rm tr}_{C}(\rho)=\sigma$ for a fixed density matrix $\sigma \in L({\mathcal H_{B}})$?
While a purification of $\sigma$ yields a pure state $| \Psi \rangle \langle \Psi |$ with the property ${\rm tr}_{C}(| \Psi \rangle \langle \Psi |)=\sigma$, I am wondering whether one can do the same given a fixed (possibly mixed) state $\rho$.
If this is possible, what would be the restrictions on the dimension of ${\mathcal H_{A}}$ (in relation to the size of ${\mathcal H_{C}}$)?
"
"['qiskit', 'programming', 'ibm-q-experience', 'cirq']"," Title: Can I run Cirq on IBMQ?Body: Google's quantum computer is not yet available for the public. Is it possible to run Cirq on IBM's quantum computers, instead of Qiskit? And if so, how can I do it?
Thank you!
"
"['qiskit', 'programming']"," Title: QPE example on QiskitBody: I am learning to do QPE on qiskit. I wanted to choose a simple example to learn, and hence began with the state $|+\rangle$ and operator $X$.
I initialized $|+\rangle$ this way:
circ = QuantumCircuit(1)
circ.h(0)
a = Custom(num_qubits=1, state='zero', state_vector=None, circuit=circ)
blah = a.construct_circuit(mode='circuit', register=None)
statevec = Statevector.from_instruction(circ).data
I then defined $X$ this way:
b = MatrixOperator(np.array([[0,1],[1,0]]), basis=None,
z2_symmetries=None, atol=1e-12, name=None)
Finally, I gave the QPE commands:
backend = Aer.get_backend('statevector_simulator')
qpe = QPE(operator=b, state_in=statevec, iqft=None,
num_time_slices=1, num_ancillae=1,
expansion_mode='trotter', expansion_order=1,
shallow_circuit_concat=False)
quantum_instance = QuantumInstance(backend=backend)
results = qpe.run(quantum_instance)
However, when I try running QPE, I run into this error:
AttributeError: 'numpy.ndarray' object has no attribute 'construct_circuit'
If I define my operator instead this way:
b = Operator([[0,1],[1,0]])
I get the error:
AquaError: "Unsupported type to convert to WeightedPauliOperator: <class 'qiskit.quantum_info.operators.operator.Operator'>"
I also tried:
b = Pauli.x
but ran into:
AttributeError: 'property' object has no attribute 'copy'
Can someone help me with defining the state and operator correctly?
"
"['qiskit', 'programming', 'hamiltonian-simulation', 'vqe']"," Title: Intuition behind the construction of an ansatz circuitBody: I'm learning about the VQE algorithm. When I looked at the declaration in Qiskit I saw you need to pass an ansatz which prepares the state. I looked at some commonly used ansatz functions, e.g. EfficientSU2 of Qiskit, and I saw many of them use $R_y$ and $X$ gates.
I was wondering why exactly was this structure chosen? What's the physical logic behind it that makes it so convenient to use for many different Hamiltonians? How can the structure of the Hamiltonian affect the construction of the ansatz?
Thank you
"
"['qiskit', 'hamiltonian-simulation', 'vqe']"," Title: How does VQE performs the measurement on a given Hamiltonian?Body: I'm trying to understand, given a specific Hamiltonian, for example $H = Z\otimes Z+X\otimes Z$, does the VQE algorithm calculates the expectation value of $Z\otimes Z$ first or does it calculates the expectation value of $X\otimes Z$ first? couldn't understand it from the source code.
Thank you very much!
"
"['complexity-theory', 'deutsch-jozsa-algorithm', 'bqp', 'forrelation']"," Title: BQP and PH separationBody: I was reading the Quanta article here which shows that there exists a problem which achieves "oracle separation between BQP and PH". In simple terms, there exists a problem which a quantum computer can solve with far fewer calls to an oracle than a classical computer could (even in the realm where P=NP).
Why is this a stronger result than the well-known Deutsch-Jozsa algorithm to decide if a function is constant or balanced? In that case too, a classical computer had to make $O(n)$ calls to an oracle (the function) while a quantum computer could do so with a single query. Does this not prove that quantum computers are distinct from any possible classical computer, even if P=NP?
"
"['qiskit', 'hamiltonian-simulation']"," Title: Is there any algorithm that implements wavelet?Body: Is there any algorithm that implements wavelet (like there is Quantum Fourier Transform)? I've tried looking online, but couldn't find any, I wonder if something like this exists.
Thank you.
"
"['quantum-gate', 'algorithm']"," Title: A quantum operation to form the complement of an ""elementary"" entanglement of N qbits?Body: I have asked two similar questions 1, 2 but have not received a definite answer, so here I have narrowed the issue down to one hopefully more easily addressed aspect of the big question. Unfortunately I do not have a quantum computation background, and don't yet understand the usual notation used in the field. A link to an article that provides an answer that I can gradually decipher would be sufficient.
Given an elementary entangled state of N qubits, is there a quantum operation that produces the complement of the entangled state?
By "elementary entangled state of N qubits", I mean a state in which all of the N qubits are entangled with each other such that measuring the value of any one qbit will determine the values of all the other qubits.
By "complement", I mean a superposition of all states that are orthogonal to the elementary entangled state, where the "weights" of all the independent components of the superposition are the same.
The closest I've been able to come on my own to answering the question is to see that the hypothetical operation would not lose any information and would be reversible. And, it seems that simply adding an ancillary bit to identify a state as the complement of another state would almost be good enough (except that the components of that state wouldn't be very easily accessible for downstream operations).
"
"['quantum-state', 'textbook-and-exercises']"," Title: Outer Product IntutionBody: Please, help me understand this statement.
The outer product notation for matrices also gives an intuitive input-output relation for them.
For instance, the matrix |0⟩ ⟨1| + |1⟩ ⟨0| can be read as "output 0 when given a 1 and output 1 when
given a 0".
"
"['resource-request', 'classical-computing', 'qaoa']"," Title: Papers on classical optimization in QAOABody: Are there any papers on the classical optimization part of QAOA?
What is the most efficient method now?
And how is the classical optimization classified?
"
"['quantum-gate', 'programming', 'superposition', 'quantum-circuit']"," Title: Superposition of quantum circuitsBody: Given a quantum circuit $C_1$ that generates a state $\vert\psi\rangle$ and another circuit $C_2$ that generates $\vert\phi\rangle$, is there a way to construct a circuit that outputs
$$\frac{1}{\sqrt{2}}(\vert \psi\rangle +\vert\phi\rangle)$$
using $C_1$ and $C_2$ as black boxes?
"
"['mathematics', 'matrix-representation', 'unitarity']"," Title: How to force a matrix to be unitary given constraints on some of the elements?Body: I am working with a matrix of the following form:
$$
A =\begin{pmatrix}
a_{11} & Q & \ldots & Q\\
a_{21} & Q & \ldots & Q\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & Q &\ldots & Q
\end{pmatrix}
$$
where the $a_{ij}$ elements are real and predetermined, the $Q$'s are placeholders and not necessarily equal to one another, and $A$ is square of size $n$x$n$. I am looking to find values for all $Q$'s such that $A$ is unitary. To do this I have attempted to set up a system of nonlinear equations of the form $AA^\dagger=I$ which yields a system of $n^2-n$ unknown $Q$'s, but only $n^2/2 +n/2$ equations after removing any duplicate equations. Therefore, for $n=2$ the system is over-determined and for $n>3$ the system is under-determined.
My question is, is there a method in which I can solve for $Q$'s to force $A$ to be unitary given these constraints for any size n?
"
"['quantum-gate', 'universal-gates', 'continuous-variable', 'quantum-turing-machine']"," Title: Is the universality of a qubit based quantum computer different from the universality of a continuous-variable quantum computer?Body: I understand that a quantum computer is universal if it can compute anything that a quantum Turing machine can. Another way to think about universality is that any unitary transformation on, e.g., a registry of qubits or their continuous-variable counterparts, qumodes, can be approximated. One may also consider ways to decompose unitary transformations into circuits of quantum gates and then introduce the concept of a universal gate set, that is to say a set of gates that can be combined into a finite circuit that can approximate any given unitary transformation as accurately as one desires. These topics have already been discussed in this SE for example here and here.
Is it the case that the universalities of a discrete-variable quantum computer and a continuous-variable quantum computer are in fact different? Different in the sense that what we consider to be the set of all unitary transformations appear at least to me to be different in the two cases? Or am I missing something and they both can be shown to be equivalent to the same quantum Turing machine?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: JSONDecodeError with backend.runBody: I'm trying to follow tutorial on pulse simulation described in qiskit.org.
The generated PulseQobj is well executed with AER simulator, but it throws JSONDecodeError when using real backends (ex. ibmq-armonk). The PulseQobj passed the validation (validate_qobj_against_schema), so I'm struggling to find the reason. Qobj, generated by QuantumCircuit command, does not raise this error.
I connected to real device with APItoken, and qiskit version is up to date (qiskit 0.22.0).
Below is the trial code with real device, and log after backend.run(PulseQobj)
%matplotlib inline
import numpy as np
from qiskit.ignis.characterization.calibrations import rabi_schedules, RabiFitter
from qiskit.pulse import DriveChannel
from qiskit.compiler import assemble
from qiskit.qobj.utils import MeasLevel, MeasReturnType
from qiskit import IBMQ
IBMQ.enable_account(APItoken, proxies = ProxyConfig, verify = certPath)
provider = IBMQ.get_provider(hub=hub, group=group, project=project)
backend = provider.get_backend(device)
# qubit list
qubits = [0]
# drive amplitudes to use
num_exps = 64
drive_amps = np.linspace(0, 1.0, num_exps)
# drive shape parameters
drive_duration = 2048
drive_sigma = 256
# list of drive channels
drive_channels = [DriveChannel(0)]
# construct the schedules
rabi_schedules, xdata = rabi_schedules(amp_list=drive_amps,
qubits=qubits,
pulse_width=drive_duration,
pulse_sigma=drive_sigma,
drives=drive_channels,
inst_map=backend.defaults().instruction_schedule_map,
meas_map=backend.configuration().meas_map)
rabi_qobj = assemble(rabi_schedules,
backend=backend,
meas_level=1,
meas_return='avg',
shots=512)
result = backend.run(rabi_qobj).result()
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-17-16f293a93614> in <module>
----> 1 result = backend.run(rabi_qobj).result()
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
"
"['grovers-algorithm', 'cryptography']"," Title: How exactly does Grovers algorithm ""crack"" symmetric key encryption?Body: How exactly does Grovers algorithm "crack" symmetric key encryption? I searched around on the internet, and found that it could make the key length effectively half as long, meaning you only needed to double the lenth of your key for the encryption to be viable again. But how exactly could it brute force the password?
"
"['quantum-gate', 'quantum-state', 'resource-request']"," Title: Good book/paper for finding an ansatz via Trotterization?Body: Is there a good book or paper where they describe how to get the ansatz and gates from a Hamiltonian?
"
"['qiskit', 'programming', 'algorithm']"," Title: How can I convert arithmetic operations in a code to quantum format?Body: def SSGSM(im):
log_image=np.log(1+np.float32(im))
gx=cv2.Sobel(log_image,cv2.CV_64F,1,0,ksize=3)
gy=cv2.Sobel(log_image,cv2.CV_64F,1,0,ksize=3)
ex=np.exp(-1*abs(gx))
ey=np.exp(-1*abs(gy))
vx=np.multiply(gx,ex)
vy=np.multiply(gy,ey)
vx=np.multiply(vx,vx)
vy=np.multiply(vy,vy)
v_=vx+vy
v=np.sqrt(v_)
return v
I need to convert this code into a quantum format..could anyone help me please?
"
"['stabilizer-code', 'clifford-group']"," Title: Is there a CSS code for which the controlled phase gate and all Clifford gates are transversal?Body: In a paper that I have recently read, a protocol was given that required a CSS code with certain properties for which all logical Clifford gates and standard measurements have a transversal implementation (the 7-qubit would be an example). Later in that same paper a procedure was required that required the controlled $XP^{\dagger}$ ($C-XP^{\dagger}$) gate to be transversal for that specific code.
Now my question is, is that even possible? As far as I know, the set {Clifford group + a single non-Clifford} gate is universal, and that no stabilizer code allows for transversal implementation of a universal set of gates without any further assumptions. The controlled phase gate $C-P$ is a non-Clifford gate and $C-XP^{\dagger} = CNOT*(C-P^{\dagger})$, so that $C-XP^{\dagger}$ also is a non-Clifford gate. Doesn't this make the requirement that the ($C-XP^{\dagger}$) gate be transversal impossible in the first place?
"
"['mathematics', 'density-matrix', 'trace-distance']"," Title: How do I prove that $\newcommand{\tr}{\operatorname{Tr}}\tr(A \sqrt{B} A \sqrt{B}) = \tr\Big[\Big(\sqrt{\sqrt{B}} A \sqrt{\sqrt{B}}\Big)^2\Big]$?Body: Let's say I have 2 density operators $A$ and $B$. Now, here is what I am trying to calculate:
$$\newcommand{\tr}{\operatorname{trace}}
\tr(A \sqrt{B} A \sqrt{B}).
$$
I saw that this trace can be rewritten as:
$$
\tr(A \sqrt{B} A \sqrt{B}) = \tr\Bigg(\Big(\sqrt{\sqrt{B}} A \sqrt{\sqrt{B}}\Big)^2\Bigg).
$$
I was wondering, which property of trace is being used here. I do not think the cyclic property would help, would it?
"
"['quantum-gate', 'quantum-circuit']"," Title: Should C-NOT gate affect ""input"" qubit or not?Body: In MS presentation, they describe the process CNOT gate working with state machine diagram. At first they drew CNOT gate in black bock as following:
This implies, that Input qbit is not affected, since it is always $|x\rangle$. This also corresponds with what they drew earlier for any irreversible operation made reversible.
Nevertheless, on next slide they drew, that "Input" qubit (left circle on slide, green state change arrow) is affected
Why?
I checked myself of applying CNOT matrix to depicted state and found that input state changes, while output does not.
So this was just error on slides, implying "Input" is not changes?
"
"['quantum-state', 'mathematics', 'density-matrix']"," Title: What is the intuition behind ""states with support on orthogonal subspaces""?Body: I'm sure I don't fully understand support, but I am having trouble seeing how it connects to things like density operators. I have an idea that it means, according to Wikipedia:
"In mathematics, the support of a real-valued function f is the subset of the domain containing those elements which are not mapped to zero."
First of all, what would support be used for in quantum theory? What is the meaning of the support of a density operator or quantum state? Perhaps someone could explain what "states with support on orthogonal subspaces means" and what implications it has.
"
"['non-locality', 'information-theory', 'foundations']"," Title: What is the difference between no signaling and non locality at operational and ontological level?Body: I understand the basic definitions. Locality means Alice's measurements do not affect Bob's and system and that no-signalling means a party can't send information faster than light. I also know that locality is defined at the ontological level but no-signalling is at the operational level. What I do not understand is why it is so. Can this be understood with physical intuition?
"
"['qiskit', 'programming', 'noise']"," Title: Simulation of Noise in a particular quantum computerBody: I wish to be able to model a quantum computer with all the noise sources of an IBM quantum computer. For a given set of T1, T2, readout_errors, U2_errors and CNOT errors I want to know how to include all these errors. I can run a quantum circuit using the expected noise from a particular computer through the following code
backend = provider.get_backend('ibmqx2')
noise_model = NoiseModel.from_backend(backend)
# Get coupling map from backend
coupling_map = backend.configuration().coupling_map
# Get basis gates from noise model
basis_gates = noise_model.basis_gates
This runs my code with the noise from ibmqx2. I then try to implement each noise source. For example if the single qubit U2 error rate is er1, I implement this as follows:
error_1 = noise.depolarizing_error(er1, 1)
noise_model.add_quantum_error(error_1, ['u1', 'u2', 'u3','h'],[0])
I implement the two qubit and readout errors in the same way. Is this correct? Also how do I implement the errors associated with the T1 and T2 values? I am asking because my current model when I add each noise source myself does not match when I simply import the noise model. I wish to reconcile this.
"
"['programming', 'ibm-q-experience', 'measurement']"," Title: Unable to run program on different backendsBody: from qiskit import *
def random_bitstring_generator(bit_number, backend):
"""
Generate a bitstring with one qubit
:param bit_number: number of bits that we want to generate
:param backend: Qiskit hardware or simulator
:return: string object with random bits
"""
bitstring = ""
one_qubit_random_bit_generator_circuit = QuantumCircuit(1,1)
one_qubit_random_bit_generator_circuit.h(0)
one_qubit_random_bit_generator_circuit.measure(0,0)
for _ in range(bit_number):
counts = execute(one_qubit_random_bit_generator_circuit, backend, shots=1).result().get_counts()
bit = list(counts.keys())[0] # we have only one key because shots=1
bitstring += bit
return bitstring
provider = IBMQ.load_account()
backend = BasicAer.get_backend('ibmq_santiago')
print(random_bitstring_generator(512, backend)
Running the above code in jupyter notebook in quantum lab gives me error as shown is photo. I am also unable to run the program for a backend other than simuator like melboune, vigo, ourense.
"
"['quantum-gate', 'programming', 'simons-algorithm']"," Title: A Simon's algorithm with secret string b = 01, IBM Quantum experience gives a different result from what I calculateBody: I try to design the circuit for $b = 11$ and succeeded in running. Therefore, I start to think of the circuit for different secret string $b = 01$. The circuit I made is down below:
Here is the problem: After the first Hadamard operator, if the input $x = \left|10\right\rangle$, the $f(x)$ result (That is the measurement of $q2$, $q3$, which is the last two bits of $\left|y_1y_2y_3y_4\right\rangle$ in Computational basis states) according to my circuit, should be $\left|11\right\rangle$, the same as the input $x = \left|11\right\rangle$. And the output of $y1, y2$ should match the condition:$$b\cdot{y} = 0\,(\,mod\,2\,)$$Hence, one of the output I believe is $\left|1011\right\rangle$, but the calculator gives me a wired (at least I think it is wired) result. What are the issues?
"
"['quantum-state', 'haar-distribution', 'linear-algebra']"," Title: Expected value of a Haar random quantum state multiplied by a unitaryBody: Consider a quantity
\begin{equation}
\mathbb{E}\big[\langle z|\rho|z\rangle\big],
\end{equation}
where $\rho = |\psi \rangle \langle \psi|$ is a Haar-random state $n$-qubit quantum state and $z$ is the label of a fixed $n$-qubit basis vector. Now, consider
\begin{equation}
\sigma = \underset{\text{diagonal}~U}{\mathbb{E}}\big[U\rho U^{*}\big],
\end{equation}
where $\rho$ is as defined before, and $U$ is a diagonal unitary matrix such that the diagonal entries are uniformly random complex phases. I am trying to prove that
\begin{equation}
\mathbb{E}\big[\langle z|\rho|z\rangle\big] = \mathbb{E}\big[\langle z|\sigma|z\rangle\big]
\end{equation}
Intuitively, the result is clear as the Haar measure is invariant under left and right multiplication by a unitary. But, the RHS has two expectations - one nested inside the other - and I do not know how to simplify that.
"
"['qiskit', 'programming', 'grovers-algorithm', 'simulation']"," Title: Qiskit BasicAer & AerBody: While I'm simulating grover's algorithm, I found that with BasicAer backend it works well but with Aer it is not. What is the difference between qiskit.providers.BasicAer and qiskit.providers.Aer ?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Suppress WarningsBody: I wish to know how to suppress the following warning obtained on qiskit when I try to add two different types of noise to a qubit
WARNING: quantum error already exists for instruction "u2" on qubits [0] , appending additional error.
I know that some warnings can be suppressed with
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
but I do not know what category my warning is contained in. I would also like to know if I can access somewhere all the different warning categories. Additionally trying
import warnings
warnings.filterwarnings('ignore')
to suppress all warnings does not help.
"
"['qiskit', 'programming', 'simulation']"," Title: Qiskit BasicAer simulator optionsBody: I usually use Qiskit "Aer" to simulate quantum circuit with several methods such as statevector, density_matrix, stabilizer, extended_stabilizer, and matrix_product_state. Recenlty I came across another simulator called "BasicAer" and I wonder if the qiskit BasicAer supports above methods.
"
"['quantum-state', 'information-theory', 'linear-algebra']"," Title: Checking whether a state is almost orthogonal to permutation invariant statesBody: Let us consider
\begin{equation}
|T\rangle = |\psi \rangle^{\otimes m}
\end{equation}
for an $n$-qubit quantum state $|\psi\rangle$. Let $\mathcal{V}$ be the space of all $(m + 1)$-partite states that are invariant under permutations. Consider $|\psi\rangle|T\rangle$, which belongs to the space $\mathcal{V}$. I am trying to prove:
- For $|\phi\rangle$ orthogonal to $|\psi\rangle$, $|\phi\rangle |T\rangle$ is almost orthogonal to $\mathcal{V}$, upto an error $\mathcal{O}\big(\frac{1}{m}\big)$.
- There exists a measurement to determine whether $|\phi\rangle |T\rangle$ is in $\mathcal{V}$, upto an error $\mathcal{O}\big(\frac{1}{m}\big)$, and when doing so, the state $|T\rangle$ is only disturbed by $\mathcal{O}\big(\frac{1}{m}\big)$.
(For reference, these statements are in this paper, in the last paragraph of page 13).
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: How to set overwrite to true with IBMQ?Body: I'm trying to get setup with https://qiskit.org, but I'm having a problem.
I have dug around the internet for a bit and haven't been able to find anything.
When I try to run IBMQ.save_account('api_token') it says that I already have credentials present, and to set overwrite to true in order to overwrite the current ones.
How do I do with that?
"
"['qiskit', 'programming', 'grovers-algorithm']"," Title: Grover's algorithm with matrix_product_state methodBody: I implemented Grover algorithm with matrix_product_state method in qiskit. But I found something strange. I designed the oracle part come out $|1111\rangle$ but, real output was $0011\rangle$. I check out my code, but there is nothing wrong with it. Even simulating with the other simulation method (such as statevector, density_matrix etc.) I got correct output. I really don't understand why only matrix_product_state method's output is strange. My code is below.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'linear-algebra']"," Title: Basis Change SubstitutionBody: question: "A spin right $\frac{1}{\sqrt 2}(|0\rangle + |1\rangle)$ is sent through a Hadamard gate, creating the superposition of $|+\rangle$ and $|-\rangle$, given by $\frac{1}{\sqrt 2}(|+\rangle + |-\rangle)$. By making a basis change substitution, show that this is equivalent to producing a $|0\rangle$ state."
How do I represent a basis change substitution mathematically?
"
"['programming', 'quantum-state', 'cirq', 'ghz-state']"," Title: Producing $|ghz\rangle\langle ghz|$ State in CirqBody: I could manage to produce 3 qubit ghz state in Cirq. But I don't know how I can produce $|GHZ\rangle\langle GHZ|$ in Cirq
Here is my code for 3 qubit ghz state
Can you help me please for improving my code from $|GHZ\rangle$ to $|GHZ\rangle\langle GHZ|$:
n = 3
qubits = cirq.LineQubit.range ( n )
def circuit ():
circuit = cirq.Circuit ()
circuit.append (cirq.H(qubits[0]))
for i in range (n-1):
circuit.append ( cirq.CNOT ( qubits [i] , qubits [i+1]) )
circuit.append (cirq.measure (* qubits , key ='x') )
print (circuit)
return circuit
def simulation (circuit):
simulator = cirq.Simulator()
results = simulator.run ( circuit , repetitions = 200)
counts = cirq.plot_state_histogram (results)
def main():
simulation (circuit())
if __name__ == "__main__ ":
main ()
"
"['quantum-gate', 'measurement', 'textbook-and-exercises', 'quantum-circuit']"," Title: How to compute the measurement probability in swap test?Body: The figure of a circuit and the state are as follows.
The final state before the measurement is $|O_{out}\rangle=\frac{1}{2}|0\rangle(|\phi\rangle|\psi\rangle+|\psi\rangle|\phi\rangle)+\frac{1}{2}|1\rangle(|\phi\rangle|\psi\rangle-|\psi\rangle|\phi\rangle)$.
Measuring the first qubit of this state produces outcome 1, how can I get the probability $\frac12(1-|\langle\phi|\psi\rangle|^2)$?
"
"['qiskit', 'programming', 'noise', 'ibm', 'google-sycamore']"," Title: Simulating noise of googles quantum computersBody: Is there a way to simulate the noise of googles quantum computers using circ? In the same way that any of IBM's computers can be simulated using different backends?
backend = provider.get_backend('ibmqx2')
noise_model = NoiseModel.from_backend(backend)
Ideally I would want something like above which allows me to easily call the noise properties of for example Bristlecone or Sycamore.
If this is not possible does anyone know the best way to approach simulating the noise of any of googles quantum computers in qiskit?
I am asking because I wish to compare Google and IBMs quantum computers for implementing a simple circuit.
"
['quantum-walks']," Title: Quantum Walk Study Resource for Non-regular GraphBody: Does anyone know any good resource where I can study about how quantum walk is performed on non-regular graph?
Most of the papers I read, talks about only quantum walk on regular graphs containing cycles. For non-regular graph as each node have different degree, the dimensions of coin operator needs to keep changing. No resource talks about this.
If anyone have any source, it will be helpful.
"
"['continuous-variable', 'quantum-turing-machine']"," Title: Is continuous-variable quantum computing a model of a quantum universal Turing machine?Body: In this question of a few days ago, it was raised the question about the similarities or differences between the notion of universality in discrete-variable (DV) quantum computers and continuous-variable (CV) computers. My question is in the same line and I think that the answer would include both questions: Is the continuous-variable quantum computing model a quantum universal Turing machine?
This doubt stems from the definition of universality in the CV quantum case (see for example the original article by Lloyd): Universality of the CV model is defined as the ability to approximate arbitrary transformations of the form $U_H = e^{−it H}$, where the generator $H = H (x, p)$ is a polynomial function
of $(x, p)$ with arbitrary but fixed degree. If the CV model is a quantum universal Turing machine, it would mean that it is equivalent to the DV model, and therefore I can represent any unitary transformation as $e^{−it H(x,p)}$, but I'm not sure about this last point.
"
"['shors-algorithm', 'quantum-fourier-transform']"," Title: How to write a classical version of Shor's algorithmBody: For learning purposes, I would like to write a classical version of Shor's algorithm. From what I have read, what makes this algorithm fast is the quantum FFT, which is used to find the period of the function $a^k \bmod N$ with the ultimate goal of finding the k that solves $a^k \bmod N = 1$.
Acknowledging that it would be impractically slow, I would like to write a version that uses the classical FFT. Certainly such an algorithm could factor small numbers.
What confuses me is that when I calculate the values of $a^k \bmod N$ to feed into the FFT, it is not that much harder skip the FFT and just find $a^k \bmod N = 1$ by brute force (similar to this question).
What am I missing here? Alternatively, if I had a black box that could calculate FFTs instantaneously, how would this change Shor's algorithm?
"
"['quantum-state', 'tensor-product']"," Title: Can every bipartite state be written as $\rho_{AB} = \sum_{ij} c_{ij}\sigma_A^i\otimes \omega_B^j$?Body: Can every bipartite quantum state (including entangled ones) be written in the following way
$$\rho_{AB} = \sum_{ij} c_{ij}\sigma_A^i\otimes \omega_B^j$$
where $\sigma_A^i$ and $\omega_B^j$ are density matrices? And if $\rho_{AB}$ is a quantum state, must it also be the case that $c_{ij}$ are nonnegative? If the answers are yes, how can one show this?
I ask this because of a claim that the set of product states $\rho_A\otimes\rho_B$ span the vector space of all operators acting on $H_A\otimes H_B$ in an answer here - https://quantumcomputing.stackexchange.com/a/5066/4831.
"
"['quantum-state', 'mathematics', 'density-matrix', 'partial-trace', 'projection-operator']"," Title: Bob applies a projector - what happens to eigenvalues of Alice's reduced state?Body: Suppose Alice and Bob share a state $\rho_{AB}$. Let us denote the reduced states as $\rho_A = \text{Tr}_B(\rho_{AB})$ and $\rho_B = \text{Tr}_A(\rho_{AB})$. Bob applies a projector so the new global state is
$$\rho'_{AB} = (I_A\otimes \Pi_B)\rho_{AB}(I_A\otimes \Pi_B)$$
Let us denote the new (subnormalized) reduced state on Alice's system as $\rho'_{A}$. I am given two facts about Bob's projector
- $\Pi_B$ is diagonal in the eigenbasis of $\rho_B$.
- It is gentle i.e. $\text{Tr}(\Pi_B\rho_B) \geq \text{Tr}(\rho_B) - \varepsilon$ for some small $\varepsilon$.
I would like to know how the eigenvalues of $\rho'_A$ are related to those of $\rho_A$. So far, the only conclusion I have is that $\rho'_A\leq \rho_A$ where $A \leq B$ means that $B-A$ is positive semidefinite.
In particular, I am interested in any inequality relating the smallest nonzero eigenvalue of $\rho_A$ and the smallest nonzero eigenvalue of $\rho'_A$.
"
"['qiskit', 'vqe']"," Title: Depth for UCC ansatzBody: I tried to understand the notion of depth vs Trotter step in a uccsd circuit for the vqe algorithm in qiskit (I use an older version, 0.15). When I tried understanding it for a small system like H2, and started changing depth from 1 through 3, the whole circuit for U (the variational form, which in this case is uccsd) started repeating itself. Physically, this looked very much like increasing Trotter steps (or num_time_slices), for example, e^(A+B) = (e^(A/3)e^(B/3))^3. Indeed, when I set num_time_slices as 2 and depth as 1, I got the same circuit as with the numbers switched. Can someone help me with how the two are different, viz, depth and Trotter step?
"
"['error-correction', 'nielsen-and-chuang', 'textbook-and-exercises']"," Title: Nielsen&Chuang 5-qubit quantum error-correction encoding gateBody: $\newcommand{\bra}[1]{\left<#1\right|}\newcommand{\ket}[1]{\left|#1\right>}\newcommand{\bk}[2]{\left<#1\middle|#2\right>}\newcommand{\bke}[3]{\left<#1\middle|#2\middle|#3\right>}$
In Nielsen&Chuang on quantum error-correction codes they give a 5 qubit one as follows:
$$\small
\ket{0_L}=\frac14\left(
\color{red}{
+\ket{00000}
-\ket{00011}
+\ket{00101}
-\ket{00110}
}
%
\color{blue}{
+\ket{01001}
+\ket{01010}
-\ket{01100}
-\ket{01111}}\\ \hspace{.47in}
%
\color{green}{
-\ket{10001}
+\ket{10010}
+\ket{10100}
-\ket{10111}}
%
-\ket{11000}
-\ket{11011}
-\ket{11101}
-\ket{11110}
\right)
$$
$$\small
\ket{1_L}=\frac14\left(
\color{red}{
+\ket{11111}
-\ket{11100}
+\ket{11010}
-\ket{11001}
}
%
\color{blue}{
+\ket{10110}
+\ket{10101}
-\ket{10011}
-\ket{10000}}\\ \hspace{.47in}
%
\color{green}{
-\ket{01000}
+\ket{01011}
+\ket{01101}
-\ket{01110}
}
%
-\ket{00001}
-\ket{00010}
-\ket{00100}
-\ket{00111}
\right)
$$
(I reshuffled entries w.r.t. to equal bits of information...colors represents equal patterns of signs, which remind me on a $H\otimes H$ gate)
How to implement the encoding gate for this?
I can't find that specific one anywhere in the online available literature...
Update: I can take $\ket{00000}$ to $\ket0_L$ by that quirk (modulus some sign errors for the other transfer to $\ket{1_L}$)...
"
"['algorithm', 'grovers-algorithm']"," Title: How to perform computation on an ancilla register in Grover's mean estimation algorithm?Body: While reading about Grover's mean estimation algorithm, I came across this post on StackExchange. As an undergrad, there are several points I don't quite understand.
- What is the role of $f(x)$. Consider I have a list of numbers, such as $0.1, 0.2, 0.3, 0.4$ and I want to calculate the mean. What exactly is $f(x)$ mapping? What exactly is $x$ here? My wildest guess is that the above numbers are labelled as $00, 01, 10, 11$ and these binary strings are referred to as $x$. In this sense $f(x)$ behaves more like a table to associate $00 \rightarrow 0.1$, $00 \rightarrow 0.2$, etc. Is this the correct understanding?
- What computation on the ancilla? The aforementioned post also suggest that perform a computation of $f(x)$ on an ancilla register. What does the computation mean?
- How does this controlled-rotation look like? It appears to me that three registers are needed to implement this algorithm. To achieve this controlled-rotation, which bit is used as control?
"
"['programming', 'cirq']"," Title: Cirq: Creating an arbitrary gate for an arbitrary number of qubitsBody: How do I create an arbitrary unitary gate for an arbitrary number of qubits in Cirq?
Note: A solution for creating a single qubit gate is answered by Thomas W from this post.
How do I create my own unitary matrices that I can apply to a circuit in Cirq?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: Unable to run a QRNG codeBody:
I am trying to run the above code on Vigo, Santiago and other backends. However, warning message as shown in the image apppears and no result is displayed even after hours of waiting. However, when I reduce the bitstring size to 4 from 512/256/56 the output appears but that too after very long.
Questions:
- Can anyone guide how to obtain a longer length bitstring (512, 1024, 2048) for one, two, three qubit measurements for backend options other than simulator?
- What is the reason for results not being obtained as I think there is no error in the code?
"
"['qiskit', 'programming', 'ibm-q-experience', 'circuit-construction']"," Title: How can I obtain transformation matrix of a quantum circuit in the Qiskit?Body: I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. Is there any feature on Qiskit in this case?
"
"['resource-request', 'complexity-theory', 'speedup', 'forrelation']"," Title: Bound on quantum speedups under various models of complexityBody: What are the bounds on quantum speedups under the various models of complexity? How big or small can they be?
Under the query model, my understanding is that the lower bound is $\Omega(\sqrt{N})$ as discussed in BBBV97 and established by Grover's algorithm. The upper bound is established by Forrelation, as shown by Aaronson and Ambainis. Using these, we can then define a quantum speedup as:
$S={C(N)\over{Q(N)}}$,
where $C$ is some appropriately selected classical algorithm, $Q$ our quantum algorithm, and the quantum speedup is bounded by $\Omega(\sqrt{N}) \le S \le {\Omega(\sqrt{N}/ \log N)}$.
Do we have similar bounds on quantum speedups under other models of complexity (e.g. gate, sample, space)? If so, references to the papers establishing these bounds would be great.
"
"['quantum-state', 'partial-trace', 'information-theory', 'trace-distance', 'state-space-geometry']"," Title: Quantum marginal problem - constructing a global state from reduced statesBody: Consider a bipartite state $\rho_{AB}$ with reduced states $\rho_A = \text{Tr}_B(\rho_{AB})$ and $\rho_B = \text{Tr}_A(\rho_{AB})$.
Suppose one obtains states $\rho'_{A}$ and $\rho'_{B}$ such that $\|\rho'_A - \rho_A\|_1 \leq \delta$ and $\|\rho'_B - \rho_B\|_1 \leq \delta$. That is, we have perturbed the reduced states slightly. In the specific problem I am looking at $\rho'_A$ commutes with $\rho_A$ and $\rho'_B$ commutes with $\rho_B$ but perhaps this is not relevant.
Does there exist a global state $\rho'_{AB}$ with marginals $\rho'_A$ and $\rho'_B$ such that $\|\rho'_{AB} - \rho_{AB}\|_1\leq \varepsilon(\delta)$, where $\lim_{\delta\rightarrow 0}\varepsilon(\delta) = 0$?
"
"['programming', 'quantum-state', 'entanglement', 'cirq']"," Title: Multiple Bipartite Entangled State in CirqBody: I am trying to create this state:
rho = = q . rho_{1,2} + r . rho_{2,3} + s . rho{1,3} + (1-q-r-s) . rho_separable
And I wrote this code:
import random
import numpy as np
import cirq
circuit, circuit2, circuit3 = cirq.Circuit()
p = 0.2
q = 0.1
r = 0.3
alice, bob, charlie = cirq.LineQubit.range(1, 4)
rho_12 = circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
#circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
rho_23 = circuit.append([cirq.H(bob), cirq.CNOT(bob, charlie)])
rho_13 = circuit.append([cirq.H(alice), cirq.CNOT(alice, charlie)])
circuit = rho_12 + rho_23 + rho_13
print(circuit)
In here I have 2 problem:
1)This line is not working: circuit = rho_12 + rho_23 + rho_13
2)I cannot multiply the state with p or q or r. What I mean is that I can't write this line:
rho_12 = circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)]) * q
Could you please show me how I can write this state?
"
"['programming', 'entanglement', 'measurement', 'noise', 'cirq']"," Title: Bit Flip, Separable state and Several Question about CirqBody: 1)I want to use noise model for my state and bit_flip is not defined on cirq.
rho_13 = cirq.Circuit(
cirq.H(alice),
cirq.CNOT(alice, charlie),
#cirq.bit_flip([r]),
cirq.measure(alice,charlie),
)
When I wrote this code, I had the error: " bit_flip is not defined" (I used import cirq)
2)For ghz state I wrote this part but I didn't understand I have a syntax error which is very weird maybe I am doing something wrong regarding cirq but I get this error. Can you look at it?
ghz = cirq.Circuit(
cirq.H(qubits[0]),
for i in range (n-1):
cirq.CNOT ( qubits [i] , qubits [i+1]),
cirq.final_density_matrix(circuit),
cirq.measure (* qubits , key ='x'),.
)
The syntax error is just after the "for" and "Invalid syntax"
3)My original state is |GHZ><GHZ|+P*rho. Should I use cirq.final_density_matrix(circuit), in the part of ghz only, or should I use cirq.final_density_matrix(circuit), after defining my all state(I will first define |GHZ><GHZ and then (1-P)rho, and then I will write circuit =|GHZ><GHZ|+(1-P)rho after that cirq.final_density_matrix(circuit)) or should I use cirq.final_density_matrix(circuit) both part for all circuit and |GHZ><GHZ too
- I can create entangled state with hadamard and cnot gate but I want to create seperable state. How can I create seperable state with cirq
5)For measurement, Should I measure each part seperately or should I first appending all circuit and then measured together? What I mean is that first I will measure |GHZ><GHZ| and then I will measure P*rho and after that I will add my circuit like circuit =|GHZ><GHZ|+(1-P)rho and simulate or Should I directly add and after that measure the all circuit?
Many thanks from now
"
"['quantum-gate', 'programming', 'algorithm']"," Title: How to apply control on a register if that register is equal to a specific n-bit string c*?Body: Say we want to apply CNOT, and the control register "c" is a n-bit string. Given a specific c*, is it possible to change all bits of the register into 1, if and only if the initial c equals to c*?
I checked "Classical Concepts in Quantum Programming" in order to get an idea of how to implement something similar to if-else in quantum computing, but it made things more complicated. What is the right direction to figure something like this out?
"
"['algorithm', 'grovers-algorithm']"," Title: Grover's Search applied to Schöning's AlgorithmBody: In this paper by Ambainis, he talks about the applicability of Grover's Search to Schöning's algorithm for solving the 3SAT problem to obtain a runtime of $O(\sqrt{1.329...^n}$.
In the original algorithm by Schöning, the algorithm is repeated for $1.329^n$ time to obtain a constant success probability. Ambainis states the following: "To obtain a quantum algorithm, we just use quantum amplitude amplification instead of classical repetition."
I don't understand here at what stage we apply Grover's Search. For instance, what is the search space on which we are applying Grover's Search?
"
"['algorithm', 'measurement', 'phase-estimation']"," Title: How to use the measurement in quantum phase estimation?Body: Reading the quantum phase estimation algorithm on Wikipedia, I am wondering how exactly the measurements are used to obtain the phase $\delta$. I understand that the value of phase is encoded into the binary string that represents a computational state. My question is more about what extra information can be extracted from the probabilities. If I perform the measurement in the computational basis, i.e., $|a\rangle$ in the notation used on Wikipedia, what I obtain is a list of probabilities for each state. (Imagine the case $\delta\neq 0$). How exactly can I get this $\delta$ from these probabilities? Since the probability $\text{Pr}(a)$ is what I get and is expressed in terms of $\delta$, do I have to inverse the following function
$\text{Pr}(a) = \frac{1}{2^{2^{n}}}\frac{|\sin(\pi 2^{n}\delta)|^{2}}{|\sin(\pi\delta)|^{2}}$
in order to get $\delta$?
Meanwhile, how does the algorithm recognise the nearest integer to $2^{n}\theta$? The only way I can imagine is that the probability that corresponds to a certain state is greater than other. Imagine I do not approximate, $\textit{a priori}$, $2^{n}\theta = a + 2^{n}\delta$, then what I obtain is this list of probabilities for each $a$. It appears I can use any of them to estimate the phase. In this case, which probability shall I use?
"
"['qiskit', 'programming', 'quantum-state']"," Title: State Vector Output for T$|1\rangle$ in Qiskit differs from manual calculation. Why is this so?Body: The T Gate is defined as $\begin{bmatrix} 1&0 \\ 0&e^{i\pi/4} \end{bmatrix} = \begin{bmatrix} 1&0 \\ 0&\frac{\sqrt{2}}{2}(1+i) \end{bmatrix}.$
So $\begin{bmatrix} 1&0 \\ 0&\frac{\sqrt{2}}{2}(1+i) \end{bmatrix} \vert 1 \rangle = \begin{bmatrix} 1&0 \\ 0&\frac{\sqrt{2}}{2}(1+i) \end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{\sqrt{2}}{2}(1+i) \end{bmatrix}.$
But the following code for the T Gate gives a slightly different output:
from qiskit import QuantumCircuit, Aer, execute
from qiskit_textbook.tools import array_to_latex
qc = QuantumCircuit(1)
qc.initialize([0,1],0) # initialize to |1>
qc.t(0)
display(qc.draw('mpl'))
backend = Aer.get_backend('statevector_simulator') # simulate the circuit
state = execute(qc,backend).result().get_statevector() # get final state
array_to_latex(state, pretext="\\text{Output} = ") # show final state vector
which is $\begin{bmatrix} 0 \\ \frac{1}{\sqrt{2}}(1+i) \end{bmatrix}.$
Why do these two results differ? Thanks for any insights.
"
"['entanglement', 'hadamard']"," Title: Is there a clear boundary between quantum coupling and quantum entanglement?Body: I have a few questions in understanding the difference between coupling and entanglement in quantum systems: Is there a clear boundary between quantum coupling and quantum entanglement? If two quantum systems are coupled, do they need to be restricted to a certain distance? Is there a difference between 'coupling the two qubits' and 'entangling' them using a Hadamard Gate? In Schrodinger's cat thought experiment, are we saying the cat and radioactive source are 'entangled' or 'coupled'?
"
"['quantum-gate', 'circuit-construction', 'textbook-and-exercises']"," Title: Optimizations in quantum circuitsBody: In a paper called On quantum circuits employing roots of the Pauli matrices, I found this figure, where I couldn't understand the equality in the circled circuits. I need an explanation of how the circuits in the circle are equal with any rules used in reduction. Especially the CNOT underlined in red - How it is reduced?
"
"['qiskit', 'programming', 'measurement']"," Title: Partial Measurement of Quantum Circuit in QiskitBody: I want to do partial measurement of quantum circuit containing two qubits in entangled state. I want to first measure one qubit and record the result. Thereafter, record the measurement of second qubit and compare the two. Mathematically, the two should come out to be same.
How to do the same on Qiskit using Python?
"
"['quantum-gate', 'qiskit', 'circuit-construction']"," Title: Which method of executing a multi-control gate is more efficient?Body: I am interested in executing multi-control gates and I have found two methods to do so as explained below.
- The first is taken from Nielsen and Chuang (2010) from their Figure 4.10. This method requires an additional n-1 ancillary (or work as they call it) qubits along with $2(n-1)$ Toffoli gates and a single $CU$ gate where $n$ is the number of control qubits.
.
- The second method from Barenco et al. (1995) (on their page 17) uses a total of $2^{n}-1$ $V$ gates and $2^{n}-2$ CNOT gates where $n$ is the number of control qubits and $V^4=U$ in this example.
It seems to me that the Nielsen method uses fewer gates but has the disadvantage of requiring additional ancillary qubits. So which of these methods is more efficient? Or, are there other method I should consider using? In case it helps, I am looking to use one of these methods on my qiskit circuit to be run on the actual quantum hardware.
"
"['entropy', 'information-theory', 'linear-algebra', 'max-entropy']"," Title: What is the relationship between these two definitions for the max-entropy?Body: On Wikipedia, the max-entropy for classical systems is defined as
$$H_{0}(A)_{\rho}=\log \operatorname{rank}\left(\rho_{A}\right)$$
The term max-entropy in quantum information is reserved for the following definition
$$H_{\max }(A)_{\rho}=2 \cdot \log \operatorname{tr}\left[\rho_{A}^{1 / 2}\right]$$
While these are just definitions, they go by the same name so is there a relationship between them?
What I know
The only thing I managed to prove was that $H_0(A)_\rho \geq H_{\max}(A)_\rho$. The proof is below. Let $\lambda_i$ be the eigenvalues of $\rho_A$ and $r$ be the rank of $\rho_A$. We have
\begin{align}
H_{\max}(A)_\rho &= 2\log(\lambda_1^{1/2} + .. + \lambda_n^{1/2})\\
&\leq 2\log \left(\frac{1}{r^{1/2}}\cdot r\right)\\
&=H_0
\end{align}
Is there perhaps a reverse version of this inequality
$$H_{\max}(A)_\rho\geq H_0(A)_\rho + \text{something}$$
which would justify using the same name for both quantities?
"
"['quantum-state', 'textbook-and-exercises']"," Title: What does a negative ket state represent?Body: I'm studying - well trudging through - Quantum Computing for Everyone by Bernhardt. Towards the bottom of the book's physical page 41 he states, "spins are given by either," and then shows an up state ket $|\uparrow\rangle$ and then a negative up state ket $-| \uparrow \rangle$. Nowhere did he mention a negative state ket and what it means. He then goes on to use the negative ket on page 42, but I'm lost.
I've looked on the Internet, but to no avail.
What does a negative ket $-| \uparrow \rangle$, or negative bra (if exists) for that matter, mean/represent within the introductory scope of Bernhardt's book?
Much appreciated.
"
"['nielsen-and-chuang', 'textbook-and-exercises', 'entropy', 'information-theory']"," Title: von Neumann entropy in a limiting caseBody: I am stuck with a question from the book Quantum theory by Asher Peres.
Excercise (9.11):
Three different preparation procedures of a spin 1/2 particle are represented by the vectors $\begin{pmatrix}
1 \\
0
\end{pmatrix}$ and $\frac{1}{2} \begin{pmatrix}
-1\\
\pm \sqrt{3}
\end{pmatrix} $. If they are equally likely, the Shannon entropy is $\log{3}$, and the von Neumann entropy is $\log{2}$. Show that if there are $n$ such particles, all prepared in the same way, the von Neumann entropy asymptotically tends to $\log{3}$ when $n \to \infty$.
Hint: Consider three real unit vectors making equal angles: $\langle u_i,u_j \rangle = c $ if $ i \neq j$ . Show that the eigenvalues of $\sum u_i u_i^\dagger$ are 1-c, 1-c and 1+2c."
The Shannon entropy can be easily calculated to be $\log{3}$. The density matrix
$
\hat\rho$ comes out to be
$$\begin{pmatrix}
\frac{1}{2} & 0\\
0 & \frac{1}{2}
\end{pmatrix}.
$$
Therefore, the von Neumann entropy also comes out to be $\log{2}$. However, in the second part, I am not able to get von Neumann entropy equal to $\log{3}$.
"
"['error-correction', 'stabilizer-code']"," Title: Are there any implications of the automorphism group in QECC?Body: We often see that classically automorphism group of an error-correcting code plays a crucial role in many computational problems. Are there any important implications that depend on this in quantum case?
One I could find was this fault tolerant computing. In that case automorphism group for underlying codes to CSS codes are mainly considered.
I am looking for more such applications of automorphism groups of QECC. Also in the case of stabilizer codes, does the automorphisms group have any direct relation to its stabilizer group, and is there a standard definition of "automorphism group" of relavance?
"
"['quantum-state', 'teleportation']"," Title: Why does describing a quantum state take an infinite amount of classical information?Body: In chapter 1 of Quantum Computation and Quantum Information by Michael A. Nielsen & Isaac L. Chuang, I came across this paragraph on quantum teleportation,
Intuitively, things look pretty bad for Alice. She doesn’t know the state $\lvert\psi\rangle$ of the
qubit she has to send to Bob, and the laws of quantum mechanics prevent her from
determining the state when she only has a single copy of $\lvert\psi\rangle$ in her possession. What’s
worse, even if she did know the state $\lvert\psi\rangle$, describing it precisely takes an infinite amount
of classical information since $\lvert\psi\rangle$ takes values in a continuous space. So even if she did
know $\lvert\psi\rangle$, it would take forever for Alice to describe the state to Bob.
So Alice and Bob share a qubit each from an EPR pair created long ago and now Alice wishes to teleport the state $\lvert\psi\rangle$ to Bob by only sending classical information.
I do not understand why describing $\lvert\psi\rangle$ takes an infinite amount of classical information, since to my knowledge, only the amplitudes of the basis vectors need to be known($\lvert\psi\rangle=\alpha \lvert 0\rangle+\beta \lvert 1\rangle$). Maybe I did not understand properly what it means for Alice to know a state $\lvert\psi\rangle$. Any guidance would be helpful. Thank you.
PS: I'm not from a Quantum mechanics background.
"
"['qiskit', 'programming', 'circuit-construction', 'ibm-q-experience', 'teleportation']"," Title: Composing teleportation circuit in Qiskit Circuit ComposerBody: I'm trying to create the teleportation circuit in IBM Qiskit Circuit Composer.
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg a[3]; // should be crz
creg b[4]; // should be crx
h q[1];
cx q[1],q[2];
barrier q; //[0];
cx q[0],q[1];
h q[0];
barrier q;
measure q[0] -> a[0];
measure q[1] -> b[0];
barrier q;
This gives me the following circuit till the 3rd measurement barrier. How do I add CRX and CRZ gates - to obtain the circuit as shown in the picture? Also, how to change the names of the classical registers from a3, b4 to crz and crx?
"
"['qiskit', 'programming', 'quantum-state', 'ibm-q-experience', 'teleportation']"," Title: How to verify teleportation was successful in this circuit?Body: In this circuit (link), q0 is Alice's qubit and q1, q2 are entangled qubits given to Alice and Bob respectively. After measuring q2 in this circuit, how can it be verified that the state of q0 and q2 are the same?
By default, q0 is in ground state, I assume. So, shouldn't q2 be also in the ground state if the state was teleported.
"
"['programming', 'mathematics', 'hamiltonian-simulation', 'vqe', 'qaoa']"," Title: How to implement the Mixer of Quantum Alternating Operator Ansatz for Max-Independent-SetBody: I am trying to implement the Mixer of the Max-Independent Set from The Quantum Alternating Operator Ansatz.
From this paper: https://arxiv.org/pdf/1709.03489.pdf in Chapter 4.2 page 15 to 17.
For every verice $v$ in the Graph this operator $H_{CX,v}$ is definded. ($nbhd(v)$ are all the neighbors of v)
\begin{align*}
H_{CX,v} &= X_{v} H_{NOR(x_{nbhd(v)})} \\
&= 2^{-D_{v}}X_{v}\prod_{w \in nbhd(v)}(I + Z_{w})\\
\end{align*}
Then the operators for all vertices are summed up.
Are there any rules how to sum up operators?
$$H_{CX} = \sum_{i = 0}^{n-1}H_{CX,v_{i}}$$
After that the exponential of the Matrix is calculated.
I have no clue how to do that.
$$U_{sim-CX}(\beta) = e^{-i\beta H_{CX}}$$
Should I maybe do a Hamiltonian-simulation or are there other ways for doing this?
Thanks for reading :)
"
"['physical-realization', 'clifford-group']"," Title: Average execution time for T gateBody: Using the Q# resource estimator, I found out that my program, meant to do graph coloring using Grover's algorithm, could be decomposed into ~500-1000*x T gates, where x in the number of iterations, often ranging between 5 and 10. This means I am considering thousands of T gates.
I am considering T gates because they can be a universal gate when paired with the Clifford group which is easy to simulate.
I am interested to know the average time it would take for a quantum computer (any type) to execute one of these T gates, time which I would then multiply to estimate the runtime of my program.
Thanks for reading !
"
"['shors-algorithm', 'quantum-fourier-transform', 'hidden-subgroup-problem', 'fourier-sampling']"," Title: Abelian Hidden Subgroup Problem for arbitrary cyclic p-GroupsBody: I had asked a question similar to this one here regarding how to handle the HSP for groups whose cyclic decomposition contains factors whose order is not a power of two. I also had some prior misunderstanding that I think I worked out. It was answered that one method for approximating the QFT over arbitrary cyclic groups is from Andrew Child's notes section 4.4 (also mentioned in more detail here section 3.4) .
Method 1:
To summarize the approach, this method utilizes the ability to prepare arbitrary uniform super-positions (i.e. algorithm used by Qiskit.initialize) and controlled phase-shifts to produce the operation:
$|x, 0\rangle \mapsto |x, y\rangle$, where $|y\rangle = QFT_{p^n}(|x\rangle).$ (1)
Then given the phase-estimation applied to the cyclic-shift operator, $U_{p^n}: |x\rangle \mapsto |x + 1 \rangle $, produces the operation $|0,y\rangle \mapsto |\tilde{\frac{x}{p^n}}, y\rangle$ (where $|y\rangle$ = $QFT_{p_n}(|x\rangle)$)). Multiplying the left register by $p^n$ produces:
$|0,y\rangle \mapsto |\tilde{x}, y\rangle$ (2)
and inverting this allows us to clear out the left
register containing $x$ in (1), and thus approximate $QFT_{p^n}$.
However, even in a simulator, with small examples like $p^n = 9$, the multiplication operation, with the required precision, seems to be infeasible (or just takes a really long time). I implemented this, and the algorithm I used for multiplication is the modular multiplication algorithm here
Method 2:
However, I found a possible alternative mentioned here (page 9), which states quote:
If we use $F^{−1}_{p^{m_j}}$we would determine $t_j$ [an element of the dual group/character] exactly,or we could use the simpler $F^{−1}_{2^{k}}$, for some $k >log_2(p^{m_j})$, and obtain $t_j$ with high probability [...] In practice we could use $F^{−1}_{2^{k}}$ for a large enough $k$ so that the probability of error is sufficiently small.
Thus it seems this is a similar approach to Shor's: apply $QFT_{2^k}$ for large enough $k$, and then apply continued fractions. However, Shor's is for the HSP in $\mathbb{Z}$. So I'm not sure how to properly apply this method to $\mathbb{Z}_{p^n}$; I just tried to use $QFT_{2^k}$, $p^{2n} < 2^k < 2p^{2n}$ like in Shor's, which didn't seem to work. There also seems to be no proof of its validity for $\mathbb{Z}_{p^n}$. The paper mentions it briefly, and there is no reference annotated. I also couldn't find this method referenced anywhere else.
So my questions are:
- What is the correct way to apply 'method 2' (assuming my understanding of it is correct)?
- Is there any known way to speed up the multiplication required for 'method 1'?
If there is an entirely other way of going about this, please feel free to mention as well.
I'm trying to implement some small examples for learning purposes that are feasible on simulators.
"
"['qiskit', 'programming']"," Title: Cannot get the counts of a job in Qiskit with the usual commandBody: When I use job.result().get_counts I am getting this result:
<bound method Result.get_counts of <qiskit.result.result.Result object at ...>>
but no counts at all. I have tested it both with a new job and with an old one and in both cases the counts are not shown.
"
['shors-algorithm']," Title: What is a maximal number factored by Shor's algorithm so far?Body: With reference to a similar question here, I would like to know what is the maximal number which has been factored with Shor's algorithm so far on actual quantum hardware.
The reason I am asking a similar question as the link is that this question is from 2018 and I would expect that some progress has taken place since that time, especially in light of introducing a 65 qubits processor by IBM.
I also saw some other techniques for factoring integers to primes but these are based on converting the factorization problem to QUBO instead of period finding as in the case of Shor's algorithm:
These algorithms are able to factor integers in an order of ten or a hundred thousand but according to my knowledge, Shor's algorithm has been demonstrated on very simple cases like factoring 15, 21, and 35.
I also found adapted Shor's algorithm described in An Experimental Study of Shor's Factoring Algorithm on IBM Q, which should provide better performance on processors with a limited (small) number of qubits. However, again only numbers 15, 21, and 35 were factored in.
I would appreciate it if anyone can me provide a link to the paper(s) discussing progress in Shor's algorithm implementation.
"
"['mathematics', 'measurement', 'vqe']"," Title: Measuring Pauli strings using generatorsBody: I am trying to find the ground state of a Hamiltonian using VQE. I have decomposed the Hamiltonian into a set of Pauli strings. To decrease the number of actual measurements that has to be done, can I just measure the generators of this set of Pauli strings? For example, say if the set is $\{I, Z_1Z_2, Z_2Z_3, Z_1Z_3\}$, can I just measure $Z_1Z_2$, and $Z_2Z_3$, and then find the expectation value of $Z_1Z_3$ from the expectation values of $Z_1Z_2$ and $Z_2Z_3$?
"
"['qiskit', 'programming', 'circuit-construction', 'matrix-representation']"," Title: Creating a custom gate (given by a matrix) more efficientlyBody: I have the following gate (as represented by its matrix) on $4$ qubits which I hope to use in an error-detection code
$$M=\left(
\begin{array}{cccccccccccccccc}
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 & 1 & 0 & 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 & 1 & 0 & 0 & 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 & 1 & 0 & 0 & 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 & 1 & 0 & 0 & 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 & 1 & 0 & 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 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
\end{array}
\right)$$
Naively, it is possible to make this gate using the following configuration of generalized toffoli gates and $X$ gates:
However, this is already past what is feasible to do on current machines. My question is: Is there a better way to implement $M$ or has previous research been done to create gates whose matrix representations consist solely of $0$s and $1$s. This is not the only gate that I could implement that would serve my purposes (in fact, there are $(4!)^4=24^4=331176$ matrices that would work), but this is the 'simplest' one (simplest as in it presents the most symmetry).
"
"['quantum-state', 'measurement', 'density-matrix', 'partial-trace', 'trace-distance']"," Title: Trace distance bound after partial traceBody: Let's say I have a pair of states among three parties Alice(A), Bob(B) and Eve(E), $\rho_{ABE}$ and $\rho_{UUE}$ where the first two parties hold uniform values U.}
I know that the trace distance between them is upper bounded by some small quantity $\epsilon$. Like:
$$
||\rho_{ABE} - \rho_{UUE} ||\le \epsilon .
$$
Now, I take the partial trace on B's subsystem, leaving only operators $\rho_{AE}, \rho_{UE}$. What can I say about the trace distance of these two operators? Would the same bound be followed? I.e. is it the case that:
$$
||\rho_{AE} - \rho_{UE} || \le \epsilon.
$$
"
"['entanglement', 'bloch-sphere', 'concurrence']"," Title: How to sample from the uniform distribution over the tensor product of two Bloch spheres?Body: For some context, I am trying to assess the capacity that certain two qubit gates have to create entanglement. To do this I am using the idea of "entangling power", where one takes their favorite entanglement measure and takes some distribution over all the possible input states averaging over them to find the resulting concurrence.
I want to take a uniform distribution over all my possible inputs which would mean taking a uniform distribution over the tensor product of two Bloch Spheres.
I'm struggling to understand how to do this.
I feel the approach should be somewhat similar to what one would need to do to solve this Exercise from Preskill's notes
but the jump of sampling from one to two Bloch Spheres does not seem obvious or simple to me.
In this paper, a sample over one Bloch Sphere is taken also.
Any ideas of how I should approach this?
"
"['complexity-theory', 'quantum-advantage', 'random-quantum-circuit']"," Title: Could random quantum circuits be efficiently approximately simulated?Body: Google's landmark result last year was to compute a task with a quantum computer that a classical computer could not compute, and they chose random circuit sampling. Part of their justification was complexity-theoretic reasons that, if one can efficiently compute this classically, it collapses the polynomial hierarchy (they cite 1,2,3 for this). Paper 2 in that list says that the hardness result comes from a reduction to computing the permanent of a random matrix.
Based on a quick search, computing an approximation to the permanent seems to be easy for many classes of random matrices. So is it possible there is some classical algorithm that could efficiently approximate the random circuit sampling problem?
Second, is the quantum computer solving this exactly or approximately? I'm not quite sure what that means to approximately sample (since sampling is inherently noisy anyway). That is: if I had a quantum computer that was (up to some noise) sampling from random circuits, and a classical computer efficiently approximating the same task, could you tell the difference?
"
"['quantum-state', 'quantum-operation', 'information-theory']"," Title: Alternative definition of the coherent information of a quantum channelBody: Let $T: M_n \to M_n$ be a quantum channel. If I understand Definition 13.5.1 of the book "Quantum information theory" of Wilde, the coherent information $Q(T)=\max_{\phi_{AA'}} I(A \rangle B)_\rho$ of $T$ is given by
\begin{equation}
Q(T)
=\sup_{\rho \textrm{ pure}} \Big\{H\big((\mathrm{tr} \otimes T)(\rho)\big)-H\big((\mathrm{Id} \otimes T)(\rho)\big)\Big\}
\end{equation}
where the supremum is taken over all bipartite pure states $\rho$ on $M_n \otimes M_n$.
It is true that we can replace the supremum by a supemum on all states (not necessarily pure) ?
"
"['qiskit', 'measurement']"," Title: Can I partially collapse the wavefunction in Qiskit?Body: I'm trying to do something similar to this question, where I want to partially measure the system before getting the output. In particular, say I have 4 qubits. I want to measure two of them, and then get the state vector associated with the other two. I know that I can do this the following way:
- Measure the 2 qubits.
- Perform a partial trace on those two qubits (so that my output vector only has $2^2$ components instead of $2^4$).
- Call the statevector function to get the state on my other 2 qubits.
The problem is that I need to actually get the statevector in Step 2 before performing the partial trace. This means the system has to produce the statevector, taking up a lot of memory and limiting the number of qubits I can scale to.
My question is: Is there a way to collapse the wavefunction and then get the statevector out on only the remaining qubits without having the system calculate the whole statevector beforehand?
I don't know if this is a reasonable question, but I was wondering if it could be done.
"
"['circuit-construction', 'quantum-operation', 'universal-gates']"," Title: Why do the constant operations in a quantum computer need second qubits?Body: From what I'm reading, building the constant-1 and constant-0 operations in a quantum computer involves building something like this, where there are two qubits being used. Why do we need two?
The bottom bit in both examples is not being used at all, so has no impact on the operation. Both operations seemingly only work if the top qubit's initial value is 0 so surely what this is just saying is that this is an operation which either flips a 0 or leaves it alone - in which case what is the second qubit needed for? Wouldn't a set-to-0 function set the input to 0 whatever it is and wouldn't need one of its inputs to be predetermined?
Granted, the 'output' qubit is for output, but it's value still needs to be predetermined going into the operation?
Image is from this blog but I've seen it come up in other blogs and videos.
"
"['algorithm', 'adiabatic-model', 'graph-isomorphism']"," Title: What is known about quantum algorithms for graph isomorphism?Body: Shor's algorithm (for factoring integers) and Grover's algorithm (for searches) are the two most well-known quantum algorithms. I was wondering if there was a similar result in QC that dealt with the Graph Isomorphism problem?
I can't seem to find a consensus online. I've found two references:
- This paper published in the Physical Review gives an algorithm for graph isomorphism, but it seems as if the algorithm doesn't give any complexity bound. It seems to explain that doing so is hard in adiabatic QC (I'm not too familiar with this so I don't know if I'm understanding this right; would also appreciate if someone could clear this up for me).
- In this paper, the authors claim they have found a poly-time quantum algorithm for the problem, though there is no record of review and this paper remains unpublished. I wasn't sure if people had actually reviewed this and determined whether it was correct or not.
"
"['mathematics', 'textbook-and-exercises', 'trace-distance']"," Title: Prove that the trace norm is dual to the spectral normBody: Suppose $A\in L(X,Y)$. $||\cdot||$ denotes spectral norm and denotes the largest singular value of a matrix, i.e. the largest eigenvalue of $\sqrt{A^*A}$.
$||\cdot||_{tr}$ denotes trace norm. We have that
$$||A||_{tr}=tr\sqrt{A^*A}$$
So I would like to prove the statement that
$$||A||_{tr}=\max\{|tr(A^*B)|: B\in L(X,Y), ||B||=1 \}$$
I know that from Nielsen and Chuang lemma 9.5 that
$$|tr(AU)|\le tr |A|$$ and equality is achieved by a unitary.
We have by definition that $|A|=\sqrt{A^*A}$. So $||A||_{tr}=tr|A|$.
I think my question is if $B$ is not a unitary but has norm 1, can we have that
$$|tr(AB)|> tr |A|\ge |tr(AU)|$$ for any unitary? And if yes, why the maximum is still achieved by a unitary?
"
"['entropy', 'information-theory', 'classical-quantum']"," Title: Is ""classical information"" the same as ""Shannon information""?Body: does Shannon meet Feynman?
Bits underlie classical information measurements in information theory, while qubits underlie quantum information measurements in, what I can only assume to be called, quantum information theory.
Information theory is a field attributed to Claude Shannon, who calculates bits as logarithmic probabilities, which are what I mean here by Shannon information.
- Are Shannon information and what everyone here is calling "classical information" the same?
- What is the analogue of Shannon's information theory for quantum information? I have more often heard the term "quantum theory of information", but not sure if this exactly corresponds to what I have in mind as to what "quantum information theory" would mean in the Shannon sense.
- How does quantum information relate to, diverge from or reduce to Shannon information, which used log probabilities?
"
"['resource-request', 'information-theory', 'history']"," Title: Wheeler's ""information theoretic"" derivation of quantum informationBody: 1980s. John Wheeler at the University of Texas would tell his students, “Give an information theoretic derivation of quantum theory!” Information theoretic is an adjective for Claude Shannon's information theory, which used log probabilities to represent bits.
With this desperate call to make quantum theory relatable to information theory, or molded in its likeness, is the link between Shannon's information theory unnaturally linked to "quantum theory of information"? In other words, is the connection between them man-made (superficial) and quantitatively contrived? or are classical and quantum information naturally bonded?
What did Wheeler's career conclude about the connection between information theory and quantum theory (quantum information)? Was he able to derive it information theoretically, and what exactly is the derivation?
"
"['entropy', 'information-theory', 'classical-quantum', 'max-entropy', 'probability']"," Title: Relating quantum max-relative entropy to classical maximum entropyBody: The quantum max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\},$$
where $\rho\leq \sigma$ should be read as $\sigma - \rho$ is positive semidefinite. In other words, $D_{\max}$ is the logarithm of the smallest positive real number that satisfies $\rho\leq\lambda\sigma$.
In classical information theory, the maximum entropy principle designates the Normal distribution as being the best choice distribution amongst other candidates because it maximizes Shannon entropy,
$$H(X) = -\int_{-\infty}^{\infty} f(x) \ln f(x) \enspace dx$$
where $f(x)$ is a probability distribution of random variable $X$.
Can the first measure be extended to probability distributions, rather than binary states, to coincide with the second? How are quantum max-relative entropy and maximum entropy related, given that maximum entropy, in the classical sense, represents a highly disordered and unconcentrated state?
"
"['qiskit', 'programming']"," Title: How can I obtain a unitary matrix of quantum circuit with angles as parametric?Body: I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. (I received a response to this part of my question before in the link: How can I obtain transformation matrix of a quantum circuit in the Qiskit?) and now I want to do this work as a parametric. For example, I want to define gate T as
$$
\begin{pmatrix}
1 & 0 \\
0 & w
\end{pmatrix}
$$
where $w=\frac{(1+i)}{\sqrt{2}}$, and I want to obtain the transformation matrix of the circuit with parameter $w$ and not as numeric. How can I do this?
"
"['algorithm', 'qaoa']"," Title: Optimum Solution calculation for QAOABody: In QAOA, for the MaxCut problem, one tries to find a good ratio, as close to 1 as possible, of $\epsilon = \frac{C_{approx}}{C_{opt}}$, where $C_{approx}$ is the approximate value of the cost function for some configuration of spins and $C_{opt}$ is the optimum cost value for the given graph. I want to calculate $\epsilon$ for some random instances of the MaxCut problem (with small number of vertices) and test how good the algorithm behaves.
In order to do that though, I need the exact solution of a given instance. I was wondering what is the best way to calculate it? Do a brute force in the whole configuration space? Finally, is there any Python library that will help me with my problem of obtaining the optimum solution, given the graph?
"
"['programming', 'ibm-q-experience']"," Title: No backends assigned to my AccountBody:
When I open my account on IBM Quantum Experience, I am shown 9 backends that are assigned to me. But when I open any of my circuits, I get the error that "This account has no backends assigned". This is a rather new problem, as I was able to access backends before but now I am unable to run my circuits anymore.
"
"['qiskit', 'programming', 'circuit-construction', 'noise']"," Title: How to intentionally add noise to a Qiskit circuit?Body: I am attempting to intentionally add noise to my qiskit circuit by applying n-pairs of CNOT gates. The effect of this should be to yield the same result of my baseline (no pairs of CNOT gates applied) circuit with the addition of some noise. However, the result of my "noisy" circuit looks the same as my baseline even for large n. My best guess is that qiskit automatically removes unnecessary operations (like a pair of CNOTs) in an effort to reduce the number of gates. If this is true, then how can I add a series of gates which will keep the baseline circuit the same but will add gate noise?
"
"['programming', 'ibm-q-experience', 'noise', 'bernstein-vazirani-algorithm']"," Title: Bernstein-Vazirani Gate IBM Q NoiseBody: When running the attached Bernstein-Vazirani gate on IBM Q, with 1024 shots on ibmq_16_melbourne, I receive the expected result of "00110" with 26.563% success. I notice that there is a lot of noise in the results and am curious about what the cause of this could be? Is there any way to reduce this noise in order to get a higher chance of success for my expected result?
"
"['programming', 'quantum-state', 'entanglement', 'measurement', 'cirq']"," Title: Cirq-Measuring a State with Rotation MatrixBody: I have this state:
$$p |\text{GHZ}\rangle \langle \text{GHZ}| + (1-p)\rho$$
And after creating this state I have this code lines:
state = p * GHZ+(1-p)* rho
state = p * GHZ + (1 - p) * rho
print(f"final state: \n {state}")
print(cirq.sample_density_matrix(state, indices=[0, 1, 2], repetitions=10))
Now I want to measure this state. I know we have cirq.measure in Cirq But I don't know which kind of measurement is used by this function (and the last line is also doing measurement if I am not wrong??)
cirq.measure(a, b, c)
I have 3 questions
- I want to use rotation matrix and measure my state. Do we have rotation matrix in Cirq. Can you please show me how can I measure my state with rotation matrix in Cirq?
- I want to choose x and Y randomly and I want to do measurement
- Which kind of measurement is used by Cirq.measure() and (cirq.sample_density_matrix(state, indices=[0, 1, 2], repetitions=10))
cirq.measure(a, b, c)
(cirq.sample_density_matrix(state, indices=[0, 1, 2], repetitions=10))
Best and thanks
"
"['quantum-state', 'density-matrix', 'entropy', 'information-theory', 'classical-quantum']"," Title: Quantum analogues of information theoretic measures: are log probabilities replaced with the density matrix?Body: Below is a question and an answer.
How does quantum information relate to, diverge from or reduce to
Shannon information, which used log probabilities?
What people are more often interested in are averaged quantities such
as entropies, conditional entropies and mutual information. These have
direct quantum analogues, calculated based on density matrices of
qubits rather than classical probability distributions. The density
matrix still represents a probability distribution but, rather than
using a single fixed basis (i.e. the "0" and "1" of a bit), there's a
continuous range of possibilities, which change the actual
calculations a bit.
Information theoretic measures are all based on log probabilities. What do log probabilities in classical information theory become in quantum information theory?
What are the quantum analogues of entropy, conditional entropy and mutual information? their formulas, and how are they computed from density matrices of qubits (rather than probability distributions)?
"
"['quantum-gate', 'ibm-q-experience', 'quantum-operation']"," Title: How to perform this $d$-dimensional unitary operation on IBM Q?Body: $U_{a,b}=\sum^{d-1}_{x=0}\omega^{bx}|x+a\rangle\langle x|$,$\omega=e^{\frac{2\pi i}{d}}$,$a,b\in\{0,1,2,...,d-1\}$
Can someone please give me the pic of the quantum circuit?
"
"['quantum-state', 'teleportation', 'communication', 'foundations']"," Title: Quantum teleportation and the reality of quantum statesBody: This question is perhaps philosophical but it's been confusing me. Suppose Alice is teleporting some qubit state $|\phi\rangle$ to Bob via the quantum teleportation protocol. After Alice applies the operations necessary to her qubit and her half of the Bell pair, but before she sends that classical information over to Bob, by the no-communication theorem the state of Bob's pair should be the mixed state $1/2 (|0\rangle\langle0| + |1\rangle\langle1|)$. After she transmits her measurement outcome to Bob, however, it seems like Bob's state changes to some pure state, e.g. $|\phi\rangle$ if Alice happened to measure $00$. It's not important what exactly the state is, just that it seems to have changed from a mixed state to a pure state.
This seems to favor the thought that quantum states are not "really real" but measures of subjective (dis)information about a system. However that troubles me, because I've thought of quantum states as being literally real aspects of the universe. Perhaps the trouble is that we should not think of Bob's state by itself, since it is entangled -- but then that seems to lead us to a non-manifestly local description of quantum theory, which I also find bothersome. I guess I'd just like to know what do people make of this.
"
"['algorithm', 'complexity-theory', 'models']"," Title: PreciseQMA = PreciseBQP gives PP = PSPACEBody: $\text{PreciseBQP}$ is defined as $\text{BQP}$ with inverse exponentially close completeness and soundness bounds (for a better definition, see Section 3.1 here, in the paper by Gharibian et al). Similarly, $\text{PreciseQMA}$ is $\text{QMA}$ with inverse exponentially close completeness and soundness gaps (for more details, see Remark 5 here, in the paper by Fefferman and Lin). It is known that
\begin{equation}
\text{PreciseBQP} = \text{PP}, \\
\text{PreciseQMA} = \text{PSPACE}.
\end{equation}
For more details, see Figure 1 here (paper by Deshpande et al). However, it seems obvious to me that
\begin{equation}
\text{PreciseQMA} \subseteq \text{PreciseBQP}.
\end{equation}
This is because one can simply replace the quantum witness given by the prover by the maximally mixed state, similar to the trick in Theorem 3.6 here, in the Marriott. We take an inverse exponential hit in the completeness and soundness bounds, but since the completeness and soundness bounds are inverse exponentially close in $\text{PreciseBQP}$, to begin with, we do not care.
However, if this is true, then it implies $\text{PP} = \text{PSPACE}$.
What am I missing?
"
"['qiskit', 'programming']"," Title: How to repeat circuit efficiently and reliably in IBM Qiskit?Body: I'm having a problem in IBM Qiskit with my qubit identities switching places during transpilation. I've been told by developers on the Qiskit slack server that there's currently no built-in way to fix this problem. I'm wondering if anyone has found one themselves.
The issue is that I'd like to perform an algorithm like so:
- Prepare in an initial state
- Apply a circuit
U repeatedly n_iter times
- Measure
I also want this algorithm to:
- Be reasonably efficient with gates (specifically noisy CNOTs)
- Have the same error for
U for each iteration of it
This turns out to be a headche. When U is complicated, it becomes difficult for the transpiler to efficiently decompose it to native gates. This difficulty goes up for U*U and U*U*U since they're longer. So if I were to transpile the whole algorithm at once (with many U's), it certainly won't give an efficient gate decomposition, and won't have the same error for each iteration of U.
The solution I thought would be reasonable is to transpile U on its own, then compose it with itself. But this hits a problem. The transpiler likes to switch qubit identities (and add global phase, and maybe more?) while searching for a more efficient circuit. So if I follow my algorithm as stated above, U will not line up correctly with the prep or measurement, and my results will be wrong.
I've been told by developers on the slack that there's currently no built-in way to fix this. The transpiler does not report a final_layout of the qubits.
I've been trying to determine the final_layout by hand by comparing the transpiler output to my intended circuit plus swap gates (up to a global phase), but I'm even failing at this.
Does anyone have either working code to determine the final_layout, or a better approach to implementing this algorithm?
EDIT: Code and more info is included in my partial answer below
EDIT 2: See further clarification here: Qubit identities get swapped in IBM Qiskit
(This issue is remarkably difficult to communicate clearly)
"
['programming']," Title: How many shots should one take to get a reliable estimate in a quantum program?Body: When testing my quantum programs, I wonder how many shots I must take to get a specific accuracy.
Are there any papers that you can recommend that analyze this?
"
"['qiskit', 'programming', 'simulation']"," Title: Qiskit ""statevector_gpu"" method not availableBody: I am trying to use the statevector_gpu simulation method in Qiskit Aer (see this page). I installed qiskit-aer-gpu according to the instructions on this page. It was working last week and then stopped working. I'm not sure what changed. (It's a shared computer.) I get the error message qiskit.providers.aer.aererror.AerError: "Invalid simulation method statevector_gpu. Available methods are: ['automatic', 'statevector']".
Thanks in advance for the help!
Here is the relevant system information:
- It is a shared computer running
Ubuntu 18.04.4 LTS.
- I have
qiskit 0.23.0, qiskit-aer 0.7.0, qiskit-aer-gpu 0.7.0 installed in an environment in conda 4.8.5 with python 3.8.5.
nvcc --version gives Cuda compilation tools, release 10.0, V10.0.130
nvidia-smi shows 4 GPUs available and indicates CUDA Version: 10.2.
"
"['quantum-state', 'density-matrix', 'textbook-and-exercises', 'notation']"," Title: How to represent the state vector form of a qubit in density matrix representation?Body: While I'm studying state vector and density matrix. I wonder how to write qubit state as density matrix. qubit state can be represented with state vector form. But how about density matrix?
"
"['quantum-gate', 'simulation', 'density-matrix']"," Title: Computation of qubits with quantum gates using density matrix formBody: I'm making a quantum circuit with qubits and quantum gates. While I'm doing it, I have some problem with it. My calculation process is below.
As you can see, start qubit is $|0 \rangle$ and after 'X' gate, the result will be $|1 \rangle$. And I checked if the result of quantum circuit and density matrix form of $|1 \rangle$ are different. As you can see, they are different.
Here are my questions.
- Why it occurs?
- If they are different, is my calculation wrong?
"
"['density-matrix', 'classical-quantum', 'wigner-function', 'probability']"," Title: What is the relation between density matrices and phase-space probability distributions?Body: According to its tag description, a density matrix is the quantum-mechanical analogue to a phase-space probability measure (probability distribution of position and momentum) in classical statistical mechanics.
How can I reconcile the concept and intuition behind a "probability distribution based on both position and momentum" found in statistical mechanics, with that of a matrix ensemble of 1's and 0's found in the quantum density matrix?
"
"['information-theory', 'max-entropy', 'relative-entropy']"," Title: When can the max relative entropy be written as $D_{\max}(\rho\|\sigma) = \|\sigma^{-1/2}\rho\sigma^{-1/2}\|_{\infty}$?Body: The max-relative entropy between two states is defined as $D_{\max}(\rho\|\sigma) = \log\lambda$, where $\lambda$ is the smallest real number that satisfies $\rho\leq \lambda\sigma$, where $A\leq B$ is used to denote that $B-A$ is positive semidefinite.
An alternative way to express the max relative entropy is
$$D_{\max}(\rho\|\sigma) = \|\sigma^{-1/2}\rho\sigma^{-1/2}\|_{\infty},$$
where $\|\cdot\|_\infty$ is the operator norm which essentially picks out the largest eigenvalue. I see that the essential idea is
\begin{align}
\rho &\leq \lambda\sigma \\
\sigma^{-1/2}\rho\sigma^{-1/2}&\leq \lambda I
\end{align}
Choosing the smallest possible $\lambda$ results in equality and hence one recovers $D_{\max}(\rho\|\sigma)$ this way.
I assumed that $\sigma^{-1}$ here is obtained by
- Diagonalizing $\sigma$
- Taking the reciprocal of all nonzero eigenvalues and leaving zero eigenvalues as they are
- Undiagonalizing $\sigma$ again.
However, this doesn't make sense because to me because when the support of $\rho$ is bigger than the support of $\sigma$, $D_{\max}(\rho\|\sigma) = \infty$. However, it looks like $\|\sigma^{-1/2}\rho\sigma^{1/2}\|_\infty$ can never be infinity.
So how does one obtain $\sigma^{-1}$?
"
"['complexity-theory', 'hamiltonian-simulation', 'qma']"," Title: How close is the history state to the ground state in the Kitaev clock construction?Body: Consider a standard circuit to Hamiltonian reduction in QMA. For example, refer here (Vazirani's lecture notes) or page 235 of here (survey by Gharibian et al).
The history state of the Kitaev clock Hamiltonian $H$ is given by:
\begin{equation}
|\psi_{\text{history}}\rangle = \frac{1}{\sqrt{T + 1}} \sum_{i = 0}^{T} V_{i} V_{i - 1} \cdots V_{1} |00 \cdots 0 \rangle |\psi\rangle |i\rangle_{\text{clock}},
\end{equation}
where $V = V_{T} V_{T-1}\cdots V_{1}$ is the circuit that the QMA verifier, and $|\psi\rangle$ is the state sent by the prover. Note that $|\psi_{\text{history}}\rangle$ is not the ground state of $H$. But how close is it to the ground state?
In other words, if $|\psi_{\text{ground}}\rangle$ is the ground state of the Kitaev clock Hamiltonian $H$, I am trying to find
\begin{equation}
|| |\psi_{\text{ground}}\rangle - |\psi_{\text{history}}\rangle ||.
\end{equation}
"
"['qiskit', 'programming']"," Title: Unknown error code [5204] when running job on IBM's qasm_simulatorBody: I am submitting a job to ibmq_qasm_simulator and after the validation I repeatedly get the error "Error running job on a simulator. [5204]" The site with error descriptions https://quantum-computing.ibm.com/docs/manage/errors does not have an entry for the error code 5204, so it is impossible to know what causes the error and how to fix it. Can anybody help with this?
"
"['programming', 'algorithm', 'cirq', 'hhl-algorithm']"," Title: Implementing the HHL algorithm with negative eigenvalues (Cirq)Body: How do I implement the HHL with negative eigenvalues?
This paper (https://arxiv.org/abs/1803.01486) says that:
what if $\lambda<0$? This problem actually does not hard to solve, since we can choose $t$ small enough, such that $|\lambda t| < \pi$. So if $2 \pi y/N > \pi$, then we believe that $\lambda t = 2 \pi y/N − 2\pi=−2\pi (N−y)/N$.
However, doing so introduces a problem at $\lambda = 0$, where the solution diverges.
Note 1: In Cirq, the code only works where eigenvalues of the Hamiltonian is positive. How do I adjust this code so it also works with negative eigenvalues?
https://github.com/quantumlib/Cirq/blob/master/examples/hhl.py
Note 2: in Qiskit,the quantum phase estimation EigsQPE has an input negative_evals. It seems this adds one more ancilla qubit. What do that they do here?
https://qiskit.org/documentation/stubs/qiskit.aqua.components.eigs.EigsQPE.html
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'bloch-sphere', 'notation']"," Title: What is the difference between the states $i|1\rangle$ and $|+i\rangle$?Body: I am new to Quantum computing.
I see $|\mbox{+}i\rangle$ state maps to y-axis on bloch sphere ($\theta = 90$ degree and $\phi = 90$ degree) while $i|1\rangle$ maps on x-axis, $i|1\rangle$ is stated as $|1\rangle$ with global phase $i$ ($\theta = 180$ degree and $\phi = 90$ degree).
But both the notation ie. $i|1\rangle$ and $|\mbox{+}i\rangle$ looks very similar to me. How do we interpret that something is global phase while reading it.
"
"['quantum-state', 'textbook-and-exercises', 'notation']"," Title: Is it wrong to say that $a$ and $b$ are the square roots of the detection probabilities in a qubit state $|\psi \rangle = a|0 \rangle +b|1 \rangle $?Body: Is it wrong to say in $a$ and $b$ are the square roots of the probability of the qubit being in the state 0 and 1 when measured for a qubit in the state $|\psi \rangle = a|0 \rangle +b|1 \rangle $? And by that definition how can $a$ and $b$ be imaginary numbers?
"
"['measurement', 'density-matrix', 'communication']"," Title: Proof of the no-communication theoremBody: Let $A, B$ be (finite-dimensional) Hilbert spaces, and $\rho$ some mixed state of $A \otimes B$. I am trying to show that a measurement performed on the '$A$-subsystem' does not affect $\rho^B = \text{Tr}_A(\rho)$.
I understand a 'measurement performed on the $A$-subsystem' as given by some observable $X \otimes I$, where $X$ is a self-adjoint operator on $A$ which decomposes as $X = \sum m P_m$ (where $P_m$ is the orthogonal projection on the $m$-eigenspace). If this measurement results in outcome $m$, the resulting state should be
$$\rho' = \frac{(P_m \otimes I) \rho (P_m \otimes I)}{\text{Tr}((P_m \otimes I) \rho)}$$
and I wish to see that $\text{Tr}_A(\rho') = \text{Tr}_A(\rho)$. Now I can use the cyclicity of trace to see that
$$\text{Tr}_A(\rho') = \frac{\text{Tr}_A((P_m \otimes I) \rho)}{\text{Tr}((P_m \otimes I) \rho)}$$
but why should this be equal to $\text{Tr}_A(\rho)$? I did check this is the case if $\rho = \rho^A \otimes \rho^B$ decomposes as a product. And I know a general $\rho$ will be a linear combination of such cases; but since the equality desired is not linear, it does not seem to follow that it'll hold (in fact, it seems to indicate it will not hold). Hopefully someone can point to the mistake in my thinking.
"
"['quantum-gate', 'mathematics', 'unitarity', 'notation']"," Title: What are the physical meanings of the outer product when writing expressions for unitary gates?Body: I'm really confused with the interpretation of those equations:
$1.$ The evolution of states under unitary operations can be expressed as
$$
U = \sum_k\exp(i\phi_k)|\psi_k\rangle\langle\psi_k|
$$
$2.$ The controlled operation in quantum computing is defined as
$$
|0\rangle\langle0|\otimes I + |1\rangle\langle1|\otimes e^{i\alpha}I = \begin{bmatrix}
1 & 0\\
0 & e^{i\alpha}
\end{bmatrix}
\otimes I
$$
I'm not pretty sure how to understand them. Also, the outer product is present in both equations, so I'm wondering could those equations be explained in terms of the projection operator? What are the physical meanings of the outer product?
Thanks:)
"
"['qiskit', 'ibm-q-experience', 'quantum-circuit']"," Title: What's meant by the depth of a quantum circuit?Body: I'm using Qiskit to create quantum circuits wherein I've this attribute called depth. The documentation states it is the length of the critical path here. What does it represent and how to find it out manually?
"
"['programming', 'quantum-state', 'measurement', 'cirq']"," Title: Cirq - Measure Density Matrix Function Getting First ElementBody: Hello I am using measure density matrix function like that:
for i in range (10):
measurement_result = cirq.measure_density_matrix(state,indices=[0, 1, 2])
print("measurement",measurement_result)
And my results are like that:
As you can see, I have ([0, 0, 0], array([[0.36107099-0.36107099j, 0. +0.j , and I want to extract first part [0, 0, 0] (the qubit part) and then I will count how many [0, 0, 0] , [0, 0, 1] [0, 1, 0] … But I could not extract the first part of array. How can I get the first part [0, 0, 0] ?
Thanks ...
"
"['textbook-and-exercises', 'cryptography', 'fidelity', 'communication']"," Title: Non-ideal bit commitment and coin tossingBody: Can someone please explain rigorously the reasoning behing non-ideal ($\epsilon$-concealing and $\delta$-binding) bit commitment scheme and the impossibility of coin tossing.
What is bias in coin tossing? How to use non-ideal bit commitment scheme to come up with non-ideal coin tossing and how to estimate the bias.
Lo-Chau paper "Why quantum bit commitment and ideal coin tossing are impossible" has some of the details, but it looks like it omits a lot of details we could add 22 years later.
And I could not understand Mayers' work "Trouble with quantum bit commitment".
Thank you very much.
"
"['qiskit', 'programming', 'hhl-algorithm']"," Title: How to increase matrix size and getting high fidelity for HHL algorithm in Qiskit?Body: I have followed an example that Qiskit provides here.
I tried to increase the matrix size to 16x16 and change num_ancillae and num_time_slices in create_eigs() function.
# set the random seed to get the same pseudo-random matrix for every run
aqua_globals.random_seed = 0
matrix = random_hermitian(16)
vector = matrix.dot(np.array([1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1]))
m = np.array(matrix)
orig_size = len(vector)
matrix, vector, truncate_powerdim, truncate_hermitian = HHL.matrix_resize(matrix, vector)
# Initialize eigenvalue finding module
eigs = create_eigs(matrix, 2, 2, True)
num_q, num_a = eigs.get_register_sizes()
# Initialize initial state module
init_state = Custom(num_q, state_vector=vector)
# Initialize reciprocal rotation module
reci = LookupRotation(negative_evals=eigs._negative_evals, evo_time=eigs._evo_time)
algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
init_state, reci, num_q, num_a, orig_size)
result = algo.run(QuantumInstance(Aer.get_backend('statevector_simulator'),
seed_simulator=aqua_globals.random_seed,
seed_transpiler=aqua_globals.random_seed))
print("solution ", np.round(result['solution'], 5))
result_ref = NumPyLSsolver(matrix, vector).run()
print("classical solution ", np.round(result_ref['solution'], 5))
print("probability %f" % result['probability_result'])
fidelity(result['solution'], result_ref['solution'])
The result is
solution [ 0.19079-0.95092j 0.26228+0.11189j -0.30868-0.55258j -0.7612 +1.61692j
0.64665-0.26533j 1.20938-0.40916j -0.51564+1.98277j -0.08177-2.63386j
1.14807-0.1218j 0.87798+1.39184j 0.8494 +0.00695j -0.0529 -0.11107j
0.28287+0.74082j 1.3964 +0.23344j -2.15506+1.25378j 1.07591-0.70505j]
classical solution [1.+0.j 2.+0.j 3.-0.j 1.-0.j 1.+0.j 2.-0.j 3.+0.j 1.-0.j 1.-0.j 2.+0.j
3.+0.j 1.-0.j 1.+0.j 2.-0.j 3.-0.j 1.+0.j]
probability 0.000000
fidelity 0.040951
I got very low fidelity when I change num_ancillae to 2, if I increase num_ancillae to 3, my kernel just died without showing any error.
My questions are,
What cause my kernel died? Is it normal?
How does num_ancillae and num_time_slices affect the fidelity?
"
"['qiskit', 'hadamard']"," Title: Confused about the application of Hadamard gate to uncorrelated qubitsBody: Why does applying the following circuit on a $00$ state produce
$|0\rangle \otimes |+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$. Shouldn't it produce $ |+\rangle \otimes |0\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |10\rangle)$?
"
"['quantum-state', 'circuit-construction', 'applications', 'quantum-computing-for-finance']"," Title: Loading a random distribution using controlled-Y rotationsBody: In the paper by Stamatopoulos et al., the authors say that it is possible to load a distribution on a three qubit state to obtain:
In Qiskit finance this is performed using the uncertainty model function. My question is, how do you encode random numbers on qubit states?
Later is their paper they report that you can use controlled-Y rotations to load a random distribution, this way:
but I don't know how they pick the angle for the controlled rotation in order to obtain the desired number.
"
['qaoa']," Title: Quantum Approximate Optimization Algorithm for $p=1$Body: I was running instances of $3$-regular graphs with small number of vertices on Qiskit, and for $p=1$ the algorithm was giving always the exact solution for the MaxCut problem, after optimizing the parameters. I was wondering though, how do we know if a specific graph can't be solved on $p=1$ ? Do we know the limits of QAOA for $p=1$ in order to decide with certainty that extra layers are required, given the graph?
"
"['textbook-and-exercises', 'fidelity', 'communication']"," Title: Non-ideal coin tossingBody: Can someone please check if the following makes sense?
We have a non-ideal coin-tossing scheme as follows. Alice and Bob know what $|0\rangle,|1\rangle$ are. Bob wins when the coin is 1.
- Honest Alice commits a random bit $a\in \{0,1\}$. The state of their joint system with Bob is $|a\rangle ,$ while Bob has $\rho_a^B=Tr{|a\rangle\langle a|}$
- Bob chooses a bit $a'\in\{0,1\}$
- Alice reveals her guess.
- The coin is $c=a\oplus a'$.
Probability that $c=0$ is $p_0$ and similarly, the probability that $c=1$ is $p_1$. I need to determine bias Bob can achieve, i.e. bounds on $\max|p_0-p_1|$ if Bob is dishonest.
Now suppose, Bob is acting dishonestly and he wants the coin to be 1 in the end. He will try to guess what bit Alice has commited so he can choose the opposite. All he has is his reduced density matrix. He will try to distinguish $\rho_a^B$ from $\rho_0^B$ and from $\rho_1^B$.
By Holevo-Helstrom his probability of guessing correctly is at most $$\frac{1}{2}+\frac{1}{4}||\rho_0^B-\rho_1^B||_1.$$ Suppose, we are given that $F(\rho_0^B,\rho_1^B)\ge 1-\delta.$
We have the inequalities:
$$2-2F(\rho_0^B,\rho_1^B)\le ||\rho_0-\rho_1||_1\le 2\sqrt{1-F(\rho_0^B,\rho_1^B)^2}$$
Therefore,
$$1-\frac{F(\rho_0^B,\rho_1^B)}{2}\le \frac{1}{2}+\frac{1}{4}||\rho_0^B-\rho_1^B||_1\le \frac{1}{2}+\frac{\sqrt{2\delta-\delta^2}}{2}$$
Any feedback, any additional comments, references and suggestions are greatly appreciated.
"
"['quantum-gate', 'circuit-construction', 'entanglement']"," Title: What is k-state and how to go about creating a circuit?Body: The k-state is given by:
$$ |𝐾⟩ = \dfrac{\sqrt{3}|100⟩ − 𝑒^{𝑖π/4}|010⟩ + \sqrt{2}|001⟩}{ \sqrt{6}}$$
I am fairly new to quantum computing and do not have much background in the field. I understand the amplitudes of the state and the phases, however, how would one go about making a circuit for the same using the different quantum gates. I did refer to entangled states such as the W state, but I am unable to understand the underlying principle behind the combination of the gates used to create the circuit. In what direction should I go about constructing the k-state circuit.
"
"['quantum-gate', 'quantum-state', 'quantum-operation']"," Title: How can I find a quantum channel connecting two arbitrary quantum states?Body: Given two arbitrary density matrices $\rho, \sigma\in \mathcal{H}$ (they have unit trace and are positive), how do I go about finding a possible quantum channel $\mathcal{E}$ such that $\mathcal{E}(\rho)=\sigma$? $\mathcal{E}$ is a general CPTP map, as such it is 1) trace preserving, 2) convex-linear, and 3) completely positive. It admits a Kraus operator representation or can be expressed as a unitary operation (gate) on an extended Hilbert space via Stinespring dilation. Can one say something about the remaining degree of freedom in the choice of $\mathcal{E}$?
I am simply wondering how one goes about constructing a valid quantum channel (representing the most general form of evolution of a quantum system) which connects two fixed states. This is a very general problem: One can think of a situation where a quantum system is initialized in some fixed state $\rho$ and one would like to manipulate it ( $\leftrightarrow$ subject it to a given quantum channel) such that it ends up in a target state $\sigma$. As such, this question must be addressed in a plethora of quantum experiments... (Maybe someone can also simply point me to some relevant literature?)
"
"['hamiltonian-simulation', 'bloch-sphere', 'pauli-gates']"," Title: How does adding an identity to an Hamiltonian affect the corresponding time-evolution in the Bloch sphere?Body: For the Hadarmard Hamiltonian, $\hat H = (\hat X+\hat Z)/\sqrt 2$, where $\hat X$ and $\hat Z$ are Pauli matrices. The time evolution of a state under this Hamiltonian could be visualized by a rotation on the Bloch sphere with an axis
$$
\hat n = \frac{1}{\sqrt2}\begin{bmatrix}
1 \\
0 \\
1 \\
\end{bmatrix}
$$
However, I'm wondering if I have another Hamiltonian defined as
$$
\hat H_1 = \frac{1}{\sqrt3}(\hat X +\hat Z +\hat I)
$$
where $\hat I$ is the identity operator. Then what the role $\hat I$ would have on this Hamiltonian? If I still want to visualize the time-evolution rotation on the Bloch sphere, what the 'new' axis would be?
Thanks:)
"
"['resource-request', 'density-matrix', 'entropy', 'information-theory', 'classical-quantum']"," Title: Does the quantum Jensen-Shannon divergence appear in any quantum algorithms or texts on quantum computing?Body: The generalization of probability distributions on density matrices allows to define quantum Jensen–Shannon divergence (QJSD), which uses von Neumann entropy. Does QJSD appear in any quantum algorithms or texts on quantum computing?
"
['cryptography']," Title: (Why) does unconditionally secure multi-party quantum computation imply quantum bit commitment?Body: I have read in several papers now that information-theoretically secure multi-party quantum computation (MQPC) with a dishonest majority ($t \geq n/2$) is impossible because of the impossibility of unconditionally secure quantum bit commitment. Hence my question, why does MPQC imply the existence of quantum bit commitment? I would in particular be interested in how to combine the different frameworks of MPQC and quantum bit commitment protocols.
"
"['grovers-algorithm', 'complexity-theory', 'textbook-and-exercises']"," Title: Hybrid lower bound proof Kaye Laflamme Mosca (lemma 9.3.6)Body: I am confused about one point in the proof on the lower bounds in Kaye, Laflamme Mosca's lemma 9.3.6.
Context: $|\psi_T\rangle$ is the final state of the search algorithm that started on the all-zero string.
$|\psi^x_T\rangle$ is the final state of the search algorithm that started on the non-zero string $x$. We want to distinguish the two states with probability at least 2/3.
Need to show that $|||\psi_T\rangle-|\psi^x_T\rangle||\ge c>0.338$.
Tools to use:
If $|||\psi_T\rangle-|\psi^x_T\rangle||\le d,$ then $|\langle \psi_T | \psi_T^x\rangle|\ge 1-\frac{d^2}{2}$.
Any procedure that on input $|\psi_z\rangle$ guesses whether $z=x$ or $z=y$ guesses with the maximum achievable probability $\frac{1}{2}+\frac{1}{2}\sqrt{1-|\langle\psi_x | \psi_y\rangle |^2}$.
My reasoning: Suppose instead that $|||\psi_T\rangle-|\psi^x_T\rangle||< c$. Then $\frac{2}{3}=\frac{1}{2}+\frac{1}{2}\sqrt{1-|\langle\psi_T | \psi_t^x \rangle |^2}< \frac{1}{2}+\frac{c}{2\sqrt{2}}$, so we need $c>\frac{\sqrt{2}}{3}\simeq 0.4714$.
Question. how did the book get 0.338? Am I misisng something?
"
"['qiskit', 'ibm-q-experience']"," Title: A problem with IBM Q, NameError: name 'iBMQ' is not definedBody: I 'm trying to reproduce the code given in the Qiskit summer school here.
The code is:
# initialization
import numpy as np
# import Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, execute
from qiskit.tools.jupyter import *
provider= iBMQ.load.account()
but I am getting this error:
NameError Traceback (most recent call last)
<ipython-input-9-5e15427b4944> in <module>
9 from qiskit import QuantumCircuit, execute
10 from qiskit.tools.jupyter import *
---> 11 provider= iBMQ.load.account()
12
13 #import basic plot tools
NameError: name 'iBMQ' is not defined
The same question was asked so I tried the answer to install IBM Q provider using the command
pip install qiskit-ibmq-provider
but still I am getting the same error.
My python version is 3.8.3 and qiskit version is '0.16.0'
{'qiskit-terra': '0.16.0',
'qiskit-aer': '0.7.0',
'qiskit-ignis': '0.5.0',
'qiskit-ibmq-provider': '0.11.0',
'qiskit-aqua': '0.8.0',
'qiskit': '0.23.0'}
"
"['qiskit', 'programming']"," Title: What is the proper way of doing Pauli arithmetic in Qiskit?Body: To my understanding, the WeightedPauliOperator class in discontinued, and should no longer be used when dealing with Pauli operators. So how should I perform arithmetic with paulis?
$$
( 3 X_1 Y_3 + 5 Z_2 X_0 ) (Z_3+2X_2X_4) = \ \text{(expanded version)}
$$
"
"['quantum-gate', 'qiskit', 'programming']"," Title: Two circuits with Toffoli, Hadamard and Rx gatesBody: Can anyone explain me the behaviour of these two circuits? They contain Hadmard and rotation gates before the Toffoli gate.
Results of simulation:
"
"['quantum-gate', 'hadamard']"," Title: Why 2 $H$ gates in series create a probability of 100% for one value of the qubit and 0% of the second value of the qubit?Body: Why 2 $H$ gates in series create a probability of 100% for one value of the qubit and 0% of the second value of the qubit since an $H$ gate acts like a superposition generator?
"
"['mathematics', 'textbook-and-exercises', 'matrix-representation', 'notation', 'linear-algebra']"," Title: Difference between change of basis in bra-ket notation and matrix notationBody: In matrix notation, say I have the vector $\begin{bmatrix} 1 \\ 0 \end{bmatrix}$. It is currently represented in the computational basis $\{\begin{bmatrix} 1 \\ 0\end{bmatrix}, \begin{bmatrix} 0 \\ 1\end{bmatrix}\}$. I want to now represent it in the basis $\{\begin{bmatrix} \frac{1}{\sqrt 2} \\ \frac{1}{\sqrt 2}\end{bmatrix}, \begin{bmatrix} \frac{1}{\sqrt 2} \\ \frac{-1}{\sqrt 2}\end{bmatrix}\}$. To accomplish this, I use the correct change of basis matrix:
$$
\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} \\ \frac{1}{\sqrt 2}\end{bmatrix}
$$
When I see that final vector, I know to read it in the latter basis. And I can compute that the RHS in the second basis is in fact the LHS in the first basis.
Now, when I do the same thing with bra-ket notation, I have:
$$
\left(|0\rangle \langle + | + |1 \rangle \langle -|\right)|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt 2}
$$
When I see the final result here, do I internally read $|0\rangle$ as $|+\rangle$ and $|1\rangle$ as $|-\rangle$?
The explicit writing of bases in the bra-ket notation I find slightly confusing.
"
"['programming', 'non-locality']"," Title: How do I fix the UnboundLocalError?Body: I have read about the global and nonlocal variable and I know they may solve the problem, but as I'm still naive at this I couldn't figure out how to implement them to solve the UnboundLocalError. Sorry for the long program I put here:
# initialization
import numpy as np
# import Qiskit
from qiskit import IBMQ, BasicAer
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, execute
from qiskit.tools.jupyter import *
#provider= IBMQ.load.account()
provider= IBMQ.load_account()
#import basic plot tools
from qiskit.visualization import plot_histogram
Here is the Dj function
def dj_oracle(case, n):
#We need to make a QuantumCircuit object to return
#This circuit has n+1 qubits: the size of the input,
#plus one output qubit
oracle_qc=QuantumCircuit(n+1)
#First, let's deal with the case in which oracle is balanced
if case == "balanced":
# We apply controlled-NOT gates for each qubit, using the
#output qubit as target
for qubit in range(n):
oracle_qc.cx(qubit, n)
# case in oracle is constant
if case == "constant":
# First decide what the fixed output of the oracle will be
# (either always 0 or always 1)
output = np.random.randint(2)
if output == 1:
oracle_qc.x(n)
oracle_gate = oracle_qc.to_gate()
oracle_gate.name ="Oracle"
return oracle_gate
and Here is the dj_algorithm
def dj_algorithm(n, case='random'):
dj_circuit=QuantumCircuit(n+1, n)
# Set up the input register:
for qubit in range(n):
dj_circuit.h(qubit)
#And set up the output qubit:
dj_circuit.x(n)
dj_circuit.h(n)
#Let's append the oracle gate to our circuit:
if case == 'random':
random = np.random.randint(2)
if random == 0:
case = 'constant'
else:
case = 'balanced'
oracle = dj_oracle(case, n)
dj_circuit.append(oracle, range(n+1))
# Finally, perform the H-gates again and measure:
for i in range(n):
dj_circuit.h(i)
dj_circuit.measure(i,i)
return dj_circuit
Now when I want to use the local simulator to get the results, I face the UnboundLocalError, Can anybody help me to solve it?
This is the error I get:
UnboundLocalError Traceback (most recent call last)
<ipython-input-112-f0c5e2ae7e9a> in <module>
2 backend = BasicAer.get_backend('qasm_simulator')
3 shots = 1024
----> 4 dj_circuit = dj_algorithm(n,'constant')
5 results = execute(dj_circuit, backend=backend, shots=shots).result()
6 answer = results.get_counts()
<ipython-input-89-6104e1173619> in dj_algorithm(n, case)
15 else:
16 case = 'balanced'
---> 17 oracle = dj_oracle(case, n)
18 dj_circuit.append(oracle, range(n+1))
19 # Finally, perform the H-gates again and measure:
<ipython-input-110-75bb51aa8b15> in dj_oracle(case, n)
22 output = np.random.randint(2)
23
---> 24 if output == 1:
25
26 oracle_qc.x(n)
UnboundLocalError: local variable 'output' referenced before assignment
"
"['qiskit', 'programming']"," Title: Applying conditional X-gate in QiskitBody: I have problem with implementation of the circuit below. How can I write down the conditional X-gate in the following circuit?
"
"['entanglement', 'bell-experiment', 'non-locality', 'foundations']"," Title: Difference between Bell's inequality and CHSHBody: In this section of the Scholarpedia article on Bell's theorem, the first paragraph comments that Bell's original inequality is not ideal for experimental verification because it requires perfect anti-correlation of the variables, and for that reason the CHSH inequality is better. I don't really understand what this means, since as far as I'm aware experiments with e.g. the CHSH game also involve Bell pairs which are perfectly correlated. They allude to some continuity in the correlations, but I don't know what this means. Could anyone elucidate?
"
"['density-matrix', 'tensor-product', 'partial-trace', 'classical-quantum', 'trace-distance']"," Title: Trace distance of two classical-quantum state with hashingBody: Let's say I have a classical-quantum(cq) state $\rho_{XE}$, where the classical part $(X)$ is orthogonal. It's trace distance from another uniform density operator is defined to be:
$$
\frac{1}{2}||\rho_{XE} - \rho_U \otimes \rho_E||_1.
$$
Now I apply a hash function $f$ from $F$ distributed according to probability $p_f$ on the first register and get a new state:
$$
\rho_{F(X)E}:= \sum_f p_f \; \rho_{f(X)E}.
$$
Then I notice that its trace distance has the following upper bound:
$$
\frac{1}{2}||\rho_{F(X)E} - \rho_U \otimes \rho_E|| \le \epsilon .
$$
Now, from this upper bound, what can I infer for the first trace distance, i.e. without the hash function? Would the following be true?
$$
\frac{1}{2}||\rho_{XE} - \rho_U \otimes \rho_E|| \le \epsilon.
$$
Thanks!
"
"['qiskit', 'programming', 'ibm-q-experience', 'quantum-computing-for-finance']"," Title: Traveling salesman problem in Qiskit: cannot find a solution on simulatorBody: I am trying to solve Traveling Salesman Problem (TSP) in Qiskit based on Qiskit Tutorial.
I used TSP for four cities described by this distance matrix:
$$
D =
\begin{pmatrix}
0 & 207 & 92 & 131 \\
207 & 0 & 300 & 350 \\
92 & 300 & 0 & 82\\
131 & 350 & 82& 0 \\
\end{pmatrix}
$$
With brute force I found two optimal solutions:
- $0 \rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow 0$
- $0 \rightarrow 3 \rightarrow 2 \rightarrow 1 \rightarrow 0$
A total distance is 720 for both solutions.
However, when I run the problem on qasm_simulator with TSP algorithm in qiskit.optimization.applications.ising library, the returned solution is $0 \rightarrow 2 \rightarrow 3 \rightarrow 1 \rightarrow 0$ with distance 873. But according to matrix $D$, the total distance should be 731.
I can understand that the quantum solver cannot reach the optimal solution but I am rather confused by miscalculated total distance for the solution which was found.
So my questions is what wrong in my code? Just note that solution for example in Qiskit Tutorial was found correctly.
My second question is how to set TSP solver to reach an optimal solution? I would expect that since I use a simulator, there is no noise and in the end I would reach the optimal solution.
EDIT:
It seems that if the code is rerun, the results are different. I reached the distance 731, user Egretta Thua even the optimal 720. However, the first city in solution should be the city no. 0 which was not the case both in my or Egretta code rerun.
Here is my code:
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
#visualization tools
import matplotlib.pyplot as plt
import matplotlib.axes as axes
#other tool
import numpy as np
import networkx as nx
from itertools import permutations
#quadratic program
from qiskit.optimization import QuadraticProgram
#TSP libraries
from qiskit.optimization.applications.ising import tsp
from qiskit.optimization.applications.ising.common import sample_most_likely
#quantum computing optimization
from qiskit.optimization.converters import IsingToQuadraticProgram
from qiskit.aqua.algorithms import VQE, QAOA, NumPyMinimumEigensolver
from qiskit.optimization.algorithms import MinimumEigenOptimizer
#function for solving the TSP with brute force, i.e. generate all permutations and calc distances
def brute_force_tsp(w):
N = len(w)
#generate tuples with all permutation of numbers 1,2...N-1
#first index is zero but we want to start our travel in the first city (i.e. with index 0)
a = list(permutations(range(1,N)))
best_dist = 1e10 #distance at begining
for i in a: #for all permutations
distance = 0
pre_j = 0 #starting in city 0
for j in i: #for each element of a permutation
distance = distance + w[pre_j,j] #going from one city to another
pre_j = j #save previous city
distance = distance + w[pre_j,0] #going back to city 0
order = (0,) + i #route description (i is permutation, 0 at the begining - the first city)
print('Order: ', order, ' Distance: ', distance) #show solutions
if distance < best_dist:
best_dist = distance
best_order = order
print('Route length: ', best_dist)
print('Route: ', best_order)
return best_dist, best_order
#showing resulting route in graph
def show_tsp_graph(route):
n = len(route)
#showing the route in graph
G = nx.Graph() #graph
G.add_nodes_from(range(0,n)) #add nodes
#adding edges based on solution
for i in range(0,n-1):
G.add_edge(route[i], route[i+1])
G.add_edge(route[n-1], 0)
nx.draw_networkx(G) #show graph
#decoding binary output of QAOA to actual solution
def decodeQAOAresults(res):
n = int(len(res)**0.5)
results = np.zeros(n)
k = 0
for i in range(0,n): #each n elements refers to one time point i
for j in range(0,n): #in each time points there are all cities
#when x = 1 then the city j is visited in ith time point
if res[k] == 1: results[i] = j
k = k + 1
return results
def tspQuantumSolver(distances, backendName):
citiesNumber = len(distances)
coordinates = np.zeros([citiesNumber, 2])
for i in range(0, citiesNumber): coordinates[i][0] = i + 1
tspTask = tsp.TspData(name = 'TSP', dim = citiesNumber, w = distances, coord = coordinates)
isingHamiltonian, offset = tsp.get_operator(tspTask)
tspQubo = QuadraticProgram()
tspQubo.from_ising(isingHamiltonian, offset)
quantumProcessor = Aer.backends(name = backendName)[0]
qaoa = MinimumEigenOptimizer(QAOA(quantum_instance = quantumProcessor))
results = qaoa.solve(tspQubo)
print('Route length: ', results.fval)
route = decodeQAOAresults(results.x)
print('Route: ', route)
return results.fval, route
distMatrix = np.array([[0,207,92,131],
[207,0,300,350],
[92,300,0,82],
[131,350,82,0]
])
#brute force solution
lengthBrute, routeBrute = brute_force_tsp(distMatrix)
show_tsp_graph(routeBrute)
#quantum solution
lengthQuantum, routeQuantum = tspQuantumSolver(distMatrix, 'qasm_simulator')
show_tsp_graph(routeQuantum)
"
"['qiskit', 'programming']"," Title: ImportError when setting up PySCF driverBody: I have a problem when attempting to set up a PySCF driver for a hydrogen molecule from the QISKIT Chemistry tutorial: https://qiskit.org/documentation/tutorials/chemistry/01_electronic_structure.html.
The code:
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
molecule = Molecule(geometry = [['H', [0., 0., 0.]],
['H', [0., 0., 0.735]]],
charge = 0 , multiplicity = 1)
driver = PySCFDriver(molecule = molecule, unit = UnitsType.ANGSTROM, basis = 'sto3g')
When this is run, I receive: ImportError: cannot import name 'Molecule' from 'qiskit.chemistry.drivers' (C:\Users\louis\anaconda3\lib\site-packages\qiskit\chemistry\drivers_init_.py)
I am not entirely sure what is causing this error and any help would be appreciated.
"
"['programming', 'hamiltonian-simulation', 'openfermion']"," Title: How to get a molecular Hamiltonians in OpenFermionBody: I want to get a jordan_wigner_hamiltonians of a molecule-ion by using jordan_wignerget_fermion_operator(molecule.get_molecular_hamiltonian()). But I can only get the molecular Hamiltonians no matter how I set the charge and multiplicity.
How I can get a molecular Hamiltonians which have more (or less) electrons for example HeH+?
"
"['quantum-state', 'notation', 'quantum-walks']"," Title: What does the notation $|\psi(0)\rangle = |0\rangle|n=0\rangle$ mean?Body: Let us take the initial state with the particle located at the origin $|n=0\rangle$ and the coin state with
spin up $|0\rangle$. So,
$$
|\psi(0)\rangle = |0\rangle|n=0\rangle,
$$
where $|\psi(0)\rangle$ denotes the at the initial time and $|\psi(t)\rangle$ denotes the state of the quantum walk at time $t$.
Please, help me understand that, if on RHS we have a matrix product of two column vectors?
"
['quantum-walks']," Title: Why, in a discrete-time quantum walk,we first apply the tensor product of the coin operation with the identity?Body: When we apply coin step in the quantum walk, for example considering the H gate, we first do it's tensor product with Identity vector of the position Hilbert space. Why is this so? Please see below statement for more details:
"
"['qiskit', 'programming', 'quantum-state']"," Title: Qiskit get qubits from statevectorBody: How do I get the amplitude of each qubit, like plot_bloch_multivector(), but not output the tensor product of all qubits.
In this case I need output [0.707, -0.707], [0, 1], [0.707, 0.707], [0.707, 0.707]. How can I get this?
"
"['quantum-gate', 'circuit-construction', 'hamiltonian-simulation', 'pauli-gates']"," Title: How can I simulate Hamiltonians composed of Pauli matrices?Body: Suppose I want to perform the time-evolution simulation on the following Hamiltonians:
$$
H_{1} = X_1+ Y_2 + Z_1\otimes Z_2
\\
H_{2} = X_1\otimes Y_2 + Z_1\otimes Z_2
$$
Where $X,Y,Z$ are Pauli matrices. Since $[X_1,Y_2] = 0$, I can simultaneously perform the time evolution simulation of $X_1$ and $Y_2$. Thus, it seems like both Hamiltonians could be simulated using the following circuit ($\pi$ is just a random number):
Is this circuit looks right? If so, how can I tell the difference between these two Hamiltonians just by looking at the circuit?
"
"['qiskit', 'hhl-algorithm']"," Title: HHL example solution on QiskitBody: In the example on the Qiskit page (https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#A.-Some-mathematical-background) section 3 for the HHL algorithm the author is trying to solve the system of equations written as $A \vec{x}=\vec{b}$, where:
$$
A=\left(\begin{array}{cc}
1 & -1 / 3 \\
-1 / 3 & 1
\end{array}\right), \quad \vec{b}=\left(\begin{array}{c}
1 \\
0
\end{array}\right) \quad \text { and } \quad \vec{x}=\left(\begin{array}{c}
x_{1} \\
x_{2}
\end{array}\right).
$$
The final state of the system implementing the algorithm is:
$$
\frac{\frac{3}{2 \sqrt{2}}\left|u_{1}\right\rangle+\frac{3}{4 \sqrt{2}}\left|u_{2}\right\rangle}{\sqrt{45 / 32}}=\frac{|x\rangle}{\|x\|}.
$$
Given that:
$$
|x\rangle={\frac{3}{2 \sqrt{2}}\left|u_{1}\right\rangle+\frac{3}{4 \sqrt{2}}\left|u_{2}\right\rangle}
$$
where:
$$
\left|u_{1}\right\rangle=\left(\begin{array}{c}
1 \\
-1
\end{array}\right) \quad \text { and } \quad\left|u_{2}\right\rangle=\left(\begin{array}{l}
1 \\
1
\end{array}\right).
$$
How do i determine the solution to the system which is $\left[\begin{array}{ll}1.125 & 0.375\end{array}\right]$?
"
"['programming', 'ibm-q-experience']"," Title: No histogram appears in my job resultsBody: Newbie here - logged in to IBM Q Experience on a MacBook Air with up-to-date OS (macOS Catalina 10.15.7) and Safari browser (14.0). I can build a circuit in Circuit Composer, select a back-end in Run Settings, run my job on a QPU, and then I see the job appear in the Jobs tab on the right side of the Circuit Composer. I click on the job and it takes me to the results for the job. I see the sequence of steps for the job (created, transpiled, validated, in queue, running, completed). Under that I see Run Details: Back-end, run-mode, shots, status, last update. Under that I see the circuit which can be displayed as an image, Qasm or Qiskit. I do not see the histogram of states anywhere - nor do I see any menu item that would allow me to download this. The only downloads I see give me images of the circuit. How do I get the histogram of states?
![screenshot from IBM Q Experience showing circuit but no histogram of results]
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How can I construct a 2-qubit state using single qubit gates and CNOT gate?Body: How can I construct the below 2-qubit state using suitable single qubit gates (maximum 3) and one CNOT gate starting with state $|00\rangle$?
$$
|\omega\rangle=\frac{1}{3}(2|00\rangle+|01\rangle+2|11\rangle)
$$
"
['quantum-walks']," Title: Use of Position Hilbert Space in Quantum WalkBody: To perform quantum walk first we need to define combine hilbert space for the position and coin, which is represented by: $H=H_p\bigotimes H_c$
Now, my question is what is the use of above representation, if all the operation are defined on initial state. For example here, $| \psi(0)\rangle = |0\rangle\bigotimes\mid n=0\rangle$
Here, first vector is coin with initial state $0$ and second vector is walker at initial node $0$.
"
['error-correction']," Title: Quantum error correction: block length and error rate definitionsBody: I encountered notions of block length and error rate for quantum error correcting codes, which literature seems to just assume. Can someone please give precise definitions for these?
Usually we denote a quantum code by parameters $[[n,k,d]]$. Where $n$ is the number of physcial qubits used, $k$ - number of encoded (or logical) qubits, and $d$ the code distance.
Besides the definitions, how are block length and error rate related to those parameters $n,k$ and $d$?
"
"['qiskit', 'error-correction', 'noise']"," Title: Why and how is quantum noise predictable?Body: I have been learning about quantum error correction using the zero-noise extrapolation method from this paper and have been pleased with the results. This method takes advantage of the fact that the quantum gate noise is predictable as seen, for example, in the plot below. Here, I have taken a simple 2-qubit circuit given by qc.x(0), qc.h(0), qc.cx(0,1), qc.x(0) and added noise to it in the form of pairs of CNOT gates (a noisey identity matrix). I am plotting the $|01\rangle$ solution for this circuit as a function of the number of CNOT pairs that I used. This is done using the qiskit noise model with the IBMQ-montreal gate error rates. Note that the real solution is 0.5.
Clearly, the noise follows a very predictable relationship which to me is unexpected. Instead, what I expected was the noise to be scattered evenly across the real solution (0.5) with the amount of scatter being proportional to the number of gates, as shown in the made up plot below.
My question is, why does the noise follow the predictable curve instead of a random scattering about the real solution? And a follow up question, for an arbitrary circuit, how can I predict what the curve will look like?
Update: I ran my noisy circuits on the real IBMQ-athens machine to see if it is anywhere close to the simulated results. The plot is below is meant to be the same as the first plot (except the maximum depth is a less because I could not exceed 900).
Clearly the noise is no where near as organized as in the simulated version. What I don't know is if that was a failure on my part to simulate the noise correctly, or if it is a problem of the qiskit noise simulator itself.
"
"['entanglement', 'grovers-algorithm', 'oracles', 'amplitude-amplification']"," Title: Is Grover's algorithm only applicable to a pure state?Body: I've been trying to perform Grover's algorithm on entangled states, e.g. $|00\rangle + |11\rangle$. However, the algorithm apparently doesn't seem to amplify the amplitude of the state $|11\rangle$ which I have marked. Instead it only applies a net effect of a phase flip, despite applying both oracle and diffusion operator. Is Grover search only applicable to uniform, "pure" states?
"
"['quantum-gate', 'quantum-operation', 'pauli-gates', 'hadamard']"," Title: Transforming $|01 \rangle + |10 \rangle - |11 \rangle \to |01 \rangle - |10 \rangle + |11 \rangle$Body:
How to convert from current state: $$|\psi \rangle =\dfrac{ |01 \rangle + |10 \rangle - |11 \rangle}{\sqrt{3}}$$
into a target state
$$|\phi \rangle = \dfrac{|01 \rangle - |10 \rangle + |11 \rangle}{\sqrt{3}} $$
using only X, Z & H gates? TIA.
"
"['quantum-state', 'density-matrix', 'noise', 'linear-algebra', 'depolarizing-channel']"," Title: Depolarization of density operator with zeros in diagonalBody: I suppose a quantum state with density matrix like the following is not valid.
$$
\begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}.
$$
Now, let's say I have a valid density operator representing the state $|\psi \rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1 \rangle)$.
$$
|\psi \rangle \langle\psi | = \frac{1}{2}(|0\rangle \langle 0| + |0\rangle \langle 1| + |1\rangle \langle 0| + |1\rangle \langle 1|) = \frac{1}{2} \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}.
$$
Now I send this state to depolarizing channel $\mathcal{E}$. Because $\mathcal{E}$ is linear:
$$
\mathcal{E}(|\psi \rangle \langle\psi |) = \frac{1}{2}(\mathcal{E}(|0\rangle \langle 0|) + \mathcal{E}(|0\rangle \langle 1|) + \mathcal{E}(|1\rangle \langle 0|) + \mathcal{E}(|1\rangle \langle 1|)).
$$
I'm wondering what the depolarization of $\mathcal{E}(|0\rangle \langle 1|)$ would mean. By definition of depolarizing channel, for noise parameter $p$,
$$
\mathcal{E}(\rho) = (1 - p)\rho + \frac{pI}{2}.
$$
But then, what is the meaning of $\mathcal{E}(|0\rangle \langle 1|)$?
"
"['qiskit', 'programming', 'vqe']"," Title: TypeError: 'NumPyMinimumEigensolver' object is not subscriptableBody: I'm trying to implement the same Jupyter notebook Jin-Sung Kim gave in his YouTube video The Variational Quantum Eigensolver — Programming on Quantum Computers — Coding with Qiskit S2E4; however, I'm facing the error as below:
Error:
step 0
/Users/bambrozi/.local/share/virtualenvs/ibm-quantum-challenge-2020-ZWRg31rS/lib/python3.8/site-packages/qiskit/chemistry/core/hamiltonian.py:91: DeprecationWarning: The ChemistryOperator is deprecated as of Qiskit Aqua 0.8.0 and will be removed no earlier than 3 months after the release date. Instead, the FermionicTransformation can be used to transform QMolecules and construct ground state result objects.
super().__init__()
/Users/bambrozi/.local/share/virtualenvs/ibm-quantum-challenge-2020-ZWRg31rS/lib/python3.8/site-packages/qiskit/chemistry/core/hamiltonian.py:415: DeprecationWarning: Processing a dictionary result is deprecated, pass a (minimum) eigensolver result now.
warnings.warn('Processing a dictionary result is deprecated,'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-66becf9098c9> in <module>
13 # exact classical result
14 exact_result = NumPyMinimumEigensolver(qubit_op, aux_operators=aux_ops)
---> 15 exact_result = operator.process_algorithm_result(exact_result)
16
17 # VQE
~/.local/share/virtualenvs/ibm-quantum-challenge-2020-ZWRg31rS/lib/python3.8/site-packages/qiskit/chemistry/core/chemistry_operator.py in process_algorithm_result(self, algo_result)
88 return self._process_algorithm_result(algo_result)
89 else:
---> 90 lines, result = self._process_algorithm_result(algo_result)
91 result['algorithm_retvals'] = algo_result
92 return lines, result
~/.local/share/virtualenvs/ibm-quantum-challenge-2020-ZWRg31rS/lib/python3.8/site-packages/qiskit/chemistry/core/hamiltonian.py in _process_algorithm_result(self, algo_result)
374 # TODO return self._process_algorithm_result_excited_states(algo_result)
375 else:
--> 376 return self._process_algorithm_result_deprecated(algo_result)
377
378 def _process_algorithm_result_ground_state(self, algo_result: MinimumEigensolverResult) \
~/.local/share/virtualenvs/ibm-quantum-challenge-2020-ZWRg31rS/lib/python3.8/site-packages/qiskit/chemistry/core/hamiltonian.py in _process_algorithm_result_deprecated(self, algo_result)
419
420 # Ground state energy
--> 421 egse = algo_result['energy'] + self._energy_shift + self._ph_energy_shift
422 result['energy'] = egse
423 lines = ['=== GROUND STATE ENERGY ===']
TypeError: 'NumPyMinimumEigensolver' object is not subscriptable
Source-code:
# %%
import numpy as np
import pylab
import copy
from qiskit import BasicAer
from qiskit.aqua import aqua_globals, QuantumInstance
from qiskit.aqua.algorithms import NumPyMinimumEigensolver, VQE
from qiskit.aqua.components.optimizers import SLSQP
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.drivers import PySCFDriver
from qiskit.chemistry.core import Hamiltonian, QubitMappingType
# %%
molecule = 'H .0 .0 -{0}; Li .0 .0 {0}'
distances = np.arange(0.5, 4.25, 0.25)
vqe_energies = []
hf_energies = []
exact_energies = []
# %%
for i, d in enumerate(distances):
print('step', i)
# set up experiment:
driver = PySCFDriver(molecule.format(d/2), basis='sto3g')
qmolecule = driver.run()
operator = Hamiltonian(qubit_mapping=QubitMappingType.PARITY,
two_qubit_reduction=True,
freeze_core=True,
orbital_reduction=[-3, -2])
qubit_op, aux_ops = operator.run(qmolecule)
# exact classical result
exact_result = NumPyMinimumEigensolver(qubit_op, aux_operators=aux_ops)
exact_result = operator.process_algorithm_result(exact_result)
# VQE
optimzer = SLSQP(maxiter=1000)
initial_state = HartreeFock(operator.molecule_info['num_orbitals'],
operator.molecule_info['num_particles'],
qubit_mapping=operator._qubit_mapping,
two_qubit_reduction=operator._two_qubit_reduction)
var_form = UCCSD(num_orbitals=operator.molecule_info['num_orbitals'],
num_particles=operator.molecule_info['num_particles'],
initial_state=initial_state,
qubit_mapping=operator._qubit_mapping,
two_qubit_reduction=operator._two_qubit_reduction)
algo = VQE(qubit_op, var_form, optimzer, aux_operators=aux_ops)
vqe_result = algo.run(QuantumInstance(BasicAer.get_backend('statevector_simulator')))
vqe_result = operator.process_algorithm_result(vqe_result)
exact_energies.append(exact_result.energy)
vqe_energies.append(vqe_result.energy)
hf_energies.append(vqe_result.hartree_fock_energy)
Thanks for the help!
"
"['programming', 'ibm-q-experience', 'quantum-advantage', 'quantum-enhanced-machine-learning']"," Title: Comparing QSVM & Classic SVM on BigData. Quantum SupremacyBody: I work on comparing QSVM and Classic SVM (SKlearnSVM) with using Qiskit. I have to show
quantum supremacy at 400000-500000 samples but I don't get good results. I have problem with long time training and using big RAM when I use big training samples (In both cases). If I use big training samples in quantum algorithm, I can't get results of tests in short time (such as 1-4 days is acceptable). For example, I try do a test with 1000000 samples when I train quantum kernel on 20 samples and I got a bug in running state for some work (It was already above 10000 works; The work hanged). The reason of bug is unknown. For tests I use 2 quants (maybe it is little?) and last version libraries. Dataset is my generate (with perceptible differents). I try normalize dataset but I got a code mistake of numpy library (can't reshape array ant e.t.c).
For begining I used example from github tutorial, next I used other methods of class (that I find in qiskit - .train(),.test()) but I don't see differents here (if I use .run() and .predict() with rebooting of kernel).
And I have question - So can I to show this comparing generally with using Qiskit? So how? Maybe can I show quantum supremacy on other size of samples? Or can I use Qiskit library wrong?
"
"['resource-request', 'applications']"," Title: University Project - Quantum computing and it's social impact?Body: I was hoping to gain some insights on how I can convey to the public the ways in which Quantum Computing can have positive social impact?
I'm going convey this information in an A4 sized infographic to help create more awareness of this technology and how it can help us in the future. From my research the main tangible advantage of Quantum computing is a logistical one, however when I look at the UN sustainable development goals, I was hoping that you could enlighten me if there are other areas where this technology is going to help our race?
The UN Sustainable Development Goals:
1-No poverty
2-Zero hunger
3-Good health and well-being
4-Quality education
5-Gender equality
6-Clean water and sanitation
7-Affordable and clean energy
8-Decent work and economic growth
9-Industry, innovation and infrastructure
10-Reduced inequalities
11-Sustainable cities and communities
12-Responsible consumption and production
13-Climate action
14-Life below water
15-Life on land
16-Peace, justice and strong institutions
17-Partnerships for the goals
Full disclosure, I am a Business school student, so I have a very limited knowledge of the subject but I chose it because I am fascinated by the possibilities of the technology rather than choosing a much more cliché subject!
"
"['quantum-gate', 'ibm-q-experience', 'physical-realization']"," Title: Gate characteristics of different platformsBody: I would like to know if there is a place in which is summarized the gate characteristics of the different quantum computer existing (IBM,Google, others).
For instance, which kind of two qubit gate they physically implement. Their quality, etc.
From Sycamore paper I am able to access some of those date from google. From IBM I am struggling to find their characteristics on internet. I am particularly interested to know what is the physical two qubit gate they realize.
"
"['teleportation', 'communication', 'information-theory']"," Title: Teleportation followed by measurement: Lowering communication costBody: Suppose Alice and Bob have access to shared entanglement and a classical channel and wish to simulate the following quantum protocol. Alice sends over to Bob an $n$-qubit state which is not known to him. Bob then does a projective measurement with $2$ outcomes. The measurement is known to both parties before the protocol starts. I am interested in the communication cost of simulating this protocol.
Option 1: Alice teleports her state to Bob with the cost of $2n$ classical bits of communication. Bob applies the unitary correction required and then measures the state.
Option 2: Alice does the projective measurement herself and simply communicates $1$ bit of information to Bob.
Question: If Alice cannot do the projective measurement herself, can she and Bob do better than Option 1? Can they still successfully execute this protocol but with only $1$-bit (or at least fewer than $2n$ bits) of communication?
"
"['circuit-construction', 'quantum-fourier-transform']"," Title: Quantum Fourier Transform for general cyclic groupsBody: The QFT on the group $\mathbb{Z}_N$ is given by
\begin{equation}
QFT\,|k\rangle =\frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} e^{2\pi i\,jk/N}|j\rangle\,.
\end{equation}
The usual circuit implements the QFT with $N=2^n$ on $n$ qubits. Does anyone know how to realize this transformation when $N$ is not a power of 2? I have found an algorithm that approximates a QFT with arbitrary $N$, but I would like to find out if some exact circuit is known. I think that it should at least in some cases, since the problem 5.1 of Nielsen and Chuang's book is to find it when $N=p$ is a prime number.
I'm interested in particular on the $\mathbb{Z}_3$ transform, which corresponds to the matrix
\begin{equation}
\frac{1}{\sqrt{3}}\,\begin{pmatrix}
1&1&1 \\ 1&e^{2\pi i/3}&e^{-2\pi i/3} \\ 1&e^{-2\pi i/3}&e^{2\pi i/3}
\end{pmatrix}\,.
\end{equation}
Of course it acts on a 3d space, so to realize it using qubits we should extend it to a unitary operator on at least a $2^2$ dimensional Hilbert space. One possibility could be
\begin{equation}
\begin{pmatrix}
\frac{1}{\sqrt3 }
\begin{pmatrix}
1&1&1 \\ 1&e^{2\pi i/3}&e^{-2\pi i/3} \\ 1&e^{-2\pi i/3}&e^{2\pi i/3}
\end{pmatrix} & \\
& 1
\end{pmatrix}\,,
\end{equation}
but then how can we realize it exactly? When $N=2^n$ we can get the $\frac{1}{\sqrt{2^n}}$ prefactor with the n Hadamard gates that prepare the uniform superpositions, but now that $\sqrt{3}$ factor is really bothering me.
"
['measurement']," Title: How to identify index $k$ when presented with a state $\vert \psi_k\rangle$ from orthonormal states $\{\vert \psi_i\rangle\}_{1\le i\le n}$?Body: A passage on page 86 of Quantum Computation and Quantum Information by Michael A. Nielsen & Isaac L. Chuang has been bugging me for a while,
Suppose the states $\vert \psi_i\rangle$ are orthonormal. Then Bob can do a quantum measurement to distinguish these states, using the following procedure. Define measurement operators $M_i\equiv \vert \psi_i\rangle\langle\psi_i\vert$, one for each possible index $i$, and an additional measurement operator $M_0$ defined as the positive square root of the positive operator $I-\sum_{i\ne0}\vert \psi_i\rangle\langle\psi_i\vert$. These operators satisfy the completeness relation, and if the state $\vert \psi_i\rangle$ is prepared then $p(i)=\langle\psi_i\vert M_i\vert\psi_i\rangle=1$, so the result $i$ occurs with certainty. Thus, it is possible to reliably distinguish the orthonormal states $\vert \psi_i\rangle$.
Here Bob is presented with a state $\vert \psi_i\rangle$ from orthonormal states $\{\vert \psi_i\rangle\}_{1\le i\le n}$ and his task is to identify the index correctly.
The setup seems very strange to me. When Bob "measures" the state $\vert \psi_i\rangle$, shouldn't the state collapse to a computational basis assuming the measurement was done in it with probabilities given by the coefficients? And what does "$i$ occurs with certainty" even mean? Does it mean that $\vert \psi_i\rangle$ will always be from the given set? But then that's obvious since that was stated in the setup. And also, I don't see how Bob has even correctly identified the index at all.
It seems to me that there's a gap in my understanding of Postulate 3 which states the mathematical definition of quantum measurement. Any guidance would be helpful. Also, I wanna add that I'm not from a physics background. Thank you.
"
"['algorithm', 'hamiltonian-simulation', 'phase-estimation']"," Title: Reducing cost of Phase Estimation for TrotterizationBody: Even though Trotterized Hamiltonians have polynomial time scaling directly, the process of quantum phase estimation means that the controlled unitaries $ CU$ scale exponentially with number of precision bits. That means we need to apply our controlled Hamiltonian an exponential number of times if we increase the number of precision bits. Furthermore, because increasing the trotter step size requires greater precision, doesn't this directly imply that there is some relationship between Hamiltonian size and precision required, and thus a somewhat exponential relationship?
So, does Trotterization technically scale closer to exponential time or amortized superpolynomial time? Are there ways to get around this additional time cost incurred by QPE?
"
"['quantum-gate', 'circuit-construction']"," Title: How to realize SWAP operation using iSWAP gate?Body: The following are the matrices for SWAP and iSWAP gates.
SWAP =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}
iSWAP =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & i & 0 \\
0 & i & 0 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}
Both are similar except iSWAP adds a phase to $|01\rangle$ and $|10\rangle$ amplitudes.
How can the SWAP operation be realized using the iSWAP gate?
"
"['programming', 'grovers-algorithm', 'optimization']"," Title: How to implement the Maximum or Minimum Searching Algorithm (QUMMSA) circuit in Quirk?Body: I am Java and Python programmer who started self-learning Quantum Computing a couple of months back. The journey has been thus far very tough. I have been using QisKit and Quirk to learn by in addition to Khan academy on the Linear Algebra side.
I have now started to dive a little into the deep and and read research and go through the practise of trying replicate circuits on Quirk then QisKit.
I have come accross the followng paper An Optimized Quantum Maximum or Minimum Searching Algorithm and its Circuits
The paper proposes this QUMMSA algorithm to find the minimum or maximum in a dataset.
What I would love to do is replicate the QUMMSA circuit in Quirk with the Titanic experiment written in the paper but with just two inputs.
How do I best implement the circut?
"
"['quantum-gate', 'textbook-and-exercises']"," Title: What are the properties of the matrices representing quantum gates?Body: Quantum gates are basically matrices belonging to $C_{2\times2}$. Now, what are the properties of these matrices? We know that to preserve the normalization factor of the qubits these are unitary. All good. But then again we know that every unitary matrix is represented by rotation around Z, Y, and Z-axis (I am mentioning the Z-Y decomposition here).
So that means any unitary matrix is a rotation?
One funny thing, is this similar to rotation matrices similar to $R^{3}$ with determinant 1 etc?
"
"['qiskit', 'programming', 'quantum-circuit']"," Title: How to change the names of the registers displayed with circuit_drawer (output='mpl')Body: I am trying to change the appearance of the circuit_drawer in output='mpl' mode. The registers of the Quantum Circuit are named like ($q0_0$, $q0_1$, $q1_0$, $q2_0$, $q2_1$,..) but I'd like to name them myself. I can't find a style function or option which is able to do that... any ideas?
To be clear what I would like to change:
"
"['programming', 'algorithm']"," Title: Tutorial, optimization part, 5_admm_optimizer has attribute errorBody: In admm optimizer, when running the demo, it has attribute error, binary_vartype does not have attribute 'one_letter_symbol'. Does any one know how to solve it?
Here is the code:
import time
from typing import List, Optional, Any
import numpy as np
import matplotlib.pyplot as plt
from docplex.mp.model import Model
from qiskit import BasicAer
from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
from qiskit.optimization.algorithms import CobylaOptimizer, MinimumEigenOptimizer
from qiskit.optimization.problems import QuadraticProgram
from qiskit.optimization.algorithms.admm_optimizer import ADMMParameters, ADMMOptimizer
# If CPLEX is installed, you can uncomment this line to import the CplexOptimizer.
# CPLEX can be used in this tutorial to solve the convex continuous problem,
# but also as a reference to solve the QUBO, or even the full problem.
#
# from qiskit.optimization.algorithms import CplexOptimizer
# define COBYLA optimizer to handle convex continuous problems.
cobyla = CobylaOptimizer()
# define QAOA via the minimum eigen optimizer
qaoa = MinimumEigenOptimizer(QAOA(quantum_instance=BasicAer.get_backend('statevector_simulator')))
# exact QUBO solver as classical benchmark
exact = MinimumEigenOptimizer(NumPyMinimumEigensolver()) # to solve QUBOs
# in case CPLEX is installed it can also be used for the convex problems, the QUBO,
# or as a benchmark for the full problem.
#
# cplex = CplexOptimizer()
# construct model using docplex
mdl = Model('ex6')
v = mdl.binary_var(name='a')
w = mdl.binary_var(name='w')
t = mdl.binary_var(name='t')
u = mdl.continuous_var(name='u')
mdl.minimize(v + w + t + 5 * (u-2)**2)
mdl.add_constraint(v + 2 * w + t + u <= 3, "cons1")
mdl.add_constraint(v + w + t >= 1, "cons2")
mdl.add_constraint(v + w == 1, "cons3")
# load quadratic program from docplex model
qp = QuadraticProgram()
#qp.from_docplex(mdl)
print(qp.export_as_lp_string())
And here is the link to the tutorial: https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/optimization/5_admm_optimizer.ipynb
"
"['algorithm', 'hhl-algorithm']"," Title: In the HHL algorithm, how large should the eigenvalue estimation register be?Body: In the HHL algorithm, we need to estimate the eigenvalues of a matrix $A$. The result is stored in a register with $l$ qubits. Let $T = 2^l$. $T$ cannot be too small, otherwise the result would have a large error. How large should $T$ be?
The original paper (p. 11) states: we make the assumption that $\delta \leq T/10$. Here $\delta = \lambda_jt_0 - 2\pi k$, $\lambda_j$ is any eigenvalue of $A$, $t_0$ is another parameter to be chosen, and $k$ is an integer that ranges from $0$ to $T - 1$. However, this means that $\delta$ may be anything between $\lambda_jt_0 - 2\pi T$ and $\lambda_jt_0$. How is it possible to guarantee that $\delta \leq T/10$?
"
"['qiskit', 'programming']"," Title: Is it possible to plot the average counts from two jobs with multiple circuits on a single histogram in Qiskit?Body: I have the results of 2 separate jobs that contain a set of 75 circuits each. I am trying to compare these jobs by plotting the average counts from all the circuits in job 1 vs the average counts from all the circuits in job 2 on a single histogram plot.
The image below is an example of what I am looking to create where the grey counts would be the average from the circuits in job 1 and the blue counts would be the average from the circuits in job 2.
Is this possible? What is the best way to go about creating this plot?
Thanks in advance!
"
"['physical-realization', 'hadamard', 'ibm', 'superconducting-quantum-computing', 'google-sycamore']"," Title: How are the IBM's and Google's Hadamard gates fabricated and operated?Body: There are thousands of articles, books and web sites describing the Hadamard Gate from a theoretical point of view.
But I haven't been able to find any photo about any real implementeation of a Hadamard Gate on superconducting circuits nor any article describing how to make one.
Only some articles speaking about optical implementation of Hadamard gates.
(An approach to realize a quantum Hadamard gate through optical implementation)
Maybe the following is the only one I've found with some information, though quite theoretical too (Realization of efficient quantum gates with a superconducting qubit-qutrit circuit)
How are the IBM and Google Hadamard gates fabricated (or created in the laboratory) and operated?
"
"['quantum-gate', 'circuit-construction']"," Title: How to make Controlled-CRY GatesBody: I found that how to make CRY Gates.
But I don't know how to make Controlled-CRY Gates.
Please show me a figure.
Sorry for the poor English.
"
"['qiskit', 'programming', 'hhl-algorithm']"," Title: Qiskit HHL algorithm BrokenProcessPool errorBody: I try to run HHL algorithm on qasm_simulator. I took the example from here. I try to solve 8x8 random matrix and adjust some parameters in create_eigs.
aqua_globals.random_seed = 0
matrix = random_hermitian(8)
vector = matrix.dot(np.array([1, 2, 3, 4, 5, 6,7,8]))
orig_size = len(vector)
matrix, vector, truncate_powerdim, truncate_hermitian = HHL.matrix_resize(matrix, vector)
# Initialize eigenvalue finding module
eigs = create_eigs(matrix, 3, 10, False)
num_q, num_a = eigs.get_register_sizes()
# Initialize initial state module
init_state = Custom(num_q, state_vector=vector)
# Initialize reciprocal rotation module
reci = LookupRotation(negative_evals=eigs._negative_evals, evo_time=eigs._evo_time)
algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
init_state, reci, num_q, num_a, orig_size)
result = algo.run(QuantumInstance(Aer.get_backend('qasm_simulator')))
Then, this error occur.
---------------------------------------------------------------------------
BrokenProcessPool Traceback (most recent call last)
<ipython-input-8-105a0b6b991d> in <module>
18 algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
19 init_state, reci, num_q, num_a, orig_size)
---> 20 result = algo.run(QuantumInstance(Aer.get_backend('qasm_simulator')))
~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py in run(self, quantum_instance, **kwargs)
69 self.quantum_instance = quantum_instance
70
---> 71 return self._run()
72
73 @abstractmethod
~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in _run(self)
407 else:
408 self.construct_circuit(measurement=False)
--> 409 self._state_tomography()
410 # Adding a bit of general result information
411 self._ret["matrix"] = self._resize_matrix(self._matrix)
~/.local/lib/python3.8/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in _state_tomography(self)
341
342 # Extracting the probability of successful run
--> 343 results = self._quantum_instance.execute(tomo_circuits)
344 probs = []
345 for circ in tomo_circuits:
~/.local/lib/python3.8/site-packages/qiskit/aqua/quantum_instance.py in execute(self, circuits, had_transpiled)
268 # maybe compile
269 if not had_transpiled:
--> 270 circuits = self.transpile(circuits)
271
272 # assemble
~/.local/lib/python3.8/site-packages/qiskit/aqua/quantum_instance.py in transpile(self, circuits)
229 the length is one.
230 """
--> 231 transpiled_circuits = compiler.transpile(circuits, self._backend, **self._backend_config,
232 **self._compile_config)
233 if not isinstance(transpiled_circuits, list):
~/.local/lib/python3.8/site-packages/qiskit/compiler/transpile.py in transpile(circuits, backend, basis_gates, coupling_map, backend_properties, initial_layout, layout_method, routing_method, translation_method, scheduling_method, instruction_durations, dt, seed_transpiler, optimization_level, pass_manager, callback, output_name)
241
242 # Transpile circuits in parallel
--> 243 circuits = parallel_map(_transpile_circuit, list(zip(circuits, transpile_args)))
244
245 if len(circuits) == 1:
~/.local/lib/python3.8/site-packages/qiskit/tools/parallel.py in parallel_map(task, values, task_args, task_kwargs, num_processes)
133 # Otherwise just reset parallel flag and error
134 os.environ['QISKIT_IN_PARALLEL'] = 'FALSE'
--> 135 raise error
136
137 Publisher().publish("terra.parallel.finish")
~/.local/lib/python3.8/site-packages/qiskit/tools/parallel.py in parallel_map(task, values, task_args, task_kwargs, num_processes)
123 future = executor.map(_task_wrapper, param)
124
--> 125 results = list(future)
126 Publisher().publish("terra.parallel.done", len(results))
127
/usr/lib/python3.8/concurrent/futures/process.py in _chain_from_iterable_of_lists(iterable)
482 careful not to keep references to yielded objects.
483 """
--> 484 for element in iterable:
485 element.reverse()
486 while element:
/usr/lib/python3.8/concurrent/futures/_base.py in result_iterator()
609 # Careful not to keep a reference to the popped future
610 if timeout is None:
--> 611 yield fs.pop().result()
612 else:
613 yield fs.pop().result(end_time - time.monotonic())
/usr/lib/python3.8/concurrent/futures/_base.py in result(self, timeout)
430 raise CancelledError()
431 elif self._state == FINISHED:
--> 432 return self.__get_result()
433
434 self._condition.wait(timeout)
/usr/lib/python3.8/concurrent/futures/_base.py in __get_result(self)
386 def __get_result(self):
387 if self._exception:
--> 388 raise self._exception
389 else:
390 return self._result
BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Please tell me how to fix this error.
"
"['fidelity', 'trace-distance', 'linear-algebra']"," Title: Properties of composition of isometry and a perturbed adjointBody: Suppose $\vert\Phi\rangle_{AR} = \frac{1}{\sqrt{|D|}}\sum_{i\in D} \vert ii\rangle_{AR}$ is the maximally entangled state. Let $V_{A\rightarrow BE}$ and $\tilde{V}_{A\rightarrow BE}$ be two isometries from $H_A$ to $H_B\otimes H_E$ such that
$$\langle\Phi_{AR}\vert I_R\otimes \tilde{V}^\dagger V\vert\Phi_{AR}\rangle\geq 1- \varepsilon$$
My questions are about the map $\tilde{V}^\dagger V$.
- Is $\tilde{V}^\dagger V\leq I_A$ in a positive semidefinite sense? Following Rammus' comment, perhaps this doesn't make sense. Instead, how can one show that $\|I - \tilde{V}^\dagger V\|_1 = \text{tr}(I - \tilde{V}^\dagger V)$?
- How can one show that $\|I_A - \tilde{V}^\dagger V \|_1\leq \varepsilon|D|$?
Both these claims are made in Lemma 14 of this paper
"
['matrix-representation']," Title: How to find original matrix from eigenbasis and eigenvalues?Body: I'm not sure is it the right place to ask this but, I think it is better to ask here than Math Overflow. It is about how to find the matrix representation of an operator (for the CHSH test).
What are the matrices that has $\left|\frac{\pi}{8}\right>$ and $\left|\frac{5 \pi}{8}\right>$ with eigenvalues $\{1,-1\}$?
I can relate an operator with eigenbasis geometrically, but I do not know how to represent the operator matrix using these eigenbases and eigenvalues.
"
"['qiskit', 'programming', 'quantum-enhanced-machine-learning']"," Title: Usage of Tensorflow/Keras to train Qiskit circuitsBody: In order to explore whether it is possible to train a Qiskit Quantum circuit with tensorflow I built a small toy model.
The purpose of this toy model is to find via tensorflow the correct angle to get "zero" output independent of the input.
import numpy as np
import qiskit
from qiskit.circuit import QuantumCircuit, QuantumRegister
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Layer
def QuantumCircuit(thetas, n_qubits=1):
simulator = qiskit.Aer.get_backend('qasm_simulator')
shots=1024
circuit= qiskit.QuantumCircuit(n_qubits)
circuit.h(0)
circuit.ry(float(thetas),0)
circuit.measure_all()
job = qiskit.execute(circuit,backend=simulator,shots=shots)
result = job.result().get_counts(circuit)
counts = np.array(list(result.values()))
states = np.array(list(result.keys())).astype(float)
# Compute probabilities for each state
probabilities = counts / shots
# Get state expectation
expectation = np.sum(states * probabilities)
return np.array(expectation)
class Linear(Layer):
def __init__(self,units=1,input_dim=1):
super(Linear,self).__init__()
self.w = self.add_weight(shape=(input_dim,units),initializer='random_uniform', trainable=True)
def call(self, inputs, input_dim=1):
if (tf.executing_eagerly()):
return QuantumCircuit(self.w)
return inputs
x_train = np.arange(10)
y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
inputs=Input(shape=(1,))
outputs=Linear()(inputs)
model=tf.keras.models.Model(inputs=inputs,outputs=outputs)
model.summary()
model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.01),
loss=tf.keras.losses.MeanSquaredError())
model.fit(x_train, y_train, epochs=100, batch_size=1, verbose=1)
Unfortunately the toy model doesn't work and I get the following error:
optimizer_v2.py:1219 _filter_grads
([v.name for _, v in grads_and_vars],))
ValueError: No gradients provided for any variable: ['Variable:0'].
So I tried to calculate the gradient "by myself":
@tf.custom_gradient
def custom_activation(w):
result = QuantumCircuit(w)
def grad(dy):
eps=0.0001
result1=QuantumCircuit(w)
result2=QuantumCircuit(w+eps)
grad=(result2-result1)/eps
return dy * [grad]
return result, grad
as an intermediate step before the Quantum circuit is called. But this works out neither :-(
Does anybody have another idea to plug in Qiskit circuits into tensorflow and to deal with the fact that the automatic differentiation framework of tensorflow does not work in this case ?
Thanks a lot !!
"
"['quantum-state', 'entanglement', 'mathematics', 'density-matrix']"," Title: Is the set of two-qubit absolutely separable states convex?Body: Companion question on MathOverflow
Let us order the four nonnegative eigenvalues, summing to 1, of a two-qubit density matrix ($\rho$) as
\begin{equation}
1 \geq x \geq y \geq z \geq (1-x-y-z) \geq 0.
\end{equation}
The set ($S$) of absolutely separable states (those that can not be "entangled" by global unitary transformations) is defined by the additional inequality (eq. (1) in Halder)
\begin{equation}
x - z \leq 2 \sqrt{y (1-x-y-z)}.
\end{equation}
Is the set $S$, that is,
\begin{equation}
1 \geq x \geq y \geq z \geq (1-x-y-z) \geq 0 \land x - z \leq 2 \sqrt{y (1-x-y-z)},
\end{equation}
convex?
If so, I would like to seek to determine the John ellipsoids JohnEllipoids containing and contained within $S$ and see if they are simply the same as the circumscribed ($\mbox{Tr}(\rho^2) \leq \frac{3}{8}$) and inscribed ($\mbox{Tr}(\rho^2) \leq \frac{1}{3}$) sets, respectively Adhikari .
These two sets are determined by the constraints
\begin{equation}
1 \geq x \geq y \geq z \geq (1-x-y-z) \geq 0 \land x^2 +y^2 +z^2 +(1-x-y-z)^2 \leq \frac{3}{8}.
\end{equation}
and
\begin{equation}
1 \geq x \geq y \geq z \geq (1-x-y-z) \geq 0 \land x^2 +y^2 +z^2 +(1-x-y-z)^2 \leq \frac{1}{3}.
\end{equation}
(The latter set corresponds to the separable "maximal ball" inscribed in the set of two-qubit states (sec. 16.7 GeometryQuantumStates).
Further, I am interested in the Hilbert-Schmidt probabilities (relative volumes) Hilbert-Schmidt of these various sets. These probabilities are obtained by integrating over these sets the expression
\begin{equation}
9081072000 \left(\lambda _1-\lambda _2\right){}^2 \left(\lambda _1-\lambda _3\right){}^2 \left(\lambda
_2-\lambda _3\right){}^2 \left(2 \lambda _1+\lambda _2+\lambda _3-1\right){}^2 \left(\lambda _1+2
\lambda _2+\lambda _3-1\right){}^2 \left(\lambda _1+\lambda _2+2 \lambda _3-1\right){}^2,
\end{equation}
where the four eigenvalues are indicated. (This integrates to 1, when only the eigenvalue-ordering constraint--given at the very outset--is imposed.)
In the answer to 4-ball, we report formulas for the Hilbert-Schmidt probabilities (relative volumes) of these inscribed and circumscribed sets, that is,
\begin{equation}
\frac{35 \pi }{23328 \sqrt{3}} \approx 0.00272132
\end{equation}
and the considerably larger
\begin{equation}
\frac{35 \sqrt{\frac{1}{3} \left(2692167889921345-919847607929856 \sqrt{6}\right)} \pi}{27518828544} \approx 0.0483353.
\end{equation}
(We also have given an exact--but still quite cumbersome--formula [$\approx 0.00484591$] for $\mbox{Tr}(\rho^2) \leq \frac{17}{50}$.)
Further, in the answers to AbsSepVol1 and AbsSep2 ,
the formula for the Hilbert-Schmidt volume (confirming and rexpressing the one given in
2009paper)
\begin{equation}
\frac{29902415923}{497664}-\frac{50274109}{512 \sqrt{2}}-\frac{3072529845 \pi }{32768
\sqrt{2}}+\frac{1024176615 \cos ^{-1}\left(\frac{1}{3}\right)}{4096 \sqrt{2}} \approx 0.00365826
\end{equation}
of the intermediate absolutely separable set $S$ has been given.
As to the total (absolute and non-absolute) separability probability of the 15-dimensional convex set of two-qubit density matrices, compelling evidence of various kinds--though yet no formalized proof--indicate that its value is the considerably larger
$\frac{8}{33} \approx 0.242424$ MasterLovasAndai . (One can also enquire as to the John ellipsoids for this [known-to-be] convex set JohnEllipsoid2.)
Here is a joint plot of the three sets of central interest here.
ThreeSetPlot
"
"['quantum-state', 'machine-learning', 'quantum-boltzmann-machine']"," Title: Quantum Boltzmann machine: How do you sample from the Boltzmann distribution on a quantum computer?Body: I am reading through the following article https://arxiv.org/abs/1601.02036.
Eq. (22) describes one of the terms of the gradient of the log-likelihood cost function, which can be estimated using Boltzmann averaging.
Eq. (22) looks like this
$$\frac{Tr[e^{-H}\delta_\theta H]}{Tr[e^{-H}]},$$
and the article states that this term can be estimated by sampling from eq. (12).
Eq. (12) looks like this
$$ \rho = \frac{e^{-H}}{Tr[e^{-H}]}.$$
Can someone give me an explanation of how this is done on a quantum computer?
I was thinking that the expectation of the truncated Taylor expansion term $e^{-H} \approx I - H$ could be evaluated
$$ \langle v| I - H |v \rangle, $$
for every basis state $|v \rangle$ and this would make it possible to estimate the diagonal of $\rho$. However, this task would be exponential in the number of qubits so I suspect that this is not how to do it. Any ideas?
"
"['quantum-gate', 'quantum-state', 'physical-realization', 'unitarity']"," Title: Can the (universal) state inversion operator be physically realized?Body: I was trying to solve an exercise from Vazirani's course "Qubits, Quantum Mechanics and Computers":
A mathematically nice, but unphysical, way to detect entanglement is to use the state inversion operator, $T$, which, for all states $n$ acts as $T\vert n\rangle = \vert -n\rangle$. Why can’t this operator be realized physically?
Can anyone help me with this problem? Many thanks! The problem is from https://inst.eecs.berkeley.edu/~cs191/fa10/homework/hw7.pdf
"
"['hamiltonian-simulation', 'pauli-gates', 'tensor-product']"," Title: Simulate Hamiltonians with Pauli operations (controlled time evolution)Body: I had a question last week regarding the simulation of Hamiltonians composed of the sum of Pauli products: How can I simulate Hamiltonians composed of Pauli matrices? I'm having a follow-up question: still for those two Hamiltonians:
$$
H_{1} = X_1+ Y_2 + Z_1\otimes Z_2
\\
H_{2} = X_1\otimes Y_2 + Z_1\otimes Z_2
$$
How can I perform the 'controlled version' of them? The thing really confused me is the 'tensor product term': for both $H_1$ and $H_2$, the two qubits are coupled, but if I want to do the controlled time-evolution simulation, should I couple the whole thing with the third qubit? If so, how to do that?
Thanks:)
"
"['programming', 'circuit-construction', 'optimization']"," Title: Is there a quantum circuit to find the maximum of two inputs?Body: Is there a quantum circuit (preferably on Quirk as an example) that will enable me to find the maximum from two inputs?
Example
- input A: 11011
- input B: 11100
Expected output: 11100
"
"['qiskit', 'programming']"," Title: Qiskit programming: convert qubit to quantum registerBody: When simulating quantum circuits in Qiskit, sometimes you need to build your own operation. And when you are doing so you would like to save the computational cost, but the QuantumCircuit object takes only QuantumRegister object as input(while rejects the qubit object) and this might be cumbersome.
For instance, see the code:
def swappedOp(obj,qr0,qr1,index):
circ=QuantumCircuit(qr0,qr1)
circ.swap(qr0[qr0.__len__()-1],qr1[index])
circ.append(obj,[qr0[i] for i in range(qr0.__len__())]+[qr1[i] for i in range(qr1.__len__())])
circ.swap(qr0[qr0.__len__()-1],qr1[index])
return Operator(circ)
In this code, my input obj is a random unitary, and what this function does is to swap the action of two qubits(in this code, it swaps the last qubit of qr0 and qr1[index]) and the latter swap makes sure that in other operations the sequence is unchanged.
The needed action of the random unitary(or say obj) is taken place between all qubits in qr0 and one qubit in qr1, but to actually implement this operation in Qiskit I have to expand it to action between all qubits of the two quantum registers because the QuantumCircuit object only takes QuantumRegsiter as
input (not qubit) and this is computationally inefficient.
So what I want to know is: is there a way to convert between qubit object and QuantumRegister object? If so, this can be time-saving!
"
"['programming', 'cirq', 'machine-learning', 'tfq']"," Title: How to learn parameters in a quantum circuit, given an interference pattern?Body: Using cirq, I have the following quantum circuit, with three parameters: phi, alpha and beta:
q0 = cirq.GridQubit(0,0)
q1 = cirq.GridQubit(0,1)
phi = sp.Symbol('phi')
alpha = sp.Symbol('alpha')
beta = sp.Symbol('beta')
circuit = cirq.Circuit([
cirq.H(q0),
cirq.CNOT(q0,q1),
cirq.XPowGate(exponent=phi)(q0),
cirq.H(q1),
cirq.X(q1) ** (alpha*phi),
cirq.XX(q0,q1) ** (beta*phi),
cirq.measure(q0, q1, key='m')
])
SVGCircuit(circuit)
This circuit is just some randomness I was playing with, so please don't take it too seriously...
If I fix the values of alpha=2 and beta=-3 and perform a scan over phi from $[0,2\pi]$ I can generate a distribution of the number of times the system is measured in state $|00\rangle$ (actually not 100% sure I am right here)...
Example scan with phi=0.25
>>> resolver = cirq.ParamResolver({'phi':0.25,'alpha':alpha,'beta':beta})
>>> trials = cirq.Simulator().run(circuit, resolver, repetitions=1000)
>>> trials.histogram(key='m')
Counter({0: 726, 2: 124, 3: 122, 1: 28})
Plotting trials.histogram(key='m')[0] as a function of phi, I get:
Finally, my question...
What would be the best way to set this up as a (hybrid-)ML problem, in order to solve what the values of alpha and beta, given a prior distribution?
I.e. using this above distribution, I could turn this into a regression problem with a little NN to try and learn alpha and beta
I can think of possible ways to do it in a manual way by setting up a function to just return the distribution given parameters alpha and beta, before calculating the loss etc. I was hoping there was a better/cleaner way to do this, perhaps via tfq?
Any suggestions? Or suggestions to move to qiskit/pennylane?
"
"['qiskit', 'ibm-q-experience', 'phase-estimation']"," Title: Quantum Phase estimation with $2\pi$ replaced with $2e$Body: The QPE on IBM platform finds the eigenvalue of a unitary operator, i.e $$U|\phi\rangle=e^{2\pi i\theta}|\phi\rangle$$
and uses the rotation operators as $$U(\theta)=\begin{bmatrix}0 & 1\\
1 &e^{i\theta}\end{bmatrix}$$
My question is we can write $U|\phi\rangle=e^{2\pi i\theta}|\phi\rangle$ as $$U|\phi\rangle=e^{2e i\theta}|\phi\rangle$$ where, since even then the magnitude of the eigenvalue remains same. Of course that would require more number of measurement qubits. For instance for $\theta=0.5$, we had $4$, so this time we can increase the $n$ and get closer to $\theta=0.5$. My question is can this be done.
"
"['grovers-algorithm', 'classical-computing']"," Title: Is there an explanation for why, to search through an unstructured database, the average number of checks is $\frac{N}{2}$ in classical computation?Body: I have came across many books online that all explain that if $N$ is large enough, then the average number of checks in $N/2$ but is there a mathematical explanation or derivation for why this is true?
I have considered when $N=2^n$ and tried to use logarithms but am not getting anywhere with this. Any help would be greatly appreciated
Sorry, I should have made it clear... I was referring to Grover's search algorithm and how I can show that if $N$ is large enough, then the average number of checks is $N/2$. I know I will have to check $N$ objects in the worst-case scenario
"
"['quantum-state', 'quantum-walks']"," Title: How to encode $|i \rightarrow j \rangle$ using binary string?Body: We define the quantum state on a complex network in the form,
$$\mid\psi(t)\rangle=\sum_{i=1}^{N}\sum_{j=1}^{k_i}\psi_{i,j}(t)\lvert
i\to j\rangle, $$
where $N$ is the total number of nodes, the state $|i \to j⟩$ resides on the node $i$ and is to hop to the adjacent site $j$, while $k_i$ is the number of links attached to the node $i$.
My question is how this $|i \to j \rangle$, can be represented using binary coded bit string?
Reference: Discrete-time quantum walk on complex networks for community detection by Kanae Mukai
"
['deutsch-jozsa-algorithm']," Title: How to solve this Deutsch Jozsa variant?Body: You are given a function $f : \{0,1\}^n \to \{0,1\}$ and a quantum circuit, $C$, computing the signed implementation of $f$. Let $I_0$ be the input bit-strings of length $n$ where the first bit is $0$, and $I_1$ be the
remaining ones (i.e., the first bit is $1$).
You are given the promise that $f$ is one of these two types:
- $f(x) = 0 $ for all $x$ belonging to $I_0$ and $f(x) = 1$ for all $x$ belonging to $I_1$
- The total number of strings in $I_0$ for which $f(x) = 1$ plus the total number of strings in $I_1$ for which $f(x)$ is $0$ is $2^{n-1}$.
Give an algorithm (i.e., quantum circuit) to distinguish between these two cases by calling $C$ only once.
"
['quantum-walks']," Title: How to make a Node dependent coin operator?Body: In a non-regular graph the degree of each node is different.
So, the dimension of the coin operator also needs to be changed (as the number of options the walker has to hop to adjacent nodes will be different) as opposed to for example a 2-d regular graph where coin dimensions are $C^2$ for every node.
Any idea.
"
"['hhl-algorithm', 'phase-estimation']"," Title: Given a matrix, how do I proceed with the quantum phase estimation algorithm and choose $\theta$?Body: Given a matrix, say $\begin{bmatrix} 1.5 & 0.5\\
0.5& 1.5
\end{bmatrix}$, with eigenvalues $1$ and $2$, how do I proceed with the quantum phase estimation algorithm?
In particular, how do I choose $\theta$?
In the text I am reading it says fix $\theta=\pi$ and $\pi/3$ for the eigenvalues. How do they get this?
Can somebody explain?
Edit: is it linked by the approximation that $ \theta= 2\arcsin(C/\lambda_j)$, if so then why is $C=1$ in this matrix case?
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: Which Gate set can be used to perform the function $U|0\rangle =\frac{1}{\sqrt{n}}\sum_{i=0}^{n}(|i\rangle)$?Body: I want to perform the following operation:
$$U|0\rangle =1/\sqrt{n}\sum_{i=0}^{n}(|i\rangle).$$
I know that Hadmard gate can give me the superposition of states $|0\rangle$ and $|1\rangle$. But it can only be applied to a single-qubit system.
Does anyone have any idea for a multi-qubit system?
"
"['algorithm', 'circuit-construction']"," Title: How do I construct a circuit to reshuffle some computational basis vectors?Body: I would like to construct a quantum circuit s.t.
- It maps a certain (relatively small) subset of computational basis vectors onto a different subset of those, e.g.
$$
|0101001\rangle \to |1000010\rangle, \; |1001011\rangle \to |0111011\rangle, \ldots
$$
(I was tempted to call such action "a permutation", but I guess it not necessarily is one.)
- I don't care what circuit's action is on the rest of the basis vectors.
How can I do that? Of course, ideally I would like to achieve this with a minimum number of single-qubit gates and CNOTs.
"
"['tomography', 'quantum-process-tomography']"," Title: How to measure a general two-qubits gate? Does it help to Bob and Alice?Body: Excuse me if this question is absurd. I discovered logic gates a few weeks ago.
two-qubis Logic gates are represented by 4x4 matrices.
Can they mimic a general density matrix of pairs of spin 1/2 particles?
The problem that I have in mind is the reconstruction (tomography) of the global density matrix from the local measurement by Alice and Bob once they can compare their results.
I suppose that we can measure the 16 elements of the logic gate matrix.
Does it help to find a similar procedure for Bob and Alice?
"
['quantum-boltzmann-machine']," Title: Variational imaginary time evolution: confused with derivationBody: I am reading the following article, https://arxiv.org/abs/1812.08767, and I am trying to go though the derivation of McLachlan's variational principle for imaginary time evolution. The derivation is done in section B.1.2.
I am confused about going from this equation:
to this equation (assuming real $\theta_i$):
I think the $x$ at the end is a typo. What I dont understand is how the variation $\delta$ removes the need to sum over $i$, going from eq. (120) to (123). They also remove the $\dot{\theta}_i$ factor and seem to replace it with $\delta \theta_i$. I also dont understand why the final term in eq. (120) disappears.
I think I am overall a little confused as to what the variation $\delta$ actually does to an equation. Could anyone explain?
"
"['quantum-gate', 'circuit-construction', 'entanglement', 'hadamard', 'quantum-circuit']"," Title: Transforming $|100\rangle$ state into $|000\rangle + |111\rangle$ state using only Hadamard and CNOT gatesBody:
Hi, How to convert $|100\rangle$ 3-qubit quantum state into $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$ state using only Hadamard and CNOT gates? Also, is output state an entangled one?
"
"['error-correction', 'stabilizer-code']"," Title: Considering quantum codes as codes over $F_2$Body: It is very common to look at stabilizer codes as codes over GF(2) or codes over GF(4). Mostly I have seen this for computations for distance of codes and syndromes. How do other notions like say automorphism group (over GF(2)) or some other invariants translate to stabilizer code? In other words will automorphism group of GF(2) equivalent code say something about its corresponding stabilizer code? For eg. Let $Q$ be a quantum code and corresponding GF(2) linear code be $C$ represented by generatir matrix (or parity check matrix M). Now given $aut(C)$ that is $\lbrace A,P \in GL(F_2) \times S_n \rbrace$ that fix M, what can we say about aut(Q), I suppose now automorphism groups would be defined over complex fields or considering stabilizer formalism we might have one over paulis if we want to look at stabilzers as analog of generator matrices.
"
"['qiskit', 'programming']"," Title: How does Qiskit Aqua commutator work?Body: Commutation operation is essential in quantum mechanics, but when I was trying to use the commutator of IBM qiskit I find something confusing.
Here comes the problematic code.
from qiskit import QuantumCircuit
from qiskit.quantum_info import DensityMatrix
from qiskit.aqua.operators.legacy import commutator
qr0=QuantumCircuit(1)
qr1=QuantumCircuit(1)
circ0.x(0)
dm0=DensityMatrix.from_instruction(circ0)
circ1.z(0)
dm1=DensityMatrix.from_instruction(circ1)
The upper codes generates two Density Matrices, and since they are matrices, mathematically we can compute their commutator, but then after you run commutator(dm0,dm1) you'll find that it's not working. Even if you try some other types like input two Operators or input the detailed matrices(dm.data) but it is just raised an error. E.g. in the lower code when the detailed matrices case returns an error.
dm0=Operator(dm0)
dm1=Operator(dm1)
commutator(dm0.data,dm1.data)
The errors that qiskit reports are nearly identical so I just put one of them as an example.
I know numpy or scipy can help me in circumventing the trouble, but I still want to ask: have anyone meet this before? Do you know how to fix this? Thanks!
"
"['qiskit', 'circuit-construction', 'quantum-fourier-transform']"," Title: Qiskit Inverse of a quantum fourier transformationBody: In the photo provided the Quantum Fourier Transform is depicted in Qiskit before the barrier. I don't understand the result of inverse. Conceptually, should the inverse of the QFT be the same resultant as the original implementation? And is the inverse correctly depicted in Qiskit for this 3 bit QFT algorithm show below?
"
"['quantum-state', 'entanglement', 'measurement', 'textbook-and-exercises']"," Title: What is the result of measuring $\sigma_x$ on the state $|01\rangle+|10\rangle$?Body: I confused about how to calculate the probabilities and getting a certain result of measuring Bell's states with Pauli matrices as the operator. When you measure something, the state involved would be projected onto an eigenstate of the observable.
given $|\psi\rangle = \frac{1}{\sqrt2} (|01⟩ + |10⟩)$ as the state and
$\sigma_x = \left[\begin{matrix}0&1\\1&0\\\end{matrix}\right]$ as the observable.
if the probability is 1/2, how to calculate them actually? What is the state after measurement?
"
"['quantum-gate', 'deutsch-jozsa-algorithm']"," Title: Where is the parallelism in Deutsch-Jozsa algorithm?Body: I am newbie on Quantum Computing. Actually I am a software engineer but I want to understand how quantum computers work. So my question may be absurd. Sorry about that.
I tried to understand Deutsch-Jozsa algorithm to understand how quantum computers work. I understood it mathematically. But I couldn't understand it's logic. How this algorithm finds the solution in only one iteration?
Before studying about quantum computing in depth, I have been seeing that quantum computer can perform $2^n$ ($n$ is qubits count) process same time thanks to qubits superposition in various videos on YouTube.
I have two question:
- Where is the parallelism in Deutsch-Jozsa algorithm? As I understand, the reason why this problem can be solved in one iteration is qubits can be put any position via quantum gates on Bloch sphere. Is it true?
- How to develop quantum algorithm? Isn't it very difficult that developing an algorithm by thinking the state of matrices?
"
"['quantum-state', 'entropy', 'information-theory', 'trace']"," Title: Prove that for a general tri-partite state $\rho_{ABE}$, $H(AB) = H(E)$Body: How do I prove that for a general tri-partite state $\rho_{ABE}$, the following holds:
$$
H(\rho_{AB}) = H(\rho_{E}), H(\rho_{AE}) = H(\rho_{B}),
$$
where, $H$ is the Von Neumann entropy. Would Schmidt decomposition help? But I can only do it in a bi-partite scenario. Thanks!
"
"['quantum-state', 'entanglement', 'measurement']"," Title: Probabilities of entangled state. Quantum measurementBody: I confused about how to calculate the PROBABILITIES and getting a certain result of measuring Bell's states with Pauli matrices as the operator. When you measure something, the state involved would be projected onto an eigenstate of the observable.
Given $|ψ⟩ = \frac{1}{\sqrt2} (|01⟩ + |10⟩)$ as the state and $σy = \left(\begin{matrix}0&-i\\i&0\\\end{matrix}\right)$ as the observable.
How to calculate probability on the first qubit actually? What is the state after measurement?
"
"['entanglement', 'entropy', 'information-theory']"," Title: Positive conditional quantum entropy for entangled stateBody: The quantum conditional entropy $S(A|B)\equiv S(AB)-S(A)$, where $S(AB)=S(\rho_{\rm AB})$ and $S(B)=S(\rho_{\rm B})$ is known to be non-negative for separable states. For entangled states, it is known that the quantum conditional entropy can attain both negative and positive values. Thus, a negative quantum conditional entropy serves as a sufficient, but not necessary, criterion for the quantum state to be entangled. References where this is stated would be https://arxiv.org/pdf/1703.01059.pdf or https://arxiv.org/pdf/quant-ph/9610005.pdf.
While it is easy to find entangled states which yield negative quantum conditional entropies, such as any pure entangled state, I cannot think of/construct an entangled state which yields a positive quantum conditional entropy. Can someone provide an example?
"
"['programming', 'q#']"," Title: Simulator-dependent implementations in Q#Body: I have a Q# operation:
operation init_and(a: Qubit, b: Qubit, target: Qubit) : Unit is Adj {
// Uncomment this when using Toffoli simulator.
// CCNOT(a, b, target);
// Uncomment this when doing resource estimates.
body(...) {
CCNOT(a, b, target);
}
adjoint(...) {
H(target);
if (M(target) == One) {
CZ(a, b);
}
}
}
As you can see from the comments, I have to choose between being able to simulate the operation (when testing the correctness of constructions using it) and being able to correctly cost the operation (because uncomputing it should cost zero T gates).
Is there some way to get the best of both worlds? For example, some way to say "when testing correctness use this, when doing cost estimates use this"? Some way to query "Is the Hadamard available?"?
"
"['quantum-gate', 'hamiltonian-simulation', 'pauli-gates', 'hadamard']"," Title: Definitions of $D_y$ gate in Hamiltonian simulation: are they the same?Body: I'm reading a Hamiltonian simulation example proposed in this paper. From their notation, the operator $D_y$ (sometimes it's called $H_y$) serves the function to diagonalize the Pauli matrix $\sigma_y(Y)$ (the corresponding circuit is illustrated below):
$$
D_y\ (or\ H_y)=HSX=\frac{1}{\sqrt{2}}\begin{bmatrix}
i & 1\\
-i & 1
\end{bmatrix}
\quad\quad\quad [A]
$$
However, unlike $D_x$, which is the Hadamard gate, I found $D_y$ is sometimes written in different ways, like in this answer by @Craig Gidney:
$$
D_y\ (or\ H_{YZ}) = \frac{Y+Z}{\sqrt{2}} = \frac{1}{\sqrt{2}}\begin{bmatrix}
1 & -i\\
i & -1
\end{bmatrix}
\quad\quad\quad [B]
$$
and in this answer by @Davit Khachatryan:
$$
D_y\ (or \ 'Y'_{not\ pauli\ here}) = U_2(0,\pi/2) =\frac{1}{\sqrt{2}}\begin{bmatrix}
1 & -i\\
1 & i
\end{bmatrix}
\quad\quad\quad [C]
$$
Thus I'm wondering are those different versions of $D_y$ the same thing? Are they essentially all belong to $U_2$ gate?
Also, when should we use two $U_3$ gates outside of the CNOT gates to perform the time-evolution simulation (like in this case, the answer from @KAJ226)?
Thanks!!!
"
"['qiskit', 'programming', 'quantum-state', 'density-matrix', 'state-preparation']"," Title: Produce a quantum state with its density matrix an identity matrix up to an constantBody: For a n-qubit quantum state $|\psi\rangle=\displaystyle\sum_{i=0}^{2^N-1}|i\rangle$, by definition it's density matrix is $|\psi\rangle\langle\psi|=\displaystyle\sum_{i,j=0}^{2^N-1}|j\rangle\langle i|$.
Recently I am trying to implement a quantum neural network given by a paper, and one step of it is required so, maybe up to a normalization constant(at supplementary note 2, when calculating the derivative).
For a $2^N$ dimensional identity matrix, it does not violate the requirements of being a density matrix, but I just cannot figure out how to do so and I even think this is not possible, have anybody be at this place before?
An additional requirement of mine is that the density matrix must be produced by some qubits or this problem might be truly tedious.
"
"['qiskit', 'programming']"," Title: Parallel shots on QiskitBody: I am running variational algorithms using QuasmSimulator, which means I am performing a classical optimization where the cost function is computed running a quantum circuit. Moreover, for the optimizer to converge I need high accuracy, which implies a large number of shots.
These two things combined make a run last for days on my laptop, even for a few qubits. Thus, I am trying to run shots in parallel to save some time. Qiskit has a backend option for this:
from qiskit.providers.aer import QasmSimulator
backend = QasmSimulator(method="automatic", max_parallel_threads=6, max_parallel_shots=6)
... the rest of the code...
job = execute(circ, backend, shots=nshots)
However, when setting this option I see no difference, neither in runtime nor in CPU usage from Window's task manager. I think the problem could be that normally a python script just uses one core, so when Qiskit runs it "thinks" that indeed you have one core only. Any suggestion?
I am using Qiskit 0.23.0
(Note that I asking specifically about parallel shots and not parallel circuits, although that might also help with another issue I have)
"
"['quantum-gate', 'error-correction']"," Title: Understanding ""Restrictions on Transversal Encoded Quantum Gate Sets""Body: I am trying to understand a part from the article "Restrictions on Transversal Encoded Quantum Gate Sets" (arxiv link) by Eastin and Knill.
In the article they talk about the importance of transversal encoded gates for fault tolerant quantum computing. They prove that there can't be a gate set that works on a non trivial quantum code space $\mathcal C$ that is also universal and the gates are transversal.
I understand the claim, but I have tried to understand the proof for a couple of weeks and just cant wrap my mind around it.
Can someone help me understand the following paragraph from the article?
An outline of the argument is as follows: The set of logical unitary product operators, $\mathcal G$, is a Lie subgroup of the Lie group of unitary product operators, $\mathcal T$. As a Lie group, $\mathcal G$ can be partitioned into cosets of the connected component of the identity, $\mathcal C$; these cosets form a discrete set, $\mathcal Q$. Using the fact that the Lie algebra of $\mathcal C$ is a subalgebra of $\mathcal T$, it can be shown that the connected component of the identity acts trivially for any local-error-detecting code. This implies that the number of logically distinct operators implemented by elements of $\mathcal G$ is limited to the cardinality of $\mathcal Q$. Due to to the compactness of $\mathcal T$, this number must be finite. A finite number of operators can approximate infinitely many only up to some fixed accuracy; thus, $\mathcal G$, the set of logical unitary product operators, cannot be universal. Transversal operators may be viewed as product operators with respect to a transversal partitioning of the code, so the ability to detect an arbitrary error on a transversal part implies the nonexistence of a universal, transversal encoded gate set.
Thank you for any help :)
"
"['quantum-state', 'circuit-construction']"," Title: What is a unitary operator that makes all the amplitudes all negative on the arbitrary state of $n$ qubits?Body: What is a unitary operator that makes all the amplitudes all negative on the arbitrary state of $n$ qubits?
For example suppose, $n=2$, the arbitrary state is:
$a_1|00\rangle+a_2|01\rangle-a_3|10\rangle+a_4|11\rangle$ then the unitary operator will give the result
$-a_1|00\rangle-a_2|01\rangle-a_3|10\rangle-a_4|11\rangle$ on the above state (where $a_i$ are real positive numbers that are the amplitudes).
In other words the amplitudes are not complex numbers and the negative signs are randomly distributed regarding the $a_i$ for $n=2$; a similar statement is true for any $n$. Also we do not know for which $a_i$is negative or positive without measuring the state (which will destroy the state and we do not want to destroy the state).
An informal description of what the question asks is, is there a unitary operator that gives the version of an arbitrary state which has negated absolute values of all the original amplitudes in the resulting state generated by the unitary operator.
"
"['quantum-operation', 'information-theory', 'linear-algebra', 'diamond-norm']"," Title: Diamond norm distance bound on Stinespring dilations of channelsBody: The diamond distance between two channels $\Phi_0$ and $\Phi_1$ is defined in this answer.
$$ \| \Phi_0 - \Phi_1 \|_{\diamond} = \sup_{\rho} \: \| (\Phi_0 \otimes \operatorname{Id}_k)(\rho) - (\Phi_1 \otimes \operatorname{Id}_k)(\rho) \|_1 $$ where $\operatorname{Id}_k$ denotes the identity channel from $M_k(\mathbb{C})$ (the set of $k\times k$ complex matrices) to itself, $\| \cdot \|_1$ denotes the trace norm, and the supremum is taken over all $k \geq 1$ and all density matrices $\rho$ chosen from $M_{nk}(\mathbb{C}) = M_n(\mathbb{C}) \otimes M_{k}(\mathbb{C})$.
Let $N_1$ and $N_2$ be two completely positive trace nonincreasing maps that satisfy
$$\|N_1 - N_2\|_\diamond\leq \varepsilon.$$
For any channel $N_{A\rightarrow B}$, we define its Stinespring dilation to be an isometry $V_{A\rightarrow BE}$ such that $\text{Tr}_E(V\rho V^\dagger) = N(\rho)$.
Can one show that there exist Stinespring dilations $V_1$ and $V_2$ of $N_1$ and $N_2$ respectively such that we also have a bound on
$$\|V_1 - V_2\|_\diamond$$
in terms of $\varepsilon$?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: IBM Q - Individual Run ResultsBody: In Qiskit, is there a way to get the individual results from each shot on the IBM quantum device (instead of simply the summary statistics)? The result JSON file provides the count of all the 1024 shots.
"
"['programming', 'ibm-q-experience']"," Title: Can Not Login IBM Quantum Experience!Body: When I click the “IBMid” for the first time, I can see the login page and input my username and password. However it return to the initial page(https://quantum-computing.ibm.com/login) and after that the page would give no response no matter which button I click. What is the problem?
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'entanglement', 'error-correction']"," Title: Is there a way to entangle to a dirty qubit?Body: Let's say I do something to a qubit, and I want to entangle it to a 2nd one, like this:
┌───┐
q_0: ┤ ? ├──■──
└───┘┌─┴─┐
q_1: ─────┤ X ├
└───┘
If I measure the 2nd I know the 1st one would have the same result. Now I mess with the first one. In Qiskit, I'll have to reset the 2nd qubit and for the CNOT to maintain the entanglement:
┌───┐ ░ ┌───┐ ░
q_0: ┤ ? ├──■───░─┤???├─░───■──
└───┘┌─┴─┐ ░ └───┘ ░ ┌─┴─┐
q_1: ─────┤ X ├─░──|0>──░─┤ X ├
└───┘ ░ ░ └───┘
My question is how do I make sure the 2nd qubit reflect the measurement of the first one, without the reset (which is not unitary); basically, how do I CNOT to a dirty ancilla? Obviously I can CNOT to a blank ancilla, or swap a blank one up, but say I want an universal gate that do this a million time, and I just don't have enough blank qubits; is there a way that use a finite number of qubits, no matter how many time you repeat the gate, that can achieve the task of making sure some ancilla(s) reflect the measurement of the first qubit? Or is it impossible (and why)?
Thank you!
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'matrix-representation', 'unitarity']"," Title: What is the effect of the reset gate on the matrix form of a gate/circuit?Body: From what I understand, any circuit can be combined to make a gate, which has a square, unitary matrix form that acts on the $2^n$ row of the qubits state column vector. For example, the circuit
┌───┐
q_0: ┤ H ├──■──
├───┤┌─┴─┐
q_1: ┤ H ├┤ X ├
└───┘└───┘
has the matrix form $\begin{bmatrix}
\tfrac{1}{2} & \tfrac{1}{2} & \tfrac{1}{2} & \tfrac{1}{2} \\
\tfrac{1}{2} & -\tfrac{1}{2} & -\tfrac{1}{2} & \tfrac{1}{2} \\
\tfrac{1}{2} & \tfrac{1}{2} & -\tfrac{1}{2} & -\tfrac{1}{2} \\
\tfrac{1}{2} & -\tfrac{1}{2} & \tfrac{1}{2} & -\tfrac{1}{2} \\
\end{bmatrix}$
which acts on the vector $\begin{bmatrix}1 \\ 0 \\ 0 \\ 0 \end{bmatrix}$ of the initial $|0\rangle$ state. But when I try to get_unitary() a circuit with a reset gate, Qiskit tells me that reset instruction is not unitary and therefore it cannot give me any matrix form. My question is, in general, how do a reset gate affect the matrix form of a multi-qubit gate/circuit?
Thank you!
Edit: The circuit I'm trying to find the matrix form for is i.e. like this:
┌───┐
q_0: ┤ H ├──■───────
├───┤┌─┴─┐
q_1: ┤ H ├┤ X ├─|0>─
└───┘└───┘
"
"['information-theory', 'continuous-variable', 'key-distribution']"," Title: What is meant with ""reconciliation"" in CV QKD?Body: I am working on a paper about Continuous Variable QKD. (https://arxiv.org/abs/1711.08500v2)
I read about direct and reverse reconciliation in this paper. I don't understand what exactly Reconciliation is? Reconciliation algorithms, reconciliation protocols and so on.
I am really confused. Can any one explain reconciliation to me?
"
"['quantum-gate', 'quantum-state', 'matrix-representation', 'pauli-gates', 'entanglement-swapping']"," Title: Quick question about Two-qubit SWAP gate from the Exchange interactionBody: I am reading the following paper: Optimal two-qubit quantum circuits using exchange interactions.
I have a problem with the calculation of the unitary evolution operator $U$ (Maybe it is stupid):
I have figure out the matrix of $H$:
\begin{equation}
H = J \begin{bmatrix}1 & 0 & 0 & 0\\
0 & -1 & 2 & 0\\
0 & 2 & -1 & 0\\
0 & 0 & 0 & 1\\
\end{bmatrix}
\end{equation}
But I cannot write the matrix of Operator $U$ and get the result of $(SWAP)^α$.
Could you please help me to calculate it? I really want to know how to get the matrix of U.
Thank you so much.
The figure is shown as below:
"
['vqe']," Title: What are the main differences between the ""unitary coupled cluster"" and the ""hardware efficient"" ansatzes in VQE?Body: There are two popular initial states, in general, for VQEs: the unitary coupled cluster ansatz and the hardware efficient ansatz (for details, see here: https://quantaggle.com/algorithms/ansatz/). Intuitively, what are the main differences between these two and when do we prefer one to the other?
"
['q#']," Title: $S^{\dagger}$ gate in Q#Body: I would like to implement $S^{\dagger}$ gate in Q# and I would like the best way to do it, is it correct to say that $S^{\dagger}$ is equivalent to R1( -Pi()/2 , q) ? Is it also correct to say that $S^{\dagger}$ is equivalent to Rz( -Pi()/2 , q) but with a global phase ?
Thank you.
"
"['circuit-construction', 'shors-algorithm', 'quantum-fourier-transform']"," Title: Shor's algorithm: initialization of second registerBody: I am trying to understand Shor's algorithm. I am not quite sure why the initialization, indicated as $|1\rangle$ in the below image at the bottom left is chosen as it is? I understand the modular exponentiation method in principle, but I am not sure which initialization should be chosen.
"
"['measurement', 'projection-operator']"," Title: What can I conclude about $\langle \phi|\pi_1\pi_2|\phi\rangle$ if $\langle \phi|\pi_i|\phi\rangle\ge e$?Body: If I have two projectors $\pi_1, \pi_2$ such that for some $|{\phi}\rangle$:
$\langle {\phi}| \pi_1 |{\phi}\rangle \geq e$ and $\langle {\phi}| \pi_2 | {\phi}\rangle \geq e$
What can I conclude about the following quantity?
$\langle {\phi} | \pi_1 \pi_2 |{\phi}\rangle$
Is it also $\geq e$?
"
"['information-theory', 'linear-algebra']"," Title: What is the Stinespring representation of the adjoint of a channel?Body: For any completely positive trace nonincreasing map $N_{A\rightarrow B}$, the adjoint map is the unique completely positive linear map $N^\dagger_{B\rightarrow A}$ that satisfies
$$\langle N^\dagger(\sigma), \rho\rangle = \langle \sigma, N(\rho)\rangle$$
for all linear operators $\sigma \in \mathcal{L}(\mathcal{H}_B)$ and $\rho \in \mathcal{L}(\mathcal{H}_A)$.
Let $V_{A\rightarrow BE}$ be any isometry such that $\text{Tr}_E(V\rho V^\dagger) = N(\rho)$. This is the Stinespring representation of any completely positive map. Since $N^\dagger$ is also a completely positive map, it also has a Stinespring representation.
Question: Given $V$, can one write down the Stinespring representation of $N^\dagger$? Naively taking the transpose conjugate of $V$ to write down something like
$$\text{Tr}_E(V^\dagger\sigma V) = N^\dagger(\sigma)$$
doesn't even make sense since $V^\dagger_{BE\rightarrow A}$ whereas the isometry we are after should go from $B$ to $AE'$.
"
['hidden-subgroup-problem']," Title: What is the intuitive reason for why Abelian HSPs are much easier than Non-Abelian HSPs?Body: I think I roughly understand the quantum algorithm for the general Abelian Hidden Subgroup Problem (HSP). We begin by constructing a uniform superposition, calculating the function over that superposition in another register, then measure it to yield a coset state (i.e. a state whose nonzero components all lie in the same coset). Applying the Quantum Fourier Transform will then yield an element that is "orthogonal," or in the kernel, of the hidden subgroup. Repeating this only polynomially many times, we can be certain with arbitrarily high probability that we have produced the hidden subgroup.
My question is, where does this go wrong for non-Abelian subgroups? And what exactly about being Abelian is so important for this algorithm to work correctly? If someone could provide an intuitive explanation, that would be even better! Thanks.
"
"['quantum-gate', 'programming']"," Title: How does the CX gate work?Body: I have a silly question as I am an absolute beginner! So as described in Qiskit:
It performs the NOT operation (equivalent to applying an X gate) on the second qubit only when the first qubit is $|1\rangle$ and otherwise leaves it unchanged.
in the piece of the related program we have :
# Let's do an CX-gate on |00>
q = QuantumRegister(2)
qc = QuantumCircuit(q)
qc.cx(q[0],q[1])
qc.draw(output='mpl')
In my mind I need 2 inputs for a CX gate A & B as (q[0] and q[1]) so that it can control B and NOT A, and also a third qubit as an output. But here we have q[0] as an input and q[1] as an output apparently. Can anybody help me please to understand the logic?
"
"['quantum-gate', 'programming', 'circuit-construction']"," Title: How do I check what is wrong in my full-adder code?Body: I am trying to solve the first question on the qiskit test which is writing a code for a full adder.
So based on my research if I have $A$ q[0], $B$ q[1] and $C$ in q[2] as input and Sum and Cout as output, I should be able to produce the correct outputs by the following gates:
q[0] XOR1 q[1] ---> q[4]
q[0] AND1 q[1] ---> q[3]
q[2] XOR2 q[4] ---> q[5] (SUM)
q[2] AND2 q[4] ---> q[6]
q[3] OR q[6] ---> q[7] (COUT)
Writing the following program I get that my answer is producing wrong results :
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit import IBMQ, Aer, execute
##### build your quantum circuit here
#Define registers and a quantum circuit
q = QuantumRegister(8)
c = ClassicalRegister(2)
qc = QuantumCircuit(q,c)
# Preparing inputs
qc.x(q[0]) # Comment this line to make Qbit0 = |0>
qc.x(q[1]) # Comment this line to make Qbit1 = |0>
qc.x(q[2]) # Comment this line to make Qbit2 = |0> ( carry-in bit )
qc.barrier()
# AND gate1 implementation
qc.ccx(q[0],q[1],q[3])
qc.barrier()
# XOR gate1 implementation
qc.cx(q[0],q[4])
qc.cx(q[1],q[4])
qc.barrier()
# XOR gate2 implementation
qc.cx(q[2],q[5])
qc.cx(q[4],q[5])
qc.barrier()
# AND gate2 implementation
qc.ccx(q[2],q[4],q[6])
qc.barrier()
#OR gate implementation
qc.cx(q[3],q[7])
qc.cx(q[6],q[7])
qc.ccx(q[3],q[6],q[7])
qc.barrier()
# Measuring and put result to classical bit
# ( sum )
qc.measure(q[5],c[0])
# ( carry-out )
qc.measure(q[7],c[1])
# execute the circuit by qasm_simulator
backend = Aer.get_backend('qasm_simulator')
job = execute(qc, backend, shots=1000)
result = job.result()
count = result.get_counts()
print(count)
qc.draw(output='mpl')
Grading tells me that my results are not matching, but I cannot figure out what is wrong with my code.
Thank you so much for help.
"
"['qiskit', 'programming']"," Title: Import Qiskit failsBody: I have successfully installed the Qiskit in Anaconda by using pip install qiskit.
But I can't import Qiskit and get the following error.
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-5-578b7f7e9727> in <module>
----> 1 import qiskit
~\anaconda3\envs\quantum_computing\lib\site-packages\qiskit\__init__.py in <module>
29
30 # The main qiskit operators
---> 31 from qiskit.circuit import ClassicalRegister
32 from qiskit.circuit import QuantumRegister
33 from qiskit.circuit import AncillaRegister
~\anaconda3\envs\quantum_computing\lib\site-packages\qiskit\circuit\__init__.py in <module>
212 random.random_circuit
213 """
--> 214 from .quantumcircuit import QuantumCircuit
215 from .classicalregister import ClassicalRegister, Clbit
216 from .quantumregister import QuantumRegister, Qubit, AncillaRegister, AncillaQubit
~\anaconda3\envs\quantum_computing\lib\site-packages\qiskit\circuit\quantumcircuit.py in <module>
23 from collections import OrderedDict, defaultdict
24 from typing import Union
---> 25 import numpy as np
26 from qiskit.exceptions import QiskitError
27 from qiskit.util import is_main_process
~\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py in <module>
138
139 # Allow distributors to run custom init code
--> 140 from . import _distributor_init
141
142 from . import core
~\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py in <module>
24 # NOTE: would it change behavior to load ALL
25 # DLLs at this path vs. the name restriction?
---> 26 WinDLL(os.path.abspath(filename))
27 DLL_filenames.append(filename)
28 if len(DLL_filenames) > 1:
~\anaconda3\envs\quantum_computing\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
379
380 if handle is None:
--> 381 self._handle = _dlopen(self._name, mode)
382 else:
383 self._handle = handle
OSError: [WinError 193] %1 is not a valid Win32 application
So what should I do to solve this problem?
"
"['programming', 'ibm-q-experience', 'grovers-algorithm', 'simulation', 'compiling']"," Title: Length / transpilation issues with Grover's algorithmBody: I would like to discuss the discrepancies between what we see in the simulator versus what we see in the actual running of the code on any IBMQ machine for any qubits at 5 or above. I am doing a final project on grover's algorithm, and the premise would require an extremely large number of qubits. I have tested my theory on the simulators up to 26 qubits (took 6 hours), and they are ~100% accurate. When I went to test the theory using the exact same circuit, I couldn't get a circuit of 4 qubits to even deviate from statistical random distrubution.
First of all, I have used Qiskit and Q# to create the exact same algorithm. If you could provide me with a methodology that would allow for easier work / do the work for the transpiler on qiskit, or the ability to utilize a real quantum computer in Q#, I would appreciate it.
Currently the transpiler in qiskit / IBMQ for grover's algorithm is limited to around 6-7 qubits. I don't like that I don't have more gates available. Regardless of this issue, I get garbage results for an oracle / ancilla at or larger than 4 qubits total. Why is is that the transpiler / decoherance that is occuring within the circuit is so terrible that I cannot construct Grover's algorithm using gates at or larger than 4 qubits? The probabilties of the simulators themselves are upwards of 99%, but even after a two qubit Grover's algorithm, it shows as only 40ish %?
When I go to three qubits, the entire algorithm is garbage, and I cannot provide ANY accuracy other than a random distribution, and when I tabulated it the accuracy was actually less than the statistical random distrubution. I'm not happy with what is going on here, as I cannot feasibly run anything of meaning on any IBMQ machine. I don't understand why the transpiler is inserting such a ludicrous range in the possible number of gates (about a hundred different possible gate configurations for 5 qubit Grover's algorithm)
Is this an issue with the transpiler? Is this just an issue with general decoherance? I don't understand why the quantum computer can't peform a grover's algorithm of 5 or more.
Please help me to understand what I am not getting here. Are the physical devices that far off from where I felt the technology was? I was hoping that a 15 qubit machine would be able to actually perform better, esp. in the 5 qubit realm.
#initialization
import matplotlib.pyplot as plt
import math
import numpy as np
# importing Qiskit
from qiskit import ClassicalRegister, QuantumRegister
from qiskit.providers.ibmq import least_busy
from qiskit.quantum_info import Statevector
from qiskit.providers.aer import QasmSimulator
# import basic plot tools
from qiskit.visualization import plot_histogram
def initialize_s(qc,qubits):
"""Apply a H-gate to 'qubits' in qc"""
for q in qubits:
qc.h(q)
return qc
def numberofiterations(nqubits):
temp = 2 ** nqubits;
squareRoot = math.sqrt(temp)
iterations = round(squareRoot)
return iterations
def oracle(nqubits):
q = QuantumRegister(nqubits)
qc = QuantumCircuit(q)
#set the oracle's 0 bits
qc.x(q[1])
qc.x(q[2])
#qc.x(q[5])
#qc.x(q[7])
#qc.x(q[8])
#qc.x(q[12])
#qc.x(q[13])
#qc.x(q[15])
#qc.x(q[19])
#qc.x(q[20])
#qc.x(q[21])
#qc.x(q[22])
#qc.x(q[24])
qc.h(q[nqubits-1])
#[0,3,4,6,9,10,11,14,16,17,18,23,26,27],30,ancilla_qubits=None, mode='noancilla')
#qc.mcx([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],q[25],ancilla_qubits=None, mode='noancilla')
#qc.cx([0],[1])
qc.mcx([0,1,2],q[nqubits-1],ancilla_qubits=None, mode='noancilla')
qc.x(q[1])
qc.x(q[2])
#qc.x(q[5])
#qc.x(q[7])
#qc.x(q[8])
#qc.x(q[12])
#qc.x(q[13])
#qc.x(q[15])
#qc.x(q[19])
#qc.x(q[20])
#qc.x(q[21])
#qc.x(q[22])
#qc.x(q[24])
qc.h(q[nqubits-1])
#return the oracle as a gate.
oracle = qc.to_gate()
oracle.name = "U$_\omega$"
return oracle
def diffuser(nqubits):
qc = QuantumCircuit(nqubits)
# Apply transformation |s> -> |00..0> (H-gates)
for qubit in range(nqubits):
qc.h(qubit)
# Apply transformation |00..0> -> |11..1> (X-gates)
for qubit in range(nqubits):
qc.x(qubit)
# Do multi-controlled-Z gate
qc.h(nqubits-1)
qc.mcx(list(range(nqubits-1)), nqubits-1) # multi-controlled-toffoli
#qc.cx([0],[1])
qc.h(nqubits-1)
# Apply transformation |11..1> -> |00..0>
for qubit in range(nqubits):
qc.x(qubit)
# Apply transformation |00..0> -> |s>
for qubit in range(nqubits):
qc.h(qubit)
# We will return the diffuser as a gate
U_s = qc.to_gate()
U_s.name = "$U_s$"
return U_s
n = 4
qr = QuantumRegister(n-1, 'register')
anc = QuantumRegister(1, 'ancilla')
cr = ClassicalRegister(n-1, 'classical')
grover_circuit = QuantumCircuit(qr,anc)
grover_circuit = initialize_s(grover_circuit, list(range(n)))
iterations = numberofiterations(n-1)
for j in range(iterations ):
grover_circuit.append(oracle(n), list(range(n)))
grover_circuit.append(diffuser(n), list(range(n)))
measure_circuit = QuantumCircuit(qr,cr)
measure_circuit.measure(qr,cr)
```
"
"['programming', 'ibm-q-experience']"," Title: State bug in IBM Quantum ExperienceBody: I run many tests with VQC and QSVM algorithms. In last times I can't get final result because some job hang on state Creating, Validating or Running. It can continue many hours and It doesn't finish. For example, I run test with some parameters and get result but after I run test with the same parameters and not get result because this problem. It happens with real devices and qasm_simulator. For QSVM These problems happen after long time (>1000 jobs), for VQC - in the beginning. Does it are problems of site or my code?
Sorry for my english.
My code:
import warnings
import numpy as np
from qiskit.aqua import QuantumInstance
from qiskit.aqua.algorithms import VQC
from qiskit.aqua.components.optimizers import SPSA, COBYLA
from qiskit.aqua.components.feature_maps import RawFeatureVector
from qiskit.circuit.library import TwoLocal, ZZFeatureMap
from qiskit import IBMQ
#I read file where data look so:
#1234
#28313
#2145
#27216
#...
def get_bd(str):
f = open(str,'r')
data = f.read()
_true = []
_false = []
for i in range(3):
m = []
a,none,data = data.partition('\n')
b,none,data = data.partition('\n')
m.append(int(a))
m.append(int(b))
_false.append(m)
for i in range(3):
m = []
a,none,data = data.partition('\n')
b,none,data = data.partition('\n')
m.append(int(a))
m.append(int(b))
_true.append(m)
return _false, _true
def get_tr(name,n):
f = open(name,'r')
data = f.read()
test = []
for i in range(n):
m = []
a,none,data = data.partition('\n')
b,none,data = data.partition('\n')
m.append(int(a))
m.append(int(b))
test.append(m)
return test
train_false,train_true = get_bd('spectrain.txt')
test_false,test_true = get_bd('spectest.txt')
warnings.filterwarnings("ignore", category=DeprecationWarning)
IBMQ.enable_account('0adb8fad54503818021e5540edd831eb17ff2b794c33f544630a57041a7f808140fd5bf21be60984b652025147b4ee5fded6f0783763b0fc9c18dbfcf61cdfdc')
provider = IBMQ.get_provider(hub='ibm-q')
shots = 8192
feature_dim = 2
backend = provider.get_backend('ibmq_qasm_simulator')
optimizer = SPSA(max_trials=1000, c0=4.0, skip_calibration=True)
optimizer.set_options(save_steps=1)
#feature_map = RawFeatureVector(feature_dimension=feature_dim)
feature_map = ZZFeatureMap(feature_dimension=feature_dim, reps=2,entanglement='linear')
#feature_map = SecondOrderExpansion(feature_dimension=2,depth=2,entanglement='linear')
var_form = TwoLocal(feature_dim, ['ry', 'rz'], 'cz', reps=3)
training_data = {'A': np.asarray(train_false),'B': np.asarray(train_true)}
#test_false,test_true = get_bd('test_data')
testing_data = {'A': np.asarray(test_false),'B': np.asarray(test_true)}
vqc = VQC(optimizer, feature_map, var_form, training_data, testing_data)
quantum_instance = QuantumInstance(backend, shots=shots,skip_qobj_validation=False)
result = vqc.run(quantum_instance)
print("testing success ratio: ", result['testing_accuracy'])
Hmm. I run it today on trainning samples in 3-norm,3-anomaly samples and It doesn't hang... while. So yesterday It worked in first time until I run training for 1000-norm,1000-anomaly samples where problem happens. I try to run 1000-norm,1000-anomaly samples later for checking.
Update 21.11.2020
I try run VQC algorithm 1000-norm,1000-anomaly samples and get this:
Some jobs were completed but It hangs now. I get good result with this test yesterday. Today I set 8192 shots (It was 2 shots in last time) and We see this image.
"
['phase-kickback']," Title: Why does the phase of the eigenstate get kicked up to the ancilla qubit?Body: I'm revisiting my knowledge on phase kickback, and I realize that there are many holes in my understanding. I've come across the definition that phase kickback is the phenomenon that occurs when you apply a controlled unitary where the target qubit is in an eigenstate of the unitary thus kicking the phase to the ancilla qubit So here's my question:
Why is it that when applying a controlled operation where the target qubit is an eigenstate, that the phase of that state gets kicked up to the ancilla qubit?
"
"['hamiltonian-simulation', 'quantum-control']"," Title: Gate cancellations in Hamiltonian simulationBody: I'm a bit confused about in which case the two unitary gates in a quantum circuit could be canceled? I'm reading an example in this paper. In the following diagram, Figure (b) is a simplified circuit of Figure (a):
I'm wondering if Figure (b) is the simplest optimization result of Fig. a? In their diagram, the first and third part of the circuit are grouped together, I do understand that two Hadamard gates are canceled, but why the two C-NOT gates (acting on the second and the ancilla qubit) are also canceled? (in this case, those two C-NOT gates are not next to each other)
My guess is they're canceled since no unitary gates are directly sandwiched between the two control qubits (despite there's another C-NOT between them targeted at the same ancilla qubit). Is this the right explanation? How can I have a better understanding of what's going on?
Thanks!!!
"
"['quantum-gate', 'quantum-state', 'unitarity']"," Title: How to perform the unitary transformation $U|i,j_1\rangle = 1/\sqrt{k}(|i,j_1\rangle+|i,j_2\rangle+|i,j_3\rangle...+|i,j_k\rangle)$?Body: Is the following unitary transformation possible? If so, what will be the value of $U$?
$$U|i,j_1\rangle = 1/\sqrt{k}(|i,j_1\rangle+|i,j_2\rangle+|i,j_3\rangle...+|i,j_k\rangle)$$
Here, $i$ is a node in a graph and $j_1,j_2....j_k$ are the nodes to which node $i$ is attached. $k$ is the degree of node.
For example: Consider we have 8 nodes in the graph and Node 0($|000\rangle$) is attached to node 1($|001\rangle$) ,node 7($|111\rangle$) and node 5($|101\rangle$).
So, what I want is a single $U$ operator which does this:
$$U|000,001\rangle=1/\sqrt{3}(|000,001\rangle+|000,111\rangle+|000,101\rangle)$$
$$U|000,111\rangle=1/\sqrt{3}(|000,001\rangle+|000,111\rangle+|000,101\rangle)$$
$$U|000,101\rangle=1/\sqrt{3}(|000,001\rangle+|000,111\rangle+|000,101\rangle)$$
"
"['quantum-gate', 'circuit-construction']"," Title: How to make the gate decomposition of CCCRYBody: I asked about decomposition gate of CCRY last week, and the answer was:
However, I now also want to do this for CCCRY. Please someone tell me.
"
"['programming', 'ibm-q-experience', 'vqe']"," Title: Recording the time taken by a VQE to find ground state energyBody: I want to record the time that a VQE solver takes to find the ground state. At the moment I am using:
%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
import numpy as np
import matplotlib.pyplot as plt
import time
# Loading your IBM Q account(s) and assigning backend
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')
qcomp = provider.get_backend('ibmq_valencia')
#Imports for algorithm
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit.chemistry.transformations import FermionicTransformation, FermionicQubitMappingType
from qiskit.aqua.algorithms import NumPyMinimumEigensolver
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
from qiskit.chemistry.algorithms.ground_state_solvers import GroundStateEigensolver
#Define molecule
molecule = Molecule(geometry=[['H', [0., 0., 0.]],
['H', [0., 0., 0.735]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
#Map fermionic hamiltonian to qubit hamiltonian
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.PARITY,
two_qubit_reduction=True,
freeze_core=True)
#Initialize the VQE solver
vqe_solver = VQEUCCSDFactory(QuantumInstance(backend = qcomp))
#Ground state algorithm
calculation_VQE = GroundStateEigensolver(transformation, vqe_solver)
#Calculate results
start = time.time()
VQE_result = calculation_VQE.solve(driver)
end = time.time()
time_difference = (end - start)
print(VQE_result.total_energies)
print(time_difference)
However, after running this a few times on different IBM quantum machines, I am quite sure that the times I am recording are including the time spent waiting in queue to run the computations (but not completely certain on this).
Is there any way to record the time taken by the VQE to compute the ground state energy without including queue time.
"
"['programming', 'quantum-state', 'ibm-q-experience']"," Title: Measurement of 1 qubit in a two qubit systemBody:
I created two qubits in IBM quantum experience and measured the second qubit without applying any gate.
The result I got had a computational basis of 00 and 10. How does the measurement of the second qubit change the basis to 00 and 10? I have just started to learn quantum computing, so the question may sound silly.
"
['measurement']," Title: Details for implementing the measurement of a simulationBody: I am trying to work out how to program a simulation of a quantum
computer program. I think I understand all the steps, of implementing a simulation, except
the simulation of the measurement.
I will use 2 qubit states to illustrate; though the illustration below extends in
an obvious way to n qubits.
Suppose after we are up to the state just before measurement it is
$a_0|00\rangle+a_1|01\rangle+a_2|10\rangle+a_3|11\rangle$
Suppose there exist a unique maximum from the real numbers
$a_0,a_1,a_2,a_3$ let refer to this as m; and that the sum of squares
of the 4 amplitudes sum to 1.
and we want to know what is the most likely state that will be measured.
A) Is the most likely state to be measured
the one with maximum squared amplitude of $a_0,a_1,a_2,a_3$
in other words, the most likely state has a probability $m^2$ of being measured
-for example, out of 100 repeated measurements $(100*(m^2))$, to the nearest integer, will be the likely state.
or
B) Is the most likely state to be measured the one that has the highest ratios
regarding the amplitudes, compared to every other state,
the ratio measures how many times more likely one state is to be measured when
compared to another state,suppose that $a_3$ is near to one, and $a_0,a_1,a_3$ are near to
zero then computing the absolute values of
$|a_3/a_2|,|a_3/a_1|, |a_3/a_0|$ I assume, not sure but assuming here, will give the largest 3 values when compared
to any of the values in the two lists of amplitude ratios
$|a_2/a_3| ,|a_2/a_1|, |a_2/a_0|$
or
$|a_1/a_2|,|a_1/a_0|, |a_1/a_3|$
therefore $a_3$ is most likely to measured and suppose $a_3/a_2, a_3/a_1, a_3/a_0$ are all largest than some integer I
then if I is large enough for the simulation then we can ignore how many times, referred to as T, we measure
the state because we can conclude $a_3$ is measured every time.
So is the answer A or B?
"
"['qiskit', 'algorithm', 'grovers-algorithm']"," Title: Qiskit: How can I modify Grover's algorithm to search for a state that doesn't belong to a basis set?Body: Let's say I need to find the state $111$ in a "database" that is not the computational basis for a 3-qubits system (because it doesn't contain all of the basis vectors or contains the same vector more than one time). For example, this database could be the set $\{000, 010, 001, 000, 000, 110\}$.
How can I adjust Grover's algorithm for this kind of search? I would like a Qiskit implementation of this case.
"
['quantum-gate']," Title: State vector after applying CNOTBody:
In the circuit, the CNOT gate is applied in 11 state and it should transform into 10 state. But why is the probability of getting 01 state 100 percent?
"
"['hamiltonian-simulation', 'quantum-control', 'probability']"," Title: Hamiltonian simulation: how can I incorporate the constant before each term?Body: I got another follow-up question about Hamiltonian simulation from the previous post: if I perform the controlled time-evolution of the Hamiltonian:
$$
H_{3} = \alpha\ X_1\otimes Y_2 + \beta \ Z_1\otimes Z_2
$$
where $\alpha$ and $\beta$ are real constants. When they're both equal to 1, $H_3$ could be simulated via the following quantum circuit (answer from @KAJ226):
However, how can I introduce those constants when they're not equal to 1? This paper by Earl Campbell proposed an idea to build up a compiler and randomly 'select' the part of Hamiltonian according to a probability distribution determined by constants like $\alpha$ and $\beta$.
I think this is a good way to incorporate the effects of those constants (the effect would be more obvious if you have enough time steps), but it's still kind of 'indirect' to me. I'm wondering is there another option that I can show the effects of $\alpha$ and $\beta$ when they are generic real numbers?
Thanks!!
"
"['quantum-state', 'quantum-fourier-transform', 'quantum-walks']"," Title: What is this equation for coin operator is trying to do in this quantum walk for Non-regular graph? This coin operator is called Fourier coinBody: I am reading the following paper: Discrete-time quantum walk on complex networks
for community detection by Kanae Mukai
We define the Coin operator $C$ by: $C=C_1\otimes C_2....C_n$ , We define coin operator for Node $i, C_i:H_i\to H_i$ is given by:
$C_i^F|i\to j_1\rangle|i\to j_2\rangle.......|i\to j_k\rangle=(|i\to j_1\rangle|i\to j_2\rangle.......|i \to j_k\rangle)1/\sqrt(k_i) \begin{pmatrix} 1 & 1 & 1 & ... & 1\\ 1 & e^{\iota\theta/k_i} & e^{2\iota\theta/k_i} & ... & e^{(k_i-1)\iota\theta/k_i}\\ 1 & e^{2\iota\theta/k_i} & e^{4\iota\theta/k_i} & ... & e^{2(k_i-1)\iota\theta/k_i}\\ . & . & . & . & .\\. & . & . & . & .\\. & . & . & . & .\\ 1 & e^{(k_i-1)\iota\theta/k_i} & e^{2(k_i-1)\iota\theta/k_i} & ... & e^{(k_i-1)(k_i-1)\iota\theta/k_i}\end{pmatrix}$
Here $k_i$ is the degree of $i^{th}$ node and $\theta=2\pi$. The author called this coin as Fourier Coin. And this $i\to j$ implies that Node $i$ is going to hope to adjacent Node $j$.
Now, What is going on with this equation?
"
"['quantum-state', 'bloch-sphere', 'semidefinite-programming']"," Title: $3 \rightarrow 1$ QRAC encoding for XOR functionsBody: I'm currently working on QRAC and was wondering if there's an encoding protocol in $3 \rightarrow 1$ such that the receiver is able to retrieve any one of the XOR combinations of the bits, along with the original bits itself ( a grand total of 7 functions; if a, b, c are the bit positions, the receiver should be able to guess a, b, c, a+b, b+c, c+a, a+b+c with a probability greater than 1/2).
Is this even possible? My initial guess would be to use some kind of POVM measurements in the decoding part but don't how to proceed with that.
If you have any ideas on this then please let me know. Thank you.
"
"['quantum-state', 'probability', 'random-quantum-circuit', 'haar-distribution']"," Title: Compute the large $n$ distribution of $|\langle z_i|\psi\rangle|^2$ over Haar random quantum statesBody: Let $|\psi\rangle$ be a $n$ qubit Haar-random quantum state. I am trying to show that in the limit of large $n$, for each $z_{i} \in \{0, 1\}^{n}$,
$$ |\langle 0|\psi\rangle|^{2}, |\langle 1|\psi\rangle|^{2}, \ldots, |\langle 2^{n} - 1|\psi\rangle|^{2} ~\text{are i.i.d random variables and}$$
$$ |\langle z_{i}|\psi\rangle|^{2} \sim \text{PorterThomas}(\alpha),$$
where the probability density function for the Porter Thomas distribution is given by
$$ f(\alpha) = 2^{n} e^{-2^{n} \alpha}.$$
For example, look at Fact 10 of this paper. I am specifically interested in why we need a large enough $n$ to have the i.i.d approximation.
"
"['qiskit', 'programming', 'shors-algorithm']"," Title: Simplifying Qiskit circuit with c_if()Body: I'm trying to simplify the inner for loop of this implementation of the Mosca-Ekert semi-classical variant of Shor's algorithm. The inner for loop should have only linear length, but this implementation is exponential.
From https://github.com/ttlion/ShorAlgQiskit/blob/master/Shor_Sequential_QFT.py
""" Cycle to create the Sequential QFT, measuring qubits and applying the right gates according to measurements """
for i in range(0, 2*n):
"""reset the top qubit to 0 if the previous measurement was 1"""
circuit.x(up_reg).c_if(c_aux, 1)
circuit.h(up_reg)
cMULTmodN(circuit, up_reg[0], down_reg, aux, a**(2**(2*n-1-i)), N, n)
"""cycle through all possible values of the classical register and apply the corresponding conditional phase shift"""
for j in range(0, 2**i):
"""the phase shift is applied if the value of the classical register matches j exactly"""
circuit.u1(getAngle(j, i), up_reg[0]).c_if(up_classic, j)
circuit.h(up_reg)
circuit.measure(up_reg[0], up_classic[i])
The obvious way of using c_if(up_classic[j],j) doesn't work. I've tried using an if statement as in
for j in range(0, i):
"""the phase shift is applied if the value of the classical register matches j exactly"""
if up_classic[j]:
circuit.u1(getAngle(2**j,i), up_reg[0])
but test runs fail to find the correct factor for small semiprimes like 21 or 33.
"
"['information-theory', 'fidelity', 'trace-distance', 'linear-algebra']"," Title: Closeness of purifications of statesBody: Uhlmann's theorem states that if two states $\rho_A, \sigma_A$ satisfy $F(\rho_A, \sigma_A)\geq 1 - \varepsilon$, then there for any purification $\Psi_{AR}$ of $\rho_A$, one can find a purification $\Phi_{AR}$ of $\sigma_A$ such that
$$F(\Psi_{AR}, \Phi_{AR})\geq 1 - \varepsilon$$
The purification $\Phi_{AR}$ can be found by optimizing over unitaries on the purifying register alone i.e. the following holds for any choice of purification $\Phi_{AR}$
$$\sup_{U_R}F(\Psi_{AR}, (I_A\otimes U_R)\Phi_{AR})\geq 1- \varepsilon$$
Since the trace distance and fidelity are closely related, one can translate Uhlmann's theorem into the following. Given $\|\rho_A - \sigma_A\|_1 \leq \varepsilon$, for any purification $\Psi_{AR}$ of $\rho_A$ and $\Phi_{AR}$ of $\sigma_A$ , we have
$$\inf_{U_R}\|\Psi_{AR} - (I_A\otimes U_R)\Phi_{AR}\|_1\leq \delta(\varepsilon),$$
where $\lim_{\varepsilon \rightarrow 0}\delta(\varepsilon) = 0$. Crucially, $\delta(\varepsilon)$ has no dependence on the dimension of the state.
Question: Is the above statement true for any other Schatten p-norm. Given $\rho_A, \sigma_A$ such that $\|\rho_A - \sigma_A\|_p\leq \varepsilon$ and for any purifications $\Psi_{AR}$ of $\rho_A$ and $\Phi_{AR}$ of $\sigma_A$, is it true that
$$\inf_{U_R}\|\Psi_{AR} - (I_A\otimes U_R)\Phi_{AR} \|_p \leq \delta(\varepsilon)$$
I am particularly interested in the above statement for the operator norm i.e. $p = \infty$.
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: What is the probability of finding the second qubit as $0$ in the state $|\psi\rangle=\frac1{\sqrt2}|00\rangle+\frac12|10\rangle-\frac12|11\rangle $?Body: Assuming two qubits start in the state:
$|\psi\rangle = \frac{1}{\sqrt 2}|00\rangle + \frac{1}{2}|10\rangle- \frac{1}{2}|11\rangle $
What is the probability of measuring the second qubit as 0? And what is the new state of the system after measuring the first qubit as 1?
I know that for a single qubit state that the probability amplitudes are the coefficient squared. In a two qubit system are the probabilities distributed to the individual states? I.e. from this example does the each zero state in the state: $|00⟩$ have a 50% chance? And I don't really understand the second question, any suggestion on where to review or study?
"
"['nielsen-and-chuang', 'textbook-and-exercises', 'probability']"," Title: Nielsen & Chuang Exercise 6.13: Standard deviation of classical counting algorithmBody: $\newcommand{\expectation}[1]{\mathop{\mathbb{E}} \left[ #1 \right] }
\newcommand{\Var}{\mathrm{Var}}$ From Nielsen & Chuang 10th edition page 261:
Consider a classical algorithm for the counting problem which samples uniformly and independently $k$ times from the search space, and let $X1, \dots, X_k$ be the results of the oracle calls, that is, $X_j = 1$ if the $j$th oracle call revealed a solution to the problem, and $X_j = 0$ if the $j$th oracle call did not reveal a solution to the problem. This algorithm returns the estimate $S \equiv N \times \sum_j X_j/k$ for the number of solutions to the search problem. Show that the standard deviation in $S$ is $\bigtriangleup S = \sqrt{ M(N − M)/k }$.
The question goes on but I'm already stuck here. To get to the standard deviation first I'm trying to calculate the variance via:
$$
\Var(S) = \expectation{S^2} - \expectation{S}^2 \tag1\label1
$$
$$
\expectation{S} = N \times \sum_j \expectation{X_j}/k = \frac{N}{k} \sum_{j=1}^k \frac{M}{N} = M \tag2\label2
$$
Therefore $S$ is an unbiased estimator of M.
Now:
$$
\expectation{S}^2 = \expectation{\left( N \times \sum_j X_j/k \right)^2} = \frac{N^2}{k^2} \expectation{\left( \sum_j X_j \right)^2} = \frac{N^2}{k^2} \sum_{i=1}^k \sum_{j=1}^k \expectation{X_i X_j} \tag3\label3
$$
To calculate $\expectation{X_i X_j}$ we need to consider 2 cases:
- $i=j \implies \expectation{X_i X_i}=P(X_i=1)=M/N \tag4\label4$
- $i \neq j \implies \expectation{X_i X_j}=P(X_i=1, X_j=1)=\frac{M}{N} \frac{M-1}{N-1} \tag5\label5$
Case 1 happens $k$ times, therefore case 2 must happen $k^2-k$ times. So we have:
$$
\expectation{S}^2 = \frac{N^2}{k^2} \left( k \frac{M}{N} + (k^2 - k) \frac{M}{N} \frac{M-1}{N-1} \right) \tag6\label6
$$
Putting \eqref{2} and \eqref{6} together, after some tedious algebra I got:
$$
\Var(S) = \frac{M}{k} \frac{(N-M)(N-k)}{N-1} \tag7\label7
$$
If $k \ll N$, then \eqref{7} is close to what is stated in the original question but is not exactly it. Can anyone spot where I made the blunder?
"
"['algorithm', 'circuit-construction']"," Title: Check if $|\psi\rangle$ is equal to a fixed basis state using the standard set of gatesBody: Consider a circuit acting on $n\geq2p+1$ qubits. The first $p$ qubits encode some unknown state $|\psi\rangle$. Next $p$ qubits encode a fixed given basis state $|\phi\rangle=|\ldots f_2f_1f_0\rangle$. The $(2p+1)$th qubit is initialized in the $|0\rangle$ state. Using the standard set of gates, how can I check if $|\psi\rangle$ is equal to $|\phi\rangle$ and put the result of this comparison into the $2p+1$th qubit? (I wrote "$\geq$" in case we need ancillas).
I guess, the implementation has to do something with the SWAP test, but I don't want to do any measurements. Feels like my question is purely on classical logic, and there's nothing quantum about it.
Please note that my question is NOT about comparing two arbitrary states. One state is a known state from the computational basis.
"
"['quantum-gate', 'entanglement', 'bell-basis']"," Title: Can the following Bell states have probability amplitudes other than 1/2 and still be entangled?Body: From my understanding, a qubit is entangled when the state of one qubit depends on the other, and vice versa. Can the following bell states have probability amplitudes other than 1/2 and still be entangled?:
$ |\Phi^\pm\rangle = \frac{1}{\sqrt{2}} (|0\rangle_A \otimes |0\rangle_B \pm |1\rangle_A \otimes |1\rangle_B) $
${\displaystyle
|\Psi ^{\pm }\rangle ={\frac {1}{\sqrt {2}}}(|0\rangle _{A}\otimes |1\rangle _{B}\pm |1\rangle _{A}\otimes |0\rangle _{B})}
$
For example, is it possible to have bell pairs with probability amplitudes that are not $ \dfrac{1}{\sqrt{2}}$, but rather something like this: $|\Psi\rangle = \frac{\sqrt{3}}{2} (|00 \rangle + \frac{1}{2} |11\rangle)$
"
"['qiskit', 'programming', 'algorithm', 'mathematics', 'measurement']"," Title: How to calculate the exponential of all elements in an input array using qiskit?Body: How can I perform an operation similar to Numpy.exp() in qiskit?
"
"['quantum-gate', 'programming', 'quantum-state', 'unitarity']"," Title: How to apply a operator to qubit system on the basis of current state of system?Body: Suppose I have three different operators $U_1, U_2,U_3$. Now, these three operators will be applied if my current state of the system is $|\psi_0\rangle,|\psi_1\rangle $ and $|\psi_2\rangle$ respectively.
Now suppose I started with some initial state $|\psi_{initial}\rangle$ and after applying two unitary operations it will be converted to one of the states above and on the basis of that the respective unitary operator needs to applied.
I know we can't measure the state as it will collapse the system. So, what method can be applied here?
"
"['quantum-state', 'entanglement', 'measurement', 'textbook-and-exercises', 'bell-basis']"," Title: What are the possible results of measuring $X$ and $Z$ on the state $|01\rangle+|10\rangle$?Body: When calculating the probability of getting +1 on X-basis on the first qubit of Bell's state $|01\rangle+|10\rangle$, the result is 1/2 with the state after measurement |++⟩ while the probability of measuring the second qubit with the collapse state is 1 and the state after measurement also $|++\rangle$.
When calculating the probability of getting +1 on Z-basis on the first qubit of Bell's state $|01\rangle+|10\rangle$, the result is 1/2 with the state after measurement |01⟩ while the probability of measuring the second qubit with the collapse state is 0 and the state after measurement also $|01\rangle$.
What is other possible result of measuring X and Z, for example, XX, XZ, ZX, ZZ ?
How to build a table to compile all of the possible results?
"
"['algorithm', 'circuit-construction', 'grovers-algorithm', 'textbook-and-exercises']"," Title: How does feedback work in simple Grovers algorithm where $n=4$?Body: In this example implementation of Grovers Algorithm from the Qiskit Textbook which solves a $2\times 2$ sudoku puzzle:
https://qiskit.org/textbook/ch-algorithms/grover.html
The circuit iterates twice (see picture)
My question is:
How is the data in the $c_0 - c_3$ and out0 qubits utilised.
To me it looks like $c_0 - c_3$ and out are never fed back into the $v_0 - v_3$ qubits, and $v_0 - v_3$ are the only ones that are measured at the end.
I'm not sure if I've misinterpreted how entanglement works here, or how the CX gates work.
"
"['circuit-construction', 'surface-code', 'quantum-circuit']"," Title: How to understand the circuits used for magic state distillation in surface code?Body: I'm reading about surface code theory recently (Phys. Rev. A 86, 032324). When I come across the magic state distillation part, it is difficult for me to understand the circuits. In addition, I have read Bravyi and Kitaev's paper about magic state distillation(Phys. Rev. A 71, 022316). But when back to the circuits below, I still can not figure out the process how it work.
"
"['algorithm', 'grovers-algorithm', 'physical-realization', 'oracles']"," Title: Is Grovers Algorithm Oracle creation a hardware level aspect?Body: There are numerous questions that asks about practical application demonstration of the Grover algorithm for arrays and databases.
However examples are not seen anywhere.
While searching for its practicality, I came across with study Is Quantum Search Practical which states that creation of the oracle is a hardware level aspect (section 4 - Oracle implementation).
Can I get please get some support in clarifying this?
"
"['mathematics', 'density-matrix', 'partial-trace', 'trace-distance']"," Title: How can we upper bound the norm of a partial trace?Body: Suppose we have the normalised states $|\phi_{1}\rangle,|\phi_{2}\rangle \in A \otimes B$ where $A$ and $B$ are $d$-dimensional complex vector spaces.
Suppose $|\langle\phi_{2}|\phi_{1}\rangle| < 1$.
Can we say what is the upper bound of $\| \mathrm{Tr}_{B} (|\phi_{1}\rangle\langle\phi_{2}| )\|_{1}$?
"
"['quantum-state', 'entanglement', 'measurement', 'physical-qubit']"," Title: What is the meaning of measuring a Bell state with Pauli operators?Body: There will be a certain value of getting the probability when measuring any Bell's state with Pauli operators such as observable X, Y, or Z. What is the meaning behind all this measurement? the result of the measurement will show or prove what? Are they any theory or explanation behind all the measurements?
"
"['mathematics', 'pauli-gates']"," Title: How can I verify that the Pauli group is a group? And is it abelian?Body: So how can I verify that the Pauli Group is a Group? Then furthermore, Abelian? And then to sum it up, the order of the group. Trying to do some research into the group but I can't find much about it.
"
"['quantum-gate', 'qiskit', 'programming', 'algorithm', 'measurement']"," Title: How can I multiply two arrays like [1,2,3] and [4,5,6] in quantum computing aspects?Body: Multiplication of two arrays in quantum computing.
"
"['quantum-gate', 'circuit-construction', 'pauli-gates', 'universal-gates', 'clifford-group']"," Title: How do I create an inverse identity gate?Body: Is it possible for me to construct a gate that inverse everything ($|0\rangle \rightarrow -|0\rangle, |1\rangle \rightarrow -|1\rangle$, etc. basically like a $-I$ gate) from the basic $X, Y, Z, CX,...$ gates, for any number of qubits? How do I do so if it's possible?
Thank you!
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis']"," Title: How to create a gate with functionality CCX(a,b,b)?Body: Can we create a Controlled gate with below functionality?
if {a==|1> && b==|1>} then {qc.x(b)}
Basically, a CCX gate but the output Qubit is actually one of the input Qubits. Apparently, In ccx/mct repetition isn't allowed!
Please do let me know. TIA!
"
"['quantum-state', 'mathematics', 'quantum-operation', 'bloch-sphere']"," Title: How does the CPTP constraint reflect on the matrix representation of a qubit channel in the Pauli basis?Body: Let us write the possible states of a qubit in the Bloch representation as
$$\newcommand{\bs}[1]{{\boldsymbol{#1}}}\rho_{\bs r}\equiv \frac{I+\bs r\cdot\bs \sigma}{2},$$
where $\bs\sigma=(\sigma_1,\sigma_2,\sigma_3)$ are the Pauli matrices.
I can then represent $\rho_{\bs r}$ as the vector
$$\rho_{\bs r}\doteq \frac12\begin{pmatrix}1 \\ \bs r\end{pmatrix}.$$
In this representation, I can represent a linear operator acting on $2\times 2$ matrices, $\mathcal E\in\mathrm{Lin}(\mathrm{Lin}( \mathbb C^2))$, as a matrix
$$\mathcal E\doteq \begin{pmatrix}1 & \bs 0^T \\ \bs t & \Delta\end{pmatrix},$$
where $\Delta\in\mathrm{Lin}(\mathbb C^2)$ and $\bs t\in\mathbb R^2$.
This form of $\mathcal E$ automatically preserves the normalisation.
The action of $\mathcal E$ on $\rho_{\bs r}$ can then be written as
$$\mathcal E(\rho_{\bs r}) = \rho_{\Delta\bs r + \bs t}.$$
Is there a good way to see how the CPTP constraint on $\mathcal E$ translates into constraints on $\bs t$ and $\Delta$ in this representation?
Clearly, for $\mathcal E(\rho)$ to still be a state we need $\|\Delta \bs r+\bs t\|\le 1$. Is this the only requirement?
"
['ibm-q-experience']," Title: Where are my Results?Body: I've successfully used IBM Q Experience for quite a while now. But the interface seems to have changed. After I run a simulation on my quantum circuit, I go to Results but I don't see the answer in the form of a histogram like I used to. Where is it?
"
"['resource-request', 'simulation', 'interpretations']"," Title: What is the ""sum-over-paths"" picture of quantum computing?Body: In chapter 9 of Scott Aaronson's book Quantum Computing Since Democritus (see online progenitor lecture notes here), he introduces a strange (to me) conceptualization of applying two Hadamard-like operations to a qbit, summed up in this diagram:
I had the opportunity to ask him about this and he made three interesting statements:
- This is called the "Feynman" or "sum-over-paths" picture of quantum mechanics
- This picture is interesting because it reveals the effect of destructive interference
- If a QC is simulated using the sum-over-paths method, it takes exponential time instead of space
How does the sum-over-paths picture work conceptually for quantum computation? For example, given a series of quantum logic gates applied to some qbits, how would I calculate the resulting amplitude values of those qbits using the sum-over-paths method? If this is too complicated to explain in an answer on this site, are there any good introductions to this topic elsewhere?
Also, do any of the main quantum languages/frameworks include a sum-over-paths simulator?
"
"['quantum-state', 'entanglement', 'density-matrix', 'bell-basis', 'depolarizing-channel']"," Title: Two qubit state + Depolarizing channel = Bell diagonal state?Body: In multiple sources, e.g. RGK, KGR, it is stated (without proof) that if you take any two qubit state and send it through a depolarizing channel, the resulting state would be a Bell-diagonal state. I understand that a bipartite Bell-diagonal state $\rho_{AB}$ has the form:
$$
\rho_{AB} = \lambda_1 |\Psi^+\rangle\langle \Psi^+| + \lambda_2 |\Psi^-\rangle\langle \Psi^-| +\lambda_3 |\Phi^+\rangle\langle \Phi^+| +\lambda_4 |\Phi^-\rangle\langle \Phi^-|,
$$
where $|\Psi^+\rangle, |\Psi^-\rangle, |\Phi^+\rangle, |\Phi^-\rangle$ are the usual Bell states.
The action of a depolarizing channel $\mathcal{E}$ on two qubits is defined as:
$$
\mathcal{E}(\rho_{AB}) = \sum_i (E_i \otimes E_i) \rho_{AB} (E_i \otimes E_i)^\dagger,
$$
where $E_i \in \{\mathbb{I}, \sigma_x, \sigma_y, \sigma_z\}$ are the Pauli operators.
However, I don't see why ANY bipartite density operator would be transformed into a Bell-diagonal state. Is there any proof of this claim?
"
"['mathematics', 'textbook-and-exercises', 'unitarity', 'linear-algebra']"," Title: What is $\sum_{i}\langle i \vert U \vert j\rangle$ for unitary $U$?Body: The question is basically the title but given a unitary operator $U$ and a computational basis, can we say anything about the complex number below?
$$c = \sum_{i}\langle i \vert U \vert j\rangle$$
I expected that it would be $|c| = 1$ but this does not seem to generally hold.
"
"['programming', 'hamiltonian-simulation', 'cirq']"," Title: Cirq.simulate expectation value of a HamiltonianBody: I want to simulate the final state of an ansatz in cirq using simulate.
Now I want to calculate the expectation value of a Hamiltonian.
How do I do this? I can only find simulator.run examples in cirq. But I want to access the wavefunction and therefore would need simulator.simulate.
Is there a function in cirq I can use or how could I do this?
"
"['qiskit', 'programming', 'ibm-q-experience', 'ibm']"," Title: Error while trying to execute the Quantum Circuits in IBMQBody: I have been trying to execute the quantum circuit in the backend of the IBM 16 qubit Melbourne machine. I end up getting
IBMQBackendApiError: 'Error submitting job: "HTTPSConnectionPool(): Max retries exceeded with url: **** SignedHeaders= ** Signature= ****(Caused by SSLError(SSLError(1, \'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)\')))
but when I check my IBMQ account the status of the job is Creating. I do not understand why I get such an error. Can someone help to identify what exactly the issue is?
"
"['measurement', 'error-correction', 'density-matrix']"," Title: Question about quantum error correction and density matrixsBody: I am now studying QEC and feel confused. If I have a density matrix before the correction:
The circuit is:
$\rho = p^0(1-p)^3|\varphi\rangle \langle\varphi|+p^1(1-p)^2\sum_{i=1}^3X_i|\varphi\rangle \langle\varphi|X_i+p^2(1-p)\sum_{i=1}^3(X_3 X_2 X_1)X_i|\varphi\rangle \langle\varphi|X_i(X_1 X_2 X_3)+p^3(X_3 X_2 X_1)|\varphi\rangle \langle\varphi|(X_1 X_2 X_3)$
My answer is:
$\rho = p^0(1-p)^3|\varphi\rangle \langle\varphi|+3p^1(1-p)^2|\varphi\rangle \langle\varphi|+3p^2(1-p)|\varphi\rangle \langle\varphi|+p^3|\varphi\rangle \langle\varphi|$
After the circuit works, what is the probability to find the logical qubit in the state $|ψ\rangle$ and why the system is not in the state $|ψ\rangle = α|000\rangle + β |111\rangle$ with probability 1 after the error correction procedure of random bit flips? It makes me confused.
Hope someone can help me with my problems.
By the way, Nielsen's book has little examples for a newbie to learn, where could I find more exercises and examples?
Sorry about the pictures, I just draw this quick picture by my hand.
"
"['quantum-gate', 'entanglement', 'error-correction', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Pauli Matrix tolerant and encodingBody: I'm stumped by these questions in Chuang's book.
If I have a state $|ψ\rangle=1/2\sqrt2(1+M_0)(1+M_1)(1+M_2)|0\rangle_7$, where
$$M_0=X_0X_4X_5X_6; M_1=X_1X_3X_5X_6; M_2=X_2X_3X_4X_6$$
I rewrite its superposition expression without operators on the computational basis:
$$|ψ\rangle=1/2^5[(|0000000\rangle+|1111111\rangle)+(|1000111\rangle+|0111000\rangle)+(|0101011\rangle+|1010100\rangle)+(|0011101\rangle+|1100010\rangle)+(|1101100\rangle+|0010011\rangle)+(|1011010\rangle+|0100101\rangle)+(|0110110\rangle+|1001001\rangle)+(|1110001\rangle+|0001110\rangle)] $$
I am not sure if it is right. Hope you guys can give me some suggestions.
Also, I am not sure $X$ or $Z$ operations are fault-tolerant. I learned from Chuang's book that a complete set of gates consisting of $H$-gate, phase-gate, C-NOT, and $T$ gates can be constructed using fault-tolerant procedures. In my opinion, $X$ is not fault-tolerant and $Z$ is fault-tolerant, since $Z$ is one of the phase gates.
Am I wrong? Hope someone can help me with my problems!
Thank you
"
"['quantum-gate', 'quantum-enhanced-machine-learning', 'quantum-neural-network']"," Title: What is a ""repeat until success quantum circuit"" in quantum neural networks?Body: I am working now on a quantum neural network project and want a deep explanation on the Repeat Until Success circuit. What I know about this circuit is that it allows a nonlinear activation function to be applied by rotating around the $\hat y$ axis by an angle $\theta$. But I don't understand till now how this circuit works? Can someone help me to clarify how it works?
Thank you
"
['qaoa']," Title: In QAOA, why do we pick the initial Hamiltonian $B$ to be $\sigma_x$ applied to each qubit?Body: In QAOA 1, why do we pick the initial Hamiltonian $B$ to be $\sigma_x$ applied to each qubit? Would it be possible to pick $B$ to be an application of $\sigma_z$'s instead? Then $C$ and $B$ would be both diagonal in the Z-basis. What is preventing us from taking this choice for $B$?
Thanks in advance!
"
"['quantum-gate', 'programming', 'physical-realization']"," Title: How do quantum computers implement a random unitary gate?Body: If I from qiskit.quantum_info import random_unitary and then random_unitary(2**number_of_qubits) What returns is a unitary matrix with dimension $(2^{number\_of\_qubits},2^{number\_of\_qubits})$, and if I stimulating the unitary operation on a classical computer it is matrix computation.
Here comes my question: what quantum computers do to implement this random unitary?
From the universality of quantum gate set, we know that an arbitrary single-qubit operation can be decomposed into the set of $\{H, S, T\}$ or $\hat U=\hat\Phi(\delta)\hat R_z(\alpha)\hat R_y(\theta)\hat R_z(\beta)$ where $\hat \Phi(\delta)=\begin{pmatrix}e^{i\delta}&0\\0&e^{i\delta}\end{pmatrix}$, $\hat R_z(\alpha)=\begin{pmatrix}e^{i\alpha/2}&0\\0&e^{-i\alpha/2}\end{pmatrix}$ and $\hat R_y(\theta)=\begin{pmatrix}cos\frac{\theta}{2}&sin\frac{\theta}{2}\\-sin\frac{\theta}{2}&cos\frac{\theta}{2}\end{pmatrix}$.
But when considering physical realizations, we need to consider the problem of finite precision and so on. Then, which method will the quantum computers adopt? And more generally, what if we introduce CNOT here to form the universal quantum gate set for an arbitrary number of qubits?
Even a great reference paper or detailed qiskit documentation can be helpful (in fact to make my work rigorous this is essential). I appreciate you in advance.
"
"['quantum-state', 'measurement', 'projection-operator']"," Title: Can we characterise how correlated the expectation values associated with a pair of observables are?Body: Consider a state $\rho$ and two observables $P$ and $Q$.
Is there a good way to characterise how correlated the associated expectation values are? Be it in terms of mutual information or something else.
As an example, if $\rho$ is a qubit and $P_i=|i\rangle\!\langle i|$ projectors onto the computational basis states, then we know that $P_0$ and $P_1$ are fully correlated, as $\langle P_1\rangle = 1- \langle P_0\rangle$. Knowing one tells the value of the other.
On the other hand of the spectrum, if $P_+\equiv |+\rangle\!\langle +|$, then knowledge of $\langle P_0\rangle$ imposes the bound
$$\frac12 - \sqrt{\langle P_0\rangle(1-\langle P_0\rangle)} \le \langle P_+\rangle \le \frac12 + \sqrt{\langle P_0\rangle(1-\langle P_0\rangle)}.$$
This can be seen starting from writing $\rho=\frac12(I+\sum_k c_k \sigma_k)$, observing that $\langle P_0\rangle = (1+c_z)/2$, $\langle P_+\rangle = (1+c_x)/2$, and $c_z^2+c_x^2\le1$, and thus concluding that $|c_x|\le \sqrt{1-c_z^2}$ with $c_z=2\langle P_0\rangle-1$.
Thus, in the case of $P_+$, we have a continuous freedom compatible with an observed value of $\langle P_0\rangle$, albeit with constrained bounds.
Can similar characterisations be made in the general case of an arbitrary pair of observables $P$ and $Q$?
To be more precise, I'm asking, given $\alpha=\langle P\rangle$, what is
$$\{\langle Q\rangle_\rho\equiv \mathrm{Tr}(\rho Q) : \rho\in\mathrm D(\mathcal X)\text{ such that } \langle P\rangle_\rho=\alpha\},$$
where $\mathrm D(\mathcal X)$ is the set of all states in the relevant Hilbert space $\mathcal X$.
"
"['quantum-state', 'quantum-operation']"," Title: Does it make sense to sum two Choi operators?Body: I am very new to the theory of the Choi representation of quantum processes and I am learning it all by myself from research papers (especially this https://arxiv.org/abs/1111.6950) as I didn't find any quantum info book describing it. I was wondering if given two Choi operators $\Lambda_1$, $\Lambda_2$, it was possible to construct a new Choi operator $\Lambda$ as a convex linear combination of the two. i.e. $\Lambda = (1-a)\Lambda_1 + a \Lambda_2$ as one would do with the states $(1-a)\rho_1 + a \rho_2$. If it is possible to what process $\Lambda$ would correspond?
"
"['quantum-state', 'partial-trace', 'trace-distance']"," Title: Is the trace distance between multipartite states invariant under permutations?Body:
- Consider two multipartite states $\rho_{A_1A_2..A_L}$ and $\sigma_{A_1A_2..A_L}$ in $\mathcal{H}_{A_1} \otimes\mathcal{H}_{A_2} \otimes...\mathcal{H}_{A_L} $. For an arbitrary permutation $\pi$ over $\{ 1, \ldots ,L\}$, is it true that
$$
\lVert \rho_{A_1A_2..A_L} - \sigma_{A_1A_2..A_L} \lVert_1 = \lVert \rho_{A_{\pi(1)}A_{\pi(2)}..A_{\pi(L)}} - \sigma_{A_{\pi(1)}A_{\pi(2)}..A_{\pi(L)}} \lVert_1?
$$
- If 1. is not true, is the following true:
If $\rho_{A_1A_2..A_LB}$ and $\sigma_{A_1A_2..A_LB}$ are two calssical-quantum states in $\mathcal{H}_{A_1} \otimes\mathcal{H}_{A_2} \otimes...\mathcal{H}_{A_L} \otimes \mathcal{H}_{B}$, i.e., one can write $\rho_{A_1A_2..A_LB} = \sum_{a_1} \ldots \sum_{a_L} p(a_1,a_2,\ldots,a_L) |a_1\rangle \langle a_1| \otimes \ldots \otimes |a_L\rangle \langle a_L| \otimes \rho_B^{a_1,\ldots,a_L}$, then
$$
\lVert \rho_{A_1A_2..A_LB} - \sigma_{A_1A_2..A_LB} \lVert_1 = \lVert \rho_{A_{\pi(1)}A_{\pi(2)}... B...A_{\pi(L)}} - \sigma_{A_{\pi(1)}A_{\pi(2)}... B...A_{\pi(L)}} \lVert_1,
$$
where the position of the subscript $B$ is arbitrary on the righthand side.
"
"['programming', 'qiskit', 'algorithm', 'circuit-construction', 'probability']"," Title: Quantum Circuit to inverse the probability distributionBody: I'm using Qiskit and after running the circuit, as we all know, we get a count dictionary such as
{'0000': 66,
'0001': 71,
'0010': 68,
'0011': 70,
'0100': 77,
'0101': 64,
'0110': 64,
'0111': 51,
'1000': 52,
'1001': 67,
'1010': 43,
'1011': 64,
'1100': 61,
'1101': 59,
'1110': 73,
'1111': 74}
Here the minimum count is 1010:43. I want the same output just reversed [1024-(count)]. I know this can be achieved by few lines of python, but I was curious if this is possible to do with a quantum circuit?
"
['stabilizer-state']," Title: How to generate all stabilizer states numerically?Body: I would like to obtain a list of all stabilizer states in the given dimension (not necessarily qubit systems). What is an efficient way of generating this list numerically?
"
"['optimization', 'qaoa']"," Title: To find the best angles in QAOA why we do not optimize over a maximum ofall shots instead of a mean?Body: When finding the best angles for QAOA we optimize over $F_{p}(\beta , \gamma) = \langle \psi_p(\gamma,\beta)|C|\psi_p(\gamma,\beta)\rangle $.
In each optimization step we simulate the circuit $m$ times and then calculate the mean $\mu$ of the outcomes which is $F_{p}(\beta , \gamma) = \langle \psi_p(\gamma,\beta)|C|\psi_p(\gamma,\beta)\rangle $.
What would happen if we don't optimize over the mean but on the maximum of the results of the simulation
Wouldn't it be much more efficient as fewer shots are needed for each simulation?
Are there any papers or work about this?
"
"['programming', 'q#']"," Title: Correctly configuring a Q# test project in Visual Studio CodeBody: I have some Q# code which I'm editing using visual studio code. The codebase is divided into a src/ folder and a test/ folder. The problem I'm having is that, although the tests do build and pass, VSCode claims that every use of something from the referenced src/ folder is invalid.
For example, in this screen shot you can see red underlines as if there are errors, but actually the project builds and runs fine:
This is quite annoying, and I can't figure out what about my setup is causing it.
Here is src/example.qs:
namespace Example {
open Microsoft.Quantum.Intrinsic;
@EntryPoint()
operation main() : Unit {
Message("main");
}
operation op() : Int {
return 42;
}
}
Here is test/test.qs:
namespace Example.Tests {
open Example;
open Microsoft.Quantum.Diagnostics;
@Test("ToffoliSimulator")
operation test_op() : Unit {
if (op() != 42) {
fail "wrong result";
}
}
}
Here is src/src_project.csproj:
<Project Sdk="Microsoft.Quantum.Sdk/0.13.20111004">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
Here is test/test_project.cs_proj:
<Project Sdk="Microsoft.Quantum.Sdk/0.13.20111004">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.13.20111004" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<ProjectReference Include="..\src\src_project.csproj" />
</ItemGroup>
</Project>
Here is .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "run tests",
"command": "dotnet",
"type": "process",
"args": [
"test",
"${workspaceFolder}/test/test_project.csproj",
],
"group": {
"kind": "test",
"isDefault": true
}
},
]
}
And finally here is .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"program": "dotnet",
"type": "coreclr",
"args": [
"run",
"--project",
"${workspaceFolder}/src/src_project.csproj",
"-s",
"ToffoliSimulator",
],
"request":"launch",
"logging": {
"moduleLoad": false
},
},
]
}
"
"['programming', 'q#']"," Title: Creating a resource count unit test in Q#Body: I want to create a unit test in Q# that runs an operation and asserts that it used at most 10 Toffoli operations. How do I do this?
For example, what changes do I have to make to the code below?
namespace Tests {
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Intrinsic;
operation op() : Unit {
using (qs = Qubit[3]) {
for (k in 0..10) {
CCNOT(qs[0], qs[1], qs[2]);
}
}
}
@Test("ResourcesEstimator")
operation test_op_toffoli_count_at_most_10() : Unit {
...?
op();
...?
if (tof_count > 10) {
fail "Too many Toffolis";
}
}
}
```
"
"['error-correction', 'architecture', 'ibm', 'clifford-group']"," Title: Is there a good reason to use T-count minimization for circuits executed on current IBM open quantum systems (real hardware)?Body: As far as I understood from a series of papers, minimizing the T-count in Clifford+T circuits is essential for fault-tolerant quantum computing:
While techniques such as magic state distillation and injection allow for fault-tolerant implementation of T gates, they typically require an order of magnitude more resources than Clifford gates
For example see here and here.
But do I understand correctly that while minimizing T-count (incl. in Clifford+T circuits) does not give a significant gain for the current IBM open quantum systems (real hardware, not simulations!), in particular, due to the fact that at the moment T gate (like T†, U1/P and RZ gates)
can be implemented virtually in hardware via framechanges (i.e. at zero error and duration)
See the documentation
"
"['physical-realization', 'ibm', 'google-sycamore', 'qutrit']"," Title: Is there a quantum processor with physically implemented Toffoli gate?Body: Recently, I came across the article Realization of efficient quantum gates with a superconducting qubit-qutrit circuit where its authors proposed a physical implementation of three qubits quantum gates with two physical qubits and one physical qutrit controlled by microwave pulses.
As a result, they were able to implement physically CCZ gate which when accompanied by two Hadamards implements Toffoli gate.
They also proposed configuration implementing Fredking gate, another three qubits gate which together with Hadamard gate form universal set.
Finally, they showed that their design can be used for implementation of $CC-U$ gate, where
$$
U=
\begin{pmatrix}
\cos(\theta) & \mathrm{e}^{i\varphi}\sin(\theta)\\
\mathrm{e}^{-i\varphi}\sin(\theta) & -\cos(\theta)\\
\end{pmatrix},
$$
which is more or less similar to $U3$ gate on IBM Q (to be precise $U(\theta, \varphi) = U3(2\theta,-\varphi,\pi+\varphi)$).
As it seems that this proposal is able to cut lenght of circuit, particularly in case of Toffoli gates (implemented by physical CC-Z gate and two Hadamards only) and therefore enables us to implement more complex cirucits, I am curious if such design is being implemented or at least considered by companies like IBM or Google for their next generation of quantum processors. I highly appreciate any links.
"
"['programming', 'qiskit', 'quantum-operation']"," Title: Getting Choi-matrix of a subsystemBody: In Qiskit, for a given QuantumCircuit object, you can compute its Choi-matrix via the corresponding Choi object, for example:
myCircuit = QuantumCircuit(q1,q2)
myChoi = Choi(myCircuit)
My problem is, that code gives the Choi-matrix describing the whole system, but I'm interested to one subsystem, say the one associate to q1.
What can I do?
I would like to do something like
myChoi = Choi(myCircuit, q1)
"
"['quantum-gate', 'programming', 'qiskit', 'vqe', 'unitarity']"," Title: Creating a parameterized Operator in QiskitBody: I'm trying to run a VQE for a specific custom Anzats. The Anzats is built up of an unitary matrix $U_H$, which I'm trying to created in this way:
from qiskit import *
from qiskit.circuit import Parameter
from qiskit.quantum_info import Operator
import math as m
u_circuit = QuantumCircuit(2)
# This does not work
theta = Parameter('θ')
U_H = Operator([
[m.cos(2 * theta) - 1j * m.sin(2 * theta), 0, 0, 0],
[0, m.cos(2 * theta), -1j * m.sin(2 * theta), 0],
[0, -1j * m.sin(2 * theta), m.cos(2 * theta), 0],
[0, 0, 0, m.cos(2 * theta) - 1j * m.sin(2 * theta)]
])
u_circuit.unitary(U_H, [0, 1], label='U_H(θ)')
U_H_gate = u_circuit.to_gate(label='U_H(θ)')
However, for the VQE to work, the circuit needs to be parameterized, and because of that, so does the unitary gate U_H. Unfortunately, I'm not able to parameterize my variable θ in my operator that I later transform into a 2-qubit gate. Also I can't find a way to bind theta so that it only exists between $0$ and $2\pi$. Whenever I try to build a circuit using this function to generate the gates in the Ansatz, I get the following error:
ParameterExpression with unbound parameters ({Parameter(θ)}) cannot be cast to a float.
Does anyone know how I can create a parameterized circuit consisting of parameterized gates of the form described by the matrix the U_H operator, where theta ranges from $0$ to $2\pi$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: IBMQ: ""Credentials are already in use""Body: Executing the following:
import numpy as np
from qiskit import IBMQ, QuantumCircuit, Aer, execute
from qiskit.quantum_info import Operator
from qiskit.providers.ibmq import least_busy
from qiskit.visualization import plot_histogram
from qiskit.tools.jupyter import *
provider = IBMQ.load_account()
I get the following error which I do not know what to do about, does anybosy know what I can do?
ibmqfactory.load_account:WARNING:2020-11-27
13:08:45,170: Credentials are already in use. The
existing account in the session will be replaced.
"
['programming']," Title: Why do I get the error name operator is not defined?Body: I checked this code multiple times, I am trying to reproduce the same code using Grover's algorithm from qiskit summerschool:
import numpy as np
from qiskit import IBMQ, QuantumCircuit, Aer, execute
from qiskit.quantum_info import Operator
from qiskit.providers.ibmq import least_busy
from qiskit.visualization import plot_histogram
from qiskit.tools.jupyter import *
provider = IBMQ.load_account()
def phase_oracle(n, indices_to_mark, name='Oracle'):
qc = QuantumCircuit(n, name=name)
oracle_matrix = np.identity(2**n)
for index_to_mark in indices_to_mark:
oracle_matrix[index_to_mark, index_to_mark]= -1
qc.unitary(operator(oracle_matrix), range(n))
return qc
def diffuser(n):
qc=QuantumCircuit(n,name='Diff - "V"')
qc.h(range(n))
qc.append(phase_oracle(n,[0]),range(n))
qc.h(range(n))
return qc
def Grover(n, marked):
qc=QuantumCircuit(n,n)
r = int(np.round(np.pi/
(4*np.arcsin(np.sqrt(len(marked)/2**n)))-1/2))
print(f'{n} qubits, basis state {marked} marked, {r}
rounds')
qc.h(range(n))
for _ in range(r):
qc.append(phase_oracle(n,marked),range(n))
qc.append(diffuser(n),range(n))
qc.measure(range(n),range(n))
return qc
n = 5
x = np.random.randint(2**n)
marked = [x]
qc = Grover(n, marked)
qc.draw()
I get the name operator error which I cannot figure out the reason:
NameError Traceback
(most recent call last)
<ipython-input-22-96635782dc30> in <module>
2 x = np.random.randint(2**n)
3 marked = [x]
----> 4 qc = Grover(n, marked)
5
6 qc.draw()
<ipython-input-20-f14e47e0af5d> in Grover(n, marked)
20 qc.h(range(n))
21 for _ in range(r):
---> 22
qc.append(phase_oracle(n,marked),range(n))
23 qc.append(diffuser(n),range(n))
24 qc.measure(range(n),range(n))
<ipython-input-20-f14e47e0af5d> in phase_oracle(n,
indices_to_mark, name)
4 for index_to_mark in indices_to_mark:
5 oracle_matrix[index_to_mark,
index_to_mark]= -1
----> 6 qc.unitary(operator(oracle_matrix),
range(n))
7 return qc
8
NameError: name 'operator' is not defined. Can anybody help me woth this?
"
"['quantum-gate', 'error-correction', 'textbook-and-exercises', 'nielsen-and-chuang', 'fault-tolerance']"," Title: CSS Code and Fault-tolerant Problem in Nielsen and Isaac Chuang‘s bookBody: Could someone help me with $Problem-10.52$ in Nielsen and Isaac Chuang‘s book?
The screenshot is shown below. I have no idea about that.
Hope someone can give me some suggestions.
By the way, if I want to know whether an operator is fault-tolerant, what should I DO to check it? For example, the $Z$ operator (as shown below) is a fault-tolerant operator in the encoding procedure, or not. I only know the fault-tolerant operator only allows 1-bit error to happen.
"
"['quantum-state', 'density-matrix', 'textbook-and-exercises', 'linear-algebra', 'eigenvalue']"," Title: How are the eigenvalues of $\rho=\frac12(|a\rangle\!\langle a| +|b\rangle\!\langle b|)$ derived?Body: Let's say I have a density matrix of the following form:
$$
\rho := \frac{1}{2} (|a \rangle \langle a| + |b \rangle \langle b|),
$$
where $|a\rangle$ and $|b\rangle$ are quantum states. I saw that the eigenvalues of this matrix are:
$$
\frac{1}{2} \pm \frac{|\langle a | b \rangle|}{2}.
$$
I was just wondering how this is derived. It seems logical, i.e if $|\langle a | b \rangle| = 1$ then the eigenvalues are $0$ and $1$, otherwise if $|\langle a | b \rangle| = 0$ then they are half and half. This means that the entropy of the system would either be $0$ or $1$. But I was just wondering how to calculate the eigenvalues from $\rho$.
"
"['algorithm', 'grovers-algorithm']"," Title: How to write the classical algorithm for lights out problem?Body: I am very new to quantum computing and I have started learning the concepts watching the IBM summerschool videos and trying to solve the IBM quantum challenge problems. One of their problems is solving the lights out puzzle using grovers' algorithm. After learning Grover's algorithm I went through the example the did on sudoko here:
https://qiskit.org/textbook/ch-algorithms/grover.html
There are three steps to solve a problem using Grovers' algorith :
- Create a reversible classical circuit that identifies a correct solution
- Use phase kickback and uncomputation to turn this circuit into an oracle
- Use Grover's algorithm to solve this oracle
For lights out problem, I'm struggling with finding the classical solution to it using the known gates(like what they did for Sudoko using XOR gate).
If I start with an input [101000010] for a $3$x$3$ puzzle in which $0$ means off and one means lit, what would be the possible gates I can use to turn off all the lights eventually?
(I know the mathematical algebric solution to the lights out problem, should I probably use that as the reversible classical circuit?)
I appreciate it if anyone can guide me through this
"
"['qaoa', 'probability']"," Title: In QAOA why do we need $m \log(m)$ repetitions to get at least $F_{p}(\beta , \gamma) - 1$ with probability of $1 - 1/m$?Body: In the original QAOA paper from Farhi
https://arxiv.org/pdf/1411.4028.pdf,
it is stated in chapter 2 last paragraph (page 6) that: when measuring $F_{p}(\beta , \gamma)$ we get an outcome of at least $F_{p}(\beta , \gamma) - 1$ with probability of $1 - 1/m$ with order $m \log(m)$ repetitions.
Where is this proven? Or what is the idea behind that?
Thanks:))
"
"['qiskit', 'programming', 'ibm']"," Title: IBMQ backends: How can I know the repetition rate and depth limits of real devices?Body: When trying to execute complex quantum circuits on IBMQ real devices, one can encounter a typical error (ERROR_RUNNING_JOB) with the message 'Circuit runtime is greater than the device repetition rate [8020]'.
I think am fully concerned on what refers to circuit fidelity and transpile optimizations. However, what I'm trying to get is just what are those device repetition rates that my circuit runtime should be smaller than (my goal is to study current device limits for executions of a quantum algorithm depending on the parameters given, which affects significantly on the circuit runtime).
What's more, how can I calculate the circuit runtime depending on its depth (and I suppose types and number of gates being required)?
For example, someone asked 7 months ago how to fix the 8020 error, which is "simply" fixed by reducing the circuit size, but at which point does someone have to reduce it depending on the real device (like ibmq_16_melbourne or ibmq_manhattan)?
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'fidelity']"," Title: In Uhlmann's theorem, should the polar decomposition be written as $A=|A|V$ or $A=V|A|$?Body: In the proof of Uhlmann's theorem, the book writes the polar decomposition: $A = |A|V$, with $|A| = \sqrt{A^\dagger A}$.
Shouldn't it be $V|A|$ instead?
The former case is $A^\dagger A = V^\dagger|A||A|V$ while the latter case is $A^\dagger A = |A|V^\dagger V|A| = |A||A| = A^\dagger A$.
"
"['classical-computing', 'superdense-coding']"," Title: Does 1 qubit correspond to 2 bits?Body: In a lot of presentation I always see people say that $n$ qbit are approximately $2^n$ classical bit.
Those talks where oriented for a broad audience, so they left out a lot of things.
Deep down I felt that this couldn't be possible, but I didn't know anythings about qc so maybe this was the problem.
Now I've started learning qc (as a computer engineer) and I'm studying the concept of super dense coding, that it the base of the association $n$ qbit equal $2^n$ classical bits.(If it's not this let me know)
I've understood what the topic is about, but I still think that the association $n$ qbit equal $2^n$ classical bits is wrong or at least misleading.
Sending 2 bit to Bob, will require Alice to have 1 qbit and 1 entangled qbit where the other part of the eqbit is owned by Bob.
Just by reading this is clear that 2 bit actually correspond to 1 qbit + 1eqbit, but reading online one common approach to say that 1qbit=2bit is by introducing a third part that is responsible to send and eqbit to Alice and Bob.
Isn't this a flawed way to think? When someone say $n$ qbit equal $2^n$ bit, they are implicitly stating that there is a way to encode the information of $2^n$ bits in $n$ qbit, but if you actually study the theory is not like this.
Also saying that 1qbit +1eqbit =2 bit, is not too much different than saying 1qbit+1qbit=2qbit=2bit, because at the end of the day 1eqbit is just a qbit in a particular state. I know that differentiating between them is important since they are two different things, but physically we can see them as two object (two photons for example) that are in a different position, still they 'occupy the space of two object'.
I also know that approximating 1 eqbit with 1 qbit is a strong affirmation, but stating that 1qbit = 2bit is stronger imo.
Is my way of thinking flawed? Why and where?
Also there is another thing that I couldn't understand on my own.
In the textbook that I'm using (Quantum Computation and Quantum Information) one thing that they say is:
Suppose Alice and Bob initially share a pair of qubits in the entangled
state..
Since the sharing of the eqbit and the sending of the qbit seems to happen in two different temporal window, they are able to store qbit?
In essence I don't understand the temporal window of the algorithm. I understand how it works, but not when. Can you clarify this?
Note that this second question is related to the first, because I kind of understand the point of super dense coding, if you can send qbit at two different time and exploit quantum mechanics to send less qbit when needed, but if everything happen at the same time (the sending of the eqbit and the sending of the qbit) then I don't know the point of super dense coding.
"
"['quantum-gate', 'physical-realization', 'photonics', 'optical-quantum-computing']"," Title: How do we realise photonic gates?Body: I am interested in photonic computing, and I am curious how the gates work. I once saw a picture of a photonic CNOT gate that used just mirrors and polarizers. I have not been able to find any blueprints or schematics for working photonic gates.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'linear-algebra']"," Title: Inequality in overlap of quantum statesBody: For quantum states $\vert\psi_1\rangle, \vert\psi_2\rangle, \vert\phi\rangle$, is it true that:
$$\tag{1}\langle \phi\vert\psi_1\rangle\langle\psi_1\vert\phi\rangle\langle \phi\vert\psi_2\rangle\langle\psi_2\vert\phi\rangle + \langle \phi\vert\psi_2\rangle\langle\psi_2\vert\phi\rangle\langle \phi\vert\psi_1\rangle\langle\psi_1\vert\phi\rangle \leq \langle \phi\vert\psi_1\rangle\langle\psi_2\vert\phi\rangle + \langle \phi\vert\psi_2\rangle\langle\psi_1\vert\phi\rangle.$$
My argument is that each number $c_i = \langle\phi\vert\psi_i\rangle$ is a complex number with modulus smaller than 1 since it is the square root of a probability. So we have to show:
$$2|c_1|^2|c_2|^2 \leq c_1c_2^* + c_1^*c_2\tag{2}.$$
"
"['mathematics', 'textbook-and-exercises', 'tensor-product', 'inner-product']"," Title: Discrepancy in inner product between tensor productsBody: I have noticed one identity in case of tensor product from this post. But I can't understand why it is true.
$\langle v_i| \otimes \langle w_j| \cdot |w_k\rangle \otimes |v_m\rangle = \langle v_i|v_m\rangle \cdot \langle w_j|w_k\rangle$
Now if I consider $\langle v_i|$ to be $[a,b]$ and $\langle w_j|$ to be $[c,d]$. (note these are $1 \times 2$) then
$\langle v_i| \otimes \langle w_j| = [a,b] \otimes [c,d]
= [ac,ad,bc,bd]$
Similarly $|w_k\rangle \otimes |v_m\rangle = [e,f]^T \otimes [g,h]^T = [eg, eh, fg, fh]^T $
Scalar product between them = $[ac,ad,bc,bd] . [eg, eh, fg, fh]^T = aceg+ adeh+ bcfg+ bdfh$
Now as per the identity if we do
$\langle v_i|v_m\rangle = [a,b] . [g,h]^T = ag+bh$
and
$\langle w_j|w_k\rangle = [c,d] . [e,f]^T = ce+df$
So $\langle v_i|v_m\rangle \cdot \langle w_j|w_k\rangle = (ag+bh).(ce+df)= aceg + adfg + bceh + bdfh$
Now they are not the same. What is the reason for this behavior?
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang', 'phase-estimation']"," Title: In Nielsen and Chuang, how can $\frac{1}{2(e-1)}$ result from $\frac12\int_{e-1}^{2^{t-1}-1}dl\frac{1}{l^2}$?Body: From Nielsen and Chuang's book: $\textit{Quantum computation and quantum information}$, how can (5.34) equal (5.33)? I.e.
$$\dfrac{1}{2} \int_{e-1}^{2^{t-1}-1} dl \dfrac{1}{l^2} = \dfrac{1}{2(e-1)}.$$
"
"['qiskit', 'programming', 'circuit-construction', 'teleportation']"," Title: Can I teleport a string of 0s and 1s?Body: I have recently started with quantum computing and created a quantum teleportation circuit to transmit a qubit state from q_0 to q_2 using Qiskit.
I understand that I can transmit any state information from q_0 to q_2. Is it then fair to expect that I can also transmit a morse code like string of 0s and 1s (say 1001)?
This is the circuit I built after watching/reading Qiskit tutorials.
"
"['quantum-gate', 'error-correction', 'stabilizer-code', 'surface-code']"," Title: Which codes can implement transversal non-Clifford gatesBody: A paper Three-dimensional surface codes: Transversal gates and fault-tolerant architectures discusses 3D surface codes and shows that
CZ and CCZ gates are transversal in [these] codes.
They give a small example in Appendix A.
I'm a bit confused by some of the parameters. There are three codes listed there; each is $[[12,1,2]]$.
So does that mean that the "overall code" acts on 36 qubits? In that case how are the three codes
"stitched" together to form the bigger code? Alternatively, if I have some $[[n,k,d]]$ code, how do
I check if it can implement a CZ,CCZ,CCCZ,...gate or not?
"
"['quantum-gate', 'programming', 'grovers-algorithm', 'quantum-circuit']"," Title: Question about a circuit from ""Quantum Computing for Computer Scientists""Body: I am trying to implement a basic quantum computing emulator. In the chapter on Grover's algorithm, we're shown the following circuit:
They demonstrate Grover's algorithm with a function $f$ that picks out $101$, i.e. $f(101)=1$ and $0$ otherwise. They start with $\psi_{1}=[1, 0, 0, 0, 0, 0, 0, 0]^{T}$. The Hadamard gate (specifically H tensored with itself $n$ times) gives $\psi_{2}=1/\sqrt8 [1, 1, 1, 1, 1, 1, 1, 1]^{T}$. This is as far as I've come. They don't show explicitly how to get to $\psi_{3}$, which should be $1/\sqrt8 [1, 1, 1, 1, 1, -1, 1, 1]^{T}$. I am not sure how to interpret the circuit.
My best guess was to take the tensor product of $|0 \rangle=|000 \rangle$ and $|1 \rangle = [0, 1]^{T}$, then apply $I_{2^{n}} \otimes H$, then $U_{f}$. However, I have two problems:
The book says that, at that stage in the calculation, $\psi_{3} = 1/\sqrt8 [1, 1, 1, 1, 1, -1, 1, 1]^{T}$, which has length $8$, instead of $16$. I don't know how to "extract" the "top" qubits. Furthermore, my answer is $1/4[1, 1..., 1]^{T}$, which doesn't suggest the correct answer (especially given the fact that every entry is $1/4$).
Am I misinterpreting this circuit? What is the correct way to go from $\psi_{2}$ to $\psi_{3}$, from a programmatic point of view?
"
"['quantum-gate', 'circuit-construction']"," Title: Is there an efficient way to realize a Toffoli with control qubits fixed at $|+\rangle$?Body: I wrote a circuit that makes use of Toffoli gates, but it is too inefficient for my purpose.
In my circuit the states of control qubits are fixed to $|+\rangle$ state. So I wanted to know if there is an efficient way to realize a Toffoli for that fixed case.
"
"['quantum-state', 'tomography', 'shadow-tomography']"," Title: In shadow tomography, how is the state reconstructed from its shadows?Body: I'm reading Huang et al. (2020) (nature physics), where the authors present a version of Aaronson's shadow tomography scheme as follows (see page 11 in the arXiv version):
We want to estimate a state $\rho$. We apply a number of random unitary evolutions, $\rho\mapsto U\rho U^\dagger$, picking $U$ from an ensemble $\mathcal U$. For each choice of unitary $U$, we perform a measurement, observing a state $|b\rangle$. We then apply the inverse evolution to this state, obtaining $U^\dagger|b\rangle$. On average, this procedure leaves us with the state
$$\mathcal M(\rho) =\mathbb E_{U\sim\mathcal U}\Bigg[
\sum_b \underbrace{\langle b|U\rho U^\dagger|b\rangle}_{\text{prob of observing $|b\rangle$}} \!\!\!\!\!\!\!
\overbrace{(U^\dagger |b\rangle\!\langle b|U)}^{\text{post-measurement state}}
\Bigg].$$
The claim is then that $\mathcal M$ can be inverted to obtain, on average, the original state:
$$
\hat\rho=\mathcal M^{-1}(U^\dagger |\hat b\rangle\!\langle \hat b| U)
\,\,\text{ is such that } \,\, \mathbb E[\hat \rho]=\rho.
$$
Is there an easy way to see how one would go in performing such inversion? The authors mention that we are thinking here of $\mathcal M$ as a linear map, so I suppose we represent $\rho$ as a vector in some operatorial basis of Hermitians, which is fine, but to then perform the inversion of this linear map we would need to characterise it, which in this case I think would mean to know the values of $\mathcal M(\sigma_i)$ for some complete basis of Hermitians $\{\sigma_i\}_i$.
"
"['qiskit', 'programming', 'ibm-q-experience', 'ibm']"," Title: How to measure a quantum circuit's execution time on a real IBM device?Body: I am executing a quantum circuit on an IBM quantum device and I need to start a timer as soon as the job in the queue starts running. I have already used:
result = job.result()
execution_time = result.time_taken
but in this particular case what I need is more like a "signal", like a variable that is switched on as soon as the queue is over and causes the timer to start. I tried using the job status but it didn't seem to work.
"
"['programming', 'ibm-q-experience']"," Title: IBMQ: Can I implement a quantum measurement in the middle of a quantum circuit?Body: I am executing a quantum circuit on an IBM quantum device. The circuit is simple:
A single qubit (start from $|0\rangle$),
- Rx($\pi/2$)
- Measure (in z)
3 .Rx($-\pi/2$)
- Measure (in z)
The final measurement probabilities should be
Prob:1/2, result:0; Prob:1/2, result:1.
But the simulation results are always Prob:1, result:0. It is as if the simulator is ignoring the first measurement. So my question is how to implement a quantum measurement in the middle of a quantum circuit on IBMQ?
"
"['quantum-state', 'algorithm', 'error-correction', 'povm']"," Title: What does it mean ""the N uses of classical-quantum channel""?Body: I was reading a paper Quantum Polar codes by Mark M. Wilde, where he discusses the N uses of the channel in the classical-quantum channel setting. What does he mean by "multiple channel uses"?
In the above context I want to use a depolarization channel $\Delta_{\lambda}$ [1](https://en.wikipedia.org/wiki/Quantum_depolarizing_channel) over which $N$ qubits are transmitted. To accomplish this task I have two ideas given below, and I am not sure if either one of them is correct.
Two options:
- Should I evolve each of $N$ qubits by $\Delta_{\lambda}(\rho_i)$ indivisually and then do a tensor $\hat{\rho_i}\bigotimes\hat{\rho_{i+1}}\bigotimes,...,\bigotimes\hat{\rho_N}$,to get final state
- Or should I input a composite state first and the evolve it as
$\Delta_{\lambda}(\rho^{\otimes N}) = \lambda\rho^{\otimes N}+\frac{1- \lambda}{2^N}I_{(2^N X \,2^N)}$
"
"['quantum-gate', 'hadamard', 'quantum-circuit']"," Title: A CNOT between two Hadamard gates: why does the CNOT changed the output of the second Hadamard gate?Body: Applying the Hadamard gate twice in a row, it restores the original input:
https://algassert.com/quirk#circuit={%22cols%22:[[%22H%22],[%22H%22]]}
However, if a CNOT control is added between the two Hadamard gates, the output of the second Hadamard gate changes:
https://algassert.com/quirk#circuit={%22cols%22:[[%22H%22],[%22%E2%80%A2%22,%22X%22],[%22Chance%22],[%22H%22]]}
I can't understand the behavior of the second Hadamard gate: the input has remaining $\frac{|0\rangle+|1\rangle}{\sqrt{2}}$ and the gate does not seem to have any effect.
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How to change the sign of a phase: sending $\alpha|0\rangle+e^{i\alpha}\beta|1\rangle$ to $\alpha|0\rangle+e^{-i\alpha}\beta|1\rangle$?Body: Say I have a qubit in the state (ignoring normalization) $$|\phi\rangle = \alpha|0\rangle + e^{i\alpha}\beta|1\rangle.$$
How can I invert the sign of its phase, thus making it $$\alpha|0\rangle + e^{-i\alpha}\beta|1\rangle$$ using only the basic gates $\{X,Y,Z,H,S\}?$
"
"['programming', 'algorithm', 'bloch-sphere', 'qrac']"," Title: Numerical optimization of QRACBody: I need to optimize a general version of 3$\rightarrow$1 QRAC where Bob is asked to retrieve one of the XOR combinations of the bits( If ABC is the given string to Alice, then Bob would be asked to retrieve one of the following functions, namely, A, B, C, A$\oplus$B, A$\oplus$c, B$\oplus$C, A$\oplus$B$\oplus$C). I know that build in optimization in Mathematica could be used for this kind of stuff, but I'm unsure how to proceed.
Kindly ask if you have any confusion regarding my problem. Thanks
"
"['qiskit', 'programming', 'resource-request']"," Title: Maximum number of qubits supported by the Qasm simulatorBody: By using the Qiskit qasm-simulator, I want to simulate a quantum circuit of 40 qubits. However, the number of qubits 40 is greater than maximum number (24) for qasm-simulator. Is there any possibility to increase this number?
"
"['quantum-state', 'haar-distribution']"," Title: How close or far apart are the distributions generated by two Haar random states?Body: Consider two $n$ qubit Haar-random quantum states $|\psi\rangle$ and $|\phi\rangle$. Let $D_{|\psi\rangle}$ and $D_{|\phi\rangle}$ be the two probability distributions (over $n$-bit strings) obtained by measuring $|\psi\rangle$ and $|\phi\rangle$ respectively, in the standard basis. I had two questions:
- What can we say about the total variation distance between $D_{|\psi\rangle}$ and $D_{|\phi\rangle}$ (with some probability over the choice of a particular $|\psi\rangle$ and $|\phi\rangle$)?
- Are $D_{|\psi\rangle}$ and $D_{|\phi\rangle}$ computationally/statistically indistinguishable (again with some probability over the choice of a particular $|\psi\rangle$ and $|\phi\rangle$)?
EDIT: I managed to prove that they are not statistically indistinguishable, with overwhelming probability. However, are they computationally indistinguishable?
"
"['quantum-state', 'information-theory', 'fidelity', 'partial-trace']"," Title: Fidelity of extensions of statesBody: Given two states $\rho_A, \sigma_A$, Uhlmann's theorem states that the fidelity between them is achieved in the following way
$$F(\rho_A, \sigma_A) = \max_{U_{R'}}F(\rho_{AR'}, (I\otimes U_{R'})\sigma_{AR'})$$
where $U_{R'}$ are unitary operators and $\rho_{AR'}, \sigma_{AR'}$ are arbitrary purifications.
Instead of purifications, let us consider extensions of the state. That is, let $\rho_{AR}$ (possibly a mixed state) satisfy $\text{Tr}_R(\rho_{AR}) = \rho_A$ and $\sigma_{AR}$ (possibly a mixed state) satisfy $\text{Tr}_R(\sigma_{AR}) = \sigma_A$. I am aware of the following fact (5.33 of these notes): For any fixed extension $\rho_{AR}$ we have
$$F(\rho_A, \sigma_A) = \max_{\sigma_{AR}}\{F(\rho_{AR}, \sigma_{AR}) : \text{Tr}_R(\sigma_{AR}) = \sigma_A\} \tag{1}$$
Let $\sigma^*_{AR}$ be the state that achieves the maximum above.
Questions
- How is $\sigma^*_{AR}$ related to an arbitrary extension $\sigma_{AR}$? If they were purifications, one had the simple fact that they were related by a unitary on $R$.
- If $|R|$ was large enough that there exist pure extension states $\sigma_{AR}$, then is $\sigma^*_{AR}$, the extension that achieves the maximum in $(1)$, also pure?
"
"['quantum-gate', 'quantum-state', 'grovers-algorithm']"," Title: How to understand intuitively the Grover diffusion operator?Body: According to the tutorial https://qiskit.org/textbook/ch-algorithms/grover.html I understand the mathematical principle of diffusion operator:
$$
\begin{equation}
\begin{split}
U_s&=2\left|s\right\rangle\left\langle s\right|-I \\
&=H^{\otimes n}U_0H^{\otimes n} \\
&=H^{\otimes n}\left(2\left|0\right\rangle\left\langle 0\right|-I\right)H^{\otimes n} \\
&=H^{\otimes n}\begin{bmatrix}1 & & & \\ & -1 & & \\ & & \ddots & \\ & & & -1\end{bmatrix}H^{\otimes n}
\end{split}
\end{equation}
$$
For example, for two qubits
$$\left|s\right\rangle=\frac{1}{2}\left(\left|00\right\rangle+\left|01\right\rangle-\left|10\right\rangle+\left|11\right\rangle\right)=\frac{1}{2}
\begin{pmatrix}1 \\ 1 \\ -1 \\ 1 \end{pmatrix}$$
applying the diffusion operator and we got
$$H^{\otimes 2}U_0H^{\otimes 2}\frac{1}{2}
\begin{pmatrix}1 \\ 1 \\ -1 \\ 1 \end{pmatrix}=\begin{pmatrix}0 \\ 0 \\ 1 \\ 0 \end{pmatrix}$$
where
$$H^{\otimes 2}=\begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\1 & -1 & -1 & 1 \end{bmatrix}$$
So far this transformation is working well, it reflected the states of $s$ as expected. But it is difficult for me to understand the role played by the Hadamard gate here. How to prove or explain the following equation?
$$2\left|s\right\rangle\left\langle s\right|-I=H^{\otimes n}\left(2\left|0\right\rangle\left\langle 0\right|-I\right)H^{\otimes n}$$
or
$$
\left|s\right\rangle\left\langle s\right|=H^{\otimes n}\left|0\right\rangle\left\langle 0\right|H^{\otimes n}
$$
"
"['qiskit', 'programming', 'vqe', 'eigenvalue']"," Title: Using Qiskit VQE for solving an eigenvalue problemBody: I am a new user of Qiskit and I believe there is a simple answer to my question but I have had a very hard time finding a straightforward answer. I am trying to transform a given $3 \times 3$ (Hermitian) Hamiltonian matrix into a qubit operator and then use the built-in VQE solver for evaluating the minimum eigenvalue for said matrix.
I have been successful in doing something similar using the qiskit.chemistry.FermionicOperator built-in class (see example below) but for this example the Hamiltonian is mapped to a Fermionic one-body qubit Hamiltonian which has $2^n$ eigenvalues instead of $n$ eigenvalues (where $n=3$ for this case). I am hoping there is a simple way to directly map a matrix to a qubit operator. My vague understanding is I need to write the matrix as a sum of weighted Pauli operators but I would expect there would exist some predefined function for doing this? (I have looked at the source code for the FermionicOperator class but it did not help me much).
import numpy as np
import scipy
import h5py
from qiskit.aqua.algorithms import VQE, NumPyEigensolver
from qiskit.chemistry import FermionicOperator
from qiskit import Aer
backend = Aer.get_backend("qasm_simulator")
c1=1
c2=2
c3=3
ff=np.zeros((3,3))
ff[1,1]=2
ff[2,2]=1
n=3
Hamil=np.zeros((n,n))
Hamil[1,1]=c2
Hamil[2,2]=-c3/2+c2
Hamil[0,2]=np.sqrt(2)*c1
Hamil[1,2]=np.sqrt(2)*c1
Hamil[2,0]=np.sqrt(2)*c1
Hamil[2,1]=np.sqrt(2)*c1
vals,vecs=np.linalg.eig(Hamil)
print("Standard Eigenvalues: ")
print(vals)
Hamil_op = FermionicOperator(h1=Hamil)
Hamil_ops = Hamil_op.mapping(map_type='parity', threshold=1e-12)
result = NumPyEigensolver(Hamil_ops,k=int(2**n)).run()
print("Quibit Eigenvalues=")
print(result['eigenvalues'])
vqe = VQE(operator=Hamil_ops)
vqe_result = np.real(vqe.run(backend)['eigenvalue'])
print("VQE Eigenvalue")
print(vqe_result)
With result:
Standard Eigenvalues:
[-1.45426242 0.90078898 3.05347344]
Quibit Eigenvalues=
[-1.45426242+0.j -0.55347344+0.j 0. +0.j 0.90078898+0.j
1.59921102+0.j 2.5 +0.j 3.05347344+0.j 3.95426242+0.j]
VQE Eigenvalue
0.18608074335373637
"
"['algorithm', 'hamiltonian-simulation', 'hhl-algorithm', 'linear-algebra']"," Title: Why is HHL the popular choice to solve QLSP and not the Childs et al. (2017) algorithm?Body: The Childs, Kthari, and Rolando (2017) (CKS) algorithm can solve the quantum linear systems problem (QLSP) in $\operatorname{poly}(\log N, \log(1/\epsilon))$ time while the HHL algorithm solves it in $\operatorname{poly}(\log N, 1/\epsilon)$ time. So, if the CKS algorithm is superior, then why is the HHL more popular?
Additionally, are there any examples of the CKS algorithm being used to solve a system of equations on a real or simulated quantum computer?
"
"['quantum-gate', 'programming', 'qiskit', 'measurement', 'ibm']"," Title: Mechanism of measurement in IBM quantum devicesBody: I am trying to find out about the mechanism of measurement in IBM Q devices. To be specific, if I apply two Hadamard gates on the first qubit and identity on the second then is it possible to immediately measure so that the second qubit is not affected by the second Hadamard on the first qubit?
Also, are measurements on qubits simultaneous? Does it differ with devices?
"
"['circuit-construction', 'superposition']"," Title: Is there a way to create a superposition of all the possible states?Body: If there're four qubits in my circuit, how can I arrange my gates so that the final output state is a superposition of all the possible states of 4 qubits? (there're 16 of them in total). I've tried some 2-qubits circuits to generate the superposition states like $|\Psi^+\rangle$ and $|\Phi^-\rangle$, but I'm not exactly sure if there's a way to create the superposition of all the possible states.
"
"['programming', 'algorithm', 'qaoa']"," Title: Classical optimisation of angles in QAOA for TSP gets stuck in local minima?Body: I have been trying to implement a QAOA for solving a traveling salesman problem (TSP) using qulacs and python. However, even for 3 cities, the implementation fails. Within QAOA, we try to minimise
$$
\begin{equation}
F_p(\gamma,\beta) = \langle \gamma,\beta | C | \gamma,\beta\rangle,
\end{equation}
$$
where $C$ is the cost function of the TSP, and $|\gamma,\beta\rangle$ is a quantum state depending on these two angles. I had a closer look at my classical optimisation of the angles $\beta, \gamma$, for which I used the scipy.optimize.minimize function with the Nelder-Mead method. I realised that the resulting optimal angles are highly dependent on the initial angles. Additionally, I had a look at my cost function $C$. It seems like the optimisation got stuck in many local minima.
I have seen several implementations of a QAOA TSP using other software frameworks, and most of them also used scipy.optimize.minimize for the angles optimisation. Is getting stuck in local minima a known issue for QAOA TSP, or do I have to search for another error source? If the first, how can I overcome this issue?
"
"['programming', 'quantum-state', 'measurement', 'cirq', 'random-quantum-circuit']"," Title: Why is the Measurement Result Always 1? (expected to find uniformly random measurement)Body: I created a $|0\rangle$ state then applied $H$ gate to get $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$ and then I meausred my state. But I always found 1.
I expected to find 0 and 1 uniformly random like the case of beam splitter.
Here is my code:
qubit = cirq.NamedQubit("myqubit")
circuit = cirq.Circuit(cirq.H(qubit))
for i in range(10):
result2 = cirq.measure(qubit, key='myqubit')
print(result2)
print(circuit)
# run simulation
result = cirq.Simulator().simulate(circuit)
print("result:")
print(result)
print(result2)
How can I find uniformly random result ?
"
"['quantum-state', 'error-correction', 'quantum-operation', 'povm']"," Title: How to define POVM measurement operators for a composite quantum stateBody: I have an evolved quantum composite state $\hat{\rho}^{\otimes{N}}$ that I retrieved from a quantum channel $\mathcal{E}$, Now I do know how to define a POVM for the evolved states $\hat{\rho}$ that the channel outputs one by one. But how can I define POVM for composite quantum state.
Suppose I embed $X = [1,0,1,1]$ classical information into $\rho_i$ as follows:
$\rho_0 = \begin{pmatrix}
0 & 0 \\
0 & 1
\end{pmatrix}\rightarrow for \; x_0=1, \\ \rho_1 = \begin{pmatrix}
1 & 0 \\
0 & 0
\end{pmatrix} \rightarrow for \; x_1=0, \\\rho_2 = \begin{pmatrix}
0 & 0 \\
0 & 1
\end{pmatrix}\rightarrow for \; x_2=1, \\\rho_3 = \begin{pmatrix}
0 & 0 \\
0 & 1
\end{pmatrix} \rightarrow for \; x_3=1,$
Now each of the $\rho_i^N$ evolves when $\mathcal{E}$ is applied and we get respective $\hat{\rho_i}^N$, I tensor the evolved states and retrieve a composite quantum state as $\hat{\rho_i}^{\otimes{N}}$ with $dXd$ square matrix where $d=2^N$.
Now, how can I define POVM measurements to get the classical information back?
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Coping values based on indicator qubit in QiskitBody: Give the following input:
$$
A: 1110 \\
B: 0111 \\
\text{indicator}: 0 \text{ or } 1
$$
How do I copy the value of A or B to target qubits if indicator is 0 or 1 respectively?
In the image below, the indicator=0 so the value of the copy_of_a_or_b qubits should resemble a_input qubits:
How can I do this in Qiskit?
"
"['programming', 'qiskit', 'circuit-construction', 'ibm-q-experience', 'quantum-circuit']"," Title: Device Repetition Rate on MelbourneBody: I've been receiving "Circuit runtime is greater than the device repetition rate [8020]" errors when running a relatively simple circuit on ibmq_16_Melbourne, but have had no issues whatsoever when running the same on the Aer backend simulator. The circuit size is 11 and depth is 6. Would anyone have any idea why this might be happening? Thank you!
Clarification: I am attempting to implement Shor's algorithm using the circuit image below. I have heard mentioned that the three large controlled multiplication gates are not necessary, but I am admittedly not clear on this as my results are much different without them. Any advice is greatly appreciated.
"
"['programming', 'qaoa', 'adiabatic-model']"," Title: Why does the problem Hamiltonian of QAOA always consist of $Z$ and $I$ gates?Body: I noticed that in QAOA the problem hamiltonian always consists of $Z$ and $I$ gates. But isn't QAOA a form of Adiabatic Programming? Where the idea is just to go from one ground state to another?
Does that not mean that every Hamiltonian can be the problem Hamiltonian?
And the Mixer consists always just of $X$ gates. Why not $Y$ gates for example?
"
"['programming', 'qiskit', 'ibm-q-experience', 'qasm']"," Title: How to run a OpenQASM 3.0 file?Body: When uploading a QASM-file with ÒPENQASM 3.0; as first line, the code editor on quantum-computing.ibm.com will throw an error.
However the qiskit Python library doesn't support the new features (e.g. for-loops) of OPENQASM 3 either.
So where can I run an OPENQASM 3.0 file?
"
"['resource-request', 'classical-quantum', 'probability']"," Title: Given averages of powers of position and momentum in quantum mechanics what information can be secured about the wave-function?Body: Question
If I tell you all the averages of powers of position and momentum in quantum mechanics can you tell me the value of the wave-function? What can you tell me about the wavefunction? Is there anything about this in the literature?
Attempted Proof
I'm uncertain about the proof (I think the answer is no) and it's validty but here's my attempt. Starting with the modulus of the the wave-function in position space:
$$ |\psi(x,t)|^2 = \psi(x,t)^* \psi(x,t)$$
Let us expand around $z$:
$$ |\psi(x,t)|^2 = \Big( \psi(z,t)^* + (x -z)\psi'(z,t)^* + \frac{(x -z)^{2}}{2!}\psi''(z,t )^* +\dots \Big )$$
$$\cdot \Big (\psi(z,t) + (x -z)\psi'(z,t) + \frac{(x -z)^{2}}{2!}\psi''(z,t)+\dots \big)$$
Multiplying the R.H.S brackets together. We will refer to the below equation as equation $\lambda$:
$$ |\psi(x,t)|^2 = | \psi(z,t)|^2 + (x -z)\psi'(z,t)^* \psi(z,t) + (x -z)\psi'(z,t) \psi(z,t)^* +\dots $$
Let us substitute $x \to z + c/(2N) \int_{-N}^N dz$ in equation $\lambda$:
$$ |\psi(z + \frac{c}{2N} \int_{-N}^N dz,t)|^2 \cdot 1 = | \psi(z,t)|^2 + (\frac{c}{2N} \int_{-N}^N dz)\psi'(z,t)^* \psi(z,t) + (\frac{c}{2N} \int_{-N}^N dz)\psi'(z,t) \psi(z,t)^* +\dots $$
Multiplying $2N$ both sides , rearranging terms and taking the limit $N \to \infty$:
$$ \lim_{N \to \infty} 2N (|\psi(z + \frac{c}{2N} \int_{-N}^N dz,t)|^2 - | \psi(z,t)|^2) = \lim_{N \to \infty} ( c \int_{-N}^N dz)\psi'(z,t)^* \psi(z,t) + ( c \int_{-N}^N dz)\psi'(z,t) \psi(z,t)^* +\dots $$
The R.H.S can be now expressed as a function of momentum averages as it has terms such as $\int_{-\infty}^\infty \psi'(z)\psi(z) dz$. Hence,
$$ \lim_{N \to \infty} 2N (|\psi(z + \frac{c}{2N} \int_{-N}^N dz,t)|^2 - | \psi(z,t)|^2) = f(c,z,\langle p \rangle, \langle p^2 \rangle, \langle p^3 \rangle, \dots) $$
Similarly if we define $\tilde \psi(p,t)$ in momentum space:
$$ \lim_{N \to \infty} 2N (|\tilde \psi(\tilde z + \frac{c}{2N} \int_{-N}^N d \tilde z,t)|^2 - | \tilde \psi(\tilde z,t)|^2) = g(c, \tilde z,\langle x \rangle, \langle x^2 \rangle, \langle x^3 \rangle, \dots) $$
We can compare powers of $c$ and learn something about the wavefunction.
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises']"," Title: How to measure expectation values of $Z$ and $X$ on the given states?Body:
- Given $|\psi \rangle = \dfrac{1}{\sqrt{3}}|00\rangle + \dfrac{1}{\sqrt{6}}|01\rangle + \dfrac{1}{\sqrt{2}}|11\rangle $ get the expected value of the situation at gate $Z$ for the quantum gate.
- Given $|\psi \rangle = \dfrac{1}{\sqrt{3}}|00\rangle + \dfrac{1}{\sqrt{6}}|01\rangle + \dfrac{1}{\sqrt{2}}|11\rangle $ get the expected value of the situation at gate $X$ for the quantum gate.
I couldn't find the right answer. Would you help me please?
"
"['programming', 'qiskit', 'quantum-state', 'matrix-representation']"," Title: How to get subspace of quantum circuit?Body: How can I get a subspace of a quantum circuit? More precisely, I'm dealing with quantum circuit with data qubits ('q') and ancilla qubits ('anc'), such as $(q_0,q_1,...,q_n,anc_0,..anc_m)$.
After some quantum operations, I'd like to get a unitary matrix representation of the data qubits. Is this possible?
"
"['quantum-gate', 'quantum-state', 'ibm-q-experience', 'entanglement']"," Title: How can I get $|00\rangle |01\rangle |10\rangle |11\rangle$ entangled on IBMQ experience?Body: How can I get this situation entangled on IBMQ experience?
$$|00\rangle:\\
|01\rangle:\\
|10\rangle:\\
|11\rangle:
$$
"
['hamiltonian-simulation']," Title: Sign problem and stoquastic HamiltoniansBody: What is the sign problem in quantum simulations and how do stoquastic Hamiltonians solve it? I tried searching for a good reference that explains this but explanations regarding what the sign problem is are very hand-wavy.
A related question, for stoquastic Hamiltonians are only off-diagonal terms zero or non-positive or are diagonal terms also zero and non-positive? Slide 2 here suggests all matrix terms are non-positive, but that means the diagonals have to all be zero, as a Hamiltonian is positive semi-definite and positive semi-definite matrices have non-negative diagonal entries.
"
"['resource-request', 'phase-kickback']"," Title: Resources and references about phase kickback trickBody: I am writing a piece of work on Grover's algorithm and I am looking for references on the phase-kickback trick to transform a state oracle in a phase oracle.
Is there any paper or there a part on it in Nielsen and Chuang ?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to transpile a circuit using Qiskit as done in IBMQ experienceBody: When I create a circuit using Qiskit and then transpile it using transpiled_circuit = transpile(circuit, ibm_backend, optimization_level=1) then I open my IBMQ account and go to circuit composer to draw the circuit and run it on the same backend, the transpiled circuit I got from the circuit composer is different from that from my qiskit code.
For example, I have the following circuit :
when I transpile it in my qiskit code
transpiled_circuit = transpile(circuit, provider.get_backend('ibmq_athens'), optimization_level=1) I got the following circuit :
Using the IBMQ experience circuit composer I got the following transpiled circuit when I run using ibmq_athens
I tried different optimization levels in qiskit and the transpiled circuit is also different.
My question is how I can get a transpiled circuit in qiskit to be the same as the one returned from IBMQ experience circuit composer.
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis', 'matrix-representation']"," Title: Decomposing gates resembling exponentiated members of desired gatesetBody: Suppose I have access to a pretty typical gate set, for example $\{\text{CNOT}, \text{SWAP}, \text{R}_{x}, \text{R}_{y}, \text{R}_{z}, \text{CR}_x, \text{CR}_y, \text{CR}_z\}$ where $\text{CR}$ is a controlled single-qubit rotation. I'm curious about decompositions of gates in the following forms:
$$
U_1 = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & a & b & 0 \\
0 & c & d & 0 \\
0 & 0 & 0 & 1
\end{pmatrix} \qquad
U_2 = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0& e & f \\
0 & 0 & g & h
\end{pmatrix}
$$
where all constants are real. It seems like these decompositions should be straightforward since $U_1$ has a similar form to $\exp{(i\theta \text{SWAP})}$ and $U_2$ has a similar form to $\exp{(i\theta \text{CNOT}})$. However I'm having difficulty getting rid of the imaginary coefficients that are a necessary result of the exponential generator.
Is there a straightforward way to find decompositions when the block form of a desired unitary with real coefficients is the same as an exponentiated member of the desired gateset?
"
"['algorithm', 'shors-algorithm']"," Title: Is there an example of Shor's algorithm for the discrete log problem with concrete numbers anywhere?Body: I understand the problem well enough and I'm trying to understand the algorithm, Shor's version. It's not easy to read the abstract descriptions available everywhere --- Shor's paper, Nielsen's book and many others. I will build a numerical example --- various numerical examples --- if none are available out there, but if you know any that will be a nice start.
If you don't know any, feel free to give me directions on how to build it. For instance, I have already understood that a key step to the algorithm is setting up two registers |a>|b> and then applying a circuit that takes |$a$>|$b$> to |$y\oplus g^a x^{-b}$>, where $g$ is a generator and $x$ is the number whose logarithm we want to find. (The computation is be reduced mod $p$.) (Of course, $y$ is to be initialized to zero.)
The next step is to compute the QFT, something I've never done and looks a bit difficult, so I will consider the previous step a mile stone for now. I think that at the previous step I will have a superposition of all possible values of the pair $(a,b)$ and so the QFT would only serve to amplify the states that are interesting.
As you can see, more than examples, I'm looking for careful steps and explanations. I'll appreciate any help on this.
"
"['qiskit', 'ibm-q-experience']"," Title: Two questions on circuit composer on IBM Q ExperienceBody: I have two (unrelated) questions when I run circuits on IBM Q Expierence.
The first one is encountered, when I run the built-in function VQE (for H2 molecule). It seems two circuits were run, and the resultant histograms seem to be different. See the first screenshot attached. I try to look up on the doc, but have no clue. May I know why is that?
The second one is encountered, when I try to create a circuit where the 0th qubit is controlled by the 5th one. This is run on ibm_16_melbourne. The compiled circuit is pretty strange, see the second screenshot attached, where the number of qubits does not seem to match (q0-q3, q8-q14 are not involved), and I am not sure if the desired property (described above) is respected. Any help would be greatly appreciated!
In both cases, the results seem to be correct/acceptable, so I think it is just a question of visualization on the IBM Q Expierence.
"
"['grovers-algorithm', 'simulation', 'oracles', 'clifford-group', 'gottesman-knill']"," Title: Is it possible to construct Grover search from Clifford gates only?Body: In the article Is Quantum Search Pratical the authors emphasized that a complexity of an oracle is often neglected when advantages of Grover search are discussed. In the end, a total complexity of the search can be given mostly by the oracle complexity.
Let's assume that we are able to prepare an oracle composed from Clifford gates only (i.e. CNOT, Hadamard gate $H$, phase gate $S$ and Pauli gates $X$, $Y$ and $Z$). Naturaly, such oracle would be very simple, for example XOR function implemented by CNOT gate.
Now, turn to Grover diffusion operator. The operator is composed of Hadamard gates and $X$ gates. These are Clifford ones. But the issue is controled $Z$ gate. For two qubits Grover operator CZ gate can be implemented with two Hadamards and CNOT. Therefore, in this simple case, Grover operator is composed of Clifford gates only.
To sum up, my ideas so far, for simple "Cliffordian" oracle and two qubits case, only Clifford gates are employed in the Grover search. According to Gottesman-Knill theorem, such circuit can be simulated efficiently on a classical computer.
However, what about $n$ qubit Grover diffusion operator? It seems to me that to implement controlled $Z$ gates with $n-1$ controlling qubits we would need to employ non-Clifford gates (e.g. Toffoli), hence it would not be possible to simulate Grover search efficiently on a classical computer.
So, my question is if this statement is right: Two qubits Grover search with an Oracle implemented with Clifford gates only can be efficiently simulated on a classical computer. For three qubits or non-Cliffordian oracle, the efficient simulation of Grover search on a classical computer is impossible.
"
"['circuit-construction', 'clifford-group']"," Title: Prepare state $|00\rangle+|1+\rangle$ using Clifford gates and the T-gateBody: I am looking for a quantum circuit which maps state $|00\rangle$ to $|\psi\rangle=\frac{1}{\sqrt{2}} |00\rangle+\frac{1}{\sqrt{2}}|1+\rangle$.
The circuit should only apply quantum gates from the Clifford group (specifically, $CNOT$, $H$, $P$) and the $T$ gate:
$$
CNOT = \begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{bmatrix}, \quad
H = \frac{1}{\sqrt{2}}\begin{bmatrix}
1 & 1 \\
1 & -1
\end{bmatrix}, \quad
P = \begin{bmatrix}
1 & 0 \\
0 & i
\end{bmatrix}, \quad
T = \begin{bmatrix}
1 & 0 \\
0 & e^{i \pi / 4}
\end{bmatrix}
$$
My Thoughts
Because these gates are universal for quantum computation (as stated here), I know that a circuit which approximates $|\psi\rangle$ must exist. I am hoping that I can produce $|\psi\rangle$ exactly, but I was not able to find the corresponding circuit.
I already figured out the the circuit needs to apply $T$ at least one, as $|\psi\rangle$ has no stabilizers from the Pauli group (determined by brute-force), and any state produced by a Clifford circuit would have stabilizers from the Pauli group.
"
"['quantum-state', 'textbook-and-exercises']"," Title: How to calculate the state vector of a mixed state of two superposition state?Body: Let $\left|\psi_1\right\rangle=\alpha_1\left|0\right\rangle+\beta_1\left|1\right\rangle$ , and $\psi_2=\alpha_2\left|0\right\rangle+\beta_2\left|1\right\rangle$.
Assume that $\left|\psi\right\rangle$ is a mixed state of $w_1*\left|\psi_1\right\rangle$ and $w_2*\left|\psi_2\right\rangle$ with $w_1+w_2=1$.
How to calculate the state vector of $\left|\psi\right\rangle$ ?
"
['shors-algorithm']," Title: What are the interesting spikes in this after-QFT graph (page 241) of Programming Quantum Computers?Body: I'm reading Programming Quantum Computers trying to understand Shor's algorithm. I learned there that we prepare a state $|x^i \bmod N\rangle$, then apply the QFT to this state. The QFT changes the amplitudes from a uniform superposition to large amplitudes evenly spaced out by the period of $x^i \bmod N$. For example, here's a graph of the amplitudes after applying the QFT with $N = 35$. That's on page 241.
The book says there are 12 spikes evenly spaced. I see a lot more than 12 spikes evenly spaced. Should I count just the highest ones and stop when I've counted 12? But isn't that subjective? How would I figure out that the number is really 12 from just looking at this graph without knowing the right answer? (In other words, how do I get 12 out of this?)
"
"['quantum-state', 'textbook-and-exercises', 'nielsen-and-chuang', 'bell-basis']"," Title: How do get from $|0\rangle=\alpha|a\rangle+\beta|b\rangle$, $|1\rangle=\gamma|a\rangle+\delta|b\rangle$ to an expression for $|01\rangle-|10\rangle$?Body: My question is linked to the Nielsen Chuang book. Particularly equation 2.216 on basis change from $|0\rangle$, $|1\rangle$ to orthonormal $|a\rangle$ and $|b\rangle$. How do we get the equation from the following?
I understand everything except why we get the negative sign in the coefficient.
"
"['shors-algorithm', 'quantum-fourier-transform']"," Title: Shor's algorithm: what to do after reading the QFT's result twice?Body: I asked about how to identify the period looking at a Fourier transform plot. The answer seems to be to run the fourier transform multiple times getting multiple values associated to high probabilities described by the graph. So still using the same picture, suppose I read it twice and I got the values |5> and |11>. These are the highest spikes (after the first highest in |0>.) How would I figure out the period 12 out of 5 and 11? Can you show an example of the calculation?
An attempted solution. Reading Peter Shor's paper (on page 320), we find that his $q$ is $q=64$ here in our example. Shor is saying we can obtain a fraction $d/r$ in lowest terms (where $r = 12$ here) by rounding $c/q$ to the nearest fraction having a denominator smaller than $n=35$ here. Our possible $c$ here is $5$ and $11$.
Let's try that. After the QFT, we got $c = 5$ and we have $q = 64$. So we get $5/64 = 0.078125$ and we want to round that to the nearest fraction having a denominator smaller than $35$. For $5/64$, I find the continued fraction $[0,12,1,4]$. (I checked that $5/64 = 1/(12 + 1/(1 + 1/4))$, so that's correct.) Now, from this continued fraction (in list form) I get the following sequence of fractions: $1/4, 5/4, 64/5, 5/64$. (I'm not sure what I'm doing.) Perhaps $5$ is bad luck? But, no, trying the same thing with $11$ will also produce $11/64$. So even though I know how to compute the continued fraction algorithm, I don't know what to do with it. I'm gonna have to look at Hardy and Wright, Chapter X.
"
"['qiskit', 'programming', 'grovers-algorithm', 'ibm']"," Title: Connectivity in Grover's algorithm on real quantum computersBody: Everytime I execute Grover's search algorithm on IBM real quantum computers I get a wrong answer (it doesn't find the correct winner state) unless I use only 2 qubits. For any higher number of qubits it fails. I've already maximized the number of shots and tried with every free device. Also, the algorithm works perfectly in every simulation with any number of qubits.
Could this be a connectivity problem? Do I need each qubit to be connected to all the other ones in the circuit for Grover's algorithm to work?
Here is the Python code I am using. It implements a generalized Grover's algorithm for n qubits.
import matplotlib.pyplot as plt
import numpy as np
from math import *
from qiskit import *
from qiskit.tools.visualization import circuit_drawer, plot_histogram
from qiskit.quantum_info.operators import Operator
def computational_basis(number_of_qubits, space_dimension):
basis = []
for i in range(space_dimension):
a = bin(i)[2:]
l = len(a)
b = str(0) * (number_of_qubits - l) + a
basis.append(b)
return basis
def scalar_product(a, b): # Where a and b are two items of the "basis" list
if a == b:
return 1
else:
return 0
def oracle_generator(space_dimension, winner_state):
for i in range(space_dimension):
if basis[i] == winner_state:
mark = basis.index(basis[i])
oracle_matrix = np.identity(space_dimension)
oracle_matrix[mark, mark] = -1
oracle = Operator(oracle_matrix)
return oracle
def diffuser_generator(space_dimension):
diffuser_matrix = np.empty((space_dimension, space_dimension))
for i in range(space_dimension):
for j in range(space_dimension):
diffuser_matrix[i, j] = (2 * scalar_product(basis[i], basis[0]) * scalar_product(basis[0], basis[j])) - scalar_product(basis[i], basis[j])
diffuser = Operator(diffuser_matrix)
return diffuser
def grover_iteration(number_of_qubits, circuit, qr):
all_qubits_list = []
for i in range(n):
all_qubits_list.append(i)
circuit.unitary(oracle, all_qubits_list, label='oracle')
for i in range(number_of_qubits):
circuit.h(qr[i])
circuit.unitary(diffuser, all_qubits_list, label='diffuser')
for i in range(number_of_qubits):
circuit.h(qr[i])
# Number of qubits
n = 3
# Space dimension
N = int(pow(2, n))
# Winner state
winner = '111'
# Make a list of computational basis vectors (strings)
basis = computational_basis(n, N)
# Build a quantum circuit for n-qubit Grover's algorithm
oracle = oracle_generator(N, winner)
diffuser = diffuser_generator(N)
qr = QuantumRegister(n, 'q')
cr = ClassicalRegister(n, 'c')
grover_circuit = QuantumCircuit(qr, cr)
for i in range(n):
grover_circuit.h(qr[i])
if n == 2:
grover_iteration(n, grover_circuit, qr)
else:
for i in range(int(sqrt(N))):
grover_iteration(n, grover_circuit, qr)
grover_circuit.measure(qr, cr)
# Draw Grover circuit
circuit_drawer(grover_circuit, output='mpl')
plt.show()
# Execute circuit
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')
qcomp = provider.get_backend('ibmq_valencia')
job = execute(grover_circuit, backend=qcomp, shots=8192)
result = job.result()
# Results
plot_histogram(result.get_counts(grover_circuit))
plt.show()
"
"['quantum-operation', 'kraus-representation']"," Title: Prove that different Kraus decompositions are related through a unitary, using the Choi isomorphismBody: I consider a process $\mathcal{E}$ that is at least CP and hermitian preserving.
I know that the Choi matrix then has the form:
$$ M = \sum_k |M_k \rangle \rangle \langle \langle M_k | $$
Where $|M_k \rangle \rangle$ are the Kraus operators of $\mathcal{E}$ in the "vectorized" form from Choi isomorphism.
My question:
How from this fact can I show that the only different set of Kraus operator can be related through unitary transformations ?
I know that if I write $|M_k \rangle \rangle=\sum_{i} U_{ik} |A_i \rangle \rangle$ I can see that:
$$ M = \sum_i |A_i \rangle \rangle \langle \langle A_i|$$
But how can I proove that it is the only possibility to find other Kraus operator, based on the Choi matrix ?
"
"['textbook-and-exercises', 'notation']"," Title: What does $|j\rangle$ mean, when $j > 1$?Body: I am trying to understand the state given here:
$$
\frac{1}{\sqrt{n}} \sum_{j=0}^{n-1} |j\rangle |j\rangle
$$
Suppose $n = 4$, I would interpret this state as being $1/2(|00\rangle + |11\rangle + |22\rangle + |33\rangle)$. Is this correct? And if so, what does $|2\rangle$ or $|3\rangle$ mean?
"
"['algorithm', 'shors-algorithm']"," Title: How to build an example of Shor's algorithm for the discrete log?Body: I have been trying to build myself an example of Shor's computations for the discrete log. I started out with this objective and I realized I should understand the factorization first, which I did and did. Having a clue about the factorization, perhaps now I can tackle the discrete log, but it's still not that easy.
Problem. Find $a$ such that $2^a = 7 \bmod 29$. (We know $2$ is a generator of $Z_{29}$.)
Peter Shor tells us to find $q$, a power of $2$ that is close to $29$, that is, $29 < q < 2\times29$. So $q = 32 = 2^5$ suffices. Next he tells us to put two register |$a$> and |$b$> in uniform superposition $\bmod 28$. (Why $\kern-0.4em\bmod 28$? Why not $\kern-0.4em\bmod 29$?) Then in a third register compute |$2^a 7^{-b} \bmod 29$>.
This will produce a periodic sequence in superposition. Applying the QFT to this register, we should be able to extract this period. When I look at the sequence for this concrete case (which is $2^a 7^{-b} \bmod 29$), I find $[1, 25, 16, 23, 24, 20, 7, 1, 25, 16, 23, 24, 20, 7, 1, ...]$ So, I can see the period is $7$.
What is the calculation that I must do now to extract the solution $a = 12$?
"
"['quantum-gate', 'quantum-state', 'probability', 'random-quantum-circuit', 'haar-distribution']"," Title: Computing expectation value of $|\langle z|C|0^n\rangle|^2$ over Haar random circuitBody: I am trying to understand the integration on page 4 of this paper. Consider a Haar random circuit $C$ and a fixed basis $z$. Each output probability of a Haar random circuit (given by $|\langle z | C |0^{n} \rangle |^{2}$, for each fixed z) is distributed according to the Porter Thomas distribution, given by
\begin{equation}
\text{PorterThomas}(x) = 2^{n} e^{-2^{n} x}.
\end{equation}
The paper claims that
\begin{equation}
\mathbb{E}[|\langle z | C |0^{n} \rangle |^{2}] = \int_{0}^{\infty} \frac{x}{2^{n}} x e^{-x} \,dx = \frac{2}{2^{n}}.
\end{equation}
However, I do not understand the integration at all. Shouldn't the integration instead be
\begin{equation}
\mathbb{E}[|\langle z | C |0^{n} \rangle |^{2}] = \int_{0}^{\infty} x ~2^{n} e^{-2^{n} x} \,dx = \frac{1}{2^{n}},
\end{equation}
where I am just using the definition of the expected value and plugging in the pdf for Porter Thomas. However, this gives me a very different answer.
Where are all the extra terms coming from and why is the answer $\frac{2}{2^{n}}$?
"
"['programming', 'cirq', 'quantum-enhanced-machine-learning', 'tfq', 'quantum-neural-network']"," Title: Does TensorFlow Quantum tfq.convert_to_tensor work on custom gates?Body: I'm trying to use Cirq with TensorFlow Quantum to simulate a variational quantum classifier. There's a tutorial on the TFQ website on building a quantum neural network to classify a simplified version of MNIST, which I've been using for reference.
The classifier that I'm building requires building my own custom gates.
After encoding the data as quantum circuits, the next step is to convert these Cirq circuits to tensors using tfq.convert_to_tensor.
I've found that this function works fine for any built-in Cirq gates, but when I pass my own custom gate as the argument, I get ValueError: Cannot serialize op <__main__.Custom_Gate object at...
Here's some watered down code that gives the gist of my attempts:
def simple_func(x):
return x*cirq.z
class Custom_Gate(cirq.Gate):
def __init__(self, x, n):
self.x = x
self.n = n
def _unitary_(self):
return simple_func(self.x)
def _num_qubits_(self):
return self.n
def _circuit_diagram_info_(self, args: 'cirq.CircuitDiagramInfoArgs'):
return ['U']
x = 3
n = 1
U = Custom_Gate(x, n)
q0 = cirq.GridQubit(0, 0)
test_circuit = cirq.Circuit()
test_circuit.append(U.on(q0))
SVGCircuit(test_circuit)
tfq.convert_to_tensor([test_circuit])
Am I making a mistake somewhere? Or does tfq.convert_to_tensor just not work for custom gates?
Thank you.
"
"['quantum-state', 'textbook-and-exercises', 'inner-product']"," Title: Find inner product of two states given inner product of an orthogonal stateBody: I have a pure quantum state $|i\rangle$ and another state $|\psi\rangle = \frac{1}{\sqrt{2}}(|i\rangle + |j\rangle)$. A state orthogonal to $|\psi\rangle$ is $|\phi\rangle$. Among these states, I know the following:
$$
\langle i | \psi \rangle = \frac{1}{\sqrt{2}} \\
\langle \phi | \psi \rangle = 0. \\
$$
Then, what can I say about the inner product of $|i\rangle$ and $|\phi\rangle$? I.e., is there a way to find:
$$
\langle i | \phi \rangle
$$.
Thanks!
"
"['qiskit', 'ibm-q-experience', 'noise', 'ibm', 'quantum-circuit']"," Title: Is Noise model for quantum prototypes accurate in QiskitBody:
- We know that in Qiskit noise models modeling specific quantum machine prototypes exist and can be inserted into the code. However, are these models fixed in nature or they continuously improve themselves using machine learning techniques so that they can provide results ideally depicting a prototype.
- Also which is a better way of getting correct results. Designing a circuit in circuit composer and executing on a selected IBM machine or writing a code for the circuit in Qiskit and executing the circuit on QASM simulator with a noise model for a IBM quantum machine inserted into the code.
"
"['programming', 'simulation', 'qasm']"," Title: Is there a faster way to get 'a list of' result from 'a list of inputs'?Body: I had a question about obtaining the probability of a certain state from the histogram, still using this example, suppose there's a variable in my quantum circuit, it's values are stored in an 'np.linspace' array. This is the result obtained from one of the elements in that array:
If I'm only interested in the probability of the '0010' state (0.831 here), is there a faster way I can get a list (or array) of the probability of '0010' using each element in my original linspace? I tried to incorporate a few commands (like job_sim and result_sim) into a function, but that doesn't work.
ps: The structure of my function looks something like this:
from qiskit import IBMQ
provider = IBMQ.load_account()
sim = provider.backends.ibmq_qasm_simulator
def qc(Variable):
qcz = QuantumCircuit(qrz,crz)
......
job_sim = execute(qcz, sim)
result_sim = job_sim.result()
counts = result_sim.get_counts()
probs = counts['0010'] / sum(counts.values())
return probs
After that I want to call the function using each of the elements in my linspace.
update:Sorry maybe I was a bit unclear in my original question, if my simulation result is determined by some variable X, for each value of X, I might obtain a different probability of the state '0010'. If there're N values of X, all of which are stored in an array and I want to run my circuit N times, is there a faster way I can do that instead of manually changing the variable and record the result? Thanks for the help:)
"
"['programming', 'matrix-representation', 'd-wave', 'annealing']"," Title: D-WAVE QUBO Matrix FormBody: I am trying to write down this problem (friend/enemy graph) in a polynomial matrix form in order to understand quantum annealing better, but it seems like the problem should actually be split into multiple matrices.
Does anyone have any idea how to replicate this problem in a polynomial matrix?
"
['quantum-gate']," Title: Existence of unitary matrix that produces quantum coin with given frequencies via iterationBody: I'm curious about for which $n$ there exists a $2\times 2$ unitary matrix $U(n)$ such that for $1 \le k \le n$ $$|U^k_{1,0}(n)|^2 = \frac kn,$$
where $U^k_{1,0}(n)$ is the lower left element of the $k$th power of $U(n)$.
The idea is that if such a matrix exists, then applying it $k$ times to the quantum state $|0\rangle$ will produce the quantum state $\sqrt{1-k/n}|0\rangle + \sqrt{k/n}|1\rangle$ modulo some phases, a "quantum coin" with probability $k/n$ of giving outcome 1.
It's easy to see that it exists for $n=2$, with an example being
$$U(2) = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix},$$
but I couldn't find an example for any other $n$. A bit of brute force shows that no such matrices exist for $n=3$, and suggests that indeed no other $n$ works. Perhaps there's an elegant way to prove this? Or maybe there is a construction that I missed?
I originally posted this question on Mathematics Stack Exchange, but nobody was interested about it there.
"
"['quantum-advantage', 'randomised-benchmarking', 'quantum-volume']"," Title: Could a new benchmark of quantum processors Q-Score by Atos be more useful than quantum volume?Body: A few days ago, Atos company published new benchmark for quantum computers. The benchmark is called Q-Score and it is defined as follows:
To provide a frame of reference for comparing performance scores and maintain uniformity, Q-score relies on a standard combinatorial optimization problem, the same for all assessments (the Max-Cut Problem, similar to the well-known TSP – Travelling Salesman Problem, see below). The score is calculated based on the maximum number of variables within such a problem that a quantum technology can optimize (ex: 23 variables = 23 Q-score or Qs)
According to Atos, one of main advantages of the new benchmark is its link to real-life problem (Max-Cut or TSP). Moreover, the new benchmark is not purely technical as quantum volume is.
Atos also said that
While the most powerful High Performance Computers (HPC) worldwide to come in the near term (so called “exascale”) would reach an equivalent Q-score close to 60, today we estimate, according to public data, that the best Quantum Processing Unit (QPU) yields a Q-score around 15 Qs. With recent progress, we expect quantum performance to reach Q-scores above 20 Qs in the coming year. [....] As per the above, Atos estimates quantum superiority in the context of optimization problems to be reached above 60 Qs.
Source of quotes: Atos press release
Based on the quotes above, I have these objections against the Atos benchmark:
- The bechmark measures only one aspect of a quantum processor (QUBO problems performance) while quantum volume takes into cosideration general properties of a quantum processor and hence it describes its average behavior. This seems more useful as QUBO problems are a narrow part of tasks which can be solved on a quantum computer.
- It has not been proven yet that a gate-based quantum computer or a quantum annealer provides advantage in solving QUBO task in comparison with classical computer. It seems that complexity is still exponential and there is a difference in constants only. Therefore, I would choose Shor, Grover or HHL algorithm as benchmark preferably as these algorithms reduces complexity in comparison with classical equivalents. If Atos is interested in easy-to-explain benchmark, lenght of RSA key which a quantum processor is able to factor (break) would be ilustrative as well.
- Proclamation that Q-Score equal to 60 means quantum supremacy is not justified. Solving QUBO problems with thousands of variables is possible on current classical (super)computers.
My question is whether my objections are justified and make sense.
"
"['programming', 'qiskit']"," Title: qiskit: How to get an operator acting on a certain qubit?Body: I have a system of $N$ qubits and want to construct a quantum operator $Z_i Z_j + Z_k$, where $Z_i$ denotes the Pauli-Z operator acting on the $i$th qubit. Is there any direct way in qiskit, how I could implement this?
I know that I can construct an operator by e.g. saying op = Z^Z, if I have a system of 2 qubits and want the operator being the Pauli-Z on each qubit. But I would like to tell qiskit the indices of the qubits that $Z$ should act on (such that on all the other qubits Identity is applied).
My way so far consists of constructing a Quantum Circuit and converting this to an operator by
circZZ = QuantumCircuit(N) # circuit for Z_i Z_j
circZ = QuantumCircuit(N) # circuit for Z_k
circZZ.z(i)
circZZ.z(j)
circZ.z(k)
opZZ = CircuitOp(circZZ) # convert circuit to operator
opZ = CircuitOp(circZ) # convert circuit to operator
op = opZZ + opZ
But that means I have to create quantum circuits everytime I want to get this operator. Is there any shorter and more elegant way to create such an operator?
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix']"," Title: Unitary freedom in the ensemble for density matricesBody: I was reading the book by Nielsen & Chuang. I got the part about why we use the density operators. And then I got to the section of theorem 2.6. It says roughly this thing:-
The sets $|{\tilde\psi_i} \rangle$ and $|{\tilde\phi_j} \rangle$generate the same density matrix if and only if
$|{\tilde\psi_i} \rangle= u_{i,j} |{\tilde\phi_j} \rangle$, (2.166)
where $u_{i,j}$ is a unitary matrix of complex numbers, with indices $i$ and $j$, and we ‘pad’ whichever set of vectors $|{\tilde\psi_i} \rangle$ or $|{\tilde\phi_j} \rangle$ is smaller with additional vectors 0 so that the two sets have the same number of elements.
Ok. I will leave all this tech talk aside and now the main thing is it tries to say is, if I can find two sets of vectors that generate the same density operator, it would be related in some way.
Or if we think a bit more we can say that suppose we find one set of $\phi$ then from that if we apply a group of unitary operators, we can reach another set which will have the same state representation or same state? (Yes state because it will have the same density operator).
Is this why this theorem got a place in this book? I am missing the idea behind this theorem. Alright, this is what I thought but what do you people think?
If you see I am saying something wrong, please correct me.
"
"['textbook-and-exercises', 'notation']"," Title: Is there a name for the terms that make up a state?Body: Suppose I have the state $\frac{1}{2}(|0\rangle + |1\rangle)$, how can I refer to ket 0 and ket 1 in general within a state? Would "term 1" and "term 2" work?
"
"['quantum-state', 'bloch-sphere']"," Title: Does this point-projection of a mixed state onto a pure state appear in the quantum information theory literature?Body: In my research, I stumbled on a smooth map:
$$\pi_{\rho_0}: B \setminus \{\rho_0\} \to \partial B$$
where $B$ is the open Bloch ball, corresponding to the set of mixed states of a single qubit and $\partial B$ is the Bloch sphere proper, consisting of the set of pured states of a single qubit and $\rho_0 \in B$ is a fixed mixed state of a single qubit. The map is defined as follows.
After fixing $\rho_0 \in B$, you define the image of a mixed state $\rho \in B$, $\rho \neq \rho_0$ as the intersection of the ray starting from $\rho_0$ and passing through $\rho$ with $\partial B$ (the Bloch sphere proper). This can be characterized as follows. It is the unique pure state which can be written as a linear combination
$$a \rho_0 + b \rho$$
where $a, b \in \mathbb{R}$ such that $a + b = 1$ and $b > 1$ (and therefore $a < 0$).
Note that $\pi$ can be viewed as a map
$$ B \times B \setminus \Delta \to \partial B $$
mapping $(\rho_0, \rho)$ to $\pi_{\rho_0}(\rho)$, where $\Delta \subset B \times B$ is the diagonal (i.e. $\Delta$ consists of all pairs $(\rho, \rho)$ such that $\rho \in B$).
Then if $G = \mathrm{SU}(2)$, then $G$ acts on $B \times B$ by
$$ g.(\rho_0, \rho) := (g \rho_0 g^{-1}, g \rho g^{-1}). $$
Moreover, $G$ acts on $\partial B$ by
$$ g.\nu = g \nu g^{-1}.$$
Then, if I am not mistaken, $\pi$ is $G$-equivariant.
This map $\pi$ seems natural. I know it appears in the literature when $\rho_0 = \frac{1}{2}I$ is at the "origin" of the Bloch ball. But did the more general $\pi_{\rho_0}$, where $\rho_0$ is any fixed mixed state of the qubit, appear in the quantum information theory literature please?
I would like to investigate whether there may be a link between a problem in geometry that I am interested in and quantum information theory.
"
"['error-correction', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Standard form Shor's codeBody: I'm trying to solve exercise 10.57 in Nielsen-Chuang, where you have to obtain the standard form check matrix of Shor's code. I followed the procedure laid out in the earlier chapter but then realised that applying the Gauss-Jordan method seems to leave a negative value on my $Z$-side.
How to interpret this, or have I just made a mistake? Here's my result:
$$\begin{bmatrix} \left.\begin{matrix}
1& 0& 1& 1& 1& 0& 0& 0& 1\\
0& 1& 0& 1& 1& 1& 0& 1& 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\\
0& 0& 0& 0& 0& 0& 0& 0& 0
\end{matrix}\right|
\begin{matrix}
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& 0\\
0& 0& 0& 1& 0& 0& 0& 0& -1\\
0& 0& 0& 0& 1& 0& 0& 0& 1\\
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& 1& 0
\end{matrix} \end{bmatrix}$$
"
"['algorithm', 'grovers-algorithm', 'unitarity', 'amplitude-amplification']"," Title: A question about Grover's paper ""Fixed-Point Quantum Search""Body: I am reading Grover's paper "Fixed-Point Quantum Search," (arXiv version with a different name) which improves on his earlier quantum research algorithm. However, I'm having difficulty in understanding some argument. How can we derive the first display on pp.4 from the last equation on pp.3 of the arXiv version. Many thanks!
"
"['programming', 'qiskit', 'matrix-representation']"," Title: Get a sparse matrix of quantum circuitBody: Is there a way that can obtain sparse matrix of quantum circuit? I used to check my quantum circuit with quantum_info.Operator, but for large number of qubits, it is difficult because of the memory allocation limit. Is it available in qiskit? or should I build elementary gates in sparse matrix format? Thank you!
"
"['programming', 'qiskit', 'physical-qubit']"," Title: Qubit Connectivity of IBM Quantum ComputerBody: When simulating a quantum circuit using the qiskit qasm_simulator, the qubits that you assign to the quantum circuit may be connected to all other qubits. In other words, if there are $n$ qubits in the quantum circuit, a single qubit can interact with all other $n-1$ qubits.
This is quite an unpractical hypothesis for real quantum computation. k-locality is a common criterion for a quantum computer and the only quantum computer I know of that has full qubit-connectivity is this one(I omitted the trivial cases of single- or two-qubit quantum computer). In the case of quantum devices that IBM provides via cloud access, e.g., 5-qubit ibmq_santiago, 5-qubit ibmq_5_yorktown, and 15-qubit ibmq_16_melbourne, all provide limited qubit connectivity.
So here arises my question: when designing a quantum circuit we have to take qubit connectivity into consideration, but how does qiskit handle this? Does it assign the job automatically (such that the quantum circuit can still work), or should I pre-assign my logical qubits to the real qubits of the IBM quantum computer by hand? And if so, how do I do that?
"
"['programming', 'qiskit', 'circuit-construction']"," Title: Conjugate transpose of a U-gateBody: I want to be able to create the circuit depicted below, but running the code below results in an empty circuit when viewing the job afterwards.
backend = provider.backends.ibmq_armonk
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
circuit.u(pi/2, pi/2, pi/2, qreg_q[0])
circuit.x(qreg_q[0])
circuit.y(qreg_q[0])
circuit.x(qreg_q[0])
circuit.y(qreg_q[0])
circuit.u(pi/2, pi/2, pi/2, qreg_q[0]).inverse()
circuit.measure(qreg_q[0], creg_c[0])
qobj = assemble(transpile(circuit, backend=backend), backend=backend)
job = backend.run(qobj)
retrieved_job = backend.retrieve_job(job.job_id())
"
"['algorithm', 'circuit-construction', 'grovers-algorithm']"," Title: Quantum Search/Count on an unknown superposition stateBody: Question:
- Search a 'known' element in an 'unknown' quantum database
- Alternatively, show this is fundamentally impossible (somehow related to the Holevo bound or P < NP?)
Related yet different:
- Grover Search (and related improvements): single element marked in a 'full' superposition.
- Quantum Associative Memory (and related improvements): single element marked in a database, but the memory oracle marks all 'stored patterns' thus requires knowledge of the database (quantum phone directory).
- Quantum Counting (and related improvements): assumes either full superposition or knowledge of database.
Formulation:
- Database structure of $t$ (qu)bits of tag and $d$ (qu)bits of data
- An initial state with a equal superposition of tag qubits and zero in the data qubits: $|\psi_0\rangle = \sum_{x \in 2^t} (\dfrac{1}{\sqrt{2^t}} |tag_x\rangle \otimes |0\rangle^d)$
- Unitary $U$ that evolves $|\psi_0\rangle$ to $|\psi\rangle = \sum_{x \in 2^t} (\dfrac{1}{\sqrt{2^t}} |tag_x\rangle\otimes |data_x\rangle)$
- Thus, every binary encoded tag is unique and has an associated data, however, the data may not be unique
Problem:
- Given $t$, $d$ and the knowledge of which qubits encode the tag and the data
- Given access to $|\psi\rangle$ in $t+d$ qubits without explicit knowledge of the superposition state
- Search/sample associated tag/s of corresponding $|data_i\rangle$ with high probability
- Count the number of tags storing a specific $|data_i\rangle$
Example:
- $t = 2$ qubit tag and $d = 3$ qubit data
- $|\psi\rangle = \dfrac{1}{2} (|00.010\rangle + |01.110\rangle + |10.100\rangle + |11.110\rangle)$. The dot is notational denoting the $tag.data$ encoding.
- $|data_i\rangle = 110$
- Search aim: amplify the corresponding tags towards the state $\dfrac{1}{\sqrt{2}} (|01.110\rangle + |11.110\rangle)$. Note: I can mark and post-select on the data but that would succeed with very low probability if the number of marked states is low and gives no advantage if I want to sample the tags.
- Count aim: counting the number of tags $\rvert|tag_i\rangle\rvert= 2$
Motivation
- Imagine a dictionary given as a quantum superposition of word and meanings. I have knowledge of what words are there in the dictionary and can list them classically. I want to query the meaning of a specific word. It seems counterintuitive that I need classical knowledge of the 'meaning of every word in the dictionary' to construct the quantum circuit (oracle+diffusion).
"
['simulation']," Title: What is the non-recursive form of the sum-over-paths simulation algorithm?Body: In my previous question on this, I managed to come up with a simple recursive algorithm for the sum-over-paths method. However, what other snatches of material I can find online don't use recursion when explaining it. I've tried to come up with a non-recursive form of the algorithm but it always seems to just look like the standard Schrodinger method. What is the non-recursive form of the sum-over-paths algorithm?
Also, how does such an algorithm map semantically onto a diagram like this, from Aaronson's quantum computing lecture 9?
"
"['measurement', 'quantum-fourier-transform', 'hadamard']"," Title: Measuring in the computational basis in the single qubit gate QFT implementationBody: I've come across this paper about a single-qubit-gate-only QFT implementation. In the paper it is claimed that measuring a qubit after applying the Hadamard gate (it isn't called Hadamard gate in the paper but its description matches that of the Hadamard gate) is no different from measuring before the gate.
Now what I assumed is that the measurement before the gate would have been made in the $\{|0⟩,|1⟩\}$ basis and the measurement after the gate would have been made in the $\{|+⟩,|-⟩\}$ basis.
However, I came across these conflicting sources about the term "Computational Basis" regarding measurement:
So my questions are:
- Does saying "measure in the computational basis" means that in whatever basis you qubits are in you measure them according to that basis to get classical bits or does it always refer to measuring in the {|0⟩,|1⟩} basis?
- If it is the latter then how does the claim hold when we know that $H|0\rangle=\frac{1}{\sqrt 2}(|0⟩+|1⟩)$ and $H|1\rangle=\frac{1}{\sqrt 2}(|0⟩-|1⟩)$ so the probabilities of measuring an outcome after H should be $\frac{1}{2}$ regardless of the original state of the qubit?
"
"['programming', 'projection-operator']"," Title: How to project a composite system down into a smaller subspace in Python?Body: If we have a composite system over five qubits ($|\psi\rangle = |a\rangle|b\rangle|c\rangle|d\rangle|e\rangle$), and I want to project into a specific subspace of the first three systems, I can build a projector of the form $|011\rangle\langle011| \otimes I_{de}$ (for example). Before projecting, state $|\psi\rangle$ can be thought of as an array with length $2^5 = 32$. My goal is to do the projection and reduce the size of my vector appropriately (so now I only have an array over the final two qubits). I'm doing this in Qiskit (after I get the statevector and am done evolving). My projectors will always have the form above, just perhaps with a different bitstring (in my example, I had "011"). This is what I've done so far:
- Since the projectors are diagonal, I convert the string "011" into an integer. In this case, it's 3. The corresponding matrix will look like:
$$ \begin{pmatrix}
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 & 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 \\
\end{pmatrix} .$$
- Because the subspace is like this, the identity matrix $I_{de}$ will just be a matrix of size $2^2\times2^2$ and when we take the tensor product, we will get a matrix similar to the one above, but now the size of the matrix will be bigger, and the $1$ that's above will be the only place where the identity shows up (since everywhere else will be zero). I won't write down the matrix because it has size $32\times32$.
- If I have my state $|\psi\rangle$ and I want to project down, I figured I just had to find the components of my 32-element array which correspond to this subspace.
- If the position of the 1 in my matrix above is given by $p$ and my state is an array called
psi, then I want to say that the projection is given by simply slicing my array as such:
projected = psi[(2**2)p:(2**2)*(p+1)]
My question is: Am I doing the right slicing in step 4? I think I am, but it's easy to get tripped up with these subspaces. I know that this won't work in general since the projection operator could be more involved, but in the case where it's diagonal like the above matrix and is only one element, do I have the steps involved correct?
"
"['measurement', 'textbook-and-exercises', 'notation']"," Title: What does it mean to ""measure an operator""?Body: I was reading a book and then I found this statement. I will put the text as well as a screenshot of the text.
The expectation value of an operator is the mean or average value of that operator
with respect to a given quantum state. In other words, we are asking the following
question: If a quantum state $|\psi\rangle$ is prepared many times, and we measure a given
operator $A$ each time, what is the average of the measurement results?
This is the expectation value and we write this as
$\langle A\rangle =\langle ψ|A|ψ \rangle$ (3.39)
Here is the screenshot,
"
"['programming', 'cirq']"," Title: Does Cirq support GPU acceleration?Body: I'm wondering if Cirq does (or plans to) support GPU acceleration of matrix operations, including density matrix simulations. I would like to speed up training and evaluations of variational circuits under different noise conditions when GPUs are available.
"
"['qiskit', 'ibm-q-experience']"," Title: IBMQ qiskit SSL error submitting jobBody: qiskit.providers.ibmq.exceptions.IBMQBackendApiError: 'Error submitting job:....
(Caused by SSLError(SSLError(1, \'[SSL:
WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)....
I used a basic Qiskit tutorial within a Conda environment, Python3.7, Ubuntu 18.
The was no problem getting it to load account with token and display the following:
ibmq_qasm_simulator has 0 queued and simulated qubits
ibmqx2 has 241 queued and 5 qubits
ibmq_16_melbourne has 3681 queued and 15 qubits
ibmq_vigo has 393 queued and 5 qubits
ibmq_ourense has 507 queued and 5 qubits
ibmq_valencia has 0 queued and 5 qubits
ibmq_armonk has 3 queued and 1 qubits
ibmq_athens has 13 queued and 5 qubits
ibmq_santiago has 17 queued and 5 qubits
This is the section of code which generated the error:
from qiskit.tools.monitor import job_monitor
backend = provider.get_backend('ibmq_qasm_simulator')
config = backend.configuration()
job = q.execute(circuit, backend, shots=10)
job_monitor(job)
I found one reference to the issue being on their cloud and it suggested using a VPN or different Network. I also setup an IBM cloud account, but there does not appear to be a way to incorporate that into qiskit. The next thing I tried was seeing if the IP address of their cloud link being called would work just in a simple browser window along the lines of a suggestion about safe.io intercepting the SSL on Macs.
I also tried a few things related to OpenSSL and reinstalling that bit etc... no luck. The qiskit package was installed using PIP within Conda.
QisKit Version:
qiskit-terra: 0.16.1
qiskit-aer: 0.7.1
qiskit-ignis: 0.5.1
qiskit-ibmq-provider: 0.11.1
qiskit-aqua: 0.8.1
qiskit: 0.23.1
"
"['quantum-gate', 'circuit-construction']"," Title: How to build a Hilbert space when do we already have concrete quantum logic gates available?Body: I read here that we use matrices to represent quantum logical gates.
But I don't like this 'point of view' because I want to build (or simulate logically with a real quantum processor, not through abstract models) mathematical structures as Hilbert space when I already have quantum circuits.
I want to understand how to build matrices with quantum logical gates as real quantum circuits.
In other words, we let's start with some physical quantum logical gates and we want to build a matrix with those circuits.
Can you give me some material explaining how to build a Hilbert space with quantum circuits?
"
"['qiskit', 'algorithm', 'circuit-construction', 'hhl-algorithm']"," Title: How to effectively compute eigenvalue rotation in HHLBody: In the HHL algorithm, how do you efficiently do the $\lambda-$controlled rotation on the ancillary qubit ? It seems to me after reading around some answers that this can be done in two steps :
- First, we map $|\lambda\rangle\mapsto |\frac{1}{\pi}\arcsin(\frac{C}{\lambda})\rangle$, defining $|\frac{1}{\pi}\arcsin(\frac{C}{\lambda})\rangle$ to be a binary representation $|\frac{1}{\pi}\arcsin(\frac{C}{\lambda})\rangle$ with $m$ qubits.
- Then perform a controlled rotation $U_y(|\theta\rangle \otimes |0\rangle)\mapsto |\theta\rangle \otimes \big(\cos(\theta)|0\rangle + \sin{(\theta})|1\rangle\big)$ where $U_y$ is simply
$$
U_y(|\theta\rangle \otimes |0\rangle) = \prod_{j=1}^m (I^{\otimes^m}\otimes R_y(2\pi\theta_j/2^j))
$$
i.e. a sequence of controlled rotations where we successively halve the angle of rotation conditionally of the digits of the binary representation of $\theta$.
My question is the following how can one implement efficiently the first step in an environment such as Qiskit ?
"
['error-correction']," Title: In quantum computation, if the fidelity is high enough to promise over 50% success rate, is quantum error-correction still needed?Body: Let's say we have many qubits and gates. The errors happen randomly, for example with a probability of 0.1% at each place(at this place, no quantum error correction is implemented). If the probability of no error occurs in the whole computation process is higher than 50%, we can repeat the computation maybe 100 times and choose the answer that appears most to be the correct one. In this situation, it seems that error correction is not needed.
Do I misunderstand sth?
"
"['programming', 'ibm-q-experience', 'measurement']"," Title: IBM quantum experience: Why are intermediate measurements ignored?Body:
Why am I getting here a measurement outcome of $00$? I measure after the first $X$ gate in a separate output bit c[1] which should result in a $1$ and I measure again after a second $X$ gate in a separate output bit c[0] which should result in a $0$, so $10$ in total. Why do I get the output $00$ as if both measurements are performed after the whole circuit? And how can I do intermediate measurements as expected?
"
"['quantum-gate', 'programming', 'circuit-construction', 'measurement', 'simulation']"," Title: Trying to understand this measurement of a simple quantum circuitBody: It's a newbie question, I know. But I was just wondering if someone could help me understand why this simple circuit results with the measurement shown. I've just didn't get the last step. It's not supposed that the last Hadamard gate would cancel the first one on q[0]? Why I still got results like 011 or 111?
"
"['quantum-state', 'entanglement', 'density-matrix', 'partial-transpose', 'entanglement-negativity']"," Title: In a bipartite system $AB$, why does the entanglement negativity $\mathcal{N}(\rho^{T_A})$ measure the entanglement between $A$ and $B$?Body: Consider a system composed of two subsystems $A$ and $B$ living in $\mathcal{H}=\mathcal{H}_A \otimes \mathcal{H}_B$. The density matrix of the system $AB$ is defined to be $\rho$. The entanglement negativity of $\rho$, defined as
$$\mathcal{N}_A(\rho) := \frac12(\|\rho^{T_A}\|_1 -1),$$ where $\rho^{T_A}$ is the partial transposition of $\rho$ and $\|\cdot\|_1$ is the trace norm, measures by how much $\rho^{T_A}$ fails to be positive semidefinite. This is useful since would $\rho$ be separable, $\rho^{T_A}$ would be positive semidefinite, hence $\mathcal{N}_A(\rho)=0$. This, along with some other nice properties makes $\mathcal{N}$ a nice entanglement measure.
I have read that if $\mathcal{N}_A(\rho)\neq 0$ then one can claim $A$ is entangled with $B$. This is what I don’t understand. By definition, $\mathcal{N}_A(\rho)$ measures by how much $\rho^{T_A}$ fails to be positive semidefinite, an essential property of a separable and hence a non-entangled system. Great, we know whether $\rho$ is entangled or not. However, just because we are told $\rho$ is entangled it doesn’t necessarily mean that the degrees of freedom in $A$ are entangled with those in $B$ right? I guess my problem could steem from the fact that I don’t understand the physical consequences of taking a partial transpose of $\rho$ w.r.t. some subsystem (i.e. what is the physical significance of $\rho^{T_A}$?).
Edit: First of all for your all your comments and generous patience. I edited the question to better address my last issue with understanding entanglement negativity.
"
"['programming', 'qiskit', 'experiment']"," Title: How can I resolve this get_count issue from running multiple circuits?Body: I'm running a couple of circuits at the same time using an array of variables. However, I met an issue regarding accessing the counts. Here's part of the code I have:
probsu = []
circuits = []
for i in range(len(Variable)):
circuit = QuantumCircuit(qrz,crz)
circuit = qc(Variable[i])
circuits.append(circuit)
prob = counts['1001'] / sum(counts.values()) **Issue here**
probsu.append(prob) **Issue here**
circuits = transpile(circuits, backend=backend)
job_manager = IBMQJobManager()
MyExperiments = job_manager. run(circuits, backend=backend, name='MyExperiment')
results = MyExperiments.results()
counts = results.get_counts(circuit)
I'm not able to get the counts since the line is referenced before the definition in the last line. However, there will be similar issues pop up if I remove the bottom lines before the for loop. How can I resolve this issue? Thanks:)
"
"['quantum-operation', 'tensor-product', 'information-theory', 'linear-algebra']"," Title: Does $\mathcal E^{\otimes n}$ admit a more efficient Stinespring dilation than the one used for $\mathcal E$?Body: Let $\mathcal{E}_{A\rightarrow B}$ be a quantum channel and consider its $n-$fold tensor product $\mathcal{E}^{\otimes n}_{A^n\rightarrow B^n}$.
Any isometry $V_{A\rightarrow BE}$ that satisfies $\text{Tr}_E(V\rho V^\dagger) = \mathcal{E}(\rho)$ can be used to construct a Stinespring dilation of $\mathcal{E}^{\otimes n}$. Indeed, a valid Stinespring dilation of $\mathcal{E}^{\otimes n}$ is simply $V^{\otimes n}$.
Is there any other Stinespring dilation of $\mathcal{E}^{\otimes n}$ that has a smaller environment size than $|E|^n$?
"
"['textbook-and-exercises', 'complexity-theory', 'nielsen-and-chuang']"," Title: Complexity of controlled operations in a two-level unitary operationBody: In Neilsen and Chuang, chapter 4.5.2 (~p.193), why did the authors come to the conclusion that complexity of operations $C^n(X)$ and $C^n(\tilde{U})$ is $O(n)$?
Did they assume using work qubits? If so, then is it true that the complexity in terms of gates has nothing to do with the complexity in terms of space (amount of qubits) and thus, any number of additional qubits is allowed using this notation?
Without work qubits this result seems suspicious, since in exercises 4.29 and 4.30 a reader is supposed to find a circuit of complexity $O(n^2)$ using no work qubits:
"
"['quantum-gate', 'programming', 'qiskit', 'algorithm']"," Title: Transpiler in IBM Quantum devicesBody: I am having trouble understanding how the transpiler works in IBM quantum computers. I am studying the spatial noise correlation between two qubits in an IBM Q device. For that, I don't want the transpiler to change my input circuit. Is it possible to overwrite the transpiler? Can someone explain how the transpiler works?
"
['programming']," Title: Design a circuit implementing the unitary matrixBody: Is it possible to design a circuit implementing the unitary matrix
$$U-\begin{bmatrix}
R_{\Theta_1} & 0 & 0 & 0 \\
0 & R_{\Theta_2} & 0 & 0 \\
0 & 0 & R_{\Theta_3} & 0 \\
0 & 0 & 0 & R_{\Theta_4} \\
\end{bmatrix}$$
for given four angles $\Theta_1,...,\Theta_4$ , where 0 is 2×2-dimensional zero matrix and $R_{\Theta}$ is the rotation matrix with angle $\Theta$?
If so, can we implement it on the available quantum programming platforms such as Qiskit, CirQ, PyQuil, or ProjectQ?
"
['programming']," Title: Classically controlled quantum operatorsBody: Does CirQ support classically controlled quantum operators where the classical values obtained by the measurement?
"
['quantum-gate']," Title: How does a generic controlled-U operation work?Body: It appears that controlled-$U$ type operation is the bedrock to many quantum algorithms, for instance, phase estimation and amplitude estimation. These algorithms systematically employs the controlled-$U$ type operation on the a state, say $|\psi\rangle$, stored in an oracle register while retaining one qubit in the computational register as the control bit. Consider a general case: The control bit is brought into a superposition $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ and the $|\psi\rangle$ is not an eigenstate of operator $U$, meaning $U|\psi\rangle = |\phi\rangle$. Now, we execute the controlled-$U$ operation to have
$\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)\otimes|\psi\rangle \xrightarrow{c-U}\frac{1}{\sqrt{2}}(|0\rangle\otimes|\psi\rangle + |1\rangle \otimes|\phi\rangle)$
where this basically implies that the control bit is entangled with the state in the oracle register. (Phase estimation is a special case where operator $U$ 'squeezes' out a phase factor $U|\psi\rangle = e^{\theta}|\psi\rangle$ and once this phase factor is considered back-kicked to state $|1\rangle$, the states in computational and oracle registers are separable.)
Here is what puzzles me. First, when we retain another bit in computational register as the control bit and apply $U$ on the oracle register, to what state are we actually applying this operator $U$? It appears in the most general case the resulting state of the control bit and the oracle register needs to be viewed as one state. Second, how does the matrix that represents this controlled-$U$ operator look like? To be more concrete, take the following 3-bit computational register as example,
$\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)\otimes\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)\otimes\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$
retaining the second bit as control and apply $U$ (on the oracle register), how does that matrix look like?
"
"['ibm-q-experience', 'bell-basis', 'bell-experiment']"," Title: Output of Bell State MeasurementBody: I was trying to see the output of Bell State Measurement in IBM Quantum Experience but in the simulation down the circuit in the histogram, it showed me that the possible qubit will be $|00\rangle$ and $|01\rangle$ whereas in the Bloch sphere it showed $|00\rangle$ and $|11\rangle$ with an angle of 180 degrees. What is the reason behind this as the output states should be $|00\rangle$ and $|11\rangle$ but then it is showing $|00\rangle$ and $|01\rangle$ in the histogram and it showed me the same when I ran that circuit on the quantum computer that is $|00\rangle$ and $|01\rangle$.
This is the photo of the circuit, histogram, and Bloch Sphere.
"
"['quantum-gate', 'quantum-state', 'state-preparation']"," Title: Have you ever seen the preparation of the state $a^{*}|0\rangle+b^*|1\rangle$ and $a|0\rangle+b|1\rangle$ from one initial state?Body: Have you ever seen the preparation of the state $a^{\star}|0\rangle+b^{\star}|1\rangle$ and $a|0\rangle+b|1\rangle$ from one initial state?
"
['programming']," Title: ProjectQ - Error messagesBody: How can we get rid of runtime next error:
Traceback (most recent call last):
File "C:\Users\Marija\Anaconda3\lib\site-packages\projectq\types\_qubit.py", line 135, in __del__
self.engine.deallocate_qubit(weak_copy)
File "C:\Users\Marija\Anaconda3\lib\site-packages\projectq\cengines\_basics.py", line 153, in deallocate_qubit
tags=[DirtyQubitTag()] if is_dirty else [])])
File "C:\Users\Marija\Anaconda3\lib\site-packages\projectq\cengines\_main.py", line 288, in send
raise compact_exception # use verbose=True for more info
RuntimeError: Qubit has not been measured / uncomputed. Cannot access its classical value and/or deallocate a qubit in superposition!
raised in:
' File "C:\\Users\\Marija\\Anaconda3\\lib\\site-packages\\projectq\\backends\\_sim\\_pysim.py", line 139, in get_classical_value'
' raise RuntimeError("Qubit has not been measured / "'```
"
"['programming', 'qiskit', 'quantum-state']"," Title: Get state vector of a single qubit in a circuit in QiskitBody: I have two quantum circuits, and I would like to compare state vector of the first qubit and check if equals, what is the best way to do that in qiskit ?
Let's say I have :
psi = QuantumCircuit(5)
psi.ry(np.pi/4.,0)
psi.x(0)
psi.x(1)
psi2 = QuantumCircuit(5)
psi2.ry(np.pi/4.,0)
psi2.x(0)
I'm looking for a function which returns True when qubit 0 has the same state vector in both circuits.
I tried to get the information from Statevector.from_instruction(psi).data, but I don't know how to extract information independently of other qubits.
Edit:
I get the right result with this function :
def QuantumCircuits_Statevectors_AreEquals(QuantumCircuit1, QuantumCircuit2, QubitIndex):
statevector1_arr = np.empty([1,2]).astype(complex)
statevector2_arr = np.empty([1,2]).astype(complex)
QuantumCircuit1.snapshot("qbsnap", qubits=[QubitIndex])
QuantumCircuit2.snapshot("qbsnap", qubits=[QubitIndex])
backend = Aer.get_backend('statevector_simulator')
snapshot1 = execute(QuantumCircuit1, backend).result().data()['snapshots']['statevector']['qbsnap']
snapshot2 = execute(QuantumCircuit2, backend).result().data()['snapshots']['statevector']['qbsnap']
statevector1_arr[0][0] = snapshot1[0][0]
statevector1_arr[0][1] = snapshot1[0][1]
statevector2_arr[0][0] = snapshot2[0][0]
statevector2_arr[0][1] = snapshot2[0][1]
return np.array_equal(statevector1_arr, statevector2_arr)
But maybe a cleaner solution is possible?
"
"['pauli-gates', 'non-locality']"," Title: Understanding the EPR argument with a simple description using Pauli matricesBody: Can someone explain the EPR argument with a simple description using Pauli matrices?
Two non-commuting physical quantity are being discussed philosophically whether there is an element of reality corresponds to the theory and the possibility of getting a value with certainty when measurement was made. Two argument are stated which are
- Either the Quantum Mechanic description of reality given by the wave function is not complete;
- Or the physical quantities associated with non-commuting operators cannot have simultaneous reality.
To clarify the ideas involved, let us consider a fundamental concept of state which is characterized by state vector, $|a\rangle$ which describe the particle’s behavior. Corresponding to every physical observable, there is an operator which operates on the state vector.
$\hat{A}|a\rangle = a|a\rangle$
For an eigenstate $|a\rangle$ of Hermitian operator $\hat{A}$, only the eigenvalue a will be obtained after measurement, with a probability equal to unity. The state too will not suffer any change after the measurement process. We can thus predict the outcome of the measurement with a probability equal to one and without disturbing the system in any way. Therefore, by the EPR argument, for an eigenstate, the value of the corresponding observable is an element of physical reality.
How to explain the momentum and coordinate in the EPR paper using pauli matrices?
"
"['programming', 'qiskit', 'optimization']"," Title: Does the Qiskit ADMM optimizer really run on quantum computers?Body: I read Qiskit quantum admm on this website.
I doubt whether this Qiskit ADMM algorithm can run on a quantum computer. The code did import packages from Qiskit, but it doesn't create any quantum circuit.
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'vqe', 'qaoa']"," Title: Decomposition of 2-qubit Hamiltonian into standard gate set for QAOABody: I try to decompose ansatz into gate set in order to create a circuit in qiskit for QAOA algorithm.
I don't understand how represent parametrized 2 qubit ansatz as circuit.
$ H{_B} = \sum_{j=1}^{n} {\sigma_j^x} $
$ H_{A} = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\otimes\sigma_z^2 $
Ansatz for p=1
$ \left| \gamma_1,\beta_1 \right\rangle = e^{-i\beta_1H_B} e^{-i\gamma_1H_A} \left| ++ \right\rangle$
It is clear how a circuit for $ e^{-i\beta_1H_B} $ looks like, but I stuck in decomposing $ e^{-i\gamma_1H_A} $(more precisely it second term) into parametrised circuit acting on both qubits and depends on $\gamma_1$
Any help would be appreciated as well as any insight on multiple qubit decomposition.
"
"['programming', 'measurement', 'bell-basis', 'bell-experiment']"," Title: How can I measure a qubit on a generic axis on Qiskit?Body: I'm trying to prove Bell's inequality by following the one made by Wigner, that is:
$P(+_a,+_b) \le P(+_a,+_c) + P(+_c,+_b)$
And that this proof is NOT satisfied for angles between the various axes $\hat a$, $\hat b$ and $\hat c$.
In particular I have chosen the coplanar axes (plane x-y) and that the $\hat c$ axis is the bisector of $\hat a$ and $\hat b$.
So I'm in the situation in the picture Graph
My idea is to take the singlet state (represented in this case by a specific state of the Bell state) and measure one qubit on one axis ($\hat a$, $\hat b$, $\hat c$) and the other qubit on one of the remaining axes in in such a way as to make all possible combinations.
In the specific situation represented in the graph, the angle that I can choose between the various axes must be a value between $0$ and $\frac \pi2$.
Now I come to my question: my doubt is whether it is correct how to interpret the measurement phase after I have created the singlet state (entagled state).
The entangled state I create it like this:
circ = QuantumCircuit(2,2)
circ.x(0)
circ.x(1)
circ.h(0)
circ.cx(0,1)
Referring to the graph I put earlier, if I wanted to now measure a long qubit $\hat a$ and a long $\hat b$ I would have to measure along x (no rotation for the first case) and rotate the second theta qubit around z and then measure along x, correct?
I thought about doing it this way
# Long a-axis for qubit 1
circ.h(0)
# Long b-axis for qubit 2
circ.rz(pi/3, 1)
circ.h(1)
circ.measure(range(2),range(2))
I wonder if these steps are correct or I forgot something or I can do it in another way.
Because if I measured directly without applying the Hadamard operator before the measurement I would make a measurement along the z-axis I suppose, right?
I hope I was clear enough and that we can resolve my doubts!
Thank you for your time!
"
"['quantum-gate', 'quantum-state', 'matrix-representation', 'quantum-fourier-transform', 'linear-algebra']"," Title: What is the matrix for a SWAP operation on two qubits?Body: Say we want to swap qubits $a$, $b$ in the same register, where $a,b \in \left \{ 0, 1,\cdots, n-1 \right \}$. What would be the corresponding matrix.
For those interested, I'm curious about this matrix because I'm implementing the QFT, which by default leaves the qubits in reverse order. This is generally handled with a layer of SWAP operations-but I haven't been able to find the matrix implementation.
For instance it is common knowledge that for $a=0$, $b=1$ (a two-qubit register) the matrix is:
$$SWAP=\begin{bmatrix}
1 & 0 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0\\
0 & 0 & 0 & 1
\end{bmatrix}$$
I understand how this acts on $\langle 10| \equiv \left [ 0, 1, 0, 0 \right ] \leftrightarrow \langle 01| \equiv \left [ 0, 0, 1, 0 \right ] $ but I fail to see where exactly to place the two off-diagonal $1$s in the general case.
"
['measurement']," Title: Why is it important to be in the basis in which measurements will be performed?Body: This might seem obvious to some but I would like to know what is exactly the purpose of this? And if there is a change of basis...it's just simply taking the new basis and writing it in terms of the old basis right?
"
"['resource-request', 'physical-realization']"," Title: Are there any detailed designs for Quantum Computing hardware?Body: I am looking to analyze some quantum hardware designs, preferably superconducting and photonics, but I can't seem to find sources that give some detailed information. Can someone provide me designs for any of the technologies mentioned above?
"
"['entanglement', 'non-locality']"," Title: Role of convexity in proof of Monogamy of Bell correlationsBody: In this paper, the authors give a proof of the monogamy principle in quantum physics. I'm having trouble understanding the convexity argument in the proof of Lemma 2 (penultimate paragraph, page 2). I suggest the reader read the problem first because the background may well be unnecessary to solve the issue.
Quick Background:
Let us consider a quantum system for which the Hilbert space can be factorised into $m$ different "sites". That is to say $\mathcal{H} = \bigotimes_{k=1}^{m} \mathcal{H}_k$ where all the individual Hilbert spaces $\mathcal{H}_k$ are $2d$ dimensional for some fixed $d$, i.e. $\mathcal{H}_k = \mathbb{C}^{2d}$ for all $k$. Now let us define a set of localised two outcome observables $M_{k,i}$ with $i=1,2$ and $k=1,2,...,m$ such that they only have $\pm 1$ as their eigenvalues, and are traceless. The authors go on to show that it is possible to choose a basis in which both $M_{k,1}$ and $M_{k,2}$ take the block diagonal form $\oplus_{j=1}^{d}\mathbb{C}^2$ simultaneously for all $k$. The quantity of interest is the Bell correlation
$$B = \langle{\psi|\mathcal{B}|\psi}\rangle.$$
where
$$\mathcal{B} = \sum_{i_1=0}^{2}...\sum_{i_m=0}^{2}c_{i_1 ... i_m}\bigotimes_{k=1}^{m}M_{k,i_k}$$
is the Bell operator for some fixed $c_{i_1...i_m}$ coefficients. We're taking $M_{k,0}=1$ as the identity operator. As I understand it, this is useful in having terms in $\mathcal{B}$ that have operators from, say, only two sites a la the CHSH case. The authors claim that "the maximum quantum value of the Bell inequality is achieved by a state that has support on a qubit at each site". I'm assuming by "value of Bell inequality" they mean value $B$. Moreover I'm assuming by "support over one qubit", they mean when the state $|\psi\rangle$ lies entirely in exactly one $\mathbb{C}^2$ sector in all $\mathcal{H}_k$'s. Please correct me if either of these assumptions are incorrect or unreasonable.
Problem:
Let $|\psi\rangle$ be some state in $\mathcal{H}$. In the second to last paragraph in page 2, the authors define $\rho_{k,j}$ as the "reduced density matrix obtained by projecting $|\psi\rangle$ onto the $j$’th $\mathbb{C}^2$ factor of the $\bigoplus_{j=1}^{d}\mathbb{C}^2$ subspace induced by $M_{k,1}$ and $M_{k,2}$ at site $k$." Now they state that $B$ can be written as $$B = \sum_{j=1}^{d} \text{tr} (\mathcal{B}\rho_{j,k}).$$ They further argue since this is a convex sum over the $\mathbb{C}^2$ sectors, "it follows that the maximum is achieved by a state with support on a qubit at site $k$." I'm assuming they're talking about projecting $|\psi\rangle$ on the $j$'th $\mathbb{C}^2$ subspace of $k$'th site. Here are my questions.
- What does the $\rho_{j,k}$ mean? It couldn't possibly mean an actual reduced density matrix obtained by tracing out all the degrees of freedom apart from $k$ because then the formula $\langle{\psi|\mathcal{B}|\psi}\rangle = \text{tr} \mathcal{B} \rho_{j,k}$ wouldn't hold as $\mathcal{B}$ has nontrivial operators on other sites too. As far as I know, this kind of expectation value formula holds only when our operator is nontrivial only on one site and identity on the rest.
- What does the convexity argument mean? I know what a convex sum of vectors is but I don't see a vector, or anything that can be construed as a vector, on either side of the equation. It's scalar on both sides.
- How does said convexity mean that $B$ is maximised with support only on one sector? What is the corresponding theorem being used here?
My Attempt at a solution
Let's define a projector $P_{j,k}$ which projects a state in $\mathcal{H}$ to the $j$'th $\mathbb{C}^2$ sector of the $k$'th site. For a state $|\psi\rangle$, I'm assuming $\rho_{j,k}\equiv P_{j,k}|\psi\rangle \langle \psi | P_{j,k}$. This may not be, and in all possibility isn't, the $\rho_{j,k}$ the paper is talking about, but I couldn't find another reasonable interpretation. Now, since both $M_{k,1}$ and $M_{k,2}$ are block diagonal in the sectors we obtain the required form $B = \sum_{j=1}^{d} \text{tr} (\mathcal{B}\rho_{j,k})$. Now assuming a dot product structure on the space of all operators on $\mathcal{H}$ given by $A\cdot B \equiv \text{tr}(AB)$, we have $B = \sum_{j=1}^{d} \mathcal{B} \cdot \rho_{j,k}$.
Since $\rho_{j,k}\cdot \rho_{j',k}=0$ if $j\neq j'$, all the $\rho_{j,k}$'s are orthogonal vectors. I guess now there is some argument with which we can say that the maximum value of $B$ can be achieved when $\mathcal{B}$ is aligned perfectly parallel to one of the $\rho_{j,k}$ and it's only that $\rho_{jk}$ that's nonzero. But this doesn't seem to be a particularly strong argument since it suggests that $\mathcal{B}$ lives is a $d$ dimensional vector space, which is obviously not true because we can arbitrary increase the degrees of freedom in its definition by increasing $k$. Moreover this argument doesn't seem to use convexity anywhere so this is probably not what the authors are getting at.
Any help regarding elucidating this proof will be of great help. Thanks in advance.
"
"['qiskit', 'simulation', 'quantum-fourier-transform', 'phase-estimation', 'quirk']"," Title: Trying to perform Quantum Phase Estimation on T-gateBody: I'm trying to perform QPE on the T-gate in Quirk but I'm not getting the correct result. For the T-gate, I should be measuring (001) with 100% probability, but instead, I'm getting the following:
I've modeled my implementation directly from the Qiskit QPE tutorial. For the unitary I am using $U(\lambda) = \begin{bmatrix}1 & 0\\0 & e^{i \lambda}\end{bmatrix}$.
Where did I go wrong here? Thank you in advance.
"
"['chemistry', 'many-body-systems']"," Title: Is there a connection between the definitions of one- and two-particle reduced density matrices?Body: In quantum chemistry, there are concepts about one-particle reduced density matrix (1-RDM) and similarly, the two-particle reduced density matrix (2-RDM).
Generally, for an $n$ particle wavefunction $|\Psi\rangle$ and the corresponding density matrix is ${}^nD=|\Psi\rangle\langle\Psi|$. Then there are two definitions of the 1-RDM and 2-RDM. The first is:
\begin{equation}
{}^1D= \begin{pmatrix}
1 \\
n
\end{pmatrix} tr_{2,3,\cdots,n} {}^nD
\end{equation}
where will resulting $C_n^1=n$ density matrix. Another method is to define the element of 1-RDM as:
\begin{equation}
{}^1D_{ij} = \langle \Psi|a_i^{\dagger} a_j|\Psi\rangle
\end{equation}
where $i$ and $j$ run over $1$ to $n$ and the matrix will be a $n\times n$ one. Is there any connection or difference between the two representations?
"
"['quantum-advantage', 'photonics', 'continuous-variable', 'boson-sampling']"," Title: Is Gaussian boson sampling (used for showing quantum advantage) a subcategory of the continuous variable approach?Body: I read about the photonic QC Jiŭzhāng that showed quantum advantage by Gaussian boson sampling. I read that boson sampling itself is a sub-universal technique of QC (where they use single-photon states as input states). In the paper, the scientists describe how they use squeezed states for their computation, which can be produced deterministically (making it better realisable then producing single-photon states).
I know the term "squeezed states" from continuous variables approaches (which e.g. Xanadu uses), where a squeezed state is an ellipse in phase space. So I am wondering, whether boson sampling is a special algorithm implemented within the continuous variable approach in QC? Or is it really a totally independent approach of QC?
"
"['qiskit', 'vqe']"," Title: Expected value in a VQE qiskitBody: I'm learning VQE(variational quantum eigensolver) of qiskit, but I have a question about how it measures the expected value of the energy ($\left \langle H \right \rangle$). I saw in other question and they comment that qiskit use $\left \langle H \right \rangle = \langle \psi | H |\psi \rangle = \sum_{i} \lambda_{i} P_{i} $ where $P_{i}=|\langle \phi_{i}|\psi \rangle|^2$. But my question is if qiskit needs the eigenvector of the operator, why does it use a VQE? Is qiskit has the diagonal representation already or how does qiskit do to measure the energy in a simulator and real device?
"
"['quantum-operation', 'tomography', 'quantum-circuit']"," Title: Unknown quantum circuit symbolBody: I was reading DiCarlo, L., Reed, M., Sun, L. et al. Preparation and measurement of three-qubit entanglement in a superconducting circuit. Nature 467, 574–578 (2010). https://doi.org/10.1038/nature09416 (open access preprint: https://arxiv.org/abs/1004.4324) and came across a quantum circuit symbol that I did not recognize and couldn't find online.
I am wondering about the symbols after the zero kets, before the rotation gates. The caption reads, "Gate sequences producing states with increasing number of entangled qubits: (a) the ground state (no entanglement)".
"
['ibm-q-experience']," Title: My IBM quantum account has been disabledBody:
As shown in the picture above, my IBMQ account is unavailable, and I found that my friend's account is also unavailable, but I have not received any email or message notification. what happened?
"
"['fault-tolerance', 'qudit']"," Title: Fault-tolerant qudit computation: advantage?Body: What are advantages of a fault-tolerant qudit computation compared with fault-tolerant quantum computation for qubits?
"
"['quantum-operation', 'partial-trace']"," Title: Positive semidefinite relationship after partial traceBody: Let $\rho_{ABC}$ and $\sigma_{C}$ be arbitrary quantum states and $\lambda\in \mathbb{R}$ be minimal such that
$$\rho_{ABC}\leq \lambda \rho_{AB}\otimes\sigma_C$$
We assume there are no issues with support in the above statement to avoid infinities. Now, one traces out the $B$ register. Let $\mu\in \mathbb{R}$ be minimal so that
$$\rho_{AC}\leq \mu\rho_A\otimes \sigma_C$$
Clearly, $\lambda\geq\mu$ since partial tracing is a completely positive quantum operation but in this case, since the traced out register had the same state on both the lhs and rhs, is $\lambda = \mu$?
"
"['information-theory', 'entropy', 'probability', 'renyi-entropies']"," Title: Prove the additivity of the Renyi entropy: $H_{\beta}(p \times r) = H_{\beta}(p) + H_{\beta}(r)$Body: The Renyi entropy of order $\beta$, for a discrete probability distribution $p$ is given by
\begin{equation}
H_{\beta}(p) = \frac{1}{1 - \beta} ~\log \left( \sum_{i \in S} p(i)^{\beta} \right),
\end{equation}
where $S$ is the set of all strings in the support of $p$.
As is mentioned here, for two discrete distributions $p$ and $r$ the Renyi entropy of the product distribution $p \times r$ is
\begin{equation}
H_{\beta}(p \times r) = H_{\beta}(p) + H_{\beta}(r).
\end{equation}
What might be a proof of this fact?
"
"['qiskit', 'vqe']"," Title: Is it possible to measure ""aux_operators"" in built-in VQE with backend ""qasm_simulator""Body: I am trying to measure the number operator, together with the ground state energy with the built-in VQE on Qiskit. However, if I pick the backend to be Aer.get_backend('qasm_simulator'), it seems to give an error 'numpy.float64' object is not iterable. Please see the minimal working code and the error message below. This is rather confusing, because the backend BasicAer.get_backend('statevector_simulator') works perfectly fine. Thanks for the help!
from qiskit.aqua.algorithms import VQE, NumPyEigensolver
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.chemistry.drivers import PySCFDriver, UnitsType
from qiskit import Aer, BasicAer
from qiskit.chemistry import FermionicOperator
from qiskit.aqua.operators import Z2Symmetries
from qiskit.aqua.components.optimizers import L_BFGS_B
optimizer = L_BFGS_B()
backend = Aer.get_backend('qasm_simulator')
# backend = BasicAer.get_backend('statevector_simulator')
atom='H .0 .0 .0; H .0 .0 0.74'
map_type = 'parity'
driver = PySCFDriver(atom=atom, unit=UnitsType.ANGSTROM, basis='sto3g')
molecule = driver.run()
num_alpha = molecule.num_alpha
num_beta = molecule.num_beta
# num_particles = molecule.num_alpha + molecule.num_beta
num_particles = [ num_alpha , num_beta ]
num_spin_orbitals = molecule.num_orbitals * 2
ferOp = FermionicOperator(h1=molecule.one_body_integrals, h2=molecule.two_body_integrals)
numOp = ferOp.total_particle_number()
qubitOp = ferOp.mapping(map_type=map_type)
qubitNumOp = numOp.mapping(map_type=map_type )
qubitOp = Z2Symmetries.two_qubit_reduction(qubitOp, num_particles)
qubitNumOp = Z2Symmetries.two_qubit_reduction(qubitNumOp, num_particles)
print('Ground state energy without shift is ' , NumPyEigensolver( qubitOp , k=2 ).run().eigenvalues.real )
init_state = HartreeFock( num_spin_orbitals , num_particles , map_type )
print( 'HF = ' , init_state.bitstr )
# setup the variational form for VQE
var_form_vqe = UCCSD(
num_orbitals=num_spin_orbitals,
num_particles=num_particles,
initial_state=init_state,
qubit_mapping=map_type ,
two_qubit_reduction = True ,
)
algorithm_vqe = VQE(qubitOp, var_form_vqe, optimizer , aux_operators = [qubitNumOp] )
result_vqe = algorithm_vqe.run(backend)
print( 'para_vqe = ' , result_vqe['optimal_point' ] )
print( 'eigenvalue_vqe = ' , result_vqe['eigenvalue' ].real )
print( result_vqe )
error message is attached below
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-5fb4d9ac0b3c> in <module>
59 algorithm_vqe = VQE(qubitOp, var_form_vqe, optimizer , aux_operators = [qubitNumOp] )
60
---> 61 result_vqe = algorithm_vqe.run(backend)
62
63
~/<redacted>/qiskit/aqua/algorithms/quantum_algorithm.py in run(self, quantum_instance, **kwargs)
68 self.quantum_instance = quantum_instance
69
---> 70 return self._run()
71
72 @abstractmethod
~/<redacted>/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py in _run(self)
425
426 if self.aux_operators:
--> 427 self._eval_aux_ops()
428 # TODO remove when ._ret is deprecated
429 result.aux_operator_eigenvalues = self._ret['aux_ops'][0]
~/<redacted>/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py in _eval_aux_ops(self, threshold)
445 # Deal with the aux_op behavior where there can be Nones or Zero qubit Paulis in the list
446 self._ret['aux_ops'] = [None if is_none else [result]
--> 447 for (is_none, result) in zip(self._aux_op_nones, aux_op_results)]
448 self._ret['aux_ops'] = np.array([self._ret['aux_ops']])
449
TypeError: 'numpy.float64' object is not iterable
```
"
"['quantum-state', 'probability']"," Title: How to interpret complex probability of superposition state?Body: I have one qubit and I apply two gates to it: H and T, which yields the following superposition:
$$
\frac{1}{\sqrt{2}} |0\rangle + \frac{1+i}{2}|1\rangle
$$
Now I want to calculate probability of 0 and 1 state:
$$
\left(A_1\right)^2 = \left(\frac{1}{\sqrt{2}}\right)^2 = \frac{1}{2}
$$
$$
\left(A_2\right)^2 = \left(\frac{i+1}{2}\right)^2 = \frac{i}{2}
$$
$$
S = \left(A_1\right)^2 + \left(A_2\right)^2 = \frac{1+i}{2}
$$
$$
P(A_i) = \frac{A_i^2}{S}
$$
according to prior equations i receive following values
$$
P(0) = \frac{1}{1+i} \land P(1) = \frac{i}{i+1}
$$
I was expecting to get $A_i=0.5$ however $P(0) + P(1) = 1$
How do I interpret this results?
"
"['entropy', 'max-entropy']"," Title: Do we know the limits of the quantum Tsallis entropy?Body: From the two main generalizations of the von Neumann entropy:
\begin{equation}
S(\rho)=-\operatorname{Tr}(\rho \log \rho)
\end{equation}
meaning Rényi:
\begin{equation}
R_{\alpha}(\rho)=\frac{1}{1-\alpha} \log \operatorname{Tr}\left(\rho^{\alpha}\right), \alpha \in(0,1) \cup(1, \infty)
\end{equation}
and Tsallis:
\begin{equation}
T_{q}(\rho)=\frac{1}{1-q}\left(\operatorname{Tr}\left(\rho^{q}\right)-1\right), q \in(0,1) \cup(1, \infty)
\end{equation}
we know that in both cases the limit to 1 for the entropic parameters gives us back the von Neumann entropy:
\begin{equation}
S(\rho)=\lim _{q \rightarrow 1} T_{q}(\rho)=\lim _{\alpha \rightarrow 1} R_{\alpha}(\rho).
\end{equation}
In the case of the quantum Rényi entropy we also know its two limits:
\begin{equation}
R_{0}(\rho)=\lim _{\alpha \rightarrow 0} R_{\alpha}(\rho)=\log \operatorname{rank}(\rho)
\end{equation}
and
\begin{equation}
R_{\infty}(\rho)=\lim _{\alpha \rightarrow \infty} R_{\alpha}(\rho)=-\log \|\rho\|.
\end{equation}
I couldn't find anything similar for the quantum Tsallis case? Is there something that is considered trivial?
"
"['grovers-algorithm', 'quantum-advantage']"," Title: Grover Algorithm vs Classical Search AlgorithmsBody: If Grover algorithm has a better speed than classical search algorithms, would it be an example of where Quantum computers outruns classical computers?
Can we use Grover Algorithm in real world problems?
"
"['qiskit', 'qaoa']"," Title: qiskit: Traveling Salesman Problem using QAOA fails for more than 3 citiesBody: I tried to implement the traveling salesman problem (TSP) using QAOA with qiskit. I worked with this qiskit QAOA tutorial and this qiskit minimum eigen optimizer tutorial, where they implement a TSP instance for three cities. However, when I tried to slightly change their example by considering four cities, the QAOA solution fails. I used the NumPyMinimumEigensolver classical solver to compare the QAOA solution with the classical obtained one. While the classical algorithm gives me the right solution, the QAOA solution even fails to visit each city once. I have tried to run QAOA with $p=1$ and $p=2$, both versions give me the same wrong result. I also used the qasm_simulatorinstead of the statevector_simulator, since for 16 qubits the latter is infeasable.
The weird thing to me is, that QAOA gives me a way too high cost value. I think this is due to the fact that QAOA gives me an invalid solution where the fourth city is never visited (QAOA's solution translates: city 1->2->3 and no city visited in fourth time step).
Does anyone know, why this slight change in the problem makes the algorithm fail? Is there anything wrong in my code?
My code:
from qiskit import Aer
from qiskit.optimization.applications.ising import tsp
from qiskit.aqua.algorithms import NumPyMinimumEigensolver, QAOA
from qiskit.aqua import aqua_globals, QuantumInstance
from qiskit.optimization.algorithms import MinimumEigenOptimizer
from qiskit.optimization.problems import QuadraticProgram
# Generating a TSP instance of n cities
n = 4
num_qubits = n ** 2
ins = tsp.random_tsp(n, seed=123)
print('distance\n', ins.w)
# Create a random TSP Hamiltonian
qubitOp, offset = tsp.get_operator(ins)
qp = QuadraticProgram()
qp.from_ising(qubitOp, offset, linear=True)
aqua_globals.random_seed = 10598
quantum_instance = QuantumInstance(Aer.get_backend('qasm_simulator'),
seed_simulator=aqua_globals.random_seed,
seed_transpiler=aqua_globals.random_seed)
qaoa_mes = QAOA(quantum_instance=quantum_instance, initial_point=[0., 0.])
exact_mes = NumPyMinimumEigensolver()
# solving Quadratic Program using exact classical eigensolver
exact = MinimumEigenOptimizer(exact_mes)
exact_result = exact.solve(qp)
print("\nExact:\n", exact_result)
# solving the Problem using QAOA
qaoa = MinimumEigenOptimizer(qaoa_mes)
qaoa_result = qaoa.solve(qp)
print("\nQAOA:\n", qaoa_result)
As a result I get:
distance
[[ 0. 48. 91. 33.]
[48. 0. 63. 71.]
[91. 63. 0. 92.]
[33. 71. 92. 0.]]
Exact:
optimal function value: 236.0
optimal value: [0. 0. 0. 1. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. 0.]
status: SUCCESS
QAOA:
optimal function value: 200111.0
optimal value: [1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0.]
status: SUCCESS
"
"['qiskit', 'vqe', 'callback']"," Title: Callback function in VQE do not return the intermediate values of the parametersBody: I tried to save all the intermediate values of the parameters when running the built-in VQE in qiskit. The callback function can save the mean values and counts, however it seems only save the very last set of parameters. Please see the codes below, which is really taken from the link here https://github.com/qiskit-community/qiskit-community-tutorials/blob/master/aqua/vqe_convergence.ipynb.
import numpy as np
import pylab
from qiskit import BasicAer
from qiskit.aqua.operators import WeightedPauliOperator
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.aqua.algorithms import VQE, NumPyMinimumEigensolver
from qiskit.aqua.components.initial_states import Zero
from qiskit.aqua.components.optimizers import COBYLA, L_BFGS_B, SLSQP
from qiskit.circuit.library import TwoLocal
pauli_dict = {
'paulis': [{"coeff": {"imag": 0.0, "real": -1.052373245772859}, "label": "II"},
{"coeff": {"imag": 0.0, "real": 0.39793742484318045}, "label": "ZI"},
{"coeff": {"imag": 0.0, "real": -0.39793742484318045}, "label": "IZ"},
{"coeff": {"imag": 0.0, "real": -0.01128010425623538}, "label": "ZZ"},
{"coeff": {"imag": 0.0, "real": 0.18093119978423156}, "label": "XX"}
]
}
qubit_op = WeightedPauliOperator.from_dict(pauli_dict)
num_qubits = qubit_op.num_qubits
init_state = Zero(num_qubits)
var_form = TwoLocal(num_qubits, 'ry', 'cz', initial_state=init_state)
counts = []
values = []
para = []
def store_intermediate_result(eval_count, parameters, mean, std):
counts.append(eval_count)
values.append(mean)
para.append( parameters )
algo = VQE(qubit_op, var_form, COBYLA(), callback=store_intermediate_result)
backend = BasicAer.get_backend('statevector_simulator')
quantum_instance = QuantumInstance(backend=backend)
algo_result = algo.run(quantum_instance)
counts = np.asarray(counts)
values = np.asarray(values)
para = np.asarray( para )
# print( 'counts' , counts )
# print( 'values' , values )
print( para)
This is in fact exactly the same code as in this answer VQE restart from a previous computation (I have also browsed other answers with keyword "callback"), and I can get the intermediate values of the cost function. However, for the parameters, what I got is the following (just copy the first few lines), which seems to be the very last set of parameters. Any ideas which part went wrong here?
[[ 1.82181708 -4.4450779 6.76132624 2.43831885 1.15624184 7.51034512
6.81040957 3.23410408]
[ 1.82181708 -4.4450779 6.76132624 2.43831885 1.15624184 7.51034512
6.81040957 3.23410408]
[ 1.82181708 -4.4450779 6.76132624 2.43831885 1.15624184 7.51034512
6.81040957 3.23410408]
[ 1.82181708 -4.4450779 6.76132624 2.43831885 1.15624184 7.51034512
6.81040957 3.23410408]
[ 1.82181708 -4.4450779 6.76132624 2.43831885 1.15624184 7.51034512
6.81040957 3.23410408] ...
"
"['quantum-state', 'entropy', 'information-theory', 'classical-quantum']"," Title: Prove that the conditional entropy of a classical-quantum state is non-negativeBody: Let $\rho_{XA}$ be a classical-quantum state, i.e., $\rho_{XA} = \sum_{x} p(x) |x\rangle \langle x| \otimes \rho_A^x$.
How to prove that the conditional von Neumann entropy $S(X|A) = S(\rho_{XA}) - S(\rho_A)$ is non-negative?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'projection-operator', 'linear-algebra']"," Title: How do I prove that $P_\pm=\frac12(1\pm U)$ if $U^2=I$?Body: Suppose I have an $n$-qubit Hermitian operator $U$ such that $U^2=I$.
The projection operators with eigenvalue $+1$ and $−1$ are $P_+$ and $P_-$.
How can I prove that $P_+=\frac{1}{2}(1+U)$ and $P_-=\frac{1}{2}(1-U)$?
I think $\sum P=1$ but I have no idea to get this conclusion.
"
"['quantum-gate', 'quantum-inspire']"," Title: Circuit composer RX or RY gate disappearsBody: When I specify the RX or RY gate to rotate by say $\pi/4$ in the circuit composer, the gate disappears off the circuit. Is there any reason why if I leave it with $\pi/2$ default then it stays?
If I edit theta the gate disappears.
Here's some screenshots to show what happens:
Ok solution is to erase the whole field $\pi/2$ and reenter $\pi/4$ but leaving $\pi/$ and then denominator $4$ will not work. Also the denominator is bounded between 1 and 9.
"
"['optimization', 'qaoa']"," Title: Can QAOA solve a constraint optimization problem?Body: Can QAOA solve a constraint binary optimization problem? QAOA is short for Quantum Approximate Optimization Algorithm. I read the information https://qiskit.org/textbook/ch-applications/qaoa.html.
But I'm not sure whether it can solve a constraint binary optimization problem.
"
['key-distribution']," Title: Quantum bit error rateBody: I am trying to understand the quantum key distribution and Quantum Bit Error Rate (QBER). I have question: Why is the QBER given by the average of the diagonals of the crosstalk matrix? Why the need to calculate the value using the diagonals?
"
"['programming', 'qiskit', 'amplitude-amplification', 'quantum-computing-for-finance', 'quantum-circuit']"," Title: Computing the CDF with QAE in QiskitBody: I want to load a lognormal distribution and then use an IntegerComparator to flip a qubit ($|0\rangle$ to $|1\rangle$) if its value is less than a threshold. Then I want to use an Quantum Amplitude Estimation algorithm to calculate the probability of measuring $|1\rangle$.
My code so far is:
import matplotlib.pyplot as plt
import numpy as np
from qiskit import Aer, QuantumCircuit, QuantumRegister, execute
from qiskit.aqua.algorithms import IterativeAmplitudeEstimation
from qiskit.circuit.library import LogNormalDistribution, IntegerComparator
num_uncertainty_qubits = 3
S = 100
vol = 0.4
r = 0.04
T = 3*(30/365)
mu = np.log(S) + (r-0.5*vol**2)*T
sigma = vol*np.sqrt(T)
mean = np.exp(mu - 0.5*sigma**2)
variance = (np.exp(sigma**2)-1)*np.exp(2*mu + sigma**2)
stddev = np.sqrt(variance)
low = np.maximum(0, mean-3*stddev)
high = mean + 3*stddev
uncertainty_model = LogNormalDistribution(num_uncertainty_qubits, mu=mu, sigma=sigma**2, bounds=(low, high))
# 3 qubit LogNormalDistribution model
uncertainty_model = LogNormalDistribution(3, mu=mu, sigma=sigma, bounds=(low, high))
# function to create the quantum circuit of the IntegerComparator and the uncertainty model
# x_eval is the threshold below which the qubit should be flipped
def get_cdf_circuit(x_eval):
qr_state = QuantumRegister(uncertainty_model.num_qubits, 'state')
qr_obj = QuantumRegister(1, 'obj')
qr_comp = QuantumRegister(2, 'compare')
state_preparation = QuantumCircuit(qr_state, qr_obj, qr_comp)
state_preparation.append(uncertainty_model, qr_state)
comparator = IntegerComparator(uncertainty_model.num_qubits, x_eval, geq=False)
state_preparation.append(comparator, qr_state[:]+qr_obj[:]+qr_comp[:])
return state_preparation
# Function to implement the Amplitude Estimation algorithm
def run_ae_for_cdf(x_eval, epsilon=0.01, alpha=0.05, simulator='qasm_simulator'):
state_preparation = get_cdf_circuit(x_eval)
ae_var = IterativeAmplitudeEstimation(state_preparation=state_preparation,
epsilon=epsilon, alpha=alpha,
objective_qubits=[len(qr_state)])
result_var = ae_var.run(quantum_instance=Aer.get_backend(simulator), shots=100)
return result_var['estimation']
Broadly speaking, I want to flip the objective qubit to $|1\rangle$ if the state is less than or equal to x_eval.
On running this, I'm getting the same amplitude estimation every time, even when I use different threshold values.
I'm missing something. Please help me out.
PS: https://imgur.com/a/qAjzzEz This is the link to the QuantumCircuit. P(X) is the LogNormalDistribution and Cmp is the comparator.
PPS: Using LinearAmplitudeFunction to compare floating numbers:
def get_comparator(threshold, num_qubits, low, high):
breakpoints = [low, threshold]
offsets = [0,0]
slopes = [0,0]
f_min = 1
f_max = 0
objective = LinearAmplitudeFunction(
num_qubits,
slopes,
offsets,
domain=(low, high),
image=(f_min, f_max),
breakpoints=breakpoints
)
return objective
"
"['measurement', 'resource-request']"," Title: Time accuracy required to reconstruct the density matrix?Body: So usually when you talk to physicists who accept the multi-world interpretation of quantum mechanics they claim that the measurement is reversible if you take into account the worlds we don't observe. Driven by this line of thought I think I can show if one alternates between measurements of $2$ different observables say $A$ and $B$ and do $2N$ (where $N$ is a large number) such measurements in time $T$. One is also allowed to assume the underlying dynamics, i.e. some Hamiltonian under which the system evolves. Then I claim it is impossible to reconstruct the original density matrix unless one knows when the measurements took place to an accuracy of $(\frac{T}{2N})^2$. Is there something like this in the literature?
"
"['quantum-state', 'error-correction']"," Title: Phase flip error correction on state $|0\rangle$Body: When I read documentations about quantum error correction, it generally speak about bit flip error, and phase flip on $|1\rangle$ state, so for example, let's say my initial state is $|\psi\rangle = a|0\rangle+b|1\rangle$, bit flip error correction $|\psi'\rangle = b|0\rangle+a|1\rangle$ or phase flip error correction $|\psi'\rangle = a|0\rangle-b|1\rangle$.
I'm wondering why the phase flip error correction $|\psi'\rangle = -a|0\rangle+b|1\rangle$ is never discussed? And why error correction codes don't correct this phase flip (at least these I have tested)? Is there a reason I'm not aware about ? Maybe this error never happens "in real life"?
"
"['programming', 'cirq']"," Title: Access and set_state during quantum computation simulation in cirqBody: The documentation for Cirq mentions the possibility to step through a circuit's moments, and access the exact wavefunction via step.state_vector(), and edit set it via step.set_state(). In the API documentation, neither function is documented. While the former seems to work anyway, the latter (setting the state) gives an AttributeError. I am using Cirq 0.9.1.
How can I change the wavefunction used for the next moment simulation?
"
"['quantum-gate', 'programming', 'qiskit', 'hamiltonian-simulation', 'matrix-representation']"," Title: XY Hamiltonian in a 1D Heisenberg ChainBody: I've been trying to implement the 1D Heisenberg chain (i.e. the XXZ model) on Qiskit but have been having trouble. To recap, the Heisenberg hamiltonian is as follows:
$$H_{XXZ} = \sum^{N}_{i = 1} [J(S^{x}_{i}S^{x}_{i+1} + S^{y}_{i}S^{y}_{i+1} + \Delta S^{z}_{i}S^{z}_{i+1})] $$
and we can take the XY hamiltonian to be
$$H_{XY} = \sum^{N}_{i = 1} [J(S^{x}_{i}S^{x}_{i+1} + S^{y}_{i}S^{y}_{i+1})]$$
as I understand. I know that the matrix representation of this hamiltonian's time evolution takes the form
$$XY(\theta) = \begin{pmatrix}
1 & 0 & 0 & 0\\
0 & \cos[{\theta}/2] & i\sin[{\theta}/2] & 0\\
0 & i\sin[{\theta}/2] & \cos[{\theta}/2] & 0\\
0 & 0 & 0 & 1
\end{pmatrix}$$
however, I'm not exactly sure how to implement it on Qiskit with the available Quantum logic gates. I do know that a special case to this problem is the iSwapGate, where it is equal to $XY(\theta = \pi)$, but is there a way to implement $XY(\theta)$ for arbitrary angles?
"
"['quantum-operation', 'information-theory']"," Title: When is the Choi matrix of a channel pure?Body: For a quantum channel $\mathcal{E}$, the Choi state is defined by the action of the channel on one half of an unnormalized maximally entangled state as below:
$$J(\mathcal{E}) = (\mathcal{E}\otimes I)\sum_{ij}\vert i\rangle\langle j\vert\otimes \vert i\rangle\langle j\vert$$
For isometric channels, the Choi state is also a pure state. What about the converse statement? Does the Choi state being pure give us any information about the properties of the channel?
"
['shors-algorithm']," Title: How to show that amount of qubits needed to crack the RSA-2048 protocol using Shor's algorithm?Body: I've read that under current technology we would need around 20 million qubits to crack the RSA-2048 protocol. How would one prove this?
"
"['entanglement', 'textbook-and-exercises', 'information-theory']"," Title: A question in classical and quantum informationBody: Let $\rho, \sigma \in \mathfrak{D}(A)$ with $\operatorname{supp}(\rho) \subseteq \operatorname{supp}(\sigma),$ and spectral decomposition
$$
\rho=\sum_{x} p_{x}\left|\psi_{x}\right\rangle\left\langle\psi_{x}\right| \quad \text { and } \quad \sigma=\sum_{y} q_{y}\left|\phi_{y}\right\rangle\left\langle\phi_{y}\right|
$$
For any integer $n$ denote by $y^{n}:=\left(y_{1}, \ldots, y_{n}\right), q_{y^{n}}:=q_{y_{1}} \cdots q_{y_{n}},\left|\phi_{y^{n}}\right\rangle:=\left|\phi_{y_{1}}\right\rangle \otimes \cdots \otimes\left|\phi_{y_{n}}\right\rangle,$ and for any $\epsilon>0$
the subspace $\mathfrak{T}_{n, \epsilon} \subset A^{n}$ is defined as
$$
T_{n, \epsilon}:=\operatorname{span}\left\{\left|\phi_{y^{n}}\right\rangle \in A^{n}:\left|\operatorname{Tr}[\rho \log \sigma]-\frac{1}{n} \log \left(q_{y^{n}}\right)\right| \leqslant \epsilon\right\}
$$
Finally, denote by $\Pi_{n, \epsilon}$ the projection onto the subspace $\mathfrak{T}_{n, \epsilon}$ in $A^{n}$
Now, I want to show two things. First, I want to show that
$$
2^{n(\operatorname{Tr}[\rho \log \sigma]-\epsilon)} \Pi_{n, \epsilon} \leqslant \sigma^{\otimes n} \leqslant 2^{n(\operatorname{Tr}[\rho \log \sigma]+\epsilon)} \Pi_{n, \epsilon}
$$
And I also want to show that for any $\epsilon>0$
$$
\lim _{n \rightarrow \infty} \operatorname{Tr}\left[\rho^{\otimes n} \Pi_{n, \epsilon}\right]=1
$$
$\textbf{ATTEMPT}$:
I think I should start as follows. I denoted $r_{y}:=\left\langle\phi_{y}|\rho| \phi_{y}\right\rangle,$ and by $\tilde{Y}$ the random variable whose alphabet is the same as that of $Y,$ but his corresponding distribution is $\left\{r_{y}\right\} .$ Then, I want to show that
$$
\operatorname{Tr}[\rho \log \sigma]=\mathbb{E}\left(\log q_{\tilde{Y}}\right)
$$
I'm really confused and struggling with this problem. Could you please help me?
"
"['entanglement', 'non-locality']"," Title: Three qubit identityBody: Problem:
I'm having trouble seeing how this paper claims the following identity to be true for a three qubit system (labelled by $A$, $B$, and $C$) under a pure state $|\psi \rangle$ with real coefficients
$$\langle X_{A} X_{B}\rangle ^2 + \langle Z_{A} Z_{B}\rangle ^2 + \langle Z_{A} X_{B}\rangle ^2 + \langle X_{A} Z_{B}\rangle ^2 = 1 + \langle Y_{A} Y_{B}\rangle ^2 - \langle Y_{A} Y_{C}\rangle ^2 - \langle Y_{B} Y_{C}\rangle ^2$$
where $X$, $Y$, and $Z$ are the three Pauli matrices and the subscript is the qubit label. The expectation values have the usual meaning $\langle X_A X_B \rangle \equiv \text{tr} \rho X_A \otimes X_B \otimes 1$ where $\rho \equiv \text{tr}_C |\psi \rangle \langle \psi |$.
My Guess:
I'm thinking that this identity arises out of something like $X^2 + Y^2 + Z^2=3$ but that approach leads me nowhere since the square is outside the expectation brackets. Another problem is that while on the LHS the $C$ space is being traced over, on the RHS it's either $A$ or $B$ that's being traced over, and the square on top of everything just makes it worse. I suspect this is a well known but tediously derived identity, in which case I'll be happy to be pointed to some source material which grinds this out.
Thanks in advance. Cheers.
"
"['entanglement', 'quantum-operation', 'unitarity', 'kraus-representation']"," Title: Unitary over bipartite states that can turn a non-product state into a product stateBody: Consider a bipartite quantum state $\rho_{AB}$ over a product of finite-dimensional Hilbert spaces $\mathcal{H}_A \otimes \mathcal{H}_B$. Does there exists a unitary $U$ over $\mathcal{H}_A \otimes \mathcal{H}_B$ such that:
- For any bipartite $\rho_{AB}$, the reduced density matrix over $A$ is preserved $\mathrm{tr}_B{[U(\rho_{AB})U^*]} = \rho_A$.
- For some a priori given $\sigma_{AB}$, the output is a product state: $U(\sigma_{AB})U^* = \sigma_A \otimes \omega_B$ (where $\omega_B$ can be anything).
I'm also interested in the case where such properties might only hold up to some arbitrary $\epsilon >0$ accuracy.
"
"['programming', 'quantum-state', 'grovers-algorithm', 'oracles']"," Title: Grover's algorithm for finding 6/8 statesBody: I'm trying to apply the diffusion operator to this state (normalization factors excluded):
$|000\rangle + |001\rangle - |010\rangle - |011\rangle - |100\rangle - |101\rangle - |110\rangle -|111\rangle$
However, I get the resulting state:
$|001\rangle+|001\rangle$
This is the opposite of what I want. Is there a solution? I know that my oracle is correct since I can view the phases of $\pi$:
.
And my implementation of the diffusion operator is the same one as for all 3 qubit states - yet I still get a resulting state of:
"
"['information-theory', 'entropy', 'max-entropy', 'min-entropy', 'renyi-entropies']"," Title: Continuity of Renyi entropies - limiting casesBody: The Renyi entropies are defined as
$$S_{\alpha}(\rho)=\frac{1}{1-\alpha} \log \operatorname{Tr}\left(\rho^{\alpha}\right), \alpha \in(0,1) \cup(1, \infty)$$
It is claimed that this quantity is continuous i.e. for $\rho, \sigma$ close in trace distance, $|S_{\alpha}(\rho) - S_{\alpha}(\sigma)|$ can be bounded for $0<\alpha<1$ and $\alpha >1$.
However, it is also stated that the max and min entropies $\lim\limits_{\alpha\rightarrow 0}S_{\alpha}(\cdot) = S_{0}$ and $\lim\limits_{\alpha\rightarrow \infty}S_{\alpha}(\cdot) = S_{\infty}$ are not continuous or not known to be continuous.
The above statements are found in http://www.scholarpedia.org/article/Quantum_entropies#Properties_of_quantum_entropy
The proofs themselves are quite complicated but is there some intuition for why the proofs fail at the limits?
"
"['quantum-gate', 'qiskit', 'ibm-q-experience']"," Title: Is there a physical definition of barrier operation in qiskit?Body: As far as I know, we can use barrier method in qiskit to split circuits into two sets to prevent the optimization. However, is there any physical meaning of the barrier? Like a delay operation or buffer gate? If we insert a barrier in the middle of the circuit, the second gate set will begin to be executed until the gates from the first set finishing their executions. What causes the waiting time for the second gate set?
"
"['quantum-operation', 'quantum-process-tomography']"," Title: Can you perform quantum process tomography using an orthonormal basis the contains non Hermitian matrices?Body: In the thesis "Efficient Simulation of Random Quantum States and Operators" on page 25 there is a portion of text explaining a method for quantum process tomography. It claims that states from an orthonormal basis for density matrices is easy to generate experimentally. This seems odd... since some of the matrices it includes in the basis are not hermitian...
They define the basis as follows:
$B_{\sigma}=\{\sigma^{(i, j)}=|i\rangle\langle j|: 1 \leq i, j \leq d \}$
but they probably actually meant
$B_{\sigma}=\{\sigma^{(i, j)}=|i\rangle\langle j|: 0 \leq i, j \leq d - 1 \}$
regardless, it generates matrices that aren't hermitian, and thus shouldn't be viable quantum states.
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: Exponentiating Pauli matrices using trapped ion native gates (single-qubit rotations + XX, YY, ZZ)Body: I'm wondering what are the known/good/standard ways of exponentiating Pauli terms (i.e. constructing circuits, which implement $\exp(i\alpha XIIZYI...)$) using gates supported by trapped ion quantum computers — single-qubit rotations and $\{XX,YY,ZZ\}$ gates.
One naïve/brute force approach would be to
- Exponentiate using the single-qubit + $\rm{CNOT}$ technique:
a. Rotate to $Z$ basis,
b. Exponentiate using $\rm CNOT$s:
- Convert each $\rm CNOT$ using eq. (9) from here:
- Try to optimize the resulting circuit.
This approach is, quite obviously, very inefficient. Any suggestions what one could do instead?..
"
"['algorithm', 'classical-computing', 'shors-algorithm', 'cryptography']"," Title: Shor vs Schnorr: A classical algorithm for breaking RSA?Body: I am not sure why I haven't heard much chatter about this paper by Dr. Claus Peter Schnorr where he claims to have come up with a classical algorithm to break the RSA protocol. The construction is based on a so called "Shortest Vector Problem Algorithm". The actual technical content is far beyond my understanding but I have a few questions about the paper and its implications.
- Has the correctness of the algorithm been already proven or disproven?
- What is the scaling of the algorithm? If efficient (meaning polynomial in the number of bits), would this undermine the field of quantum computation(QC) as Shor's algorithm is held up as the central example of the usefulness of QC?
- I know that one can use post quantum cryptographic protocols to avoid Shor's algorithm. Maybe something similar can be done here (by increasing the number of bits if the scaling is poor). However, if it can even break current RSA protocols, can't one just store all the current passwords to decrypt it later(If my memory doesn't betray me, this was the reason behind the NSA investing millions into QC)? If so, what is your bank doing about it?
"
"['programming', 'qiskit', 'quantum-circuit']"," Title: Is there a way to use titles on circuit drawing?Body: As you may know, one can use barriers in Qiskit to seperate gates on a circuit in a proper way. So, I was wondering is there a way to give a title to these "sections" seperated by barriers?
I provide an example in Figure below. Titles does not need to be exactly same with the ones in the Figure. It is just an example.
"
"['programming', 'qiskit', 'algorithm', 'orquestra']"," Title: What would be a real-life example of using a quantum workflow oriented tool/environment, such as through Orquestra?Body: Recently, a unified quantum software and hardware platform, Orquestra was released. My question is, what could be a real-life (step by step) example of using this kind of workflow? As existing quantum software frameworks already offer algorithm development toolboxes, what additional features would such a workflow include? Thanks.
"
"['hamiltonian-simulation', 'unitarity', 'chemistry', 'solid-state', 'dynamics']"," Title: If a Hamiltonian is quadratic in the ladder operator, why is its time evolution linear in the ladder operator?Body: How can one show that $\hat{U}^\dagger\hat{a}\hat{U}$ (with $\hat{U} =e^{-i\hat{H}t}$) involves only linear orders of the ladder operator, when $H$ is the general quadratic Hamiltonian $(\hat{H} = \alpha (\hat{a}^\dagger)^2+ \beta \hat{a}^\dagger\hat{a}+\alpha^*\hat{a}^2)?$
I have been trying to do it using the Baker-Campbell-Hausdorff formula.
"
"['quantum-state', 'textbook-and-exercises', 'linear-algebra']"," Title: How to calculate the overlap of the orthogonal state?Body: This is probably a very obvious question, but I am going through this problem set and I don't understand why in 1b) it says that it is obvious that $|\langle\psi_1^\perp|\psi_2\rangle|=\sin\theta$ given that $|\langle\psi_1|\psi_2\rangle| = \cos\theta$.
"
"['hamiltonian-simulation', 'chemistry', 'solid-state', 'dynamics', 'quantum-optics']"," Title: Why does joint ground state not change under action of beam splitting unitary operator?Body: How can one show that $\hat{U}|00\rangle=|00\rangle$ where $\hat{U}=e^{-igt(\hat{a}^\dagger_2\hat{a}_1+\hat{a}^\dagger_1\hat{a}_2)}$ and $|00\rangle$ is the unique joint zero eigenstate of the annihilation operators $\hat{a}_1$ and $\hat{a}_2$, i.e. $\hat{a}_1|00\rangle=\hat{a}_2|00\rangle = 0$.
"
"['programming', 'qiskit', 'quantum-state', 'ibm-q-experience']"," Title: How to initialize a qubit with a custom state in Qiskit ComposerBody: I'm trying to initialize a qubit with a custom state in IBM's Qiskit Composer. I wrote the code in the Qiskit Lab and obtained the QASM code as shown below
OPENQASM 2.0;
include "qelib1.inc";
qreg q0[1];
creg c[1];
initialize(0.5,0.8660254) q0[0];
This is giving error stating initialize is not defined. What's the way to initialize a qubit with a custom value in Qiskit Composer?
"
"['cirq', 'initialization']"," Title: Why wont my custom controlled gates in Cirq work on a simulator?Body: To initialize a state in Cirq, I created a custom controlled rotation and a custom rotation gate. The effect of applying the custom controlled gates to the qubits doesn't seem to affect the state.
Here's the definition of the custom controlled rotation gate:
a00 = 2/np.sqrt(30)
a01 = 4/np.sqrt(30)
a10 = 3/np.sqrt(30)
a11 = 1/np.sqrt(30)
class Con0Gate(cirq.SingleQubitGate):
def _unitary_(self):
return np.array([
[a00/(np.sqrt((np.abs(a00)**2)+(np.abs(a01)**2))), a01/(np.sqrt((np.abs(a00)**2)+(np.abs(a01)**2)))],
[a01/(np.sqrt((np.abs(a00)**2)+(np.abs(a01)**2))), -a00/(np.sqrt((np.abs(a00)**2)+(np.abs(a01)**2)))]])
def _circuit_diagram_info_(self, args):
return 'Con0Gate'
And here it is in the circuit (ignore the first "rotation" gate, which works fine)
circuit = cirq.Circuit(
RotationGate(theta).on(cirq.LineQubit(q1)),
Con0Gate().on(cirq.LineQubit(q2)).controlled_by(cirq.LineQubit(q1)))
After running this through a simulator, it looks like the gate isn't controlling on the target, and only applies a rotation to the controlled qubit.
"
['complexity-theory']," Title: Can quantum computer solve NP-complete problems?Body: As far as I know, quantum computers are able to solve only some of the NP-Problems in polynomial time, using the Grovers algorithm. I read that if one manages to create a reduction of Grovers algorithm on one of the NP-Complete algorithms, for example 3SAT, then it will be a huge milestone, since we could solve all other NP-Complete problems. I also read that current quantum computers lack error-correcting qubits to create a reduction of Grovers algorithm on 3SAT. What would be a sufficient amount of qubits to solve such problem and what amount do we currently have?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Running Qiskit Circuit Composer locally on Jupyer NotebookBody: I was wondering if I could use Qiskit locally on Jupyter Notebook and thus loaded my IBM-Q account via API token. I could construct circuits execute jobs but when I tried to use circuit composer, it returned nothing like the interactive circuit-composer as it does in IBM Quantum Lab. I ran the following code:
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
%matplotlib inline
from ibm_quantum_widgets import CircuitComposer
CircuitComposer()
It returned the following:
CircuitComposer(circuit=<qiskit.circuit.quantumcircuit.QuantumCircuit object at 0x15C528F8>)
Is there anything I am possibly missing out?
p.s qiskit has the latest version installed.
"
"['programming', 'qiskit', 'algorithm', 'q#']"," Title: What all parameters can we take into account when comparing different quantum programming languagesBody: I am planning to write a paper which compares Qiskit and Q# in the following circuits/algorithms
- Bell circuits
- Controlled swap to test similarity of two registers
- Phase kickback between two qubits
- Deutsch-Jozsa algorithm
- Grovers algorithm
- Simons algorithm
- Shors algorithm (slightly advanced for me)
What all parameters apart from time and space complexity can I take to compare these languages
"
"['hamiltonian-simulation', 'chemistry', 'solid-state']"," Title: Fermionic commutation relation using Jordan-Wigner transformationBody: How to show in detailed steps that Fermionic annihilation and creation operators under Jordan-Wigner transformation satisfy the Fermionic commutation relation
$\{\hat{a}_i,\hat{a}_j\}= \{\hat{a}_i^\dagger,\hat{a}_j^\dagger\} =0 , \{\hat{a}_i,\hat{a}_j^\dagger\} = \delta_{ij}.$
"
['solovay-kitaev-algorithm']," Title: In Solovay-Kitaev's algorithm, where does the rotation relation $\sin(\theta / 2) = 2 \sin^2(\phi/2)\sqrt{1 - \sin^4(\phi/2)}$ come from?Body: In Dawson's and Nielsen's pedagogical review of the Solovay-Kitaev algorithm, they describe the decomposition of U into $U=VWV^\dagger W^\dagger$, with both $V, W$ being unitary, being rotated by $\phi$ around the x-axis and y-axis, and obeying the following relationship, where $\theta$ is the angle of $U$ about the Bloch sphere:
$$ \sin(\theta / 2) = 2 \sin^2(\phi/2)\sqrt{1 - \sin^4(\phi/2)}$$
Where does this relation come from?
"
"['programming', 'cirq', 'qaoa']"," Title: Best way to compute $\langle a|B|a \rangle$ in Cirq, where a is a state obtained running circuit A. And B is a different Quantum CircuitBody: I am implementing RQAOA in Cirq.
After running regular QAOA to find an optimal state a (This I have done successfully).
I need to calculate $\langle a|Z_iZ_j|a\rangle$ for all $i,j$ in MyGraph.edges().
How should I go about using state a found with the QAOA circuit, to calculate the expectation value of a different circuit with that state?
"
"['programming', 'qiskit']"," Title: Qiskit not finding CPLEXBody: I'm trying to use the CPLEX library alongside Qiskit but keep getting the error.
File "C:\Users\charl\.conda\envs\quantum\lib\site-packages\qiskit\optimization\algorithms\cplex_optimizer.py", line 58, in __init__
raise MissingOptionalLibraryError(
qiskit.aqua.missing_optional_library_error.MissingOptionalLibraryError: "The 'CPLEX' library is required to use 'CplexOptimizer'. You can install it with 'pip install qiskit-aqua[cplex]'."
Now when of course run that command, I find that all these packages are already installed.
When I tried manually updating docplex, I got a warning saying the latest version was incompatible with qiskit and so I downgraded using pip to docplex 2.15.194, yet I still get the error.
What can I do to get docplex and Qiskit to talk to one another ?
I am using a windows 10 installation of qiskit in a conda environment.
"
"['programming', 'cirq']"," Title: In Cirq, how do you display circuit diagrams that are ""prettier"" than the ones displayed by default?Body: This is a duplicate of a question that was asked on the Cirq issues page. I'm duplicating this question to increase it's visibility.
The standard way to print circuits in Cirq is by calling print(circuit): which prints the text diagram representation of the circuit. A "prettier" representation can be displayed with SVGCircuit. In a Jupyter notebook,
import cirq
from cirq.contrib.svg import SVGCircuit
a, b = cirq.LineQubit.range(2)
SVGCircuit(cirq.Circuit(cirq.X(a), cirq.CNOT(a,b)))
outputs:
SVGCircuit is a work-in-progress. Please add comments explaining what problems you run into on the Circuit.repr_svg with nice diagrams for ipython issue.
"
"['algorithm', 'mathematics', 'grovers-algorithm', 'complexity-theory', 'nielsen-and-chuang']"," Title: How would I theorise a quantum query algorithm in O(1)?Body: I am currently attempting to solve a problem from Nielsen-Chuang, and I can't seem to figure out how I would do this;
I'm trying to implement Grover's algorithm to solve the problem of differentiating between the two functions with 99% probability in O(1),
$$
f_0:\{0,1\}^n → \{-1,1\} \; s.t. \; \hat{f}(00...0)=\sqrt{2/3}\\
f_1:\{0,1\}^n → \{-1,1\} \; s.t. \; \hat{f}(11...1)=\sqrt{2/3}
$$
Does anyone know how I would do this?
"
"['mathematics', 'tensor-product', 'partial-trace', 'linear-algebra']"," Title: Can we express $\mathrm{tr}_A((A\otimes B)\rho_{AB})$ in terms of $A$, $B$, $\rho_A$ and $\rho_B$?Body: For a density matrix $\rho_{AB}$ and some operators $A, B$, is there a way to express
$$\text{Tr}_A((A\otimes B)\rho_{AB})$$
using the reduced states $\rho_A$ and $\rho_B$ and operators $A$ and $B$? Note that when $A$ is the identity operator, this is indeed possible and one has
$$\text{Tr}_A((I_A\otimes B)\rho_{AB})= B\rho_{B}$$
as shown here.
"
"['shors-algorithm', 'quantum-fourier-transform']"," Title: Quantum Fourier Transform in the Period Finding ProblemBody: I am trying to prove that when applying the inverse QFT to the following state:
we get the following result:
However, I get a wrong prefactor. Can anyone tell me where I went wrong? Here my calculations:
Here, the last equality comes by realizing that y is an integer and thus all terms of the second bracket give 1. The first bracket can be evaluated as follows:
Then we can plug in:
Obviously I should get 1/sqrt(r) not sqrt(r), but I don't find my mistake...
"
"['qiskit', 'quantum-gate', 'bloch-sphere']"," Title: Can I find the axis of rotation for any single-qubit gate?Body: Suppose I have an arbitrary qiskit $U_3$ gate: $U_3(\theta,\phi,\lambda)$. Is there a way I can find which axis the gate is rotating around? In other words, given any real numbers $\theta,\phi,\lambda$, can I find the vector $\hat n = (n_x,n_y,n_z)$ that the gate corresponds to, so that I can plot the axis of rotation on the Bloch sphere? I'm thinking about the y-z decomposition, but I'm still unable to find out the elements of $\hat n$. How can I figure that out? Thanks a lot for the help:)
"
['hhl-algorithm']," Title: In HHL algorithm, how to find the angle of rotation of ancilla qubits?Body: In HHL algorithm, after the quantum phase estimation, what is the angle of rotation i.e. what is the value of $\theta$ in R$_y$($\theta$) that is used in rotating ancilla qubit? How to find this angle of rotation without knowing the eigenvalues of matrix $A$?
Is there any general method to find this angle of rotation for any $n$x$n$ Hermitian matrix $A$?
"
"['quantum-state', 'textbook-and-exercises', 'notation', 'terminology']"," Title: Is there any difference between ""value of a qubit"" and its ""state""?Body: Value of a qubit and its state - is there any difference between these two terms in sense of terminology?
For example, can we name this state of a qubit also a value of a qubit:
$$
|\psi\rangle = \frac{1}{\sqrt{2}} |0\rangle + \frac{1}{\sqrt{2}} |1\rangle
$$
(By value, I don't mean eigenvalue)
UPD: By the way, I always use a word "state" for states like $|\psi\rangle$ and never call it a "value". The question is more about if someone use "value" for $|\psi\rangle$, is it a complete mistake? For example, if you saw it on Wikipedia what would you say?
UPD2: And what about states like $|0\rangle$ and $|1\rangle$? They are without a doubt states but also frequently called value which doesn't look like a big mistake.
UPD3: As for me, "value" more of a service word and by itself sounds not so clear as "result of a measurement", which is more informative. For example, like in a statement: "the result of the measurement has a value 1". What do you think?
"
"['programming', 'cirq', 'tensor-product', 'qaoa']"," Title: How to create an observable: 'Identity \tensor Pauli gate' in CirqBody: I am working on an implementation of the RQAOA algorithm on the Maxcut problem in Cirq.
My graph G has n vertices. And after running a QAOA circuit with n qubits I obtain a state gammabeta (a vertical vector with 2^n entries).
I want to calculate M(e) = <gammabeta|Z(e)|gammabeta> for all edges e of G.
I want Z(e) to be an observable of the form $I\otimes \dots \otimes I \otimes Z_i \otimes I \otimes \dots \otimes I \otimes Z_j \otimes I \otimes \dots \otimes I$ (two dimensional $I$'s),
with $i -1$ $I$'s in front if $Z_i$, $j -i -1$ in the middle and $n - j - 1$ behind $Z_j$.
That way I can use Z(e).expectation_from_state_vector(gammabeta, qubit_map=qubit_map)) to calculate M(e)
The problem I ran into is that I do not know how to do $I \otimes Z$ in cirq. If I write cirq.Z * cirq.Z I get $Z\otimes Z$, but if I do cirq.I * cirq.Z it does the regular product, and I get $Z$ back.
Does any one know how to make observable Z(e)? Or altenatively how to compute the expectation value of a circuit B with state vector a: <a|B|a>? Building the Z(e) circuit is easier, but I don't know how to calculate the expectation value if a state vector from one circuit, on another circuit.
"
['ibm-q-experience']," Title: How do I get the names of all currently available IBMQ devices?Body: How do I get the names of all currently available IBMQ devices?
"
"['programming', 'qiskit', 'bloch-sphere']"," Title: Can I simultaneously plot 2 vectors on a single Bloch sphere and rotate the angle of visualization?Body: I'm trying to plot 2 vectors on the same Bloch sphere. From the qiskit documentation here, we can find plot_bloch_vector(bloch, title='', ax=None, figsize=None, coord_type='cartesian'). So I'm not quite sure if we could plot 2 vectors (say [0,0,1] and [0,1,0]) on the same Bloch sphere.
Also, from the default visualization angle, some vectors might look like they're overlapping with the x-axis (e.g the figure below). Can I switch to another angle to visualize the sphere?
Thanks for the help:)
"
"['quantum-gate', 'unitarity', 'linear-algebra']"," Title: How does measuring a value of one operator affect the probability of measuring a value for another operator?Body: Suppose I have two non-commuting operators, $U_1$ and $U_2$ with eigenvalues $\lambda_{1,1}, \lambda_{1,2}$ and $\lambda_{2,1}, \lambda_{2,2}$, respectively. In order to determine how measuring one value for $U_1$ (say $\lambda_{1,1}$) affects the probability of measuring a particular value for $U_2$ I would want to write the particle in terms of a new basis given by the eigenvectors to get the probability of each outcome, right?
I realize this question might not make perfect sense. I am self-teaching quantum computing from a linear algebra perspective.
"
"['measurement', 'tomography', 'povm']"," Title: What does the POVM corresponding to single-qubit state tomography look like?Body: Let $\rho$ be a single-qubit state.
A standard way to characterise $\rho$ is to measure the expectation values of the Pauli matrices, that is, to perform projective measurements in the three mutually unbiased bases corresponding to the Pauli matrices, and collect the corresponding statistics.
Each such measurement can be described by a projective measurement. Generally speaking, measuring in an orthonormal basis $\{|u_1\rangle, |u_2\rangle\}$ corresponds to the POVM
$$\{|u_1\rangle\!\langle u_1|, |u_2\rangle\!\langle u_2|\}.$$
Is there a way to describe the entire process of measuring the state in the various possible bases using a single POVM?
In other words, what does a POVM which is informationally complete for a single qubit look like?
Is there one that can be considered to directly correspond to the standard state tomography scheme?
"
['machine-learning']," Title: How to get the solution and prediction of nuclear ridge regression?Body: \begin{equation}
\label{eqs.1}
\tilde{y}=\sum_{m=1}^{M}\alpha_{m}\kappa(x^{(m)},\tilde{x}) (1)
\end{equation}
where $\kappa(x^{(m)},\tilde{x})$defines the similarity between data and can be chosen beforehand.The weighting$\alpha=(\alpha_{1},...,\alpha_{M})^{T}$,for instance,can be determined by minimizing the least-square loss function
\begin{equation}
\label{eqs.2}
L(\alpha)=\sum_{m=1}^{M}(\tilde{y}^{(m)}-y^{(m)})^{2}+\chi\sum_{m=1}^{M}\alpha_{m}^{2} (2)
\end{equation}
The combination of (1) and (2) is a kernel ridge regression. How to get the solution and prediction of nuclear ridge regression?
"
"['quantum-state', 'partial-trace', 'trace-distance', 'state-space-geometry']"," Title: Constructing a state with constraints on reduced statesBody: Suppose $\rho'_{AB} \approx_\varepsilon \rho_{AB}$ in trace distance. Is there an explicit construction of some state $\tilde{\rho}_{AB}$ using $\rho'_{AB}, \rho'_A, \rho'_B, \rho_A$ and $\rho_B$ (but not $\rho_{AB}$) such that
$$\tilde{\rho}_A = \rho_A, \tilde{\rho}_B = \rho_B$$
while ensuring that $\tilde{\rho}_{AB}$ is as close in trace distance to $\rho'_{AB}$ as possible?
To get some obvious answers out of the way, we have the trivial solution of $\tilde{\rho} = \rho_A\otimes\rho_B$. This satisfies the marginal condition but probably is not optimal in terms of the trace distance between $\tilde{\rho}$ and $\rho'$.
A much cleverer attempt is shown in this answer to my previous question. Take
$$\tilde{\rho}_{AB} = \rho'_{AB} + (\rho_A - \rho'_A) \otimes \rho'_B + \rho'_A \otimes (\rho_B - \rho'_B) $$
but this construction is not guaranteed to be positive semidefinite for entangled pure states. Apart from that, it satisfies the requirement on the marginals and keeps $\tilde{\rho}$ close to $\rho'$.
Is there anything else one can try?
"
"['quantum-gate', 'entanglement']"," Title: Threshold quantum gateBody: I would like to know if it is possible to construct a set of quantum gates to do the following:
- Start with a set of N qubits representing a number expressed in binary notation.
- The values in the various qubits are entangled in unknown ways with each other, and have unknown ratios of likelihood of being 1 or 0.
- calculate a new qubit whose probability of being 1 is the probability that the number represented by the N qubits exceeds $\delta$, where $\delta$ is an externally provided (classical) parameter.
The objective is to create a quantum algorithm for general purpose optimization.
"
"['quantum-gate', 'quantum-state', 'entanglement', 'matrix-representation', 'tensor-product']"," Title: How would I apply rotations to both qubits in a 2 qubit system?Body: Say I have the two qubit system $\frac{1}{\sqrt{2}}\begin{bmatrix}
0 \\
1 \\
1 \\
0
\end{bmatrix}$.
I have two 2x2 unitary gates, one is a rotation by $\theta$ radians and the other is a rotation by $-\theta$ radians. How would I apply one of these rotations to one qubit and the other to the other qubit? Can I do this with a single 4x4 gate?
"
"['quantum-gate', 'hamiltonian-simulation', 'pauli-gates']"," Title: How to construct the two qubit gate generated by the Hamiltonian $H= X\otimes X + Y \otimes Y + Z \otimes Z $?Body: I know that the two qubit gate generated by $H=X\otimes X$ is $\exp\{-\text{i}\theta X\otimes X\}=\cos{\theta} \mathbb1 \otimes \mathbb1 - \text{i} \sin{\theta} X \otimes X$, where $X$ is the $\sigma_x$ Pauli matrix. Now, if we moved to the Hamiltonian $H= X\otimes X + Y \otimes Y + Z \otimes Z$, how can we find the two qubit gate?
"
"['entanglement', 'quantum-operation', 'partial-trace', 'povm', 'entanglement-breaking-channels']"," Title: Why are entanglement breaking channels, defined as $\Phi(\rho)=\sum_a \operatorname{Tr}(\mu(a)\rho)\sigma_a$, entanglement breaking?Body: Define an entanglement breaking channel $\Phi$ as a channel (CPTP map) of the form
$$\Phi(\rho) = \sum_a \operatorname{Tr}(\mu(a)\rho) \sigma_a\tag A$$
for some POVM $\{\mu(a)\}_a$ and states $\sigma_a$.
It is mentioned e.g. in (Horodecki, Shor, Ruskai 2003) that $\Phi$ is entanglement breaking iff it "breaks entanglement", that is, is such that
$$(\Phi\otimes I)\Gamma \quad\text{ is separable for every state } \Gamma.\tag B$$
This equivalence is proved, I think, in pages 5 and 6 of the above reference, but I can't quite follow the exposition there. In particular, the proof that (A) implies (B) seems to rely on expressing the action of $\Phi\otimes I$ on $\Gamma$ via a partial trace involving some operators $E_k$ which however are not defined (there might be a typo somewhere in the text, I'm not sure).
What are good ways to prove the equivalence between (A) and (B)?
"
"['qiskit', 'measurement', 'quantum-operation']"," Title: Operation conditioned on measurement resultBody: I have a 2 qubit circuit where I wish to measure the first qubit and the measurement outcome determines what operation to implement on qubit 2. The whole process can be simulated using the following operation
\begin{equation}
|0\rangle\langle0|\otimes H+|1\rangle\langle1|\otimes HS
\end{equation}
where H is a Hadamard gate and S is the phase gate, i.e. if the result is 0 I will measure in X basis and if it is 1 I will measure in Y basis. As a unitary this is
\begin{equation}
\begin{pmatrix}
\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0&0\\
\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}&0&0\\
0&0&\frac{1}{\sqrt{2}}&\frac{i}{\sqrt{2}}\\
0&0&\frac{1}{\sqrt{2}}&\frac{-i}{\sqrt{2}}\\
\end{pmatrix}
\end{equation}
This can be implemented on IBM's simulator using c_if but does anyone know how to implement this on the real IBM devices? I tried using transpile to see what gates it can be decomposed into. However this gave a very complicated matrix. Is there a simpler way to implement conditional operations on real IBM devices?
Thanks!
"
['quantum-circuit']," Title: How to reason about absorbing Pauli Product rotations into measurements?Body:
In this image, the orange box refers to the operator $\exp(-i P \frac{\pi}{4})$ and the blue box refers to the Pauli Measurement $P'$. The idea behind these rules is to show how all the Pauli Product $\frac{\pi}{4}$ rotations at the end of the circuit can be absorbed into the measurements.
How would you prove these equations? In particular, I am looking for a proof that will help me reason about what happens if I measure say just the first qubit after performing a multi qubit orange box. For example, how would I absorb the orange box into the measurements in the following?
"
"['qiskit', 'quantum-gate', 'ibm', 'universal-gates', 'compiling']"," Title: Qiskit: 3 applications of identity with arbitrary SU(2) is universal?Body: We know that the CNOT gate together with arbitrary SU(2) gates can be used to perfectly implement arbitrary SU(4) gates with 3 applications of the CNOT.
I am using the Qiskit library and testing how different basis gates compare to the CNOT for different number of applications, when trying to approximate arbitrary SU(4) gates.
As expected, the CNOT gives fid=1.0 for 3 applications, around 0.99 for 2, 0.7 for 1, and 0.5 for 0 applications (the numbers change depending on the SU(4) you are trying to approximate, but the fidelity is always 1.0 when using 3 CNOTS).
My issue is that I'm getting similar results when I put in any SU(4) as my basis gate, even the identity (on two qubits). Its telling me that with 3 applications of the identity and arbitrary SU(2) gates, I can perfectly implement any SU(4) with no approximation error.
Is this an issue with Qiskit, or am I missing something? I thought that the two-qubit gate you use needs to be a universal two-qubit gate, such as the matrix given at the bottom of page two here.
I have changed the 'num_basis_gates()' method from the 'TwoQubitBasisDecomposer()' class in order to output the total fidelity for all applications of the basis gate (0,1,2 and 3), rather than just the maximum fidelity (I just removed the 'argmax[...] part from the return statement).
Thanks for any help
"
"['pauli-gates', 'qaoa', 'linear-algebra']"," Title: Is there a matrix whose sum with the canonical Mixing Hamiltonian in Qaoa is proportional to the identity matrix?Body: Does there exist a Hermitian matrix, $K$ s.t $B^\prime = B + K$ satisfies $(B^\prime)^2 = c\cdot I$, where $B = \sum_{i=1}^{n}\sigma_x^{(i)}$, $\sigma_x^{(i)}$ is the Pauli X matrix acting on qubit $i$, $I$ is the identity matrix and $c \in \mathcal{R}$.
If so, what is $K$ and what is the commutative relationship with $B$? Can we have $K$ that commutes with $B$?
For $n=1$, $K=\sigma_x$, $c=4$ and $[K, B] = 0$.
"
"['programming', 'qiskit', 'quantum-circuit']"," Title: How to divide one quantum circuit into multiple sub-circuits in qiskit?Body: While I'm simulating one Big quantum circuit in Qiskit, I wonder how we can divide one big quantum circuit into several sub-circuits. I looked in Qiskit API documents, but I couldn't find it.
Is there anyway that I can do that?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: Error 400 on submission request on job that ran beforeBody: since today in the morning I am always getting the following error while running a job on IBM Sydney
"'Error submitting job: '400 Client Error: Bad Request for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q-afrl/Groups/air-force-lab/Projects/quantum-sim/Jobs. Topology without kind established., {"topologyId":"5f61b942174c232ece451d1f"}, Error code: 2614.''
The job script ran fine until yesterday at night and has not been altered at all.
Can you please tell me what is going on ? This is also not the error that I have seen in previous slack questions
"
"['complexity-theory', 'qma']"," Title: The complexity of LH with constant gapBody: Kitaev's quantum equivalent of the Cook-Levin Theorem, provides a polynomial time classical reduction from a QMA verification circuit to a sum $H$ of local hamiltonians, such that the least eigenvalue of $H$ is either $\leq a$ or $\geq b$, with $b-a$ vanishing as an inverse polynomial in the size of the original problem. If the gap vanishes faster, the problem is not known to be in QMA, and if the gap is larger the problem is easier.
I read often, for example in wikipedia, that for constant gap QMA-hardness is a conjecture (equivalent to a quantum version of the PCP theorem). However, I sometimes read the opposite: for example Gharibian's phd thesis problem 1.7, or Gosset, Nagaj definition 4 for the qsat subcase.
Effectively, I don't understand why I cannot repeat each term in $H$ a polynomial number of times, and obtain an equivalent problem with constant gap. Is this reasoning naively wrong, or maybe I am not reading the PCP statement correctly. Maybe "constant gap" is just a fast way to say something more specific?
PS. I have this question already posted on the theoretical cs board, because I didn't notice there is this probably more specific one. Let me know if I have to cancel it.
"
"['measurement', 'tensor-product', 'nisq']"," Title: What is the ""quantum mean value problem""?Body: What is the "Quantum mean value problem"? A definition I found was that it is "estimating the expected value of the tensor product observable on the output state of a quantum circuit". Does this mean that given some set of bits that we pass through some circuit, we try and guess what comes out of the other side?
If anyone knows of any papers introducing this idea, that'd be awesome.
"
"['algorithm', 'mathematics', 'vqe']"," Title: How to calculate $\operatorname{Var}[H]$ in the context of VQEs?Body: Given a Hermitian operator $H$, I can calculate the variance of the Hamiltonian $Var[H]$ as
$$ Var[H] = \langle H^2 \rangle -\langle H \rangle^2 $$
Now, $H$ can be decomposed as
$$ H = \sum_i \alpha_i P_i \hspace{1 cm} P_i \in \{ I,X,Y,Z\}^{\otimes n} $$
Hence by linearity we have $$\langle H \rangle = \sum_i \alpha_i \langle P_i \rangle $$
In the Variational Quantum Eigensolver (VQE), we want to minimize the above expression, that is, $\min \langle H \rangle_{|\psi (\theta) \rangle} $.
Note that if $|\psi (\theta)\rangle$ is indeed an eigenvector of $H$ then $Var[H] = 0 $. And so one can verify whether they have indeed reached/found an eigenstate by performing such calculation.
The question is how do we calculate $\langle H^2 \rangle$?
Yes, I can decomposed $H^2$ into sum of Pauli terms, that is
$$ H^2 = \sum_k \beta_k P_k \hspace{1 cm} P_i \in \{ I,X,Y,Z\}^{\otimes n} $$
and then using the optimized $|\psi (\theta) \rangle$ I have found through VQE to perform $$\langle H^2 \rangle = \langle \psi(\theta) | \sum_k \beta_k P_k | \psi(\theta) \rangle $$
This would be the same process as I did to calculate $\langle H \rangle$, applying the appropriate rotations to my circuit before measuring in the $Z$ basis... Then once I have this, $\langle H^2 \rangle$, I can put it together with the expectation value I have found through VQE to calculate $Var[H]$. This is the naive way of doing it I guess...
What is a better way to do this?
"
"['programming', 'q#', 'quantum-fourier-transform']"," Title: How to use QFT operation in Q#?Body: I see the QFT operation in the document given by Microsoft, but I don't know how to call it.
operation QFT (qs : Microsoft.Quantum.Arithmetic.BigEndian) : Unit is Adj + Ctl
Does this method need to be rewritten? How to set the parameters here? Can I have a brief example?
"
"['mathematics', 'annealing', 'adiabatic-model']"," Title: Adiabatic Quantum Computer e intermediate Hamiltonian evolves the state within the manifoldBody: The Adiabatic Quantum Computer is implemented by slowly increasing the parameter s from 0 to 1 in the intermediate Hamiltonian $[\hat{H}(s) = \hat{H}_{input} + (1-s)\hat{H}_{init} + s\hat{H}_{circuit}]$
How to show that this process evolves the state within the manifold spanned by $\{ |\alpha(0)\rangle|0_c\rangle,|\alpha(1)\rangle|1_c\rangle...|\alpha(L)\rangle|L_c\rangle$. In other words I meant to say how to show that $\hat{H}(s)$ does not map any state in this manifold to a state outside this manifold.
where $|\alpha(L)\rangle$ is is the data qubit state after applying the $l_{th}$ logic gate ,i.e $|\alpha(l)\rangle = \hat{U}_l...\hat{U}_1|0\rangle^{\otimes n}$
$\hat{H}_{input} = \sum_{i=1}^n|1_i\rangle\langle1_i|\otimes|0_c\rangle\langle0_c|$
$\hat{H}_{init} = \sum_{j=1}^L|j_c\rangle\langle j_c|$
$\hat{H}_{circuit} = \sum_{l=1}^L \hat{I} \otimes |(l-1)_c\rangle\langle(l-1)_c| - \hat{U}_l \otimes |l_c\rangle\langle(l-1)_c| - \hat{U}_l^\dagger \otimes |(l-1)_c\rangle\langle l_c|+ \hat{I} \otimes |l_c\rangle\langle l_c|$
"
"['complexity-theory', 'terminology', 'qma']"," Title: How is a promise gap related to a spectral gap?Body: In linear algebra one often concerns oneself with the spectral gap of a given matrix, which may be defined as the difference between the smallest and second-smallest eigenvalue (or, depending on convention and context, between the largest and second-largest eigenvalue). In computational complexity one often concerns oneself with a promise gap of a given problem, which may be loosely defined as a difference of some variable between accepting and rejecting inputs.
The different meanings of "gap" appear to overlap in certain problems of quantum computing. For example a promise gap is used in the $\mathsf{QMA}$-complete problem of determining the ground energy of a Hamiltonian - e.g. a promise that the ground energy of the given Hamiltonian is either less than a first value or greater than a second value, but we are also concerned with the spectral gap of the considered Hamiltonian, which may affect the general dynamics of the Hamiltonian.
I'd like to know whether there is any relation between the two different meanings of "gap". For example:
In certain formulations of $\mathsf{QMA}$-complete or $\mathsf{BQP}$-complete problems, can the spectral gap be smaller than the promised gap? What would be the implications of the promise gap being larger than the spectral gap?
In general the larger the promise gap the easier the problem may be; similarly the larger the spectral gap the easier the problem may be.
"
"['programming', 'ibm-q-experience']"," Title: IBM Quantum Experience complains ""Circuit needs at least one measure."" But, the circuit does have one!Body: I want to run this simple test on the IBM quantum computer ibmq_lima, but it complains about the measurement. As you can see, there is one "measure". The weird part is that it works if I change the "U" gate to "u3" gate. But, the "U" is a valid gate according to the OpenQASM 2.0 spec!
OPENQASM 2.0;
include "qelib1.inc";
qreg q[1];
creg c[1];
h q[0];
U(1,2,3) q[0];
measure q[0] -> c[0];
"
"['programming', 'ibm-q-experience']"," Title: Uploading 20,000 lines of code to IBM Quantum Composer stallsBody: It is a simple 5 bit circuit, but it has 20,000 lines of QASM code. I try to put it in the composer, but the "Saving..." beside the file name will stay there for hours. I never saw its completion.
"Saving..." usually transition to "Saved" in a few seconds if the file has 100 lines of code.
Has anybody succeeded in running a large file? How long do you have to wait to see the "Saved"?
"
"['quantum-state', 'density-matrix', 'partial-transpose']"," Title: Does a partial transpose always have real eigenvalues?Body: I am working with a tripartite system, but when I partially transpose the $8\times 8$ density matrix I get two complex eigenvalues. I know the criteria for the positive and negative eigenvalues, but are they always real? If they don't, what do my complex eigenvalues physically mean? (I have already checked my matrix for any mistake.)
"
"['hamiltonian-simulation', 'vqe']"," Title: VQE - How to get from expectation value to eigenvalue?Body: In VQE, for a single-qubit Hamiltonian, I can use a standard ansatz to make a state $\psi$ and use two products to compute the expectation value $\langle\psi|{\cal H}|\psi\rangle$. As I vary the parameters to the ansatz I get very close to the minimal eigenvalue. That's good.
In a physical setting, I can't do the multiplication. I have to measure in the Pauli Bases, which yields expectation values, and then - somehow - I should find the eigenvalues from the expectation values. There is a big hole in my understanding. For example, for this Hamiltonian:
$$
{\cal H} = 2.0 X + 0.5 Z
$$
The precise eigenvalues are [-2.0615528 2.0615528]. I make an ansatz with $R_x(\theta)$ and $R_y(\phi)$. Now, just as an initial experiment, I set these angles to 0.3, 0.7 to produce $\psi$ and compute $\psi' = {\cal H}\psi$. I measure $\psi'$ in the computational basis (z-basis, projecting onto $|0\rangle$ and $|1\rangle$) and get an expectation value of 1.74. $\cal H$ is not unitary, hence this unnormalized result. I modify the ansatz and add a Hadamard gate to "rotate" the x-axis into the z-axis. I measure again and get an expectation value of 2.403.
So now what. How do I get from here to an eigenvalue / minimal energy state?
Iterating over all angles $\theta, \phi$ does not seem to yield meaningful values.
"
"['programming', 'qiskit', 'quantum-circuit', 'qasm']"," Title: How to read QASM files for parametrized circuits (in QISKIT)? both from_qasm_file() and from_qasm_str() failBody: I am trying to work with parametrized circuits in QISKIT. I can simply create parameterized circuits, bind value(s) to parameter(s), and execute/run all instances (after binding values for parameters) on different backends like ibmq_manhattan, ibmq_paris, etc.
To dump the resulting circuits to QASM files, I use the “qasm()” method of the QuantumCircuit objects, and I see no problem. Here is a simple (random) QASM file that I create:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[3];
h q[0];
h q[1];
h q[2];
barrier q[0],q[1],q[2];
rx(beta) q[0];
As you can see, the last line of the QASM file specifies a parameterized RX rotation, on qubit q[0] and the angle is (beta). As far as I am working with QuantumCircuit objects, I can deal with these parameters. However, after writing the circuit to a QASM file, I lose the functionality.
More specifically, when I try to load/read the QASM file and create a QuantumCircuit, I face the following error:
Code: circ = QuantumCircuit.from_qasm_file(filepath)
Error: qiskit.qasm.exceptions.QasmError: "Argument 'beta' in expression cannot be found, line 9 file …
I also tried the following alternative (just in case):
Code: circ = QuantumCircuit.from_qasm_str(qasm_str)
and faced the same error. Here the “filepath” specifies the path to the QASM file, and I obtain the “qasm_str” via reading the QASM file.
I checked the source code of the “from_qasm_file()” module in QISKIT, as well as “Qasm” class; however, I did not find any additional input argument/parameter to specify these parameters to the parser.
I just need to read the (abovementioned) QASM file and re-create a QuantumCircuit object.
I would appreciate it a lot if someone can help me in this regard.
Thanks,
Ramin
"
"['entanglement', 'bell-basis']"," Title: Are entangled and Bell states the same thing?Body: I am a little confused whether the entangled state and Bell state are the same thing? If they have a bit of contrast, what is the difference between them?
"
"['programming', 'bloch-sphere']"," Title: Can I plot a bigger Bloch sphere using kaleidoscope?Body: I'm plotting a vector on the Bloch sphere using kaleidoscope:
from kaleidoscope import bloch_sphere
Is there a way I can make the plot bigger? (Instead of zooming in) I tried bloch_sphere([0,0,1],figsize=(10, 10)) but that doesn't work.
Thanks!!
"
"['hamiltonian-simulation', 'hhl-algorithm', 'phase-estimation']"," Title: Quantum Circuit for $e^{iAt}$ Hamiltonian Simulation in HHL algorithmBody: In HHL algorithm, there is a step in Quantum Phase Estimation where we have to apply powers of $e^{iAt}$ to the register (see pic). I am not able to understand how to find the quantum circuit corresponding to this unitary transformation i.e. if I know $A$, then how to find the decomposition of this operator in terms of quantum gates.
As an exapmle, Cao et al. v2 , Cao et al. v3 - in these papers the authors have decomposed the operator in terms of basic gates, but I am not able to understand, how they have done that. So, I am not able to understand how to decompose the operator $e^{iAt}$ in terms of basic gates for any Hermitian Matrix $A$ .
"
"['programming', 'qiskit', 'd-wave']"," Title: From Qiskit QuadraticProgram to problem model accepted by d'wave oceanBody: Is there a way to convert QuadraticProgram (qiskit.optimization.problems.QuadraticProgram) to BQM used in D'wave ocean (e.g. dimod.AdjVectorBQM)?
I'd like to use Qiskit to model my programming problem and use converters to deal with integer variables, inequations, etc., then sample this problem on d'wave QPU with annealing schedules. I've noticed d'wave has implemented a plugin that allows Qiskit to access QPU by the DWaveMinimumEigensolver. It seems hardly deal with parameters as a native d'wave sampler.
"
"['quantum-state', 'quantum-operation']"," Title: Ranges of quantum states that are related via a quantum channelBody: Let $\rho\in M_n$ and $\sigma\in M_m$ be two quantum states. We denote the orthogonal projections onto $\text{range}(\rho)$ and $\text{range}(\sigma)$ by $P_\rho$ and $P_\sigma$, respectively. Now, if the two states are connected via the action of a quantum channel $\Psi:M_m\rightarrow M_n$, i.e., $\rho = \Psi(\sigma)$, is it true that
$$ \text{range}[\Psi(P_\sigma)] \subseteq \text{range}(P_\rho) = \text{range}(\rho) \,?$$
"
"['programming', 'qiskit', 'algorithm', 'hhl-algorithm']"," Title: Source code for a Qiskit algorithm: HHL AlgorithmBody: Is it possible to view the source code of one of the Qiskit's algorithm?
Actually, I am trying to find how Qiskit implements the HHL algorithm. I want to see the source code for this algorithm.
"
"['error-correction', 'quantum-operation', 'noise', 'fidelity', 'decoherence']"," Title: Can quantum error correction work on any type of channel?Body: It says on wikipedia that quantum error correction can (at best) correct phase flips and bit flips. A popular form of representing a quantum channel is in its Kraus representation (scroll down to section 'pure channel' or just CRTL+F 'Kraus'). This kind of representation can yield a whole plethora of different possible noise models.
That being said, are there possible quantum channels that may exist (either right now or in the future) that induce noise that can not be corrected by current QEC methods? This question is somewhat related to this unanswered question.
"
"['simulation', 'density-matrix', 'cirq', 'initialization']"," Title: Setting the Initial State of Density Matrix Simulation in CirqBody: I am trying to use the DensityMatrixSimulator in Cirq. I want to append gates to the circuit conditional on measurements. In order to reduce computational resources, I am trying to run these conditional gates by initializing another circuit with these conditional gates using the final state of the first measurement as the initial state. However, I am not sure how I can get the simulate method to accept the initial state matrix (see code below).
I get the ValueError of
ValueError: `state_like` was convertible to a numpy array, but its shape was neither the shape of a list of computational basis values (`len(qid_shape)`) nor the shape of a list or tensor of state vector amplitudes (`qid_shape` or `(product(qid_shape),)`.
qid_shape=(2, 2)
np.array(state_like).shape=(2, 2, 2, 2)
np.array(state_like)=[[[[ 0.+0.j 0.-0.j]
[ 0.+0.j 0.-0.j]]
[[-0.+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 0.-0.j]
[-0.+0.j 0.-0.j]]]]
This is the code I am trying to run to figure out how to initialize the initial state of the second circuit.
qubits = cirq.LineQubit.range(2)
circuit = cirq.Circuit()
circuit.append(cirq.X(qubits[0]))
circuit.append(cirq.Z(qubits[1]))
s = cirq.DensityMatrixSimulator()
results = s.simulate(circuit)
r = cirq.DensityMatrixSimulator()
circuit2 = cirq.Circuit()
circuit2.append(cirq.X(qubits[0]))
circuit2.append(cirq.Z(qubits[1]))
results2 =r.simulate(circuit2, initial_state = results._final_simulator_state.density_matrix)
Thank you in advance!
"
['resource-request']," Title: Question about understanding quantum computing and its usage and theory behindBody: I am just wondering if I am interested in quantum computing, but not able to get into engineering. Will I be able to acquire knowledge of quantum computing by for example taking courses in physics and mathematics department?
If so, in particular what physics courses or mathematics courses must I take in order to be capable of understanding the application and theory behind quantum computing?
"
"['qiskit', 'quantum-state', 'ibm-q-experience', 'bloch-sphere', 'superposition']"," Title: How to read a Q sphere representation?Body: I'm trying to understand the Q-sphere representation of a 3-qubit system. I get that the 3-qubits are in a superposition of 2 different states. The first qubit (rightmost) is in a superposition of 0 and 1 with a phase difference of pi. And the other two qubits are in ground states. I hope I got this right till here.
What does the location of the point on the 1st ring represent? In the documentation, it's mentioned that the latitude is the Hamming distance from zero state. What does that indicate?
"
"['entanglement', 'partial-trace', 'trace']"," Title: What is the physical intuition behind taking the partial trace of a state?Body: I want to confirm my understanding of a partial trace.
Essentially, we have a system that $H_a \otimes H_b$. When we trace out system $b$, what we are doing is basically reducing the system down to as if we had just measured system $a$. Essentially, $\rho_{ab}$ gives us the probability distribution for both $a$ and $b$ and when we do $\rho_{a} = Tr_b{[H_a \otimes H_b]}$, we are just getting the probability distribution for $a$
"
"['mathematics', 'bloch-sphere']"," Title: Why did I get two solutions to solve for the parameters of this $U_3$ gate? (I only expected one of them)Body: I have the following complex vector in $\mathbb{C}^2$:
Vec= [[ 0.89741876+0.j] [-0.33540402+0.28660724j]]
I'm trying to implement a $U_3$ gate to prepare this state. The general $U_3$ gate is defined as
$$
U_3(\gamma,\beta,\delta) =
\begin{bmatrix}
\cos\left(\frac{\gamma}{2}\right) & -e^{i\delta} \sin\left(\frac{\gamma}{2}\right) \\
e^{i\beta} \sin\left(\frac{\gamma}{2}\right) & e^{i(\delta + \beta)} \cos\left(\frac{\gamma}{2}\right)
\end{bmatrix}\\
$$
To solve for the parameters, I have
$$
\cos\left(\frac{\gamma'}{2}\right) = g_0\qquad e^{i\beta'}\sin\left(\frac{\gamma'}{2}\right) = g_1
$$
Where $g_0$ is the real entry of Vec , and g_1 is the complex one. Then, I can get the solutions
$$
\gamma'=2\cos^{-1}(g_0),\qquad e^{i\beta'}=\pm\frac{g_1}{\sqrt{1-g_0^2}}\qquad\beta'=-i\log\frac{g_1}{\sqrt{1-g_0^2}}+k\pi,\ \text{where}\ k\in\mathbb{Z}$$
$\delta'$ could be any real value. With the values specified in Vec, we can find that $\gamma' = 0.913825694123124 , \beta_1'= 2.434484141132717 , \beta_2'=5.5760767947225105$ (differ by $1*\pi$).
Therefore, they are two different vectors, as could be seen on the Bloch sphere: (the blue vector corresponds to $\beta_2'$, the purple one is $\beta_1'$)
The second solution doesn't quite work as I checked the values using Mathematica, but it looks like the blue vector might also contribute to the rotation as I tried to simulate the time-evolution of some arbitrary vector. Should I keep the blue vector, or how can I get rid of it? Thanks a lot for the help!!!
"
"['algorithm', 'vqe']"," Title: What is the complexity of estimating the expectation value of an observable?Body: The average value of an operator $O$ in the state $\left.|\psi\right>$ is
$$\overline{O}=\left<\psi|O|\psi\right>$$
Now for simplicity let $\left.|\psi\right>=\left.|0\right>^n$ and assume we have a circuit that prepares $O$. How many times one has to run this circuit and measure $O$ in the computational basis to get an accurate estimation of $\overline{O}$ ?
I guess one needs to somehow describe what kind of operator $O$ is. For example, if there is a very large eigenvalue $\lambda$ of $O$ which appears with a very low probability $p$ in the state $\left.|0\right>^n$ I expect the required number of trials to depends strongly on $p$ and $\lambda$.
Initially my question arose when reading this paper which states on the first page that when $O$ is a product of single-qubit observables its average can be computed efficiently by running the quantum circuit $O$ many times and averaging the results. Then the authors go on to give efficient classical algorithms for the same task, but they do not explain what is the complexity of the quantum algorithm. It is not clear to me if it is not exponential in the number of qubits.
Another motivation for my question. Say we use the VQE (variational quantum eigensolver) to find the ground state of some Hamiltonian. The procedure is to build an ansatz quantum circuit, measure its average energy and then optimize the ansatz parameters to go towards lower energy. My problem is with the second step "measure average energy". How many times one is supposed to run the quantum circuit for to get the average energy estimation?
"
"['quantum-gate', 'textbook-and-exercises']"," Title: How can I factor Hadamard gates according to $U=e^{i\delta}R_x(\alpha)R_y(\beta)R_z(\gamma)$Body: According to the formula $U=e^{i\delta}R_x(\alpha)R_y(\beta)R_z(\gamma)$, We know that a single quantum gate can be decomposed arbitrarily, But according to the book Quantum Computation. by Nielsen, I get $H=-iR_x(\pi)R_y(\pi/2)$, It makes me wonder how can I get rid of the phase $-i$?
"
"['qiskit', 'gate-synthesis']"," Title: What is Qiskit's Transpiler method for unitary synthesis?Body: As I could found in here how the transpile works in qiskit, I understood that transpile gets arbitrary Unitary gate $U$ and some set of basis gates as input, and produce some quantum circuit of $U$ implemented with those basis gates.
So, I understood this transpile process as some sort of 'synthesis' problem that has been shown in some literature, but I can't find which synthesis method does Qiskit implemented for their transpile process. Will there be any references or docs that I can refer to?
"
"['programming', 'qiskit', 'hhl-algorithm']"," Title: Function in Qiskit to get the quantum circuitBody: Is there any way to view the quantum circuit of pre implemented quantum algorithm in Qiskit?
In the Qiskit textbook, there is an example given for HHL algorithm. Is there any function in Qiskit which lets us see the quantum circuit that was used to compute the results(probabilities) for this example?
The code for HHL example is given below:
from qiskit import Aer, transpile, assemble
from qiskit.circuit.library import QFT
from qiskit.aqua import QuantumInstance, aqua_globals
from qiskit.quantum_info import state_fidelity
from qiskit.aqua.algorithms import HHL, NumPyLSsolver
from qiskit.aqua.components.eigs import EigsQPE
from qiskit.aqua.components.reciprocals import LookupRotation
from qiskit.aqua.operators import MatrixOperator
from qiskit.aqua.components.initial_states import Custom
import numpy as np
def create_eigs(matrix, num_auxiliary, num_time_slices, negative_evals):
ne_qfts = [None, None]
if negative_evals:
num_auxiliary += 1
ne_qfts = [QFT(num_auxiliary - 1), QFT(num_auxiliary - 1).inverse()]
return EigsQPE(MatrixOperator(matrix=matrix),
QFT(num_auxiliary).inverse(),
num_time_slices=num_time_slices,
num_ancillae=num_auxiliary,
expansion_mode='suzuki',
expansion_order=2,
evo_time=None, # This is t, can set to: np.pi*3/4
negative_evals=negative_evals,
ne_qfts=ne_qfts)
def fidelity(hhl, ref):
solution_hhl_normed = hhl / np.linalg.norm(hhl)
solution_ref_normed = ref / np.linalg.norm(ref)
fidelity = state_fidelity(solution_hhl_normed, solution_ref_normed)
print("Fidelity:\t\t %f" % fidelity)
matrix = [[1, -1/3], [-1/3, 1]]
vector = [1, 0]
orig_size = len(vector)
matrix, vector, truncate_powerdim, truncate_hermitian = HHL.matrix_resize(matrix, vector)
# Initialize eigenvalue finding module
eigs = create_eigs(matrix, 3, 50, False)
num_q, num_a = eigs.get_register_sizes()
# Initialize initial state module
init_state = Custom(num_q, state_vector=vector)
# Initialize reciprocal rotation module
reci = LookupRotation(negative_evals=eigs._negative_evals, evo_time=eigs._evo_time)
algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
init_state, reci, num_q, num_a, orig_size)
result = algo.run(QuantumInstance(Aer.get_backend('statevector_simulator')))
print("Solution:\t\t", np.round(result['solution'], 5))
result_ref = NumPyLSsolver(matrix, vector).run()
print("Classical Solution:\t", np.round(result_ref['solution'], 5))
print("Probability:\t\t %f" % result['probability_result'])
fidelity(result['solution'], result_ref['solution'])
The output is
Solution: [1.13586-0.j 0.40896-0.j]
Classical Solution: [1.125 0.375]
Probability: 0.056291
Fidelity: 0.999432
"
"['programming', 'qiskit', 'phase-estimation', 'linear-algebra']"," Title: Finding Eigen Values from Quantum Phase Estimation - Using qiskitBody: I am trying to use the quantum phase estimation(EigsQPE) of qiskit to find the eigen values of a matrix.
As I am new to quantum computing so I am confused what to measure in the circuit to derive the eigen values of the input matrix.
I know how to identify phase and derive eigen value using phase derived from the most probable bit string for a single eigen value. But deriving multiple eigen values from QPE circuit is confusing. Any help will be much appreciated.
Code : https://github.com/Anand-GitH/HLL-QauntumComputing/blob/main/Qiskit-QPEStandalone.ipynb
"
"['complexity-theory', 'qma']"," Title: The complexity of LH restricted to projectorsBody: Let's denote $kLP_{c}$ the promise problem where the input, given in an explicit encoding with finite number of bits, is a set $\{p_{1},p_{2},\ldots p_{m}\}$ of k-local projectors over a n-qbits register such that the least eigenvalue $\varepsilon_{\min}$ of $\sum_{i=1}^{m}p_{i}$ is either $\varepsilon_{\min}\leq\varepsilon\tag{y}\label{eq:LHy-1}$ where $\varepsilon$ is a parameter given in input, or $\varepsilon_{\min}(n)\geq\varepsilon+n^{-c}\tag{n}\label{eq:LHn-1}$ and the answer is yes (no) in the \ref{eq:LHy-1} (\ref{eq:LHn-1}) case.
That is, the $k$LH promise problem with hamiltonians that are projectors. Is this restriction known/studied? A circuit->projectors mapping of the type used to prove QMA1-hardness of QSAT should work in mapping to kLP the generic QMA problem. Or one could maybe reduce a kLH instance to an equivalent instance of kLP. However, how would the energy gap behave?
"
"['hamiltonian-simulation', 'classical-quantum', 'nonclassicality']"," Title: Why are diagonal Hamiltonians considered classical?Body: I've been following UT QML course (http://localhost:8888/tree/UNI/PHD/UT-QML) and during their lecture on the Ising hamiltonian, they point out that the hamiltonian of an Ising model without a transverse field commutes
$$ H=-\sum_{<i,j>} J_{ij} \sigma^Z_i \sigma^Z_{j} - \sum_i h_i \sigma^Z_i.$$
and To make this a quantum Ising model, we need to add a term that does not commute with the rest of the terms. A transverse field is such, which is an on-site interaction just like the external field.
$$ H=-\sum_{<i,j>} J_{ij} \sigma^Z_i \sigma^Z_{j} - \sum_i h_i \sigma^Z_i - \sum_i g_i \sigma^X_i.$$
I am confused by the following. What do they actually mean by a commuting hamiltonian? and second, what is the relationship between a hamiltonian commuting and its 'quantumness'?
In their written assignment, the difference between a quantum and non-quantum hamiltonian is just that one is a diagonal operator and the other is not.
"
"['programming', 'qiskit', 'simulation']"," Title: How do I export the rightmost state of circuit wires (qbits and cbits) in a qiskit simulationBody: qiskit has a quantum teleportation tutorial which winds up with this simulation code:
qasm_sim = Aer.get_backend('qasm_simulator')
t_qc = transpile(qc, qasm_sim)
qobj = assemble(t_qc)
counts = qasm_sim.run(qobj).result().get_counts()
plot_histogram(counts)
The counts are for the 3 qbits in the circuit, which also has 2 cbits. It would be most helpful to get the rightmost state of the wires in this picture for each shot:
Is there a function in qiskit which will give me these wire (cbit and qbit) output states? I looked everywhere on qiskit and with Google search and I didn't find anything.
"
['shors-algorithm']," Title: Continued fractions with Shor's algorithm: which convergent?Body: Suppose I am using Shor's order finding algorithm to calculate the order $r$ of $x\leq N$ with respect to $N$. After some run of the QPE subroutine, I obtain a good, $L$-bit approximation to $s/r$ for some $s\leq r$. According to, say, Nielsen and Chuang, because my estimation $\phi$ is sufficiently close, when I do the continued-fractions algorithm (CFA) on $\phi$, one of the convergents will be exactly $s/r$.
My question is, how will we know which convergent? It certainly isn't necessarily the last convergent, since this will be equal to the binary approximation $\phi$ and not $s/r$. Is there a guess-and-check stage that goes on here and if so, does efficiently of the algorithm depend on the number of convergents being small relative to $N$?
Edit: I should mention that I am also curious why the answer is what it is. Namely, if we are able to make a specific choice of convergent, what mathematical argument allows us to do so?
"
"['entanglement', 'superdense-coding']"," Title: How do you transmit a single qubit of an entangled qubit over?Body: When we talk about superdense coding, we say that Alice and Bob share an entangled qubit and then after this, Alice transmits her qubit over to Bob after performing the necessary manipulation.
What does this mean experimentally? How do you transmit a single qubit of an entangled qubit over?
And, if I understand correctly, only when Bob has both the Alice's and his qubits of the entangled pair can he recover the Bell state that the entangled pair is in.
"
"['programming', 'mathematics', 'bloch-sphere']"," Title: Why there're two axis of rotation when I'm trying to visualize this time-evolution?Body: This is a follow-up question of the problem I posted earlier. The following diagram illustrates my question:
I'm trying to perform the time evolution of a random Hamiltonian. The green vector represents the expected axis of rotation. I prepared two initial states and I was expecting that the two traces of time evolution (blue and purple curves) should be centered around the green vector. However, on the figure, it looks like there's another vector contributing to the rotation. I'm wondering why that would happen? It seems that the invisible vector corresponds to the solution we don't want in this post. How can I fix the issue?
PS: Each point on the trace corresponds to a result of $U_3(\theta,\phi,\lambda)$ obtained from the statevector simulator (the quantum circuit only has a $U_3$ gate, or maybe an extra state-preparation gate in the front). From the given constraints, $0≤𝜃≤𝜋$, $0≤𝜙<2𝜋$, $0≤𝜆<2𝜋$. To make sure my $U_3$ arguments are valid, I tried
lambd = float(remainder(lambdt,2*pi))
phi = float(remainder(phit,2*pi))
theta =float(remainder(thetat,2*pi))
lambd = (lambd + 2*np.pi) % (2*np.pi)
phi = (phi + 2*np.pi) % (2*np.pi)
if theta > pi:
theta = 2*pi-gamma
Where deltat, betat and gammat represent the original t-dependent values (they could take any value), I'm trying to convert them to the range we desire, but the traces obtained don't quite agree with that (due to the undesired 'rings').
Thanks so much for the help:)
"
"['programming', 'qiskit']"," Title: Make a controlled gate from a QuantumCircuit that uses append in QiskitBody: Here is a minimal example for what I want to do:
from qiskit import QuantumCircuit
qc1 = QuantumCircuit(1, name='qc1')
qc1.x(0)
qc2 = QuantumCircuit(1, name='qc2')
qc2.h(0)
qc2.append(qc1, [0])
qc2.z(0)
c_qc2 = qc2.to_gate().control(1)
This gives the following error:
qiskit.exceptions.QiskitError: 'One or more instructions cannot be converted to a gate. "qc1" is not a gate instruction'
I'm aware that in this example I can get the desired controlled gate of qc2 by manually adding a control qubit to each gate in qc2. However in practice qc2 would be complex and doing so would be tiresome.
I also tried qc2.append(qc1.to_instruction(), [0]) which didn't solve the problem. Any help is appreciated. Thanks!
"
"['quantum-gate', 'quantum-state', 'algorithm']"," Title: Why would measuring a qubit determine the states of the other qubits?Body: In Quantum Algorithm Implementations for Beginners, page 7 it is stated,
Suppose we have a three qubit state, $\vert\psi\rangle$, but we only measure the first qubit and leave the other two qubits undisturbed. What is the probability of observing a $\vert 0\rangle$ in the first qubit? This probability will be given by,
$$\sum_{(x_2,x_3)\in\{0,1\}^2}\vert\langle0x_2x_3\vert\phi\rangle\vert^2.$$
The state of the system after this measurement will be obtained by normalizing the state
$$\sum_{(x_2,x_3)\in\{0,1\}^2}\langle0x_2x_3\vert\phi\rangle\vert0x_2x_3\rangle.$$
Applying this paradigm to the state in Eq. (5) we see that the probability of getting $\vert0\rangle$ in the first qubit will be 0.5, and if this result is obtained, the final state of the system would change to $\vert 000\rangle$. On the other hand, if we were to measure $\vert 1\rangle$ in the first qubit we would end up with a state $\vert 111\rangle$.
This feels wrong to me. Why would measuring the first qubit determine the states of the other two qubits? Is this an error in the paper?
"
"['programming', 'ibm-q-experience', 'experiment']"," Title: In the job tab, no histogram appearsBody: (Newbie here) Accessing IBM Q Experience on a Windows 7 operating system and using the Google Chorme browser. I can completely assemble my circuit, using the IBM Quantum Composer and when executing it goes to the area job, I hope to finish the whole process, but when I press to see the results, only what appears in the image appears, I can't go down the page for the histogram presentation, however when accessing the same Job tab via my cell phone, the histogram and the circuit that was shown appear.
[Screenshot from IBM Q Experience]
"
"['complexity-theory', 'qma']"," Title: Complexity of Quantum Satisfiability vs Local HamiltoniansBody: $k$QSAT$c$ is the promise problem where the input, given in an explicit encoding with finite number of bits, is a set $\{p_{1},p_{2},\ldots p_{m}\}$ of $k$-local projectors over a $n$-qbits register, such that the least eigenvalue $\varepsilon_{\min}$ of $\sum_{i=1}^{m}p_{i}$ is either $\varepsilon_{\min}=0\tag{y}\label{eq:QSATy-1}$ or $\varepsilon_{\min}(n)\geq n^{-c}\tag{n}\label{eq:QSATn-1}$ and the answer is yes (no) in the y (n) case.
$k$LH$c$ is the promise problem where the input, given in an explicit encoding with finite number of bits, is a set $\{h_{1},h_{2},\ldots h_{m}\}$ of $k$-local hamiltonians, with eigenvalues in $[0,1]$, over a $n$-qbits register, such that the least eigenvalue $\varepsilon_{\min}$ of $\sum_{i=1}^{m}p_{i}$ is either $\varepsilon_{\min}\leq\varepsilon\tag{y}\label{eq:LHy-1}$ where $\varepsilon$ is a parameter given in input, or $\varepsilon_{\min}(n)\geq\varepsilon+n^{-c}\tag{n}\label{eq:LHn-1}$ and the answer is yes (no) in the y (n) case.
With same constants, the QSAT problem restricts LH in two things. First, its promise gap is glued to $0$. Second, its hamiltonian terms are projectors. So I can define two new problems.
QSAT+ Same as QSAT but with general local hamiltonians with eigenvalues in $[0,1]$.
LH- Same as LH but with local projectors.
As pointed out in the answer of a previous question, the classical 5local construction clearly works for projectors, so 5LH- is QMA-hard. Then, since 5LH is in QMA, there is a polynomial reduction from 5LH to 5LH- via a quantum circuit verification for 5LH. Of course, I expect in this case way more natural reductions. However, for $k=2$, we know that 2LH is QMA-hard, and 2QSAT is in P. So what is the complexity of 2LH- and of 2QSAT+?
"
"['qiskit', 'grovers-algorithm']"," Title: Grover's algorithm for the real problem of finding the index of an array elementBody: Good day. I am interested in an IMPLEMENTED, not theoretical, example of code for solving the problem of finding the INDEX of an element in an uncorrected array using Grover's Algorithm. The task looks like this: there is an array [3,6,2,4,9,0,1,5] and it is necessary to determine the index of the element in this array, which is 9 (that is, the result should be 4). I fully understand the example of Grover's algorithm implementation here from qiskit https://qiskit.org/textbook/ch-algorithms/grover.html, but I cannot transform it to solve the real problem described above. It is desirable to present the solutions on qiskit in Python.
P.S. I have seen these links, but this all does not provide clarity for me and understanding of how to implement this task: 1, 2, 3, 4.
I would be very grateful for a detailed explanation.!
After first answer I have questions described in comments and this image :
original image link
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: How can I experimentally quantify the ""speed up"" of a quantum-enhanced machine learning?Body: I have essentially developed a Quantum Support Vector Machine to classify some data I have successfully. I wanted to know if it is possible to quantify the speed-up and time difference between this algorithm and a classical Support Vector Machine doing the exact same task. Also is it possible to somewhat estimate how this speed-up will be for larger datasets and scaling?
Thanks a lot!
"
"['density-matrix', 'nielsen-and-chuang', 'faster-than-light']"," Title: Quantum indistinguishability using density operatorsBody: There is something that bugs me concerning the use of density matrices. For instance, to argue that quantum teleportation does not spread an information faster than light, Nielsen and Chuang state the following:
Measuring in Alice's computational basis, the state of the system after the measurement is:
$|00\rangle[\alpha|0\rangle+\beta|1\rangle]$ with probability $\frac14$
[...]
$|11\rangle[\alpha|1\rangle-\beta|0\rangle]$ with probability $\frac14$
They then proceed to compute $\rho^{AB}$ and trace out Alice's system to find $\rho^B=\frac12I$, indicating that Bob has no information whatsoever on the state until Alice gives him the results she got with her measurement.
I struggle to understand how to compute the density matrix here, or more exactly why "the system is in state x with probability y" allows to compute it. Once Alice measures the state, she knows the state Bob's system is in. I reckon that Bob doesn't, but what about the following scenario?
Let us call the previous Alice and Bob Alice1 and Bob1 and the following ones Alice2 and Bob2.
Alice2 prepares a $n$-qubit basis state $|x\rangle$. She sends this register to Bob2, who measures it (to learn $|x\rangle$ with probability 1 since $|x\rangle$ is a basis state) creates a $n$-qubit basis state $|h\rangle$ chosen uniformly at random, CNOTs it with Alice2's register and sends back to Alice2 her register, without telling her what $|h\rangle$ is. Hence, Bob2 knows that the total system is in state $|x\oplus h\rangle|h\rangle$. In particular, these registers being not entangled, Bob2 knows exactly the state Alice2's system is in, just like Alice1 knew Bob1's state. However, from the point of view of Alice2, the system can be in any basis state with uniform probability. Hence (this is where, I think, the error is), her density matrix is identical to the state of a uniform superposition of basis states, that is:
$$\rho^{A_2}=\sum_i|i\rangle\langle i|$$.
There are now two contradictory things that come to my mind:
- Since Alice2's density matrix is the same as if she created the state $\mathbf{H}|0\rangle$, applying $\mathbf{H}$ and measure should return $|0\rangle$ with probability 1. However, Bob2 knows that it will give $|0\rangle$ with probability $2^{-n}$. Hence, it is high likely that Alice won't obtain what she expects, leading to an inconsistency.
- When carrying out the computation, here's what I got. We have (up to a normalisation constant):
$$\mathbf{H}=\sum_{a,b}(-1)^{a\cdot b}|a\rangle\langle b|\,.$$
Hence, after having applied $\mathbf{H}$, the density matrix becomes:
$$\mathbf{H}\rho^{A_2}\mathbf{H}^\dagger=\sum_{a,b,x,y,i}(-1)^{a\cdot b}(-1)^{x\cdot y}|a\rangle\langle b|i\rangle\langle i|x\rangle\langle y|$$
which can be reduced to:
$$\mathbf{H}\rho^{A_2}\mathbf{H}^\dagger=\sum_{a,y,i}(-1)^{(a\oplus y)\cdot i}|a\rangle\langle y|$$
which can be reduced to:
$$\mathbf{H}\rho^{A_2}\mathbf{H}^\dagger=\sum_{a}|a\rangle\langle a|\,.$$
hence Alice, will measure $|0\rangle$ with probability $2^{-n}$ which is consistent with Bob's point of view. However, this raises the inverse problem: why, if the density matrix is equal to the one of $\mathbf{H}|0\rangle$, don't we get $\mathbf{H}\rho^{A_2}\,\mathbf{H}^\dagger=|0\rangle\langle0|$? (This question also applies generally, since, I think, I started with the density matrix corresponding to $\mathbf{H}|0\rangle$, I expected the result to be $|0\rangle\langle0|$)
I think these inconsistencies comes from a misunderstanding of mine at some point of the density matrix properties, but I can't see at which point is my reasoning flawed (though I have a guess, see in the text).
"
"['programming', 'qiskit', 'mathematics', 'bloch-sphere']"," Title: How the arguments of $U_3$ gate are converted when they're not lying in the expected range?Body: From the qiskit documentation (here), a general form of a single qubit unitary 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}.
$$
Where $0≤𝜃≤𝜋, 0≤𝜙<2𝜋, \text{and} \ 0≤𝜆<2𝜋$. However, when I tried to put some arguments out of the range, the gate still operates. For example, if I set $\theta = -1,\phi=8,\lambda=7$,
simulator = Aer.get_backend('statevector_simulator')
quancir = QuantumCircuit(1)
quancir.u3(-1,8,7,0)
results = execute(quancir, simulator).result()
resvec = results.get_statevector(quancir)
bloch_sphere([conv(resvec)])
I can still visualize how the $U_3$ gate operates on the initial state $|0\rangle$, and plot the final vector:
I'm wondering if my arguments aren't in the expected range, like in this case, what really happened to the $U_3$ gate? Am I still getting the vector I want, or do I need to convert the arguments myself to make sure the output vector is correct? Thanks:)
Update: I tried to take the mod of those parameters but it looks like the output vector is different (points toward the opposite direction):
quancir = QuantumCircuit(1)
T = float(-1%pi)
P = float(8%(2*pi))
L = float(7%(2*pi))
quancir.u3(T,P,L,0)
results = execute(quancir, simulator).result()
resvec = results.get_statevector(quancir)
bloch_sphere([conv(resvec)])
"
"['circuit-construction', 'quantum-operation', 'exponentiation', 'arithmetic']"," Title: Computing $e^x$ on a quantum computerBody: Does anyone know how to make a quantum circuit to compute exponentials where the exponent can be a fraction? To be more precise, I'm looking for a fixed point quantum arithmetic circuit that does the following:
$$|\vec{x}\rangle|\vec{0}\rangle \rightarrow |\vec{x}\rangle|e^x\rangle$$
where $|\vec{x}\rangle = |x_2x_1x_0x_{-1}x_{-2}\rangle$ is a $5$ qubit register, $|\vec{0}\rangle$ is an $n$ qubit register and where $x$ represents the binary number
$$x = x_2\times 2^2 + x_1\times 2^1 + x_0\times 2^0+x_{-1}\times 2^{-1}+ x_{-2}\times 2^{-2}$$
and where $|e^x\rangle$ holds the fixed point representation of $e^x$ to within an error of $\epsilon$ (therefore the value of $n$ will be chosen based on the value of the desired $\epsilon$)
"
"['quantum-fourier-transform', 'tensor-product', 'superposition', 'simons-algorithm', 'hidden-subgroup-problem']"," Title: In the hidden subgroup problem for finite Abelian groups, where does the state $\frac{1}{\sqrt{|G|}}\sum_{g\in G} |g,0\rangle$ come from?Body: I am new to the concept of HSP. Previously, I saw how to solve hidden subgroup problem over $\mathbb{Z}_2^n$, which was Simon's algorithm. Over there the first step was to apply $H^{\otimes n}$, which was indeed the Fourier transform over $\mathbb{Z}_2^n$.
Now for any general finite abelian group, the course notes I have been following and in many other materials, the starting step is given as to form equal superposition over all the basis vectors i.e.,
$$\frac{1}{\sqrt{|G|}}\sum_{g\in G} |
g,0\rangle$$
Here $G$ is the finite abelian group. The pair of register contains $|0,0\rangle$ at the beginning where the first register $|0\rangle$ means log$(|G|)$ qubits(Why?).
In case of Hadamard in Simon's algorithm it was easy to see this step, but in this case can anyone show me how do we get here? We have to apply Fourier transform I know, but the whole steps I am not getting.
"
"['quantum-fourier-transform', 'stabilizer-code', 'qudit']"," Title: Canonical construction of Logical Fourier GateBody: For physical $d$-dimensional qudits we can define
$$X= \sum_{i=0}^{d-1} |i+1\rangle \langle i |$$
and
$$Z = \sum_{i=0}^{d-1} \omega^i |i\rangle \langle i |,$$
with $\omega=e^{2\pi i/d}$. The Fourier gate
$$F=\frac{1}{\sqrt{d}} \sum_{i,j=0}^{d-1} \omega^{ij} |i\rangle \langle j|$$
transforms one basis into the other, i.e. $F X F^\dagger = Z$.
Now consider a stabilizer error correction code. One can choose the logical $Z_L$ operator such that it commutes with all stabilizer generators, and one can choose $X_L$ such that it commutes with the stabilizer generators plus it fulfills $Z_L X_L = \omega X_L Z_L$. That should fix our logical qudit space. Now we can choose any operator that maps $X_L$ to $Z_L$ as our $F_L$, but is there any canonical way to construct it? I was hoping that there is some compact formula for $F_L$ in terms of $Z_L$ and $X_L$, but I couldn't find it.
To be clear, I am not asking for a decomposition of $F_L$ in terms of a circuit (even though that is interesting as well), but I am "only" looking for a canonical way to construct the unitary operator itself.
"
"['programming', 'qiskit']"," Title: Incorrect rendering of a circuit by draw methodBody: Executing
from qiskit import *
circuit = qiskit.QuantumCircuit(3, 3)
circuit.draw(output="mpl")
in ipython notebook gives the following image
Which looks incomplete. It does not render two other classical registers and also appears to be incorrectly padded. Is my output image really incorrect? How can I fix that?
"
"['qiskit', 'quantum-gate', 'teleportation']"," Title: In quantum teleportation, Is it possible for bob to just see the state vector after receiving it from Alice without measuring it?Body: I was reading about quantum teleportation using Qiskit. Alice wants to teleport some quantum state to Bob. My question is Is it possible for bob just to see the state vector after receiving it from Alice without measuring it?
"
"['programming', 'ibm-q-experience']"," Title: Please help interpret the IBM Quantum error code: ""Instruction bfunc is not supported [7001]""Body: I have already run the circuit on the IBM Quantum simulators successfully. But, when I ran the same circuit on the real quantum device ibmq_16_melbourne, I got the error. The IBM website does have the 7001 code definition, but it is not specific enough to indicate what the bfunc means.
Could you please help interpret the code? More important, how can I avoid that to have a successful run?
Thanks.
"
"['quantum-operation', 'density-matrix', 'projection-operator']"," Title: Analyzing the composition of a channel with its adjoint in relation with an identical composition obtained for the channel's complementBody: Let us consider two quantum channels $\Phi:M_d\rightarrow M_{d_1}$ and $\Phi_c:M_d\rightarrow M_{d_2}$ that are complementary to each other, i.e., there exists an isometry $V:\mathbb{C}^d\rightarrow \mathbb{C}^{d_1}\otimes \mathbb{C}^{d_2}$ such that
$$\forall X\in M_d: \quad \Phi(X) = \text{Tr}_2 (VXV^\dagger) \quad\text{and}\quad \Phi_c(X) = \text{Tr}_1 (VXV^\dagger).$$
We define the adjoints $\Phi^*: M_{d_1}\rightarrow M_{d}$ and $\Phi_c^*:M_{d_2}\rightarrow M_d$ of these channels uniquely by the following relations: $\forall X\in M_d,\, \forall Y\in M_{d_1},\, \forall Z\in M_{d_2}:$
$$ \text{Tr}[\Phi(X)Y]=\text{Tr}[X\Phi^*(Y)] \quad\text{and}\quad \text{Tr}[\Phi_c(X)Z]=\text{Tr}[X\Phi_c^*(Z)].$$
It is well-known that the adjoints of quantum channels are unital (i.e., they map the identity matrix to the identity matrix) and completely positive. I am interested in the following composed maps:
$$\Phi^*\circ\Phi: M_d\rightarrow M_d \quad\text{and}\quad \Phi_c^*\circ\Phi_c: M_d\rightarrow M_d,$$ which are again guaranteed to be completely positive (notice that these maps are neither trace-preserving nor unital in general). If people have looked at these kinds of compositions before, I would love to get hold of a reference.
In particular, I want to study the supports (or ranges) of the images of quantum states under the above maps. If the channel $\Phi$ is also completely copositive, i.e. $\Phi\circ T$ is again a quantum channel and hence $T\circ \Phi^*$ is again unital and completely positive (where $T:M_d\rightarrow M_d$ is the transpose map), I claim that for all pure states $\psi\psi^*\in M_d$, the following inclusion holds
$$ \text{supp}\,\, [\Phi_c^* \circ \Phi_c](\psi\psi^*) \subseteq \text{supp}\,\, [\Phi^* \circ \Phi](\psi\psi^*).$$
Any help in proving/disproving the above claim would be greatly appreciated. Thanks!
Cross posted on math.SE
"
"['programming', 'qiskit', 'quantum-gate']"," Title: How fast is qiskit to_gate() method, which is used to convert circuit to gate?Body: I have prepared a quantum circuit, which is using 13 qubits. Now, I am converting this circuit to gate but it is taking around avg. 35s for conversion. It would have have been fine, if I require only one such converison. But, I need to convert 30 such circuits. Why it is taking such amount of time? Is having 13 qubits have something to do with it? My code:
import networkx as nx
import math
i_zero=[1,0]
i_one=[0,1]
#-----------Initiating the Graph---------------#
G=nx.karate_club_graph()
a=nx.to_numpy_array(G)
c_nodes= len(list(G.nodes))
c_edges=len(G.edges())
#-----------Making the Edge List---------------#
edge_list_tmp=list(G.edges())
edge_list=[]
for i in range(0,c_edges):
v_tmp=edge_list_tmp[i]
li_tmp=[edge_list_tmp[i][0],edge_list_tmp[i][1],False,'coin_state']
edge_list.append(li_tmp)
#-----------Calculating the Qubits Required---------------#
c_pq=math.ceil(math.log2(c_nodes))+1
c_aq=c_pq-1
li_temp=sorted(G.degree, key=lambda x: x[1], reverse=True)
h_deg=li_temp[0][1]
c_cq=math.ceil(math.log2(h_deg))
#----------Making position Transition circuit-------------#
qc_l3=[]
rep_string="{0:0"+str(c_pq-1)+"b}"
for i in range(0,len(edge_list)):
v1=rep_string.format(edge_list[i][0])
v2=rep_string.format(edge_list[i][1])
name=" Transition: "+str(edge_list[i][0])+'->'+str(edge_list[i][1])
qc_temp=QuantumCircuit(c_pq,name=name)
for i in range(0,len(v1)):
if(v1[i]!=v2[i]):
qc_temp.x(c_pq-i-2)
qc_temp.x(6)
qc_l3.append(qc_temp)
#-----------Assigning coin states to each edge------------#
coin_edge={}
curr_v=edge_list[0][0]
rep_string="{0:0"+str(c_cq)+"b}"
for i in range(0,len(edge_list)):
for j in range(0,int(math.pow(2,c_cq))-1):
if not(edge_list[i][2]):
if (edge_list[i][0],rep_string.format(j)) not in coin_edge:
edge_list[i][2]=True
edge_list[i][3]=rep_string.format(j)
coin_edge[(edge_list[i][0],rep_string.format(j))]=1
coin_edge[(edge_list[i][1],rep_string.format(j))]=1
#------Assigning Transition circuit to position states-----#
coin_states={}
rep_string="{0:0"+str(c_cq)+"b}"
for i in range(0,int(math.pow(2,c_cq))-1):
coin_states[rep_string.format(i)]=[]
for i in range(0,len(edge_list)):
coin_states[edge_list[i][3]].append(i)
rep_string="{0:0"+str(c_pq-1)+"b}"
qc_l2=[]
gate_apply=[]
for i in range(c_pq,c_pq+c_aq):
gate_apply.append(i)
for i in range(0,c_pq):
gate_apply.append(i)
for coin_value,circs in coin_states.items():
if len(circs)==0:
continue
for i in circs:
qc_temp=QuantumCircuit(c_pq+c_aq,name='Transition circuit: Coin state '+str(int(coin_value)))
for j in range(0,c_pq-1):
qc_temp.cx(j,c_pq+j)
v1=rep_string.format(edge_list[i][0])
v1=v1[::-1] #string reverse
for i in range(0,len(v1)):
if(v1[i]=='0'):
qc_temp.x(c_pq+i)
gate_tmp=qc_l3[i].to_gate().control(c_aq)
qc_temp.append(gate_tmp,gate_apply)
for i in range(0,len(v1)):
if(v1[i]=='0'):
qc_temp.x(c_pq+i)
v2=rep_string.format(edge_list[i][1])
v2=v2[::-1]
for i in range(0,len(v2)):
if(v2[i]=='0'):
qc_temp.x(c_pq+i)
qc_temp.cx(c_pq-1,c_pq)
gate_tmp=qc_l3[i].to_gate().control(c_aq)
qc_temp.append(gate_tmp,gate_apply)
qc_l2.append([coin_value,qc_temp])
#-----------------Making Final Circuit with Coin assigned to each transition---------------->
qc_l3=QuantumCircuit(c_pq+c_aq+c_cq,c_pq-1)
gate_apply=[]
for i in range(c_pq+c_aq,c_pq+c_aq+c_cq):
qc_l3.h(i)
gate_apply.append(i)
for i in range(0,c_pq+c_aq):
gate_apply.append(i)
for cc in qc_l2: #cc=coin_circuit
coin_value=cc[0]
print('ok')
coin_value=coin_value[::-1]
circ=cc[1]
gate_tmp=circ.to_gate().control(c_cq)
for j in range(c_pq,c_pq+c_aq):
qc_temp.initialize(i_zero,j)
for i in range(0,len(coin_value)):
if(coin_value[i]=='0'):
qc_l3.x(c_pq+c_aq+i)
qc_l3.append(gate_tmp,gate_apply)
for i in range(0,len(coin_value)):
if(coin_value[i]=='0'):
qc_l3.x(c_pq+c_aq+i)
qc_l3.draw('mpl')
```
"
"['programming', 'qiskit']"," Title: Need Help in QGAN function to load higher dimensional dataBody: I have a query that I am using qiskit.aqua.algorithms.QGAN library and using the qgan function and I am having difficulty in loading data of dimension 1000 rows x 10 columns. I am following qiskit's github tutorial for qgan learning and loading, however I did tested out that the tutorial was with 1000 rows and 1 column and is working fine. It did works till 2 columns but for more than 2 columns the function returns error.
I don't understand if the same dataset is of 1 or 2 column it works but as soon as the data is reshaped to 3 or more columns, it returns this error:
AttributeError Traceback (most recent call last)
<ipython-input-36-1df19589f511> in <module>
6
7 # Initialize qGAN
----> 8 qgan = QGAN(real_data, bounds, num_qubits, batch_size, num_epochs, snapshot_dir=None)
9 qgan.seed = 1
D:\Users\Bro\anaconda3\lib\site-packages\qiskit\aqua\algorithms\distribution_learners\qgan.py in __init__(self, data, bounds, num_qubits, batch_size, num_epochs, seed, discriminator, generator, tol_rel_ent, snapshot_dir, quantum_instance)
126 self._num_qubits = np.array([3])
127 self._data, self._data_grid, self._grid_elements, self._prob_data = \
--> 128 discretize_and_truncate(self._data, self._bounds, self._num_qubits,
129 return_data_grid_elements=True,
130 return_prob=True, prob_non_zero=True)
D:\Users\Bro\anaconda3\lib\site-packages\qiskit\aqua\utils\dataset_helper.py in discretize_and_truncate(data, bounds, num_qubits, return_data_grid_elements, return_prob, prob_non_zero)
214 for grid_element in grid_elements:
215 for element_current in elements_current_dim:
--> 216 temp.append(deepcopy(grid_element).append(element_current))
217 grid_elements = deepcopy(temp)
218 data_grid.append(elements_current_dim)
AttributeError: 'NoneType' object has no attribute 'append'
Any solution for the same?? PS:- I am trying to load even bigger dimensional dataset so please help in this.
"
"['quantum-state', 'partial-trace']"," Title: Is there a characterization for the set of states with given marginals?Body: Let $\rho_A,\rho_B$ be two states. Is there any way to characterise the set of bipartite states $\rho$ such that $\mathrm{Tr}_B(\rho)=\rho_A$ and $\mathrm{Tr}_A(\rho)=\rho_B$?
If I assume $\rho$ to be pure, then this is possible iff $\rho_A$ and $\rho_B$ have the same spectrum, and then $\rho=|\psi\rangle\!\langle\psi|$ for any $|\psi\rangle$ of the form
$$|\psi\rangle = \sum_k \sqrt{\lambda_k} (|\lambda_k^A\rangle\otimes|\lambda_k^B\rangle),$$
where $\rho_A|\lambda_k^A\rangle=\lambda_k|\lambda_k^A\rangle$
and $\rho_B|\lambda_k^B\rangle=\lambda_k|\lambda_k^B\rangle$.
The freedom in choosing $|\psi\rangle$ is the same freedom we have in choosing the eigendecomposition of the marginals: in degenerate eigenspaces any orthonormal basis can be chosen.
On the other extreme, if $\rho$ has maximal entropy, then it is bound to be $\rho=I/d^2$ with $d$ dimension of each space, and the condition is satisfied if and only if $\rho_A=\rho_B=I/d$.
Is there anything similar that can be said for the more general case? Either as a general statement without making any assumption on $\rho$, or as a way to classify the possible $\rho$ with fixed entropy and marginals.
Some related questions are What is the most general quantum operation that preserves the marginal? and Constructing a state with constraints on reduced states. The latter is very similar, although it approaches the problem from a different, more numerical, perspective, and it focuses on finding some solution, rather than characterising the set of possible solutions.
"
"['simulation', 'q#', 'entropy', 'stabilizer-state', 'stim']"," Title: Measuring entanglement entropy using a stabilizer circuit simulatorBody: I'm trying to simulate stabilizer circuits using the Clifford tableau formalism that lets you scale up to hundreds of qubits. What I want to do is find the entanglement entropy on by splitting my quantum state (defined as a line of $N$ qubits) at the end of my quantum circuit after applying gates and some measurements. From this paper, the authors calculate the entanglement entropy for a state defined by its stabilizers. In particular, I'm looking at Equations 10 (this is their "clipped gauge"), A16 and A17. If $\mathcal{S}$ is the set of stabilizers for the state, then the entropy is given by (Equation A16):
$$S = |A| - \log_2 |\mathcal{S}_A|,$$
where $|A|$ is the size of the bipartition of the quantum state and $\mathcal{S}_A$ is the part of $\mathcal{S}$ which acts on $\bar{A}$ with the identity.
I want to simulate my quantum circuit and calculate the entanglement entropy like they do in their paper, but I'm not sure what's the easiest way to do so. A lot of the tools for simulating stabilizer circuits aren't the most transparent to use. In particular, I'm trying to understand how to go from the tableau representation a lot of simulators output and the set of generators I need to calculate the entropy.
Is there a simple procedure to go from the tableau representation to the entropy? I'm trying to think of how to implement this in code.
For the actual simulator, I see there are a few options. I need measurements, so while Qiskit does offer Clifford simulation, I can't seem to do measurements with it. The others that offer a Python interface are:
If anyone has experience with these and can explain how to go from the tableau representation to the calculation of the entropy, that would be great, since these simulators usually seem to be for giving shots in the computational basis.
"
"['hamiltonian-simulation', 'quantum-advantage']"," Title: Has any analogue quantum simulator showed quantum advantage yet?Body: Quantum advantage/supremacy was achieved by Google using a quantum computer and more recently by Pan Jianwei's group using photons. So I was wondering, has any analog quantum simulator showed quantum advantage yet?
If yes, which one? And if not, what are the biggest hurdles?
If I'm not mistaken, current quantum simulators are in the range of hundreds of qubits, and thus they are already big enough to be difficult to simulate classically. Furthermore, even though they cannot perform universal computation, they are well suited to perform Hamiltonian simulation, at least for certain Hamiltonians.
Are these devices capable of simulating classically intractable Hamiltonians? If not, are they expected to be capable soon?
"
"['programming', 'algorithm', 'classical-computing']"," Title: What's the difference between open-source QRNG and Quantis Device?Body: qRNG is an open-source quantum random number generator written in python and Quantis RNG is a physical quantum random number generator. Both are capable of generating quantum random numbers, but how do they differ?
"
['ibm-q-experience']," Title: IBM Quantum ""Jobs"" web page problem: ""Tags"" always missingBody: I tried to edit the tags and saved them, but the "Jobs" page displays empty tags always. Is that a bug? Did I do it incorrectly?
"
"['qiskit', 'ibm-q-experience']"," Title: What is the minimal delay between gates on IBM devices?Body: Suppose I create the very simple circuit
OPENQASM 2.0;
include "qelib1.inc";
qreg q[1];
x q[0];
barrier q[0];
x q[0];
and submit it to an IBM backend. How do I find the buffer time between the end of the first X and the beginning of the second X for a given backend? I've seen the number ~10 ns thrown around in the literature (see this paper above Fig. 1), but this value is not displayed in the calibration data for a device.
Just for clarify, I am NOT referring to the duration of X but the duration of time between the X pulses even "when it appears to be 0."
If there's a way to obtain it via Qiskit on a per-calibration basis, that's even better, but just a reference which verifies that 10 ns is a reasonable value would suffice.
"
"['universal-gates', 'tomography']"," Title: How to know if your gate set is ""complete""Body: In Daniel Greenbaum's paper, "Introduction to Gate Set Tomography", in page 20, he claims the gate sets $G = \{\{\}, X_{\pi/2}, Y_{\pi/2}\}$ and $G' = \{ \{\}, X_{\pi/2}, Y_{\pi/2}, X_{\pi}\}$ with $F_k \in G$, $F_k |\rho\rangle\rangle$ are able to "span the bloch sphere". He clarifies this with, measurements $\langle\langle E | F_k |\rho \rangle \rangle$ spans the Bloch sphere. Certainly, $G$and $G'$ cannot "hit" every element in $\mathcal{H}^2$. Taking $\{\langle\langle E_k |\} = \{|x\rangle\langle x|, x \in \{0, 1\}^n\}$, does "span the bloch sphere", just mean you are able to "hit" all states in $\{\langle\langle E_k |\}$.
In general how do you determine if a gate set has this property? Are there other measurement bases that are ever used? What does a complete set of gates look like for 2 qubits? What are some other examples of "spanning" gate sets on 1 qubit? What happens with the CNOT gate? It doesn't seem to be addressed in any literature I've seen implementing GST.
"
"['algorithm', 'vqe', 'speedup', 'quantum-advantage']"," Title: What is the main advantage of using the Variational Quantum Eigensolver over a classical algorithm?Body: What is the main advantage of using the Variational Quantum Eigensolver (quantum computing) over a classical algorithm? I know a key fact is the speed-up, but how is this speed-up quantised.
"
"['programming', 'qiskit', 'quantum-state', 'ibm-q-experience', 'bloch-sphere']"," Title: Bloch Sphere of Qiskit logoBody: Trying to plot the Bloch Sphere of the IBM Qiskit logo
from qiskit import execute, Aer, IBMQ, QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_state_qsphere, plot_bloch_multivector
%matplotlib inline
# no. of qubits
n = 4
# create circuit
qc = QuantumCircuit(n)
# apply hadamard
qc.h(0)
# apply cnot
for i in range(n-1):
qc.cx(0, i+1)
# apply not on q1
qc.x(1)
# get state vector
sv = Statevector.from_instruction(qc).data
# plots
plot_state_qsphere(sv)
plot_bloch_multivector(sv)
Why the Bloch Sphere does not have any state representations?
Circuit link
"
"['algorithm', 'qaoa']"," Title: Why do we seek to maximise $F_{p}(\gamma, \beta)=\langle\gamma, \beta|H_{C}| \gamma, \beta\rangle$?Body: The question is simple: why do we seek to maximise $F_{p}(\gamma, \boldsymbol{\beta})=\langle\gamma, \boldsymbol{\beta}|H_{C}| \gamma, \boldsymbol{\beta}\rangle$? How does maximising this value correspond to finding the groundstate value of $H_{C}$ ? Why does this optimum value of $H_{C}$ correspond to a set of $ \gamma, \boldsymbol{\beta} $ that maximise our chances of getting the optimum solution?
We try to minimise the value of $\langle \gamma,\beta|H_{C}| \gamma, \beta\rangle$ as this gives us the groundstate, as pointed out in this answer.
The Fahri paper says we seek to maximise this value. Other sources try to minimise it: are these just equivalent attempts with a minus sign stuck in front?
I know that when we encode the problem Hamiltonian, we do this in way that the groundstate corresponds to the optimum solution. Why then has it been found that the set of $ \gamma,\beta $ that give the best probability of success don't always correspond to the max value of $H_{c}$ ?
The image is taken from https://arxiv.org/abs/1907.02359.
"
"['qiskit', 'programming', 'machine-learning', 'quantum-enhanced-machine-learning', 'kernel-methods']"," Title: Quantum SVM with large feature setBody: I am trying to practice QSVM from the following tutorial
Introduction into Quantum Support Vector Machines
The author has used 2 feature_dimension with 2 component PCA
feature_dimension =2
Now my question is, why?
Is it because of the limitation of the number of qubits?
When I tried to increase both to 3 the testing success ratio decreased to 0.45
How can I use more feature sets
"
['bloch-sphere']," Title: time evolution around a 'reflective axis'Body: Here's a diagram illustrates my question:
The pink and purple vectors are 'reflective' (just like a light ray hitting a surface, though the direction is not the same case). Two grey vectors are some initial states I prepared. My question is if the operator of time evolution around the pink vector is $U_3(\theta,\phi,\lambda)$, how can I represent the $U_3$ which simulates the time evolution around the purple vector? To prepare general pair of 'reflective vectors', like in this case, the operators could be represented as $U_3'(a,b,c)$ and $U_3'(-a,b,c)$ (starting from the initial state $|0\rangle$), however, I'm wondering how are the two $U_3$ gates related? Thanks!!
"
"['ibm-q-experience', 'shors-algorithm']"," Title: What is the largest number factored by the IBM Quantum simulators?Body: Though a lot of papers talk about the largest factored number by Shor's Algorithm, I want to know the largest one factored by the IBM Quantum, for example, the simulator_mps. I am able to use it to factor 143, but fail at 323.
The simulator does offer 100 qubits, and I use only 38 of them. The trouble is that the execution will time out always.
My circuit has about 1 million gates, 600,000 of which are CNOT gates.
Could you please set my expectation straight? What is the biggest circuit you have ever run successfully?
I understand the classical computers may never be able to simulate 100 qubits. It is easy to understand why IBM focuses on increasing the qubits of the real quantum hardware. But, it is unclear to me why they would offer 100 simulated qubits without backing them up with massive classical parallel computing.
According to the roadmap of IBM and this article, the year 2023 will be a critical year:
If IBM can meet the 1,121-qubit goal in the next three years, the
company says it is confident it will make its 2030 deadline for a 1
million-qubit machine.
One million physical qubits could produce 1,000 logical qubits.
This study shows:
... technological change is exponential, contrary to the common-sense
'intuitive linear' view.
So, I'd like to know how well the state-of-the-art IBM quantum computers/simulators are doing. That may help understand the future trends.
"
"['quantum-gate', 'mathematics']"," Title: Math behind Rz GateBody: After reading some books I'm very confused about one question. For example in Nielsen and Chuang chapter 4.2 the universal gate U could be used to construct the Rz gate, which means a turn around the z-axis.
They also describe the special T-gate, which gives me the same question.
I found this equation here:
$$\begin{bmatrix} e^{i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{bmatrix}\begin{bmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & e^{i\theta} \end{bmatrix}$$
Why is this equation is true? Why I need to do this math, if a Rz Operation is still a turn around z?
"
"['qiskit', 'universal-gates']"," Title: From logical universal gate set to physical one, QiskitBody: Among the several universal gate sets, the Clifford$+T$ set seems the most important one (since it should provide fault-tolerant computing).
However, that set is logical and it differs from physical implementations, e.g. IBM processors use the gate set $\{CNOT, I, R_z, \sqrt{X}, X\}$.
Hence, my question is: how does the Qiskit framework handle the switch from a gate set, such as the Clifford$+T$, to the real one?
At this link there's an interesting possible answer. But I'd like to get a deeper understanding of the criteria Qiskit applies.
EDIT:
I'd like to input to the Qiskit transpile method a simple circuit performing a control S gate:
qc = QuantumCircuit(2)
cs = SGate().control()
qc.append(cs, [0,1])
with basis gate set $\{H, S, T, CNOT\}$, i.e.:
new_qc = transpile(qc, basis_gates=['h','s','t',cx'])
However, the method cannot complete the task.
"
['density-matrix']," Title: Purification applied to indistinguishabilityBody: In Zhandry's compressed oracle paper, one can read the following:
Next, we note that the oracle $h$ being chosen at random is equivalent (from the adversary’s point of view) to $h$ being in uniform superposition $\sum_h|h\rangle$. Indeed, the superposition can be reduced to a random $h$ by measuring, and measuring the $h$ registers (which is outside of $A$’s view) is undetectable to $A$. To put another way, the superposition over $h$ is a purification of the adversary’s mixed state.
Though it appears to be intuitive, I can't manage to prove this formally using density matrices.
Let us first consider an oracle that samples at random a function $h:\{0\,;\,1\}^m\to\{0\,;\,1\}^n$ and uses a register with $n\,2^m$ qubits, which can be decomposed in $2^m$ $n$-qubit registers, where the $i$-th register (indexing from 0) represents the value of $h(i)$. We consider three registers, namely the two adversary's registers $X$ and $Y$ and the oracle's register $F$. We define the unitary $\mathcal{O}$ to act on the basis states as follow:
$$\mathcal{O}\left(|x,y\rangle\otimes|h\rangle\right)=|x,y\oplus h_x\rangle\otimes|h\rangle$$
with $h_x$ being the value stored in $F$'s $x$-th sub-register.
The goal is to show that, from the adversary's point of view, initialising $F$ with a uniformly sampled function $h$ or with a uniform superposition $\sum_h|h\rangle$ is equivalent.
Carrying out the computations and tracing out the oracle's registers, in the first case ($h$ is sampled once and for all) the system density matrix associated to the adversary's registers is:
$$\rho^A_1 = \sum_{i,j,k,l}\rho_{i,j,k,l}\,|i,j\oplus h_i\rangle\,\langle k,l\oplus h_k|$$
while in the second case ($F$ is initialised with $\sum_h|h\rangle$), we get:
$$\rho^A_2 = \frac{1}{2^{2\,n}}\,\sum_{i,j,k,l}\sum_{h_i, h_k}\rho_{i,j,k,l}\,|i,j\oplus h_i\rangle\,\langle k, l\oplus h_k|$$
which is very similar to $\rho^A_1$.
If we compute the probability of measuring $|x,y\rangle$, we get for the first case:
$$\rho_{x,y\oplus h_x,x,y\oplus h_x}$$
which is the probability given $h$. By summing over the $h$, we find the same probability as the one in the second case, that is:
$$\frac{1}{2^n}\,\sum_{h_x}\rho_{x,y\oplus h_x,x,y\oplus h_x}\,.$$
My questions are:
- We are forced to use probability theory after having performed the measurement in the first case to find the same probability as in the second case. Since the density matrix contains all the statistical information about the system's state, shouldn't we be able to say these cases are indistinguishable just by looking at the density matrices? How can/should I bring the uncertainty over $h$ into the density matrix?
- That's closely related to 1., but since the density matrices are different, are we sure that the adversary can't tell the difference by simply computing the probability once $\mathcal{O}$ has been applied? Shouldn't we consider that the adversary may apply an arbitrary unitary $\mathbf{U}$ on their state to help them distinguish between the cases? I guess it would work, but ocne again, can't we do it directly with the density matrices?
- How can Zhandry's justification can be translated into the density matrix formalism? Why is the fact that the state is now pure a reason to tell that the adversary can't tell the difference between both cases?
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'bloch-sphere']"," Title: Question regarding bloch vector solutions for master equation on page 388 of N&CBody: On page 388 of N&C, you are asked to find the solution to a differential equation for a two-level atom coupled to a vacuum. However, I have no experience with differential equations, so I am having some difficulty seeing where they get their solutions from. After moving to the interaction picture, I get $$\frac{d\tilde{\rho}}{dt}=\gamma[2\sigma_{-}\tilde{\rho}\sigma_{+}-\sigma_{+}\sigma_{-}\tilde{\rho}-\tilde{\rho}\sigma_{+}\sigma_{-}]$$I get as far as the following after changing $\tilde{\rho}$ to is bloch vector representation:
$$\frac{d\tilde{\rho}}{dt}=\gamma\begin{bmatrix}1-z & \frac{x-iy}{2}\\\frac{x+iy}{2} & -1+z\end{bmatrix}$$
It then asks you to solve the three differential equations associated with the bloch vectors.
I get $$\frac{dx}{dt}=\gamma\lambda_{x}\sigma_{x}$$ $$\frac{dy}{dt}=\gamma\lambda_{y}\sigma_{y}$$ $$\frac{dz}{dt}=\gamma(2 -2\lambda_{z})\sigma_{z}$$
However, the answers given are $$\lambda_{x}=\lambda_{x}(0)e^{-\gamma t}$$ $$\lambda_{y}=\lambda_{y}(0)e^{-\gamma t}$$ $$\lambda_{z}=\lambda_{z}(0)e^{-2\gamma t}+1-e^{-2 \gamma t}$$.
I know using $$\frac{dx}{dt}=Ax(t)\to x=x(0)e^{At}$$
However, A disappears from there exponentials and I am unsure how they arrived at the answer they give for $\lambda_{z}$
"
"['programming', 'qiskit']"," Title: Error ""too many subscripts in einsum"", UnitaryGate()Body: I'd like to build a multi qubit controlled gate in the following way.
The circuit has $n+1$ qubits, the first qubit is the control qubit, and the operation on the rest $n$ qubits is the tensor product of $n$ phase rotations $R^{\otimes n}$.
from qiskit import *
from qiskit.extensions import *
import qiskit.extensions.unitary
import cmath as cm
import numpy as np
import math as m
from qiskit.aqua.utils import tensorproduct
n=10
c = QuantumRegister(1, "c")
q = QuantumRegister(n, "q")
cl = ClassicalRegister(2, "cl")
circ = QuantumCircuit( c, q, cl)
phase=cm.exp(cm.pi*complex(0,1)*(1/4))
matrixR=np.array([[phase,0],[0,1]])
matrixTe= matrixR
for _ in range(n-1):
matrixTe=tensorproduct(matrixTe,matrixR)
matrixOp=matrixTe
gateCR=UnitaryGate(matrixOp).control(num_ctrl_qubits=1)
qubits=[m for m in reversed(q)]
circ.append(gateCR, qubits)
For $n\geq10$, I get the following error message:
I understand the problem lies in the size of the matrix when it has phase in it. I tried to build a gate for $n=10$ when the operation has no phase, and it worked without any problem!
My question is, is there any workaround to fix this problem? What does the comment hack to correct global phase; should fix to prevent need for correction here in the source code mean?
"
['measurement']," Title: What does it mean to make a simultaneous measurement?Body: In Quantum Computing quantum measurements are described by a collection of measurement operators $\{M_n\}$ such that the probability of the outcome $m$ is given by $p(m)=\langle\psi|M_m^\dagger M_m|\psi\rangle$ and the state of the system after measurement is $\frac{M_m|\psi\rangle}{\sqrt{\langle\psi|M_m^\dagger M_m|\psi\rangle}}$. In addition these measurement operators satisfy $\sum_m M_m^\dagger M_m$. Now let $P$ and $Q$ be two hermitian matrices that commute and let $|\psi\rangle$ be a pure state in some Hilbert space. My question then is what does it mean to measure $A$ and $B$ simultaneously on $|\psi\rangle$?
"
"['textbook-and-exercises', 'bell-basis']"," Title: Show that the Bell states form a basisBody: I can't seem to understand how to show that the Bell states for a basis. Should I explain that through the circuit and what gates are used or by the basic proof behind proving a set as a basis?
"
"['quantum-state', 'mathematics', 'information-theory']"," Title: Upper bounding a permutation invariant stateBody: Let $\rho_{A^n}$ be a permutation invariant quantum state on $n$ registers i.e. $\pi(A^n)\rho_{A^n}\pi(A^n) = \rho_{A^n}$ for any permutation $\pi$ among the $n$ registers.
If we trace out $n-1$ registers (doesn't matter which due to permutation invariance), we obtain the reduced state $\rho_A$. One knows that $\text{supp}(\rho_{A^n})\subseteq \text{supp}(\rho_{A}^{\otimes n})$.
What is the minimal $\lambda_n$ such that $\rho_{A^n} \leq \lambda_n \rho_{A}^{\otimes n}$ where $A\leq B$ denotes that $B-A$ is positive semidefinite? In particular, is $\lambda_n$ necessarily exponential in $n$?
"
"['quantum-gate', 'quantum-operation', 'tensor-product', 'quantum-circuit']"," Title: Understanding the quantum circuit for the quantum adder Toffoli gateBody: I am trying to understand the toffoli operation for the quantum adder below: (especially for the second toffoli gate) but I am stuck in understanding the calculation to get the correct outputs.
The carry bits and sum bits are defined as of below:
For the 2nd Toffoli gate, I cant seem to understand how to get a2⊕c2.
I calculated their inputs up till the 2nd toffoli gate to be:
Input:
$b_1 \oplus a_1$,
$a_1 \oplus c_1$,
$a_1 \oplus a_2$
By definition of the toffoli gate, my outputs should be:
$b_1 \oplus a_1$,
$a_1 \oplus c_1$,
$(a_2 \oplus a_1) \oplus [(b_1 \oplus a_1)(a_1 \oplus c_1)]$
But after expanding the result and summarizing it:
$$(a_2 \oplus a_1) \oplus [(b_1 \oplus a_1)(a_1 \oplus c_1)] = (a_2 \oplus a_1) \oplus (b_1a_1 \oplus b_1c_1 \oplus a_1a_1 \oplus a_1c_1)$$
i cant seem to equate it to $(a_2 \oplus c_2)$.
"
"['nielsen-and-chuang', 'phase-estimation', 'phase-kickback']"," Title: Question about the phase kickback in the phase estimation algorithmBody: I have an issue with the quantum phase estimation algorithm as explained Nielsen and Chuang.
There was a question very similar to mine asked about this 2 years ago, but my question is different... Namely, I can understand the phase kickback operation if t was equal to 1. What is peculiar to me however is how the phase factor sort of "jumps over" the tensors and goes to the specific control bit. Is this just the standard operation of a controlled u within n qubits, and would need to be verified through examining the specific matrix?
Thanks in advance
"
"['programming', 'cirq']"," Title: How to use pass_operation_over with cirq.Operation?Body: Lately I saw a pull request in the Cirq GiHub repo where some dev said a test should be defined, with these constraints: You need to find a case where a cirq.Operation that is not a cirq.GateOperation is passed to
Cirq/cirq/ops/pauli_string.py
Line 943 in 4bb484a
def _pass_operation_over(
I follow the project, sadly I have no time to contribute, though. I have been using Cirq for a long time, and this "puzzle" got me puzzled, as I have never used anything similar. Could someone please give me an example of something like this? I ussually use cirq.GateOperation in college, and not this stuff. Btw, idk how often those developers read silly questions like this, but maybe they'll find this helpful for their project, idk. This is the comment I'm talking about. Waiting for a response... Thanks.
"
"['hamiltonian-simulation', 'bloch-sphere']"," Title: How do we determine the direction of a time evolution $e^{-itH}$ on the Bloch sphere?Body: I have a question about the direction of time evolution on a Bloch sphere: suppose I'm performing a unitary time-evolution $\exp(-iHt/\hbar)$ for a single qubit, then on the Bloch sphere it corresponds to a rotation around an axis $\hat n$, which is an eigenvector of the Hamiltonian. My question is how do we determine if the time evolution corresponds to a clockwise or counterclockwise rotation of $\hat n$? Is the direction dependent on the sign of energy eigenvalue? Thanks!
"
"['phase-estimation', 'state-preparation', 'stoquatic-matrices']"," Title: If we can prepare a ground state efficiently, when can we prepare the second-lowest energy eigenstate?Body:
I'd like to know if there's anything that can be said about whether and when we can efficiently prepare a state corresponding to the second-lowest eigenvalue of a given Hamiltonian, or in any other way learn what this energy is?
For example, in the case of a Hamiltonian of a doubly-stochastic Markov chain $H$ acting on a space $\Omega$ of known dimension $N$ that is promised to be ergodic, and wherein we have oracle access to adjacent nodes, we can prepare arbitrary states $\vert b\rangle$ and perform quantum phase estimation to thereon, to do an eigenvalue sampling on the probability distribution supported on the spectrum of $H$.
My intuition, which I don't know how to formalize, is that given two vertices $i$ and $j$ that are far from each other in the state space $\Omega$ of the Markov chain, the spectral decomposition of a superposition such as:
$$\vert\psi\rangle=\frac{1}{\sqrt{2}}(\vert i\rangle-\vert j\rangle)$$
likely has a large component corresponding to this second-lowest eigenstate.
Thus eigenvalue sampling may well lead to such a second-lowest energy eigenstate.
"
['measurement']," Title: Measuring the product is the same as first measuring with one matrix then with the otherBody: I want to show that if one measures $M_1$ on $|\psi\rangle$ then measures $M_2$ on the resulting state and then the associated probability space will be the same as the one for measuring the product $M_2 M_1$ on that pure state $|\psi\rangle$ (also assuming that the $M_i$ are Hermitian and commute). So in our first measurement procedure, we have two measurement operators, the first one yields,
$$p(1)=\langle \psi|M_1^\dagger M_1|\psi\rangle\tag{1}$$
and the resulting state is,
$$\frac{M_1|\psi\rangle}{\sqrt{\langle \psi|M_1^\dagger M_1|\psi\rangle}}.\tag{2}$$
If we then measure it using $M_2$ then we get,
$$p(2)=\left\langle\frac{M_1|\psi\rangle}{\sqrt{\langle \psi|M_1^\dagger M_1|\psi\rangle}} \bigg| M_2^\dagger M_2 \bigg| \frac{M_1|\psi\rangle}{\sqrt{\langle \psi|M_1^\dagger M_1|\psi\rangle}}\right\rangle.\tag{3}$$
With $M_2M_1$ we get,
$$p(1)=\langle\psi|(M_2M_1)^\dagger M_2M_1|\psi\rangle.$$
However, we only have one measurement operator here being $M_2M_1$, so how can the probability spaces be the same?
"
"['quantum-gate', 'error-correction', 'topological-quantum-computing']"," Title: Why is this topological gate mentioned in Raussendorf et al. 2007 a CNOT?Body: I read a Paper about quantum error corrections. I don't know why this is a CNOT gate. How to calculate this kind of CNOT gate as a topology form?
"
"['programming', 'qiskit', 'quantum-gate', 'entanglement']"," Title: How to get_statevector() with defined gates in Qiskit?Body: I'm learning Qiskit for my QC lectures and I'm not able to run the following code:
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, assemble, Aer
def cnotnot(gate_label = 'CNOTNOT'):
gate_circuit = QuantumCircuit(3, name = gate_label)
gate_circuit.cnot(0, 1)
gate_circuit.cnot(0, 2)
gate = gate_circuit.to_gate()
gate.label = gate_label
return gate
q = QuantumRegister(3, name = 'q')
circuit = QuantumCircuit(q)
# Define initial state
initial_state = [1. / np.sqrt(2.), 1. / np.sqrt(2.)]
circuit.initialize(initial_state, 0)
circuit.append(cnotnot(), [q[0], q[1], q[2]])
circuit.draw(plot_barriers = False)
# Let's simulate our circuit in order to get the final state vector!
svsim = Aer.get_backend('statevector_simulator')
# Create a Qobj from the circuit for the simulator to run
qobj = assemble(circuit)
# Do the simulation, return the result and get the state vector
result = svsim.run(qobj).result().get_statevector()
# Get the state vector for the first qubit
final_state = [result[0], result[1]]
print('a and b coefficients before simulation:', initial_state)
print('a and b coefficients after simulation:', final_state)
without getting errors. In particular:
QiskitError: 'ERROR: [Experiment 0] Circuit contains invalid instructions {"gates": {CNOTNOT}} for "statevector" method.
I followed this answer to define a CNOTNOT gate and append it to my circuit, but I can't get the Statevector after the simulation. If I don't use a defined gate (just use two separated CNOT), the code runs without problems.
Thanks for your time!
"
"['qiskit', 'quantum-gate', 'quantum-state', 'tomography']"," Title: how to implement Quantum tomography on an arbitrary state using Qiskit?Body: Can quantum tomography helps to reconstruct the state? How is this possible with arbitrary quantum state?
For example if I have a $$|\psi\rangle= (0.24506+0.9633i)|0\rangle + (0.0046238+0.10943i)|1\rangle$$ if I measure it will give either 1 or 0, How can I reconstruct a state using tomography using Qiskit?
"
['shors-algorithm']," Title: Logical bit-flip and Phase-flip operators of Shor’s 9-qubit codeBody: The logical basis states of the Shor’s 9-qubit code are given by
$|0_L\rangle = \frac{(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}, |1_L\rangle = \frac{(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)}{2\sqrt{2}}$
What's the logical bit-flip $\hat{X}_L$ and phase-flip operators $\hat{Z}_L$
"
"['algorithm', 'quantum-enhanced-machine-learning', 'quantum-neural-network']"," Title: Understanding the definition of quantum neural network of Abbas et al. 2020Body: My Question based on this Paper https://arxiv.org/pdf/2011.00027.pdf "Power of Quantum Neural Networks" - Section 2.
So I know that there are different ways to implement Neural Networks into QNNs. In that paper, they used the QNN as a subclass from Variational Quantum Algorithm. So first we have a Feature-Map which is mapping our data by applying Hadamard gates and RZ gates.
My first question is, why are all the states 0 ($|0\rangle$)?
After the Feature Map they applying a variational model, where the parameters are chosen to minimize the loss function.
"
"['machine-learning', 'quantum-enhanced-machine-learning', 'kernel-methods']"," Title: Is a ""kernel"" just the quantum equivalent of classical SVMs?Body: I'm confused about the relationship between kernel methods and SVM methods used in quantum machine learning. Sometimes the two seem to be used interchangeably, but often I'll see them both in the same sentence. I understand what an SVM is in the classical context. So is a kernel just the quantum equivalent? Or is there such thing as a 'classical' kernel and a 'quantum' SVM?
"
"['quantum-gate', 'quantum-operation', 'fidelity', 'tomography', 'quantum-process-tomography']"," Title: Can Gate Set Tomography work on Quantum Channels?Body: I stumbled across a new paper on gate set tomography. Can gate set tomography be applied to a quantum channel or multiple quantum channels? Will the same advantages still apply of not having to 'rely on pre-calibrated state preparations and measurements'? Would GST be advantageous over QPT in some scenarios?
"
"['resource-request', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Recommended resources for starter in quantum computing and its eventual applications on machine learningBody: A growing interest in Quantum Computing -particularly in its eventual applications on Machine Learning- has taken over me and I would like to follow that path. I have strong Maths (Calculus, Multivariate Calculus, Linear Algebra, Math. Analysis, etc) and Probability foundations but my knowledge in Physics is rather poor.
I also have some knowledge in common Machine Learning.
What subjects should I study and -if possible- what books per subject could I try?
I will probably do this on my own but I don't mind taking rigourous books if it's needed.
Thanks a lot, I know the answer to my question is a large one and I appreciate the effort it will take to approach it.
"
"['programming', 'qiskit']"," Title: Issue in running the qiskit tutorial for QSVMBody: I am trying to run this QSVM tutorial using qiskit from my Python environment using Jupyter Notebook
Firstly it gives me an error that I have to install qiskit-aqua[cvx] when I try to run this code -
backend = BasicAer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, shots=1024, seed_simulator=seed,seed_transpiler=seed)
result = qsvm.run(quantum_instance)
Then after I install the above package. I keep on getting the error - 'BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.'
I also try using the following code at the beginning of the notebook as per here https://github.com/Qiskit/qiskit-aer/issues/924. But no luck.
import os
os.environ['MPMATH_NOSAGE'] = 'true'
Any help is highly appreciated.
Regards,
Sourav
"
"['information-theory', 'entropy']"," Title: Does the relative entropy variance $V(\rho_{AB}\|\rho_A\otimes\sigma_B)$ satisfy an ordering for different $\sigma_B$?Body: The relative entropy between two quantum states is given by $D(\rho\|\sigma) = \operatorname{Tr}(\rho\log\rho -\rho\log\sigma)$. It is known that for any bipartite state $\rho_{AB}$ with reduced states $\rho_A$ and $\rho_B$, it holds that
$$D(\rho_{AB}\|\rho_A\otimes\rho_B)\leq D(\rho_{AB}\|\rho_A\otimes\omega_B)$$
for all choices of $\omega_B$. This can be seen by expanding both sides and noting that the relative entropy is nonnegative. Now define the relative entropy variance (see this reference, 2.16)
$$V(\rho \| \sigma):=\operatorname{Tr} [\rho(\log \rho-\log \sigma-D(\rho \| \sigma))^{2}]$$
Does this also satisfy a similar property i.e.
$$V(\rho_{AB}\|\rho_A\otimes\rho_B) \leq V(\rho_{AB}\|\rho_A\otimes\sigma_B)$$
for all $\sigma_B$?
EDIT: It seems like the last inequality is not true. But the name variance is suggestive so perhaps there is a non trivial lower bound for $V(\rho_{AB}\|\rho_A\otimes\sigma_B)$ using $V(\rho_{AB}\|\rho_A\otimes\rho_B)$?
"
"['programming', 'quantum-state', 'ibm-q-experience', 'quantum-neural-network']"," Title: How to upload our dataset using pytorch when it is not present in torchvision?Body: I am trying to upload my dataset(SWELL-KW) instead of MNIST in "Hybrid quantum-classical Neural Networks with PyTorch and Qiskit" provided by IBM qiskit but it says "AttributeError: module 'torchvision.datasets' has no attribute 'SWELL'. I could not find the dataset in torch vision. Is that the reason? If I try to give the path of dataset which is on my system, it indicates unicode error. Thank You.
"
"['programming', 'qiskit', 'measurement', 'quantum-circuit']"," Title: Qiskit - Circuit drawing aesthetics - Can I force the measurements in my circuit to show at the end?Body: I'm studying an introduction course to quantum computation at my uni and we got homework to draw a certain circuit using qiskit. I managed to understand how to do what is asked from me, and this is the final answer:
Now I know that once the qubit is no longer used in a manipulation, you can measure it without affecting the results, however I find this circuit rather confusing and messy. Since we can always postpone our measurement to the end, I'd prefer a more organised drawing where all CNOT gates are performed, and only then the measurements - preferably from the top one to the bottom one.
Is it possible to force such a thing?
To try and force the code doing that, I tried to first use a for loop to apply CNOTs on every qubit, then using a separate loop I performed the measurements on every qubit.
circuit_three = QuantumCircuit(5, 5)
circuit_three.h(0)
for i in range(1, 5):
circuit_three.cx(0, i)
for i in range(0, 5):
circuit_three.measure(i, i)
circuit_three.draw(output='mpl', filename='3')
The desired result is this (done with paint):
"
"['quantum-state', 'circuit-construction']"," Title: Single qubit gates (or CNOT) sequence to transform SWAP to Sqrt of SWAPBody: I'm trying to figure out how to transform the SWAP state gate into the square root of SWAP gate using only CNOTs or single qubit gates.
As you might guess, I'm new to this whole concept, but I'm having a hard time grasping how I can get a 1 or 0 (values in the SWAP gate matrix) to e^(i pi / 4) that are present in the square root of SWAP matrix.
I tried Kronecker product of Pauli Y and Hadamard, but I'm only getting e^(i pi / 2) elements.
Any ideas on a simple circuit? Thank you!
"
"['error-correction', 'stabilizer-code']"," Title: In Shor’s 9-qubit code, is the error syndrome for qubit 5 phase-flip the same as that for qubit 6 phase-flip?Body: The Shor’s 9-qubit code has the following stabilizers
$\hat{S}_1= \hat{Z}_1\hat{Z}_2$ , $\hat{S}_2= \hat{Z}_2\hat{Z}_3$, $\hat{S}_3= \hat{Z}_4\hat{Z}_5$
$\hat{S}_4= \hat{Z}_5\hat{Z}_6$, $\hat{S}_5= \hat{Z}_7\hat{Z}_8$ , $\hat{S}_6= \hat{Z}_8\hat{Z}_9$
$\hat{S}_7= \hat{X}_1\hat{X}_2\hat{X}_3\hat{X}_4\hat{X}_5\hat{X}_6$ , $\hat{S}_8= \hat{X}_4\hat{X}_5\hat{X}_6\hat{X}_7\hat{X}_8\hat{X}_9$
Is it true that error syndrome for qubit 5 phase-flip is the same as that for qubit 6 phase-flip?
"
"['entanglement', 'measurement', 'shors-algorithm', 'superposition']"," Title: Does Toffoli AND conjugate affect superposition if used in Shor's algorithm?Body: I have come across several papers that use Toffoli AND conjugate to minimize the T-depth. But since it contains a measurement, does it affect Shor's algorithm (in terms of interference, entanglement, or superposition), when used within the reversed modular multiplication circuit, such as in Vedral et al's implementation?
Toffoli AND conjugate (d), source.
Vedral et al's modular exponentiation circuit, source: Nakahara et al's book: Quantum Computing - From Linear Algebra to Physical Realizations:
"
"['information-theory', 'entropy']"," Title: Continuity of relative entropy varianceBody: Related question here - copying over the definitions.
The relative entropy between two quantum states is given by $D(\rho\|\sigma) = \operatorname{Tr}(\rho\log\rho -\rho\log\sigma)$. It is known that for any bipartite state $\rho_{AB}$ with reduced states $\rho_A$ and $\rho_B$, it holds that
$$D(\rho_{AB}\|\rho_A\otimes\rho_B)\leq D(\rho_{AB}\|\rho_A\otimes\sigma_B)$$
for all choices of $\sigma_B$. This can be seen by expanding both sides and noting that the relative entropy is nonnegative. Now define the relative entropy variance (see this reference, 2.16)
$$V(\rho \| \sigma):=\operatorname{Tr} [\rho(\log \rho-\log \sigma)^2]-D(\rho \| \sigma)^{2}$$
I would like to understand if this variance satisfies some type of continuity argument in the following sense. Let $\rho_{AB}$ be $d$ dimensional. I am given that $\sigma_B\approx_\varepsilon\rho_B$ although this property may not be very useful. Let
$$\Delta = D(\rho_{AB}\|\rho_A\otimes\sigma_B) - D(\rho_{AB}\|\rho_A\otimes\rho_B)$$
Is one able to then bound the difference in variances in the following way
$$V(\rho_{AB}\|\rho_A\otimes\rho_B) - V(\rho_{AB}\|\rho_A\otimes\sigma_B) \leq f(\Delta, d)?$$
EDIT: I ran following very simple MATLAB code (requires QETLAB and cvxquad for partial trace, random state generation and computing relative entropy) around 10000 times.
d = 10; %Dimension of rhoAB
rhoAB = RandomDensityMatrix(d^2,d^2);
rhoA = PartialTrace(rhoAB, 2, [d, d]);
rhoB = PartialTrace(rhoAB, 1, [d, d]);
sigmaB = RandomDensityMatrix(d,d);
v1 = trace(rhoAB*(logm(rhoAB) - logm(kron(rhoA, rhoB)))^2) - quantum_rel_entr(rhoAB, kron(rhoA, rhoB))^2;
v2 = trace(rhoAB*(logm(rhoAB) - logm(kron(rhoA, sigmaB)))^2) - quantum_rel_entr(rhoAB, kron(rhoA, sigmaB))^2 ;
conjecture = 1/sqrt(log(d))*(v1 - v2) <= quantum_rel_entr(rhoAB, kron(rhoA, sigmaB)) - quantum_rel_entr(rhoAB, kron(rhoA, rhoB));
This suggests that the conjecture
$$V(\rho_{AB}\|\rho_A\otimes\rho_B) - V(\rho_{AB}\|\rho_A\otimes\sigma_B) \leq \Delta\sqrt{\log d}$$
holds for the randomly generated states I used without exception so far.
"
"['superconducting-quantum-computing', 'chemistry', 'openfermion']"," Title: Molecular Docking using Quantum ComputingBody: I would like to ask if somebody could suggest me a pair of ligand-Protein which had been validated and the corresponding resulting drug is already being used commercially.
I am interested in experimenting with this ligand-Protein pair, to reverse engineer the molecular docking procedure using Quantum Computing.
"
"['quantum-gate', 'circuit-construction', 'classical-computing', 'quantum-circuit', 'deferred-measurement']"," Title: Using principle of deferred measurement to replace gates conditional on classical bits (c_if)Body: I am trying to implement the Iterative Phase Estimation algorithm on one of Qiskit's labs. I can do it for a 'nice' phase, such as 1/4 :
But if I want to implement the algo generally (as a subroutine for other algorithms, etc), the R_z gates will have to be conditioned on the values of the classical bits I measure (first gate conditioned on c_3 = 1, second gate conditioned on c_3 = 1, third gate conditioned on c_2 = 1).
I know that by the Deferred Measurement Principle, I can get a circuit with the same outcome by changing the conditioned R_z's in some way and measuring everything at the end. The question is how? Is there a general rule / set of principles on how to do this for a given circuit?
I'm asking for two reasons. First is that if I keep the c_if's, they have to be conditioned on individual bits, which isn't supported by Qiskit unless I go around it by saying that c3 = 1 if c = 4,5,6,7, etc.; and that's just not nice. Second is that I would like to execute the circuit on a real quantum computer and IBM computers don't support c_if.
"
['measurement']," Title: Born rule as the sudden approximation applied twice?Body: Background
I haven't seen this done before as tempting as it seems and was wondering if there was some way to disprove the below? In short can one think of the measurement as the sudden approximation (Eq $84$ onwards or see wiki) applied twice? I use the notation:
$$ P(| A \rangle \to | B \rangle ) = \text{Probability of State $|A \rangle $ going to State $|B \rangle$}$$
And also:
$$ P(| A \rangle \to \sum | B \rangle ) = \text{Sum of probabilities of State A going to one of the eigenstates of the observable of state $|B \rangle$}$$
Proof
I define the measurement as a short lived interaction $H_{int}$ produced due to the measurement device.
Let the system I am interested in have the Hamiltonian $H$ obeying:
$$ H | E_n \rangle = E_n |E_n \rangle$$
The Hamiltonian of the short lived system (during the measurement) be $H'= H + H_{int}$ obeying:
$$ H' |E'_n \rangle = E'_n |E'_n \rangle $$
Thus we have the following sequence of Hamiltonians:
$$ H \to H' \to H $$
Let the initial state be $| \psi \rangle $ then after $H \to H'$ to find it in say state $| E' \rangle$ the probability is given by the sudden approximation.
$$ P(|\psi \rangle \to | E_n' \rangle ) = |\langle E_n' | \psi \rangle|^2 $$
Now, again let us assume the final state is $| \psi' \rangle$ after $H' \to H$. Then the probability of us arriving in that state is:
$$ P(|E_n' \rangle \to |\psi') = |\langle E_n' | \psi '\rangle|^2$$
Hence, the probability of going from $|\psi \rangle \to |E'_n \rangle \to |\psi' \rangle $ is:
$$P(|\psi \rangle \to |E'_n \rangle \to |\psi' \rangle) =|\langle E_n' | \psi \rangle|^2 |\langle E_n' | \psi '\rangle|^2 $$
Let's say I repeat the experiment many times and go through all $E_n'$ and somehow know the outcome $|\psi' \rangle$ but not the intermediate $E'_n$. Then:
$$ P(|\psi \rangle \to \sum |E'_n \rangle \to |\psi' \rangle) = \sum_{n} | \langle \psi' |E'_n \rangle \langle E'_n | \psi \rangle|^2 $$
Using triangle inequality and $\sum_n |E'_n \rangle \langle E'_n | = \hat 1 $:
$$ P(|\psi \rangle \to \sum | E'_n \rangle \to |\psi' \rangle) = |\langle \psi | \psi' \rangle |^2 + c(\psi \to \psi') \geq | \sum_n \langle \psi | E'_n \rangle \langle E'_n | \psi ' \rangle |^2 $$
where $c$ is a constant:
$$ c(\psi \to \psi') = \sum_{i \neq j} \langle \psi | E_i \rangle \langle E_j | \psi ' \rangle \langle E_j | \psi \rangle \langle \psi ' | E_i \rangle $$
Now let's say we do the experiment many times and include all possible final outcomes of $| \psi ' \rangle $. Then what happens to $c$?
$$ \sum_{\psi'} c(\psi \to \psi') = \sum_{i \neq j} \sum_{\psi'} \langle \psi | E_i \rangle \langle E_j | \psi ' \rangle \langle E_j | \psi \rangle \langle \psi ' | E_i \rangle $$
But since $\sum_{'} |\psi' \rangle \langle \psi' | = \hat 1$:
$$ \sum_{\psi'} c(\psi \to \psi') = \sum_{i \neq j} \langle \psi | E_i \rangle \langle E_j | \psi \rangle \delta_{ij} = 0$$
Hence,
$$ P(|\psi \rangle \to \sum | E'_n \rangle \to \sum |\psi' \rangle) = | \langle \psi | \psi' \rangle |^2 $$
Edit
After going through the derivation of Wikipedia. It seems indeed the Born Rule itself is used to derive the didactic/sudden approximation. Precisely when the wikipedia page where it defines the parameter $\zeta$:
To determine the validity of the adiabatic approximation for a given process, one can calculate the probability of finding the system in a state other than that in which it started.
$$ \zeta = \underbrace{\langle 0 | U^\dagger (t_1 ,t_0) U (t_1 ,t_0) | 0\rangle}_{1} - \underbrace{\langle 0 | U^\dagger (t_1, t_0) | 0 \rangle \langle 0 | U (t_1, t_0) | 0 \rangle}_{\text{Probability of finding state in $|0 \rangle$ after time evolution $t_1-t_0$}} $$
Unless, there is some other way to get this result. In light of this I would like to ask if this is a valid way to model the measurement (as a consequence of double sudden approximations).
"
"['programming', 'ibm-q-experience']"," Title: I can't see the results of my of my jobsBody: New user here. I tried to run a test circuit which I submitted to ibmq_santiago to run, but now I cannot see my results. No histogram, no circuit, only the status timeline. I believe the problem is that my antivirus recognizes this URL as blacklisted and cancels the connection, because that's the message I get every time I try to view my results, but I don't get why it would do that. Has anyone had this problem before?
"
"['programming', 'qutip']"," Title: Writing the Jaynes-Cumming model in QuTipBody: I want to write the Jaynes-Cumming Hamiltonian in QuTip.
$$H = \hbar \omega_{C} a^\dagger a + \frac12 \hbar \omega_{a} \sigma_{z} + \hbar \lambda (\sigma_{+} a + \sigma_{-} a^\dagger)$$
I assume $\hbar = 1$, and we know $a, a^\dagger$ are the field (cavity) operators, and $\sigma_{z}, \sigma_{+}, \sigma_{-}$ are the atomic operators; and they commute. $\lambda$ is the coupling constant.
I assume that the # of Fock basis states that I choose is N. Now, to write the Hamiltonian using qutip I would use the following statements,
$a$: a = tensor(qeye(2), destroy(N))
$a^\dagger$: a.dag()
$a^\dagger a$: a.dag() * a
$\sigma_{z}$: sz = tensor(sigmaz(), qeye(N))
$\sigma_{+} a$: sp = tensor(sigmap(), qeye(N)) * a
$\sigma_{-} a^\dagger$: sp.dag()
$\sigma_{+} a + \sigma_{-} a^\dagger$: sp + sp.dag()
But in the QuTip documentation the interaction term has been written as,
sm = tensor(destroy(2), qeye(N)); Hint = a.dag() * sm + a * sm.dag()
Could someone explain why they use the previous statement but not the one I would have assumed?
"
"['quantum-gate', 'textbook-and-exercises', 'bloch-sphere']"," Title: Are these two 'divided by two' terms related?Body: I have a question about the two equations:
- Any matrix in $SU(2)$ could be parametrized as
$$
R_{\hat{n}}(\theta) = \cos\left(\frac{\theta}{2}\right)I-i\sin\left(\frac{\theta}{2}\right)(\hat{n}\cdot\vec\sigma)
$$
- And the $U_3$ gate in qiskit is defined as
$$
U_3(\gamma,\beta,\delta) =
\begin{bmatrix}
\cos\left(\frac{\gamma}{2}\right) & -e^{i\delta} \sin\left(\frac{\gamma}{2}\right) \\
e^{i\beta} \sin\left(\frac{\gamma}{2}\right) & e^{i(\delta + \beta)} \cos\left(\frac{\gamma}{2}\right)
\end{bmatrix}
$$
For the first equation, I think the $\theta/2$ term is kind of relevant to the Dirac belt trick: the electron spin state will negate under a $2\pi$ rotation, so $4\pi$ will return to the original state. For the second equation, on the other hand, I think $\gamma/2$ is because on the Bloch sphere it looks like $|0\rangle$ and $|1\rangle$ are on the same line pointing toward the opposite directions, but they're orthogonal states. I'm wondering if there're any connections between the two cases when we divide $\theta$ or $\gamma$ by 2. Thanks!!
PS: In my understanding, $\theta$ refers to the angle of rotation along the axis $\hat n$ following the right-hand rule, and $\gamma$ here is the included angle of $\hat n$ and $z$-axis in the spherical coordinate.
"
"['programming', 'qiskit', 'quantum-state', 'unitarity']"," Title: How do I get the Unitary matrix of a circuit without using the 'unitary_simulator'?Body: I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.:By just using matrix manipulation, how do I get the unitary matrix of the circuit below by just using numpy and normal matrix properties?
The result should equal this:
[[1.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+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 0.+0.j 0.+0.j]
[0.+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 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 0.+0.j 1.+0.j 0.+0.j 0.+0.j 0.+0.j]
[0.+0.j 0.+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 0.+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 0.+0.j]]
I tried doing the following but it did not result in the correct Unitary matrix
swapcnot = np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]])
layer1 = np.kron( swapcnot,np.eye(2) )
layer2 = np.kron( np.eye(2),swapcnot )
print( np.matmul(layer2,layer1) )
The result:
[[1. 0. 0. 0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0. 0. 0. 1.]
[0. 0. 0. 0. 0. 0. 1. 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. 0. 0. 0.]
[0. 0. 0. 0. 0. 1. 0. 0.]]
"
"['error-correction', 'key-distribution']"," Title: Understanding the (2,3) threshold quantum secret sharing scheme in Cleve et al. 1999Body: In the paper "How to share quantum secret" by R.Cleve et al (arxiv).
There is an example of secret sharing using qutrit in a (2,3) threshold scheme.
$$\alpha\vert0\rangle+\beta\vert1\rangle+\gamma\vert2\rangle\mapsto$$
$$\alpha(\vert000\rangle+\vert111\rangle+\vert222\rangle)+\beta(\vert012\rangle+\vert120\rangle+\vert201\rangle)+\gamma(\vert021\rangle+\vert102\rangle+\vert210\rangle)$$
Where the secret encoding maps the initial qutrit as shown above, and any combination of the two can be used to determine the secret qutrit back.
Given the first two shares (for instance), add the value of the first share to the second (modulo three), and then add the value of the second share to the first, to obtain the state below.
$$(\alpha\vert0\rangle+\beta\vert1\rangle+\gamma\vert2\rangle)\vert00\rangle+\vert12\rangle+\vert21\rangle)$$
I am unable to understand what exactly is happening here, any help would be really appreciated.
"
['ibm-q-experience']," Title: IBM Quantum: 20 minutes for 1 shot, timeout for 2 shots. Why?Body: It takes 20 minutes for the ibmq_qasm_simulator to execute 1 shot of my circuit. Successful always.
It always times out for 2 shots of the same circuit on the same simulator.
One may assume the performance would be roughly linear, say, 40 minutes for 2 shots. No, that has never happened to me. For those who don't know the simulator, its default timeout is supposed to be 166 minutes (10,000 seconds).
Is there a bug somewhere in the simulator?
"
"['quantum-gate', 'textbook-and-exercises', 'pauli-gates']"," Title: Can we write Pauli-Y gate without even complex part?Body: I was just curious, why is the quantum gate Y-gate (Pauli-Y gate) written in terms of complex numbers? We can actually write Pauli-Y gate as
$$
Y = i * \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}
$$
and still we can get result $YY = I$.
"
"['programming', 'circuit-construction', 'cirq']"," Title: Multiplying quantum circuits in cirq using * and computing ""expectation values""Body: I am reading cirq guide about Simulation and there is an example in "Expectation values" paragraph that I don't understand.
Everything boils down to the following snippet:
import cirq
q0 = cirq.GridQubit(0, 0)
q1 = cirq.GridQubit(1, 0)
def basic_circuit():
sqrt_x = cirq.X**0.5
yield sqrt_x(q0), sqrt_x(q1)
yield cirq.CZ(q0, q1)
yield sqrt_x(q0), sqrt_x(q1)
circuit = cirq.Circuit(basic_circuit())
XX_obs = cirq.X(q0) * cirq.X(q1)
ZZ_obs = cirq.Z(q0) * cirq.Z(q1)
ev_list = cirq.Simulator().simulate_expectation_values(circuit, observables=[XX_obs])
print(ev_list)
# Output:
[(1+0j)]
First, I don't understand what XX_obs and ZZ_obs do. What does it mean to multiply two circuits by * operator. Is it the tensor product of the operations or something else?
Second, is simulating observable XX_obs the same as adding XX_obs at the end of circuit? If so, how to read the following printed output:
circuit.append(XX_obs)
print(circuit)
# Output:
(0, 0): ───X^0.5───@───X^0.5───PauliString(+X)───
│ │
(1, 0): ───X^0.5───@───X^0.5───X─────────────────
Third, if I simulate the above circuit without measurement I get the following output which does not resemble [(1+0j)] obtained previously:
result = cirq.Simulator().simulate(circuit)
print(result)
# output:
measurements: (no measurements)
output vector: 0.5|00⟩ + 0.5j|01⟩ + 0.5j|10⟩ + 0.5|11⟩
Why is it so?
PS. It is my very first question on this site so be forgiving about tags I used or about some conventions that you use and I don't know.
"
"['programming', 'qiskit', 'quantum-gate', 'unitarity']"," Title: Why is my unitary matrix using linear algebra not matching the 'get_unitary' simulation?Body: I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator.
i.e.: By just using matrix manipulation, how do I get the unitary matrix of the circuit below by just using numpy and normal matrix properties?
This is the code I am using:
import numpy as np
swapcnot = np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]])
cnot = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
layer1 = np.kron(np.eye(2),swapcnot)
layer2 = np.kron(swapcnot, np.eye(2))
layer3 = np.kron(np.eye(2), cnot )
print(layer3@layer2@layer1)
The result I should be getting:
[[1.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+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 0.+0.j 0.+0.j]
[0.+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 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 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 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 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]]
The actual result I am getting:
[[1. 0. 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. 1. 0.]
[0. 0. 0. 0. 1. 0. 0. 0.]
[0. 0. 0. 0. 0. 0. 0. 1.]
[0. 1. 0. 0. 0. 0. 0. 0.]
[0. 0. 1. 0. 0. 0. 0. 0.]]
"
"['programming', 'qiskit', 'quantum-gate', 'hhl-algorithm']"," Title: I don't understand unitary of ${e^{iAt}}$ from HHL algorithmBody: I tried to implement the following circuit in the image below but with the red circled gates replaced with a unitary controlled ${e^{iAt/2}}$ and controlled ${e^{iAt/4}}$
The image came from this paper here and someone already implemented this circuit here.
The matrix A is :
![]()
And t = 2π
For ${e^{iAt/2}}$ I found that the matrix is equal to an X gate which is same as the paper.
For ${e^{iAt/4}}$ I got this matrix.
![]()
But in the paper they use U3(-pi/2,-pi/2,pi/2) as target bit and U1(3π/4) afterwards at control bit.
The unitary matrix from both qubit is something like this.(I use qiskit to find the unitary matrix)
While my ${e^{iAt/4}}$ connected with a control bit gives different unitary matrix.
![]()
Am I missing something or is there anything wrong with my ${e^{iAt/4}}$ unitary?
"
"['programming', 'qiskit', 'quantum-gate', 'unitarity']"," Title: How do I get the Unitary matrix of this circuit without using 'unitary_simulator'?Body: I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator.
i.e.: By just using matrix manipulation, how do I get the unitary matrix of the circuit below by just using numpy and normal matrix properties?
I have figured out how to get the unitary matrix of the circuit below:
By using this code:
import numpy as np
swapcnot = np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]])
cnot = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
layer1 = np.kron(np.eye(2),swapcnot)
layer2 = np.kron(swapcnot, np.eye(2))
print(layer2@layer1)
However when I try to add another qubit and another cnot gate, I do not get the correct result
The result I should be getting:
"
['ibm-q-experience']," Title: Adding team to our IBM Quantum Experience accountBody: I have an account and API token on IBM Quantum Experience (https://quantum-computing.ibm.com/)
I would like to add team members to the account, so that everyone can use it without sharing login credentials.
It doesn't look like IBMQ is integrated with IBM Cloud IAM (we have an IBM Cloud account). I asked their support team and they suggested I post the question here.
Does anyone know if it is possible to add team members to an IBMQ account?
Thank you!
"
"['programming', 'qiskit']"," Title: Calculating the expected value of a weighted Pauli Operator in QiskitBody: Following UT course on Quantum Machine Learning, they have a notebook on QAOA. As part of their lecture, they perform QAOA using Qiskit. Unfortunately, it seems the new versions of Qiskit have changed a lot since then and the code is not working anymore.
Specifically, the instructions on the optimization / evaluation procedure say the following:
We now create a function evaluate_circuit that takes a single vector gamma_beta (the concatenation of gamma and beta) and returns $\langle H_c \rangle = \langle \psi | H_c | \psi \rangle$ where $\psi$ is defined by the circuit created with the function above.
In their code, evaluate_circuit looks like this:
def evaluate_circuit(beta_gamma):
n = len(beta_gamma)//2
circuit = create_circuit(beta_gamma[:n], beta_gamma[n:])
return np.real(Hc.eval("matrix", circuit, get_aer_backend('statevector_simulator'))[0])
So basically they're calculating the expected value of $H_c$ (the hamiltonian we expect to evolve to at the end) with respect to $\psi$, which in this case is constructed using the function create_circuit (which simulates the evolution from a superposition state based on the applicacion of Hc and Hm operators with angles beta and gamma, respectively):
def create_circuit(beta, gamma):
circuit_evolv = sum([evolve(Hc, beta[i], qr) + evolve(Hm, gamma[i], qr)
for i in range(p)], evolve(identity, 0, qr))
circuit = circuit_init + circuit_evolv
return circuit
The problem here is that $H_c$ in this case is an object of WeightedPauliOperator, and it doesn't seem to have the function eval anymore.
What's the best way to calculate $\langle \psi | H_c | \psi \rangle$ using WeightedPauliOperator objects?
"
"['programming', 'hamiltonian-simulation', 'openfermion']"," Title: How to get eigenvectors of Hamiltonian in OpenFermionBody: In OpenFermion you can create a Hamiltonian in terms of creation and annihilation pretty easily:
ham = ((FermionOperator('1^ 1', .5)) + (FermionOperator('2^ 2', .25)))
And getting the eigenvalues of the Hamiltonian is pretty straightforward as well:
vals = eigenspectrum(ham)
But I don't understand how to get the eigenvectors of the Hamiltonian. FermionOperator doesn't return a numpy object so I can't use usual linear algebra libraries. What am I missing?
"
"['information-theory', 'entropy']"," Title: Is data processing for relative entropy true when states are not normalized?Body: The data processing inequality for relative entropy states that
$$D(\rho\|\sigma) \geq D(N(\rho)\|N(\sigma))$$
for some CPTP map $N$ where $\rho$ is a quantum state and $\sigma$ is a positive-semidefinite operator.
What goes wrong if $\rho$ is not normalized (either sub-normalized or has trace larger than 1)?
"
['error-correction']," Title: Error syndrome on logical operatorsBody: The stabilizers and logical operators (for five qubit-codes) are given by
$$
\hat{S}_1= \hat{X}_1\hat{Z}_2\hat{Z}_3\hat{X}_4 \\
\hat{S}_2= \hat{X}_2\hat{Z}_3\hat{Z}_4\hat{X}_5 \\
\hat{S}_3= \hat{X}_1\hat{X}_3\hat{Z}_4\hat{X}_5 \\
\hat{S}_4= \hat{Z}_1\hat{X}_2\hat{X}_4\hat{Z}_5 \\
\hat{X}_L= \hat{X}_1\hat{X}_2\hat{X}_3\hat{X}_4\hat{X}_5 \\
\hat{Z}_L= \hat{Z}_1\hat{Z}_2\hat{Z}_3\hat{Z}_4\hat{Z}_5
$$
How to find the error syndromes for single qubit $\hat{X},\hat{Y},\hat{Z}$ errors on qubit 3.
"
['entanglement']," Title: Reduced density matrix of the ensemble of two-qubit state that is possessed by Alice and BobBody: Consider the entanglement-based protocol that in each round Alice prepares a Bell state $\Phi_+= \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)=\frac{1}{\sqrt{2}}(|++\rangle+|--\rangle)$ and sends one qubit to Bob. Assume Alice and Bob store their qubit in perfect quantum memory. What
is the reduced density matrix of the ensemble of two-qubit state that is possessed by Alice and Bob
"
"['programming', 'qiskit']"," Title: How to solve TSP problem with more than 3 nodes in the tutorial of Max-Cut and Traveling Salesman Problem?Body: I had to try the example of qiskit’s Traveling Salesman Problem with 3 nodes and executing it at IBM backend called simulator_statevector.Can execute and get the result normally.
But when trying to solve the TSP problem with more than 3 nodes,I changed n = 3 to n = 4.
# Generating a graph of 3 nodes
n = 4
num_qubits = n ** 2
ins = tsp.random_tsp(n, seed=123)
print('distance\n', ins.w)
# Draw the graph
G = nx.Graph()
G.add_nodes_from(np.arange(0, ins.dim, 1))
colors = ['r' for node in G.nodes()]
for i in range(0, ins.dim):
for j in range(i+1, ins.dim):
G.add_edge(i, j, weight=ins.w[i,j])
pos = {k: v for k, v in enumerate(ins.coord)}
draw_graph(G, colors, pos)
And I changed backend from Aer.get_backend ('statevector_simulator') running on my device to provider.backend.simulator_statevector running on the IBM backend.
aqua_globals.random_seed = np.random.default_rng(123)
seed = 10598
backend = provider.backend.simulator_statevector
#backend = Aer.get_backend('statevector_simulator')
quantum_instance = QuantumInstance(backend, seed_simulator=seed, seed_transpiler=seed)
But the result that comes out with an error.
energy: -1303102.65625
time: 5626.549758911133
feasible: False
solution: [1, 0, 2, []]
solution objective: []
Traceback (most recent call last):
File "<ipython-input-10-bc5619b5292f>", line 14, in <module>
draw_tsp_solution(G, z, colors, pos)
File "<ipython-input-4-999185567031>", line 29, in draw_tsp_solution
G2.add_edge(order[i], order[j], weight=G[order[i]][order[j]]['weight'])
File "/opt/conda/lib/python3.8/site-packages/networkx/classes/coreviews.py", line 51, in __getitem__
return self._atlas[key]
TypeError: unhashable type: 'list'
Use %tb to get the full traceback.
How should I fix it? Please give me some advice.
"
"['qiskit', 'quantum-gate', 'noise', 'phase-estimation', 'quantum-circuit']"," Title: Iterative Phase Estimation with noise vs standard Quantum Phase Estimation with noiseBody: I am doing Qiskit Lab 4 about Iterative Phase Estimation. I created a circuit implementing IPE for theta = 1/3 (phase of 2pi/3). Here's the circuit:
It seems to do okay if I run it without noise in a QASM sim:
Then the lab compares how IPE performs compared to QPE when you add noise - in this lab they use NoiseModel.from_backend() from the Athens IBM computer to simulate the noise.
The lab guide says I'm supposed to get something like this:
In reality I get this:
I have zero idea how to approach this problem because I tried inputing several values of theta to simulate in QASM without noise and everything seems to be fine there. Any ideas?
For reference, the code implementing IPE is below:
import math
theta = 2/3*math.pi
IPE = QuantumCircuit(2)
cregs = []
IPE.x(1)
for i in range(n):
cregs.append(ClassicalRegister(1))
IPE.add_register(cregs[i])
for i in range(n):
IPE.reset(0)
IPE.h(0)
IPE.crz(theta*(2**(n-i)),0,1)
if i > 0:
for j in range(i):
IPE.rz(-math.pi*2**(j-i),0).c_if(cregs[j],1)
IPE.h(0)
IPE.measure(0,cregs[i])
UPDATE: Apparently specifying the initial_layout during transpiling is crucial as it seems to have worked!
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix', 'trace']"," Title: Why does the trace of density operators need to be one?Body: Usually, the textbook starts with a few assumptions of what density operator $\rho$ has.
One of them is $Tr(\rho) = 1$.
Why is that?
"
"['programming', 'qiskit']"," Title: Optimising Angle Code in Qiskit - Using the QAOAVarFormBody: I’ve got a bit of an elongated plea for aid here!
I’ve got some code that finds the optimum angles for QAOA on the Maximum Independent Set Problem. It does however seem about ~10x slower than related code that solves the Maxcut Problem.
The issue I think arises from the fact I use QAOAVarForm.construct_circuit() to generate my circuit whereas the Maxcut program ‘manually’ places in the RX, RZ gates, etc. I’ve made two notebooks that compare the two approaches side by side in-depth:
https://www.dropbox.com/sh/xad0fcl49dbesqw/AABcNSBakS8r21Jh_3SOBaTNa?dl=0
(I’ve also included an image from snakeviz which shows that the problem is coming from pauli_trotter_evolution script. And for that matter the cProfile Data for this too, under the filename ‘Benchmarking_with_COBYLA’)
Here is the engine of my poorly performing code (this is certainly not all the functions required to make it work, those can be found in the notebooks!). Am I doing something incredibly inefficient? Is there a way that speeds up my code? Or would the best be to just manually create the circuit?
def quantum_operator_for_graph(Graph,model_name):
'''
Generates the quanutm object to be passed to the optimal angles function
'''
qp = QuadraticProgram()
qp.from_docplex(new_docplex_generator(Graph,model_name)) # Putting in Graph
quantum_operator, offset = qp.to_ising()
return quantum_operator
def get_qaoa_circuit_sv(var_form,p, theta):
'''
Supplies the circuit from var_form to be used in the optimisation stage of the program
'''
var_qc = var_form.construct_circuit(theta) # cost operator put in first, then after p the mixer p angles
return var_qc
def get_black_box_objective_sv(G,p,var_form,seed =10):
backend = Aer.get_backend('statevector_simulator')
def f(theta):
quantum_circuit = get_qaoa_circuit_sv(var_form,p,theta)
statevector = execute(quantum_circuit, backend, seed_simulator=seed).result().get_statevector()
# return the energy
return compute_mwis_energy_sv(get_adjusted_state(statevector), G)
return f
def get_optimal_angles(Graph,p, quantum_operator, initial_starting_points,seed):
'''
This performs the classical-quantum interchange, improving the values of beta and gamma by reducing the value of
< beta, gamma | - C | beta, gamma > (Note Negative Sign). Returns the best angles found and the objective value this refers to.
Starting points for the angles are randomly distributed across the interval specified.
'''
var_form = QAOAVarForm(quantum_operator, p)
objective_function= get_black_box_objective_sv(Graph,p,var_form,seed)
optimiser_function = minimize(objective_function, initial_starting_points, method='COBYLA', options={'maxiter':500})
best_angles = optimiser_function.x
objective_value = optimiser_function.fun
return best_angles,objective_value
"
"['qiskit', 'quantum-circuit']"," Title: How to calculate quantum circuit with given quantum state?Body: I have task to calculate this quantum circuit
Where psi is:
x1 = 5
x2 = 1
r = x1 * x1 + x2 * x2
a = np.sqrt(1 + 2*r)
psi = [0, 0, 0.5, 0, 0, -0.5, 0, 0, 1/(np.sqrt(2)*a), 0, x1/(np.sqrt(2)*a), x2/(np.sqrt(2)*a), x1/(np.sqrt(2)*a), x2/(np.sqrt(2)*a), 0, 0]
I am doing this type of code:
circ = QuantumCircuit(4)
circ.h(0)
meas = QuantumCircuit(4, 4)
meas.barrier(range(4))
# map the quantum measurement to the classical bits
meas.measure(range(4), range(4))
# The Qiskit circuit object supports composition using
# the addition operator.
qc = circ + meas
qc.initialize(psi, 4)
#drawing the circuit
backend_sim = Aer.get_backend('qasm_simulator')
# Execute the circuit on the qasm simulator.
# We've set the number of repeats of the circuit
# to be 1024, which is the default.
qc.draw('mpl')
job_sim = execute(qc, backend_sim, shots=1000)
# Grab the results from the job.
result_sim = job_sim.result()
counts = result_sim.get_counts(qc)
print(counts)
But getting this error:
CircuitError: 'Index out of range.'
If I change qc.initialize like this:
qc.initialize(psi, 3)
I get this:
QiskitError: 'Initialize parameter vector has 16 elements, therefore expects 4 qubits. However, 1 were provided.'
"
['quantum-state']," Title: How can one geometrically represent a 2-qubit state?Body: I know that a one-qubit $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$, where $\alpha, \beta \in \mathbb C$, can be represented geometrically on a Bloch sphere as $|\psi\rangle = \cos\theta |0\rangle +e^{\text{i}\phi}\sin \theta |1\rangle$.
Now, for a two-qubit state $|\psi\rangle= \alpha |00\rangle + \beta |11\rangle+\gamma|01\rangle+\delta|10\rangle$, where $\alpha, \beta, \gamma, \delta \in \mathbb C$, can we find a geometrical representation analog to that of the Bloch sphere?
"
"['programming', 'q#']"," Title: Quantum Katas - Tutorials - SingleQubitGates - Exercise 7 - Preparing an arbitrary stateBody: Exercise 7 "Preparing an arbitrary state" from the Quantum Katas - Tutorials - SingleQubitGates asks to prepare a state $\alpha|0\rangle + e^{i\theta}\beta|1\rangle$, using parameters $\alpha$, $\beta$, and $\theta$.
In brief, $\theta$ is one of known-inputs, why we don't use $\theta$ for the Ry gate directly ? Something like this..
Ry(theta, q);
R1(theta, q);
But alas, I got error:
Qubit in invalid state. Expecting: Zero
Expected: 0
Actual: 0.061208719054813704
Try again!
Any ideas would be highly appreciated!!
"
"['complexity-theory', 'annealing', 'spin-glasses']"," Title: Are spin-glass problems NP (-complete)?Body: It is well known that finding ground states for spin-glass systems (Ising, XY...) is NP-hard (at least as hard as the hardest NP-problems) so that they can be efficiently used to solve other NP problems like the Traveling Salesman Problem.
My question is: is the problem NP-complete? This seems to be what is claimed here. To my understanding, this would mean that apart from NP-hard, the problem is NP itself. But I don't know an obvious algorithm to check if a given solution is the true ground state in polynomial time?
And actually, I think that a similar argument can be made for the traveling salesman problem.
"
"['qiskit', 'vqe']"," Title: What is the physical unit of the energy calculated using VQE on Qiskit?Body: Suppose there is any arbitrary ansatz producing variational energy for any arbitrary Hamiltonian. What is the physical unit corresponding to the energy? Since numerical algorithms only output a numeric value, the unit is missing. I know for quantum chemistry, it is usually taken to be Hartree. However, not all problem Hamiltonians are from chemistry.
"
['quantum-gate']," Title: Do global phases matter when a gate is converted into a controlled gate?Body: Let's say that we have a unitary matrix M such that:
$$
M = e^{i\pi/8}\begin{pmatrix}
1 & 0 \\
0 & e^{i\pi/12} \\
\end{pmatrix}
$$
If we were to apply this unitary matrix to the state $|1\rangle$, we would get:
$$
M|1\rangle\ =\ e^{i\pi/8+i\pi/12}\begin{pmatrix}
0\\
1
\end{pmatrix}
$$
Where the global phase is $ e^{i\pi/8+i\pi/12}$.
However, when we want to convert this global phase into a controlled gate, we would use the following implementation:
$$
CM = |0\rangle\langle0| \otimes I + |1\rangle\langle1| \otimes M
$$
But would this mean that the global phase does matter in such cases?
The way I see it, there are two possibilities:
- We do take the global phase into account in the resulting unitary matrix, as such: $$
CM = \begin{pmatrix}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & e^{i\pi/8} & 0 \\0 & 0 & 0 & e^{i\pi/8+i\pi/12} \\\end{pmatrix}
$$
This option would mean that multiplying with the state $|{+}{+}\rangle$, gives us the state: $$
\frac{|00\rangle + |01\rangle+e^{i\pi/8}|10\rangle+e^{i\pi/8+i\pi/12}|11\rangle}{2}
$$
In this case, M's global phase has changed into a relative phase when applied as a control on the state $|{+}{+}\rangle$.
- There is a rule stating that we should not take the global phase into account when converting a gate into a controlled gate.
Could somebody please help me with getting this clear?
"
"['programming', 'qiskit', 'hhl-algorithm']"," Title: Question on qiskit.circuit.library.PiecewiseChebyshev Qiskit circuit libraryBody: This question follows the post https://quantumcomputing.stackexchange.com/posts/15070/.
I am working on an implementation of HHL algorithm, to do so, I need to map $|\lambda\rangle\mapsto |\arcsin(\frac{C}{\lambda})\rangle$, where $|\arcsin(\frac{C}{\lambda})\rangle$ is a binary representation $\arcsin(\frac{C}{\lambda})$ with $m$ qubits.
Recently, a circuit implementing a Piecewise Chebyshev approximation of a given function $f$ was implemented in Qiskit, documentation can be found here : https://qiskit.org/documentation/stubs/qiskit.circuit.library.PiecewiseChebyshev.html#qiskit-circuit-library-piecewisechebyshev.
I was working on the given example:
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit.library.arithmetic.piecewise_chebyshev import PiecewiseChebyshev
f_x, degree, breakpoints, num_state_qubits = lambda x: 0, 2, None, 2
pw_approximation = PiecewiseChebyshev(f_x, degree, breakpoints, num_state_qubits)
pw_approximation._build()
qc = QuantumCircuit(pw_approximation.num_qubits)
qc.h(list(range(num_state_qubits)))
qc.append(pw_approximation.to_instruction(), qc.qubits)
qc.draw(output='mpl')
which should implement a piecewise approximation of the zero function on two qubits ...
We can take a look of what the circuit looks like:
the first and second qubits are state qubits and I guess that the three others are ancillary qubits.
The initial state of the system is set to $\frac{1}{2} (|00\rangle+|01\rangle+|10\rangle+|11\rangle)$ so we may look at all possible results of the approximation.
But while looking at measurements of the output qubits, I am facing weird results:
The third qubit is set to one, while the two first are unchanged. I tried a lot of different functions to understand how one can interpret the resulting qubits, but I still cannot figure out what the circuit does. Does anyone have an idea ?
"
"['programming', 'qiskit', 'vqe', 'chemistry']"," Title: Getting the current variational parameters in QiskitBody: I am right now using variational quantum eigensolver (VQE) to calculate the ground state of some molecules, like H2, by qiskit. The quesiton is that how to get the current parameters of the varaional ansatz, like UCCSD for the following code.
import numpy as np
import pylab
import copy
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.aqua.algorithms import NumPyMinimumEigensolver, VQE
from qiskit.aqua.components.optimizers import SLSQP
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit.chemistry.algorithms.ground_state_solvers import GroundStateEigensolver
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
from qiskit.chemistry.transformations import (FermionicTransformation,
FermionicTransformationType,
FermionicQubitMappingType)
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
molecule = Molecule(geometry=[['H', [0., 0., 0.]],
['H', [0., 0., 0.735]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER)
vqe_solver = VQEUCCSDFactory(QuantumInstance(BasicAer.get_backend('statevector_simulator')))
calc = GroundStateEigensolver(transformation, vqe_solver)
res = calc.solve(driver)
print(res)
Also, I need to simulate the model in the presence of noise, so I need to extract the variational parameters to calculate other properties of the system.
"
"['simulation', 'vqe']"," Title: What is the largest reported number of qubits used in a VQE simulation?Body: Numerous studies have investigated the simulation of an X-qubit circuit, demonstrating the 'classical simulation supremacy' on supercomputers. X is less than 50. However, useful VQE circuits are often long and require multiple iterations to converge. I would like to know the largest reported circuit, both in terms of qubit number and depth. My question does not concern VQE on a real device.
"
['qiskit']," Title: Which qiskit backend is faster in execution of the quantum circuit prepared?Body: I have a quantum circuit of 40 qubits with mutliple gate operations being applied to many of the qubits. Currently I am using qasm simulator which for shots=1 took 10 hour of time. Is there any other backend which can execute my circuit faster or is there any other process through which I can speed up my execution?
"
"['programming', 'algorithm', 'circuit-construction', 'cirq']"," Title: Expectation value of an arbitrary observable. My own definition and `cirq` limitationsBody: In my previous question I was struggling with the definition of expectation value of an observable for a circuit. Here is what I have derived after some support (I simplify the definition to 2-qubit system (+3rd ancilla)):
My Definition. Given a 2-qubit circuit $C$ and a 2-qubit observable $Ob$, the expectation value of $Ob$ for $C$ is defined as $$EV(C, Ob):=\sqrt{\sum_{ij}|\alpha_{ij0}|^2} - \sqrt{\sum_{ij}|\alpha_{ij1}|^2},$$
where $\alpha_{ijk}$ are such that $$(Ob_X\circ(C\otimes I))|000⟩=\sum_{ijk}\alpha_{ijk}|ijk⟩,$$
where $Ob_X$ denotes X-Axis control, i.e. $Ob_X=(I\otimes H)\circ Ob_C\circ(I\otimes H)$, where $Ob_C$ denotes $Ob$ controlled by the ancilla qubit.
My question is whether this definition is correct. If so, why does cirq constrain simulate_expectation_values method only for observables being Pauli Strings (tensor product of Pauli Gates)?
After @Craig Gidney answer I thought it would be easy to write (just using cirq and numpy) a code that computes expectation value with regard to arbitrary observable and I derived the following snippet:
import cirq
from copy import deepcopy
from cirq import X, CZ, H, Circuit, Simulator, GridQubit, InsertStrategy
import numpy as np
def example_circuit(q0, q1):
sqrt_x = X ** 0.5
yield sqrt_x(q0), sqrt_x(q1)
yield CZ(q0, q1)
yield sqrt_x(q0), sqrt_x(q1)
def extend_circ(C, Ob):
circ = deepcopy(C)
q2 = GridQubit(2, 0)
ObC = Ob.controlled_by(q2)
circ.append([H(q2), ObC, H(q2)], strategy=InsertStrategy.NEW_THEN_INLINE)
return circ
def main():
q0 = GridQubit(0, 0)
q1 = GridQubit(1, 0)
C = Circuit(example_circuit(q0, q1))
Ob = cirq.X(q0) * cirq.X(q1)
# Ob = cirq.X(q0)*cirq.X(q1) + 0.1 * cirq.Z(q0) * cirq.Z(q1)
ext_circ = extend_circ(C, Ob)
print(ext_circ)
result = Simulator().simulate(ext_circ)
print(result)
p0 = np.sqrt(np.sum(np.abs(result.final_state_vector[::2])**2))
p1 = np.sqrt(np.sum(np.abs(result.final_state_vector[1::2])**2))
expectation_value = p0 - p1
print('Expectation Value: {}'.format(expectation_value))
if __name__ == '__main__':
main()
Which gives the following output obtained from prints:
(0, 0): ───X^0.5───@───X^0.5───────PauliString(+X)───────
│ │
(1, 0): ───X^0.5───@───X^0.5───────X─────────────────────
│
(2, 0): ───────────────────────H───@─────────────────H───
measurements: (no measurements)
output vector: 0.5|000⟩ + 0.5j|010⟩ + 0.5j|100⟩ + 0.5|110⟩
Expectation Value: 0.9999999403953552
However, if I uncomment # Ob = cirq.X(q0)*cirq.X(q1) + 0.1 * cirq.Z(q0) * cirq.Z(q1) I obtain the error AttributeError: 'PauliSum' object has no attribute 'controlled_by' which indicates that in order to apply my method an observable must be "controlable".
My naive question. Maybe it would be easier to make in cirq all observables controlable by definition (i.e. extend controlled_by method to all observables)?
"
"['programming', 'cirq', 'pauli-gates']"," Title: How can I compose the Ising XXPOW,YYPOW and ZZPOW gate in single qubit gates and CNOT,...?Body: I am a bit stuck in decomposing these gates in single qubit gates, in the Cirq documentation it is written, for example that XX is for example the tensor product of Rx gates. But when I calculate these, I get terms with sin*cos where they write a 0.
Is there any trick/explanation for this?
"
"['programming', 'qiskit', 'circuit-construction']"," Title: Is there any way to assign a colour for a single gate in Qiskit?Body: I'm drawing with Qiskit a big circuit with some predefined and custom gates. I want to colour some of them in non-default colours for a better reading of it. Is it possible to do it for predefined gates? And for custom ones? Here is some code to play with:
from qiskit import QuantumCircuit, QuantumRegister
def cnotnot(gate_label = 'CNOTNOT'):
gate_circuit = QuantumCircuit(3, name = gate_label)
gate_circuit.cnot(0, 1)
gate_circuit.cnot(0, 2)
gate = gate_circuit.to_gate()
return gate
q = QuantumRegister(3, name = 'q')
circuit = QuantumCircuit(q)
circuit.append(cnotnot(), [q[0], q[1], q[2]])
circuit.h(q[0])
circuit.draw()
Thanks in advance!
"
"['programming', 'qiskit']"," Title: Re-initializing qubits in a circuit without losing superpositionBody: So recently I was building some circuit made of subcircuits. My subcircuits happen to use auxiliary qubits, that are always initialized in the state $|0\rangle$ and are not used after the calculation. Hence, I wanted to use the same set of auxiliary qubits for all the subcircuits by reinitializing them between subcircuits. As I code on Qiskit, I used reset gates to do so.
But I have a problem : my circuit is correct on each possible input state that belongs to the basis $\{|0\rangle,|1\rangle\}^{\otimes n}$, but the reset gates make it fail for any superposed state, henceforth losing all quantum advantage.
I'll explain the problem with a simplified example : let's say that I have two subcircuits, C and C', that operate on 1 main qubit (that I want to change) and use 1 auxiliary qubit. When C takes as input $|0\rangle$ for the main qubit, it outputs the main qubit in the state $|0\rangle$ and leaves the auxiliary qubits in the state $|0\rangle$, and when it takes as input $|1\rangle$ for the main qubit, it outputs the main qubit in the state $|1\rangle$ and gets the auxiliary qubits in the state $|1\rangle$. My full circuit resets the auxiliary gate between C and C' (with the Qiskit reset gate) and then C' is applied to get the wanted output on the main qubit. Now, if I input the state $\frac{|0\rangle+|1\rangle}{\sqrt{2}}$ on the main qubit, which is overall (taking into account the auxiliary qubit) the input state $\frac{|0\rangle+|1\rangle}{\sqrt{2}} \otimes |0\rangle$, after C we get :
$$\frac{|00\rangle+|11\rangle}{\sqrt{2}}$$
But then after the reset gate we don't get :
$$\frac{|00\rangle+|10\rangle}{\sqrt{2}}$$
But $|00\rangle$ 50% of the time and $|10\rangle$ 50% of the time. As superposition is broken, the main circuit gets flawed.
This behavior can be reproduced with the following code:
qc=QuantumCircuit(2)
qc.h(0)
qc.cx(0,1)
qc.reset(1)
backend=Aer.get_backend('statevector_simulator')
plot_histogram(execute(qc,backend,shots=1024).result().get_counts())
And by the way, in my understanding, this is in disagreement with this answer - which motivated me to ask my question, even if it may seem redundant at first sight.
Is there a way I could fix that ?
I am pessimistic, as in my previous example, the operation I'd like to apply isn't unitary. But I know that I can find on this site people that are amazing at quantum computing, so I have hope that a solution can be found.
Thanks a lot,
Thomas
"
"['quantum-state', 'algorithm', 'complexity-theory', 'quantum-advantage', 'haar-distribution']"," Title: Quantum hardness of XQUATH conjectureBody: Consider the XQUATH conjectures, as defined here (https://arxiv.org/abs/1910.12085, Definition 1).
(XQUATH, or Linear Cross-Entropy Quantum Threshold Assumption). There
is no polynomial-time classical algorithm that takes as input a
quantum circuit $C \leftarrow D$ and produces an estimate $p$ of
$p_0$ = Pr[C outputs $|0^{n}\rangle$] such that \begin{equation}
E[(p_0 − p)^{2}] = E[(p_0 − 2^{−n})^{2}] − Ω(2^{−3n}) \end{equation}
where the expectations are taken over circuits $C$ as well as the
algorithm’s internal randomness.
Here, $D$ is any distribution "over circuits on $n$ qubits that is unaffected by appending NOT gates to any subset of the qubits at the end of the circuit." For the purposes of our discussion, we can assume the circuit $C$ to be a particular Haar random unitary.
So, we believe the task mentioned in XQUATH is hard for classical computers. But how hard is the task for quantum computers? If it is easy for quantum computers, what is the algorithm?
A trivial algorithm I can think of just runs the quantum circuit many times, samples from the output distribution of the circuit each time, and then computes the frequency of observing $|0^{n}\rangle$. But what is the guarantee that this procedure will give us an additive error estimate robust enough to meet the condition of XQUATH?
"
"['programming', 'qiskit', 'vqe']"," Title: Unable to use iSWAP in Qiskit TwoLocal entangling_blockBody: I would like to use a general entangler in the entanglement_block of the TwoLocal function. The function seems to work with 'cz', 'cx', 'swap' gates, but it fails for 'iswap' gate. Below is the error message. Any help would be appreciated
from qiskit.circuit.library import TwoLocal
ansatz = TwoLocal(num_spin_orbitals, ['ry', 'rz'], entanglement_blocks = 'iswap', entanglement='linear')
Gives the following error
Traceback (most recent call last):
File "<ipython-input-34-5d8e95fd9811>", line 2, in <module>
ansatz = TwoLocal(num_spin_orbitals, ['ry', 'rz'], entanglement_blocks = 'iswap', entanglement='linear')
File "/opt/conda/lib/python3.8/site-packages/qiskit/circuit/library/n_local/two_local.py", line 177, in __init__
super().__init__(num_qubits=num_qubits,
File "/opt/conda/lib/python3.8/site-packages/qiskit/circuit/library/n_local/n_local.py", line 140, in __init__
self.entanglement_blocks = entanglement_blocks
File "/opt/conda/lib/python3.8/site-packages/qiskit/circuit/library/n_local/n_local.py", line 248, in entanglement_blocks
self._entanglement_blocks = [self._convert_to_block(block) for block in blocks]
File "/opt/conda/lib/python3.8/site-packages/qiskit/circuit/library/n_local/n_local.py", line 248, in <listcomp>
self._entanglement_blocks = [self._convert_to_block(block) for block in blocks]
File "/opt/conda/lib/python3.8/site-packages/qiskit/circuit/library/n_local/two_local.py", line 248, in _convert_to_block
raise ValueError(f'Unknown layer name `{layer}`.') from ex
ValueError: Unknown layer name `iswap`.
"
"['programming', 'qiskit']"," Title: Symbolic computation with quantum circuitsBody: What are my options for computing symbolic results for quantum circuits?
I have identified some possibilities:
- SymPy (Python library, see also this), unfortunately, the software forces you to encode the matrix of each gate explicitly instead of working with circuits;
- IBM Qiskit v0.25 operator framework (Python library), which claims
Qiskit operators fully support parameterization
even if it seems not completely true since the same error of this older question holds and this issue is still open.
"
"['quantum-gate', 'quantum-state', 'grovers-algorithm']"," Title: Is Grover's algorithm suitable for this search problem?Body: I wonder if we can utilize Grover's algorithm to solve the following search problem.
Leetcode 33. Search in Rotated Sorted Array
Example 1:
Input: nums = [4,5,6,7,0,1,2], target = 0
Output: true
Example 2:
Input: nums = [4,5,6,7,0,1,2], target = 3
Output: false
Let's ignore the fact that "the array nums sorted in ascending order" initially and suppose this array is an unstructured list of integers, which satisfied with the problem setting about Grover's algorithm.
So, can I use this Quantum algorithm to solve this problem with $O(\sqrt{N})$ complexity?
How to make an initial uniform superposition with $N$ states, which $N$ is not 2, 4, 8, 16 etc.? For example, I can use 2 qubits and 2 $H$ gates to construct a superposition about $|00\rangle$, $|01\rangle$, $|10\rangle$ and $|11\rangle$, with uniform probabilities $\frac{1}{4}$. But what about a list containing only 3 integers, [0, 2, 3], corresponding $\frac{1}{\sqrt{3}}(|00\rangle + |10\rangle + |11\rangle)$. How to use quantum circuit to express this superposition?
"
"['vqe', 'notation']"," Title: How does this expression from the VQLS paper result in a CZ-gate?Body: I am reading the VQLS paper and equation C2 on page 10 they have:
$ \delta_{ll'}^j = \beta_{ll'} + \langle0|V^\dagger A_{l'}^\dagger U(Z_j \otimes I_\bar{j}) U^\dagger A_lV|0\rangle $
Here they define the $I_\bar{j}$ as "the identity on all qubits except qubit $j$" (see the text below equation 7).
They then go on to say that equation C2 can be calculated from the circuit in Fig.9c (reproduced below).
I understand how the circuit is made except for the $CZ$ gate. Is it the case that $(Z_j \otimes I_\bar{j}) = CZ$ and if so, can you demonstrate how this is the case?
"
"['programming', 'error-correction', 'simulation', 'stim']"," Title: 'Best practices' for making Stim run as fast as possible?Body: I'm currently testing out an error-correction surface code circuit in Stim.
I've tried a 19x19 surface code over 10k rounds of syndrome extraction sampled 256 times, and this takes about 165 seconds. This comes out to roughly ~100s of nanoseconds per measurement, which is not as fast as I'd like.
I was wondering if there are 'best practices' for making circuits as fast as possible in Stim?
"
['graph-states']," Title: How are the two definitions of graph state mathematically equivalent?Body: There are at least two definitions of Graph State, two of them are shown in Wikipedia. The first definition is via quantum states, while the second one is from the point of view of the stabilizer group. How are the two definitions mathematically equivalent?
"
['graph-states']," Title: How can one check whether a given quantum state is a graph state?Body: We can build a quantum state from a graph, which is a mathematical concept.
But, vice versa, how can one check whether or not a given quantum state is a graph state?
"
"['grovers-algorithm', 'oracles', 'adiabatic-model']"," Title: In the adiabatic version of Grover's algorithm, how is the Hamiltonian constructed?Body: X-posted on physics.stackexchange
In quantum computation, there is a famous algorithm to search a marked item in an unstructured database called Grover's algorithm. It achieves a quadratic speedup over the best possible classical algorithm.
On the gate model of quantum computing, a phase oracle is used in Grover's algorithm. The phase oracle can be implemented by simulating the classical circuit that defines the function $f$, where $f$ indicates if an element (of the database for example) is marked ($f(x) = 1$) or not ($f(x) = 0$).
There exists a version of Grover's algorithm for the adiabatic quantum computer architecture as well.
However here the final Hamiltonian has a very similar form to the phase oracle in the gate model.
The phase oracle had to be constructed with a quantum circuit simulating the classical circuit, that defines $f$.
But in the adiabatic case, how can the final Hamiltonian be constructed?
The problem is, that the Hamiltonian contains a projector onto the unknown state/the marked element.
"
"['density-matrix', 'information-theory']"," Title: How can we prove that the covariance satisfies $\mathrm{Cov}_\rho(X,Y)=\mathrm{Cov}_\rho(Y,X)$?Body: While attempting to prove the Cauchy Schwarz Inequality I came across this problem. First of all, if we are given a $\rho$ density matrix and two matrix of obserables $X,Y$, after defining the Covariance as:
$$COV_{\rho}(X,Y) = \mathbb{E}_{\rho}[(X-\mu_XI)^{\dagger}(Y-\mu_YI)]$$ where $\mathbb{E}_{\rho}(X)= tr(\rho^{\dagger}X) = \sum_{ij}\rho_{ij}X_{ij}$ and $\mu_X = \mathbb{E}_{\rho}(X)$ and the same for Y.
How can we formally prove that:
$$COV_{\rho}(X,Y)= COV_{\rho}(Y,X)$$
I was considering that since $X,Y$ are both observable then a meaningful conclusion can be taken by that, since $X^{\dagger} = X$ but what if $X$ is not necessarily like this? Would it still hold?
"
"['programming', 'qiskit', 'textbook-and-exercises']"," Title: PyTorch and Qiskit example from the Qiskit textbook seems brokenBody: After executing the proceeding code blocks, when I try to copy the same code from Qiskit textbook on my jupyter notebook, I get the error as
QiskitError: 'Data for experiment "circuit-109" could not be found.'
simulator = qiskit.Aer.get_backend('qasm_simulator')
circuit = QuantumCircuit(1, simulator, 100)
print('Expected value for rotation pi {}'.format(circuit.run([np.pi])[0]))
circuit._circuit.draw(
)
Please suggest:
<ipython-input-23-06b09ff4dd69> in <module>
2
3 circuit = QuantumCircuit(1, simulator, 100)
----> 4 print('Expected value for rotation pi {}'.format(circuit.run([np.pi])[0]))
5 circuit._circuit.draw()
<ipython-input-22-e6eb9c91d6f9> in run(self, thetas)
28 parameter_binds = [{self.theta: theta} for theta in thetas])
29 job = self.backend.run(qobj)
---> 30 result = job.result().get_counts(self._circuit)
31
32 counts = np.array(list(result.values()))
~\anaconda3\lib\site-packages\qiskit\result\result.py in get_counts(self, experiment)
261 dict_list = []
262 for key in exp_keys:
--> 263 exp = self._get_experiment(key)
264 try:
265 header = exp.header.to_dict()
~\anaconda3\lib\site-packages\qiskit\result\result.py in _get_experiment(self, key)
368
369 if len(exp) == 0:
--> 370 raise QiskitError('Data for experiment "%s" could not be found.' %
371 key)
372 if len(exp) == 1:
QiskitError: 'Data for experiment "circuit-109" could not be found.'```
"
"['noise', 'graph-states']"," Title: Graph States subjected to finite erasuresBody: The appendix to the paper Graph States as a Resource for Quantum Metrology states that when graph states subjected to finite erasures, $$G\Rightarrow Tr_\vec{y}G.$$ While more explicitly he explains the formula as
$$G_\vec{y} = \mathrm{const}\times\sum_{\vec{y}}Z_\vec{j}\lvert G\rangle\langle G\rvert Z_\vec{j}.$$
I was wondering, how can these two statements the same, i.e., why the erasure error can be stated as the operation of $Z$? I know $I + Z$ can be the erasure error, but how can $Z$ alone stand for the erasure error?
"
"['qiskit', 'vqe']"," Title: Compute measurement values of observables by QiskitBody: Is there a way to get certain measurement results by variational quantum eigensolver in qiskit? More specifically, I want to get measurement results for certain operators, like $\langle a^\dagger_ia_j\rangle$ (which I assume that I later transform it into the qubit version using Jordan-Wigner transformation) for every $i,j$ in the system. Therefore, I need to get the measurement results for the matrix for, say, $10^4$ shots. I noticed that the VQE class provides the function to calculate the expection value, can I use this function to get my job done, or there are any other ways to achieve this?
"
"['quantum-state', 'entropy', 'partial-trace']"," Title: Partial trace instead of trace in definition of entropyBody: For a bipartite quantum state $\rho_{AB}$, we have that the von Neumann entropy is
$$S(\rho_{AB}) = -\text{Tr}(\rho_{AB}\log\rho_{AB})$$
If instead, one took the partial trace above and obtained
$$\rho'_A = -\text{Tr}_B((\rho_{AB}\log\rho_{AB}))$$
Is $\rho'_A$ an object that has been studied? Its trace gives us the entropy of $\rho_{AB}$ and it is positive semidefinite so I'm wondering if (up to normalization) it is related $\rho_A$ and $\rho_B$ in some way?
"
"['algorithm', 'quantum-advantage']"," Title: How are quantum computers more powerful than classical computers?Body: I feel the answer to this question is just out of reach - I "understand" the implication that a quantum computer uses all combinations of bits simultaneously compared to a classic computer, and that clearly gives a huge boost to processing times, however I'm struggling to quite grasp how.
I watched a TED talk on quantum computing in which the gentleman said that a 300 qubit QC would be more powerful than a regular PC with one bit of memory for every atom in the universe. They also mentioned that Google have created a QC with 53 qubits.
So to try and get my head around it, I decided to compare this to my PC.
Forgetting memory needed for anything other than storing combinations, if I have 16GB of RAM available, that's 217'179'869'184 possible combinations, or ~57 million lots of 53 bits (with each one in one specific combination).
So for each cycle of combinations, my PC is able to hold ~57 million combinations of 53 bits, and if my PC is running at 4.1GHz, that's 7.0E+19, or in the region of 266 combinations per second.
Now I have a good PC, but it seems to be reasonably on a par with Google's quantum computer, which just seems wrong. I know that I've not used an exact science to calculate things but I can't follow where I've screwed up the maths?
The claim for the 300 qubit QC I also can't follow with the above logic.
As excel won't work with stupidly large numbers I tried to do this on paper, so bear with me:
There are 10E+80 atoms in the universe, so this number of bits would give 2(10E+80), or 2800 combinations. An unholy number that no-one could possibly comprehend.
For the QC there are 300 qubits or ~28 therefore one could store 2792 combinations at any one time, which is already way above the 2300 combinations available to a 300 qubit QC..?
"
"['programming', 'qiskit', 'measurement', 'vqe']"," Title: How to measure a qubit Hamiltonian in qiskitBody: I am using qiskit to get some measurement results of observables similar to the Hamiltonian. Can someone provide the way how qiskit measures the Hamiltonian (Jordan-Wigner transformed) when using VQE? Or can they just provide the source code link.
"
"['quantum-gate', 'quantum-optics']"," Title: After a photon passes through the phase shifter, does it gain the geometric phase or dynamical phase?Body: In Quantum Mechanics, the phase can be divided into geometric phase and dynamical phase. In mach-zehnder interferometer, after the photon passes through the phase shifter, what kind of phase does it gain? The geometric one or the dynamical one? Geometric phase is the phase like Berry Phase, and there are differences between them.
"
"['qiskit', 'circuit-construction']"," Title: Can Qiskit decompose circuits into non-IBMQ basis gate sets?Body: Let circ be a QuantumCircuit object. Running circ.decompose() returns a circuit that consists entirely of gates native to IBMQ computers (single-qubit operations + CNOT).
I'm interested in decomposing circ into a circuit consisting of gates native to ion-trap quantum computers (that is, single-qubit gates + Mølmer–Sørensen). Is there a way to do this in Qiskit?
"
"['hamiltonian-simulation', 'openfermion']"," Title: Finding the norm of a HamiltonianBody: I am experimenting with https://journals.aps.org/prx/pdf/10.1103/PhysRevX.8.041015 and in equation 36 I find that they use the norm of the Hamiltonian.
Is there a clean way to compute it, or an upper bound lower than $\lambda = \sum_j |w_j|$ for the Hamiltonian $H = \sum_j w_j H_j$ and $H_j$ unitary, other than taking the Jordan-Wigner or Bravyi Kitaev, constructing the matrix and finding the norm of the matrix?
I expect this way to be quite slow and would avoid it if possible, but do not see how. Extra points if can be done cleanly using OpenFermion (notice that OpenFermion helps with DiagonalCoulombOperator but not in any other case).
Thanks!
"
"['quantum-operation', 'kraus-representation']"," Title: Kraus representation of a convex combination of CPT mapsBody: Let $\Phi_1,\Phi_2$ be CPT maps with Kraus decomposition
\begin{equation}
\Phi_1=\sum_{k=1}^{d_1}M_k\rho M_k^\dagger, \quad \Phi_2=\sum_{k=1}^{d_2} N_k\rho N_k^\dagger, \quad \text{s.t.} \quad \sum_{k=1}^{d_1}M_k^\dagger M_k=\sum_{k=1}^{d_2} N_k^\dagger N_k=\mathbb I.
\end{equation}
and let $p\in[0,1]$ . Consider the following (convex) combinations of the two maps:
\begin{equation}
\Phi=p\Phi_1+(1-p)\Phi_2.
\end{equation}
I'd like to find a Kraus decomposition for this map. Inserting the above gives
$$
\Phi(\rho)=p\left(\sum_{k=1}^{d_1}M_k\rho M_k^\dagger\right)+(1-p)\left(\sum_{k=1}^{d_2} N_k\rho N_k^\dagger\right),
$$
The two representations, in general, have a different number of elements; I guess I can always fix this by taking $D:=\max(d_1,d_2)$ and extend the smallest one with null operators. After doing this, one can rewrite the sum as
$$
\Phi=p\left(\sum_{k=1}^DM_k\rho M_k^\dagger-N_k\rho N_k^\dagger\right)+\sum_{k=1}^DN_k\rho N_k^\dagger
$$
which strikes me something we need to do to exploit the convexity property. To make progress, I've thought about inserting a few identities by the normalization conditions above. However, I can't quite make it work.
"
"['resource-request', 'nisq']"," Title: Definition of a NISQ device with respect to qubit counts and error ratesBody: How do we define whether a device is a noisy intermediate-scale quantum (NISQ) device with respect to number of qubits and their error rates? Does it make sense to do this? I believe I once saw a definition of a NISQ device as one with on the order of $n \le 10^5$ qubits and single qubit error rates on the order of $\epsilon \ge 10^{-4}$ – are there any references that attempt to define the 'intermediate-scale' part of NISQ? As far as I'm aware, John Preskill did not provide any explicit definitions (this seems to have been prudent at the time, perhaps it still is).
Attempting to unpack things a bit, it seems that a NISQ device must be one that is designed to leverage noisy, not logical (error-corrected), qubits. If we are to believe that, then the obvious question is how many logical qubits do we need to justify entering the fault tolerant quantum computing (FTQC) regime? Do we require a quantum supremacy experiment on a FTQC such as the one demonstrated by the Google-led collaboration or does a more appropriate alternative exist?
Let's say that the we answer the latter question in the affirmative and assume 53 qubits is sufficient to realize an equivalent quantum supremacy in the FTQC regime (i.e. 53 logical qubits), can we estimate the transition from NISQ to FTQC to meaningfully occur once a system capable of error correcting the $n$ number of noisy qubits with single qubit1 error rate $\epsilon$ to yield 53 logical qubits capable of completing a similar RCS task with XEB benchmarking? If so, what do we estimate the order of $n$ noisy qubits and $\epsilon$ error rate(s) to be?
Another way to think about this: What would an update to this 2018 graph from Google AI Blog look like?
Any answers which explain the current state of thinking with respect to the question would be fantastic.
1. Setting aside that single qubit errors are far from the only errors we're concerned with.
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises', 'nielsen-and-chuang', 'bloch-sphere']"," Title: Exercise 4.6 in Quantum Computing and Quantum Information Nielsen and ChuangBody: Question 4.6: One reason why the
$R_\hat{n}(θ)$ operators are referred to as rotation operators is the following fact, which
you are to prove. Suppose a single qubit has a state represented by the Bloch
vector $λ$. Then the effect of the rotation$ R_\hat{n}(θ)$ on the state is to rotate it by an
angle $θ$ about the $\hat{n}$ axis of the Bloch sphere. This fact explains the rather
mysterious looking factor of two in the definition of the rotation matrices.
In this question $\hat{n} = (n_x, n_y, n_z)$ is a unit vector in three dimension and we have
$R_\hat{n}(θ) = cos(\theta/2) I - isin(\theta/2)(n_xX + n_yY + n_zZ)$
I don't understand the idea of this question? I need some explanation of this question.
"
"['programming', 'qiskit', 'chemistry']"," Title: How do I work with Gaussian in Qiskit?Body: I am trying to run this Qiskit Nature tutorial (Vibrational Structure) and it uses the GaussianForceDriver. Every time I run the Gaussian job from Qiskit I get this message:
QiskitNatureError: Could not locate Gaussian 16 executable 'g16'. Please check that it is installed correctly.
Do I have to install the commercial version of Gaussian, or should it work with just the Qiskit Nature module? If that's the case, what could be the reason for getting this error if I already installed all requirements for Qiskit Nature? Thank you!
"
"['circuit-construction', 'grovers-algorithm', 'quantum-circuit']"," Title: Method to mark only when certain conditions are satisfied in the superposition states of qubitsBody: I am Newbie in Quantum Computing World.
While studying on my own, I was curious about one thing, so I asked this question.
My question is as follows:
- When I configure the superposition states of qubits through Hadamard gate and input this to a certain function, for output superposition states of qubits, is there a way to mark only two cases that meet certain conditions through checker qubits?
For example, consider the superposition states with the number of $2^{128}$ cases composed of 128 qubits (meaning after passing through the Hadamard gate).
Let's say we input this to a certain function (running on the quantum circuit) and get the output as superposition states. At this time, I want to mark in checker qubit(or ancill qubit) only two inputs that satisfy a specific value by performing xor (exclusive or) among the outputs. Are there any algorithms that can do this?
All the best!
"
"['hamiltonian-simulation', 'adiabatic-model']"," Title: Why is the time ordering omitted in the trotterised version of the time-dependent evolution operator?Body: The unitary evolution of a time-dependent hamiltonian is given by the time-ordered matrix exponential
$$\begin{aligned}
U(t)&=\mathcal T\exp\left[-i\int_0^tH(\tau)d\tau\right]\\
&=I-i\int_0^td\tau\,H(\tau)-\frac12\int_0^td\tau\int_0^t d\tau'\,\mathcal T[H(\tau)H(\tau')]+\ldots\\
&=I-i\int_0^td\tau\,H(\tau)-\int_0^td\tau\int_0^\tau d\tau'\,H(\tau)H(\tau')+\ldots
\end{aligned}$$
To implement $U(t)$ on a quantum computer, people often work with a trotterised form, where the integrals are discretized as Riemann sums. One typically encounters expressions such as (arXiv:1805.11568, eq. 1):
$$\begin{aligned}
U(t)%&\approx\exp[-i\sum_{a=0}^{k-1}H(a\Delta\tau)\Delta\tau]\\
&\approx\prod_{a=0}^{k-1}\exp[-iH(a\Delta\tau)\Delta\tau]~~~~(\Delta\tau=t/k)
\end{aligned}$$
However, in this expression, the time ordering symbol $\mathcal T$ has somehow vanished.
What's going on here?
"
"['resource-request', 'quantum-operation', 'kraus-representation', 'channel-capacity']"," Title: Quantum capacity for serial composition of quantum channelsBody: Recently, I have been working with quantum channel capacity for quantum-quantum channels and I was wondering if there exist some results for channel compositions.
Specifically, I have been looking for results on what happens to quantum channel capacity when a serial composition of quantum channels is considered, i.e. $C(\mathcal{N_1}\circ\mathcal{N_2}) = ?$ where $\mathcal{N_1}$ and $\mathcal{N_2}$ are the quantum channels in consideration.
The channels are described by their Kraus operators $\{E_k^1\}$ and $\{E_j^2\}$. Note that the serial composition channel is a quantum channel that will be described by Kraus operators $\{E_k^1 \cdot E_j^2\}$, i.e. all the possible products of the Kraus operators of the individual channels.
I have been looking around but have not found anything interesting yet. I would appreciate any information, partial results and especially literature on the topic.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'non-locality', 'state-preparation']"," Title: How to prove that EPR outcomes have equal probability no matter the basis?Body: Recently in class, we learned about the EPR state. I know that no matter what basis the first qubit is measured in, the two outcomes have an equal probability. However, how does one prove this? I somewhat understand what is happening and why, but if you know where a through proof of this might be that would be amazing.
"
"['programming', 'qiskit', 'measurement']"," Title: How to transform fermionic operators in qiskitBody: I encountered some problems when using the qiskit pakage to define the 2-electron reduced density matrix (2-RDM), which is a 4-index tensor, $\langle a_i^\dagger a_j^\dagger a_k a_l\rangle$. I need to first transform each term in the tensor (2-RDM) to the qubit form by Jordan-Wigner transformation. Then, I can measure each term using the expectation feature of the VQE function in qiskit. However, the qiskit.chemistry.fermionic_operator class only support Hamiltonian to be transformed to the qubit form. Therefore, there are two questions here to finish the 2-RDM measurement job. The first is how to define general fermionic operators by qiskit, especially the one has the form of the 2-RDM. The second is that are there any build-in function in qiskit to tranform general fermionic operators to the qubit form.
"
"['quantum-state', 'algorithm', 'bb84']"," Title: What is the probability of detecting Eve's tampering, in BB84?Body: Alice sends a 0 in computational basis
I understand that theres a $\frac12$ probability that eve guesses the basis wrong, and can go with Hadamard. So it's $\frac12$ chance Eve will pick computational and $\frac12$ chance of Hadamard.
Now if Eve measured wrong and went with Hadamard, and Bob computational, however Bob got it wrong and got a $|1\rangle$ instead of $|0\rangle$, which is a $\frac12$ probability,
Theres a $\frac14$ probability Alice and bob will detect Eve's intrusion if they verify that bit.
This is all clear to me, however. Tampering is where I get confused. Detecting Eve tampered with a qubit is $\frac14$, and depending on the qubits $n$, Eve will go undetected with the probability $\left(\frac34\right)^n$
The question is (keep in mind there is an intruder), say Alice sent $20$ qubits to Bob, and only $10$ qubits Bob chose the correct basis, the rest are discarded. Alice and Bob then compare the results between the two to detect Eve, is the probability of detecting Eve
$1-\left(\frac34\right)^{10}$ or just $\left(\frac34\right)^{10}$?
"
"['programming', 'qiskit', 'grovers-algorithm', 'oracles']"," Title: Implementing 3-Qubit Grover Algorithm in QiskitBody: The Qiskit tutorial on Grover's Algorithm shows an example of finding two marked solutions out of 8 items, produced by 3 qubits. Using the general diffuser code it provides, however, I realize that the algorithm fails to properly find the solution if the oracle is set to mark single item.
Specifically, the oracle in the example marks two items:
qc = QuantumCircuit(3)
qc.cz(0, 2)
qc.cz(1, 2)
oracle_ex3 = qc.to_gate()
oracle_ex3.name = "U$_\omega$"
I've changed it to mark just one:
qc = QuantumCircuit(3)
qc.cz(0, 2)
oracle_ex3 = qc.to_gate()
oracle_ex3.name = "U$_\omega$"
Now that there is only one solution and 8 possibilities, we should iterate the Grover oracle + diffuser twice, for which I did:
n = 3
grover_circuit = QuantumCircuit(n)
grover_circuit = initialize_s(grover_circuit, [0,1,2])
grover_circuit.append(oracle_ex3, [0,1,2])
grover_circuit.append(diffuser(n), [0,1,2])
grover_circuit.append(oracle_ex3, [0,1,2])
grover_circuit.append(diffuser(n), [0,1,2])
grover_circuit.measure_all()
And here is the measurement outcome plot:
As far as I expect the plot should show the state $|101⟩$ with nearly 100% probability. I tried iterating it 3 and 4 times, but the result is still messy. Is there something that I'm missing here?
"
"['quantum-gate', 'quantum-state', 'algorithm', 'hadamard', 'deutsch-jozsa-algorithm']"," Title: Understanding Deutsch AlgorithmBody: From the image below, if we focus on the first qubit, we know after Hadamard (state 1) $|0\rangle$ will become $|+\rangle$ and the second qubit $|1\rangle$ will become $|-\rangle$.
What exactly would the result be after $U_f$? I understand that $U_f$ performs a CNOT gate on the qubits. But how is this result shown? By this I mean the image below is it (the equation for state 2), $|0\rangle$, $|1\rangle$, $|+\rangle$ or $|-\rangle$ and why is it that specific one? For instance, I presume state 2 would be $|-\rangle$? is it simply the process that if it was previously $|+\rangle$ then it just flips after going through CNOT gate to $|-\rangle$? In which state 3 then results in it being $|1\rangle$ ?
state 2:
By states I refer to the bottom numbered symbols within this image below.
"
"['quantum-state', 'bloch-sphere']"," Title: Can I understand mixed states using the Bloch sphere?Body: I'm a bit confused with the representation of mixed states in a Bloch sphere. Are they represented as points or vectors? For pure states, they're vectors on the surface of the Bloch sphere and have a norm of 1. If I have a mixed state $\rho=\sum_sp_s|\psi_s\rangle\langle\psi_s|$, is there a way I can see $\sum_sp_s=1$ on the Bloch sphere?
"
"['quantum-gate', 'notation']"," Title: What is the name for the gate rotating around $Z$ by $\pi/8$?Body: I think similar to $R_z\big(\frac{\pi}{4}\big)$ gate named T gate, how to standardize the name $R_z\big(\frac{\pi}{8}\big)$?
"
"['quantum-gate', 'ibm-q-experience', 'error-correction', 'ibm']"," Title: Characteristics of the IBM quantum computerBody: On the IBM Quantum Composer website, there are characteristics of qubit computers. For example, ibmq_16_melbourne.
But there is no description anywhere of what:
T1(us),
T2(us),
Frequency (GHz),
Readout assignment error,
Prob meas0 prep1,
Prob meas1 prep0,
Readout length (ns),
ID error,
√x (sx) error,
Single-qubit Pauli-X error,
CNOT error,
Gate time (ns) means.
Could you write down what they mean?
And why isn't there, for example, a Pauli-Z error, even though there is a Pauli-X error?
"
"['quantum-gate', 'superposition', 'quantum-memory']"," Title: When writing data into qRAM, can I do it in a superposition state?Body: In general, quantum algorithms are said to be hybrid algorithms.
Especially when storing data in qRAM, it seems to be done through classical calculations.
Is it possible to write this part directly to qRAM after passing through Hadamard Gate and performing a specific operation?
In other words, can the data in the superposition states be stored directly in qRAM?
"
"['quantum-operation', 'kraus-representation']"," Title: Is there an upper-bound on the operator norm (max-singular value) of the matrix representation of a quantum channel?Body: Suppose $\Phi$ is a CPTP map with Kraus operators $\phi_n$, so that $\hat{\Phi} := Σ_n (\phi_n ⊗ \phi_n^*)$ is the matrix representation (here $*$ being entry-wise complex conjugate).
Is there an upper bound for $\|\hat{\Phi}\|_{\rm op}$ (where $\|\cdot\|_{\rm op}$ is "operator norm" / max-singular value)? And how should I interpret this quantity?
I need this for purely technical reasons (i.e. to bound some other quantity), but I'd still like to know what it means. I know it must be at least $\leq\sqrt{d}$, because e.g. it happens for the 1-qubit completely amplitude damping channel (defined here, with $\gamma=1$). I also generated a 2-qubit channel from the single-qubit amplitude damping (with Kraus operators $\phi_i\otimes\phi_j$, which to be fair I'm assuming it is indeed a channel) and the same holds. Furthermore, I'm tempted to understand this operator norm as a measure of how much the purity of a state (or I guess in a sense it's coherence) can be increased with the channel: for the example I cited of the amplitude damping channel, such case takes any state to the $|0\rangle$ state, on the other hand, if I try a totally depolarizing channel (such that $\Phi(\cdot)=\boldsymbol{1}/d$ ), then I get $\|\hat{\Phi}\|=1/2$ (which anyhow, is not $1/\sqrt{2}$, as I would've expected). I just haven't been able to prove or understand this generally.
"
"['qiskit', 'programming']"," Title: How does one use the Qiskit CDMKRippleCarryAdder?Body: How does one use (call from a main program)
Qiskit's CDKMRippleCarryAdder in a quantum circuit, or for that matter, any other Qiskit library of a similar nature?
For example, how do I create a 3 bit half adder module using the library to be used as part of an oracle for Grover's algorithm?
Side-note:
I've programmed for many years in traditional languages like C/C++ but I'm new to python and even newer to Qiskit and I'm very confused about how the parameters get passed in the case of the ripple carry adder library.
I've tried searching for forums, but haven't found any other than this one.
There also seems to be many tutorials on basics of quantum gates, but that's not what I'm looking for at the moment.
Thanks in advance for your help.
"
"['algorithm', 'ibm-q-experience', 'error-correction', 'grovers-algorithm', 'noise']"," Title: Accuracy of Grover algorithm is 100% for 2 qubit, 94.5% on 3 qubit and 96.2% for 4 qubit on simulator. Why it decreasing and then again increasing?Body: The accuracy of Grover's algorithm decreases for 3 qubit then increases for 4 qubit and then again increases for 5-qubit on simulator (qasm simulator) with pi/4(sqrt N) iterations. What is the reason behind that? Why there is no specific patten.
"
"['circuit-construction', 'quantum-circuit', 'hamiltonian-simulation']"," Title: Simulating the Ising-like model as a quantum circuitBody: We are interested in simulating the 1d Ising model Hamiltonian using a Quantum Circuit (QC). A similar question was posted before with no answers. Here we will assume, for simplicity, 3 lattice sites and $J=-1$.
Generically, the Hamiltonian is given as
$$
H = -J \sum_{ij} \sigma_i^z \otimes \sigma_j^z.\tag{1}
$$
For our case of interest this Hamiltonian becomes:
$$
H = \sigma^z \otimes \sigma^z \otimes \mathbb{1} + \mathbb{1} \otimes \sigma^z \otimes \sigma^z.\tag{2}
$$
Obviously I have not included any periodic boundary conditions. There are only three lattice sites so there are only two interaction terms. In what follows I will replace $\sigma^z$ with $Z$ implying the corresponding quantum gate.
The evolution operator corresponding to this Hamiltonian is given as
$$\tag{3}
U(t) = e^{-i (Z \otimes Z\otimes \mathbb{1} + \mathbb{1}\otimes Z \otimes Z)t}.
$$
Should these operators not commute we would have to use the Trotter-Suzuki formula. However, they do commute and as a result there is no need to use it.
In each of the two summands there exists a unit operator which can be completely ignored from the circuit. Now, for the operator $Z \otimes Z$ the curcuit would read
$$
\mathrm{CNOT} R_z(2t) \mathrm{CNOT}:
$$
My question is whether as the generalization to the 3 lattice sites Hamiltonian is as simple forward as this:
Of course the $R_Z$ gate runs for $2t$ according the unitary $U(t)$. Finally, does this generalize as simply to the $n$ lattice site Ising model?
"
"['quantum-operation', 'kraus-representation']"," Title: What's a ""natural"" way to show that, for unital channels, $\Phi(X)=X$ iff $[X,A_a]=0$ for all Kraus operators $A_a$?Body: This is a statement proved in Watrous, Theorem 4.25, page 229 of the online version.
Let $\Phi\in\mathrm C(\mathcal X)$ be a unital channel with Kraus representation $\Phi(X)=\sum_a A_a X A_a^\dagger$. Then for any linear operator $X\in\mathrm{Lin}(\mathcal X)$, a linear operator $X$ is a fixed point for $\Phi$ iff it commutes with all Kraus operators:
$$\Phi(X)=X\iff [X,A_a]=0\,\,\forall a.$$
To prove this, the author defines the operators $C_a\equiv [X,A_a]$ and then $C\equiv \sum_a C_a C_a^\dagger$, and observe that, assuming $\Phi(X)=X$, we have
$$\Phi(C) = \sum_a (XA_a-A_a X)(A_a^\dagger X^\dagger - X^\dagger A_a^\dagger)
\\= X\Phi(I)X^\dagger
- X \Phi(X^\dagger) - \Phi(X)X^\dagger + \Phi(XX^\dagger)
= \Phi(XX^\dagger) - XX^\dagger.$$
Because $\Phi$ is trace-preserving, this implies that $\operatorname{Tr}(C)=\operatorname{Tr}(\Phi(C))=0$, and thus $C=0$, which in turn implies $C_a=[X,A_a]=0$.
This all works and is relatively straightforward, but leaves me wondering where the idea of using such operators came from. Why test the action of $\Phi$ on these particular operators $C$? Is there any intuition to it? Different routes to the result would also be interesting.
For example $\Phi(X)=X$ is equivalent to $\operatorname{vec}(X)$ being an eigenvector $K(\Phi)=\sum_a A_a\otimes \bar A_a$ (natural representation). If there was a nice way to see how the "unitality" of $\Phi$ is reflected in the structure of the Kraus operators (aside from them satisfying $\sum_a A_a A_a^\dagger=I$), maybe this could offer another way to see why $\sum_a (A_a\otimes\bar A_a)\operatorname{vec}(X)= \operatorname{vec}(X)$ should imply $[X,A_a]=0$.
From a different perspective, one could observe that, for a vector $\psi\in\mathcal X$, we have $\Phi(\mathbb P(\psi))=\sum_a \mathbb P(A_a \psi)$, where $\mathbb P(v)\equiv vv^\dagger$. Thus $\psi$ is a fixed point iff $A_a\psi$ are all collinear: $A_a\psi=\lambda_a \phi$ for some coefficients $\lambda_a\in\mathbb C$ and fixed $\phi\in\mathcal X$.
This seems like a pretty strong condition, but still, I'm not sure how to convert it to the stated result.
"
"['simulation', 'complexity-theory', 'classical-computing', 'random-quantum-circuit', 'boson-sampling']"," Title: What is the relationship between the size of the Hilbert space for boson sampling and the complexity of classical simulating it?Body: My intuition is that the fastest classical algorithm for simulating some kind of noiseless quantum sampling process should scale roughly with the dimension of the Hilbert space: you would need to process each amplitude at least once in order to calculate a generic matrix element.
For random (noiseless) circuit sampling, this is indeed true: the fastest classical simulation algorithm, the Schrodinger algorithm, scales as $m|\mathcal{H}|$, where $m$ is the number of gates and $|\mathcal{H}| = 2^n$ (where $n$ is the number of qubits) is the dimension of the Hilbert space.
But for exact boson sampling, these two quantities seems strangely unrelated to each other, and either can be much larger than the other. The Wikipedia article on boson sampling says that for $n$ identical photons distributed across $m$ modes, the dimension of the Hilbert space is $\binom{n+m-1}{n} = \binom{n+m-1}{m-1}$, but the fastest known classical algorithm has runtime $O(n\, 2^n + m n^2)$. (Note that unfortunately, the Wikipedia article switches its definitions of $M$ and $N$ between different sections.)
- In the regime where $m \approx n \gg 1$, which is the case in the most advanced boson sampling experiments, we get that the Hilbert space dimension is $~4^n/\sqrt{n}$ and the runtime is $O(n\, 2^n)$, so the runtime only scales as the square root of the Hilbert space dimension.
- In the regime where $n \gg m$, the Hilbert space dimension is $(n/m)^m$ (times subleading corrections) but the runtime is still $O(n\, 2^n)$, so for a fixed number of modes $m$ the runtime is exponentially longer than the Hilbert space dimension (which only scales polynomially in the number of photons).
- In the regime where $m$ is exponentially larger than $n$, the Hilbert space dimension is $(m/n)^n$ (times subleading corrections), and if hold $n$ fixed then the runtime is $O(m)$, so the runtime scales as the $n$th root of the Hilbert space dimension.
This all seems very weird to me. Why does the runtime only scale as a root of the Hilbert space size in certain regimes, but is exponentially longer than the Hilbert space size in other regimes? This seems both more complicated and less intuitive than in the case of random circuit simulations, where the two quantities are directly proportional as I'd intuitively expect.
"
"['qiskit', 'programming', 'quantum-state', 'ibm-q-experience', 'textbook-and-exercises']"," Title: Given this code fragment, what is the probability that a measurement would result in $|0\rangle$?Body: Trying to understand below probability how it occured?
qc = QuantumCircuit(1)
qc.ry(3 * math.pi/4, 0)
A. 0.8536
B. 0.5
C. 0.1464
D. 1.0
And the answer is C. But I can't understand the calculation behind it. Can someone please explain?
"
"['programming', 'error-correction', 'stim']"," Title: Efficient Way to Create an LUT in StimBody: What is the fastest and most resource-efficient way to create an LUT decoder for a quantum error correction code using Stim (https://quantum-journal.org/papers/q-2021-07-06-497/)?
Specfically, I am running simulations of a steane QECC using several conditional loops (this was addressed in the question Simulating flag qubits and conditional branches using Stim).
Is there an efficient way to create the relevant LUTs as well using the TableauSimulator?
"
"['qiskit', 'ibm-q-experience', 'measurement', 'noise', 'superposition']"," Title: Bias in the results of superposition measurements on IBMQ Backends, qiskitBody: Dear people on this forum,
I was doing some research, and I created this circuit in qiskit
Please bear in mind that I am really new to this field, and I do not retain much knowledge yet. Therefore I am grateful to whoever will help me out here.
qc = qiskit.QuantumCircuit(1, 1) # Make a circuit with 1 QuBit and 1 bit.
qc.u(np.pi / 2, 0, 0, 0) # Rotate Q1 to |+⟩. Emulation of a Hadamard gate via rotation
qc.measure([0], [0]) # Measuring the qubit.
It should be correct to assume that such a circuit should have 50% chance of a 0 outcome, and 50% of a 1 outcome.
But when I ran in on three IBMQ backends, namely IBMQ-Santiago, IBMQ-Lima, and IBMQ-Armonk, there always was a higher percentage of 0 outcomes. Sometimes, depending on which backend, a higher difference, and sometimes a lesser.
Each run ran on the backend with 8192 shots.
See the tables and graphs down below:
As you can see, the bias from the Armonk backend could be a mere statistical error. But it is a clear bias when you check the data from Santiago or Lima. And this could not be merely explained by quantum noise, correct?
Could finally someone explain the nature of such a phenomenon?
Thanks a lot in advance!
Mattia
"
"['quantum-gate', 'circuit-construction', 'quantum-circuit', 'gate-synthesis']"," Title: Confusion with the number of CNOTs in a circuitBody: I am a bit puzzled on the following circuit. According to this Quantum Computing SE thread it holds that
$$
e^{i(Z\otimes Z)t} = {\rm CNOT} (I\otimes e^{iZt}){\rm CNOT} \qquad (1)
$$
As a result we have the following circuit (C1):
Furthermore, for $e^{iZ\otimes Z\otimes Z t}$ we obtain the following circuit (C2):
I was reading arxiv:2003.13599 and in Figure 3 we see three unitaries corresponding to $I\otimes Z \otimes I$, $I \otimes Z \otimes Z$ and $Z \otimes Z \otimes I$ seen below (C3):
Which is very confusing. Specifically, let's focus for example on the middle part of Diagram (a) corresponding to $I\otimes Z \otimes Z$. The $I$ term (in the first qubit) can be ignored. Then, if we ignore the first wire we essentially should have the term $Z\otimes Z$ from Eq. (1) but nevertheless we see two pairs of CNOT gates just like in (C2) that corresponds to $e^{iZ\otimes Z \otimes Z t}$.
Why is this the case? I suspect this is somehow related to the extra wire we ( C2 has three wires but for some reason C3 has four).
"
"['entanglement', 'key-distribution']"," Title: In the E91 protocol, how can Alice and Bob detect Eve if she waits to measure until A&B publish their bases?Body: I'm studying the E91 protocol. Suppose Eve has a qubit entangled with Alice's and Bob's qubits.
I understand how Alice and Bob can detect Eve if Eve measures before A&B by testing Bell's inequalities.
I'm confused how Alice and Bob could detect Eve if Eve waits to measure her qubit until after A&B publish their bases.
My current understanding: Alice and Bob would measure collapsing the qubits into some state and destorying the entanglement. Eve could then wait until A&B publish their bases and then perfectly recover the secret key by measuring her qubits. And A&B can do nothing to prevent this.
Could someone help me understand what I'm missing here? Thanks!
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises', 'unitarity']"," Title: How to find the output state after evolution through a unitary?Body: I was reading about quantum postulates, and I have a few questions about the second postulate that describes the evolution of a quantum system.
For a system S, we describe the evolution after applying the unitary $U$ by the following:
$|S'\rangle = U|S\rangle$
I understand the idea a bit, I saw a couple of simple examples like H, but I would like to see it in action on a slightly more complex unitary (with a tensor product).
For example, can someone please give the detailed steps to calculate the following evolution for $|S\rangle = |00\rangle$.
- What would be the state for $|S'\rangle$ with $U = CNOT\circ (H\otimes I)$, I'm bit confused by the tensor product...
- What happens if we apply $|S''\rangle = U'|S'\rangle$ with $U'$ this time $U'=(H\otimes I) \circ CNOT$ (different order).
Thanks in advance and happy new year :)
"
"['programming', 'ibm-q-experience']"," Title: Simple Hadamard Circuit gives incorrect results?Body: I am running the simplest Hadamard circuit possible - one qubit, initialised to 0, apply H gate, measure in Z basis. When I run the circuit on the simulator I obtain the expected result (50% in 0, 50% in 1) but the "measurement probability" and "state vector" from the IBM Circuit Composer indicate I am in the state $|0\rangle$, with 100% probability to measure 0. Am I understanding this visualisation wrong? Why don't I see the 50%/50% measurement probabilities and the state vector to be $(\frac{1}{\sqrt{2}})(|0\rangle + |1\rangle)$?
"
"['quantum-gate', 'programming', 'qiskit']"," Title: Qiskit Controlled S and Controlled T GatesBody: I was implementing controlled S and T gates in qiskit and was wondering if there is any difference between using the cu1 and crz gates for this purpose. Qiskit doesn't seem to include explicit versions of these two gates.
circuit = qiskit.QuantumCircuit(2)
# a)
circuit.crz(theta=math.pi/2, control_qubit=0, target_qubit=1)
# b)
circuit.cu1(theta=math.pi/2, control_qubit=0, target_qubit=1)
In terms of the unitary the cu1 gate seems closer to what one would want, I would assume. Are there any other consequences I should be aware of?
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix']"," Title: How is a qubit in superposition between $|0\rangle$ and $|1\rangle$ different from a mixture of $|0\rangle$ and $|1\rangle$?Body: Given that a qubit in equal superposition of $|0\rangle$ and $|1\rangle$ is represented by following wave function
\begin{equation}
\Psi = \frac{1}{\sqrt 2}(|0\rangle + |1\rangle)
\end{equation}
and associated density matrix
\begin{equation}
\rho_1 = |\Psi\rangle \langle\Psi| = \frac{1}{2} \begin{pmatrix} 1 && 1 \\ 1 && 1 \end{pmatrix}
\end{equation}
Further a qubit in this state is considered to be in a pure state (even though its in a superposition) since the density matrix can be cleanly factored into a product.
Fact $F$ : When measured this qubit will turn out to be 0 or 1 with 50% probability each.
But there exists another density matrix consistent with the same fact $F$ as follows:
\begin{equation}
\rho_2 = \frac{1}{2} (|0\rangle \langle0|) + \frac{1}{2} (|1\rangle \langle1|)
= \frac{1}{2} \begin{pmatrix} 1 && 0 \\ 0 && 1 \end{pmatrix}
\end{equation}
and this matrix corresponds to a mixed state. Clearly $\rho_1 \neq \rho_2$ but they have same physical characteristics which is the fact $F$.
My Question: What is a physical fact or property that can be used to distinguish $\rho_1$ from $\rho_2$?
"
"['quantum-gate', 'matrix-representation']"," Title: Can we understand multi-qubit gates in terms of rotation groups?Body: I'm trying to reconcile (i) the statement that swapping two subsystems constitutes a rotation by $2\pi$ and (ii) the angle that is implied by the Hermitian generator of a SWAP gate.
I haven't tracked down an explicit statement of (i) but I think the idea is, using Dirac's "belt trick" one can show that the ends of a belt must be swapped twice to remove $4\pi$ worth of twist (rotations) applied to the belt buckle. So for Fermions (antisymmetric with respect to particle exchange) the SWAP of two subsystems results in a $2\pi$ rotation and some relative phase between the systems.
The statement (ii) is just that
$$
\text{SWAP} = \exp (i \frac{\pi}{4} (XX + YY + ZZ))
$$
where $X,Y,Z$ are pauli operators. By analogy with the relationship between $SU(2)$ and $SO(3)$ this seems to imply a rotation of some kind, but I'm not confident in this analogy. So my questions are
- Does the analogy for understanding single-qubit rotation gates in terms of $SO(3)$ extend to understanding multi-qubit gates in terms of some other rotation group?
- If not, how should I understand the $\text{SWAP}$ gate in terms of rotations in the context of quantum computing (since there does seem to be a physics explanation connecting the two)?
"
"['entanglement', 'measurement']"," Title: How can measuring a particle in a GHZ state leave behind a maximally entangled pair?Body: I am trying to understand the section on the Wikipedia page for GHZ states entitled "Pairwise entanglement". In this section, it is claimed that measuring the third particle in a GHZ state in the X basis can leave behind a maximally entangled Bell state. However, there is no source cited and I am having some trouble understanding this, so I was wondering if anyone could perhaps explain this further.
Also, how would the measurement outcome of this X-basis measurement affect the state produced?
"
"['textbook-and-exercises', 'hadamard', 'deutsch-jozsa-algorithm', 'qudit']"," Title: How does $U_f$ act on a qudit state in the Deutsch-Jozsa AlgorithmBody: The problem starts with the given the input state $|\psi_{in} \rangle = |0 \rangle |1 \rangle$, I'm asked to calculate $|\psi'\rangle = H_d \otimes H_d |\psi_{in} \rangle$ where $H_d$ is the Hadamard gate for $d=4$ dimensional system.
$$H_d = \frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1\\
1 & -1 & 1 & -1\\
1 & 1 & -1 & -1\\
1 & -1 & -1 & 1
\end{pmatrix}$$
Well, $H_d|0\rangle = |0\rangle + |1\rangle + |2\rangle + |3\rangle$ and $H_d |1 \rangle = |0\rangle - |1\rangle + |2 \rangle - |3 \rangle$. So $|\psi'\rangle = H_d \otimes H_d |\psi_{in} \rangle = \frac{1}{4} \sum_{x,y=0}^{d-1} (-1)^{y} |x\rangle |y \rangle$. The problem suggests that the $\frac{1}{4}$ is not part of the new state, but I think it is.
Now the question I'm stuck on is using the unitary operator $U_f | x,y \rangle = |x, y \oplus f(x) \rangle$, show that
$U_f|\psi'\rangle = \Big( \sum_{x=0}^{d-1}(-1)^{x} |x\rangle \Big) |1 \rangle_H$
$|1\rangle_H$ is not defined in the problem but I'm guessing it's equivalent to $H_d|1\rangle$
My problem is we don't know what $f(x)$ is, only that it might be constant or balanced. So why is $|y\rangle$ always transformed into $|1\rangle_H$?
Here, a function $f$ in $d$ dimensions is defined as constant if $f(0) \oplus f(1) \oplus \ldots \oplus f(d-1) = 0$ and it is balanced if $f(0) \oplus f(1) \oplus \ldots \oplus f(d-1) = \frac{d}{2}$ where $\oplus$ is addition mod $d$.
"
"['universal-gates', 'fault-tolerance', 'clifford-group']"," Title: What are the simplest examples of codes with transversal non-Clifford gates?Body: There are certain codes which have transversal non-Clifford gates. My question is, what are the simplest examples of such codes and how does one check for a non-Clifford gate? Is it a computationally intensive question, compared to checking for Clifford gates?
"
"['stabilizer-state', 'gottesman-knill']"," Title: Gottesman Knill theorem: why $O(n^2)$ classical operation to keep track of a Clifford gateBody: Starting from a state stabilized by Pauli matrices, and using only Clifford operations Gottesman Knill theorem ensures us that such algorithm can be classically simulated.
Indeed, if I call my initial state $|\psi \rangle$, I can define a Stabilizer group $S$ having for generators elements of the n-Pauli matrix group. I have $S=\langle g_1,...,g_n \rangle$
I consider $U$ a clifford gate. Then $U |\psi \rangle$ is stabilized by the stabilizer group $U S U^{\dagger}$.
Then $U |\psi \rangle$ is stabilized by $USU^{\dagger} = \langle U g_1 U^{\dagger},...,U g_n U^{\dagger}\rangle$
I simply have to compute $\{U g_i U^{\dagger}\}_{i=1..n}$ to keep track of my state.
My question:
It is said that such operation requires $O(n^2)$ classical operations (for instance in Nielsen & Chuang). Where does this $n^2$ comes from ? I can understand that I have $n$ calculations to compute each $U g_i U^{\dagger}$ for $1 \leq i \leq n$, but why exactly computing each of those would require additional $n$ calculations giving rise to the $O(n^2)$ ? I guess it depends on what we call an elementary operation.
"
"['complexity-theory', 'shors-algorithm', 'bqp']"," Title: What is stopping FACTORING from being BQP-complete?Body: Classical complexity theory makes much of the study of so-called intermediate problems - that is, problems that are in $\mathsf{NP}$ but are nonetheless not known to be in $\mathsf{P}$ and further not expected to be $\mathsf{NP}$-complete.
Commonly discussed examples of likely intermediate problems include, e.g., GRAPH-ISOMORPHISM and FACTORING. One reason why GRAPH-ISOMORPHISM and FACTORING are both thought to be of intermediate complexity is that neither are known to have an algorithm in $\mathsf{BPP}$, while both are known to be in $\mathsf{coNP}$ (or rather, $\mathsf{coAM}$ in the case of GRAPH-ISOMPORPHISM) - thus if, for example, FACTORING/GRAPH-ISOMPORPHISM were $\mathsf{NP}$-complete, then one would have the conclusion that $\mathsf{NP=coNP}$/the polynomial-time hierarchy $\mathsf{PH}$ collapse, both of which are believed to be unlikely.
Turning now to the $\mathsf{BQP}$ complexity class, noting the fact that FACTORING is both in $\mathsf{NP}$ with witnesses being the factors, and in $\mathsf{BQP}$ by Shor's algorithm, a conclusion is that FACTORING is not likely to be (promise) $\mathsf{BQP}$-complete. If FACTORING were complete for $\mathsf{BQP}$ then, for example, $\mathsf{BQP}\subseteq\mathsf{NP}$, which may be ruled out by the recent breakthrough of Raz and Tal.
Thus it may be natural to ask:
What is stopping FACTORING from being complete for $\mathsf{BQP}$?
GRAPH-ISOMORPHISM can be generalized/altered to SUBGRAPH-ISOMORPHISM, which is $\mathsf{NP}$-complete. Can FACTORING be generalized or altered in any way such that it is complete for $\mathsf{BQP}$, in much the same way that SUBGRAPH-ISOMORPHISM generalizes GRAPH-ISOMORPHISM to be $\mathsf{NP}$-complete?
"
['quantum-gate']," Title: Square root of Pauli operators: is there a common convention to define them uniquely?Body: There exists many different matrices square root. For instance I can define either of the two for square root of $X$:
$$\sqrt{X}^{(1)} \equiv \frac{1}{\sqrt{2 i}} \begin{pmatrix} 1 & i \\ i & 1 \end{pmatrix}$$
Or as suggested on wikipedia:
$$\sqrt{X}^{(2)} \equiv \sqrt{NOT} = \frac{1}{2} \begin{pmatrix} 1+i & 1-i \\ 1-i & 1+i \end{pmatrix} \neq \sqrt{X}^{(1)} $$
We notice that those two matrices do not differ by a global phase: they really act differently on quantum state.
Now, it is frequent in the litterature to simply see $\sqrt{X}$ or $\sqrt{Y}$ without further explanations. To be generic I consider $M$ a matrix in which I will consider its square root.
As long as we do $\sqrt{M} \sqrt{M}$ whatever the definition taken it doesn't matter. However I if we have calculations involving $\sqrt{M}$ without having it directly squared, the result might depend on the choice we took for the square root.
My question
Is there a uniform convention in quantum information to define square root of matrices ? Or more specifically square roots of Pauli ? Or each reference must specify which convention they take ?
"
"['quantum-state', 'correlations', 'quantum-optics']"," Title: How is the third-order autocorrelation measured in quantum optics?Body: The third order autocorrelation is defined as
$$\bar g^{(3)} = \frac{\langle \hat a^\dagger \hat a^\dagger\hat a^\dagger \hat a\hat a\hat a\rangle}{\bar n^3}.$$
How is this quantity measured in quantum optics, and how can it be interpreted in terms of probabilities?
What happens to this value, if we consider a monomode field coherent
state, a Fock state, or a thermal state?
Update****************
For measuring this quantity in quantum optics, we need 3 detectors and we need it for processes where we are interested in the possibility to have three photons at the same time. And g3 is proportional to <n(n-1)(n-2)> with n the operator
"
"['algorithm', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Are there quantum algorithms demonstrating speedup computing classical neural networks (in 2021)?Body: It seems like there are a number of different speed-ups for different machine learning algorithms:
But has anyone created an algorithm showing speed-up for neural networks? A similar question was asked a few years ago, but the answer is not so clear. It seems like it is an open problem as of 2014, and was interested in knowing if there have been any recent developments that demonstrate speedup.
"
"['algorithm', 'error-correction', 'grovers-algorithm', 'speedup']"," Title: Are applications with only polynomial speedup worth chasing after? (since error correction adds a heavy overhead)Body: A number of ML algorithms have demonstrated to have polynomial speed-up:
But this (I'm assuming) is without error correcting qubits. How practical are algorithms that only exhibit polynomial speed-up when error correction is taken into account? For example, will we need millions and millions of qubits to be able to even compete with modern computers?
"
"['programming', 'qiskit', 'simulation']"," Title: How can I fix the BrokenProcessPool error in Qiskit?Body: I'm running a set of quantum circuits using the ibmq_qasm_simulator. However, sometimes my code works for the simulation, but sometimes it doesn't, and the system shows me the following message:
BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
I don't know why am I always getting this error. My Python version is 3.7.8, is there a way I can fix this issue? Thanks!
"
"['qiskit', 'grovers-algorithm', 'oracles', 'quantum-circuit']"," Title: Weird Grover's Algorithm BehaviorBody: I am attempting to use Grover's to find elements in an array that satisfy a comparative query (=, <, >, etc). I am using Qiskit, and am using a qRAM to encode my array.
I have experimented with several quantum comparators, all of which seem to be working well offline (i.e. they indeed produce 1 when the query is satisfied). I settled for the IntegerComparator present in Qiskit.
Things start getting weird once I inject my comparator into the oracle of my algorithm. For the array is $[7,6,5,4,3,2,1,0]$, the following happens when testing the query $< n$ for some predetermined $n$:
- The algorithm produces sensible results for $n \in \{0, 1, 2,3\}$.
- For $n = 4$, the algorithm doesn't produce any conclusive solutions.
- For $n \in \{5,6,7\}$, it produces answers the $\geq n$ instead!
Analogous behavior was observed for $> n$. The algorithm works perfectly for the query $==n$.
I have been debugging this for several days, and I can't seem to figure it out. I highly appreciate any kind of help.
This is the high level design of my algorithm:
"
"['hamiltonian-simulation', 'optimization', 'qaoa', 'adiabatic-model']"," Title: Why QAOA with $p \rightarrow \infty $ gives the optimal solution?Body: In the QAOA paper, it is shown that the optimal value of the p-ansatz $M_p$ converges to $\max_z C(z)$ as $p \rightarrow \infty$ on page 10. The proof is to relate to QAOA by considering the time-dependent Hamiltonian $H(t) = (1 − t/T)B + (t/T)C$, which I don't follow.
First, I guess the QAOA paper is to use the Trotterization to approximate $e^{-i H(t)}$ using $e^{-i \beta B}e^{-i \gamma C}\cdots e^{-i \beta B}e^{-i \gamma C}$. But this approximation is only for a ${\bf fixed}$ $t$, right? So how can this Trotterized approximation be close to $e^{-i C}$?
Second, $C$ has many eigenstates, and why should the state $z$ with the largest value of $C(z)$ be returned?
"
"['complexity-theory', 'bqp']"," Title: Do there exist problems known to be computationally intractable for quantum computer, but tractable for classical computer?Body: Or alternatively phrased, is it believed that the complexity class P is a complete subset of BQP?
Consider the following diagram à la MIT OpenCourseWare, which seems to explicitly state as much.
"
"['quantum-state', 'algorithm', 'machine-learning', 'inner-product']"," Title: Calculating Dot Product of Two StatesBody: I've been reading Peter Wittek's Quantum Machine Learning. In chapter 10.2 of this book, the author explains how we can calculate the dot product of two states:
To evaluate the dot product of two training instances, we need to do the following
(Lloyd et al., 2013a):
● Generate two states, $|\psi\rangle$ and $|\phi\rangle$, with an ancilla variable;
● Estimate the parameter Z = $\|x_i\|^2$ + $\|x_j\|^2$, the sum of the squared norms of the two instances;
● Perform a projective measurement on the ancilla alone, comparing the two states.
The author further goes on explaining the process:
Z times the probability of the success of the measurement yields the square of the Euclidean distance between the two training instances: $\|x_i - x_j\|^2$. We calculate the dot product in the linear kernel as $x_i^Tx_j = \frac{Z-\|x_i-x_j\|^2}{2}.$
I am not sure what does 'success of measurement' means in this context. From my understanding, we first need to estimate Z (which is done while preparing $|\psi \rangle$ and $|\phi \rangle$) and then using the prepared states, along with an ancilla, we measure the distance(?) between the two training instances by using a swap test on the above-prepared state. Just for reference, the states are:
$$|\psi \rangle = \frac{|0\rangle|x_i\rangle + |1\rangle|x_j\rangle}{\sqrt 2}$$
$$|\phi \rangle = \frac{\|x_i\| |0\rangle - \|x_j\| |1\rangle}{Z}.$$
"
"['quantum-gate', 'textbook-and-exercises', 'hadamard']"," Title: What Hamiltonians generate Hadamard and CNOT?Body: Find a $2 \times 2$ Hamiltonian $H_H$ such that $e^{iH_H}$ equals the Hadamard matrix and a $4 \times 4$ Hamiltonian $H_{CNOT}$ such that $e^{-iH_{CNOT}}$ equals the matrix of the CNOT gate.
I have been trying to solve this but couldn't come to any conclusion. Any help would be really appreciated.
"
"['measurement', 'textbook-and-exercises', 'quantum-operation', 'povm']"," Title: What are the matrices in the POVM for measuring the first $m$ qubits?Body: Suppose you have a quantum state $|w\rangle$ consisting of $m + n$ qubits, and you set up a measurement that measures the first $m$ qubits in the standard basis. What are the matrices in the corresponding POVM?
"
"['quantum-state', 'textbook-and-exercises']"," Title: How to show that a given mixed two-qubit state is separable?Body: A pure state is separable (unentangled) if it can be written as a tensor product of states of each qubit.
A mixed state is separable, if it can be written as a probability distribution over separable pure states.
Consider the mixed state which is $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$ with the probability of $\frac{1}{2}$, and $\frac{1}{\sqrt{2}}(|01\rangle+|10\rangle)$ with the probability of $\frac{1}{2}$.
How to show that this mixed state is separable?
"
"['grovers-algorithm', 'amplitude-amplification', 'quantum-walks']"," Title: Is it possible to nest quantum Markov chain Monte Carlo, mean and minimum algorithms?Body: Montanaro A. 2015 Quantum speedup of Monte Carlo methods makes the following claim of an algorithm to estimate the mean output $\mu$ of an arbitrary algorithm A, with near-quadratic speedup over classical methods:
An important aspect of this construction is that the
underlying subroutine need not be a classical randomized
procedure, but can itself be a quantum algorithm. This
enables any quantum speedup obtained by A to be used within the
overall framework of the algorithm
So, a few questions relating to nesting quantum algorithms in this way:
- Does this statement also hold for previous algorithms of this type such as Brassard's algorithm for computing the mean of A?
- Does this statement hold for Grover search and hence quantum computation of minimum also?
- Does this statement hold for the quadratic quantum improvements on Markov chain Monte Carlo algorithms presented later in the Montanaro paper?
"
"['simulation', 'complexity-theory', 'clifford-group']"," Title: Are almost-Clifford circuits almost easy to simulate?Body: Circuits consisting entirely of Clifford operations in $\{X, Y, Z, H, S, \text{CNOT} \}$ are "easy" to simulate classically since there is a method that can fully compute such circuits over $n$ qubits with $O(n^2)$ complexity.
I'm curious if circuits that are almost entirely Clifford operations can be shown to approach some lower complexity$^\dagger$ with respect to some continuous parameter that dictates how non-Clifford that circuit is. This is different than some work (e.g. Bravyi and Gosset) that has shown efficient simulation methods when a small number of $T$ gates are inserted into an otherwise Clifford circuit.
For example, suppose I have a circuit consisting entirely of Clifford operations but has a set of $\text{CNOT}^x$ gates. Can I show either of the following?
- The complexity of simulating this circuit continuously approaches some asymptotically lower function in the limit that $x\rightarrow 0$?
- If $p$ is the distribution over results from my almost-Clifford circuit and $q$ is the distribution over results from the corresponding Clifford circuit taking $x=0$, then $d(p, q) \leq \epsilon$ for some small $\epsilon$ and some choice of statistical distance $d$. Of course this would also depend on the number of parameterized $\text{CNOT}$'s occurring in the circuit.
If no such behavior exists - i.e. my circuit is generally $O(2^n)$ complexity even for infinitesmal $x$ - why not?
$^\dagger$ This lower limit doesn't need to be $O(n^2)$. Instead of a stabilizer based simulation I could instead use tensor-based simulation for which there is still a large speedup for computing $\text{CNOT}$ compared to $\text{CNOT}^x$. It seems like this might be more approachable to show something like (1) since the Clifford simulation techniques I'm aware of simply don't generalize to the non-integer $x$ case.
"
"['programming', 'qiskit', 'vqe', 'optimization', 'qaoa']"," Title: Implemented QAOA returns wrong resultBody: I try to apply QAOA algorithm to find minimal energy state of the Hamiltonian:
$H_A = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\sigma_z^2$
It is expected that with p=2 my variational should satisfy the eigenstate of the smallest eigenvalue.
The problem is that something went wrong in my code and I cannot find mistake.
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit.aqua.operators import WeightedPauliOperator
from qiskit.aqua.operators.state_fns import CircuitStateFn
from qiskit.aqua.algorithms import NumPyEigensolver
#from qiskit import BasicAer, execute
from qiskit import Aer
from qiskit.aqua import QuantumInstance
from qiskit.aqua.operators import PauliExpectation, CircuitSampler, StateFn
import itertools
import math
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
$ H_B $
def prepare_Hb(a,b):
pauli_dict = {
'paulis': [
{"coeff": {"imag": 0.0, "real": a}, "label": "XI"},
{"coeff": {"imag": 0.0, "real": b}, "label": "IX"}
]}
return WeightedPauliOperator.from_dict(pauli_dict)
$H_A$
def prepare_Ha(a, b):enter preformatted text here
pauli_dict = {
'paulis': [
{"coeff": {"imag": 0.0, "real": a}, "label": "ZI"},
{"coeff": {"imag": 0.0, "real": b}, "label": "ZZ"},
]
}
return WeightedPauliOperator.from_dict(pauli_dict)
Ansatz
def add_ansatz_layer(circuit, gamma, beta):
q = circuit.qregs[0]
circuit = add_U_Ha(circuit, gamma)
circuit = add_U_Hb(circuit, beta)
return circuit
def ansatz(arr_gamma, arr_beta):
p = len(arr_gamma)
q = QuantumRegister(2)
circuit = QuantumCircuit(q)
# quantum state preparation
circuit.h(q[0])
circuit.h(q[1])
for ind in range(p):
circuit = add_ansatz_layer(circuit, arr_gamma[ind], arr_beta[ind])
return circuit
Expectation calculation
def expectation(ansatz,Hamiltonian):
H_operator = Hamiltonian.to_opflow()
psi = CircuitStateFn(ansatz)
backend = Aer.get_backend('qasm_simulator')
q_instance = QuantumInstance(backend, shots=1024)
measurable_expression = StateFn(H_operator, is_measurement=True).compose(psi)
expectation = PauliExpectation().convert(measurable_expression)
sampler = CircuitSampler(q_instance).convert(expectation)
# evaluate
result = sampler.eval().real
return result
def evaluation2(variables,p=1):
if p not in [1,2]:
print("Invalid p")
return
if len(variables) != 2:
variables = [[variables[0],variables[1]],[variables[2],variables[3]]]
gamma = variables[0]
beta = variables[1]
#print(variables,'-----')
if p != 2:
gamma = [gamma]
beta = [beta]
Ha = prepare_Ha(0.5, 0.5)
test = ansatz(gamma,beta)
res = expectation(test, Ha)
return res
1)Compute the expectation value of the energy $ <\gamma,\:\beta\:|\:H\:|\:\gamma,\:\beta\:> $ and plot it as a function of the variational parameters $ \gamma $ and $ \beta $ ;
gamma = np.arange(-np.pi, np.pi, 0.05)
beta = np.arange(-np.pi, np.pi, 0.05)
func = np.zeros( (gamma.size, beta.size) )
print(gamma.shape, beta.shape)
counter_y = 0
for j in beta:
counter_x = 0
for i in gamma:
func[counter_x, counter_y] = evaluation2([i,j],1)
counter_x += 1
counter_y += 1
X, Y = np.meshgrid(beta, gamma)
fig = plt.figure(figsize=(15,15))
ax = fig.gca(projection='3d')
#ax = fig.add_subplot(111, projection = '3d')
ax.plot_surface(X, Y, func, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
plt.xlabel('gamma')
plt.ylabel('beta')
plt.show()
2)Minimize the energy. What are the optimal angles 𝛾∗
, 𝛽∗
bound_g1 = (0,np.pi)
bound_b1 = (0,np.pi)
initial_guess = (0, np.pi/2)
result = optimize.minimize(evaluation2, x0=initial_guess , bounds=[bound_g1,bound_b1])
3)Compute the variational state obtained for the optimal angles $ |\:\gamma\ast,\:\beta\ast> $
circuit_opt = ansatz([opt_angles[0]],[opt_angles[1]])
circuit_opt.draw(output='mpl')
4)Compute the success probability $ |<1,0|\:\gamma\ast,\:\beta\ast>|^2 $;
# one-zero state
q10 = QuantumRegister(2)
one_zero_circuit = QuantumCircuit(q10)
one_zero_circuit.x(q10[0])
one_zero_state = CircuitStateFn(one_zero_circuit)
psi = CircuitStateFn(circuit_opt)
result = (abs(one_zero_state.adjoint().compose(psi).eval()))**2
print('Probability =',result)
Answer: Probability = 0.24999999175977444
5)Show numerically that with p=2 a success probability of 100% is obtained.
#Gradient based optimization
initial_guess = (np.pi, 0, 0, 0)
bound_g1 = (0,np.pi)
bound_g2 = (0,np.pi)
bound_b1 = (0,np.pi)
bound_b2 = (0,np.pi)
result = optimize.minimize(evaluation2, x0=initial_guess, args=(2), bounds=[bound_g1,bound_g2,bound_b1,bound_b2])
opt_angles_p2 = result.x
'''
# Annealing
import scipy.optimize as spo
initial_guess = (np.pi, 0, 0, 0)
anneal_solution = spo.dual_annealing(evaluation2, x0=initial_guess, maxiter = 100, args=(2,), bounds=[bound_g1,bound_g2,bound_b1,bound_b2])
#print(anneal_solution)
opt_angles_p2 = anneal_solution.x
print(opt_angles_p2)
'''
opt_g1 = opt_angles_p2[0]
opt_g2 = opt_angles_p2[1]
opt_b1 = opt_angles_p2[2]
opt_b2 = opt_angles_p2[3]
circuit_opt_p2 = ansatz([opt_g1 ,opt_g2],[opt_b1 ,opt_b2])
circuit_opt_p2.draw(output='mpl')
chi = CircuitStateFn(circuit_opt_p2)
result = (abs(one_zero_state.adjoint().compose(chi).eval()))**2
print('Probability =',result)
Answer: Probability = 0.2500000000000261
The graph in 1) seems to be strange
In 2)and 5) minimization doesn't work. Minimizer returns initial guess.
It is expected 100% success probability in 5) but I got 25% and even worse.
Any help would be appreciated.
"
"['programming', 'qiskit', 'ibm-q-experience', 'q#', 'shors-algorithm']"," Title: Braket and Q# SimulatorsBody: I have implemented Shor's algorithm in Qiskit, and everything works as expected within the IBM Q experience for both the IBM qasm_simulator and real hardware. However, after I've implemented Shors in both Q# and within Braket and attempt to run on either local simulator, the behavior is much more deterministic. On the Q# local simulator, Braket local simulator, Braket managed simulator, and Rigetti Aspen-8 hardware via Braket, however, I get the same results every time. Is this a difference in simulator behavior between IBM and others, or have I messed up somewhere in implementation? Any help would be greatly appreciated.
"
"['algorithm', 'quantum-advantage']"," Title: List of practical quantum computing algorithms that have speed-up higher than quadratic speed-up?Body: From this link (provided by @KAJ226's comment in this question), it appears as though current error correction methods are not enough to get practical speedup out of algorithms that have quadratic speedups (before taking error correction into account).
In another post, I showed a chart of speedups of different machine learning algorithms. All of these algorithms do not have quartic or higher speedups (and therefore will not be practical with error correction).
Is there a list of practical algorithms that have quartic or higher speedup? I found one such list called the quantum zoo, but it only provides if a given algorithm is "polynomial" or "superpolynomial." Also it doesn't seem very up-to-date and the impact or practicality of these algorithms is not mentioned (a lot of these seem useless or are very vague).
"
"['quantum-state', 'simulation', 'quantum-operation', 'fidelity']"," Title: Simulate a quantum channel with a certain fidelityBody: I am looking for an easy-to-use framework for simulating a quantum channel that can accept the desired average fidelity of the channel as input.
For example, if I want a channel with 98% average fidelity, I can just call a function like:
new_channel = create_channel(0.98)
Then, I can pass individual qubits into that channel and get an output, like this:
almost_the_same_as_arbitrary_state_1 = new_channel(arbitrary_state_1)
Any suggestions? I prefer matlab and python but can work with any language.
edit: as outlined in a comment below, this question may have 2 answers, one where:
- the underlying physical process of the channel is unimportant
- the underlying physical process of the channel is important
Suggestions on how to implement either one of these from scratch is also much appreciated.
"
"['quantum-state', 'ibm-q-experience', 'superposition']"," Title: What's the point of a measurement operator?Body: I was experimenting with quantum circuits in IBM Quantum Experience. I know that the Hadamard gate creates superposition in the qubit, so I created the following circuit:
However, when I looked at the measurement probabilities, it looked like this:
I don't think this is supposed to be the case, as superposition distributes the probability of being 0 and 1. When I removed the measurement like this:
The measurement probability was:
What is the right way to create superposition? What is the point of the measurement operator?
Please excuse me if my questions are obvious, I'm new to quantum computing.
"
"['programming', 'qiskit']"," Title: Qiskit installationBody: I'm trying to get started with Qiskit but the installation process has been horrendous and the official instructions are unusable. The latest python doesnt work with the install instructions at: https://qiskit.org/documentation/install.html (qiskit devs lurking here: can you please update the instructions on the official website or atleast add links to fixes for known issues for novices like me?)
qiskit-aer didnt install until I deprecated python to 3.8 for the qiskit env via: conda create -n name_of_my_env python=3.8
Then, the jupyter notebook didn't recognize the new environment until I tried: python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
Now, the jupyter notebook in the qiskit env wouldnt connect to the kernel and I'm not sure what to do. The error message I get on the jupyter nb is: A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.
I'm not a software engineer and I'm getting tired of poking randomly on the internet for hours with error messages I don't understand.
Suggestions on how I can get jupyter nb in qiskit env to connect to the kernel? Should I expect more such software nuisance with qiskit?
Thanks!
"
"['error-correction', 'stabilizer-code', 'fault-tolerance']"," Title: CSS Code in disguiseBody: Suppose I have a quantum error correcting code described by a set of stabilizers. Is there any easy way of checking whether or not it is equivalent to a code constructed using the CSS construction, using local Clifford transformations?
"
"['programming', 'qiskit', 'algorithm']"," Title: Issue with Speed of Qiskit Arbitrary InitializationBody: I've been using a circuit that needs a specific initialization in the beginning, and to do so I've been using qc.initialize() as mentioned in previously asked similar questions (How can I create an arbitrary superposition state of two qubits in Qiskit?).
However, I've noticed that even when using qc.initialize() to initialize some very simple states (|000>, etc.) it takes roughtly 3-4 seconds to just execute the circuit (something that would only take ~0.2 sec if I just start the circuit at |000> without qc.initialize()). The time for me is important because I need to execute the circuit many times (different than shots, each time I execute, the circuit is modified slightly). Regardless, the extra 3-4 seconds seems abnormal, because even when I use qc.initialize() on even just one qubit in the circuit, it still takes the extra 3 seconds to execute.
One property about the initialization I need for the circuit is that its kind of "sparse". With n qubits, my initial state is only built with a linear combination of ~2n basis vectors (as opposed to $2^n$).
Given this is there some known algorithm or workaround to make an arbitrary initialization that avoids qc.initialize()? Perhaps is there some way other way through Qiskit I can use?
"
"['programming', 'qiskit', 'algorithm']"," Title: How to decompose/unroll a Qiskit Arbitrary initializationBody: I'm aware that to randomly initialize a quantum circuit with Qiskit, we can simply write qc.initialize(rand_state, q[0]...). However, when drawing the circuit, I see that the "initialize" function is treated as one big gate that takes in an input and outputs the initialized state.
Is there a way to decompose this "initialization gate" through python/Qiskit and run a circuit that is composed of the individual smaller gates that actually make up this large gate?
"
"['programming', 'qiskit', 'ibm-q-experience', 'measurement']"," Title: Random measurement of qubitsBody: from qiskit import *
def qrng(bit_num, backend):
bitstring = ""
qrng_circuit = QuantumCircuit(5, 5)
qrng_circuit.h(4)
qrng_circuit.measure(4, 4)
for _ in range(bit_num):
counts = execute(qrng_circuit, backend, shots=8192).result().get_counts()
bit = list(counts.keys())[0]
bitstring += bit
return bitstring
backend = BasicAer.get_backend('qasm_simulator')
print(qrng(1024, backend))
For the above code is supposed to generate a random sequence by measurement of some specific qubits. For example if i have a quantum circuit with 10 qubits which are all put in superposition using Hadamard gate but I want that the measurement method
would be random (to be able to select say 2, 3, 5, 7, 8th qubit) leading to random bitstring being generated.
"
"['programming', 'quantum-state', 'textbook-and-exercises']"," Title: Expectation value of operator - pythonBody: I am suposed to solve following problem:
Calculate the probability $P_n(x > X)$ that a particle in then n-th eigenstate is found at a position with an x-value larger than X. Here it is convenient to formulate it as an expectation value of an operator. We make an operator $P(x > X)$ which is a matrix with unity on the diagonal if $x > X$.
To do this I used the command > which returns True if the number on the left is larger than the one on the right and False otherwise. To turn the True or False into 0 or 1 we use the method astype(int) on the NumPy array, which we then transform to an operator.T ake a few values of X, e.g. X= 3, 5, and 7, and plot $P_n(x > X)$ as a function of $n$ (make sure that the box size $L$ is somewhat larger than $X$).
The excercise continues as follow
Explain what you see: Why is it low when $n$ is small? At which value ofnwould you expect $P_n(x > X)$ to grow from a small to a large value? Hint :which energy would it require classically?
My question is: How do I find the expectation value of the operator?
"
"['machine-learning', 'optimization', 'quantum-enhanced-machine-learning']"," Title: Comparing method of differentiation in variational quantum circuitBody: Training of variational circuits needs to calculate the derivative to be optimized. Several methods were proposed (1), the most famous ones being the finite difference and the parameter shift rule.
- What's the difference between the two methods? Is one more convenient than the other?
- Do other methods exist for taking the derivative, besides these two?
"
"['physical-realization', 'ibm']"," Title: Topology graphs of IBM's quantum computersBody: What is the meaning of the topology graphs of IBM's quantum computers? How should it be interpreted?
For example, how should I understand the following graph?
"
"['entropy', 'information-theory', 'partial-trace']"," Title: Calculating the entropy of a quantum stateBody: Let $\rho_{AR}$ be some $d-$dimensional pure quantum state. Consider a channel $N_{A\rightarrow B}$ that outputs a constant state in $B$. We now consider the Stinespring dilation of this channel with some environment register $E$ and trace out the $B$ register. This gives us the state below
$$\sigma_{RE} = \sum\limits_{k, k'=1}^{d} \langle k_A \vert \ \rho_{AR} \vert k'_A\ \rangle\otimes \vert k_E\rangle\langle k'_E \vert,$$
where $\vert k\rangle, \vert k'\rangle$ denote basis vectors from any fixed basis. How can one calculate the von Neumann entropy of $\sigma_{RE}$ given by $S(\sigma_{RE}) = \text{Tr}(\sigma_{RE}\log\sigma_{RE})$? I am unable to simplify my expression beyond the definition so any hints are appreciated. I would like to express the answer in terms of $S(\rho_R)$ (and maybe other terms as pointed out in the comment).
"
"['cryptography', 'qkd']"," Title: Do quantum computers have any security risks associated with them?Body: I would, like to know for my company, as we are looking to start the process of moving towards quantum safeness.
"
"['shors-algorithm', 'phase-kickback']"," Title: Unitary Operator impact on both - the Control Qubit and the Target Register in Shor's AlgorithmBody: I read the details of Shor's algorithm implementation at the link https://qiskit.org/textbook/ch-algorithms/shor.html#2.-The-Solution and had a question. As a concept, when Unitary is applied with a Control Qubit, because of Phase kickback, the Phase gets applied to Control Qubit instead of the target register. So, that means there should not be any impact of the Unitary operator on the target register. But in Shor's algorithm application, we see that the impact is seen in both the Control bit and the target register. If we measure the target Qubit, we see the superposition of 1, 2, 4 and 8 (for the example taken as Qiskit implementation) along with impact Phase rotations in Control register too.
Is my understanding correct? Have tried a lot to search and get information on this but could not find. So, can someone please help me understand this?
"
"['programming', 'qiskit', 'ibm']"," Title: Qiskit's c_if and conditioned operations on a real quantum computerBody: Can Qiskit's c_if be used on a real quantum computer of IBM? And if it can, can it put a condition only on Qiskit gates like X, H, U1, U2, etc, or is there some way to make the conditioned operation to be a user defined operation, like a block of code, or a user defined gate? Is there other ways to do operations which are conditioned on the classical register measurements results, which will work on real quantum devices (or at least on a simulator)?
"
"['programming', 'random-quantum-circuit']"," Title: Quantum PRGN against Hard disk ForensicsBody: We can make use of the Qbit to make a random string of bytes then as I have an office laptop and I can do some espionage by copying the files to my local disk from the network share and upload it to some online board.
It Leaves a shadow file if I choose to delete it and or encrypt the file. If forensics is performed then that file can be retrieved in its entirity( best case), partially(most cases), encrypted entirety( rarely), or a sign that the file was attempted to be shredded and implementation may vary from OS to OS and File system to file system.
My proposal is that we expose an online service where we input the remaining size of our harddisk, let's suppose I have a disk size of 2TB and 1.5TB is remaining so I shall download a file with Quantum random numbers of size 1.5TB hence overriding all the memory cell even if the disk firmware is ware balanced it will not be able to preserve the fragments of the previously deleted files as we are filling all the leftover disk space with random quantum numbers.
"
"['quantum-state', 'bloch-sphere']"," Title: How to change vectors from SU(2) to SO(3)?Body: I know how to change the special unitary matrix in $SU(2)$ to the matrix in $SO(3)$, and I found one way to change the state(vector) from $2\times 1$ to $3\times 1$, but I don't know why.
The method is shown below:
For any vector$|\psi\rangle \equiv (a+bi,c+di)^T$, the corresponding one is
$$\begin{equation}
\tag{1}
\begin{pmatrix}
2(ac + bd) \\
2(-bc + ad)\\
a^2+b^2-c^2-d^2
\end{pmatrix}
\end{equation}
$$
The process is :$\langle\psi|\vec{\sigma} |\psi\rangle$, and the $x$ component of it is the first line in $(1)$, the $y$ component of it is the second line in $(1)$ and so on, where $\sigma $ stands for Pauli operator
$$\sigma _x = \begin{pmatrix}0&1\\1&0\end{pmatrix},\sigma _y = \begin{pmatrix}0&-i\\i&0\end{pmatrix}, \sigma _z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}$$
For example, if the $2\times 1$ vector is $\begin{pmatrix}\cos(\theta/2)\\ \sin(\theta /2)e^{i\phi}\end{pmatrix}$ then using transformation $(1)$ the corresponding $3\times 1$ vector is
$$
\begin{pmatrix}\sin(\theta)\cos(\phi)\\ \sin(\theta)\sin(\phi)\\ \cos(\theta)\end{pmatrix}.
$$
However, I don't understand how to prove (1).
Cross-posted on physics.SE
"
"['programming', 'qiskit', 'simulation', 'openpulse']"," Title: Job fails when using PulseSimulator: Job Status: job incurred errorBody: I'm trying to simulate a basic circuit using the PulseSimulator in Qiskit. The following Qiskit Pulse code works when I run it on the real device, but not when using the PulseSimulator. The job monitor tells me Job Status: job incurred error and nothing else.
Trying to run any gates native to the device causes an issue. If I remove schedule += inst_sched_map.get('u2', [qubit], P0=0.0, P1=np.pi) then it runs fine, but I can't figure out what I'm doing wrong. I'd deeply appreciate any support. I'm using qiskit 0.23.2
#Essential Imports
import numpy as np
# Qiskit Imports
from qiskit.providers.aer import PulseSimulator
from qiskit import IBMQ, assemble
from qiskit.tools.monitor import job_monitor
import qiskit.pulse as pulse
# Connect to an IBMQ Account and Backend
API_TOKEN = ''
IBMQ.save_account(API_TOKEN, overwrite=True)
IBMQ.load_account()
provider = IBMQ.get_provider()
backend = provider.get_backend("ibmq_armonk")
backend_pulse_simulator = PulseSimulator.from_backend(backend) #backend
# Get information about the backend
qubit = 0
backend_defaults = backend.defaults()
backend_properties = backend.properties()
qubit_frequency_updated = backend_properties.qubit_property(qubit, 'frequency')[0]
inst_sched_map = backend_defaults.instruction_schedule_map
measure_schedule = inst_sched_map.get('measure', qubits=[qubit])
# Assemble a job - circuit with a single qubit-> u2 gate -> measurement
num_shots_per_point = 1024
drive_chan = pulse.DriveChannel(qubit)
schedule = pulse.Schedule()
schedule += inst_sched_map.get('u2', [qubit], P0=0.0, P1=np.pi) # Removing this solves the issue - why?
schedule += measure_schedule << schedule.duration
pulse_program = assemble(schedule,
backend=backend_pulse_simulator,
meas_level=2, meas_return="single",
shots=num_shots_per_point,
schedule_los=[{drive_chan: qubit_frequency_updated}])
# Run the job
job = backend_pulse_simulator.run(pulse_program)
job_monitor(job)
"
"['programming', 'resource-request']"," Title: Source code for graphsimBody: The source code for the graph state simulator from "Fast simulation of stabilizer circuits using a graph state representation" is supposed to be at http://homepage.uibk.ac.at/homepage/c705/c705213/work/graphsim.html but the link is dead and the WayBack machine did not archive it.
Does anyone know where another copy can be found?
"
"['quantum-gate', 'linear-algebra']"," Title: Conjugation of $R_x(\theta)$ with $CNOT$Body: Section 2.5 (4.3) of the Qiskit textbook, see here, discusses the conjugation of $R_x(\theta)$ by $CNOT$. The following expression is given:
$$CX_{j,k}(R_x(\theta)\otimes 1) CX_{j,k}=\color{brown}{CX_{j,k}e^{i\frac{\theta}{2}(X\otimes1)}CX_{j,k}=e^{i\frac{\theta}{2}CX_{j,k}(X\otimes 1)CX_{j,k}}}=e^{i\frac{\theta}{2}X\otimes X}$$
I am confused by the part highlighted in yellow. What exponentiation rules allow this? Could someone show me the intermediate steps or the relevant identities/rules to take us from the LHS to RHS of the highlighted part?
"
"['algorithm', 'grovers-algorithm']"," Title: Can Grover's algorithm be used to efficiently find elements in unsorted lists?Body: From my understanding, Grover's algorithm is often misinterpreted as being able to find elements in lists. And when people try to understand the oracle function in terms of this, it leads to confusion.
I understand that Grover's algorithm finds the input to a function that returns true in $\sqrt{n}$ steps. (And that this is the more general purpose where it's useful.) But I don't see why this can't be used to also efficiently find elements in unsorted lists.
For example, if the function is $x == 5$ (that is, it returns TRUE when the input is 5, and false otherwise) and I have the list $\{4, 8, 2, 3, 1, 9, 10, 12, 5 \}$ (so no duplicates of 5). Grover's algorithm CAN find this in 3 steps, no?
I guess the issue is that the efficiency of writing this function to return true if x==5 and return false if x $\neq 5$ is costly enough that you don't actually get speedup (similar to what is said here)?
EDIT:
To try to make my question more clear. In a nutshell it is: "What exactly in the math of grover's algorithm prevents it from being used to efficiently find an element in an unsorted list?"
Possible answers:
- Based on this question: Grover's cannot efficiently find elements in lists because the oracle specifically requires knowing where the state is in the database, and by doing so makes it impossible to actually find something that was not already known.
My confusion: Is it really impossible to write an oracle as I've written above that simply checks for a value in a set of inputs? (If what I wrote above isn't clear, then I think it's better explained in @gIS's answer here. ) So there really is no algorithmic way of constructing a function to find a specific element in a list? Seems far fetched to say that it's impossible for a quantum computer to do this.
- Grover's algorithm isn't efficient because encoding the classical information to quantum data is slow and makes the overall process inefficient.
My confusion: then if everything is uploaded at first in a sort of "QuantumRAM" you only have to deal with this overhead once - so it would be efficient if multiple searches are performed.
- Grover's algorithm isn't efficient because the oracle function that would check for the actual desired value in the list is prohibitively costly.
My confusion: Can this be made a bit more explicitly if it's true? How costly is such a function to check an element in a list. It seems very counterintuitive such a simple function would be too costly to be worth implementing.
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'pauli-gates']"," Title: How to find the normalization factor of the eigenvectors of the $\sigma_x$ Pauli gate?Body: I'm trying to calcaute the eigenstates for the $\sigma_x$ gate, and I can follow the process up to finding eigenvalues $\pm 1$, but I don't understand where the $\frac{1}{\sqrt{2}}$ coefficient comes from for the answer:
$$\begin{bmatrix}
-\lambda & 1\\
1 & -\lambda
\end{bmatrix}v = 0 \implies v = \frac{1}{\sqrt{2}} \begin{bmatrix} 1\\ 1 \end{bmatrix}
$$
For the solution $\lambda = 1$, why does that $\frac{1}{\sqrt{2}}$ show up?
"
"['quantum-gate', 'programming', 'qiskit']"," Title: A problem with application of multi controlled rotation gatesBody: This message pops up when I run an mcrx gate
The mcrx gate needs a single qubit as target.
Here is a part of code I run:
QC.mcrx(np.pi,[0,1,2],3)
QC.draw('mpl')
'
"
"['qiskit', 'quantum-state', 'mathematics', 'textbook-and-exercises', 'tensor-product']"," Title: Writing state $ |\Psi⟩ =\frac{1}{\sqrt{2}}|00⟩+\frac{i}{\sqrt{2}}|01⟩$ as separate qubits (qiskit textbook)Body: While going through the IBM qiskit textbook online, I came across the following question in section 2.2:
Write the state: $ |\Psi⟩ =\frac{1}{\sqrt{2}}|00⟩+\frac{i}{\sqrt{2}}|01⟩$ as two separate qubits.
I understand tensor products with qubits, but I don't know how to even begin this problem. Does anyone have some advice on how to separate a state into its constituent qubits?
"
"['quantum-state', 'circuit-construction', 'state-preparation']"," Title: Is there an efficient circuit implementing the unitary $U|x\rangle|0\rangle=|x\rangle\Big(\sqrt{1 - x/2^n}\,|0\rangle+\sqrt{x/2^n}|1\rangle\Big)?$Body: Given an $n$-qubit register $|x\rangle$, does there exist an efficient circuit implementing unitary operation $U$ such that
$$U |x\rangle|0\rangle = |x\rangle\Big(\sqrt{1 - x/2^n}\, |0\rangle + \sqrt{x/2^n}\, |1\rangle\Big)?$$
I've found this related question from which the answer suggests to rotate and apply an $\arccos$ approximation (which is very complicated, and only provides an approximation). Is there not an exact circuit implementing this from simple gates plus $R_k$?
The context of this question is trying to implement Algorithm 1 from Quantum speedup of Monte Carlo methods by Ashley Montanaro. They say (paraphrased):
Also observe that $U$ can be implemented efficiently, as it is a controlled rotation of one qubit dependent on the value of $x$ [59]
I did not find the linked reference (Quantum algorithm for approximating partition functions by Wocjan et al) particularly enlightening. And I don't believe they used the $\arccos$ approximation either, as they did not include this in the error analysis. So I am confused as to how $U$ is actually implemented.
"
"['programming', 'qiskit', 'circuit-construction', 'ibm-q-experience', 'ibm']"," Title: How to deal with job submission error in IBM?Body: I keep on getting this error no matter how many circuits I run in the backend 'ibmq_athens'. It says 'Max retries exceeded with URL'. Can someone explain why I am getting this error message.
The main error message is as follows:
IBMQBackendApiError: 'Error submitting job: 'HTTPSConnectionPool(host=\'s3.us-east.cloud-object-storage.appdomain.cloud\', port=443): Max retries exceeded with url: /us-east-quantum-computing-user-jobs-prod/qObject-5ffc48c0c3d09157546c8092.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=21ce861c64cc417e9a95f95263ecf8f7%2F20210111%2Fus-east%2Fs3%2Faws4_request&X-Amz-Date=20210111T124657Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=6715779f30e144ac7e6e1f8ae316960473e57b251c6360b02d881fb8e9a47333 (Caused by SSLError(SSLError("bad handshake: SysCallError(60, \'ETIMEDOUT\')")))''
"
"['programming', 'qiskit', 'quantum-fourier-transform']"," Title: Qubit ordering in qiskitBody: I am confused about the qubit ordering in circuit diagrams and endianness used in qiskit. As far as I understand, qiskit uses little endian (least significant qubit is rightmost) and while drawing circuits, qiskit plots least siginificant qubit at the top. So, we have the following table:
| qubits |
decimal representaion |
ckt |
statevector |
| $|00\rangle$ |
$|0\rangle$ |
![]() |
[1 0 0 0] |
| $|01\rangle$ |
$|1\rangle$ |
![]() |
[0 1 0 0] |
| $|10\rangle$ |
$|2\rangle$ |
![]() |
[0 0 1 0] |
| $|11\rangle$ |
$|3\rangle$ |
![]() |
[0 0 0 1] |
But, when I use QFT on the 2 qubit state $|10\rangle(i.e.|2\rangle)$, the result I expect is $\frac{1}{2}\Sigma_{y=0}^{3}exp(\frac{2\pi j*2y}{4})|y\rangle = \frac{1}{2}(|0\rangle - |1\rangle + |2\rangle - |3\rangle)$ i.e. statevector [0.5,-0.5,0.5,-0.5], however the following code:
from qiskit import QuantumCircuit
from qiskit.circuit.library import QFT
from qiskit import Aer,execute
qc2 = QuantumCircuit(2)
qc2.x(1)
# prepare the state |10>
two_qbit_QFT_ckt = QFT(2)
qft_ckt_2 = qc2+two_qbit_QFT_ckt
# apply QFT on the state |10>
state_backend = Aer.get_backend('statevector_simulator')
qft_res_2 = execute(qft_ckt_2,state_backend).result().get_statevector()
print(qft_res_2)
outputs [0.5,-0.5,0.5j,-0.5j]. I believe there is some qubit ordering problem that I am not getting right, but I can't figure out what it is. I have also seen the following two questions, but they didn't help much.
Q1: Big Endian vs. Little Endian in Qiskit
Q2: qiskit: IQFT acting on subsystem of reversed-ordered qubits state
Can you please help me find the problem?
"
"['algorithm', 'textbook-and-exercises', 'nielsen-and-chuang', 'quantum-fourier-transform', 'order-finding']"," Title: Application of QFT to Order-findingBody: In the Nielsen & Chuang book, section 5.3.1 page 226, there is a statement which goes like this:- (statement-1)
The quantum algorithm for order-finding is just the phase estimation
algorithm applied to the unitary operator
$U|y\rangle ≡ |xy(mod N)\rangle$
Well, this statement is not a trivial one. And then one more,
(statement-2)
(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$$
Now, there are two questions:
- How do we know statement-1? How do we know that the unitary operator which we have defined here, would give us the solution to the order finding problem?
- How do we arrive at statement-2? Eigenstates of $U$ are just the eigenvectors of $U$, so somebody might have calculated them, right? (For example, by solving $U-\lambda I= 0$). However, I don't see how one would arrive at something so elegant. Or is it just some of those "define" statements?
I would be glad if I get an answer to any of these questions.
"
"['qiskit', 'textbook-and-exercises', 'hadamard']"," Title: Is there an error on Qiskit.org textbook with the superdense coding section?Body: The textbook on Qiskit.org has
When the H-gate is applied to first qubit, it creates superposition and we get the state $|0+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$
Shouldn't it be:
$$|0+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |10\rangle)$$
as explained in some answers here: (How do I apply the Hadamard gate to one qubit in a two-qubit pure state?)
"
"['mathematics', 'textbook-and-exercises', 'density-matrix']"," Title: Uniqueness of Density OperatorBody: I have been reading "Introduction to Quantum Information Science" by Masahito Hayashi, Satoshi Ishizaka,Akinori Kawachi, Gen Kimura and Tomohiro Ogawa; Springer Publication. I'm currently in the density operator section, page 96. There they are considering two ensemble states as follows $s_1 = \left\{ \frac{1}{2}, \frac{1}{2}; |0\rangle,|1\rangle \right\}$ and
$s_2 = \left\{ \frac{1}{2}, \frac{1}{2}; |+\rangle,|-\rangle \right\}$. Let there be a arbitary physical quantity be $A = \sum_a aP_a$ (Spectral Decomposition). Hence they are doing this:
$$
Pr(A=a|s_2) = \frac{1}{2} \langle+|P_a|+\rangle + \frac{1}{2} \langle-|P_a|-\rangle = \frac{1}{2} \langle0|P_a|0\rangle + \frac{1}{2} \langle1|P_a|1\rangle = Pr(A=a|s_1)\tag1
$$
They are concluding that that the uniqueness of the states $s_1$ and $s_2$ are getting lost in equation (1), hence they are suggesting below form(2):
$$
Pr(A=a|s) = \sum_i p_iPr(A=a|\text{ }|\psi_i\rangle) = \sum_i p_i \langle\psi_i|P_a|\psi_i\rangle \tag2
$$
They are claiming that the above representation[2] is unique
In order to get rid of non-uniqueness defect...
. But i cant understand how? To me both(1) & (2) are same. I'm adding the snapshot too.
"
"['quantum-state', 'quantum-fourier-transform', 'bell-basis']"," Title: Show that Quantum Fourier Transform maps Bell states to Bell statesBody: Given Bell states $\mathcal{B} = \{\left\vert \phi^{\pm} \right\rangle, \left\vert \psi^{\pm} \right\rangle\}$, show that Quantum Fourier Transform(QFT) maps $\mathcal{B}\rightarrow \mathcal{B}$ by keeping $\left\vert \psi^{-} \right\rangle $ invariant.
After applying the QFT on Bell states, I found
$$
QFT \left\vert \phi^{+} \right\rangle = \frac{1}{2\sqrt{2}}(2\left\vert0 \right\rangle + (1-i)\left\vert 1 \right\rangle + (1+i) \left\vert3 \right\rangle) \\
QFT \left\vert \phi^{-} \right\rangle = \frac{1}{2\sqrt{2}}((1+i) \left\vert1 \right\rangle +2\left\vert2 \right\rangle + (1-i)\left\vert 3 \right\rangle ) \\
QFT \left\vert \psi^{+} \right\rangle = \frac{1}{2\sqrt{2}}(2\left\vert0 \right\rangle + (i-1)\left\vert 1 \right\rangle - (1+i) \left\vert3 \right\rangle) \\
QFT \left\vert \psi^{-} \right\rangle = \frac{1}{2\sqrt{2}}((1+i) \left\vert1 \right\rangle -2\left\vert2 \right\rangle + (1-i)\left\vert 3 \right\rangle ).
$$
Can anyone please help, how to proceed from here ?
"
"['programming', 'qiskit', 'bloch-sphere', 'quantum-circuit']"," Title: how to plot probability histogram and/or bloch sphere of single qubit in multi-qubit quantum circuit in Qiskit?Body: How can I get statevector and/or blochsphere representation of qubits of my choice. For example I have 3 qubits with different gates being applied on each qubit. the qiskit state_vector simulator gives bloch sphere representation of states for all qubits in the circuit and qasm simulator also plots histogram of probability for all qubits in the circuit. How can I get the single, for instance, second qubit's probability histogram and/or bloch sphere representation?
Secondly, can we use 15 qubits for simulation and plot probability histogram and/or bloch sphere or two qubits only, because qiskit is giving memory error since it takes the whole circuit for plotting.
Thanks
"
"['quantum-state', 'w-state']"," Title: How to implement a circuit preparing the three-qubit W state?Body: I'm trying to implement a circuit wich prepare this three qubits state :
$\frac{1}{\sqrt{3}}(|100\rangle + |010\rangle + |001\rangle)$
It seems that the three qubits W-state can produce this state, and I found this code.
But I have seen a simple circuit on this page wich seems to work, but I don't understand how the person find the Ry rotation of 1.321, does someone could explain me how 1.321 is found?
"
"['programming', 'vqe', 'chemistry']"," Title: How to improve accuracy of ground energy values from a VQEBody: Using the Qiskit textbook I have been using a VQE to find the ground state energy of Hydrogen at different interatomic distances on a quantum machine. However, the average energy value I will always calculate at a interatomic distance of 0.735 A (groundstate) is ~ 1.06 Hartrees while the exact value calculated with the NumpyEigensolver is 1.1373... Hartrees. I am unable to see what is causing this inaccuracy and at higher interatomic distances this inaccuracy increases. In some cases the VQE values for the ground energy are above even above the HartreeFock energy given by:
VQE_result.hartree_fock_energy
I was under the impression that the qubits are initialised in the HartreeFock initial state so how can the VQE energy given by:
VQE_result.total_energies
be above its initial state if the VQE is meant to be minimizing the value? Unless I am miss understanding how the algorithm is working? Is this inaccuracy just an effect of quantum noise and decoherence in NISQ era machinery or is this an error with my method.
This is a graph of my VQE results (Blue) and the exact values (Orange) to demonstrate the inaccuracy:
The main loop of my code which retrieves these values is:
for i in np.arange(0.25,4.25,0.25):
molecule = Molecule(geometry=[['H', [0., 0., 0.]],
['H', [0., 0., i]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
#Map fermionic hamiltonian to qubit hamiltonian
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.PARITY,
two_qubit_reduction=True,
freeze_core=True)
numpy_solver = NumPyMinimumEigensolver()
#Initialize the VQE solver
vqe_solver = VQEUCCSDFactory(QuantumInstance(backend = backend, shots = 1024))
#Ground state algorithm
calculation_VQE = GroundStateEigensolver(transformation, vqe_solver)
calculation_numpy = GroundStateEigensolver(transformation, numpy_solver)
#Calculate results
VQE_result = calculation_VQE.solve(driver)
VQE_results_array.append(VQE_result.total_energies)
hf_energies.append(VQE_result.hartree_fock_energy)
NRE.append(VQE_result.nuclear_repulsion_energy)
Numpy_result = calculation_numpy.solve(driver)
Numpy_result_array.append(Numpy_result.total_energies)
"
"['quantum-gate', 'resource-request']"," Title: How the various quantum gates are implemented physically in quantum computer?Body: I'm not able to find any sources. Can you point me to some?
"
"['entanglement', 'physical-qubit']"," Title: How can one imagine entanglement in a non-mathematical way?Body: I understand the theoretical concept of an entanglement and what it means for our computation to have two entangled qubits, but what does it really mean when two qubits are entangled? How are they entangled in the first place? I mean in the physical world, not in theory. Right now I think of entanglement as a "synchronization" of two quantum mechanical properties that can be encoded as a qubit.
I tried to understand what happens when the spin of two electrons are entangled, but I could not grasp it. Maybe someone could explain how we achieve an entangled state of qubits if the qubits are encoded in the spin of an electron?
I would be very grateful for any help because I am slowly getting crazy and not crazy at the same time.
"
"['programming', 'qiskit', 'quantum-circuit']"," Title: An issue in plotting the quantum circuit using latexBody: Here's the code I'm working on:
!pip install pylatexenc
!pip install pillow
qc = QuantumCircuit(2)
qc.x(0)
qc.cz(0,1)
qc.x(0)
qc.draw('latex')
However there's an error:
FileNotFoundError: [Errno 2] No such file or directory: 'pdflatex': 'pdflatex'
What should I do to make it work? Thanks!!
"
"['quantum-state', 'circuit-construction', 'hadamard']"," Title: What is a complexity of producing arbitrary equally distributed superposition?Body: In the article An Optimized Quantum Maximum or Minimum Searching Algorithm and its Circuits I found statement (pg. 4):
Preparing an initial state takes $\log_2(N)$ steps.
In this case the initial state is uniformly distributed superposition of $n$ qubits where some states from computational basis are missing (example for two qubits: $\frac{1}{\sqrt{3}}(|00\rangle + |01\rangle+|11\rangle)$). Since $N=2^n$ the statement above means that complexity of preparing such state is linear in number of qubits.
In case all computational basis states are present in the required state, it is possible to use $H^{\otimes n}$ gate for preparing such state and in this case number of steps is even constant under assumpation that all Hadamard gates can be applied at once on all qubits.
However, since some computational basis states are missing, more complex circuit involving CNOT gates has to be constructed. In article Transformation of quantum states using uniformly controlled rotations, a general method how to produce arbitrary quantum state is proposed. Of course, this method is also suitable for preparing equally distributed states. However, the method leads to exponential incerease in gates number with increasing number of qubits.
So, my question is: What is a complexity of preparing uniformlly distributed states with some missing computational basis states? Is it really linear in number of qubits?
"
"['quantum-gate', 'phase-estimation']"," Title: A question regarding quantum phase estimation algorithmBody: Why are $U$s raised to successive powers of two in quantum phase estimation circuit diagram when we use $n$ register qubits $|0\rangle|0\rangle|0\rangle$?
"
"['quantum-gate', 'gate-synthesis', 'matrix-representation', 'pauli-gates']"," Title: Single-qubit rotations on a subspace within two-qubit unitaryBody: I would like to implement the operation
$$
U(a,b) = \exp\left(i \frac{a}{2} (XX + YY) + i \frac{b}{2} (XY - YX) \right)
$$
($a,b \in \mathbb{R}$) without using Baker-Campbell-Hausdorf expansion, which at first seems necessary since $[(XY - YX), (XX + YY)] \neq 0$. My intuition is that this can be done in the same way that $\exp(i(aX + bY))$ does not require a BCH expansion to implement. The above operation is generated by these two matrices:
\begin{align}
i \frac{a}{2} (XX + YY)\rightarrow i a
\begin{pmatrix}
0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0
\end{pmatrix} \\
i \frac{b}{2} (XY - YX)\rightarrow i b\begin{pmatrix}
0 & 0 & 0 & 0 \\
0 & 0 & \text{-}i & 0 \\
0 & i & 0 & 0 \\
0 & 0 & 0 & 0
\end{pmatrix}.
\end{align}
Since sum of these matrices is proportional to the operator $(aX - bY)$ in the $(|01\rangle,|10\rangle)$ subspace it seems possible that the operation can be done with a general single-qubit rotation $\text{R}_\hat{n}$ in that subspace. Taking the (unnormalized) unit vector $\hat{n} = a\hat{x} - b\hat{y}$ this rotation is given by
$$
\text{R}_\hat{n} (\theta) = \cos\frac{\theta}{2} + i \sin \frac{\theta}{2} (a X - b Y)
$$
so that the operation can be implemented as
$$
U(a, b) = \text{CNOT}^{2\rightarrow 1} \text{CR}_{\hat{n}}(\theta)^{1\rightarrow 2} \text{CNOT}^{2\rightarrow 1}
$$
where $\text{CR}_{\hat{n}}(\theta)$ is a controlled version of $\text{R}_\hat{n}$ and $i\rightarrow j$ indicates an operation on qubit $j$ controlled by qubit $i$. My main concern is that since neither $(XY - YX)$ nor $(XX + YY)$ has support in the $|00\rangle, |11\rangle$ subspace that there's something missing or wrong in this process.
My question is, is this a valid decomposition for $U(a, b)$ or is there something wrong in the above reasoning?
"
"['quantum-state', 'nielsen-and-chuang', 'phase-estimation']"," Title: Output of Quantum Phase Estimation AlgorithmBody: In section 5.2.1 of Nielsen Chuang, Performance and Requirements, there is an idea, that what happens if we can't prepare eigen state $|u\rangle$ and instead have a state $|\psi\rangle$ which is represented by $\sum_{u} c_{u}|u\rangle$. Output state is $\sum_{u} c_{u} |\phi_{u}\rangle|u\rangle$
Now we will measure the first qubit and it will turn out to be $|\phi_{u} \rangle$ with probability proportional to $c_{u}^{2}$.
But I am curious, what will be the state of the second qubit? (Is it entangled with the first qubit?)
Some excerpts from the book itself:
"
"['programming', 'qiskit', 'ibm-q-experience', 'shors-algorithm', 'ibm']"," Title: Can I access device specifications of IBMQ paying devices?Body: I need to perform some tests for my thesis in real quantum computers, however, I only have access to IBM's free quantum devices (the maximum number of qubits I can use is 15, in ibmq_16_melbourne). I mainly have two problems:
- To factor N=15 using Shor's algorithm using the
Shor class provided by Qiskit, I'd need 18 qubits.
- Using this version of the algorithm, I only need 11 qubits, but when I try to execute it in
ibmq_16_melbourne, I get the following error message:
Circuit runtime is greater than the device repetition rate. Error code: 8020.
Which basically means I'm using too many gates.
I know that I can see data about the circuit by writing
shor_compiled = transpile(result['circuit'], backend=server, optimization_level=3)
print('gates = ', shor_compiled.count_ops())
print('depth = ', shor_compiled.depth())
However, if I want to know about the depth and gate number of a circuit in another computer, first I need to have access to it. Is there any way I could at least find device specifications for the more powerful, paying devices? I might get access to them in the near future through the company that's financing my PhD, but I've been asked to analyze whether Shor's algorithm might be tested in those devices.
"
"['qiskit', 'entanglement', 'measurement', 'teleportation']"," Title: Quantum teleportaion seems to occuring without entanglement in circuit (what's wrong)Body: Please, pardon the caption. No intention of making new theories. I am a bit confused about the quantum teleportation. I missed a hadamard gate before CNOT gate for creating the EPR pair. But the circuit seems to bee working and copying q0 to q2.
Circuit without entanglement and initial Hadamard gate:
Results consistent with q0 wave function:
This is measurement of q2 for multiple shots
I am new to quantumn mechanics domain, any guide or help would mean a lot. Thank you for your help :).
"
"['programming', 'qiskit']"," Title: Why qiskit.execute runs much slower for inputs with multiple circuits, and how to speed it up?Body: I am using the "execute" in qiskit to run experiments for two circuits, and it turns out that "execute" runs much slower if the two circuits are run simultaneously, compared to if the circuits are run one at a time. Please see the codes below. Any idea why this happens and how to improve it?
from qiskit import QuantumCircuit, Aer, execute
import numpy as np
import time
pi = np.pi
num_qubits = 2
theta = np.random.rand(1,2)[0]
qc = QuantumCircuit(num_qubits)
qc.u1( theta[0] , 0 )
qc.cx( 0,1 )
qc.u3( -pi/2 , -pi/2 , pi/2 , 0 )
qc.u2( 0 , pi , 1 )
qc.cx( 0,1 )
qc.u1( theta[1] , 1 )
qcz = qc.copy()
qcz.measure_all()
qcx = qc.copy()
qcx.h(qcx.qubits)
qcx.measure_all()
# Using execute for the two circuits together
start_time = time.time()
results = execute([qcx,qcz], Aer.get_backend('qasm_simulator'), shots = 8192 ).result()
print( results.get_counts() )
print("--- %s seconds ---" % (time.time() - start_time))
# Using execute for one circuit at a time
start_time = time.time()
resultx = execute(qcx, Aer.get_backend('qasm_simulator'), shots = 8192 ).result()
resultz = execute(qcz, Aer.get_backend('qasm_simulator'), shots = 8192 ).result()
print( resultx.get_counts() )
print( resultz.get_counts() )
print("--- %s seconds ---" % (time.time() - start_time))
and the outputs are
[{'00': 4114, '01': 4063, '10': 9, '11': 6}, {'00': 2027, '01': 2055, '10': 2074, '11': 2036}]
--- 11.244265079498291 seconds ---
{'00': 4099, '01': 4084, '10': 5, '11': 4}
{'00': 2047, '01': 2034, '10': 2073, '11': 2038}
--- 0.29702305793762207 seconds ---
"
['quantum-neural-network']," Title: Label function for a QNN designed to classify bit stringsBody: The paper can be found https://arxiv.org/pdf/1802.06002.pdf here.
They say that for each binary label function $l(z)$ where $l(z)=−1$ or $l(z)=1$, there exists a unitary $U$ such that, for all input strings $z=z_0z_1...z_{n−1}$ (where each $z\in \{−1,1\}$),
The predicted output is defined as, $$<z, 1|U^\dagger
(
θ )Y_{n+1}U(
θ )|z, 1>$$
where $Y_{n+1}$ is the Pauli y operator on the last qubit.
loss is defined as $$
loss(~θ, z) = 1 − l(z)\langle z, 1|U^\dagger ( θ )Y_{n+1}U( θ )|z, 1>$$
In Representation section it is said that, Before discussing learning we want to establish that our quantum neural network is capable
of expressing any two valued label function. There are 2n
, n-bit strings and accordingly there are 22n
possible label functions l(z). Another operator is defined as following, $U_l
|z, z_{n+1}\rangle = e^{il(z) π X_{n+1}/4}|z, z_{n+1}\rangle$ Further $l(z)$ is obtained as following, $$
\langle z, 1|U^\dagger_l Y_{n+1}U_l|z, 1\rangle = l(z)$$
I do not understand what $l(z)$ exactly is(true label I believe) and how there are 22n possible functions for it.
"
"['quantum-state', 'measurement']"," Title: Expectation value of the coherent termBody: I am trying to and understand a statement of a paper I am reading URL. Figure 3c shows the circuit.
$\newcommand{\bra}[1]{\langle #1\rvert}\newcommand{\braket}[2]{\langle #1\rvert #2\rangle}\newcommand{\ket}[1]{\lvert #1\rangle}\newcommand{\on}[1]{\operatorname{#1}}\newcommand{\ketbra}[2]{\lvert #1\rangle\!\langle #2\rvert}$
There is mentioned that the result of an quantum circuit can be read out by measure the expectation value of the coherent term of the ancillary qubit $\ket{000}\bra{000} \otimes \ket{1}_A \bra{0}_A$.
What is the coherent term?
Is'n the solution of this equation a matrix? How does a matrix have an expectation value that can be read out of a measurement of a quantum circuit?
"
"['quantum-state', 'entanglement', 'measurement', 'textbook-and-exercises', 'bell-basis']"," Title: Probability on measuring bell state in x-basis with pauli operator sigma xBody: I am confused about how to calculate the probabilities of getting a certain result when measuring a Pauli observable on a Bell state. When you measure an observable the state is projected onto an eigenstate of the observable.
For example, given $|\psi\rangle = (|{+-}\rangle + |{-+}\rangle)/\sqrt{2}$ as the state and $\sigma_x = \begin{pmatrix}0 & 1 \\ 1 & 0\end{pmatrix}$ as the observable, if the probability is $1/2$, how to calculate actually it? What is the state after measurement?
"
"['programming', 'qiskit', 'qasm']"," Title: Why do I get the error 'IBMQManagedResultDataNotAvailable'?Body: I'm trying to use IBMQ job manager to submit a list of quantum circuits (300 of them in total) to 'ibmq_16_melbourne'. This is what the job status looks like on IBM Quantum Experience:
I don't know why my code doesn't work on this real quantum computer. If I use the ibmq_qasm_simulator instead then no error has occurred. Here's the structure of my code:
from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider()
backend = provider.get_backend('ibmq_16_melbourne')
job_manager = IBMQJobManager()
all_circuits = [...] # A list with 300 elements.
MyExperiments = job_manager.run(all_circuits, backend=backend, shots = 100)
results = MyExperiments.results()
I tried another list with 5 simple circuits and it worked fine, but I'm wondering how can I make it work in my case with 300 circuits? What should I do? Thanks a lot for your help:)
"
"['algorithm', 'complexity-theory']"," Title: What is the computational complexity of approximate quantum adders, in terms of big O notation?Body: I have recently found papers on approximate quantum adders. However, the papers do not seem to mention the computational complexities of their algorithms. What are their complexities, in terms of big O notation?
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.116.110403
https://www.degruyter.com/view/journals/qmetro/4/1/article-p1.xml?language=en
"
"['quantum-gate', 'qiskit', 'quantum-state', 'ibm-q-experience']"," Title: Measurement of any qubit state in Y-basisBody: how can I measure any qubit state in Y-basis in qiskit. there is this solution here How to measure in another basis but it gives the qubit's position on bloch sphere in z-axis where as I think it should be on y-axis just like in X-measurement basis (created by H,Z-measure,H) the qubit position is always on x-axis.
The y-basis measurement in solution (link above) uses the initial state of |+⟩ and if we change the qubit initial state to 0 or 1 it collapses onto z-axis whereas it should remain on y-axis , if it is correctly measuring in y-basis, right?
Any guidance about how we can measure in y-basis using qiskit would be appreciated.
Thanks
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises', 'hadamard', 'superposition']"," Title: How to describe the state of a qubit passing through two Hadamard gates?Body:
Describe the state of the qubit at points A, B and C. How does this demonstrate that we need the “ket” (or the vector) representation of qubits, rather than just describing them in terms of probabilities (e.g. “this is a qubit with a 50% probability of being a 1”).
"
"['programming', 'qiskit']"," Title: Why ""job_manager"" did not submit some of the jobs?Body: I tried to submit around 2000 circuits with "job_manager", and it turns out that some jobs are not submitted. Please see the code and error message below. I understand that we can submit max 5 jobs at a time, so it is not surprised to get the WARNING, but those jobs should be submitted when the previous ones are finished. Also please note that the "experiment 375" (the one triggers the error message) is not failed, but it is not submitted at all.
I also checked the job history, see the screenshot below. Indeed, "L_3_vqe_qc_5" was missed, and never submitted afterwards, which exactly corresponds to the 375th experiment. Is there any way to avoid this?
Many thanks for the help!
(EDIT: A bit of search leads to me the "timeout" error discussed here https://github.com/Qiskit/qiskit-aqua/issues/1169. Has this issue been solved?)
(EDIT2: See the post Why did "job_manager" submit the same job twice and how to fix it?, for a workaround of the issue here.)
# Need to transpile the circuits first.
qclist = transpile(qclist, backend=backend)
# Use Job Manager to break the circuits into multiple jobs.
job_manager = IBMQJobManager()
job_set = job_manager.run(qclist, backend=backend, name='L_3_vqe_qc')
result_qc = job_set.results()
result_qc = [ result_qc.get_counts(ind) for ind in range(len(qclist)) ]
print( result_qc )
and the error message is
managedjob._async_submit:WARNING:2021-01-17 00:07:26,619: Job limit reached, waiting for job 6003f01db16bee437192eab7 to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 375-449: 'Timeout while waiting for job 6003f01db16bee437192eab7.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 00:12:27,968: Job limit reached, waiting for job 6003f01db16bee437192eab7 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:13:32,341: Job limit reached, waiting for job 6003f022c4547b677c533108 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:17:32,482: Job limit reached, waiting for job 6003f02a9110da92007c4c14 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:18:36,084: Job limit reached, waiting for job 6003f0319110dadeec7c4c15 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:20:12,296: Job limit reached, waiting for job 6003f037c4547b774953310b to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:24:15,390: Job limit reached, waiting for job 6003f1a9b16beeb3de92eac4 to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 825-899: 'Timeout while waiting for job 6003f1a9b16beeb3de92eac4.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 00:29:17,112: Job limit reached, waiting for job 6003f1a9b16beeb3de92eac4 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:29:44,659: Job limit reached, waiting for job 6003f2992159c385a834e9bc to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 975-1049: 'Timeout while waiting for job 6003f2992159c385a834e9bc.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 00:34:45,966: Job limit reached, waiting for job 6003f2992159c385a834e9bc to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 525-599: 'Timeout while waiting for job 6003f2992159c385a834e9bc.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 00:39:47,453: Job limit reached, waiting for job 6003f2992159c385a834e9bc to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:43:01,237: Job limit reached, waiting for job 6003f2d9cf834acf2a506bb9 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:43:57,144: Job limit reached, waiting for job 6003f338b16bee9d0892eace to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:45:06,760: Job limit reached, waiting for job 6003f42ccf834a050f506bc7 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:50:02,826: Job limit reached, waiting for job 6003f5762f13a0c4006406c1 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 00:52:24,291: Job limit reached, waiting for job 6003f8924ae4e577be32c9a2 to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 1500-1574: 'Timeout while waiting for job 6003f8924ae4e577be32c9a2.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 00:57:25,735: Job limit reached, waiting for job 6003f8924ae4e577be32c9a2 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:01:09,173: Job limit reached, waiting for job 6003f8cbcf834a4441506bef to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:01:53,181: Job limit reached, waiting for job 6003f910cf834a4424506bf2 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:02:35,367: Job limit reached, waiting for job 6003fa384ae4e5712332c9b1 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:03:18,686: Job limit reached, waiting for job 6003fac6b16bee172792eb14 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:04:29,024: Job limit reached, waiting for job 6003fcd32f13a0533b640708 to finish before submitting the next one.
/Users/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedjob.py:133: UserWarning: Unable to submit job for experiments 1950-2024: 'Timeout while waiting for job 6003fcd32f13a0533b640708.'
warnings.warn("Unable to submit job for experiments {}-{}: {}".format(
managedjob._async_submit:WARNING:2021-01-17 01:09:30,436: Job limit reached, waiting for job 6003fcd32f13a0533b640708 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:09:54,575: Job limit reached, waiting for job 6003fcfe2159c3caa234ea17 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:10:38,221: Job limit reached, waiting for job 6003fd299e0e7f25ffb32405 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:11:21,017: Job limit reached, waiting for job 6003fd542f13a0689b64070c to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:12:03,256: Job limit reached, waiting for job 6003fd984ae4e536e332c9d2 to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:13:10,995: Job limit reached, waiting for job 6003fee0b16bee44e092eb3a to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:13:53,037: Job limit reached, waiting for job 6003ff0bb16bee98bf92eb3c to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:14:36,193: Job limit reached, waiting for job 6003ff36b16bee443992eb3f to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:15:18,779: Job limit reached, waiting for job 6003ff602159c3817c34ea2f to finish before submitting the next one.
managedjob._async_submit:WARNING:2021-01-17 01:16:01,750: Job limit reached, waiting for job 6003ffa44ae4e50f2032c9e5 to finish before submitting the next one.
---------------------------------------------------------------------------
IBMQManagedResultDataNotAvailable Traceback (most recent call last)
<ipython-input-50-229aa73320ab> in <module>
8
9 result_qc = job_set.results()
---> 10 result_qc = [ result_qc.get_counts(ind) for ind in range(len(qclist)) ]
11 print( result_qc )
<ipython-input-50-229aa73320ab> in <listcomp>(.0)
8
9 result_qc = job_set.results()
---> 10 result_qc = [ result_qc.get_counts(ind) for ind in range(len(qclist)) ]
11 print( result_qc )
~/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedresults.py in get_counts(self, experiment)
125 be found.
126 """
--> 127 result, exp_index = self._get_result(experiment)
128 return result.get_counts(exp_index)
129
~/psi4conda/envs/env_for_qiskit/lib/python3.8/site-packages/qiskit/providers/ibmq/managed/managedresults.py in _get_result(self, experiment)
226 (job, exp_index) = self._job_set.job(experiment)
227 if job is None:
--> 228 raise IBMQManagedResultDataNotAvailable(
229 'Job for experiment {} was not successfully submitted.'.format(experiment))
230
IBMQManagedResultDataNotAvailable: 'Job for experiment 375 was not successfully submitted.'
"
"['quantum-state', 'measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'probability']"," Title: What does $M_m |\psi_i\rangle$ mean in the equation $p(m|i)=\langle\psi_i|M_m^\dagger M_m|\psi_i\rangle$?Body: I have trouble understanding two equations in the Nielsen & Chuang textbook. Suppose we perform a measurement described by the operator $M_m$. If the initial state is $|\psi_i\rangle$, then the probability of getting result m is
$$
p(m|i)=\langle\psi_i|M_m^\dagger M_m|\psi_i\rangle.
$$
The form of this equation looks like the overlap between two states, but I'm not exactly sure what $ M_m|\psi_i\rangle$ means? Is this relevant to the projection operator?
Also, given the initial state $|\psi_i\rangle$, the state after obtaining the result m is
$$
|\psi_i^m\rangle = \frac{M_m|\psi_i\rangle}{\sqrt{\langle\psi_i|M_m^\dagger M_m|\psi_i\rangle}}.
$$
Why is this the case?
Cross-posted on physics.SE
"
"['quantum-state', 'circuit-construction', 'measurement', 'superposition', 'quantum-circuit']"," Title: How to distinguish between collapsed and uncertain qubits in a quantum circuit?Body: I have been through the Young's double slit experiment. It's a direct proof or instance of showing that a wave is collapsed via observation or measurement, and shows no interference patterns.
I want to do something similar in a quantum circuit, not visual interference but something to distinguish between a collapsed qubit and an uncertain qubit. So that I can notice the difference while alternatively putting and omitting measurement on the pathway of a superposed qubit.
Update:
I followed @AdamZalcman 's answer and coded the whole thing up on a notebook
"
"['programming', 'algorithm', 'cirq', 'oracles', 'simons-algorithm']"," Title: In Simon's algorithm, is there a general method to define an oracle given a certain periodicity?Body: I have to implement Simon's algorithm in Cirq. I have problems determining the oracle $f(x)$ defined such that $f(x)=f(x\oplus a)$ from a certain value of $a$.
Given a random $a$, is there a general way to define the oracle $f$? Or at least, how can I determine the oracle from a certain $a$?
I think the following code (from Cirq Github repo) answers my question but I cannot understand it.
def make_oracle(input_qubits, output_qubits, secret_string):
"""Gates implementing the function f(a) = f(b) iff a ⨁ b = s"""
# Copy contents to output qubits:
for control_qubit, target_qubit in zip(input_qubits, output_qubits):
yield cirq.CNOT(control_qubit, target_qubit)
# Create mapping:
if sum(secret_string): # check if the secret string is non-zero
# Find significant bit of secret string (first non-zero bit)
significant = list(secret_string).index(1)
# Add secret string to input according to the significant bit:
for j in range(len(secret_string)):
if secret_string[j] > 0:
yield cirq.CNOT(input_qubits[significant], output_qubits[j])
# Apply a random permutation:
pos = [
0,
len(secret_string) - 1,
] # Swap some qubits to define oracle. We choose first and last:
yield cirq.SWAP(output_qubits[pos[0]], output_qubits[pos[1]])
"
"['programming', 'qiskit', 'resource-request', 'hhl-algorithm']"," Title: Query on the HHL Algorithm in the Qiskit Aqua LibraryBody: This is a question regarding the Qiskit Aqua package. I have been studying
HHL algorithm from QISKIT textbook and after understanding the math I finally got to the code part, I am having a hard time understanding what is going on. I know how to write code in order to create gates and making a Quantum Circuit, but I can't find good resources for Aqua. If you guys could point me to some examples or something helpful, it will be greatly appreciated. I have also posted a screenshot where I got confused.
"
"['circuit-construction', 'ibm-q-experience', 'gate-synthesis', 'pauli-gates', 'ibm']"," Title: How to create the state $\vert 0 \rangle+i \vert 1 \rangle$ using elementary gates?Body: I am trying to write $|0\rangle+i|1\rangle$ in terms of elementary gates like H, CNOT, Pauli Y, using the IBM QE circuit composer.
I was thinking some kind of combination of H and Y since $Y|0\rangle=i|1\rangle$, so it is close but not quite.
Please help!
Thanks
"
"['quantum-operation', 'noise', 'quantum-process-tomography']"," Title: How can I fit an unknown quantum channel?Body: Suppose that I have one noisy channel $\mathcal{E}$ and I want to fit it with another one $\mathcal{E}_0(p)$ that depends on some fitting parameter $p$.
As both of this processes for me are represented by matrices, I would simply minimize the distance that I define as $$d(p) = ||\mathcal{E} - \mathcal{E}_0(p)||_2$$ where for the norm $||\cdot||_2 $ I would just take the square difference between the elements of the two matrices that represent the processes.
Would it be correct using this distance? I read in Gilchrist et al. PRA 71, 062310 (2005)(https://arxiv.org/pdf/quant-ph/0408063.pdf) that there are several metrics for processes, but I think that they should be all equivalent, as I have a finite Hilbert space. Am I missing something?
Thanks!
"
"['programming', 'qiskit']"," Title: Why did ""job_manager"" submit the same job twice and how to fix it?Body: In order to avoid the problem posted in Why "job_manager" did not submit some of the jobs?, (the current issue is related but quite different, so I think it is more appropriate to ask separately), I divide the job to batches, with each batch having 75*5=375 circuits. Then I use ("item" below contains a list of 375 circuits)
job_set = job_manager.run(item, backend=backend, name='L_5_vqe_qc' , shots = 8192 )
with the hope that "job_mamager" will submit the 5 jobs, each with 75 circuits. However, it turns out that the same job was submitted twice. See the screenshot below, where "L_5_vqe_qc_2" was submitted twice. Is this normal?
"
"['programming', 'q#']"," Title: Q# Callable Not Accessible from Open NamespaceBody: I am trying to to call ApplyMultiplyControlledAnd(), and I'm receiving an error saying "The callable ApplyMultiplyControlledAnd exists in an open namespace, but is not accessible from here." I have opened Microsoft.Quantum.Canon already, but I'm still getting the error. Any advice as to why this is happening would be greatly appreciated!
Thank you!
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix', 'nielsen-and-chuang', 'probability']"," Title: What's the difference between $p(i|m)$ and $p(m|i)$ in measurement?Body: Suppose we perform a measurement described by measurement operators $M_m$. If the initial state is $|{\psi_i}\rangle$, then the probability of getting result $m$ is
$$
\begin{align}
p(m|i)=\| M_m|\psi_i\rangle \|^2 = \langle\psi_i|M_m^\dagger M_m|\psi_i\rangle =tr(M_m^\dagger M_m|\psi_i\rangle\langle\psi_i|).
\end{align}
$$
After a measurement that yields the result $m$, we have an ensemble of states $|\psi_i^m\rangle$ with respective probabilities $p(i|m)$. The corresponding density operator $\rho_m$ is therefore
\begin{align}
\rho_m = \sum_ip(i|m)|\psi_i^m\rangle\langle\psi_i^m|.
\end{align}
I'm wondering whether $p(i|m)$ and $p(m|i)$ refer to the inverse procedure? How are those two procedures connected? Is $|\psi_i^m\rangle$ a subset of the initial ensemble $|\psi_i\rangle$? Can I rewrite $\rho_m$ as
\begin{align}
\rho_m = \sum_{ij}p(j|m)p(m|i)|\psi_{ij}^m\rangle\langle\psi_{ij}^m|
\end{align}
?
"
"['algorithm', 'nisq']"," Title: NISQ algorithm: do they all have circuit updated between each run AND impossible to predict when they will stop?Body: I don't know very much the NISQ algorithms, but the ones that I know are based on kind of "Hybrid" calculation between a quantum computer and a classical computer.
Indeed, for instance in QAOA, we can try to find the fundamental of some Hamiltonian.
To do this, we run a circuit with a given set of gates. We measure the qubit and "feed" it to some classical processing that either say "fundamental may have been found: stop", or "make more iterations". When "more iterations" occurs the circuit is changed according to a classical algorithm and the quantum algorithm is run again. And so on until we believe we found the solution (my summary is probably a little bit short/exagerated as I don't have in full memory the details but from what I remember it is something roughly like this)
In this algorithm there are two important features:
- There is a classical processing around that is used in parallel of the quantum which goal is to "update" the quantum circuit.
- We basically cannot know when the algorithm will stop "theoretically". It is not like in fault tolerant quantum computing where an algorithm has a fixed Depth so that we can deduce when it will stop.
I wanted to know if all (seriously considered) NISQ algorithms are based on those two elements: circuit updated from classical processing AND you don't know "in advance" when the algorithm will stop ?
From the example I read I think this is true but I don't know enough to be sure.
"
"['quantum-state', 'matrix-representation', 'unitarity', 'qudit', 'haar-distribution']"," Title: Is the column vector of a uniformly sampled random unitary matrix a uniformly sampled random state vector?Body: I am wondering if a random unitary matrix taken from a Haar measure (as in, it is uniformly sampled at random) can yield a uniformly sampled random state vector.
In section 3 of this paper it says "It is worthwhile mentioning that, although not advantageous, it is possible to use the rows or columns of such a random unitary matrix as random state vector" and also says in the previous section that " Another manner of obtaining samples with similar properties is by using the rows or columns of random unitary matrices, which we shall discuss in the next section."
I am a bit confused by the wording of this paper. Is it explicitly saying that taking a column or row from a random unitary matrix sampled uniformly will in fact give a random state vector with respect to the Haar measure?
"
['shors-algorithm']," Title: Why is the superposition of all states an eigenvector, with eigenvalue 1, of the QFT?Body: In many descriptions of order finding, but also in this answer here, it is shown that the superposition of all states is an eigenvector for eigenvalue 1.0. To cite:
Having found the eigenvalues, we now want to find the corresponding eigenvectors. We begin with the observation that 𝑈 permutes the states $|x^0\pmod N\rangle,\dots|x^{r-1}\pmod N\rangle$. Consequently, the uniform superposition
$$|v_0\rangle = \frac{1}{\sqrt{r}}\sum_{k=0}^{r-1}|x^k\pmod N\rangle\tag3$$
is an eigenvector associated with eigenvalue 1.
Sometimes this is being phrased as all eigenvectors adding up to $|1\rangle$.
I really don't get this conclusion. Any insights / pointers?
Thanks
"
"['information-theory', 'key-distribution', 'qkd']"," Title: Average secret key rate calculationBody: I am working on a problem related to average secret key rate calculation in satellite quantum key distribution (QKD). The problem is similar to a paper on arXiv:1712.09722 (P. No. 21).
In a single mode transfer version of entanglement based QKD, we send one of the modes to the satellite via atmospheric fading channel, while the other mode is retained at the ground. We assume that the atmospheric fading channel transmissivity $\eta$ is distributed according to probability distribution $P(\eta)$ with maximum transmissivity $\eta_0$. The resultant mixed state can be written as
$$
\rho_t^{\prime} = \int_0^{\eta_0} P(\eta) \rho^{\prime}(\eta) d \eta.
$$
The average secret key rate can be calculated as
$$
K = \int_0^{\eta_0} P(\eta) K[\rho^{\prime}(\eta) ]d \eta.
$$
However, I am unable to follow the above equation. I first tried to see how the mutual information can be evaluated in such a scenario. I came to know that ``the mutual information is neither convex nor concave in the joint distribution or density matrix" Ref: arXiv:1404.6496
However, I don't know how to proceed further in this special case also. Any help will be appreciated.
"
"['quantum-gate', 'ibm-q-experience', 'quantum-fourier-transform', 'quantum-circuit']"," Title: Why can I not apply a control gate/function to a gate like T, S, S dagger, ... (using IBM Quantum Experience)? Is there another option?Body: I am trying to use the circuit composer of the IBM QE. I am doing the inverse QFT on 3 qubits and therefore need a control on T and S dagger gates, but it won't let me.
Does anyone know why or know a way around it? I've been stuck on this for a while now and have no idea what to do.
Thanks
"
"['textbook-and-exercises', 'partial-trace', 'trace']"," Title: How do I trace out the second qubit to find the reduced density operator?Body: I'm doing an exercise to trace out the second qubit to find the reduced density operator for the first qubit:
$tr_2|11\rangle\langle00| = |1\rangle\langle0|\langle0|1\rangle$
I'm just wondering if I do trace for the first qubit, should I have:
$tr_1|11\rangle\langle00| = |1\rangle\langle0|\langle0|1\rangle$ or
$tr_1|11\rangle\langle00| = \langle0|1\rangle|1\rangle\langle0|$ ?
In the Nielsen-and-Chuang textbook, we have $tr(|b_1\rangle\langle b_2|)=\langle b_2|b_1\rangle$. Can I say the left and right hand side are just two ways to locate an element in a matrix?
Thanks!!
"
"['programming', 'qiskit']"," Title: Error When Importing from qiskit.aquaBody: Qiskit Aqua raises the following exception:
ImportError: dlopen: cannot load any more object with static TLS
I don't understand what might be causing this. I currently have a Ubuntu 14.04 Linux distribution and am using Anaconda Navigator, which I have downloaded with Conda. See code and full error log below.
Code:
from qiskit import *
from numpy import *
import qiskit as q
from math import pi
import numpy as np
from numpy.fft import fft
import scipy.fftpack
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt1
import matplotlib.pyplot as plt2
import matplotlib.pyplot as circuit
from qiskit.quantum_info import Statevector
from qiskit.quantum_info import DensityMatrix
from qiskit.visualization import plot_bloch_multivector, plot_histogram
from qiskit.visualization import plot_state_city
from typing import List, Union
from qiskit.quantum_info import Pauli
import time
from itertools import combinations
from qiskit.compiler import assemble
from qiskit.test.mock import FakeVigo
from qiskit.circuit import Parameter
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit.tools.visualization import circuit_drawer
from matplotlib import style
from qiskit import execute, BasicAer
from qiskit.compiler import transpile
from qiskit.quantum_info.operators import Operator, Pauli
from qiskit.quantum_info import process_fidelity
from qiskit.extensions import RXGate, XGate, CXGate
from qiskit import QuantumCircuit
from qiskit.circuit import ParameterExpression
from typing import Union, Set, List
import numpy as np
from qiskit.circuit import ParameterExpression
from qiskit.aqua.operators import PrimitiveOp
%matplotlib inline
#%matplotlib tk
#style.use("classic")
COLOR = 'white'
COLOR1 = 'black'
plt.rcParams['text.color'] = COLOR1
plt.rcParams['axes.labelcolor'] = COLOR
plt.rcParams['xtick.color'] = COLOR
plt.rcParams['ytick.color'] = COLOR
plt1.rcParams['text.color'] = COLOR1
plt1.rcParams['axes.labelcolor'] = COLOR
plt1.rcParams['xtick.color'] = COLOR
plt1.rcParams['ytick.color'] = COLOR
plt2.rcParams['text.color'] = COLOR1
plt2.rcParams['axes.labelcolor'] = COLOR
plt2.rcParams['xtick.color'] = COLOR
plt2.rcParams['ytick.color'] = COLOR
#style.use("seaborn-whitegrid")
plt.rc('legend',fontsize=20) # using a size in points
plt1.rc('legend',fontsize=20) # using a size in points
plt2.rc('legend',fontsize=20) # using a size in points
#Rotation Parameters:
#N = .5
Error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-f30f52024441> in <module>
35
36 from qiskit.circuit import ParameterExpression
---> 37 from qiskit.aqua.operators import PrimitiveOp
38
39
~/anaconda3/lib/python3.8/site-packages/qiskit/aqua/__init__.py in <module>
74 from .missing_optional_library_error import MissingOptionalLibraryError
75 from .aqua_globals import aqua_globals
---> 76 from .quantum_instance import QuantumInstance
77 from .algorithms import QuantumAlgorithm
78 from ._logging import (QiskitLogDomains,
~/anaconda3/lib/python3.8/site-packages/qiskit/aqua/quantum_instance.py in <module>
32
33 from .aqua_error import AquaError
---> 34 from .utils.backend_utils import (is_ibmq_provider,
35 is_statevector_backend,
36 is_simulator_backend,
~/anaconda3/lib/python3.8/site-packages/qiskit/aqua/utils/__init__.py in <module>
58 from .subsystem import get_subsystem_density_matrix, get_subsystems_counts
59 from .entangler_map import get_entangler_map, validate_entangler_map
---> 60 from .dataset_helper import (get_feature_dimension, get_num_classes,
61 split_dataset_to_data_and_labels,
62 map_label_to_class_name, reduce_dim_to_via_pca)
~/anaconda3/lib/python3.8/site-packages/qiskit/aqua/utils/dataset_helper.py in <module>
16 from copy import deepcopy
17 import numpy as np
---> 18 from sklearn.decomposition import PCA
19
20
~/anaconda3/lib/python3.8/site-packages/sklearn/__init__.py in <module>
79 from . import __check_build # noqa: F401
80 from .base import clone
---> 81 from .utils._show_versions import show_versions
82
83 __all__ = ['calibration', 'cluster', 'covariance', 'cross_decomposition',
~/anaconda3/lib/python3.8/site-packages/sklearn/utils/_show_versions.py in <module>
10 import importlib
11
---> 12 from ._openmp_helpers import _openmp_parallelism_enabled
13
14
ImportError: dlopen: cannot load any more object with static TLS
"
"['quantum-state', 'partial-trace']"," Title: Where does the term $|\psi\rangle\langle\psi|$ come from while calculating the expectation value?Body: Suppose there're two systems $A$ and $B$, if we're in a pure state $|\psi\rangle\in\mathbb{H}_a\otimes\mathbb{H}_b$. Let $\hat A$ be an operator acting on $\mathbb{H}_a$ and $|\psi\rangle=\sum_{i,j}\psi_{i,j}|a_i\rangle|b_j\rangle$. The expectation value of A with respect to the state $|\psi\rangle$ can be calculated as
$$
\langle A\rangle_{\psi}= Tr_{\mathbb{H}_a\otimes\mathbb{H}_b}(A|\psi\rangle\langle\psi|)=\sum_{i,j}\langle a_i|\langle b_j|A\otimes\mathbb{1}_B|\psi\rangle\langle\psi|a_i\rangle|b_j\rangle=...
$$
I'm very confused about where these two equalities coming from? In particular, where does the term $|\psi\rangle\langle\psi|$ in the sum come from? Can I understand its function as generating a $\psi$ matrix with different constants $\psi_{i,j}$?
"
['quantum-state']," Title: Does applying the transformation $\sum\alpha_{jk}|j,f(k)\rangle\mapsto\sum\omega_N^{-jk}\alpha_{jk}|j,f(k)\rangle$ require computing $f^{-1}$?Body: Suppose that I have a bijective function $f: \mathbb{Z}_N → Y$ where $Y$ is a finite set. Suppose that $f$, but not its inverse, can be computed efficiently classically.
I would like to apply the following diagonal unitary transformation:
$$
\sum_{j,k \in \mathbb{Z}_N} \alpha_{j,k} \vert j, f(k) \rangle \mapsto \sum_{j,k \in \mathbb{Z}_N} \omega_N^{-jk} \alpha_{j,k} \vert j, f(k) \rangle.
$$
Here, $\omega_N = e^{\frac{2 \pi i}{N}}$.
My question is: if I want to apply this transformation, does that require $f$ to be inverted classically, or is that not needed because my sum goes over $j$ and $k$?
Thanks in advance.
"
"['quantum-gate', 'programming', 'circuit-construction', 'cirq', 'tfq']"," Title: How to convert a dataset of different values in [0,1000] to quantum data for training a model using Tensorflow QuantumHaving?Body: import sympy
import cirq
from cirq.contrib.svg import SVGCircuit
import tensorflow_quantum as tfq
import tensorflow as tf
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.utils import to_categorical
from tensorflow.keras import layers
import os
class CircuitLayerBuilder():
def __init__(self,data_qubits,readout):
self.data_qubits=data_qubits
self.readout=readout
def add_layer(self,circuit,gate,prefix):
for i,qubit in enumerate(self.data_qubits):
symbol=sympy.Symbol(prefix+ '-' +str(i))
circuit.append(gate(qubit,self.readout)**symbol)
demo_builder=CircuitLayerBuilder(data_qubits=cirq.GridQubit.rect(32,32),readout=cirq.GridQubit(-1,1))
circuit=cirq.Circuit()
demo_builder.add_layer(circuit,gate=cirq.XX,prefix='xx')
SVGCircuit(circuit)
def create_quantum_model():
data_qubits=cirq.GridQubit.rect(32,32)
readout=cirq.GridQubit(-1,1)
circuit=cirq.Circuit()
circuit.append(cirq.X(readout))
circuit.append(cirq.H(readout))
builder=CircuitLayerBuilder(data_qubits=data_qubits,readout=readout)
builder.add_layer(circuit,cirq.XX, "xx1")
builder.add_layer(circuit,cirq.ZZ ,"zz1")
circuit.append(cirq.H(readout))
return circuit,cirq.Z(readout)
def convert_to_circuit(filename):
values=np.ndarray.flatten(filename)
qubits=cirq.GridQubit.rect(32,32)
circuit=cirq.Circuit()
for i,value in enumerate(values):
if value:
circuit.append(cirq.X(qubits[i]))
return circuit
file =np.load('CWRU_48k_load_1_CNN_data.npz')
data = file['data']
labels = file['labels']
category_labels = np.unique(labels)
labels = pd.Categorical(labels, categories = category_labels).codes
train_data, test_data, train_labels, test_labels = train_test_split(data, labels, test_size = 1000, random_state = 829,
stratify = labels)
# reshape data
train_data = train_data.reshape(len(train_data),32,32,1)
test_data = test_data.reshape(len(test_data),32,32,1)
#train_labels = to_categorical(train_labels)
#test_labels = to_categorical(test_labels)
x_train_circ=[convert_to_circuit(x) for x in train_data]
x_test_circ=[convert_to_circuit(x) for x in test_data]
x_train_tfcirc=tfq.convert_to_tensor(x_train_circ)
x_test_tfcirc=tfq.convert_to_tensor(x_test_circ)
model_circuit,model_readout=create_quantum_model()
model=tf.keras.Sequential([tf.keras.layers.Input(shape=(),dtype=tf.string),
tfq.layers.PQC(model_circuit,model_readout),
])
index = np.random.permutation(len(train_labels))
trian_data, trian_labels = train_data[index], train_labels[index]
SVGCircuit(x_train_circ[0])
y_train_hinge=2.0*test_data-1.0
y_test_hinge=2.0*test_labels-1.0
def hinge_accuracy(y_true, y_pred):
y_true = tf.squeeze(y_true) > 0.0
y_pred = tf.squeeze(y_pred) > 0.0
result = tf.cast(y_true == y_pred, tf.float32)
return tf.reduce_mean(result)
model.compile(loss=tf.keras.losses.Hinge(),
optimizer=tf.keras.optimizers.Adam(),
metrics=[hinge_accuracy])
epochs=25
batch_size=16
num_examples=len(x_train_tfcirc)
x_train_tfcirc_sub=x_train_tfcirc[:num_examples]
y_train_hinge_sub=y_train_hinge[:num_examples]
history = model.fit(x=x_train_tfcirc_sub,
y=y_train_hinge_sub,
batch_size=16,
epochs=25,
verbose=1,validation_data=(x_test_tfcirc,y_test_hinge))
print(model.summary())
qnn_results=model.evaluate(x_test_tfcirc,test_labels)
print(qnn_results)
"
"['programming', 'trapped-ion', 'compiling']"," Title: What are the available compilers for Trapped-Ion Quantum Computing Architecture?Body: I am looking for a compiler to compile a high-level quantum circuit for the Trapped-Ion Quantum Computing architecture, i.e. a compiler that can translate a high-level circuit to native gates of the TI hardware (single-qubit rotations and 2-qubit MS gate) in an optimized manner.
"
"['quantum-gate', 'circuit-construction']"," Title: How does a rotation about the y-axis on a Bloch sphere affect the state of a qubit?Body: I am unsure how exactly it can be inferred that the following sequence of logic gates and rotation operators acting on a three-qubit state $\lvert abc\rangle$
$$ R_{y,c}\left(\frac{\pi}{4}\right)CNOT(b,c)R_{y,c}\left(\frac{\pi}{4}\right)CNOT(a,c)R_{y,c}\left(-\frac{\pi}{4}\right)CNOT(b,c) R_{y,c}\left(-\frac{\pi}{4}\right) $$
(Where, for example, $R_{y,c}(\frac{\pi}{4})$ represents a $\frac{\pi}{4}$ rotation of qubit c about the y-axis and CNOT(b,c) represents the CNOT gate acting on the qubits b and c (b is the control and c is the target).)
Can represent that of a Toffoli gate but with relative phases.
My specific problem with understanding this sequence are the rotation operators. If I neglect the rotation operators and just apply the three CNOT logic gates for some state $\lvert abc\rangle$ (e.g. $\lvert 110\rangle$), it is apparent that the sequence of the three CNOT gates acts as a single Toffoli gate. But I'm confused by trying to understand what effect the rotation operators have on each c qubit. Do they cancel each other out? Do they impose a net rotation on some state $\lvert abc\rangle$?
I've tried to make sense of it all by envisioning rotations on a Bloch sphere but it hasn't helped. If anyone could provide an explanation as to what effect a rotation operator has on a qubit, that would be helpful. Thank you.
"
"['complexity-theory', 'bqp', 'boson-sampling']"," Title: CS conjecture that Quantum Computer cannot solve NP-complete problems, but Boson Samplers do a #P-hard problem. How is it?Body: There is something very strange and absurd for me about the power of a quantum computer. Let me briefly states the following facts:
Fact 1: theoretical computer scientists believe (very likely to happen) that quantum computer cannot solve NP-complete problems.
Fact 2: In BQP, there are problems that is harder than NP, such as Boson sampling distribution which is known to be $\#P$$-hard$.
Fact 3: If Boson sampling distribution (and other problems such as Quantum Sampling) belong to $PH$, then the polynomial time hierarchy collapsed. So, it is unlikely that these problems belongs to $PH$.
Now, by these facts it is said that BQP is greater class than $PH$. I.e. since all NP problems lies in PH, then BQP contains all NP problems including the NP-complete problems. But, at the same time, theoretical computer scientists (such as Scott Aaronson) conjectured that quantum computer cannot solve NP-complete problems efficiently, i.e. they are trying to say the following: BQP should be smaller than class PH.
Can someone explain to me whether I'm wrong about something or not.
"
"['entanglement', 'information-theory', 'communication']"," Title: If Alice and Bob share only classical communication resources, is shared entanglement always equivalent to shared randomness?Body: If Alice and Bob share only classical communication resources such as noisy or perfect classical channels, is shared entanglement always equivalent to shared randomness?
In other words, must there be a quantum channel in order to exploit the power of shared entanglement? If yes, how can one prove this?
"
"['teleportation', 'communication', 'quantum-networks']"," Title: Why do quantum networks matter?Body: I'm very new to quantum computing, sorry if this is a dumb question.
I was reading in some lecture notes I found online that a quantum network could be created by using teleportation multiple times to move a qubit from one node to the next until it reaches its destination. So, like if you wanted to get a qubit from point A to point D, you could send it from A to B, B to C, and then C to D. At each step, you would send 2 classical bits and use them for quantum teleportation of a qubit.
2 bits A -> B
1 qubit A -> B
2 bits B -> C
1 qubit B -> C
2 bits C -> D
1 qubit C -> D
So I guess my question is, would it be possible to send the necessary classical bits from A to B to C to D, and then use those to directly perform quantum teleportation from A to D? And if so, what is the advantage of performing quantum teleportation at each step?
2 bits A -> B
2 bits B -> C
2 bits C -> D
1 qubit A -> D
"
"['programming', 'qiskit', 'qaoa']"," Title: How to use Initial States in Qiskits QAOA?Body: The class QAOA from qiskit:
https://qiskit.org/documentation/stubs/qiskit.aqua.algorithms.QAOA.html
has the parameter initial_state from the type InitialState.
https://qiskit.org/documentation/apidoc/qiskit.aqua.components.initial_states.html#module-qiskit.aqua.components.initial_states
class QAOA(operator=None, optimizer=None, p=1, initial_state=None, mixer=None, initial_point=None, gradient=None, expectation=None, include_custom=False, max_evals_grouped=1, aux_operators=None, callback=None, quantum_instance=None)
But this doesnt work.
qaoa_mes = QAOA(H, p=p, optimizer=optimizer, initial_state = Zero, quantum_instance=Aer.get_backend("qasm_simulator"))
results = qaoa_mes.run()
Any Ideas?
"
['architecture']," Title: A distributed, scale-out quantum computing architecture?Body: Having been part of the mainframe, client-server, and now containers scale out architecture, I can observe the parallel and resemblance of today's quantum computers (massive) to that of the mainframe era where everyone hooks onto this massive mainframe for computational power.
How does one design a fundamentally distributed scale-out quantum computing architecture?
"
"['mathematics', 'measurement', 'notation', 'povm']"," Title: What is the relation between observables (as defined in the measure-theoretic framework) and POVMs?Body: A POVM is typically defined as a collection of operators $\{\mu(a)\}_{a\in\Sigma}$ with $\mu(a)\in\mathrm{Pos}(\mathcal X)$ positive operators such that $\sum_{a\in\Sigma}\mu(a)=I$, where I take here $\Sigma$ to be some finite set and $\mathcal X$ some vector space (using the notation from Watrous' TQI).
On the other hand, when discussing observables in a measure-theoretic framework, given a nonempty set $\Omega$, a $\sigma$-algebra $\mathcal F$ on $\Omega$ (in other words, given a measurable space $(\Omega,\mathcal F)$), and denoting with $\mathcal E(\mathcal X)$ the set of effects on the space $\mathcal X$, that is, the set of Hermitian operators $E$ such that $0\le E\le I$, we say that a mapping $\mathrm A:\mathcal F\to\mathcal E(\mathcal X)$ is an observable if, for any state $\psi\in\mathcal X$, the function
$$\mathcal F\ni X\mapsto \langle \psi|\mathrm A(X)\psi\rangle\in\mathbb R$$
is a probability measure. Here I'm taking definition and notation from Heinosaari et al. (2008).
In other words, $\mathrm A$ is an observable iff, for all $\psi\in\mathcal X$, the triple $(\Omega,\mathcal F,\mathrm A_\psi)$ is a probability space, with $\mathrm A_\psi$ defined as $\mathrm A_\psi(X)=\langle \psi|\mathrm A(X)\psi\rangle$.
I'm trying to get a better understanding of how these two different formalisms match.
In particular, an observable as thus defined is closer to a POVM than an "observable" as usually defined in physics (which is just a Hermitian operator), right?
Are these observables equivalent to POVMs? That is, does any such observable correspond to a POVM, and vice versa?
I can see that a POVM can be thought of as/is the map $\mu:\Sigma\to\mathrm{Pos}(\mathcal X)$, which then extends to a map $\tilde\mu:2^{\Sigma}\to\mathrm{Pos}(\mathcal X)$ such that $\tilde\mu(2^\Sigma)=1$, which is then an observable.
However, I'm not sure whether any observable also corresponds to such a POVM.
"
"['simulation', 'hamiltonian-simulation', 'models', 'quantum-computing-for-finance']"," Title: Applications of Quantum Computing to EconomicsBody: I have recently been interested in the field of 'Econophysics' which as I understand it is the practice of basically applying results of physics in areas such as non-linear dynamics and stochastic physics to already known facts of economics (i.e. it is not a field of new discoveries but just a different perspective on economics).
I am also a lover of all things Quantum.
I was wondering if there have been any attempts to use QC to simulate economic models, which tend to be really difficult on classical computers. The field of "Quantum Finance" (how much more buzzword-y can a field get...), is able to describe many phenomena in finance and monetary supply management using quantum concepts like Hilbert Spaces and state collapses (this has nothing to do with quantum mechanics, it just uses the same formalism). Maybe in the same way that Hamiltonian simulation can be done easily on a quantum computer, because it just naturally lends itself to the medium, these Quantum Finance models can also be done easily?
"
"['gate-synthesis', 'matrix-representation']"," Title: Representation of multiple qubit matrices in Dirac notationBody: Imagine one wants to represent the and function for any number of qubits in Dirac notation. The and gate flips the target qubit if all the control qubits are in state 1. This is its matrix representation :
$$\begin {bmatrix}
1 & 0 & 0 & \cdots & 0 & 0 \\
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & \ddots & & \vdots & \vdots \\
\vdots & \vdots & & 1 & 0 & 0 \\
0 & 0 & \cdots & 0 & 0 & 1 \\
0 & 0 & \cdots & 0 & 1 & 0 \\
\end{bmatrix}$$
It can be decomposed into two parts :
$$\begin{bmatrix}
1 & 0 & 0 & \cdots & 0 & 0 \\
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & \ddots & & \vdots & \vdots \\
\vdots & \vdots & & 1 & 0 & 0 \\
0 & 0 & \cdots & 0 & 0 & 0 \\
0 & 0 & \cdots & 0 & 0 & 0 \\
\end{bmatrix}=
\begin{bmatrix}
1 & 0 & \cdots & 0 & 0 \\
0 & 1 & \cdots & 0 & 0\\
\vdots & \vdots & \ddots & & \vdots \\
0 & 0 & & 1 & 0 \\
0 & 0 & \cdots & 0 & 0 \\
\end{bmatrix} \otimes I =
\begin{bmatrix}
1 & 0 & \cdots & 0 & 0 \\
0 & 1 & \cdots & 0 & 0\\
\vdots & \vdots & \ddots & & \vdots \\
0 & 0 & & 1 & 0 \\
0 & 0 & \cdots & 0 & 1 \\
\end{bmatrix} \otimes I-
\begin{bmatrix}
0 & 0 & \cdots & 0 & 0 \\
0 & 0 & \cdots & 0 & 0\\
\vdots & \vdots & \ddots & & \vdots \\
0 & 0 & & 0 & 0 \\
0 & 0 & \cdots & 0 & 1 \\
\end{bmatrix} \otimes I
= (I-|1\cdots1\rangle\langle1\cdots1| ) \otimes I
\tag{1}$$
and
$$\begin {bmatrix}
0 & 0 & 0 & \cdots & 0 & 0 \\
0 & 0 & 0 & \cdots & 0 & 0\\
0 & 0 & \ddots & & \vdots & \vdots \\
\vdots & \vdots & & 0 & 0 & 0 \\
0 & 0 & \cdots & 0 & 0 & 1 \\
0 & 0 & \cdots & 0 & 1 & 0 \\
\end{bmatrix} = \begin{bmatrix}
0 & 0 & \cdots & 0 & 0 \\
0 & 0 & \cdots & 0 & 0\\
\vdots & \vdots & \ddots & & \vdots \\
0 & 0 & & 0 & 0 \\
0 & 0 & \cdots & 0 & 1 \\
\end{bmatrix} \otimes X =
|1\cdots1\rangle\langle1\cdots1| \otimes X
\tag{2}$$
So combining (1) and (2), we get : $$U_{and} = (I-|1\cdots1\rangle\langle1\cdots1| ) \otimes I + |1\cdots1\rangle\langle1\cdots1| \otimes X$$
This is still pretty easy to see, the example complicates a lot when we have an or gate : $$U_{or} = U_{or} = |0...0\rangle\langle 0...0|\otimes I + \big(I - |0...0\rangle\langle 0...0|\big) \otimes X$$ which applies the X gate on the target qubit if there is at least 1 control qubits in the $|1\rangle$ state.
My question is : is there any way to see these transformations in Dirac notation to use them in a program ? To gain some intuition on the decomposition.
"
"['many-body-systems', 'quantum-fourier-transform']"," Title: Lieb-Robinson Bound in 2nd quantized description?Body: Background
Let us restrict our discussion to bosons and adopt the convention First Quantised $\leftrightarrow $ Second Quantised Theory (we are following these Ashok Sen's Quantum Field Theory I of HRI institute's notes also on my google drive). Consider a single particle system's hamiltonian $\hat h$ and energy operator $\hat E$:
$$ \hat h \psi = \hat E \psi $$
with energy eigenstates $u_i$ and eigenvalues $e_n$
$$ \hat h u_n = e_n u_n$$
Now moving to an assembly of quantum mechanical Hamiltonians (many body system) $\sum_i h_i$ with an interacting potential $\hat v_{ik}$ (between two particles corresponds to a second quantised version (Page 16):
$$ \hat H_N = \sum_{i=1}^N \hat h_i + \frac{1}{2}\sum_{\substack i\neq j
\\ i,j=1 }^N \hat v_{i,j} \leftrightarrow \sum_{n=1}^\infty e_n a_n^\dagger a_n + \frac{1}{2} \sum_{m,n,p,q=1}^\infty \Big(\int \int d^3 r_1 d^3 r_2 u_{m}(\vec r_1)^* u_{n}(\vec r_2)^* \hat v_{12} u_{m}(\vec r_1) u_{p}(\vec r_2) \Big) a^\dagger_m a^\dagger_n a_p a_q$$
where $e_n$ i the $n$th energy eigevalue, $u_i$ are the one-particle eigenstates and $a_i^\dagger$ is the creation operator of the $i$'th particle and they obey the energy eigenvalue system $h_i u_n = e_n u_n$. The symmetric wave function for $H_N$ corresponds as a second quantised version (Page 6):
$$ u_{n_1,n_2,\dots n_N} \equiv \frac{1}{\sqrt{N!}} \sum_{\text{permutations of $r_1,\dots,r_N$}}u_{n_1} (\vec r_1) \dots u_{n_N} (\vec r_N) \leftrightarrow (a_1^\dagger)^{n_1} (a_2^\dagger)^{n_2} \dots (a_N^\dagger)^{n_N} |0 \rangle$$
Now, in QM one can derive the Lieb-Robinson bound as:
$$ || [ O_A(t), O_B(0) ] || < C e^{- \frac{L-vt}{\eta}}$$
with $|| A ||$ is the norm of the operator, $ O_A(t) = e^{ i H t} O e^{- i H t} $ where the operators $O_A$ and $O_B$ act non-trivially on the subsystems $A$ and $B$ and identity outside it.
Question
Since the mathematical machinery is only different (QFT vs QM) and the physical system is the same. How does one derive the Lieb-Robinson (or equivalent) bound in the Second Quantized Theory?
"
"['qiskit', 'ibm-q-experience', 'ibm', 'qasm', 'openpulse']"," Title: Is it possible to modify pulse schedules in QASM?Body: Is it possible to modify a pulse schedule of a circuit compiled using QASM? I know this is possible using OpenPulse, but it seems none of the IBM backends support OpenPulse. So is it possible to do this through QASM? This paper gives me the impression that I would only be able to modify the QASM command order, but not the actual pulse schedule. Is this correct?
"
"['physical-realization', 'nielsen-and-chuang']"," Title: What are Sideband PulsesBody: I see sideband pulses used all over the place when looking up implementation techniques especially in Trapped Ion QC. Is there a layman's explanation of what they actually are? I understand what they do in terms of Energy Transitions, and how that is then used for gates; but I am struggling with understanding how these pulses can be tweaked to do nearly everything (In the case of the Cirac-Zoller Gate for instance).
My reference text has been Nielsen and Chuang, where they introduce sideband pulses in chapter 7.6; just for some context on where I am. Thanks!
"
"['quantum-operation', 'noise', 'fidelity']"," Title: Is un-computing $U$ a good proxy for circuit fidelity?Body: I'm trying to estimate the fidelity of some family of unitaries $U(\theta)$ implemented on a noisy quantum computer. To do so, I start from an uninitialized state $|0\rangle$ and run the circuit $U(\theta)^\dagger U(\theta)$, and then measure the probability of returning to the all-zeros bitstring as
$$
P_\theta (0) = |\langle 0| \mathcal{E}_{U(\theta)^\dagger} \mathcal{E}_{U(\theta)} |0 \rangle |^2
$$
where $\mathcal{E}_U$ is the (noisy) process that results from trying to run $U$. If $P(0) \neq 1$ then I have some idea that my operation ran with lower fidelity. But I would like to know more about how well this kind of reasoning generalizes:
- How well does $P_\theta(0)$ track the fidelity of this process, $F(\mathcal{E}_{U(\theta)} , U(\theta))$, if at all?
- Can I expect any kind of relationship between $P_\theta(0)$ and $P_\theta(\psi) \equiv |\langle \psi| \mathcal{E}_{U(\theta)^\dagger} \mathcal{E}_{U(\theta)} |\psi \rangle |^2$, i.e. the same experiment repeated for a different input state?
- Can I expect any kind of relationship between $P_\theta(0)$ and $P_\phi (0)\equiv |\langle 0| \mathcal{E}_{U(\phi)^\dagger} \mathcal{E}_{U(\phi)} |0 \rangle |^2$ i.e. the same experiment repeated on a similar unitary $U(\phi)$
I can think of specific counterexamples that show that some of these relationships fail to hold but ideally there would be a way to assess the likelihood of this being a good (or bad!) metric.
"
"['programming', 'measurement', 'cirq']"," Title: Cirq: Result of rotating qubit measurements never come [0 1] or [1 0 ], always come as [0,0] or [1,1]Body: I am creating a 2 qubit entangled state:
def density_matrix_chsh(i, j, qs):
circuit = chsh_circuit(i, j, qs)
return cirq.final_density_matrix(circuit, qubit_order=qs)
def chsh_circuit(i, j, qs):
return cirq.Circuit(cirq.H(qs[i]), cirq.CNOT(qs[i], qs[j]))
qs = [a, b]
state = density_matrix_chsh(0, 1, qs)
Then I am applying rotation for maximum violation:
th = np.pi/(-2)
th1 = np.pi/(4)
th2 = 0
random_angles = []
newlist = []
b_big = cirq.kron(cirq.unitary(cirq.ry(th)),cirq.unitary(cirq.ry(th)))
results = []
for choosen in itertools.product([th2, th1], repeat=2):
random_angles.append(choosen)
for i in range (1000):
choosen_combination = random.choice(random_angles)
a_big = cirq.kron(cirq.unitary(cirq.rz(choosen_combination[0])),cirq.unitary(cirq.rz(choosen_combination[1])))
rotated_state = b_big @ a_big @ state @ b_big.conj().T
measurement_rotated = cirq.measure_density_matrix(rotated_state,indices=[0, 1])
print("measuring qubits ",measurement_rotated)
qubit_result = measurement_rotated[0]
results.append(qubit_result)
For instance here I tried 1000 times and both qubits are either 0 or 1 at the sma time but I could never see one of them 1 and the other one is 0 after measurement. Probably I am doing something wrong and I can't see
Thanks for helps
"
"['algorithm', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: What does the quantum part of the quantum support vector machine actually do?Body: I'm implementing a quantum support vector machine on qiskit and I was wondering what the quantum part of the algorithm actually does. I'm aware that it's a feature map that executes the kernel function but what is the significance of using quantum computers for that if the kernel trick is already effective classically? And how does the quantum feature map work?
"
"['programming', 'projectq']"," Title: How to read the unitary matrix of a quantum circuit in ProjectQ?Body: I would like to read the unitary matrix of a quantum circuit in ProjectQ.
Is there any way to do it?
"
"['resource-request', 'physical-realization']"," Title: Up to date overview of experimental approaches to quantum computingBody: I'm interested in getting an overview of the leading approaches to quantum computing from a physics perspective. I've read most of Nielsen and Chuang, but its chapter on physical realizations looks extremely out of date.
Is there a resource at a similar level that covers the approaches used by, e.g. Google, Microsoft, Pan's group, and IBM? I've seen a lot of qualitative material, but it's usually aimed at computer science people and thus physics-free. I'm looking for something at the level of "here's the Hamiltonian describing a single qubit, here's the interaction Hamiltonian describing a gate, here's how readout is done", and so on.
"
"['measurement', 'textbook-and-exercises', 'density-matrix', 'nielsen-and-chuang', 'partial-trace']"," Title: What's the 'physical consistency' in the partial trace scenario?Body: I'm reading 'Why the partial trace' section on page 107 in Nielsen and Chuang textbook. Here's part of their explanations that I don't quite understand:
Physical consistency requires that any prescription for associating a ‘state’, $\rho^A$, to system A, must have the property that measurement averages be the same whether computed via $\rho^A$ or $\rho^{AB}$ : $\text{tr}(Mf(\rho^{AB}))=\text{tr}((M\otimes I_B)\rho^{AB})$
Here $M$ is any observable on system A. I'm wondering what 'physical consistency' and 'measurement average' are?
It is also argued that $f(\rho^{AB})=\rho^A=\text{tr}_B(\rho^{AB})$ is a uniquely determined map. I'm also confused about this point. Could someone give me some more explanations? Thanks!!
"
"['programming', 'classical-computing', 'optimization']"," Title: Question on practical quantum computing programming codeBody: Has anyone tried any quantum computing programming code that shows or demonstrates the advantage of a quantum computer over classical computers? Thanks a lot.
"
"['programming', 'qiskit', 'vqe', 'qaoa']"," Title: Qiskit: getting QAOA expectationBody: Suppose I run the Qiskit's QAOA algorithm.
qaoa = QAOA(operator=qubit_operator, p=p, optimizer=optimizer)
result = qaoa.run(quantum_instance)
There is a built-in method that gets me the most likely binary solution for this problem. sample_most_likely(result['eigenstate']) But how do I get the whole probability distribution of binary solutions? Ultimately, I would like to calculate the expected value for my problem, not the value based solely on the most likely string.
"
"['resource-request', 'vqe', 'openfermion']"," Title: implement variational quantum eigensolver with openfermionBody: Can someone provide me with an example about how to implement VQE with OpenFermion, for example, use the UCCSD ansatz to get the ground state energy of LiH. I have checked some code, but none of them is up to date (deprecated). Also, there is no demo code in the official document for VQE implementation.
Also, can somebody show me how to calculate energy with 1-electron and 2-electron reduced density matrix with OpenFermion using the following formula (A14).
"
"['algorithm', 'hhl-algorithm']"," Title: HHL and choice of observable for calculating the expectation value thereofBody: The chapter about solving linear systems in the qiskit textbook describes the last (6th) step of the HHL algorithm as follows
Apply an observable $M$ to calculate $F(x):=\langle x |M|x\rangle$.
How is this observable $M$ chosen? What are the considerations?
"
"['quantum-state', 'simulation', 'classical-computing', 'chemistry']"," Title: No. of bits in 160 qubits computerBody: I read in a book that (https://hub.packtpub.com/quantum-expert-robert-sutor-explains-the-basics-of-quantum-computing/)
160 qubits (quantum bits) could hold $2^{160} \approx1.46\times 10^{48}$ bits while the qubits were involved in computation."
How does this calculation come about?
The context of the statement is that a caffine molecule would require $10^{48}$ bits to be represented by a classical computer. However a quantum computer would require 160 qubits and is thus well suited for such representation.
If I look at this question on Quora, a 512 bit computer (which I suppose are real) would give a largest 155 digit number (https://www.quora.com/How-many-digits-are-in-a-512-bit-number). Isn't that big enough to represent atoms, molecules etc.?
"
"['qiskit', 'measurement', 'classical-computing', 'information-theory']"," Title: If quantum computing always return random measurement (or uncertain measurement), why do we still need it?Body: I am very new to quantum computing and currently studying quantum computing on my own through various resources (Youtube Qiskit, Qiskit website, book).
As my mindset is still "locked" with classical computation, where input and output are very certain, I can confirm my output given a certain input. There are some confusion for me to understand quantum computing properly.
Then many described what are state vector, superposition, measurement, etc. I understand what they meant (or maybe not fully). State vector is probability of being 0 or 1. Superposition is linear combination between two basis ($|0\rangle$, $|1\rangle$ or $|+\rangle$, $|-\rangle$ or any orthogonal basis). Measurement, to get the outcome of a qubit given the probability of the qubit.
However what doesn't make me feel satisfy or "ahha" is that I don't understand, since quantum computing always give an uncertain outcome after measurement (e.g. this video about 2:40 the pong game shows when Hadamard gate is applied, then the probability of plane 000 and 001 are half-half and causing the loss because the ball didn't hit the plane), why we still want to use the uncertain outcome?
I understand (or maybe partially understand) that quantum computing is very fast, we can compute many things at once (since we have superposition or something), and we can simulate an experiment many times to get the result. However I don't think this solved my confusion.
So my question is, why do we still need quantum computing since it always gives uncertain measurement?
"
"['nisq', 'performance', 'trapped-ion']"," Title: Gate SWAP vs Physical SWAP in Trapped Ions for chain reorderingBody: In trapped ion quantum computers, especially in systems with multiple traps, you may need at some point to perform a "chain reordering", in which you change an ion's position within the ion chain like in the figure below (source):
This is basically a SWAP between two qubits, you can either do it by applying a SWAP gate or by physically rotating the ions. Of course, both methods have time and reliability overheads but, is there (currently) a consensus of which one is generally better than the other?.
"
['error-correction']," Title: Can Shor‘s code correct two- or three-qubit errors?Body: I have read some articles about Shor's code (e.g. this one). It is said that Shor's code can correct a single-qubit error. What about two qubit errors? Three qubit errors? It confused me a lot...
"
"['programming', 'simulation', 'q#']"," Title: Q# Simulation BehaviorBody: I am attempting to run a series of tests on a Q# program I'm running on the local simulator, but I'm not seeing any way to use >1 shot and collect the results of those shots at once, as in essentially every other quantum language/system I've seen. Is this not a feature at all in the Q#/Azure Quantum system? Thank you!
"
"['grovers-algorithm', 'phase-estimation', 'probability']"," Title: Quantum Amplitude Estimation vs Quantum Phase EstimationBody: Quick question concerning the probability of success after a phase estimation algorithm vs an amplitude estimation algorithm.
Given the calculation on the wikipedia page, the probability of measuring the desired output in a phase estimation algorithm is at least $\frac{4}{\pi^2}$. This is something that I think I have a pretty good handle on.
However, when looking at the amplitude estimation algorithm, we see that the probability of measuring the desired output is at least $\frac{8}{\pi^2}$ (i.e. twice as likely). The only proof that I have found was in Theorem 11 from the original paper. To be honest I am still working through this paper but it is quite terse and a bit difficult to read. Does anyone either have a good intuitive explanation for the difference in success probabilities between phase estimation and amplitude estimation? Or can someone maybe recommend a resource that describes this difference in a nice way? Thanks!
"
"['hadamard', 'superposition', 'amplitude-amplification']"," Title: Is it possible to tune the amplitude of superposition generated by Hadamard gates?Body: I had a question earlier about generating the superposition of all the possible states: Here. In that case, we could apply $H^{\otimes n}$ to the state $|0\rangle^{\otimes n}$, and each state has the same amplitude in the superposition: $|0\rangle^{\otimes n} \to \dfrac{1}{\sqrt{2^n}}\sum_{i=0}^{2^n-1} |i\rangle $. However, it is possible for us to tune the amplitude of certain states in the superposition? Say if I have 4 qubits and 4 Hadamard gates (one on each), that would generate a superposition of 16 states. Can I add some additional procedures to increase the amplitude of $|0110\rangle$ and $|1001\rangle$ and the rest states have the same and reduced amplitude?
Thanks!!
"
"['hamiltonian-simulation', 'qaoa']"," Title: Is $\gamma \in [0,2 \pi]$ or $\gamma \in [0,\pi]$ in $CU1(2\gamma)_{(i,j)} $?Body: When wanting to find the groundstate of this Hamiltonian with QAOA:
\begin{equation}
H_{C} =\sum_{i }^{n}(1 - Z_{i})/2 + \sum_{\{i,j\}\in \overline{E} } - 2(1 - Z_{i})(1 - Z_{j})/4
\end{equation}
whose the Hamiltonian Simulation is:
\begin{equation}\label{eq:qubo}
e^{ -i\gamma H_{C}} =\prod_{i}^{n} U1(-\gamma)_{i}\prod_{\{i,j\}\in \overline{E} } CU1(2\gamma)_{(i,j)}
\end{equation}
is $\gamma \in [0,2 \pi]$ or $\gamma \in [0,\pi]$ because of $2 \gamma$ in $CU1(2\gamma)_{(i,j)} $?
And how are $ U1(2\pi -\gamma)_{i}$ and $U1(-\gamma)_{i}$ distinguished?
"
"['quantum-state', 'classical-computing']"," Title: Aren't qubits just ternary?Body: Qubits have 3 states: 1, 0, and 1 and 0 at the same time. If a qubit can have 3 states, then how come they are seen as different from ternary computing, which also has 3 states?
Is it that the 3 states are represented in different ways, or what?
"
"['quantum-gate', 'teleportation']"," Title: What can gate teleportation be used for in practice?Body: I was quite fascinated when I learned about gate teleportation, but I am struggling with understanding what it may be used for.
Sure, one can use ancillae bits to teleport gates into various parts of a circuit... but why? In general would it not be more difficult to add extra qubits to the system as opposed to performing extra gate operations?
Gate teleportation looks great to me on paper (by this I mean drawing the physical circuits... it's so cool!), but when I think about an ion trap I can't seem to convince myself of a time where one would really use it if they have access to the proper lasers to implement gates.
"
"['quantum-state', 'bloch-sphere']"," Title: How is a two qubit mixed state represented in the form of Bloch vector?Body: How is a two qubit mixed state represented in the form of Bloch vector?
"
"['entanglement', 'fidelity', 'resource-theories', 'concurrence']"," Title: What is the relation between fidelity and concurrence for a two qubit maximally mixed state?Body: I am trying to understand the relation between Fidelity and Concurrence for a two qubit maximally mixed state. When I calculate the Fidelity and Concurrence, I observe that Concurrence is zero whereas Fidelity is one.
In some of the papers, I read that the relation between Fidelity and Concurrence is $F = (c+2/3)$. But this violates the above observation.
Please let me know if I miss anything.
"
"['physical-qubit', 'quantum-dots']"," Title: What does a gate electrode do in the context of a quantum dot?Body: I am trying to understand the creation of qubits through the use of quantum dots, but I have always had some trouble understanding the function of the gate electrode. I know it can control the chemical potential of the dot itself, but how does it actually work?
"
"['programming', 'entanglement', 'circuit-construction', 'cirq', 'ghz-state']"," Title: Cirq: n-qubit GHZ stateBody: I am trying to write $n$ party GHZ state but at the end of the day, it seems like bi partite state. I am missing a detail. Here is my code
number =6
qubits = cirq.LineQubit.range(number)
def n_party_GHZ_circuit(qubits)
GHZ_circuit = cirq.Circuit(cirq.H(qubits[i]),
cirq.CNOT(qubits[i], qubits[j]))
GHZ = cirq.final_density_matrix(n_party_GHZ_circuit)
I can write it by hand with indexes but suppose that we have 10 qubits and in that case I do not want to write it by hand for all combinations. So I am trying to write a function but I couldn't.
"
"['quantum-gate', 'pauli-gates', 'quantum-fourier-transform', 'hadamard', 'qudit']"," Title: How to generalize the relationship HXH = Z for higher dimensionsBody: Concerning the Hadamard gate and the Pauli $X$ and $Z$ gates for qubits, it is straightforward to show the following relationship via direct substitution:
$$ HXH = Z.\tag{1}$$
And I would like to demonstrate this relationship for higher dimensions (I know that this still holds for higher dimensions but I haven't found a proof for it anywhere).
I know that the $d$-dimension generalization of the X and Z Pauli gates for qudits are given by $X_d\lvert j\rangle = \lvert j\bigoplus1 \rangle$ and $Z_d\lvert j\rangle = \exp^{\frac{i2\pi j}{d}}\lvert j\rangle$ (where $j = 0,1,2,\dots,d-1 $). My approach to finding the d-dimension generalization of equation $(1)$ is to make use of these operators, but unfortunately I cannot find a $d$-dimensional analogue of the Hadamard gate like I have for the $X$ and $Z$ Pauli gates. I have considered using the relationship $H = \frac{1}{\sqrt2}(X + Z)$ but I don't know for certain if this is just true for qubits.
If anyone could provide any suggestions or hints as to how I should prove the generalization of equation $(1)$, it will be much appreciated (my biggest problem specifically is expressing H in an alternate form).
"
"['measurement', 'unitarity', 'information-theory']"," Title: Does the no-hiding theorem suggest that quantum information is never destroyed?Body: According to Wikipedia:
The no-hiding theorem proves that if information is lost from a system via decoherence, then it moves to the subspace of the environment and it cannot remain in the correlation between the system and the environment. This is a fundamental consequence of the linearity and unitarity of quantum mechanics. Thus, information is never lost. This has implications in black hole information paradox and in fact any process that tends to lose information completely. The no-hiding theorem is robust to imperfection in the physical process that seemingly destroys the original information.
My understanding is that reading a qubit destroys some information. For example, a qubit which is in state
$$\frac{\left| 0 \right> + \left| 1 \right>}{\sqrt{2}}$$
has a 50% chance of being sampled as a 0, and a 50% chance of being read as a 1. If you read this qubit, doesn't this destroy information?
Here's my argument for why this destroys information. If you had an unrelated qubit, in the state
$$\frac{\left| 0 \right> - \left| 1 \right>}{\sqrt{2}}$$
that would have the same probability of getting a zero or one when you read it. If the two are different before sampling, and indistinguishable afterwards, isn't this a loss of information?
While researching this question, I found this article, but I don't understand their argument.
"
"['information-theory', 'trace-distance', 'probability']"," Title: Why do probablity distribution with orthogonal suppor have maximal Kolmogorov distance?Body: Can anyone explain why the $l_1$ distance has the property that probability distributions $P,Q$ with orthogonal support (meaning that the product $p_iq_i$ vanishes for each value of $i$) are at a maximal distance from each other?
Consider $$ \|P-Q\|_1=\frac{1}{2}\sum_{i=1}^{N}|p_i-q_i|$$
"
['cryptography']," Title: Theoretical obstacles for a BZK-like quantum algorithm instantiated with a subroutine operates at small block size?Body: Obviously this specific topic had not been thoroughly studied, and the best we can do are empirical deductions based on past experience with quantum algorithms.
The security of lattice-based public-key encryption and digital signature schemes are based on the intractability of reducing algebraic lattice, with concrete estimates of the security levels based on BKZ family of algorithms.
The rough idea is that, BKZ operates with a siever/enumerator that finds short lattice vectors in a particular block size, and BKZ use that to reduce the lattice to certain desirable norm. Typically, the larger the block size, the smaller the norm of the output of BKZ. The siever/enumerator here, have running time that's typically exponential to the block size.
However, what if there's a quantum version of BKZ that's capable of producing lattice with small norm using siever/enumerator operating with small block size? That brings us to the questions:
What would be the theoretical obstacles for such BKZ-like quantum algorithm?
"
['physical-realization']," Title: Is it possible to have access to real quantum computers that have more than 15 qubits for my master thesis?Body: My physics master thesis is about variational quantum optimization and I have to run algorithms with more qubits than 15. Is it possible to make any requests to use larger IBM real quantum computers?
"
"['quantum-state', 'mathematics', 'measurement', 'textbook-and-exercises']"," Title: Derivation of the identity $\sum_j p_j \langle \psi_j|M|\psi_j \rangle = \sum_j p_j \operatorname{tr}\left(|\psi_j \rangle \langle \psi_j|M\right)$Body: For measurement, we know
$$\langle M \rangle = \sum_j p_j \langle \psi_j|M|\psi_j \rangle = \sum_j p_j \operatorname{tr}\left(|\psi_j \rangle \langle \psi_j|M\right).$$
My question is, how can we go from the first expression to the second one with trace operation? What's the math behind it?
"
"['quantum-state', 'entanglement']"," Title: Prove that $a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle$ is separable iff $ad-bc=0$Body: I am having trouble rigorously proving that a two qubit state
$|\psi\rangle=a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle$ is unentangled/separable if $ad-bc=0$
I currently have fairly little exposure to quantum information theory.
I've heard 'Schmidt decomposition' mentioned as a possible solution.
Alternately, this is problem 16b in this document
which also gives the hint to apply a unitary matrix
$$e^{i\phi}\begin{bmatrix}
c& -a \\ a^* & c^*
\end{bmatrix}$$
to one of the qubits. Any solution is appreciated but the preference is for one that uses less machinery, and in particular I'd be interested to see how to use the above hint to prove the result.
EDIT
To be clear, I know that separable $\implies ad-bc=0$ - this is not difficult to show. It is the other implication ($ad-bc=0\implies$ separable) that I am having trouble with.
"
"['complexity-theory', 'd-wave', 'annealing', 'adiabatic-model']"," Title: What is the computational complexity of quantum annealing?Body: Quantum annealing can be thought of as a black box solver that can find approximate solutions to hard optimization problems. For example, D-Wave quantum annealers can approximately solve quadratic unconstrained binary optimization (QUBO) problems, which are known to be NP-hard.
In this context, what is the computational complexity of quantum annealing? More specifically:
- If the size of my problem is $N$, how long will I need to run the quantum annealing process (as a function of $N$) to obtain the exact solution?
- Under an approximation algorithm / randomized algorithm setting, how many repetitions of quantum annealing will I have to perform to obtain an approximate solution that is within $\epsilon$ error of the exact solution (for example, $\epsilon = 0.1$ for getting a $10\%$ error)?
In my experience running problems on the D-Wave, I have noticed that a constant annealing time in conjunction with a constant number of repetitions can find exact solutions for smaller-sized problems. However, quantum annealing is not as accurate on larger-sized problems.
"
"['quantum-gate', 'quantum-state', 'circuit-construction', 'textbook-and-exercises', 'gate-synthesis']"," Title: How to construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift?Body: How can I construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift?
I am stuck in this and any help would be appreciated.
"
"['measurement', 'decoherence', 'partial-trace']"," Title: How can I understand these two equations about the indirect measurement?Body: I'm reading an article about environmental monitoring and information transfer. Suppose $S$ represents a quantum system and $E$ is the environment. Assume at time $t=0$ there are no correlations between $S$ and $E$: $\rho_{SE}(0)=\rho_{S}(0)\otimes\rho_{E}(0)$, and this composite density operator evolved under the action of $U(t) = e^{-iHt/h}$, where $H$ is the total Hamiltonian. Let $P_\alpha$ be a projective operator on $E$. Then, the probability of obtaining outcome $α$ in this measurement when $S$ is described by the density operator $\rho_s(t)$ is given as
$$
\text{Prob}(\alpha|\rho_s(t))=\text{Tr}_E (P_αρ_E(t))
$$
and the density matrix of $S$ conditioned on the particular outcome $\alpha$ is
$$
\rho_s^{\alpha}(t)= \frac{\text{Tr}_E\{(I\otimes P_\alpha)\rho_{SE}(t)(I\otimes P_\alpha)\}}{\text{Prob}(\alpha|\rho_s(t))}
$$
I'm wondering how those two equations coming from? Also, since the indirect measurement aims to yield information about S without performing a projective (and thus destructive) direct measurement on S, why there's $P_\alpha$ in the equation? Thanks!!
"
"['programming', 'qiskit']"," Title: What qiskit version?Body: How do I find out what version of qiskit I am running?
"
"['programming', 'qiskit']"," Title: Visualizing nice circuits in QiskitBody: This is what drawing a circuit looks like in the Qiskit textbook:
and this is the ugly version I am stuck with in my own notebooks:
On their Prerequisites page they write:
However, there is no .qiskit file in my home directory, and I can't locate it anywhere else. I installed it simply with the usual pip install command, without setting up any virtual environment, so that may be the issue. I am not a Linux expert so perhaps there is something simple I am missing.
How can I set up this configuration file? Creating a .qiskit directory manually doesn't do the job.
"
"['programming', 'measurement', 'quantum-enhanced-machine-learning', 'pennylane', 'quantum-neural-network']"," Title: Computing expectation value of product of observables in PennyLaneBody: In PennyLane, the following circuit returns the expectation value of the PauliZ observable on qubit (wire) 1:
def my_quantum_function(x, y):
qml.RZ(x, wires=0)
qml.CNOT(wires=[0, 1])
qml.RY(y, wires=1)
return qml.expval(qml.PauliZ(1))
What if I instead wanted to return the expectation value of an operator $H = Z_1Z_2$ that acts on the first and the second qubit? How might I do that?
It is my understanding that qubits 1 and 2 are "correlated" because of the CNOT, so $\left\langle Z_1 Z_2 \right\rangle \neq \left\langle Z_1 \right\rangle \left\langle Z_2 \right\rangle$. Does this mean I have to define a custom operator? Or does [qml.expval(qml.PauliZ(i)) for i in range(2)] achieve what I want? Thanks for any help.
Note: The above example function was taken from the PennyLane measurements documentation.
"
"['quantum-state', 'algorithm', 'quantum-advantage', 'probability', 'haar-distribution']"," Title: Confusion about the output distribution of Haar random quantum statesBody: Consider a Haar random quantum state $|\psi \rangle$. I was confused between two facts about $|\psi \rangle$, which appear related:
- Consider the output distribution of a particular $n$-qubit $|\psi \rangle$. For a large enough $n$, the probability of what fraction of strings in the output distribution of $|\psi \rangle$ lie between $\frac{1}{2^{n}}$ and $\frac{2}{2^{n}}$ (or between any two numbers)? According to the formulas in the supplement of the Google paper (section IV C, page 9) and this answer, the answer is
$$ \int_\frac{1}{2^{n}}^\frac{2}{2^{n}} 2^n e^{-2^np} dp.$$
How to prove this? Also, is this statement true for any Haar-random $|\psi\rangle$, or only with high probability over a particular choice of a Haar-random $|\psi\rangle$? For example, $|\psi\rangle$ could be something trivial like $|0\rangle^{\otimes n}$ and this statement would not hold.
- We know that for a particular output string $z \in \{0, 1\}^{n}$, if we define $p_z = |\langle z| \psi \rangle|^{2}$, then the random variable $p_z$ (for a fixed $z$, but for $|\psi\rangle$ chosen uniformly at random from the Haar measure) follows the Porter-Thomas distribution, for every such fixed $z$. The probability density function of the Porter-Thomas distribution is given by
\begin{equation}
\text{PorterThomas}(p) \sim 2^{n} e^{-2^{n}p}.
\end{equation}
The same density function also appears inside the integration in the first item. Is this just a coincidence, or are these facts related? The two situations do not seem related (we are interested in a particular $|\psi\rangle$ for the first one and a particular $z$ for the second one) and I do not see an obvious way of going from one to another.
"
"['programming', 'qiskit', 'vqe', 'chemistry']"," Title: Simulation of a helium molecule using QskitBody: I am trying to compute the ground state energy of He-He using VQE. For this purpose I have utilized Qskit and have written the following script:
from qiskit.chemistry.drivers import PySCFDriver, UnitsType, Molecule
from qiskit.chemistry.transformations import FermionicTransformation, FermionicQubitMappingType
from qiskit.aqua.algorithms import NumPyMinimumEigensolver
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
from qiskit.aqua.algorithms import VQE
from qiskit.circuit.library import TwoLocal
from qiskit.chemistry.algorithms.ground_state_solvers import GroundStateEigensolver
molecule = Molecule(geometry=[['He', [0., 0., 0.]],
['He', [0., 0., 3.1]]],
charge=0, multiplicity=1)
driver = PySCFDriver(molecule = molecule, unit=UnitsType.ANGSTROM, basis='sto3g')
transformation = FermionicTransformation(qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER)
numpy_solver = NumPyMinimumEigensolver()
vqe_solver = VQEUCCSDFactory(QuantumInstance(BasicAer.get_backend('statevector_simulator')))
num_qubits = 4
tl_circuit = TwoLocal(num_qubits, ['h', 'rx'], 'cz',
entanglement='full', reps=3, parameter_prefix = 'y')
tl_circuit.draw(output = 'mpl')
another_solver = VQE(var_form = tl_circuit,
quantum_instance = QuantumInstance(BasicAer.get_backend('statevector_simulator')))
calc = GroundStateEigensolver(transformation, vqe_solver)
res = calc.solve(driver)
print(transformation)
print(res)
When I run it I get a following error message:
Traceback (most recent call last):
File "test_remove.py", line 37, in <module>
res = calc.solve(driver)
File "/Users/monica/miniconda3/lib/python3.7/site-packages/qiskit/chemistry/algorithms/ground_state_solvers/ground_state_eigensolver.py", line 94, in solve
solver = self._solver.get_solver(self.transformation)
File "/Users/monica/miniconda3/lib/python3.7/site-packages/qiskit/chemistry/algorithms/ground_state_solvers/minimum_eigensolver_factories/vqe_uccsd_factory.py", line 212, in get_solver
same_spin_doubles=self._same_spin_doubles)
File "/Users/monica/miniconda3/lib/python3.7/site-packages/qiskit/chemistry/components/variational_forms/uccsd.py", line 153, in __init__
excitation_type=self._excitation_type,)
File "/Users/monica/miniconda3/lib/python3.7/site-packages/qiskit/chemistry/components/variational_forms/uccsd.py", line 509, in compute_excitation_lists
raise ValueError('No unoccupied orbitals')
ValueError: No unoccupied orbitals
Can anyone explain to me what is going on? What am I doing wrong?
"
"['qaoa', 'adiabatic-model']"," Title: Is the problem Hamiltonian in QAOA and AQC always a phase Hamiltonian?Body: In QAOA and AQC the problem Hamiltonian is always a Phase Hamiltonian (meaning only phases are added)
Is that part of the QAOA and AQC definition or it is only used because it is convenient and work?
If one uses non phase Hamiltonians with QAOA or AQC, (theoretically the Adiabatic theorem would still work) would it still be considered to be QAOA and AQC?
Thanks for reading.
"
"['quantum-gate', 'ibm-q-experience']"," Title: IBM QE - Parameters that differentiate the various backendsBody: I'm doing a university thesis using IBM's quantum backends. In my analysis I am making some considerations on what differentiates one backend from another other than the number of qubits and quantum volume.
The parameters that come into play are:
- Frequency: the difference in energy between the ground and exicted states
- Readout Error: the error in measuring qubit
- T1: the relaxation time
- T2: the coherence time
- CNOT error: the error on operating the 2-qubit gate
- Sqrt-x (sx) error: ?
- Anharmonicity: ?
- Gate time: ?
The last three I have not yet understood.
Is each single qubit powered individually or does it follow the topological configuration of the backend?
For example if I used a 5 qubit system and used the linear configuration 0-1-2-3-4 and used 0-1 and 3-4. Does the current have to go from 2 to get to 3-4? Or are they powered individually?
I tried to look for articles and information on the internet that gave me these answers but I did not find anything, if you have any material that may be useful to me, please link it to me!
"
"['programming', 'simulation', 'noise', 'openfermion']"," Title: noisy circuit by openfermionBody: I am working on designing quantum error mitigation algorithms for simulating chemical systems. Therefore, a necessary component is to add noisy to the ideal circuit when using a quantum simulator. But I notice there is no such features in the official documentation of openfermion.
Is there a way to add noise to the circuit in openfermion?
"
"['quantum-state', 'entanglement', 'density-matrix', 'correlations']"," Title: $\rho_{SE}(0)=\rho_S(0)\otimes\rho_E(0)$: No coupling or no entanglement?Body: We know that the entangled states cannot be expressed like product state, e.g. $|\omega\rangle = |\psi\rangle\otimes|\phi\rangle$. In the density matrix describing the correlations between system $S$ and environment $E$ we sometimes assume that there are no correlations between $E$ and $S$ at $t=0$: $\rho_{SE}(0)=\rho_S(0)\otimes\rho_E(0)$. I'm wondering what 'correlation' means here? Is this equation implying there's 'no coupling' or 'no entanglement' between $S$ and $E$? (I'm still a bit confused with the difference)
Also in a quantum circuit, can we say that the qubits are coupled as long as there's some gate(s) acting on each qubit, but they are entangled only if some states in the final simulation result cannot be decomposed like the product state?
"
"['algorithm', 'error-correction']"," Title: How to compute the error threshold for the $9$-qubit Shor code?Body: I was trying to calculate the threshold of $9$-qubit Shor's code. The error channel is
$$E=(1-p)I+p/3X+p/3Y+p/3Z.$$
But I got the threshold is equal to 1. How can I get the right threshold (I believe it will be smaller than 0.5)? I tried to code by Qiskit but still wrong...
"
"['information-theory', 'fidelity', 'quantum-fisher-information', 'quantum-metrology']"," Title: How is the connection between Bures fidelity and quantum Fisher information derived?Body: I recently came to know that there is a connection between Bures Fidelity $(F_B)$ and Quantum Fisher Information $(F_Q)$ given by
$$[F_{B}(\rho, \rho_\theta)]^2 = 1 - \frac{\theta^2}{4} F_Q[\rho, A] + O(\theta^3),$$
where
$\rho_\theta = \exp(-iA\theta)\rho \exp(iA\theta)$ and $F_B(\rho_1, \rho_2) = \mathrm{Tr}\Big[ \sqrt{\sqrt{\rho_1}~ \rho_2~ \sqrt{\rho_1}}\Big]$.
How can one derive this result?
Here is the link to my source
"
"['algorithm', 'textbook-and-exercises', 'grovers-algorithm']"," Title: Why does Grover's algorithm reflect along $|000...0\rangle$?Body: In general I understand Grover's algorithm, how we can think of two separated state spaces, a space $|\alpha\rangle$ with no solutions and a space $|\beta\rangle$ with only solutions, and how the Grover operator rotates the state $|\psi\rangle$ into the solution space $|\beta\rangle$.
- In the implementation of grover, we use $|000...0\rangle$ as the state to reflect about. The math and how the inversion around the mean operator is constructed, this appears to be an easy and elegant way. The math adds up. I'm not clear how to justify the use of this particular state. Can't we use others as axes, and if not, why not?
"
"['entanglement', 'bell-experiment', 'non-locality', 'games']"," Title: Modified CHSH game - Does entanglement help?Body: I'm thinking about a modified version of the CHSH game and I'm trying to convince myself that in this case, entanglement cannot be used to gain an advantage or else it would imply signalling is possible through entanglement (i.e. contradicting the no-signalling theorem).
The rules are: the referee generates $a$ and $b$ uniformly from $\{0, 1\}$ and computes $a\oplus b = w$. The referee sends $a$ to Alice and $b$ to Bob. The game is won if both Alice and Bob can each send a bit $w_a, w_b$ back to the referee such that $w_a=w$ and $w_b = w$. Alice and Bob cannot classically communicate but they can distribute entanglement before the game starts.
What I have tried is assuming Alice and Bob share an entangled state $\rho \in \mathcal{H}_A\otimes\mathcal{H}_B$ and have arbitrary measurements $\{ M_a \}, \{M_b\}$. Assume Alice and Bob coordinate with a distribution $c(x_a, x_b|a,b)$, where $x_a$ and $x_b$ are variables to help them decide for $w_a$ and $w_b$. Then
$$
\begin{align}
c(x_a, x_b|a,b) &= tr((M_a\otimes M_b) \rho) \\
&= tr_A(tr_B((M_a\otimes M_b) \rho))\\
&= \dots\\
&= tr(\rho)?
\end{align}
$$
This isn't correct as it is, but I'm looking for something that would imply that $a$ and $b$ wouldn't affect $x_a, x_b$, or that they are uniformly random which would then imply Alice and Bob couldn't strategize any better than guessing. I'm not sure if this argument makes sense at all since I think it would also contradict that there is an advantage to the normal CHSH game.
Any tips to showing if there is an advantage or not would be helpful. Thanks.
"
"['programming', 'qiskit']"," Title: Why Measurement Error Mitigation does not seem to improve the result of VQE?Body: I try to follow https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/algorithms/03_vqe_simulation_with_noise.ipynb to perform measurement error mitigation for calculating H2 energy with VQE. With some modification, I did the calculation on "qasm_simulator" with the noise model built from "ibmq_santiago". However, it does not seem to improve the result. Please see below. I tried a separate experiment, and for the computational basis, the error mitigation seems to work really well. So in principle I could have measured the expectation values of ZZ,XX, etc and the calibration matrix myself, followed by calculating the energy. However, I expect that "VQE" should be able to do these for me. So is there any way that we can improve it further?
from qiskit.aqua.components.optimizers import COBYLA
from qiskit.aqua import QuantumInstance
from qiskit.circuit.library import TwoLocal
from qiskit.aqua.algorithms import VQE, NumPyMinimumEigensolver
from qiskit.aqua.operators import X, Y, Z, I
from qiskit import Aer, IBMQ
from qiskit.ignis.mitigation.measurement import CompleteMeasFitter
from qiskit.providers.aer.noise import NoiseModel
IBMQ.load_account()
provider = IBMQ.get_provider(group='open', project='main')
backend = provider.get_backend('ibmq_santiago')
H2_op = (-1.052373245772859 * I ^ I) + \
(0.39793742484318045 * I ^ Z) + \
(-0.39793742484318045 * Z ^ I) + \
(-0.01128010425623538 * Z ^ Z) + \
(0.18093119978423156 * X ^ X)
npme = NumPyMinimumEigensolver()
result = npme.compute_minimum_eigenvalue(operator=H2_op)
ref_value = result.eigenvalue.real
print( 'reference result = ' , ref_value )
optimizer = COBYLA # COBYLA, L_BFGS_B, SLSQP
var_form = TwoLocal(rotation_blocks='ry', entanglement_blocks='cz')
Ham_vqe = VQE(H2_op, var_form , optimizer(maxiter=1000) , include_custom=True )
noise_model = NoiseModel.from_backend(backend)
# Get coupling map from backend
coupling_map = backend.configuration().coupling_map
# Get basis gates from noise model
basis_gates = noise_model.basis_gates
# Noisy simulation
quantum_instance = QuantumInstance( Aer.get_backend('qasm_simulator'),
coupling_map=coupling_map,
basis_gates=basis_gates,
noise_model=noise_model,
shots = 8192 )
result = Ham_vqe.run( quantum_instance )
print( 'noisy result = ' , result.eigenvalue.real )
print( 'noisy result - reference result = ' , result.eigenvalue.real-ref_value )
# Noisy simulation with mitigation
quantum_instance = QuantumInstance( Aer.get_backend('qasm_simulator'),
coupling_map=coupling_map,
basis_gates=basis_gates,
noise_model=noise_model,
shots = 8192 ,
measurement_error_mitigation_cls=CompleteMeasFitter ,
cals_matrix_refresh_period=30 )
result = Ham_vqe.run( quantum_instance )
print( 'with mitigation, noisy result = ' , result.eigenvalue.real )
print( 'with mitigation, noisy result - reference result = ' , result.eigenvalue.real-ref_value )
and the output is
reference result = -1.8572750302023824
noisy result = -1.8406772338912365
noisy result - reference result = 0.016597796311145885
with mitigation, noisy result = -1.841906128159805
with mitigation, noisy result - reference result = 0.015368902042577348
"
"['measurement', 'textbook-and-exercises', 'pauli-gates', 'notation', 'linear-algebra']"," Title: If the eigenvalues of $Z$ are $\pm1$, why are the computational basis states labeled with ""$0$"" and ""$1$""?Body: The computational basis is also known as the $Z$-basis as the kets $|0\rangle,|1\rangle$ are chosen as the eigenstates of the Pauli gate
\begin{equation}
Z=\begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}.
\end{equation}
I've got a quick question. As $|0\rangle$ has eigenvalue $+1$ with respect to $Z$ and $|1\rangle$ has eigenvalue $-1$, according to the postulates of quantum mechanics $\pm 1$ are the results of the measurement. So why is it that in every text the results are written as $""0""$ or $""1""$? Is it simply because of a conventional correspondence $""0""\leftrightarrow +1,""1""\leftrightarrow -1$ that no one ever even bothers to write explicitly?
"
"['measurement', 'mathematics', 'textbook-and-exercises', 'projection-operator']"," Title: Is a projective measurements over a superposition of eigenstates possible?Body: All observables admit a spectral decomposition in terms of projectors $P_m$ into the eigenspace corresponding to the eigenvalue $m$. So given for example a collection of kets $|0\rangle, |1\rangle,..., |n\rangle$ with eigenvalues $a_0,a_1,...,a_n$ I can always perform a measurement on a state $|\psi\rangle=\alpha_0|0\rangle+...+\alpha_n|n\rangle$ by a projection such as $$P_0|\psi\rangle=| 0\rangle\langle 0|\psi\rangle=\alpha_0|0\rangle$$ (to be eventually renormalized) with outcome $a_0$. But what if I wanted to see if the system is in a superposition of certain eigenstates? For example, I may wish to apply the projector $$P=\frac{1}{2}(|0\rangle+|1\rangle)(\langle 0|+\langle 1|)=\frac{P_0+|0\rangle\langle1|+|1\rangle\langle 0|+P_1}{2}.$$
Clearly $P$ doesn't belong to the set $\{P_m\}$ as $|0\rangle$ and $|1\rangle$ are associated to different eigenvalues.
My question is: is such a measurement possible, and what would be the outcome of the measurement?
"
"['programming', 'qiskit', 'vqe']"," Title: error when running VQE in QiskitBody: I am running the code, which gets the ground state energy with different atomic distances of LiH. However, I encountered this error. The code is as follow
import numpy as np import pylab import copy
from qiskit import BasicAer
from qiskit.aqua import QuantumInstance
from qiskit.aqua.algorithms import NumPyMinimumEigensolver, VQE
from qiskit.aqua.components.optimizers import SLSQP
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.drivers import PySCFDriver
from qiskit.chemistry.algorithms.ground_state_solvers import GroundStateEigensolver
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
from qiskit.chemistry.transformations import (FermionicTransformation,
FermionicTransformationType,
FermionicQubitMappingType)
from qiskit.chemistry.algorithms.ground_state_solvers.minimum_eigensolver_factories import VQEUCCSDFactory
molecule = 'H .0 .0 -{0}; Li .0 .0 {0}'
distances = np.arange(0.5,4.25,0.25)
vqe_energies = []
hf_energies = []
exact_energies = []
for i,d in enumerate(distances):
print('step', i)
#set up the experiment
driver = PySCFDriver(molecule.format(d/2), basis='sto3g')
fermionic_transformation = FermionicTransformation(
transformation=FermionicTransformationType.FULL,
qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER,
two_qubit_reduction=False,
freeze_core=False)
qubit_op, aux_ops = fermionic_transformation.transform(driver)
#VQE
optimizer = SLSQP(maxiter=1000)
initial_state = HartreeFock(fermionic_transformation.molecule_info['num_orbitals'],
fermionic_transformation.molecule_info['num_particles'],
qubit_mapping=fermionic_transformation.qubit_mapping,
two_qubit_reduction=fermionic_transformation._two_qubit_reduction)
#VQE
vqe_solver = VQEUCCSDFactory(QuantumInstance(BasicAer.get_backend('statevector_simulator')),
optimizer,
initial_state)
calc = GroundStateEigensolver(fermionic_transformation, vqe_solver)
res = calc.solve(driver)
print(res)
The traceback is here
File "/home/ironmanaudi/research/VQE/VQE_tutorial/LiH_VQE.py", line 76, in <module>
res = calc.solve(driver)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/algorithms/ground_state_solvers/ground_state_eigensolver.py", line 102, in solve
raw_mes_result = solver.compute_minimum_eigenvalue(operator, aux_operators)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 494, in compute_minimum_eigenvalue
return self._run()
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/aqua/algorithms/minimum_eigen_solvers/vqe.py", line 429, in _run
vqresult = self.find_minimum(initial_point=self.initial_point,
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/aqua/algorithms/vq_algorithm.py", line 172, in find_minimum
if initial_point is not None and len(initial_point) != nparms:
TypeError: object of type 'HartreeFock' has no len()
When change the syntax of getting the result to
res = calc.solve(driver, aux_ops)
the error becomes
File "/home/ironmanaudi/research/VQE/VQE_tutorial/LiH_VQE.py", line 70, in <module>
res = calc.solve(driver, aux_ops)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/algorithms/ground_state_solvers/ground_state_eigensolver.py", line 90, in solve
operator, aux_operators = self.transformation.transform(driver, aux_operators)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/transformations/fermionic_transformation.py", line 152, in transform
ops, aux_ops = self._do_transform(q_molecule, aux_operators)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/transformations/fermionic_transformation.py", line 358, in _do_transform
_add_aux_op(aux_op, name)
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/transformations/fermionic_transformation.py", line 289, in _add_aux_op
aux_qop = FermionicTransformation._map_fermionic_operator_to_qubit(
File "/home/ironmanaudi/anaconda3/lib/python3.8/site-packages/qiskit/chemistry/transformations/fermionic_transformation.py", line 645, in _map_fermionic_operator_to_qubit
qubit_op = fer_op.mapping(map_type=qubit_mapping, threshold=0.00000001)
AttributeError: 'SummedOp' object has no attribute 'mapping'
Can anybody tell me how to work this out?
"
"['error-correction', 'physical-realization', 'fault-tolerance', 'topological-quantum-computing']"," Title: How to do the counting when computing the fault tolerant threshold of quantum codes?Body: Here, I want to ask a basic question about how to compute the fault tolerance threshold of quantum codes. As I know, maybe, the most usual way is to do some simulations. Howvever, I am more intersted with the theoretical computation. More specificly, I am interested with the quantum LDPC relted codes, e.g., https://arxiv.org/abs/1412.6172, https://arxiv.org/abs/1711.08351, and https://arxiv.org/abs/1310.2984. For example, let us talk about
Efficient decoding of random errors for quantum expander codes, by Fawzi,Grospellier,and Leverrier, STOC’18.
My first question is about the failure probability $\epsilon$ (or success probability $1-\epsilon$ in verse). I am confused by the computation of that. Do we need to count all the random errors that can not be corrected succesfully? In that paper, the authors can correct random errors of linear weight with a very high probability $1-\epsilon$. Denote by $\delta n$ the weight of the random errors, where $0<\delta\leq1$ and $n$ is the block length. In general, we can assume that $0<\delta<0.5$ (Is it right or necessary?). Then do we need to deal with the random errors of weight larger than $\delta n$ up to $n$?
"
"['qiskit', 'quantum-state', 'algorithm', 'hhl-algorithm', 'phase-estimation']"," Title: HHL algorithm, How can I get result from register $|b\rangle$?Body: From the paper A survey on HHL algorithm: From theory to application in quantum machine learning ,
I use qasm code from here.
I try to follow the example in page 7. with Ax = b
and
the answer x should be
From the algorithm 2 in page 7 from the paper, They applied measurement on qubit q[0].
If q[0] = $|1\rangle$, the answer will be stored in q[.3] or register b.
But in the example here, I got state $|0\rangle$ from ancilla bit if I use the same rotation angle as the example.
When I measure register b, I always got state $|1\rangle$ even if the result on ancilla bit is $|1\rangle$ (I change ancilla bit rotation angel from the example to 3.6591 and 1.8296).
Does the problem is the rotation angle on ancilla bit?
How can I get the correct result on register b? Can you give me a good example to do this?
"
"['algorithm', 'shors-algorithm', 'phase-estimation']"," Title: Shor's algorithm - modular exponentiation and Quantum Fourier transform and quantum phase estimation methodBody: I have a question about Shor's algorithm with respect to the eigenvector representation of the second (lower) register. In the following I use the notation of Nielsen, M., Chuang, I., 2016, Quantum Computation and Quantum Information, p. 232 on Quantum order-finding. I am using the quantum phase estimation approach to Shor's algorithm.
Starting off with the following preparation
$\frac{1}{\sqrt{2^n}}\sum_{j=0}^{2^n-1}|j\rangle|1\rangle$,
and applying the controlled $U^j$ gates,
$\frac{1}{\sqrt{2^n}}\sum_{j=0}^{2^n-1}|j\rangle|a^j\text{ mod }N\rangle$
rewritten in terms of eigenvectors $|u_0\rangle,|u_1\rangle,...,|u_{r-1}\rangle$ of $U$ of the second register
$\frac{1}{\sqrt{r2^n}}\sum_{s=0}^{r-1}\sum_{j=0}^{2^n-1}e^{2\pi ijs/r}|j\rangle|u_s\rangle$
and then applying the inverse QFT, we have
$\frac{1}{\sqrt{r}}\sum_{s=0}^{r-1}|\widetilde{\frac{s}{r}}\rangle| u_s\rangle$
where $|\widetilde{\frac{s}{r}}\rangle$ is considered an approximation to an integer.
Would the application of the $QFT^{\dagger}$ to
$\frac{1}{\sqrt{2^n}}\sum_{j=0}^{2^n-1}|j\rangle$
irrespective of the second register (which is in a superposition of states $|a^j\text{ mod }N\rangle$) yield $|0\rangle$ for the upper register before measurement, thinking of the inverse QFT as the quantum equivalent to the discrete Fourier transform? If measured would that not result in the state $|0\rangle$, which does not make sense to me, at all, as a result. How are these two approaches reconciled? Am I missing something basic here?
"
"['qiskit', 'vqe', 'chemistry']"," Title: Calculating energy function with 1&2-RDM (reduced density matrix) in QiskitBody: I am now working on designing quantum error mitigation with variational quantum eigensolvers (VQE). I need to get the 1&2-RDM from Qiskit, which has already been realized by Openchemist pakages for Qiskit to get RMDS. The question is how to get the energy function in the following formula (A14) from appendix A of The Google Hartree Fock paper. I need (A14) to be the objective function for gradient descent, then the VQE algorithm can be implemented.
Because the problem here is to calculate the ground state energy for a quantum chemistry problem, the first step is to extract the molecular information, which is contained in the tensors, h_ij and V_ijkl in (A14). I already got the 1&2-electron integrals by the PySCFDriver. Then, the objective function can be defined for gradient descent. Is there a way to realize the second step in Qiskit?
"
"['mathematics', 'textbook-and-exercises', 'trace']"," Title: How is $\sum_i\langle i|M|i\rangle$ correlated to $\mathrm{tr}(M)$?Body: In the book Quantum computation and quantum information, it says to evaluate $tr(A|\psi\rangle\langle\psi|)$ using Gram-Schmidt procedure to extend $|\psi\rangle$ to an orthonormal basis $|i\rangle$ which includes $|\psi\rangle$ as the first element. Then:
$$tr(A|\psi\rangle\langle\psi|)=\sum_i\langle i|A|\psi\rangle\langle\psi|i\rangle\tag{2.60}$$
$$=\langle\psi|A|\psi\rangle\tag{2.61}$$
I understood that equation 2.61 that uses the special basis $|i\rangle$ described. But in equation 2.60, how $\sum_i\langle i|M|i\rangle$ is correlated to $tr(M)$ ? Can you help me with a more detailed description of it ?
"
"['architecture', 'superconducting-quantum-computing', 'quantum-optics', 'circuit-qed']"," Title: Solution for the ""Input and Output theory"" for circuit/cavity-QED Quantum ArchitectureBody: This question consists of the basic calculations which are often referred to as "trivial" in most references in circuit-QED. However, are not so trivial for anyone who starts fresh into the quantum optics involved for studying the input/output (I/O), and therefore the measurements in actual architecture of QC.
(With some quality answer this can become a resource for starters to refer to). The starting point is to study the Quantum Langevin Equations from some 'rare' quantum optics texts. The notation is standard:
$\Omega:$ Cavity Frequency
$\Gamma$: Dissipation/decay rate
$b_{\text{in/out}}$: Input/Output field operators
$a$ & $a^\dagger$: Cavity modes
The solution to the Langevin equation reads:
$a(t)=a(0)\text{e}^{-(i\Omega +\Gamma/2)}-\sqrt{\Gamma}\int_0^tds$ $\text{e}^{-(i\Omega+\Gamma/2)(t-s)}b_{\text{in}}(s)$.
(1) Prove the commutators:
$[a^\dagger(t),b_{\text{in}}(t')]=0 \quad$ for $t<t'$
$[a^\dagger(t),b_{\text{in}}(t)]=-\frac{1}{2}\sqrt{\Gamma} \quad$
$[a^\dagger(t'),b_{\text{in}}(t')]=-\sqrt{\Gamma}\text{e}^{-(i\Omega+\Gamma/2)(t-t')} \quad$ for $t>t'$
$[a^\dagger(t),a^\dagger(s)]=\text{e}^{-\frac{1}{2}\Gamma|t-s|}$
(2) Given the time reversed Langevin equation
$\dot{a}(t)=(-i\Omega+\Gamma/2)a(t)-\sqrt{\Gamma}b_{\text{out}}(t)$
find the solution for $a(t)$ in terms of the output field at a future time $T$.
(3) Prove the relation
$\tilde{a}(\omega)=\frac{\sqrt{\Gamma}}{i(\omega-\Omega)-\Gamma/2}\tilde{b}_{\text{in}}(\omega)$
where the standard Fourier transform is defined as: $\tilde{f}(\omega)=\frac{1}{2\pi} \int_{-\infty}^{\infty}\text{e}^{i\omega t}f(t)dt$
(4) Given the I/O relation and boundary condition:
$b_{\text{out}}(t)=b_{\text{in}}(t)+\sqrt{\Gamma}a(t)$
Prove the simpler relation:
$\tilde{b}_{\text{out}}(\omega)=\text{e}^{i\delta(\omega)}\tilde{b}_{\text{in}}(\omega)$
where $\delta(\omega)$ is a phase shift which preserves the commutation relations for the I/O operators under the Fourier transform.
"
"['quantum-state', 'measurement', 'density-matrix']"," Title: What do the off-diagonal elements of a density matrix physically represent?Body: For simplicity, let's take a density matrix for a single qubit, written in the $\{|0\rangle,|1\rangle\}$ basis:
$$ \rho = \begin{pmatrix} \rho_{00} & \rho_{01} \\ \rho_{10}^* & 1-\rho_{00} \end{pmatrix} $$
The diagonal elements give us the probabilities of measuring the $|0\rangle$ and $|1\rangle$ states. And this is true for both pure and mixed states.
What about the off-diagonal elements? What information does the numerical value of $\rho_{01}$ tell us about the quantum state?
And how does this generalize to systems with more than one qubit?
"
"['programming', 'q#']"," Title: Q# installation on HerokuBody: I'm trying to deploy a simple Quantum App written using Python on Heroku Server which is also using Microsoft's Q#, but getting the below error:
AttributeError: module 'qsharp' has no attribute 'clients'
Traceback:
File "/app/.heroku/python/lib/python3.6/site-packages/streamlit/script_runner.py", line 332, in _run_script
exec(code, module.__dict__)
File "/app/qrng_final.py", line 18, in <module>
import qsharp
File "/app/.heroku/python/lib/python3.6/site-packages/qsharp/__init__.py", line 123, in <module>
client = _start_client()
File "/app/.heroku/python/lib/python3.6/site-packages/qsharp/clients/__init__.py", line 31, in _start_client
client = qsharp.clients.iqsharp.IQSharpClient()
Log from the docker image:
ovyan@7ca97f8365fb: /appjovyan@7ca97f8365fb:/app$ ls
Dockerfile Operation.qs README.md qrng_final.py runtime.txt
LICENSE Procfile obj requirements.txt setup.sh
ovyan@7ca97f8365fb: /appjovyan@7ca97f8365fb:/app$ ls $HOME/.local/bin
base58 f2py3 pip3 pybind11-config virtualenv
cygdb f2py3.7 pip3.7 sample virtualenv-clone
cython get_objgraph pipenv streamlit watchmedo
cythonize isympy pipenv-resolver streamlit.cmd
f2py pip plasma_store undill
ovyan@7ca97f8365fb: /appjovyan@7ca97f8365fb:/app$ ls $HOME/.local/binls $HOME/.local/bin $HOME/.local/bin $HOME/.local/binc $HOME/.local/bind $HOME/.local/bin $HOME/.local/bin$HOME/.local/bin
ovyan@7ca97f8365fb: ~/.local/binjovyan@7ca97f8365fb:~/.local/bin$ ls streamlit
streamlit
ovyan@7ca97f8365fb: ~/.local/binjovyan@7ca97f8365fb:~/.local/bin$ ls streamlit/streamltit
ls: cannot access 'streamlit/streamlit': Not a directory
ovyan@7ca97f8365fb: ~/.local/binjovyan@7ca97f8365fb:~/.local/bin$ ls streamlit/streamlit streamlit/streamlit streamlit/streamlitc streamlit/streamlita streamlit/streamlitt streamlit/streamlit
cat: streamlit/streamlit: Not a directory
ovyan@7ca97f8365fb: ~/.local/binjovyan@7ca97f8365fb:~/.local/bin$ cat steeamlit
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from streamlit.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
ovyan@7ca97f8365fb: ~/.local/binjovyan@7ca97f8365fb:~/.local/bin$ cd ..
ovyan@7ca97f8365fb: ~/.localjovyan@7ca97f8365fb:~/.local$ vfcf f ..cd /app
ovyan@7ca97f8365fb: /appjovyan@7ca97f8365fb:/app$ ls
Dockerfile Operation.qs README.md qrng_final.py runtime.txt
LICENSE Procfile obj requirements.txt setup.sh
ovyan@7ca97f8365fb: /appjovyan@7ca97f8365fb:/app$ $HOME/.local/bin/streamlit run qrng_final.py
2021-02-06 23:56:11.279
Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'.
As a result, 'server.enableCORS' is being overridden to 'true'.
More information:
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.
If cross origin resource sharing is required, please disable server.enableXsrfProtection.
2021-02-06 23:56:13.041
Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'.
As a result, 'server.enableCORS' is being overridden to 'true'.
More information:
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.
If cross origin resource sharing is required, please disable server.enableXsrfProtection.
You can now view your Streamlit app in your browser.
Network URL: http://172.17.0.2:8501
External URL: http://106.51.241.244:8501
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:107: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
z = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:108: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
x = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:107: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
z = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:108: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
x = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:107: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
z = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:108: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
x = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:107: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
z = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:108: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
x = np.zeros(len(label), dtype=np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
/home/jovyan/.local/lib/python3.7/site-packages/qiskit/quantum_info/operators/pauli.py:30: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
arr = np.asarray(arr).astype(np.bool)
2021-02-06 23:56:17.792 Starting IQ# kernel...
2021-02-06 23:56:23.896 Exception while checking if IQ# is ready.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/qsharp/clients/iqsharp.py", line 97, in is_ready
result = self.component_versions(timeout=6)
File "/usr/local/lib/python3.7/site-packages/qsharp/clients/iqsharp.py", line 193, in component_versions
self._execute("%version", output_hook=capture, _quiet_=True, **kwargs)
File "/usr/local/lib/python3.7/site-packages/qsharp/clients/iqsharp.py", line 270, in _execute
reply = self.kernel_client.execute_interactive(input, output_hook=_output_hook, **kwargs)
File "/usr/local/lib/python3.7/site-packages/jupyter_client/blocking/client.py", line 321, in execute_interactive
raise TimeoutError("Timeout waiting for output")
TimeoutError: Timeout waiting for output
Preparing Q# environment...
2021-02-06 23:56:27.619 Q# version
{'iqsharp': LooseVersion ('0.15.2101126940'), 'Jupyter Core': LooseVersion ('1.5.0.0'), '.NET Runtime': LooseVersion ('.NETCoreApp,Version=v3.1')}
I have already given Q#package name in requirements.txt but still not able to resolve it. Is there any solution around how can I install Q# binded with Python on any remote server?
"
"['algorithm', 'phase-estimation', 'eigenvalue']"," Title: In the quantum phase estimation algorithm, why can't we directly compute the eigenvalue from the known eigenvector?Body: The Quantum Phase Estimation algorithm wants to approximate the phase $\varphi$ of an eigenvalue $\lambda = e^{2\pi i \varphi}$ of a unitary operator $U$.
Besides $U$ an eigenvector $x$ corresponding to $\lambda$ is given, that is, we know,
$U x = \lambda x$.
However, isn't computing the eigenvalue of a given eigenvector fairly simple?
- Let $i$ be an index with $x_i \neq 0$,
- compute $U x$,
- compute $\frac{(Ux)_i}{x_i}$ which equals $\lambda$.
What am I missing?
Is it the fact that it might not be easy to find an index $i$ with $x_i \neq 0$ ?
"
"['quantum-state', 'algorithm', 'entanglement', 'cryptography', 'communication']"," Title: How are inputs during the quantum communication between Alice and Bob placed in the Galois Field?Body: I have to write a report on "Classical Interaction Cannot Replace a Quantum Message" by Gavinsky (arxiv link).
The author gave a lecture, and at 14:55 explains that a communication problem exists where Alice has input $x$, Bob has input $y$ and together they produce an output $z$. This problem is relational so every $x,y$ there are multiple output $z$. In the video he explains that a table(galois field) exists in the communication channel which stores the $x$ and $y$ and then calculates $z$ by taking the bitwise XOR and giving orthogonal bits to the resultant.
After watching that part of the video and reading through some of the paper,
- I also want to know if Alice and Bob have a fixed number of rows and columns dedicated to them for calculating the output, and are the number of elements in each cell fixed or variable?
- How are the elements placed in the table?
These definitions are provided in the paper on page 3:
Definition 1. Let $x, y⊂[n^2]$, such that $|x|=n/2$ and $|y|=n$. Let $z \in \mathcal{G} \mathcal{F}_{2}^{2 \log n} \backslash\{\overline{0}\}$. Let $\Sigma=\left\{\sigma_{2^{2 i}}\right\}_{i=1}^{\infty}$ be a set of reversible mappings from [2$^{2i}$] to GF$^{2i}_2$. Then $(x, y, z) ∈ P^Σ_{1×1}$ if either $|x \cap y| \neq 2$ or〈z, a+b〉= 0, where $\sigma_{n^{2}}(x \cap y)=\{a, b\}$.
Let $\Sigma_{0}$ be the set of reversible mappings from $\left[2^{2 i}\right] \text { to } \mathcal{G} \mathcal{F}_{2}^{2 i}$, preserving the lexicographic ordering of the elements.
Definition 2. Let $x \subset\left[2 n^{2}\right],|x|=n$. Let $y = (y_1, . . . , y_{n/4})$ be a tuple of disjoint subsets of [n$^{2}$], each of size $n$, such that $\left|x \cap y_{j}\right|=2$ for all $1 \leq j \leq n / 4$. Let $z \in \mathcal{G} \mathcal{F}_{2}^{2 \log n+1} \backslash\{\overline{0}\}$ and $1 \leq i \leq n / 4$, then $(x, y,(i, z)) \in P^{(n)} \text { if }\langle z, a+b\rangle=0$, where $\sigma_{0}\left(x \cap y_{i}\right)=\{a, b\}$ for some $\sigma_{0} \in \Sigma_{0}$.
In the rest of the paper we will implicitly assume equivalence between the arguments and the corresponding values of every $\sigma_{0} \in \Sigma_{0}$. We will show that P is easy to solve in Q$^{1}$ and is hard for R. In order to prove the lower bound we will use the following modification of $P_{1 \times 1}^{\Sigma}$.
Definition 3. Let $x$, $y⊂[n^2]$, such that $|x|=n/2$ and $|y|=n$. Let $z\subset[n^2]$. Then $(x, y, z) ∈ P^{search}_{1×1}$ if $x∩y=z$.
"
"['mathematics', 'matrix-representation', 'unitarity', 'quantum-circuit']"," Title: How to check if a quantum circuit can be constructed for a given matrix representation?Body: Let's say I have a matrix representation, e.g.
$$
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}.
$$
How can I determine whether a quantum circuit can be constructed given said matrix representation? Is unitarity a sufficient and necessary condition?
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'unitarity']"," Title: How does one create the unitary sending $|0\rangle$ into a target quantum state?Body: The Hadamard gate allows us to construct an equal superposition of states. If one wants to construct an arbitrary superposition e.g. $\alpha\vert 0\rangle + \beta\vert 1\rangle + ..$, how does one create the corresponding unitary?
Such a unitary should act on $\vert 0\rangle$ and output the desired state. Also, in more generality, it should take in $\vert 0\rangle^{\otimes n}$ and output some coherent superposition state of my choice.
I ask this question since many quantum algorithms encode a classical vector $(x_1, x_2,... x_n)$ into a quantum state $\sum_i x_i\vert i\rangle$ but this step itself seems hard to achieve.
"
"['resource-request', 'superconducting-quantum-computing']"," Title: Does anyone know of any good books to learn about the electronics/electrical engineering side of quantum computing?Body: I am a Physics student that just entered the field of quantum computing. I am obviously lacking in the electronic engineering side of things and would love to learn more! Any advice for good books?
"
"['error-correction', 'textbook-and-exercises', 'nielsen-and-chuang', 'stabilizer-code']"," Title: How do we find the stabilizer generators for the three-qubit bit-flip code spanned by $|000\rangle$ and $|111\rangle$?Body: In Nielsen & Chuang's book "Quantum Computation and Quantum Information" section 10.5.6, page 467 there is the following statement
Consider the familiar three-qubit bit-flip code spanned by the states $|000\rangle$ and $|111\rangle$, with
stabilizer generated by $Z_{1}Z_{2}$ and $Z_{2}Z_{3}$.
- How do we find these stabilizer generators?
- Is this stabilizer set is unique? ( code spanned by $|000\rangle$ and $|111\rangle$, have only $Z_{1}Z_{2}$ and $Z_{2}Z_{3}$ as generator stabilizer nothing else?)
"
"['error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: Stabilizer code: error detection why does it matter?Body: State vectors take more space when we have to specify certain states. In stabilizer formalism, we can specify these states in a much more compact way.
But in error correction then we say that the error of a particular code can be measured by measuring the generators.
How does it help? What does it give us extra in terms of error detection? (Finding these generators is difficult as well).
"
"['algorithm', 'circuit-construction', 'quantum-fourier-transform', 'hhl-algorithm', 'phase-estimation']"," Title: Efficient QFT-based QPEA complexityBody: The HHL algorithm lies on an implementation of the Quantum Phase Estimation algorithm. One popular implementation is based on the Quantum Fourier Transform which can be divided in three steps. Let $U$ be a unitary matrix and $|\psi\rangle$ an eigenvector s.t. $U|\psi\rangle = e^{2\pi i\theta}|\psi\rangle$ and $|0\rangle^{\otimes n }|\psi\rangle$ the initial state of the system.
- Apply $n$-bit Hadamard gate operation $H^{{\otimes}n}$ to the first register. The state of system becomes $\frac{1}{\sqrt N} (|0\rangle + |1\rangle)^{\otimes n} |\psi\rangle$.
- Apply controlled unitary operations $C-U$ to the first register. More precisely, we want to apply a $C-U^{2^{j}}$ to the $(n-j)^{th}$ qubit of the first register for all $j$. Now the state of the first register is $\frac{1}{\sqrt N} \underbrace{ \left (|0\rangle + e^{2\pi i 2^{n-1} \theta}|1\rangle \right )}_{1^{st} \ qubit} \otimes \cdots \otimes \underbrace{\left (|0\rangle + e^{2\pi i 2^1 \theta}|1\rangle \right )}_{n-1^{th} \ qubit} \otimes\underbrace{\left (|0\rangle + e^{2\pi i 2^{0} \theta}|1\rangle \right )}_{n^{th} \ qubit} = \frac{1}{\sqrt N}\sum_{k=0}^{2^n -1} e^{2\pi i \theta k} |k\rangle$
- Apply inverse Quantum Fourier Transform on the first register, which yields to a binary approximation of $\theta$ stored in the first register.
The following picture summarize all these steps :
My question : how do one implement efficiently the circuit $C-U^{2^{j}}$ ? A naive approach would be to use $2^j$ circuit $C-U$ and apply them successfully but the overall complexity would be of order $O(2^n)$ which is not what we want in the HHL algorithm.
"
"['quantum-state', 'algorithm', 'textbook-and-exercises', 'deutsch-jozsa-algorithm', 'notation']"," Title: Shouldn't the input state of Deutsh-Jozsa's algorithm look like $|0\rangle^{\otimes n}\otimes |1\rangle$ rather than $|0\rangle^{\otimes n}|1\rangle$?Body: According to this wikipedia page the initial state in Deutsch–Jozsa algorithm is written as follows:
$$|0\rangle^{\otimes n} |1\rangle$$
shouldn't it look like this?:
$$|0\rangle^{\otimes n} \otimes |1\rangle$$
"
"['programming', 'qiskit', 'quantum-state', 'circuit-construction']"," Title: Preparing Bell state $(1/\sqrt{2}) (|01\rangle + |10\rangle)$ in QiskitBody: I'm working through the Qiskit textbook right now, and wanted to complete part 1 of exercise 3.4, which asks me to use qiskit to produce the Bell state:
$$\frac{|01\rangle + |10\rangle}{\sqrt{2}}$$
which is equivalent to
$$\begin{bmatrix}
0 \\
\frac{1}{\sqrt2} \\
\frac{1}{\sqrt2}\\
0
\end{bmatrix}.
$$
When you apply a CNOT to this, we get:
$$\begin{bmatrix}
0 \\
0 \\
\frac{1}{\sqrt2}\\
\frac{1}{\sqrt2}
\end{bmatrix}$$
Which is just $|1\rangle\otimes |+\rangle$. However, I can't figure out how to set my qubits up in the right way.
Any tips on how to use qiskit to get that last matrix?
"
"['programming', 'qiskit', 'simulation']"," Title: Get the gates after fusion optimization in Qiskit statevector simulatorBody: I tried to obtain the gates after fusion in Qiskit-aer statevector simulator. What I can find now is that it provides a backend option saying fusion_verbose (bool): Output gates generated in fusion optimization into metadata [Default: False]. While I set it, I couldn't figure out a way to get the "metadata".
simulator = aer.StatevectorSimulator(max_parallel_threads=128,fusion_verbose=True)
result = execute(circuit,simulator).result()
statevector = result.get_statevector(circuit)
config = simulator.configuration()
print(config.to_dict())
That information is not in the configuration. I am wondering how I can get those gates.
Another related question is that if I set the highest optimization level in the qiskit transpile function, do I get the same circuits as I was running it in the statevector simulator?
Thank you in advance.
"
"['grovers-algorithm', 'cryptography']"," Title: Where does the time complexity come from when applying Grover's algorithm to AES?Body: I have just finished multiple readings of Applying Grover’s algorithm to AES: quantum resource estimates, a 2015 paper by Markus Grassl, Brandon Langenberg, Martin Roetteler, and Rainer Steinwandt. There are many copies of it online; I used this one: https://arxiv.org/abs/1512.04965
The authors construct quantum gate implementations of AES-128, AES-192 and AES-256. They Do it with Clifford+T gates "as the underlying fault-tolerant logical quantum gate set." Table 1 has their gate estimates and qubit estimates for the key expansion.
Table 2 has the quantum resource estimates for the AES-128 implementation:
Table 3 has the resources for AES-192:
And Table 4 has the resource estimates for AES-256:
Cracking AES with Grover's algorithm requires a (plaintext, ciphertext) pair --- that is, you perform a known plaintext attack, which is easier than a ciphertext-only attack. In this case, Grover's algorithm is used find the key that produces the ciphertext from the plaintext (or vice-versa). One of the things that the authors note is that you actually need multiple blocks to perform the attack, since the block size is 128-bits, so for the vast majority of 128-bit blocks there will be multiple AES-192 and AES-256 bit keys that produce the same (plaintext,ciphertext) pair. (I had not realized this before reading the paper, but it is a straightforward application of the pigeonhole principle.)
The part of the paper that I do not understand is the time estimates, and this probably goes back to some confusion that I have regarding Grover's algorithm. The challenge in cracking AES with Grover is not the complexity of the circuit (which results primarily from unwinding the multiple rounds), but from the number of "Grover iterations" that are required.
The key paragraph is at the bottom of p. 10 and the top of p. 11:
What I'm confused about is how we actually implement a 'Grover iteration' on a suitably large quantum computer. If we were to use a scaled up version of the superconducting quantum computers with artificial atoms, then the qubits are the wires and the gates are radio pulses that are fed into the circuit, right? So does each "iteration" mean that we play the gates from beginning to end $1.19 \times 2^{86}$ times?
If we do need to play the gates $1.19 \times 2^{86}$ times, do we store the results of each of those iterations in a classical computer that's controlling the quantum computer, and then take the result that was selected the most number of times, or do the results accumulate in the quantum circuit itself? If we accumulate the results, then don't we also need to have room to store $2^{128}$ 128-bit solutions to see which one comes up the most times?
Here is Table 5, which computes the time resources required for attacking AES with Grover's algorithm:
The paper concludes "it seems prudent to move away from 128-bit keys when expecting the availability of at least a moderate size quantum computer." Presumably this is because we can perform $2^{86}$ iterations (even with today's technology!!!) but we won't be able to perform $2^{151}$ iterations of anything, ever. In fact, we won't ever be able to perform $2^{128}$ iterations of anything, ever.
But what exactly are we iterating?
"
"['programming', 'qiskit', 'circuit-construction', 'mathematics']"," Title: Qiskit order of multiplication and tensor productBody: Section 2.3 of the Qiskit textbook shows us that
$$ CNOT|0+\rangle \ = \ \frac{1}{\sqrt2}(|00\rangle + |11\rangle)$$
which I was able to translate to a circuit as such:
qc = QuantumCircuit(2)
qc.h(1)
qc.cx(1,0)
qc.draw()
.
I'm trying to see how to come to the same result by hand, but no order of operations is saving me here. In other words, could someone step through the process? To the best of my understanding, the convention is to tensor product upwards and multiply right to left, e.g.:
$$ [CNOT (H ⊗ I)] |0+\rangle$$
Could someone step through the math as a guided example?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: How do I arrange these two-qubit states based on their entanglement?Body: How can I arrange the following states in decreasing order based on their entanglement?
i) $\rho_1 = \frac{1}{2}|0\rangle \langle0|\otimes |+\rangle \langle+| +\frac{1}{2}|+\rangle \langle+|\otimes |1\rangle \langle1|$
ii) $\rho_2 = |\psi\rangle \langle\psi|$, where $|\psi\rangle=\sqrt{0.99}|00\rangle+0.1|11\rangle$.
"
"['algorithm', 'mathematics', 'classical-computing']"," Title: what matrix operations have better known time complexity on a quantum computer?Body: I'm exploring quantum computers for a semester project. I'm mainly interested in making faster matrix calculations than a regular computer.
I was wondering what arithmetic operations (irrespective of how simple or complex they are) are faster on a quantum computer? Also, by what factor does the time complexity improve?
Note - I'm a newbie to quantum computers. So, apologies if this question is too vague than the usual questions here.
"
"['quantum-gate', 'ibm', 'ibm-quantum-experience']"," Title: Where is CZ gate in IBM Quantum circuit composerBody: I am trying to build the Grover circuit using the IBM Quantum Composer circuit composer. The Grover example has a CZ gate. I can't find that gate in circuit composer.
"
"['programming', 'qiskit']"," Title: How can I adjust calibration figure size?Body: I'm hoping to obtain a larger picture of the calibration figure. The original command is
meas_fitter.plot_calibration()
I tried to use
meas_fitter.plot_calibration(figsize=(10,10))
but that doesn't work. How can I make it bigger? Thanks!
"
"['quantum-state', 'foundations', 'interpretations']"," Title: How can quantum interference happen in real world if a wave function does not have any physical meaning?Body: I understood quantum interference as a heart of quantum computing, because it enables two possibilities to cancel each other. Quantum algorithms utilize this property to reduce the probability of returning wrong answers and thus give higher chance to returning correct answers compared to classical algorithms. And quantum interference is possible because wave function can have complex value, not just non-negative value like classical probability.
But according to many articles about quantum mechanics, wave function is not actual existence - and wave function itself does not have any physical meaning. Only its absolute value squared has a meaning of possibility to be in a specific quantum state. But still, quantum interference happen in real quantum world and quantum computers use this phenomenon to be effective.
How is this possible?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Numpy DeprecationWarning flooding in IBM Quantum LabBody: I'm coding using the Jupyter Notebook in the IBM Quantum Lab. However, I don't know why I see the following repeated message every time when I execute a quantum circuit:
This message shows thousands of times and occupied a significant amount of memory. However, it shows that the job I submitted could be successfully executed, but I'm not able to access the result.
Does anyone know what happened? What can I do to fix this issue? Thanks a lot!
"
"['programming', 'qiskit', 'error-mitigation']"," Title: Can I only use a 'subset' of calibration matrix to reduce measurement errors?Body: Suppose I have the following calibration matrix generated using 4 qubits:
from qiskit.ignis.mitigation.measurement import (complete_meas_cal, CompleteMeasFitter)
cal_circuits, state_labels = complete_meas_cal(qr = qc.qregs[0],circlabel = 'measerrormitigationcal')
cal_job = execute(cal_circuits,
backend = device,
shots = 1024,
optimization_level = 0
)
print(cal_job.job_id())
job_monitor(cal_job)
cal_results = cal_job.result()
meas_fitter = CompleteMeasFitter(cal_results, state_labels)
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(10, 10))
meas_fitter.plot_calibration(ax)
Is there a way I can use this filter to reduce another quantum circuit with 3 qubits? (i.e. A subset with 8 elements) (I was wondering if I could add a '0' after the keys but it seems like this won't work since the additional qubit might 'flip'. )
Thanks!!
"
['qiskit']," Title: How to fix an error: 'module 'qiskit.result' has no attribute 'get_counts''Body: execute(circuit, backend = simulator).result()
plot_histogram(result.get_counts(circuit))
Error: module 'qiskit.result' has no attribute 'get_counts'
"
"['entanglement', 'stabilizer-state', 'graph-states', 'entanglement-witness']"," Title: Entanglement Witnesses close to GHZ statesBody: Consider page 2 of Toth's paper 'Entanglement detection in the stabilizer formalism (2005)'. To detect entanglement close to GHZ states, they construct entanglement witnesses of the form $$\mathcal{W} := c_0 I - \tilde{S}_{k}^{(GHZ_N)} - \tilde{S}_{l}^{(GHZ_N)},$$
where $\tilde{S}_{k/l}^{(GHZ_N)}$ are elements of the stabilizer group and $$c_0 := \text{max}_{\rho \in \mathcal{P}}\big( \big\langle \tilde{S}_{k}^{(GHZ_N)} + \tilde{S}_{l}^{(GHZ_N)} \big\rangle_{\rho} \big),$$ where $\mathcal{P}$ denotes the set of product states.
Definition: Two correlation operators of the form $$K = K^{(1)} \otimes K^{(2)} \otimes \cdot \cdot \cdot \otimes K^{(N)}~~~~~~\text{and}~~~~~~L = L^{(1)} \otimes L^{(2)} \otimes \cdot \cdot \cdot \otimes L^{(N)}$$ commute locally if for every $n \in \{1,...,N\}$ it follows $K^{(n)}L^{(n)} = L^{(n)}K^{(n)}$.
Question:
In the paper, an observation which follows states:
Hence it follows that if $\tilde{S}_{k}^{(GHZ_N)}$ and $\tilde{S}_{l}^{(GHZ_N)}$ commute locally then the maximum of $\big\langle \tilde{S}_{k}^{(GHZ_N)} + \tilde{S}_{l}^{(GHZ_N)} \big\rangle$ for separable and entangled states coincide.
Is it clear why this statement holds true?
Thanks for any assistance.
"
"['quantum-gate', 'qiskit', 'quantum-state', 'linear-algebra', 'quantum-circuit']"," Title: proof that the gate U is equivalent to the given circuit mathematicallyBody:
I have solved this question by this, but can't able to get my mistake in it.
"
"['qiskit', 'teleportation']"," Title: How to fix an error : "" QiskitBackendNotFoundError: 'No backend matches the criteria' ""Body: I am trying to run the Quantum Teleportation Algorithm using Qiskit on Jupyter Notebook.
Here is my code below where I am finding an error -
circuit.measure(2,2)
simulator = Aer.get_backend('qasm-simulator')
result = execute(circuit, backend = simulator, shots = 1024).result()
counts = result.get_counts()
from qiskit.tools.visualization import plot_histogram
plot_histogram(counts)
Error: QiskitBackendNotFoundError: 'No backend matches the criteria'
"
['quantum-enhanced-machine-learning']," Title: What's the point of the half coefficient in the max-cut cost HamiltonianBody: Below is the cost Hamiltonian for an unweighted max-cut problem, I don't understand what the point of the half coefficient is. Why couldn't we omit it?
$C_\alpha = \frac{1}{2}\left(1-\sigma_{z}^j\sigma_{z}^k\right),$
"
"['algorithm', 'machine-learning', 'qaoa', 'quantum-enhanced-machine-learning', 'nisq']"," Title: Quantum Machine Learning in NISQ eraBody: I know that quantum algorithms can be useful for machine learning ("ML") methods, and vice versa. For example if we use QAOA we can use for the optimization part different types of ML methods, like SGD, Bayesian etc.
Now we can hold on that the both topics can be useful for each of them but is it possible that we can convert any ML method to a quantum ML method ?
Is it possible to use QML in NISQ era?
"
"['entanglement', 'mathematics', 'textbook-and-exercises', 'density-matrix']"," Title: How do I determine if a given pure two-qubit state is separable?Body: I'm trying to self-study some topics about quantum computing and I came across a topic of state separability. Talking about that, I wanted to determine separability on the following state (from Qiskit Textbook):
$$
\frac{1}{\sqrt{2}}\left|00\right> + \frac{i}{\sqrt{2}}\left|01\right>
$$
I know, that it is separable, as it can be rewritten as
$$
\left| 0\right> \otimes \frac{\left|0 \right> + i\left| 1\right>}{\sqrt{2}},
$$
but what's the way to determine if the state is separable or entangled without guessing?
It's stated in Is there an algorithm for determining if a given vector is separable or entangled? , there are ways to do this and
I came also across Peres-Horodecki separability criterion, often called also PPT Criterion.
I must admit, that due to my little previous experience, I don't understand everything well, so I'd appreciate an explanation on the abovementioned state, preferably with algebraic steps written, as they're mostly missing in many explanations of this topic.
My attempt
As I understand it, the very first thing is to rewrite the state-vector as a density matrix $\rho$:
$$
\left| \psi\right> = \left| 0\right> \otimes \frac{\left|0 \right> + i\left| 1\right>}{\sqrt{2}} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1\\ i\\ 0\\ 0\end{bmatrix}
$$
$$
\rho = \left| \psi \right > \left< \psi \right| = \begin{bmatrix}
\frac{1}{2} & -\frac{i}{2} & 0 & 0\\
\frac{i}{2} & \frac{1}{2} & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{bmatrix}
$$
And now I should perform "partial transform" and find eigenvalues of the partially transformed matrix. But I'm really confused here about A and B "party", as I have only one state $\left| \psi \right>$. How am I supposed to proceed now?
My attempt 2
I also tried to utilize a reduced density matrix:
$$
\left| \psi \right> = \frac{1}{\sqrt{2}}\left|00\right> + \frac{i}{\sqrt{2}}\left|01\right> = \frac{1}{\sqrt{2}} \left( \left| 0\right>_A \otimes \left| 0\right>_B + i\left(\left| 0\right>_A \otimes \left| 1 \right>_B \right)\right)
$$
$$
\rho_A = Tr_B \left( \left|\psi \right> \left<\psi \right| \right) = \frac{1}{2} \left( \left| 0\right> \left< 0\right| + i\left( \left|0\right>\left<1\right| \right) \right) = \frac{1}{2} \begin{bmatrix}1 & i\\ 0 & 0 \end{bmatrix}
$$
$$
Tr(\rho_A^2) = \frac{1}{4} Tr\left( \begin{bmatrix} 1 & i\\ 0 & 0 \end{bmatrix} \right) = \frac{1}{4}
$$
As we can see, my results seems to be $\frac{1}{4}$, while it should be 1 for a separable state. What am I doing wrong?
"
"['quantum-gate', 'qiskit', 'error-correction']"," Title: Applying a projector to a qubit in a qiskit circuitBody: I'd like to be able to apply $|0 \rangle \langle 0|$ to project a qubit to the state $|0 \rangle$ in the middle of qiskit circuit (see, for example, the attached circuit).
I wonder if, in general, one can customize those orange boxes in some way and if that works in the real hardware.
"
"['quantum-gate', 'quantum-state', 'mathematics']"," Title: Formula for a single unit gate acting on a lexicographically represented stateBody: I've been trying to find in textbooks a discussion on the action of arbitrary single qubit gates on a lexicographic state. That is, given an operator $G_{l}= 1\otimes 1...\otimes G \otimes ... \otimes 1$ which acts on the $l$-th qubit and a state
$|\psi\rangle = \sum \alpha_{J} |J\rangle$
where $ 0 \leq J < 2^N $, $N$ is the number of qubits, $J \in \mathbb{Z}$, $|J\rangle$ is standard product state representing $J$ in binary, and the sum runs through the range of J, what can be said about:
$G_{l} |\psi \rangle$
in terms of the single qubit operator $G$ and how do the original $\alpha_{J}$ map.
It shouldn't be too difficult to derive some formulas (there will likely be some transitions between $J$ and it's bit flipped int) but I figured since this seems like a basic thing it would have been discussed somewhere.
Edit: Using the notation of the answer below it's can be shown that if:
$G = g_{00} |0\rangle \langle 0| + g_{01} |0\rangle \langle 1| + g_{10} |1\rangle \langle 0| + g_{11} |1\rangle \langle 1|$
then the coefficent mappings are:
$\alpha'_{J} = \alpha_J g_{00} + \alpha_{f_l(J)} g_{01} $ if $J_{l} = 0$
$\alpha'_{J} = \alpha_J g_{11} + \alpha_{f_l(J)} g_{10} $ if $J_{l} = 1$
where $f_l(J)$ flips the $l$-th bit of $J$.
"
"['entanglement', 'measurement', 'entanglement-negativity']"," Title: How do I calculate Logarithmic Negativity for the given bipartite state?Body: How can I calculate Logarithmic Negativity for the given state?
$\rho = \frac{1}{2} |0\rangle \langle0| \otimes |+\rangle \langle+| +\frac{1}{2} |+\rangle \langle+| \otimes |1\rangle \langle1| $
"
"['algorithm', 'measurement', 'phase-estimation']"," Title: Why do the controlled unitary operations in quantum phase estimation have $2^n$ in their exponents?Body: Why do the unitary gates on the measurement qubits have $2^n$? Why do we need to apply the unitary gates for any power at all? What would happen if we applied the controlled-$U$ only once, for example, for each control qubit, prior to the inverse QFT?
For example, from Wikipedia here.
Specifically the circuit diagram illustrated in Wikipedia.
Another resource that shows this is the Qiskit documentation.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: CERTIFICATE_VERIFY_FAILED after updating Python when trying to access results in IBM QEBody: I had a question earlier about the Numpy DeprecationWarning flooding issue. I just updated the Python in my regular jupyter notebook and have trouble running the following cell:
cal_job = execute(cal_circuits,
backend = backend,
shots = 1024,
optimization_level = 0
)
***cal_results = cal_job.result()***
meas_fitter = CompleteMeasFitter(cal_results, state_labels)
fig, ax = plt.subplots(figsize=(10, 10))
meas_fitter.plot_calibration(ax)
My code worked fine before upgrading but now it shows the following error message (The line with the error is marked with***):
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
On the IBMQ Experience page it shows my job has been successfully executed, but I cannot obtain any result from the notebook. What should I do? Thanks so much for the help!
"
"['programming', 'qiskit']"," Title: How to simulate the density matrix in Qiskit when using the qasm simulator?Body: When simulating a circuit using qasm simulator, if there is a depolarizing channel in the noise model, then the results could be mixed states. How can I calculate the density matrix of the mixed states?
"
"['mathematics', 'textbook-and-exercises']"," Title: Why isn't $\{1,2,3\}$ well ordered?Body: I was reading the book "Quantum Computing Since Democritus".
"The set of ordinal numbers has the important property of being well
ordered,which means that every subset has a minimum element. This is
unlike the integers or the positive real numbers, where any element
has another that comes before it."
Unlike integers? Let's consider a set $\{1,2,3\}$ This has a minimum element.
What does the author want to say here?
"
"['quantum-gate', 'grovers-algorithm', 'hadamard']"," Title: How do two H gates act on two entangled qubits?Body:
In this circuit, if the two qubits are initial in state 0, then after the oracle they are entangled and in state:
$0.5 * (|00\rangle+|01\rangle+|10\rangle-|11\rangle)$
My question is how do the two H gates act on them? Do they act like:
$0.25 * [(|0\rangle+|1\rangle)\otimes(|0\rangle+|1\rangle) + (|0\rangle+|1\rangle)\otimes(|0\rangle-|1\rangle) + (|0\rangle-|1\rangle)\otimes(|0\rangle+|1\rangle) - (|0\rangle-|1\rangle)\otimes(|0\rangle-|1\rangle)]$
which in the end nothing has changed. My intuition tells me that it's wrong.
Update: The figure above is from a circuit to implement Grover's algorithm. The whole figure is given below:
I have seen the answer that the state is indeed not changed after the two H gates, why they add them here?
"
"['quantum-operation', 'information-theory', 'depolarizing-channel']"," Title: How to find the operator-sum representation of the depolarizing channel?Body: Consider a circuit built as follows: take two ancilla states and an operator $U$ made of a series of controlled gates which act on a pure state $\rho$ as follows:
- $X$ if the ancilla is in $|00\rangle$;
- $Y$ if the ancilla is in $|01\rangle$;
- $Z$ if the ancilla is in $|10\rangle$;
- $\mathbb{I}$ if the ancilla is in $|11\rangle$.
Prepare the ancilla in the state $$|\psi\rangle_{A}=\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\delta|11\rangle.$$I want to find $\rho'$ using the operator-sum formalism. Using the notation $C^2_O$ for a double-controlled gate, we have
\begin{equation}
E_{ij}=\langle ij|C_Z^2C_Y^2C_X^2(\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\delta|11\rangle) \\ =\langle ij|00\rangle\alpha X+\langle ij|01\rangle\beta Y\langle ij|10\rangle\gamma Z+\langle ij|11\rangle\delta \mathbb{I},
\end{equation}
so that, for example, $E_{00}=\alpha X$, $E_{00}^\dagger=\alpha^*X$. Therefore
\begin{equation}
\rho'=\sum_{i,j\in\{0,1\}}E_{ij}\rho E_{ij}^\dagger=|\alpha|^2X\rho X+|\beta|^2 Y\rho Y+|\gamma|^2Z\rho Z+|\delta|^2\rho.
\end{equation} (as a side note: what is the standard notation to indicate a doubly controlled quantum gate?)
This model can be used to study several noisy channels. In particular, $|\alpha|^2=|\beta|^2=|\gamma|^2=p/3$ gives the so-called depolarizing channel: $$\rho'=\frac{p}{3}(X\rho X+Y\rho Y+Z \rho Z)+(1-p)\rho.$$ To see this, I should be able to write the first term as $p\mathbb{I}/2$. The problem is, I can't. I haven't tried anything fancy, just writing $$\rho=\begin{pmatrix} a & b \\ c & d \end{pmatrix} $$
and doing the calculations explicitly. What's the best way to show it?
"
"['bell-experiment', 'non-locality']"," Title: Formal proof of Bell's inequality in CHSH formBody: I have a sketch of the proof of Bell's theorem that goes as follows: Alice measures an observable $A$ along a direction $\vec a$ with possible outcomes $\pm 1$, and Bob does the same for an observable $B$ along $\vec b$ with the same outcomes. Both observables possess the same hidden variable $\lambda$ with normalized probability distribution $\int p(\lambda)d\lambda$.
The expectation value for their measurements once $\vec a$ and $\vec b$ have been fixed is
\begin{equation}
E(\vec a,\vec b)=\int d\lambda p(\lambda)A(\vec a,\lambda)B(\vec b,\lambda).
\end{equation}
If we assume that Bob measures in two different directions $\vec b, \vec b'$ without change in the paramter $\lambda$, then
\begin{equation}\tag{$*$}
E(\vec a,\vec b)-E(\vec a, \vec b')=\int d\lambda(A(\vec a,\lambda)B(\vec b,\lambda)-A(\vec a,\lambda)B(\vec b',\lambda)).
\end{equation}
My question: how do we get from $(*)$ to the estimate
\begin{equation}
E(\vec a,\vec b)-E(\vec a, \vec b')\le \left|\int d\lambda p(\lambda)(1-A(\vec a', \lambda)B(\vec b',\lambda))\right|+ \left|\int d\lambda p(\lambda)(1-A(\vec a', \lambda)B(\vec b',\lambda))\right| \\ \le 2-| E(\vec a',\vec b')+ E(\vec a',\vec b)|\ ?
\end{equation}
"
"['programming', 'qiskit', 'error-mitigation']"," Title: Filtering a set of results obtained from job managerBody: I've already generated a filter for readout error mitigation:
cal_results = cal_job.result()
meas_fitter = CompleteMeasFitter(cal_results, state_labels)
fig, ax = plt.subplots(figsize=(10, 10))
meas_fitter.plot_calibration(ax)
meas_filter = meas_fitter.filter
I have a set of circuits executed using the IBM job manager, the list is called all_circuits. After transpling the list, I tried:
MExperiments = job_manager.run(all_circuits, backend=backend, shots = nshots)
results = MExperiments.results()
**mitigated_results = meas_filter.apply(results)**
I'm hoping to use the filter to mitigate the errors for each circuit in the list, but the last line doesn't quite work. It shows me
QiskitError: 'Unrecognized type for raw_data.'
How can I fix this issue? Thanks:)
$\rule{4cm}{0.4pt}$
PS:
From the tutorial, there're 4 types of raw data that match the requirement:
Form1: A counts dictionary from results.get_counts,
Form2: A list of counts of length=len(state_labels),
Form3: A list of counts of length=M*len(state_labels) where M is an integer (e.g. for use with the tomography data),
Form4: A qiskit Result.
I'm not pretty sure why the results in my code doesn't fit any one of them.
"
"['quantum-gate', 'shors-algorithm']"," Title: How does the subtraction gate work in Fourier spaceBody: I am currently reading Shor's algorithm on my own and I come across a paper via this link. It shows the circuit for implementing Shor's alogrithm. Here it depicts that taking a QFT circuit on the number a on the qubits b that are already in fourier space would result in the addition of a and b in Fourier space.
The addition is quite intuitive. However, when it comes the subtraction, I am stuck.Why taking an inverse QFT circuit would result in the $b-a$ or $2^{n+1} - (a-b)$? Wouldn't it return $a+b$ as the second stage output is $\Phi(a+b)$?
"
"['circuit-construction', 'measurement']"," Title: Circuit that measures PVMBody: How can I construct a circuit that measures PVM $\{|\psi\rangle\langle\psi|\},|\psi^\perp\rangle\langle\psi^\perp| \}$ where $|\psi\rangle=\cos\frac{\theta}{2}+e^{i\phi}\sin\frac{\theta}{2}|1\rangle$ by using only computational basis measurement and Pauli-axis rotation.
"
"['programming', 'qaoa']"," Title: Initial state definition for QAOABody: There are a few options already discussed and suggested how to pass the initial state to the QAOA module.
I tried all but no one works in my case. Maybe, there are any other ideas?
So, I created the initial state as:
circ = QuantumCircuit(4)
circ.h(0)
circ.h(1)
circ.h(2)
circ.h(3)
backend=Aer.get_backend('statevector_simulator')
job = execute(circ, backend)
result = job.result()
init_state = result.get_statevector(circ)
print(init_state)
then, by passing it to QAOA:
qaoa = QAOA(qubitOp, optimizer, p=3, initial_state=init_state,
mixer=mixerop, initial_point=init_point,
callback=store_intermediate_result, quantum_instance=qi)
I got the error:
~\Anaconda3\lib\site-packages\qiskit\aqua\algorithms\minimum_eigen_solvers\qaoa\var_form.py in construct_circuit(self, parameters, q)
83 # initialize circuit, possibly based on given register/initial state
84 if self._initial_state is not None:
---> 85 stateVector = CircuitStateFn(self._initial_state.construct_circuit('circuit'))
86 circuit = stateVector.to_circuit_op()
87 else:
AttributeError: 'numpy.ndarray' object has no attribute 'construct_circuit'
```
"
"['entanglement', 'state-distillation']"," Title: What is the difference between ""entanglement distillation"" and ""entanglement purification""?Body: To my understanding, entanglement distillations is transformation of several copies of weakly entangled states into fewer copies of more strongly entangled states using local operations and classical communication.
My question is, what is the difference between "entanglement distillation" and "entanglement purification"?
I've checked some papers, but I thought these words are used interchangeably.
"
"['quantum-state', 'measurement', 'textbook-and-exercises', 'probability']"," Title: Probability of measuring one qubit from the state of two qubitsBody: I am new to quantum information and I am trying to work on some problems but I have confused myself over a qubit problem. I have the state of two qubits $|\psi\rangle_{AB}=a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11}|11\rangle$ and $\sum_{j,k} |a_{j,k}|^2=1$. If I am to measure qubit B in the basis {$|0\rangle_{B},|1\rangle_{B}$}, what is the probability of getting $|1\rangle_B$?
I am not familiar with measuring only one of the qubits. From my understating, the entire state will not collapse after the measurement, and only one of the subsystems will collapse. Am I wrong?
"
"['programming', 'quantum-circuit', 'pennylane']"," Title: Pennylane: creating QNodes for large numbers of circuits that only differ by number of wiresBody: Take the following simple quantum function:
def my_quantum_function(params, wires=None):
for i in range(wires):
random_rot = params[i]
qml.RY(random_rot, wires=i)
qml.broadcast(qml.CZ, wires=range(wires), pattern="chain")
return qml.expval(qml.PauliZ(0))
Let's say I want to make QNode objects using this function for wires=2 and wires=3. My understanding is that I can either leave the function as it is and write,
params = [np.random.uniform(0, 2*np.pi) for _ in range(wires)]
dev1 = qml.device("default.qubit", wires=2)
circuit1 = qml.QNode(my_quantum_function, dev1)
result1 = circuit1(params, wires=2)
dev2 = qml.device("default.qubit", wires=3)
circuit2 = qml.QNode(my_quantum_function, dev2)
result2 = circuit2(params, wires=3)
or, I can make two copies of the function and use the QNode decorator:
dev1 = qml.device("default.qubit", wires=2)
dev2 = qml.device("default.qubit", wires=2)
@qml.qnode(dev1)
def circuit1(params):
wires = 2
for i in range(wires):
random_rot = params[i]
qml.RY(random_rot, wires=i)
qml.broadcast(qml.CZ, wires=range(wires), pattern="chain")
return qml.expval(qml.PauliZ(0))
@qml.qnode(dev2)
def circuit2(params):
wires = 3
for i in range(wires):
random_rot = params[i]
qml.RY(random_rot, wires=i)
qml.broadcast(qml.CZ, wires=range(wires), pattern="chain")
return qml.expval(qml.PauliZ(0))
params = [np.random.uniform(0, 2*np.pi) for _ in range(wires)]
result1 = circuit1(params)
result2 = circuit2(params)
Fair enough. But let's say I wanted to create QNode objects using this function for wires=2,3,4,...,20. What is the most idiomatic way to do this? I know QNodes collections is a way to define families of QNodes, but this still requires explicitly defining all $N$ devices you need, which doesn't end up saving any time, as it appears. Right now what I'm doing is using the top function I gave and a for-loop, defining a new device/QNode on each iteration:
n_wires = [i+2 for i in range(19)]
for n in n_wires:
params = [np.random.uniform(0, 2*np.pi) for _ in range(n)]
dev = qml.device("default.qubit", wires=n)
circuit = qml.QNode(my_quantum_function, dev)
result = circuit(thetas, wires=n)
...
# Do some computations
...
Using the QNode decorator is the recommended approach, and QNodes can be set to mutable, but I can't find an example in the documentation where you can adjust the number of wires on the fly. Maybe there isn't a more elegant way to do this, but I thought I would ask. Sorry for the long-winded question.
"
"['complexity-theory', 'qaoa']"," Title: Properties of QAOABody: The QAOA algorithm consists of two elements:
- The outer loop, basically a classical optimization algorithm
- The quantum circuit, taking $2p$ parameters (where $p$ is the number of layers, where each layer is a gate representation of the cost and mixer Hamiltonian)
In each iteration of the outer loop, the quantum circuit is sampled with candidate variational parameters which yields a classical bit string (after a measurement, then the bit string's cost is classicaly evaluated and finally the parameters are accordingly updated through some optimization approach.
Usually, QAOA is presented as a potential candidate for quantum advantage, esp. for NP-hard problems. Why?
There are only three ways how an approximation algorithm can improve the state-of-the-art:
- It can find better solutions (approximation ratio)
- It requires less iterations to find acceptable solutions
- Per iteration, less time is required (or any other important resources, e.g. space, ...)
ad 1) As far as I know, currently no problem is known for which QAOA performs better than classical algorithms (but of course, such problems can exist)
ad 2) I assume that this entirely depends on the optimization algorithm in the outer loop
ad 3) The quantum circuit does two things: it computes part of the cost function (in the form of the cost Hamiltonian $H_C$) and stochastically maps the $2p$ parameters to a bit string (via qubit rotation and measurement). If $H_C$ can be classicaly evaluated in an efficient way (and this should almost always be the case, maybe even always as cost Hamiltonians that are not efficiently computable are probably not constructuable with sums of Pauli tensor products, I guess), I don't see a chance of structural improvement (as the mapping from parameters to a candidate solution bit string is also done efficiently by many classical optimization algorithms)
So, QAOA can not be faster per iteration (in terms of time complexity) than a classical algorithm and it can not require less iterations than a classical algorithm. It only may have better approximation ratios for certain problems. Is my thought process correct?
PS. Yes, there are papers stating a QAOA advantage once a certain amount of qubits are available, but those compare deterministic solver algorithms (always correct/optimal solutions) with the stochastic approximations algorithm QAOA.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: API error when trying to access IBM Quantum Computer using IBMQ API TokenBody: I'm trying to write a code so that if the token exists then it loads the account or else it asks the user for the API token. Below is the code for reference:
from qiskit import IBMQ
try:
IBMQ.load_account()
except Exception as e:
api_key = input("Enter IBMQ API Key")
IBMQ.save_account(api_key, overwrite=True)
IBMQ.load_account()
However, even after using the exception handling, still getting below errors:
RequestsApiError: '401 Client Error: Unauthorized for url: https://auth.quantum-computing.ibm.com/api/users/loginWithToken. Login failed., Error code: 3446.'
IBMQAccountCredentialsInvalidToken: 'Invalid IBM Quantum Experience token found: "" of type <class \'str\'>.'
Any work around this to resolve this issue?
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix']"," Title: What is the difference between $|0\rangle+|1\rangle$ and a balanced mixture of $|0\rangle$ and $|1\rangle$?Body: Suppose I have a quantum state $\frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle$. Also I have a mixture of two quantum states
$S_{1} = |0\rangle$ and $S_{2} = |1\rangle$. In this mixture $50\%$ chance of getting $S_{1}$ and $50\%$ chance of getting $S_{2}$.
- If I give you these two situation one by one, is there anyway you can tell which is what?
- Also what is the difference between them?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Is there a 'retry' logic in job manager?Body: This is a follow-up question to my earlier post. I'm trying to filter a set of results obtained from job manager, and the following code works when my circuit list doesn't contain too many elements:
MExperiments = job_manager.run(all_circuits, backend=backend, shots = nshots)
results = MExperiments.results()
cresults = results.combine_results()
mitigated_results = meas_filter.apply(cresults)
The combine_results() method is used to help us combine a set of results so that the final single result matches the requirements of apply. The prerequisite is that all jobs need to succeed. However, when my list all_circuits gets large, it shows me this error message:
IBMQManagedResultDataNotAvailable: 'Results cannot be combined since some of the jobs failed.'
I checked my job status in IBMQ and it shows all the circuits have been successfully executed. How can I fix this issue? Is there a way I can make the job monitor retry the jobs that failed? Thanks!!
"
"['programming', 'qiskit', 'physical-qubit']"," Title: What's the default value for a quantum register?Body: I've just started to learn Quantum computing with Qiskit: I'm reading the Qiskit documentation and the book "Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®".
In this book, on page 79 we can read: "..., as we set up our qubit to start as 0, ..."
Can we set up the start value for a quantum register?
Because I think I have read that they have its default value to 0, and we only can set it to one using the NOT gate.
I have tried to set it to 0 in Quantum Experience and I haven't found how to do it, and also with Python and I haven't found it.
"
"['quantum-state', 'algorithm', 'interpretations']"," Title: What are tentpole topics in quantum computing?Body: Lots of beginners are starting to learn quantum computing. But there are also experienced people that have been working in this field for many years.
What are some topics that might be considered important for a beginner to learn thoroughly?
By beginner, I mean someone who didn't work in the field, and who does not have a Ph.D. in the field (for example, someone who has just been reading about Quantum Computing for the last 3-4 months).
"
['simons-algorithm']," Title: How can I solve Simon's problem for the projection function $f(x_0,x_1)=x_0$?Body: I am having issues solving Simon's problem for a projection function.
The function $f: \{0,1\}^2 \mapsto \{0,1\}$ defined as $f(x_0,x_1) = x_0$ returns the least significant bit of its argument.
How can I solve Simon's problem for this function? And write down the corresponding number $a$?
"
"['algorithm', 'complexity-theory', 'speedup']"," Title: List of problems in the query complexity model with no super-polynomial quantum speedupBody: Similar to this list over at cstheory, I'm looking for a list of computational problems in the query complexity model for which it is known that no super-polynomial quantum speedups exist. What are some natural problems for which quantum computers are known to have only 'limited' advantage?
"
"['programming', 'qiskit', 'bell-basis']"," Title: Q-Sphere representation of Bell StatesBody: I'm currently going through Lab1 of the Qiskit Quantum Computing Course, where one task is to create the Bell State
$$\frac{1}{\sqrt{2}}\left(\vert01\rangle + \vert10\rangle\right)$$
Technically it should be achived by applying a Hadamard, followed by a CNOT gate on the initial state $\vert01\rangle$, if I understand it correctly. My Qiskit implementation is the following:
sv = Statevector.from_label('01')
mycircuit = QuantumCircuit(2)
mycircuit.h(0)
mycircuit.cx(0,1)
new_sv = sv.evolve(mycircuit)
plot_state_qsphere(new_sv.data)
I'm only confused about the resulting Q-Sphere image:
The way I understood the Q-Sphere, this image should correspond to the state
$$\frac{1}{\sqrt{2}}\left(\vert11\rangle - \vert00\rangle\right)$$ and not to the requested one. Was my creation of the asked Bell State wrong, or my interpretation of the Q-Sphere? Thanks for any help!
"
"['complexity-theory', 'qaoa', 'quantum-advantage']"," Title: Why does QAOA achieve quantum supremacy in an algorithmic sense?Body: In the paper Quantum Supremacy through the Quantum Approximate Optimization Algorithm the authors claim (last sentence of page 15):
"If [...] the QAOA outperforms all known classical algorithms then it will achieve Quantum Supremacy in an algorithmic sense."
To support this, they prove that any classical (stochastic) algorithm that produces a similar (up to a small multiplicative error) output distribution as QAOA, cannot do this in poly-time (or in other words: sampling from the QAOA distribution cannot be done efficiently on classical computer).
Can someone explain how this point supports their supremacy claim?
I mean, according to their proof it is still possible that a (potentially not yet known) classical algorithm can have a completely different output distribution that however might have even a much higher probability for the correct answer.
Of course, this also depends on the definition of quantum supremacy but for me quantum supremacy would mean that no classical algorithm can exist at all that solves the problem in a better way than a quantum algorithm. So, is this just a different understanding of the supremacy term in the sense that they mean that supremacy is reached once all known classical algorithms are beaten?
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'linear-algebra']"," Title: Why is the transpose of a density matrix positive and trace preserving?Body: With density matrix $\rho=\sum_{a,b=0}^1\rho_{a,b}|a\rangle\langle b|$ and it's transpose $\rho^T=\sum_{a,b=0}^1\rho_{a,b}|b\rangle\langle a|$. How to confirm that $\rho^T$ is positive and trace preserving.
"
"['mathematics', 'tensor-product', 'notation', 'linear-algebra']"," Title: Are the two ways of interpreting the expression $(|a\rangle\otimes|b\rangle)(\langle c|\otimes\langle d|)(|e\rangle\otimes |f\rangle)$ equivalent?Body: Reading Nielsen and Chuang, I am under the impression that a linear operator on the tensor product can be written in two ways:
\begin{equation}
(\left|a\right> \otimes \left|b\right>)(\left<c\right| \otimes \left<d\right|) = \left|a\right>\left<c\right| \otimes \left|b\right>\left<d\right|
\end{equation}
As if I take a vector $\left|e\right> \otimes \left|f\right>$ from a tensor product and apply the operator, I get in the first case:
\begin{align}
(\left|a\right> \otimes \left|b\right>)(\left<c\right| \otimes \left<d\right|) (\left|e\right> \otimes \left|f\right>) =& (\left|a\right> \otimes \left|b\right>) \left<c|e\right> \left<d|f\right>\\
=& \left<c|e\right> \left<d|f\right> \left|a\right> \otimes \left|b\right>
\end{align}
And, in the second case,
\begin{align}
(\left|a\right>\left<c\right| \otimes \left|b\right>\left<d\right|) (\left|e\right> \otimes \left|f\right>) =& \left|a\right>\left<c|e\right> \otimes \left|b\right>\left<d|f\right> \\
=& \left<c|e\right> \left<d|f\right> \left|a\right> \otimes \left|b\right>
\end{align}
In the first case, I consider an operator on the tensor product, and in the second case, a tensor product of operators. Are the two equivalent ? All state vectors considered are arbitrary.
"
"['programming', 'quantum-gate', 'quantum-state', 'grovers-algorithm']"," Title: Multiply-Controlled X Gate/MCT Gate ImplementationBody: I am currently trying to implement a multi-controlled Toffoli/multi-controlled X gate in Braket, but I am confused as to the general concept of cascaded X gates and other implementations. I've read Barenco, Shors, et al's work "Elementary Gates for Quantum Computation", which touches on this, but it's not really illuminating the concept for me. I am partial to the V-gate method used in Barenco, as no ancillary qubits are required, but I'm open to the cascaded-X method as well. Any additional sources or ideas would be greatly appreciated.
"
"['programming', 'q#']"," Title: Take every second element of the array in Q#Body: Very quick question, I am trying to implement SAT solving in Q# using Grover's Algorithm. I want to take every second element from an array starting at the second element, represented with a range element : 1..2..Length(array). I am not very experienced and I am trying to find a nice and clean way to do so, without too much unnecessary for loop. Could someone help ?
"
"['programming', 'qiskit', 'grovers-algorithm', 'oracles']"," Title: Implementing Grover's oracle with multiple solutions in QiskitBody: I want to turn a state
$$
|\Psi_1⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩+|101⟩+|110⟩+|111⟩)
$$
into
$$
|\Psi_2⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩-|101⟩-|110⟩+|111⟩)
$$
using a phase oracle before applying Grover's amplification.
One example from Qiskit's official page for Grover's Algorithm does this by manually building a circuit with Controlled-Z gates, but another Qiskit document simply uses a class Statevector.from_label to mark the target state $|11⟩$ without constructing a circuit, which I assume can only assign single state.
Having the desired states in a form of Python list, i.e. [101, 110], can I directly convert this into a phase oracle that does the intended job in Qiskit?
"
"['quantum-gate', 'measurement', 'quantum-enhanced-machine-learning']"," Title: SWAP Test as a Projective MeasurementBody: In a much cited paper by Lloyd et al Quantum Algorithm for Supervised and Unsupervised Machine Learning, they proposed a rather cute quantum algorithm to evaluate the distance between an input feature vector $\vec{u}$ and the centroid of a set of $M$ training vectors $\{\vec{v}_{j}\}$, i.e. an average $(1/M)\sum_{j=1}^{M}\vec{v}_{j}$. On page 3 of this paper, after they have constructed state $|\psi\rangle$ for "system and ancilla", they proceeded to "... use a swap test to perform a projective measurement on the ancilla alone to see if it is in the state $|\phi\rangle$ ...". I have three closely related questions.
- Which part of state $|\psi\rangle$ is due to the ancilla? If state $|0\rangle$ there represents part of the ancilla, it seems this ancilla state in $|\psi\rangle$ is not a single qubit, as it must have the same length as $|j\rangle$.
- What states are involved in this the swap test? My wild guess is state $|\psi\rangle$ and state $|\phi\rangle$ and the projection $\langle\phi|\psi\rangle$ is a state whose norm is the desired distance.
- How is this swap test performed in this setting? I guess an extra single qubit is needed to be the ancilla.
Your wisdom will be highly appreciated.
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix', 'partial-transpose', 'eigenvalue']"," Title: How do I calculate the eigenvalues of the positive partial transpose of this two-qubit state?Body: How can I calculate the eigenvalues of $\rho^{T_{B}}$ (PPT) of the following state
$$
\rho =\frac{1}{2}|0\rangle\langle0|\otimes|+\rangle\langle+|+\frac{1}{2}|+\rangle\langle+|\otimes|1\rangle\langle1|.
$$
"
"['quantum-gate', 'entanglement', 'teleportation']"," Title: In quantum teleportation, does Bob's qubit depend on Alice's $\alpha$ and $\beta$ coefficients?Body: Does applying an operation to one half of an entangled pair affect the other?
As in the case of quantum teleportation when Alice applies CNOT to her half of the pair and the qubit she wants to send ($\alpha|1\rangle +\beta|1\rangle$). Does Bob's half also depend on $\alpha$ and $\beta$? How?
"
['cryptography']," Title: How is it possible for Quantum computers to handle encryption if their states are unstable?Body: I've been doing research on quantum computers and encryption. How is it possible for quantum computers to solve complex encryption algorithms while their qubit states are not even predictable? How is it even possible for them to implement vectoring? Quantum registers do not sound like they are even stable enough to perform any kind of predictable math alone. How are errors in state detected and/or discarded?
"
"['nielsen-and-chuang', 'bell-experiment', 'non-locality']"," Title: In Bell's inequalities, what is the meaning of assuming that the physical properties $P_Q,P_R,P_S,P_T$ have definite values?Body: Two assumptions behind Bell inequalities (Page 117 Nielsen Chuang)
(1) The assumption that the physical properties $P_{Q}$, $P_{R}$, $P_{S}$, $P_{T}$ have definite values
$Q$,$R$, $S$, $T$ which exist independent of observation. This is sometimes known as the
assumption of realism.
(2) The assumption that Alice performing her measurement does not influence the
result of Bob’s measurement. This is sometimes known as the assumption of
locality.
What is the meaning that this assumption-(1) doesn't hold? Of course, an electron will have either spin up and spin down whether we measure it or not. I don't see how this can be wrong as well.
"
"['quantum-state', 'entanglement', 'bell-basis', 'bell-experiment']"," Title: EPR pair and individual operationsBody: I have created an EPR pair. Let's suppose it's $(|00\rangle + |11\rangle)/\sqrt{2}$. We both of our halves and then we move into our places.
- If I ask you how does your half look like (mathematical expression of the state), what would be the answer? (How does my half look like?)
- If I apply some operation to my half like maybe applying pauli $X$ gate which flips qubits, would it change anything in your half?
- What would the combined state look like after this operation?
"
"['programming', 'qiskit']"," Title: Was the Quantum Circuit Attribute ""iden"" renamed?Body: I'm going through some older tutorials for my employer and everything seems to be working fine except the "iden" attribute. The error is listed below. I assume the name was changed but I don't know what it was changed to, and I don't know how to find out.
AttributeError Traceback (most recent call last)
<ipython-input-10-fff169415f56> in <module>
4 hello_qubit = QuantumCircuit(q)
5
----> 6 hello_qubit.iden(q[0])
7
8 job = execute(hello_qubit, S_simulator)
AttributeError: 'QuantumCircuit' object has no attribute 'iden' '''
"
"['textbook-and-exercises', 'information-theory', 'state-discrimination']"," Title: In classical state discrimination, why does the trace distance quantify the probability of success?Body: Consider the following task: we are given a probability distribution $p_y:x\mapsto p_y(x)$ with $y\in\{0,1\}$ (e.g. we are given some black box that we can use to draw samples from either $p_0$ or $p_1$), and we want to recover the value of $y$.
Assume $x\in X$ for some finite register $X$.
We can assume we know what the possible distributions $p_y$ are, and we also know the probability $\lambda_y$ with which each $y$ can occur: $\mathrm{Pr}(Y=y)=\lambda_y$.
Now, suppose we got our box, used it, and obtained the result $x$. Knowing $\lambda,p_0,p_1$, what's our best guess for $y$? Well, we know that $\mathrm{Pr}(X=x|Y=y)=p_y(x)$, and thus from Bayes that
$$\mathrm{Pr}(Y=y|X=x) = \frac{\lambda_y p_y(x)}{p(x)}, \quad \text{where}\quad p(x)\equiv \sum_y \lambda_y p_y(x).$$
It then stands to reason that, knowing $x$, our best guess for $y$ is the one that maximises this probability:
$$y_{\rm opt}(x)=\mathrm{argmax}_y\mathrm{Pr}(Y=y|X=x)=\mathrm{argmax}_y \lambda_y p_y(x).$$
Using such guess, the probability of guessing right (using the knowledge of $x$) would then be
$$p_{\rm correct}(x) = \max_y \mathrm{Pr}(Y=y|X=x) = \frac{\max_y \lambda_y p_y(x)}{p(x)}.$$
We would now like to know what is the probability of correctly identifying $y$ without having sampled from $p_y$. Naively, I would compute this as the average of $p_{\rm correct}(x)$ weighted over the probabilities $p(x)$, which would give
$$p_{\rm correct} = \sum_x p(x)p_{\rm correct}(x) = \sum_x \max_y \lambda_y p_y(x).\tag A$$
However, e.g. in Watrous' book (around Eq. (3.2), pag 126, though I'm using a slightly different notation here), the author mentions that the probability of correctly identifying $y$ oughts to be calculated by considering the probability that the guess is right minus the probability that it is not, and that this would result in the quantity
$$\sum_{x\in X}\left\lvert \lambda_0 p_0(x)- \lambda_1 p_1(x)\right\rvert
= \|\lambda_0 p_0 - \lambda_1 p_1\|_1,\tag B$$
from which we would recover the probability of being correct as $p_{\rm correct}=\frac12(1+\|\lambda_0 p_0-\lambda_1 p_1\|_1)$.
Assuming the reasoning that led me to (A) is correct, why is my expression for $p_{\rm correct}$ compatible with the one resulting from (B)?
"
"['quantum-gate', 'gate-synthesis']"," Title: More efficient implementation of $4$-qubit gateBody: While working on an error detection algorithm, I stumbled upon the problem of simplifying the following implementation
Here, the $S$ gate is defined by
$$S=\left(
\begin{array}{cc}
\frac{\sqrt{3}}{2} & -\frac{1}{2} e^{\frac{i \pi }{3}} \\
\frac{1}{2} e^{\frac{i \pi }{3}} & \frac{1}{2} \sqrt{3} e^{\frac{2 i \pi }{3}} \\
\end{array}
\right)$$
The issue with this implementation is that I am basically de-encoding the state (the $C_{not}$s and $S^\dagger$s in the beginning), performing the required logical gates (the $C_{not}$s and $X$ gate in the middle), and then re-encoding the state afterwords (the $C_{not}$s and $S$s at the end). Instead of this de-encoding re-encoding procedure, I would like to find some implementation that is equivalent to the above set of gates that uses less $C_{not}$s and single-qubit gates overall. I would greatly appreciate if anyone knew of an efficient way to implement this type of gate or some papers I could research in order to further my understanding of said gate.
EDIT: In response to @ryanhill1: It is an error detection algorithm that I am developing. The basic idea is to use two qubits (and therefore expanding the hilbert space) to represent a single qubit through the encoding
$$|0\rangle_L=-\frac{1}{4} \sqrt{3} e^{\frac{i \pi
}{3}}|00\rangle+\frac{3}{4} e^{\frac{2 i \pi
}{3}}|01\rangle-\frac{\sqrt{3}}{4}|10\rangle-\frac{1}{4}
e^{\frac{2 i \pi }{3}}|11\rangle$$
$$|1\rangle_L=-\frac{1}{4} \sqrt{3} e^{\frac{i \pi
}{3}}|00\rangle-\frac{1}{4} e^{\frac{2 i \pi
}{3}}|01\rangle-\frac{\sqrt{3}}{4}|10\rangle+\frac{3}{4}
e^{\frac{2 i \pi }{3}}|11\rangle$$
This encoding is actually achieved using a pair of $S$ gates and a single $C_{not}$ gate. Hence the issue I have: I want to make a gate that acts on $|0\rangle_L$ and $|1\rangle_L$ like a $C_{not}$ acts on $|0\rangle$ and $|1\rangle$ without de-encoding and the re-encoding the entire state.
"
"['entanglement', 'entanglement-negativity']"," Title: What is the logarithmic Negativity of the Werner state?Body: What is the Logarithmic Negativity of the Werner state
$$\rho_w = p|\Psi^-\rangle\langle\Psi^-|+\frac{1-p}{4}I_4$$
where $|\Psi^-\rangle = \frac{1}{\sqrt{2}}(|10\rangle-|01\rangle)$?
"
"['quantum-gate', 'partial-trace']"," Title: Partial trace and SWAP in the basis of subsystemsBody: I'm trying to derive equation $(1)$ on p.2 in Lloyd et al, 2013 which reads
$$
\text{Tr}_A\left[\exp(-i\theta S_{AB}) (\rho_A \otimes \sigma_B) \exp(i\theta S_{AB}) \right] = (\cos^2 \theta) \sigma_B + (\sin^2 \theta) \rho_B - i \sin \theta [\rho_B, \sigma_B]
$$
where $S_{AB}$ is a swap operator for the two systems. My approach so far is to write the operator as
$$
\exp(i\theta S_{AB}) = \begin{pmatrix}
e^{i\theta} & 0 & 0 & 0 \\
0 & \cos \theta & i \sin\theta & 0 \\
0 & i \sin \theta & \cos \theta & 0 \\
0 & 0 & 0 & e^{i\theta}
\end{pmatrix}
\begin{matrix}
\leftarrow\rho_A \otimes \rho_B \\ \leftarrow\rho_A \otimes \sigma_B\\ \leftarrow\sigma_A \otimes \rho_B \\ \leftarrow\sigma_A\otimes \sigma_B
\end{matrix}
$$
where the labels describe how each input is affected by this operation if the possible state configurations are represented as a column vector, e.g. $\rho\otimes \sigma \sim \hat{e}_1$ would become $\cos\theta (\rho\otimes \sigma) + \sin \theta (\sigma \otimes \rho) \sim \cos\theta \hat{e}_1 + \sin \theta \hat{e}_2$.
However, I haven't been able to carry out the calculation since I'm unsure how to apply the operator or partial trace on $(\rho\otimes \sigma)$ when I set up operators like this. Is there anything pathological about this representation of a SWAP, and if so what is the right approach to deriving the above equation?
"
"['grovers-algorithm', 'resource-request', 'simulation', 'phase-estimation']"," Title: Simulating QPE + Grover using Low-Rank Stabilizer DecompositionBody: I want to simulate a 40-45 Qubit circuit that applies Grover + QPE.
I've tried running a simulation on qiskit but can't really go past 18 qubits on my machine. As an alternative, I've been reading Bravyi's work using a technique called Low-Rank Stabilizer decomposition, but I am confused as to where to start or how to translate everything into workable code.
Could you recommend me any references which could help me understand Bravyi's work (or maybe some implemented code)?
"
"['quantum-state', 'entanglement', 'density-matrix', 'linear-algebra', 'partial-transpose']"," Title: How can one argue that the partial transpose $\rho^{T_B}$ of a general separable state is positive?Body: How can one argue that the partial transpose $\rho^{T_B}$ of a general separable state is positive?
"
"['mathematics', 'textbook-and-exercises', 'unitarity', 'projection-operator']"," Title: Find the unitary implementing the transformation $|0\rangle\to\frac1{\sqrt2}(|0\rangle+|1\rangle),|1\rangle\to\frac1{\sqrt2}(|0\rangle-|1\rangle)$Body: I have found a question for finding the Unitary operator for the following transformation:
I found the solution as well. But I didn't understand how they got the solution!
"
"['programming', 'quantum-gate', 'qiskit']"," Title: Generic CNOT gate in qiskit from tensor productBody: I would like to use qiskit to verify for generalized CNOT gates that, e.g. for 4 qubits
\begin{equation}
\text{cu(0,3)} = |0\rangle\langle 0|\otimes1\!\!1\otimes1\!\!1\otimes1\!\!1 + |1\rangle\langle 1|\otimes1\!\!1\otimes1\!\!1\otimes\sigma_x
\end{equation}
with control on qubit 0 and target on qubit 3, and in particular showing that the matrix representation is the same. While I know that a way to do that in a qiskit circuit is
test_cu = QuantumCircuit(n*2, n)
test_cu.cx(0,3)
backend_un = Aer.get_backend('unitary_simulator')
unitary = execute(test_cu, backend_un).result().get_unitary()
array_to_latex(unitary, pretext="\\text{Circuit = } ")
test_cu.draw()
I don't have any idea on how to make the same from basic operators and using tensor product. I've read that Aqua provides methods for this purpose, but I have nit found anything satisfying on the topic, neither in the official documentation (section tutorial). Thanks in advance.
"
"['programming', 'qiskit', 'ibm']"," Title: processing between sequential executionsBody: Regarding real quantum computers of IBM, can one execute a circuit that contains measurements and afterwards get counts and then, based on the results of measurements (from counts), decide if to build circuit A or circuit B that will be executed on the same quantum register with init_qubits=False and with use of rep_delay parameter, so that the chosen circuit, A or B will run on the quantum register with output state of the first circuit?
"
"['quantum-gate', 'universal-gates', 'solovay-kitaev-algorithm']"," Title: Fowler Distance in Solovay-Kitaev AlgorithmBody: I have been using this code to implement the Solovay-Kitaev algorithm for approximating arbitrary single qubit gates. One measure of success it gives is the 'Fowler distance'. I cant find a definition for the Fowler distance anywhere, and am wondering how it relates to the approximation error 'epsilon' used in proofs of the SK theorem (such as in Appendix 3 of Nielsen&Chuang). Thanks for any help.
"
"['quantum-state', 'measurement', 'decoherence', 'interpretations']"," Title: Do the Heisenberg uncertainty principle and quantum decoherence relate in some way?Body: Up until now I assumed (in simple words) that a qubit collapses because of the heisenberg uncertainty principle, meaning that we can not measure a qubit without changing it state.
But now I've read about the concept of quantum decoherence that describes why a qubit collapses after measuring it.
So my question is do the heisenberg uncertainty principle and quantum decoherence relate in some way?
If so, is my assumption about the heisenberg uncertainty principle right, or is it much more complex?
"
"['programming', 'qiskit']"," Title: Can I adjust the quantum circuit after transpiling it?Body: I have a list of quantum circuits called all_circuits. I tried to run those circuits on a quantum computer by submitting the jobs to the IBM job manager:
from qiskit.compiler import transpile, assemble
from qiskit.providers.ibmq.managed import IBMQJobManager
for i in range(len(all_circuits)): # Submit a single job, and transpile everything just once.
all_circuits[i] = transpile(all_circuits[i],backend=backend)
I'm wondering after transpiling the whole list of circuit, is it still possible for me to modify an element in the transpiled list, like adding a gate at a particular place?
For instance, if each circuit in my list have the following elements (I'm not so sure if this is a good example haha):
qc = QuantumCircuit(3,3)
qc.H(0)
qc.crx(a,2,1) # Suppose a is some random parameter
***Here!***
qc.barrier()
qc.H([1,2])
qc.cx(1,3)
qc.measure(...)
I don't think that transpiling a circuit will mix the gates on the two sides of the barrier (the barrier will also be kept), so can I transpile all circuits first, then add a CNOT gate qc.cx(0,2) right before the barrier (marked as 'Here!') to each transpiled circuit, not original one ? Thanks!!
"
"['entanglement', 'grovers-algorithm']"," Title: Do states get entangled in Grover’s algorithm?Body: I am new to QC and right now trying to understand Grover’s algorithm. In Qiskit documents, in the section about solving Sudoku using Grover’s, the first step is explained to be creating three register: $|x\rangle$ $|c\rangle$ and $|out\rangle$
The next step is to initialize $|x\rangle$ by $H|0\rangle$. I get up to here.
Then we apply controlled Not gates to flip the $|c\rangle$ (clause) registers. Here I am stuck because I thought doing a CNOT on $|0+\rangle$ leads to entangled states.
The Qiskit document is here:
https://qiskit.org/textbook/ch-algorithms/grover.html
Do the states really get entangled and if so how can the rest of the circuit work whilst considering the individual qubits?
"
"['programming', 'qiskit', 'circuit-construction', 'solovay-kitaev-algorithm']"," Title: How can I find a Clifford+T approximation of an arbitrary one qubit gate in Qiskit?Body: I know the Solovay-Kitaev algorithm can achieve this. Is there an implementation of this or any other algorithm for the same task in Qiskit? Or perhaps some other library that interfaces well with Qiskit?
"
"['programming', 'qiskit']"," Title: Qiskit CircuitStateFn.eval() on more than 16 qubitsBody: The definition of Qiskit CircuitStateFn.eval() is as follows:
def eval(self,
front: Union[str, dict, np.ndarray,
OperatorBase] = None) -> Union[OperatorBase, float, complex]:
if not self.is_measurement and isinstance(front, OperatorBase):
raise ValueError(
'Cannot compute overlap with StateFn or Operator if not Measurement. Try taking '
'sf.adjoint() first to convert to measurement.')
# pylint: disable=import-outside-toplevel
from ..list_ops.list_op import ListOp
from ..primitive_ops.pauli_op import PauliOp
from ..primitive_ops.matrix_op import MatrixOp
from ..primitive_ops.circuit_op import CircuitOp
if isinstance(front, ListOp) and front.distributive:
return front.combo_fn([self.eval(front.coeff * front_elem)
for front_elem in front.oplist])
# Composable with circuit
if isinstance(front, (PauliOp, CircuitOp, MatrixOp, CircuitStateFn)):
new_front = self.compose(front)
return new_front.eval()
return self.to_matrix_op().eval(front)
In the last line to_matrix_op() is called without any arguments. However, in order to work properly for more than 16 qubits, it has to be provided with an additional argument massive = True:
def to_matrix(self, massive: bool = False) -> np.ndarray:
if self.num_qubits > 16 and not massive:
raise ValueError(
'to_vector will return an exponentially large vector, in this case {0} elements.'
' Set massive=True if you want to proceed.'.format(2 ** self.num_qubits))
So how do I use CircuitStateFn.eval() for more than 16 qubits??
"
"['tomography', 'quantum-process-tomography']"," Title: What is quantum tomography useful for?Body: First time poster and just started with quantum computing for my master thesis, so I'm sorry if the question seems obvious.
I understand that the tomography is used to reconstruct the state and/or process of a quantum circuit, without directly measuring the used qubits but instead using many 'copies' of it. What we then get is the quantum state as a density matrix or the quantum process in e.g. choi matrix representation.
But isn't this process of tomography way too costly to really make use of it?
If I understand it correctly, we could use this choi matrix representation to replace our circuit process, but does it improve something?
And can we use the state tomography for anything else than verification/error mitigation?
"
"['quantum-gate', 'simulation', 'adiabatic-model']"," Title: Types of Quantum ComputerBody: I am confused of all that different Quantum computers.
please correct me if I say something wrong.
There are two main different types of quantum computing:
- Quantum Gates based computing
- quantum annealing
For quantum gate based computing, I know that there are different kind of architectures -- that's clear for me.
But why I am so confused is, there is the Quantum Annealing, which is used by D-Wave Systems and that Q. annealer is using the adiabatic theorem , right ?
So then we can say that Adiabatic Quantum Annealer = Quantum Annealer ?
The next confusing term is Adiabatic Quantum Computer , is that Adiabatic Quantum Annealer?
And the last is what is Quantum Simulator ? Where is that used ? which type of quantum computing are that simulated? And is there a difference between them and quantum annealing ?
Too many questions :/
"
"['quantum-gate', 'universal-gates', 'solovay-kitaev-algorithm']"," Title: Error Propagation in quantum gatesBody: When decomposing an arbitrary SU(2) matrix into elements from a universal gate set (i.e. with the Solovay-Kitaev Theorem) we try to get the lowest error possible, which leads to 'chains' of these elementary gates becoming very long.
E.g. some arbitrary SU(2) might be approximated with the decomposition THTSHTHTHT (this is just a random sequence from the {H,T,S} universal gate set that I have typed).
But when we implement this chain in a physical quantum computer each gate will have a non-zero error associated with it. This means a longer chain length both reduces the total error (through higher precision estimation) and increases it (through each gate in the chain contributing to the total error).
My question is: how can the error propagation of the chain length be calculated. For example if all gates have a fidelity of 99.99%, is the total error of a chain of length 10 just 0.9999^(10)? I have been told that the worst case scenario would be to add the errors of each gate linearly, but I am confused to how this works.
I am trying to optimise the chain length to reduce the total error (balancing the longer chain length leading to a more precise approximation, and the longer chain length increasing error through imperfect gates in the chain).
Thanks for any help and sorry if the wording of the question is poor.
"
"['programming', 'q#']"," Title: Accessing tuple data in Q#Body: I am continuing my work on the SAT katas, but I thing I am missing something on the way the tuple data type works. In this example code, I am trying to access the data in a tuple type :
let clause = [(0, false), (1, true)];
using (testRegister = qubit[2]) {
for i in clause {
if i[1] == false {
X(testRegister[i[0]]);
}
}
}
Executing this code will return the error : error QS5004: The type (Int, Bool) does not provide item access. Items can only be accessed for values of array type. I have trouble understanding this error as it states that the tuple's different values cannot be accessed, or am I not doing it the correct way ? I am definitely not trying to modify these !
"
"['programming', 'optimization', 'qaoa']"," Title: Solving higher-order (unconstrained) binary optimization problems with QAOA without quadratizationBody: I am aware that it's possible to use QAOA to solve QUBO problems. However, I've recently seen some sources mentioning the possibility of solving HOBO/HUBO problems using QAOA as well [1][3].
While I understand that quadratization from HOBO/HUBO to QUBO could be done [1][2], I'm trying to understand if it's actually possible to solve problems with higher-order polynomials using QAOA without quadratizing them. Unfortunately, I haven't been able to find too many sources discussing this subject.
[1] Adam Glos, Aleksandra Krawiec, Zoltán Zimborás, "Space-efficient binary optimization for variational computing"
[2] Avradip Mandal, Arnab Roy, Sarvagya Upadhyay, Hayato Ushijima-Mwesigwa, "Compressed Quadratization of Higher Order Binary Optimization Problems"
[3] Yuichiro Minato, "Variational Quantum Factoring using QAOA and VQE on Blueqat"
"
"['quantum-gate', 'qiskit', 'phase-estimation']"," Title: How to perform a phase operator on register that contains two or more qubits?Body: My problem is easy to understand, just how to calculate the matrix of phase operator(or phase gate) acts on multi-qubits so that i can perfrom it in quantum circuit on IBM Quantum Experience
just like the controlled-U gate in phase estimation:
for example:
$$U(y)|φ\rangle=\exp(2πiy)|φ\rangle$$
where $|φ\rangle$ is a two- or three-qubit register.
"
"['error-correction', 'textbook-and-exercises']"," Title: 5 qubit codewords definition in terms of operators: MerminBody: Book: Quantum computer science by David Mermin
Chapter:5
Page-118
The 5-Qbit codewords are most clearly and usefully defined in terms of
the $M_{i}$ (rather than writing out their lengthy explicit expansions in
computational-basis states):
\begin{aligned}| \overline{0}\rangle =\dfrac{1}{4}\left( 1+M_{0}\right) \left( 1+M_{1}\right)
\left( 1+M_{2}\right) \left( 1+M_{3}\right)
| 00000\rangle \\
\end{aligned}
This is how the operators to project the state to the eigenspace with
Eigenvalues +1 or - 1.But then what is this denoting?.
When I say that, what is this denoting, I mean to ask what exactly is happening in terms of error detection and then correction.
After asking this question, I have realized that whole point of denoting that 5 qubit codeword can be realized by this expression is too much.I think this equation just proves the point that the state all zeros can be thought as an eigenstate of this operator.
Correct me if I am wrong. (if my understanding is wrong)
But then what’s the point? Yes now all the error is having different eigen value based on the individual operator which gives us the error syndromes but how do we find this magical operators in the first place?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Handle Qiskit Exception while Loading IBMQ Account using StreamlitBody: I'm trying to build a simple web app for generating random numbers using IBMQ (Qiskit) and Streamlit. However, if there is no IBMQ saved account it should wait for the user to enter the API token and if the token is valid then proceed further and load IBMQ backends.
Below is the code which I have written:
filename.py
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 31 01:30:00 2021
@author: ShadabHussain
"""
import warnings
warnings.filterwarnings("ignore")
import requests
import streamlit as st
# IBMQ
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, IBMQ
from qiskit.tools.monitor import job_monitor
st.set_page_config(page_title='QRNG', page_icon=None, layout='centered', initial_sidebar_state='auto')
st.markdown("<h1 style='text-align: center; color: black;'>Quantum Random Number Generator</h1>", unsafe_allow_html=True)
quantum_computer = st.sidebar.selectbox("Select Quantum Computer Type", ['IBMQ'])
subheader = "using "+ quantum_computer
st.markdown(f"<h1 style='text-align: center; color: black;'>{subheader}</h1>", unsafe_allow_html=True)
def about(quantum_computer):
if quantum_computer == "IBMQ":
text = "Qiskit is an open source SDK for working with quantum computers at the level of pulses, circuits and application modules. It accelerates the development of quantum applications by providing the complete set of tools needed for interacting with quantum systems and simulators."
link = 'https://qiskit.org/'
link_text = 'For Qiskit Documentation'
st.markdown(f"<body style='text-align: center; color: black;'>{text}</body>", unsafe_allow_html=True)
st.markdown(f"<h4 align='center'> <a href={link}>{link_text}</a> </h4>", unsafe_allow_html=True)
about(quantum_computer)
def ibmq_qrng(minimum, maximum):
q = QuantumRegister(num_q, 'q')
c = ClassicalRegister(num_q, 'c')
circuit = QuantumCircuit(q, c)
circuit.h(q) # Applies hadamard gate to all qubits
circuit.measure(q, c) # Measures all qubits
job = execute(circuit, backend, shots=1)
counts = job.result().get_counts()
result = int(counts.most_frequent(), 2)
result1 = minimum + result % (maximum+1 - minimum)
return result1
if quantum_computer == "IBMQ":
api_key = None
try:
IBMQ.load_account()
except Exception as e:
api_key = st.sidebar.text_input("Enter IBMQ API Key")
if api_key != None:
IBMQ.save_account(api_key, overwrite=True)
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
device = st.sidebar.selectbox("Select Quantum Device", [str(each) for each in provider.backends()])
backend = provider.get_backend(device)
if device == "ibmq_qasm_simulator":
num_q = 32
else:
num_q = 5
minimum = st.sidebar.number_input("Minimum Random Number", value=0)
maximum = st.sidebar.number_input("Maximum Random Number", min_value=minimum+1, value=minimum+1)
num_rand_numbers = st.sidebar.number_input("Number of Random Numbers to be Generated", min_value=1, value=1)
def display_result(result1):
if 'result1' in locals():
st.markdown(f"<h2 style='text-align: center; color: black;'>Sampling {num_rand_numbers} random number between {minimum} and {maximum}: {result1}</h2>", unsafe_allow_html=True)
if st.sidebar.button("Generate Random Number"):
if num_rand_numbers <1:
st.markdown(f"<h3 style='text-align: center; color: black;'>Please enter number of random numbers to be generated 1 or greater then 1</h3>", unsafe_allow_html=True)
else:
if quantum_computer == "IBMQ":
if num_rand_numbers==1:
result1 = ibmq_qrng(minimum, maximum)
else:
result1 = []
for i in range(num_rand_numbers):
result1.append(ibmq_qrng(minimum, maximum))
display_result(result1)
else:
st.markdown(f"<h3 style='text-align: center; color: black;'>Click on 'Generate Random Number' button</h3>", unsafe_allow_html=True)
For running the above code you should have IBMQ API token (https://quantum-computing.ibm.com/account) and python installed on your system with the below dependencies:
pip install qiskit streamlit
Command to run the code:
streamlit run filename.py
When I'm running the app, I'm getting the following error:
Is there any better way of exception handling for qiskit and streamlit?
"
"['quantum-state', 'circuit-construction', 'quantum-circuit']"," Title: Parametric circuit to prepare the most general single-qubit stateBody: I am highly confused with this statement and spent a lot of time understanding it.
"
"['entanglement', 'error-correction', 'fidelity', 'scalability']"," Title: How to limit the error probability in large scale quantum computersBody: I am quite stumped by the fact that the roadmaps for quantum computers as given by IBM, Google, IonQ, etc. seem to imply a linear/exponential growth in the size of their quantum computers.
Naively, I would assume that bigger systems are much harder to engineer, especially if one wanted to be able to entangle all of their bits, because only the undisturbed outcome is correct. Given a fidelity where $P[0_i] = x$ means no error occurs on bit $i$ with probability $x$, it would seem to me that an entangled system of size $n$ would have probability $P[0_1, ..., 0_n] = x^n$. The probability of error grows exponentially, if $x < 1.0$, which is of course true for all practical systems.
ECCs mitigate this to some extent, but also just by a polynomial factor and require even more bits. It looks like building large systems of the same fidelity becomes exponentially harder, and just scaling an existing design will result in a system with exponentially lower fidelity. Most interesting algorithmic building blocks, like the QFT, require entanglement between all of the involved bits. More bits without the ability to produce larger entangled states seem to have a limited advantage, because it would be practically equivalent to using two computers or executing in sequences.
Optimism about improvements in basic gate fidelity and error correction aside, is there anything I am missing about errors in entangled states that gives rise to these predictions? To state this more precisely, is there any theoretical effect or algorithm that can be exploited to limit the error probability in entangled systems to be polynomial or at least subexponential in the size of the system?
"
"['programming', 'qiskit']"," Title: Can I 'shuffle' the qubits in my circuit?Body: If I have such a quantum circuit:
quanc = QuantumCircuit(5)
quanc.crz(np.pi,1,0)
quanc.cx(1,[i for i in range(2,5)])
Can I 'shuffle' the quantum circuit, such that the qubits [0,1,2,3,4] are mapped to [4,2,3,0,1]? I know in principle I could directly define my circuit in that order, but I'm still wondering if I could first define it like the original code and then 'shuffle' the qubits with those mapping rules? Thanks a lot:)
"
"['circuit-construction', 'hamiltonian-simulation']"," Title: Is there a systematic way how to generate the Hamiltonian from a given circuit?Body: If I have a designed circuit to solve a particular problem. Is there a systematic way how to generate the Hamiltonian from it?
"
"['textbook-and-exercises', 'density-matrix', 'partial-transpose']"," Title: Is there an easy way to calculate the eigenvalues of the partial transpose of a given matrix?Body: Consider the state
$$|\psi\rangle=(\cos\theta_A|0\rangle+\sin\theta_A|1\rangle)\otimes(\cos\theta_B|0\rangle+e^{i\phi_B}\sin\theta_B|1\rangle).$$
To calculate the $\rho^{T_B}$ I first calculate the $\rho$ and the change it into a matrix form but It was very complicated to compute the eigenvalues for that matrix.
Is there any easy way to calculate the eigenvalues of $\rho^{T_B}$?
"
"['programming', 'qiskit']"," Title: What are the differences between IBMQJobManager and Qiskit aqua QuantumInstance?Body: I have been using the Qiskit aqua QuantumInstance for a while, and have recently discovered the IBMQJobManager class and the two seem to be quite similar. Are there differences between them? Will they be consolidated together in the future?
"
"['quantum-state', 'quantum-operation', 'classical-quantum']"," Title: What is the general form of a classical-quantum state?Body: In the literature, one comes across the following situation: Alice holds two registers $X$ and $A$ and it is given that $X$ is a classical register.
What is the most general way to write down Alice's state? Is it just $\sigma_{XA} = \sum_i p_i \vert i\rangle\langle i\vert_X \otimes\rho^i_A$, with each $\rho^i_A$ being a quantum state (positive semi-definite and trace one matrix)?
Sorry that this is a yes/no question because if yes, then there is not much to add. But if not, what would be the most general way to write Alice's state?
"
"['quantum-state', 'algorithm', 'grovers-algorithm']"," Title: In Grover's algorithm, how does the function know what element is to be searched for?Body: In grover's algorithm the oracle gives the output 1 if the element we want is there, my question is, how does the function know what element is to be searched for or how do you put in the element you want to teach for specifically to the oracle?
In simple words, we manually design the oracle for the input we want it to search right?
"
"['programming', 'qiskit', 'ibm-q-experience', 'openpulse']"," Title: IBMQ - Total samples exceeds the maximum number of samples for channel [8002]Body: I'm trying to run some pulse schedules on ibmq_bogota but I'm running into this error:
There are 99 "circuits"/pulse schedules in this job. When I try to queue just a subset of 98 schedules^ instead, I get
Total samples exceeds the maximum number of samples for channel CR1_0. (413168 > 258144) [8002]
So it seems like this might be a problem with having too many circuits in one job.
My questions are: what is a 'sample' in a channel, what is channel CR1_0, how can I calculate how many samples is in my job, and where can I find the maximum 258144 number for this backend.
The max_experiments of this backend is
>>> backend.configuration().max_experiments
900
and max_shots is
>>> backend.configuration().max_shots
8192
Thanks.
Using IBMQJobManager does not work either, but at least I can set max_experiments_per_job to some very low bound so that all the jobs will execute.
One of my pulse schedules:
The others are basically the same with different initial u1 pulse duration.
^I've tried queuing a single pulse schedule with the longest u1 pulse duration and that was successful, so I guess it's not related to how long each individual pulse schedule is.
"
"['programming', 'quantum-gate']"," Title: Implementation of the ""Quantum Verification of Matrix Products"" algorithmBody: I would like to implement a Quantum Verification of Matrix Products, using Ambainis OR Burhman algorithm but I don't know how to start. There isn't much documentation about it, and no circuit in the paper.
If someone has any advice on how to start it would be pretty helpful.
"
"['programming', 'qiskit']"," Title: Calculating exact expectation values on ibmq_qasm_simulatorBody: In order to calculate the exact expectation value of a Pauli operator in some state using local qasm_simulator, I do
psi = qiskit.aqua.operators.state_fns.CircuitStateFn( circuit )
expect = psi.adjoint().compose( weighted_pauli.to_opflow() ).compose( psi ).eval().real
I would like to run this calculation using ibmq_quantum_simulator. In all the examples I found online (see e.g. this one), ibmq_quantum_simulator is used to simulate sampling with some number of shots. How do I use it with shots = None, similarly to the code above?
"
"['entanglement', 'entanglement-swapping']"," Title: Clarification of a theorem mentioned in a paper on REDBody: I am reading a paper "A study of Teleportation and Super Dense Coding capacity in Remote Entangled Distribution" (arXiv:1210.1312). In this paper Relations on two-qubit pure states are mentioned.
Consider a resource entangled in 2 $\otimes $ 2 dimensions. These states are given by
$| {\psi_{12}} \rangle $ = $\sum_{i, j}a_{ij} |ij \rangle $ and
$| {\psi_{23}} \rangle $ = $\sum_{p, q}b_{pq} |pq \rangle $
where $\sum_{i, j}a_{ij}^2 = 1 $, $\sum_{p, q}b_{pq}^2 = 1 $
Alice and Bob share a pure entangled state $| {\psi_{12}} \rangle $ between them, Bob and Charlie also share another entangled state $| {\psi_{23}} \rangle $.
In order to swap the entanglement, Bob carries out measurement on his qubits. Bob carries out measurement for his two qubits in a non-maximally Bell-type entangled basis given by the basis vectors
$| \phi_{G}^{rh} \rangle $ = $\frac{1}{\sqrt{B_{rh}}} (\sum_{t =0}^{1}e^{I\pi rtR_{t}^{rh}}|t\rangle|t\oplus h\rangle) $
Now according to general measurements done by Bob on his qubits, we have four possible states between Alice and Charlie’s locations respectively. These four possible states based on Bob’s measurement outcomes are
$|\chi^{rh} \rangle$ = $\frac{1}{\sqrt{M_{rh}}} \sum_{i, q=0}^1 (\sum_{j=0}^1 e^{-I\pi rj}R^{rh}_{j}a_{ij}b_{j\oplus h, q})|iq\rangle$
where
$M_{rh}$ = $\sum_{i, q=0}^1 (\sum_{j=0}^1 e^{-I\pi rj}R^{rh}_{j}a_{ij}b_{j\oplus h, q})^2$
I was unable to understand how 𝑀𝑟ℎ resolves to a value when I take (r, h) as (0, 0)?
"
"['mathematics', 'textbook-and-exercises', 'linear-algebra']"," Title: Is there a simplified formula for the adjoint of the outer product of ket and bra?Body: I was reading about measurements and got to some operator like this:
$$\left| 0\rangle \langle 0\right|
$$
Is there any form I can apply when I have to calculate
$$ \left( \left| 0\rangle \langle 0\right| \right) ^{+} $$
How can I simplify these expressions?
My work:
$$\left( \left| 0\rangle \langle 0\right| \right) ^{+}=\langle 0\left| ^{+}\right| 0\rangle ^{+}$$
Is this the way?
"
"['quantum-operation', 'povm']"," Title: What additional conditions are there to make POVM measurement same as projective measurement?Body: We know that POVMs are applied in the more general cases where the system is not necessarily closed. So mathematically, how does going from open to closed system change the scenario in case of POVM so that it becomes a projective measurement?
"
"['hhl-algorithm', 'linear-algebra']"," Title: Why does solving linear systems of equations with HHL return imaginary numbers?Body: The textbook shows an example system of linear equations $Ax=b$ with
$$
A=\begin{pmatrix}
-\frac{1}{3} & 1 \\
1 & -\frac{1}{3}
\end{pmatrix} \,\,\,\,
b=\begin{pmatrix}
0 \\
1
\end{pmatrix}.
$$
The program in the text shows a result in real numbers. When trying to run a larger $A$ matrix and $b$ matrix, the output includes complex numbers even though the actual answer (calculated using numpy linear equation solver) shows no complex numbers. Where are these imaginary numbers coming from?
"
['measurement']," Title: How do we find out the measurement operators $M_{m}$ which gives us the desired measurement results?Body: From one of the postulates we know we can represent any system with a state space. I am considering, that if I do this I will sensibly assign different vectors to different entities of my system. But now how do I find these measurement operators?$$M_{m}$$ which are used to measure the system and the outcome is $m$.
"
['surface-code']," Title: What is a ""temporal"" or ""timelike"" logical error in the surface code?Body: When studying the surface code with phenomenological or circuit noise, the syndrome measurement is noisy, and therefore one has to repeat the syndrome measurement for several rounds before decoding. In all literature about surface code, people repeat the measurement for $d$ rounds, where $d$ is code distance. But why is that?
There are several reasons for why $\Theta(d)$ rounds are necessary and sufficient, and the one which baffles me is due to "temporal" or "timelike" logical error. Specifically, one can imagine a 3D space-time "syndrome graph" or "decoder graph", where time goes upwards. A "temporal" or "timelike" logical error is a path that links the bottom boundary with the top boundary.
I find it difficult to appreciate the consequence of such error, either in a lattice surgery circuit, or in an identity circuit without computation. I guess my issue is that I tend to project such bottom-to-top path onto the 2D spacelike plane, and then simply treat it as a spacelike error.
Specifically, I tend to focus on the post-correction residual data error $R$ and decompose it as $R=L\cdot E$, where $E$ is an operator with the same syndrome as $R$ and with minimum weight, and $L$ is a logical operator. I care about two probabilities:
- $p$: the probability that $L$ is nontrivial,
- $q$: conditioned that $L$ is trivial, the probability of $E$.
I understand that $p$ and $q$ both depend on the number of measurement rounds. But I don't see why $\Theta(d)$ is necessary and sufficient for (a) $\lim_{d\rightarrow\infty}p=0$, or (b) $q$ decays exponentially with $|E|$. (Assume iid circuit noise.)
Can anyone elaborate why a bottom-to-top path is an issue, either in a lattice surgery circuit, or in an identity circuit without computation?
"
"['programming', 'qiskit', 'ibm-q-experience', 'transpile']"," Title: Transpiler fails after 1000 iterationsBody: I'm transpiling a set of quantum circuits using ibmq_5_yorktown. However, as the number of circuits gets larger, it shows me the following error message:
TranspilerError: 'Maximum iteration reached. max_iteration=1000'
How can I fix this issue? Is it still possible for me to transpile more than 1,000 circuits? Thanks!
"
"['quantum-state', 'classical-computing', 'quantum-parallelism']"," Title: How do qubits in quantum computers work?Body: I was reading about quantum computers and qubits. While a classical bit can be either 0 or 1, a qubit can be 0 or 1 or both at the same time (can it be none too?). But how is this useful at all?
If it is 0 and 1 at same time then this isn't helpful at all because I need exact value.
"
"['quantum-gate', 'qiskit', 'quantum-state', 'circuit-construction', 'quantum-circuit']"," Title: How can I create an ADD gate for two quantum states?Body: I want to create an ADD gate like this:
in qiskit using elementary gates.
Can it be done?
"
"['qiskit', 'algorithm', 'error-correction', 'phase-estimation']"," Title: How to implement Majority VoteBody: I am trying to boost the success probability of standard phase estimation by repeating the procedure enough times and taking a majority vote that will be encoded in a quantum register.
My problem is I don't know how to implement a majority vote.
For 3 qubits $a$, $b$ and $c$ taken in $\{|0\rangle, |1\rangle \}$ the majority vote circuit returns $MV(a, b, c)$ and can be implemented as follows:
For example, if $a$, $b$ and $c$ are all in state $|0\rangle$ or if $b$ or $c$ are in state $|1\rangle$ then nothing happens and $MV(a, b, c) = a$. If $b$ and $c$ are in $|1\rangle$, the CCNOT gate flips $a$.
If $a$, $b$ and $c$ are in state $|+\rangle$, then $MV(a, b, c) = |+\rangle$ and we have 50% probability for each outcome.
How can we generalize this circuit to 5 qubits and higher ?
(My motivation is to implement this)
"
"['programming', 'qiskit', 'qaoa']"," Title: Qiskit: Taking a QUBO matrix into `qubit_op'Body: I'm trying to solve the maximum independent set problem using Qiskit and the QAOA.
I've a nice QUBO Matrix for this simple path graph:
as so:
My question is, how do I convert this into a general DOCPLEX method which can be put into the QuadracticProgram method of Qiskit? How can this be done for a general QUBO matrix?
I realise that for this particular problem I've found the matrix $Q$ as described in this [guide].(https://arxiv.org/ftp/arxiv/papers/1811/1811.11538.pdf)
So by doing the matrix multiplication:
$$y=x^{t} Q x$$
where $$ x = \begin{pmatrix} x_{0} \\ x_{1} \\ x_{2} \end{pmatrix} $$
gives the expression:
$$ y = -x_{0}^{2} -x_{1}^{2} -x_{2}^{2} + 2x_{0}x_{1} + 2x_{1}x_{2} $$
which I want to minimise (EDIT: Changed from maximise - whoops !). As the nodes are either in the maximum set or not, the variables are binary and so $ x_{0}= x_{0}^{2}$ (NB am I correct in thinking for solving the Maximum weighted independent set problem, say where $ x_{0} $ was twice as important, the weight would manifest as a different constant for the quadractic term?)
Is a function that can take a general matrix into DOCPLEX form qiskit can recognise and operate on?
EDIT 2:
I don't think the stable_set.get_operator() method works at all.
For the simplest example
path = nx.to_numpy_array(nx.path_graph(3))
qubitOp, offset = stable_set.get_operator(path)
print('Offset:', offset)
print('Ising Hamiltonian:')
print(qubitOp.print_details())
gives:
which is not the correct function - the weights of the different nodes are not equal - and so has no hope of finding the right result.
EDIT 3: After a little bug hunt, the problem is nearly solved !
https://github.com/Qiskit/qiskit-aqua/issues/1553
"
"['algorithm', 'complexity-theory', 'phase-estimation']"," Title: How do I calculate the number of uses of a unitary $U$ in iterative phase estimation?Body: How would one go along to calculate the number of uses of an unitary $U$ in Iterative Phase Estimation (IPE) to compare it to the number of uses of $U$ in standard Phase Estimation (Qiskit QPE)?
"
"['qiskit', 'algorithm', 'mathematics', 'qaoa']"," Title: Will there be any difference in solution for a weighted and unweighted graph? I mean is there any relation between weight and solution?Body: I was working on max-cut problem. To do I have been given a graph of unweighted version, and I have to convert it into weighted version. I did it using qiskit. Now I was playing around the code, hence I have been assigning some arbitrary weight value to the edges. Then I found some confusing results. The more I am changing, the more I am unable to decode what is going on?
Lets elaborate, imagine this is my unweighted version graph (it is taken from qiskit textbook), in this graph weight is 1. so whenever I am changing the value of weight from 1 to 3,4,5 etc. I am not getting the desired solution {11011} or {00100}.
"
"['density-matrix', 'probability', 'povm']"," Title: How to express a probability distribution $P(x,y,z)= \sum_\lambda P(x|y,\lambda)P(y|\lambda,z)P(z)P(\lambda)$ in terms of a trace of a density matrix?Body: I have been given and expression for a probability distribution
$$P(x,y,z)= \sum_\lambda P(x|y,\lambda)P(y|\lambda,z)P(z)P(\lambda)$$
and I have been asked to show that the above expression can be written in the form
$$P(x,y,z)= Tr(\rho_{AB}(E_A^{x|y} \otimes E_B^{y|z}))P(z)$$
for $\rho_{AB}$ a density matrix and $E_A^{x|y}, E_B^{y|z}$ POVMs on system AB.
I have no clue of even how the trace comes into picture. I have no clue as to how the first expression can be simplified to get a trace, let alone getting the whole expression correctly.
Cross-posted on math.SE
The answer over there is also interesting to look at......
"
"['quantum-state', 'quantum-operation', 'fidelity']"," Title: How to calculate the average fidelity of an amplitude damping channelBody: An answer to this question shows how to calculate the average fidelity of a depolarizing channel. How would one go about calculating this for an amplitude dampening channel? I tried working out the math myself but had no luck. The tricks used in the previous answer can't be applied in this new scenario it seems...
"
"['algorithm', 'grovers-algorithm', 'physical-realization']"," Title: How is the Grover iteration realized in an actual quantum circuit?Body: The number of the Grover's diffuser iterations is proportional to square root of the amount of input data, but how is this realized when building a real quantum circuit? Is it simply by concatenating the needed number of diffusers one after another (in which case I assume the circuit designer is required to know the needed number of iterations beforehand)?
"
"['qiskit', 'optimization']"," Title: Vertex Cover mappings from QUBO to Ising and vice versaBody: According to paper Ising formulations of many NP problems, Vertex Cover problem has the following Ising formulation:
$$\underset{x}{\text{min }} f(x) = a\sum_{(i,j) \in E}(1-x_i)(1-x_j) + b\sum_{i \in V} x_i.$$
I'd like to share some doubts of mine.
Ising formulation has spin variables $\{+1,-1\}$, not logical variable $\{0,1\}$. Shouldn't it be considered a QUBO problem?
By considering this formulation as a QUBO problem, then I should get the Ising formulation by mapping $x_i \rightarrow \frac{1 - \text{Z}_i}{2}$ as follows:
$$H = \frac{a}{4}\sum_{(i,j) \in E}(\text{Z}_i + \text{Z}_j + \text{Z}_i\text{Z}_j) - \frac{b}{2}\sum_{i \in V}\text{Z}_i + |V|.$$
However, from qiskit library authors consider the following hamiltonian:
$$H = a\sum_{(i,j) \in E}(1-\text{X}_i)(1-\text{X}_j) +b\sum_{i \in V}\text{Z}_i.$$
which seems different from both previous formulations. Are the two hamiltonians somehow equivalent?
"
"['algorithm', 'grovers-algorithm', 'quantum-advantage', 'quantum-memory']"," Title: Q-means, QRAM and how it helps algorithmic speedupBody: I am trying to understand how QRAM will help improve algorithm performance. I am reading a paper on Q-means classification, but I have noticed that some other algorithms (Grovers) seem to have a dependence on QRAM as well
For some algorithms, does then the speed-up only come from using QRAM - that it has some property where it allows lookup of data very fast? Is this the case?
"
"['measurement', 'quantum-operation', 'povm']"," Title: Is there some notion of work associated with performing a measurement?Body: Let a measurement be described by POVM elements $M_i$ such that probability $p(i) = Tr[\rho M_i]$ for some state $\rho$. I want to know whether there is some notion of work associated with such measurements.
"
"['textbook-and-exercises', 'matrix-representation', 'pauli-gates']"," Title: Is there a different way to represent Pauli gates in X basis?Body: It's easy to see that in computational basis, Pauli matrices could be represented in the outer product form:
$$
X=|0\rangle\langle1|+|1\rangle\langle0|\\
Y=-i|0\rangle\langle1|+i|1\rangle\langle0|\\
Z=|0\rangle\langle0|-|1\rangle\langle1|
$$
If we want to represent the outer products in $X$ basis $|+\rangle$ and $|-\rangle$, one way I can think of is to use the identities
$$
|0\rangle=\frac{1}{\sqrt{2}}(|+\rangle+|-\rangle)\\
|1\rangle=\frac{1}{\sqrt{2}}(|+\rangle-|-\rangle)
$$
and plug them in the first three equations. I'm wondering is there a simpler / more direct way we can do that? Thanks!
"
"['algorithm', 'vqe']"," Title: Ansatz explanation for VQEBody: I have found quite a bit of information on the UCC ansatz, but I cannot really find basic explanations for the Ry and RyRz ansatzs... Are they just applying these gates to a circuit? If anyone has good material on this I would greatly appreciate it!
"
['phase-estimation']," Title: What is the meaning of approximating a phase to an accuracy of $2^{-n}$?Body: In quantum phase estimation we often see that approximating $\phi$ ito an accuracy of $2^{-n}$. Can anybody explain what is the meaning of that?
Does that mean after decimal we can only believe the n values? So if n=4, we can think of it as $0.1234567$ only the 4 values are correct. So we should consider $0.1234$.
I am asking this question because we face this situation when applying the phase estimation algorithm.
"
"['programming', 'qiskit', 'hamiltonian-simulation']"," Title: How can I convert exponentials of pauli matrices to circuits of this form in Qiskit?Body: For example the following circuit is for $e^{-i(Z\otimes Z\otimes Z)\Delta t} $
I know this can even be done without the ancilla qubit, having the CNOTs control the last qubit and applying an RZ on the last qubit. Also, if instead of only Zs, our Pauli matrix is any combination of $I$,$X$,$Y$ and $Z$, we can still have it in this sort of format by swapping the $X-Z$ or $Y-Z$ bases before and after the circuit shown above.
So if I have an operator like $e^{-i 0.022616399973028944 YYXX}$, in Qiskit, how I can make this into a circuit of this kind of form? I am looking for a function that does this for a general operator of this form. Is there such a function in Qiskit?
"
"['programming', 'qiskit']"," Title: Can I keep composing a series of quantum circuits into a large quantum circuit?Body: Suppose I have a series of quantum circuits, each of them has 2 qubits:
qc = QuantumCircuit(2)
qc.h(0)
qc.crz(np.pi/2,0,1)
circ_list = [...say this is a list with 10 elements, each of them has the same structure above...]
If I also have a larger quantum circuit:
qcl = QuantumCircuit(8,8)
I want to compose each of the 10 'small circuits' onto the large circuit, I think a standard method would be:
qcom = qcl.compose(circ_list[i],[2,3]) # [2,3] is a random choice
However, if I want to simultaneously compose 10 circuits, it looks like I need to repeat the argument 10 times. I'm wondering is there a simpler way I can do that? An analogy I can think of is the reduce function:
n = [4,3,2,1]
a = reduce(lambda x,y: x*y, n)
Can I do something similar to the reduce function to compose everything at once? Thanks!!
"
"['simulation', 'hamiltonian-simulation', 'trotterization', 'bosons']"," Title: Trotter error for bosons in various encodingsBody: Mapping second-quantized bosonic modes onto qubits can be done using various encodings. Each of those have their pro et contra. Fewer qubits — more gates, and vice versa. Encoding an $N$-level bosonic mode with unary mapping requires $(N+1)$ qubits, with creation and annihilation operators being represented by $N$ Pauli operators. Using binary/gray code results in using $\log_2N$ qubits, with operators containing $N^2$ Pauli terms. A good overview is given here.
Now, let us move to practical applications and do some trotterization. Unlike fermions, not only we are going to lose precision due to the finiteness of the Trotter number — an additional problem with bosons is that their operator commutation relations cannot be satisfied exactly. Unlike the former, the latter circumstance poses a serious problem even for variational methods, for it causes WF leakage out of qubit subspace representing physical states.
Consider a Fock state with just two bosonic modes $|1;0\rangle$. For $N=1,2$ it is mapped onto qubits in the following ways:
$$
\begin{array}{|l|l|l|l|l|}
\hline
& N=1 & N=1 & N=2 & N=2 \\
\hline
& \text{Binary} & \text{Unary} & \text{Binary} & \text{Unary} \\
\hline
|0;1\rangle & |01\rangle & |0110\rangle & |0010\rangle & |001010\rangle \\
\hline
|1;0\rangle & |10\rangle & |1001\rangle & |0010\rangle & |010001\rangle \\
\hline
\end{array}
$$
For the unary mapping, I'm using the convention from (23) here.
Let us start from a qubit version of the state $|0;1\rangle$, and try to create its superpostion with $|1;0\rangle$. We could do it using $U_1=\exp(i(a_1^\dagger a_2 + a_2^\dagger a_1))$ (aka time evolution) or using $U_2=\exp(a_1^\dagger a_2 - a_2^\dagger a_1)$ (aka UCC). For our purposes, it does not really matter. For definiteness, let us choose $U_2$ (this would keep amplitudes real if not Qiskit...). For $N=1$ both encodings give identical results:
$$
U_2 |01\rangle = 0.54 |01\rangle
-0.84 |10\rangle
$$
$$
U_2 |0110\rangle = 0.54 |0110\rangle
-0.84 |1001\rangle
$$
But take a look at what happens as we move to $N=2$:
$$
U_2 |0010\rangle = (0.01942407020071564-0.01942407020071514j) |0000\rangle
+ (0.3018468699435287-0.30184686994353027j) |0010\rangle
+ (-0.4175689014626733+0.4175689014626758j) |0101\rangle
+ (-0.3664436305642885+0.36644363056428975j) |0111\rangle
+ (-0.24189290092458382+0.2418929009245852j) |1000\rangle
+ (-0.017433459057134393+0.017433459057134143j) |1010\rangle
+ (0.026209883033085912-0.026209883033085773j) |1101\rangle
+ (0.20090642541053194-0.2009064254105325j) |1111\rangle
$$
$$
U_2 |001010\rangle = (-0.399515044839777-0.39951504483977407j) |001010\rangle
+ (-0.5803699021310753-0.5803699021310711j) |010001\rangle
+ (-0.02732498912217729-0.027324989122177044j) |010100\rangle
+ (0.0015213913160944605+0.0015213913160944115j) |100010\rangle
+ (0.05259767375695154+0.05259767375695122j) |111001\rangle
+ (-0.006559016720416016-0.00655901672041582j) |111100\rangle
$$
See the difference? For the unary mapping, the dominant amplitudes are those from the table, corresponding to physical states. But for the binary mapping we are in a real trouble (same happens for the Gray code).
BTW, an interesting difference between binary/gray and unary mappings is the following: in the former case, all the qubit states represent some physical states, while in the latter case this is not true. This, however, by itself does not imply that one would benefit from using binary/gray encoding.
QUESTION
What are the known approaches to dealing with this problem? While for the unary mapping, we could probably tolerate the error, it seems that in the case of binary/Gray encodings the situation is pretty sad.
One obvious suggestion would be to somehow project the outcome of trotterization onto the "physical" subspace using ancillas but I don't how practical this can be.
UPDATE
Note that the situation with time evolution and VQE is quite different. For simulating time evolution, given enough gates, we could probably choose the time step to be small enough to make errors (arising due to the wave function leakage out of the physical subspace) arbitrary small. However, for VQE we want short circuits (of order of a single time evolution step), which implies having large parameters. Therefore, ONE CANNOT EFFICIENTLY SIMULATE BOSONS USING VQE AND UNITARY COUPLED CLUSTER, where by "efficiently" I mean "in a way that may potentially lead to quantum advantage". Therefore... we have to rely on sparse VQE!
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: Condition that a tripartite/multipartite qubit state does/does not admit a Schmidt decomposition?Body: I saw answers such as this and this which provide examples of tripartite system that don't take a Schmidt decomposition, but I wonder if there's an explicit condition that can tell whether a state is or is not Schmidt decomposable. Does anyone have an idea? I know a bipartite sytem always have one, so a tripartite's condition would be enough. If you can tell me about the multipartite system it'd be even better! Thank you!
Edit: After reading the comment, I understand that tripartite system also always have Schmidt decomposition, but for each specific biparition with different Schmidt coefficients. I think my question is that what is the condition that the entire state can be written as i.e. $\alpha|000\rangle+\beta|111\rangle$? Is it neccesarily true that if those Schmidt coefficients of the 3 possible bipartitions are the same, then the general state will admit a Schmidt decomposition like that? Is there a proof?
"
"['textbook-and-exercises', 'density-matrix', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Derivation of Equation $8.7$ in Nielsen ChuangBody: Equation \eqref{eq:sp1} represents the reduced state of the system after tracing over environment.(Page number 358)
$$\mathcal{E}(\rho) = \mathrm{tr}_{env}(\lbrack U(\rho \otimes \rho_{env} )U^{\dagger}\rbrack). \tag{8.6} \label{eq:sp1}$$
And then they say in page 359 that initially $\rho_{env} = |0\rangle\langle0|$ and then we apply $U$ to the combined state.(here $U$ is CNOT). The equation \eqref{eq:sp1} becomes (after plugging these values)
$$ \mathcal{E}(\rho) = P_{0}\rho P_{0} + P_{1}\rho P_{1} \tag{8.7} \label{eq:sp2}$$ where $P_{m}=|m\rangle\langle m|$.
How are they arriving at \eqref{eq:sp2}?
"
"['programming', 'qiskit']"," Title: How can I compose a list of quantum circuits onto different qubits in one command?Body: This is a follow-up question on composing the quantum circuits. Say if I have the following circuit element:
def qc1(a):
quanc1 = QuantumCircuit(2)
quanc1.x(0)
quanc1.h(1)
quanc1.crz(a,1,0)
quanc1.barrier()
return quanc1
and circ is a list that contains multiple elements:
circ = []
for i in range (3):
circ.append(qc1(np.pi+i))
Then using the reduce function, I could combine those 3 circuits and compose them into a larger quantum circuit:
from functools import reduce
qc = QuantumCircuit(5,5)
qc = reduce(lambda x,y: x.compose(y,[2,4]),circ, qc)
The code works to compose the circuits in circ onto qubit 2 and 4 of qc:
However, if I have another set of coordinates:
c = [[2,1],[2,4],[2,3]]
Is it possible for me to compose the circuits in circ onto those pairs of coordinates, separately (instead of the fixed pair [2,4])? Or is there a simpler method than using reduce? Thanks!
"
"['qiskit', 'quantum-gate', 'gate-synthesis', 'qaoa']"," Title: IBM Qiskit QAOA gate implementation questionBody: In section $5.2$ of the QAOA chapter in Qiskit textbook, section $5.2$,
state preparation uses the gate $U_{k,l}(\gamma) = e^{\frac{i \gamma}{2} (1-Z_k Z_l)}$. Later, in section $5.3$, this gate is given in terms of basic gates as $U_{k,l}(\gamma)=C_{u1}(−2 \gamma)_{k,l}u_1(\gamma)_k u_1(\gamma)_l$. Why is this the correct implementation?
"
"['programming', 'qiskit', 'hamiltonian-simulation', 'optimization']"," Title: From QUBO matrix to Ising model in QiskitBody: Given a general QUBO matrix $Q$ for a quadratic minimization problem, is there a Qiskit way to obtain the Pauli gate list or the Ising model for it? A related question is Qiskit: Taking a QUBO matrix into `qubit_op', but it seems to be about a graph related model. The solution given there is also for a particular graph metric for the stable_set.
"
"['circuit-construction', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Partial Cyclic Permutation with only Toffoli and CNOT gates?Body: I have been trying to solve this puzzle of constructing this transformation from CNOT and Toffoli gates as mentioned in NC page 193 (Ex 4.27)
Here is what I have done:
- First observation is it has 8 rows and columns, so it is showing the table for 3 qubits.
- Whenever it is not $|000\rangle$ and $|111\rangle$ it always add 1. $|001\rangle$ becomes $|010\rangle$ etc.
- I ignored the complicated part just tried to implement the easy always add 1 part.
- One observation for $|001\rangle$ to $|110\rangle$ is the LSB qubit is always flipped.
- At this point I realized I would keep one line for $|1\rangle$ and it would help me always flip a state. (let's call it qubit 4)
- Then I realize when would qubit 2 and qubit 1 change. Qubit 2 changes when qubit 3 and 4 both are 1. Qubit 1 change when qubit 2,3,4 are 1.
- Then I ran the rest of the two cases and checked what output they generated and brute forced to correct it using Toffoli gates.
Is it possible to verify if this is how the puzzle is intended to be solved or did I miss something?
(Also CCCNOT gate is a feasible gate right? or am I making things up?)
"
"['quantum-state', 'entanglement', 'tensor-product', 'partial-trace']"," Title: Does $\mathrm{tr}(A \otimes B) = \mathrm{tr} (A) \otimes \mathrm{tr}(B)$ hold for partial trace?Body: I was reading this question from this site answered by DaftWullie. I would like to request you to read the question there. The answer says
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). $$
I don't understand where this expression comes from. There shouldn't be any $\otimes$ in there, right? Can anybody derive it step by step?
Because trace is applied over $|\psi\rangle\langle\psi|$ or $|\phi_{12}\rangle|\phi_{34}\rangle\langle\phi_{34}|\langle\phi_{12}|$ or $(|\phi_{12}\rangle \otimes |\phi_{34}\rangle)( \langle\phi_{34}|\otimes \langle\phi_{12}|)$. This is matrix multiplication of $(|\phi_{12}\rangle \otimes |\phi_{34}\rangle)$ and $( \langle\phi_{34}|\otimes \langle\phi_{12}|)$.
"
"['programming', 'quantum-gate', 'qiskit', 'gate-synthesis']"," Title: How does MCPhaseGate/MCU1Gate works internally in qiskit?Body: I was curious about the implementation of MCPhase/MCU1Gate and how it works without ancilla qubits. I ended up checking the code of the some auxiliary (?) function _gray_code_chain() but I couldn't understand much of it.
update: it seems that MCU1Gate is deprecated and MCPhase will substitute it - the code is the same anyway.
"
"['quantum-state', 'quantum-advantage', 'random-quantum-circuit', 'probability', 'haar-distribution']"," Title: Quantum supremacy: shallow depth Haar random circuits and unitary designsBody: I had a confusion about shallow depth Haar random quantum circuits. In this paper, in Section B (related works), it is mentioned that Haar random quantum circuits form approximate $2$-designs only after $\mathcal{O}\left(n^{1/D}\right)$ depth, where $D$ is the spatial dimension (proved here).
What does this mean for the output distribution of Haar random quantum circuits that have constant and logarithmic depth? For every fixed string $z \in \{0, 1\}^{n}$, does every output probability $|\langle z| U |0^{n} \rangle|^{2}$ approximately follow a Porter-Thomas distribution, even for a shallow depth Haar-random $U$?
If so, what extra mileage does the $2$-design property give us?
"
"['textbook-and-exercises', 'density-matrix', 'space-complexity']"," Title: How many real numbers are required to describe density matrix for $n$ qubits?Body: (All of these coming from the topic of simulation of quantum systems) A density matrix $\rho$ Which describe state of $n$ qubits will have $2^{n} \times 2^{n}$ size. We have couple of conditions like
- $\mathrm{tr}(\rho) = 1$
- $\rho$ is positive.
Then in this case we only need to specify $\dfrac{2^{n}(2^{n}-1)}{2} $ for off-diagonal elements and for the diagonal ones we need $2^{n}-1$ Terms. So total terms required $\dfrac{2^{n}(2^{n}-1)}{2} + 2^{n}-1 $. Now each of these terms can be complex numbers. And for defining a complex number we need one real number (assuming $e^{i\theta}$ form and defining theta to a good enough approximation).
Total number of independent real numbers - $\dfrac{2^{n}(2^{n}-1)}{2} + 2^{n}-1 = 4^{n}+\dfrac{2^{n}}{2}-1$
But in Nielsen Chuang it was asked to proof
Exercise 4.46: (Exponential complexity growth of quantum systems) Let
$\rho$ be a density matrix describing the state of $n$ qubits. Show that
describing $ρ$ requires $4^{n} − 1$ independent real numbers.
Who is correct here?
"
"['programming', 'qiskit']"," Title: IBMQ.load_account() fails with ""403 Client Error""Body: I alredy save an account but when I want to laod it I get a error like this
how can I fix it ?
HTTPError Traceback (most recent call last)
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\api\session.py in request(self, method, url, bare, **kwargs)
273 response = super().request(method, final_url, headers=headers, **kwargs)
--> 274 response.raise_for_status()
275 except RequestException as ex:
~\anaconda3\lib\site-packages\requests\models.py in raise_for_status(self)
940 if http_error_msg:
--> 941 raise HTTPError(http_error_msg, response=self)
942
HTTPError: 403 Client Error: Forbidden for url: https://auth.quantum-computing.ibm.com/api/version
The above exception was the direct cause of the following exception:
RequestsApiError Traceback (most recent call last)
<ipython-input-61-beb09c0bf764> in <module>
----> 1 IBMQ.load_account()
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\ibmqfactory.py in load_account(self)
182 # Explicitly check via a server call, to allow environment auth URLs
183 # contain IBM Quantum Experience v2 URL (but not auth) slipping through.
--> 184 version_info = self._check_api_version(credentials)
185
186 # Check the URL is a valid authentication URL.
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\ibmqfactory.py in _check_api_version(credentials)
453 version_finder = VersionClient(credentials.base_url,
454 **credentials.connection_parameters())
--> 455 return version_finder.version()
456
457 def _initialize_providers(self, credentials: Credentials) -> None:
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\api\clients\version.py in version(self)
49 * ``api-*`` (str): The versions of each individual API component
50 """
---> 51 return self.client_version_finder.version()
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\api\rest\root.py in version(self)
102 """
103 url = self.get_url('version')
--> 104 response = self.session.get(url)
105
106 try:
~\anaconda3\lib\site-packages\requests\sessions.py in get(self, url, **kwargs)
541
542 kwargs.setdefault('allow_redirects', True)
--> 543 return self.request('GET', url, **kwargs)
544
545 def options(self, url, **kwargs):
~\anaconda3\lib\site-packages\qiskit\providers\ibmq\api\session.py in request(self, method, url, bare, **kwargs)
294 self._modify_chained_exception_messages(ex)
295
--> 296 raise RequestsApiError(message, status_code) from ex
297
298 return response
RequestsApiError: '403 Client Error: Forbidden for url: https://auth.quantum-computing.ibm.com/api/version. <!DOCTYPE html>\n<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->\n<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->\n<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->\n<head>\n<title>Access denied | auth.quantum-computing.ibm.com used Cloudflare to restrict access</title>\n<meta charset="UTF-8" />\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />\n<meta name="robots" content="noindex, nofollow" />\n<meta name="viewport" content="width=device-width,initial-scale=1" />\n<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" type="text/css" media="screen,projection" />\n\n\n</head>\n<body>\n <div id="cf-wrapper">\n <div class="cf-alert cf-alert-error cf-cookie-error hidden" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>\n <div id="cf-error-details" class="p-0">\n <header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-15 antialiased">\n <h1 class="inline-block md:block mr-2 md:mb-2 font-light text-60 md:text-3xl text-black-dark leading-tight">\n <span data-translate="error">Error</span>\n <span>1009</span>\n </h1>\n <span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">Ray ID: 6250695e3c814e6d •</span>\n <span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">2021-02-21 12:18:43 UTC</span>\n <h2 class="text-gray-600 leading-1.3 text-3xl lg:text-2xl font-light">Access denied</h2>\n </header>\n\n <section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">\n <div id="what-happened-section" class="w-1/2 md:w-full">\n <h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>\n <p>The owner of this website (auth.quantum-computing.ibm.com) has banned the country or region your IP address is in (IR) from accessing this website.</p>\n \n </div>\n\n \n </section>\n\n <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">\n <p class="text-13">\n <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">6250695e3c814e6d</strong></span>\n <span class="cf-footer-separator sm:hidden">•</span>\n <span class="cf-footer-item sm:block sm:mb-1"><span>Your IP</span>: 2.183.208.51</span>\n <span class="cf-footer-separator sm:hidden">•</span>\n <span class="cf-footer-item sm:block sm:mb-1"><span>Performance & security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>\n \n </p>\n</div><!-- /.error-footer -->\n\n\n </div><!-- /#cf-error-details -->\n </div><!-- /#cf-wrapper -->\n\n <script type="text/javascript">\n window._cf_translation = {};\n \n \n</script>\n\n</body>\n</html>\n'```
"
"['qiskit', 'textbook-and-exercises']"," Title: Qiskit textbook - exercise 2.2 - why doesn't the correct answer give the same statevector?Body: In the Qiskit textbook, I'm stuck on one of the exercises in section 2.2. The question is:
Write the state:
as two separate qubits.
The answer has already been covered in this question here, and is defined as:
This makes sense to me - we're basically factoring out the first qubit.
However, for my own benefit, I tried multiplying out the vectors and I get different results:
Using the original form:
Using the answer supplied:
Why don't these give the same values?
n.b. Apologies for the use of images - I only had MS Word at my disposal and couldn't find an easy way to export the equations bar screen-shotting.
"
"['complexity-theory', 'notation', 'models']"," Title: What does ""large-scale universal quantum computation"" mean?Body: I was reading this lecture notes by Sevag Gharibian. He mentioned the following statement:
Large-scale universal quantum computer can be built.
I do understand what quantum computer is, but I don't know what is 'Large-scale universal' mean here. Can someone explains to me what does it mean?
Note: I don't know which tag I should put, so let me know if you know a good tag for this question.
"
"['qiskit', 'gate-synthesis']"," Title: How to implement $\sqrt{iSWAP}$ in QiskitBody: I want to implement the $\sqrt{iSWAP}$ operator using simple operations in Qiskit such as it is done for the $iSWAP$ here or $\sqrt{SWAP}$ gate here. How can I do this? If possible I would like to know what 'methods' do people use to find such decomposition.
"
"['qiskit', 'algorithm', 'resource-request', 'cirq']"," Title: What is a good program to practice using a quantum algorithm? Should I use Cirq or Qiskit?Body: I am starting to learn about Quantum Computers and Quantum Algorithms. I also started reading about Qiskit and Cirq. I really like learning about them and hopefully I can be a Software Engineer with Quantum Computers. First though I would like to keep practicing and studying about them. I have a couple of questions.
What is a good program to practice using a quantum algorithm? Should I use Cirq or Qiskit?
"
"['physical-realization', 'physical-qubit']"," Title: How significant is achieving electronic transport in a single qubit at room temperature?Body: This is a follow-up to a previous question I asked: How promising is the possibility of carbon-based qubits to make a qubit that’s stable at room temperature?
I am trying to assess the significance of electronic transport measurements being performed on a single qubit at room temperature, as claimed in this press release.
The company, Archer Materials, claims to be developing a room temperature quantum computing chip. How significant is this milestone to achieving that goal?
"
"['quantum-gate', 'clifford-group']"," Title: How can one argue that the $S$-gate is Clifford while $T$-gate is not?Body: How can one argue that $S$-gate is Clifford while $T$-gate is not?
"
"['quantum-gate', 'optimization', 'annealing', 'quantum-circuit']"," Title: In quantum adiabatic simulation, is the $s$ in $(1-\frac{s}{T})H_{in}+\frac{s}{T} H_{cl}$ related to the $t$ in $e^{-iHt}$?Body: I just want to do a whole adiabatic calculation on quantum circuit.
To prepare two Hamiltonian of $H_{initial}$ and $H_{classical}$ and solve $H_{classical}$ using adiabatic calc like quantum annealing.
The schedule is $H_s = (1-s/T)*H_{initial} + s/T*H_{classial}$
the time evolution operator is $e^{-iHt}$
Is the "$s$" on the schedule and the "$t$" in the operator related to each other?
"
"['qiskit', 'swap-test']"," Title: How to implement the swap test with the help of qiskit?Body: It's creating a real confusion for me especially the parameterized circuit which I have to create. Can anybody please solve this for me? I want to create this circuit.
"
"['error-correction', 'fault-tolerance']"," Title: Can one easily compute the weight enumerator of a CSS code constructed from two binary codes $M_1,M_2$?Body: Consider a CSS code, which is constructed from two binary codes $M_1$ and $M_2$, so its symplectic matrix is of the form:
$$ \begin{pmatrix} M_1 & 0 \\ 0 & M_2 \end{pmatrix}.$$
Suppose one knows the weight enumerators of the binary codes $M_1$ and $M_2$. Can one easily compute the weight enumerator of the CSS code above? What about the special case of $M_1=M_2$?
"
"['algorithm', 'hhl-algorithm', 'phase-estimation']"," Title: HHL algorithm, How to implement exp(iAt) gates?Body: From this paper Quantum Circuit Design for Solving Linear Systems of Equations, in figure 4
The paper shows what inside operator $e^{-iAt}$ but didn't shows how to connect the control qubit (register term C) how can I connect them?
"
['error-correction']," Title: How to write the general state of a corrupted n-qubit codeword in quantum error correction?Body: I am reading the chapter on quantum error correction in Quantum Computer Science by David Mermim. Which says, for a single qubit in a random state $|\Phi\rangle$ of the superposition of $|0\rangle$ and $|1\rangle$, the general form of this corrupted qubit, when interacting with the environment in state $|e\rangle$ is:
\begin{equation}
\tag{1}
|e\rangle|\Psi\rangle \to (|a\rangle\textbf{X}+|b\rangle\textbf{Y}+|c\rangle\textbf{Z}+|d\rangle\textbf{1})|\Psi\rangle
\end{equation}
where $|a\rangle,|b\rangle,|c\rangle,|d\rangle$ are four random state of the environment, and $\textbf{X}, \textbf{Y}, \textbf{Z}$ mean a flip error, a combined flip error and phase error, and a phase error, respectively. $\textbf{1}$ is the identity operator representing no error.
From this, the state of a corrupted n-qubit codeword is:
\begin{equation}
\tag{2}
|e\rangle|\Psi\rangle \to \sum_{\mu_{1}=0}^{3}...\sum_{\mu_{n}=0}^{3}|e_{\mu_{1}...\mu_{n}}\rangle \textbf{X}^{\mu_1}\otimes...\otimes\textbf{X}^{\mu_n}|\Psi\rangle
\end{equation}
I can understand the above two equations. But when constructing the general form of the state of a corrupted n-qubit codeword with the assuming that at most one single qubit in the codeword suffers an error, the book says that 'the terms in (2) are dominated by those in which only a single one of the $X^{\mu_i}$ differs from $\textbf{1}$, and the general form of (2) becomes a superposition of terms in which each individual Qbit sufferers an error.
\begin{equation}
\tag{3}
|e\rangle|\Psi\rangle \to [\sum_{i=0}^{n-1}(|a_i\rangle\textbf{X}_i+|b_i\rangle\textbf{Y}_i+|c_i\rangle\textbf{Z}_i)+|d\rangle\textbf{1}]|\Psi\rangle
\end{equation}
What I do not understand is that since we assume only one qubit has error, then only one of the $X^{\mu_i}$ in $X^{\mu_1}\otimes...\otimes X^{\mu_n}$ in equation (5.16) looks like $|d\rangle\textbf{1} + |a\rangle\textbf{X} + |b\rangle\textbf{Y} + |c\rangle\textbf{Z}$. As a result, the state $\Psi$ should only suffer error in this ith qubit. How do the auther get from (2) to (3) where all the qubits seem to have an error?
"
"['mathematics', 'measurement', 'hamiltonian-simulation', 'vqe']"," Title: What does the identity operator represent when computing $\langle\varphi|I\otimes Z|\varphi\rangle$?Body: Consider a single qubit state $|\varphi\rangle$ and a hamiltonian $H = Z$. Evaluating $\langle \varphi | H | \varphi \rangle$ corresponds to a measurement of $|\varphi\rangle$ in the computational basis. This is easy to generalise to $n$ qubits and any Hamiltonian expressed as a tensor product of Pauli matrices $X, Z, Y$.
My question is: what to do when the Hamiltonian is, for example, $H = I \otimes Z $.
What does $\langle \varphi | H | \varphi \rangle$ mean in this case?
"
['superdense-coding']," Title: Does sending a qubit using a quantum network through some conventional physical medium mean it is not with sender anymore after sending?Body: I was reading the wiki page on superdense coding algorithm. I am not quite sure what happens in this algorithm. When the photon which is part of entangled pair is being sent to Bob from Alice's side, does that mean that photon is not there with Alice anymore?
(I am asking this because if it is not there then to send some classical information again, we have to prepare another entangled pair or Bob has to send back that photon. Because upon projective measurement in bell basis the state won't be destroyed.)
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'tensor-product', 'linear-algebra']"," Title: How do I represent my 3-qubit state in the computational basis?Body: I have taken the tensor product of $|0\rangle \otimes |-\rangle \otimes |+\rangle$ which resulted in the matrix
$$\begin{bmatrix}
1/2\\
1/2 \\
-1/2 \\
-1/2 \\
0 \\
0\\
0\\
0\\
\end{bmatrix}.$$
How would I represent this in the computational basis basis $\{|0\rangle, |1\rangle\}$?
"
"['qiskit', 'algorithm', 'entanglement', 'vqe']"," Title: In VQE, what ansatz would be best used for a maximally entangled $n$-qubit $H$?Body: What ansatz would be best used for a maximally entangled n qubit H? I came across this question in the Qiskit textbook and I really don't know how I would answer it.
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'density-matrix', 'nielsen-and-chuang']"," Title: How would I compute a density matrix of a 2 qubit mixed state?Body: I am currently reading Nielsen & Chuang, and one of the questions asks to calculate a density matrix with the following mixed states, how would I do this?
$$
|00> \;with \;probability \; 2/4 \\
|01> \;with\; probability\; 0\\
|10> \;with \;probability\; 1/4 \\
|11>\; with\; probability \;1/4$$
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'density-matrix', 'nielsen-and-chuang']"," Title: How would I compute a density matrix of a complex qubit mixed state?Body: I am currently reading Nielsen & Chuang, and one of the questions asks to calculate a density matrix with the following mixed state,
$$
\frac{1}{9}\begin{bmatrix}
5 & 1 & −i \\
1 & 2 & -2i \\
i & 2i & 2 \end{bmatrix}$$
and retrieving the probability of measuring
$$
|0\rangle = \begin{pmatrix} 1 \\
0\\
0\\
\end{pmatrix}$$
How would I do this?
"
"['entanglement', 'mathematics', 'textbook-and-exercises', 'bell-basis']"," Title: Show algebraically that $U|0\rangle\otimes |0\rangle+U|1\rangle\otimes|1\rangle=|0\rangle\otimes U^T|0\rangle+|1\rangle\otimes U^T|1\rangle$Body: Suppose that Alice applies a unitary operator $U$ with real entries to her qubit in an EPR pair $|\beta\rangle=\frac{1}{\sqrt 2}(|00\rangle+|11\rangle)$. Is this the same as having Bob apply $U^T$ to his half?
I can't quite show algebraically whether the identity
$$\frac{1}{\sqrt 2}(U|0\rangle\otimes |0\rangle+U|1\rangle\otimes|1\rangle)=\frac{1}{\sqrt 2}(|0\rangle\otimes U^T|0\rangle+|1\rangle\otimes U^T|1\rangle)$$
is true or not.
I see that I can get from the LHS to the RHS by applying $U^T\otimes U^T$ as $U^T=U^\dagger=U^{-1}$, but I still haven't made progress.
"
"['programming', 'qiskit', 'ibm-q-experience', 'ibm']"," Title: Multiple Providers on IBMQBody: I am attempting to run parallel computations on two different backends from within the same Jupyter notebook, though it appears these two jobs are running sequentially. I understand the jobs will be asynchronous, but is there any way to submit two jobs to differing backends at the same time? I'm not seeing anything allowing for providing multiple backends. Thank you!
"
"['quantum-state', 'textbook-and-exercises', 'partial-trace', 'projection-operator']"," Title: Does $\frac{\Pi_A\otimes I_B}{\text{Tr}((\Pi_A\otimes I_B)\rho_{AB})}\rho_{AB}=\rho_{AB}$ hold for a state $\rho_{AB}$ and projector $\Pi_A$?Body: For some projector $\Pi_A$ and state $\rho_{AB}$, let
$$\sigma_{AB} = \frac{\Pi_A\otimes I_B}{\text{Tr}((\Pi_A\otimes I_B)\rho_{AB})}\rho_{AB}$$
Is it the case that $\sigma_B = \rho_B$? It seems intuitively true since the projector is acting only on the $A$ system but I'm not sure how to prove this.
"
"['algorithm', 'grovers-algorithm']"," Title: Is there an issue preventing people from scaling Grover's algorithm to larger numbers of qubits?Body: IBM's quantum experience offers computing up to 15 qubits however through my search of current literature the largest implementation for the algorithm has been with 4 qubits. Is there an issue, preventing people from increasing the size of the algorithm?
"
"['optimization', 'qaoa']"," Title: What exactly happening in QAOA in a general way?Body: So I know that in QAOA we have the two hamiltonians. Mixer and Cost Hamiltonian.
Lets start:
First we have our Qubits which get in the Superposition if we add the Hadamard Gate.
Then we have the both hamiltonians. Which are rotate one or all qubits. After that we are measure it and optimize the angles beta and gamma in the classical way and this process is going iterative.
That is a little bit clear for me.
BUT:
What exactly is happening in the superposition that we have a benchmark where we know that our qubit on the Bloch Sphere is finding the global minimum. Because in the classical optimization for example gradient descent that depends from the gradient if it is good.
I hope that the question is clear 😅
"
"['qiskit', 'textbook-and-exercises']"," Title: Phase Kickback - factoring Dirac representationBody: In section 2.3 of the Qiskit textbook (Phase Kickback), there's an example where a controlled-T gate is applied to $|1+\rangle$.
You're asked to attempt the same thing with $|0+\rangle$. I've done this by means of statevectors and successfully got the correct answer (that it has no effect):
$$\text{Controlled-T}|0+\rangle$$
$$=\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & e^{\frac{i\pi}{4}}
\end{pmatrix}\times\frac{1}{\sqrt{2}}
\begin{pmatrix}1\\1\\0\\0\\\end{pmatrix}
= \frac{1}{\sqrt{2}}\begin{pmatrix}1\\1\\0\\0\\\end{pmatrix}$$
The textbook's example (using $|1+\rangle$) performs the calculation in Dirac representation - i.e. by factoring out the individual qubits. I decided to try the same thing with the above. Here's what I got:
$$|0+\rangle = |0\rangle \otimes \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$$
$$=\frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$$
$$\text{Controlled-T}|0+\rangle =\frac{1}{\sqrt{2}}(|00\rangle + e^{\frac{i\pi}{4}}|01\rangle)$$
$$=|0\rangle \otimes\frac{1}{\sqrt{2}}(|0\rangle + e^{\frac{i\pi}{4}}|1\rangle)$$
When I then multiply that out to get the statevector, I get:
$$\frac{1}{\sqrt(2)}\begin{pmatrix}1\\e^{\frac{i\pi}{4}}\\0\\0\\\end{pmatrix}$$
which is clearly different.
What am I doing wrong with the algebraic approach?
"
"['quantum-gate', 'physical-qubit']"," Title: What is the difference between SWAP & Bridge gates?Body: While I'm studying about Qubit allocation (mapping), I wonder what the differences between SWAP and Bridge gates are. I know that a SWAP gate and Bridge gate can be represented with 3 CNOT gates and 4 CNOT gates respectively. Changing the qubit location of the hardware topology using SWAP is visually visible. However, Bridge gate case, I couldn't.
Here is my Questions
- What is the difference between SWAP gate and Bridge gate
- Is there any gates that can change physical qubit location of hardware topology except SWAP and Bridge gates?
"
"['textbook-and-exercises', 'bell-basis', 'bell-experiment', 'non-locality']"," Title: Bell's experiment: checking the probabilitiesBody: I have some doubts on the calculations behind Bell's experiment, which goes as follows: a pair of entangled photons is shared between two scientists, Alice and Bob, who possess a bunch of polarizers at $0°, 22.5°$ and $45^°$ with respect to some fixed vertical direction. In particular let us assume that Alice and Bob set up the following combinations of polarizers before measuring their qubit simultaneously:
- Alice uses the one at $0°$, Bob uses the one at $90°$;
- Alice uses the one at $0°$, Bob uses the one at $45°$;
- Alice uses the one at $45^°$. Bob uses the one at $90^°$.
(I will be using the convention to halve the angles when performing an actual rotation, so, for example, $45^°$ corresponds to a rotation by $22.5^°$). Assume the EPR state that describes the two photons is
\begin{equation}
|\psi\rangle=\frac{1}{\sqrt 2}(|\updownarrow\updownarrow\rangle+|\leftrightarrow\leftrightarrow\rangle)
\end{equation}
so that they both have the same polarization, though unknown a priori. In the first setup of the experiment, the global state before the measurement becomes (in the vertical/horizontal basis)
\begin{align}
(\mathbb{I}_A\otimes R_B(90^°))|\psi\rangle&=\frac{1}{\sqrt 2}\left(|\updownarrow\rangle\otimes \frac{1}{\sqrt 2}(|\updownarrow\rangle-|\leftrightarrow\rangle)+|\leftrightarrow\rangle\otimes\frac{1}{\sqrt 2}(|\updownarrow\rangle+|\leftrightarrow\rangle) \right) \\ &= \frac{1}{2}(|\updownarrow\updownarrow\rangle-|\updownarrow\leftrightarrow\rangle+|\leftrightarrow\updownarrow\rangle+|\leftrightarrow\leftrightarrow\rangle).
\end{align}
What is the probability for the photons to go through one and only one of the two polarizers? Only the first and the last term contribute, as since both photons are polarized vertically or horizontally, they either go through one or the other, for a total probability of $50\%$.
A similar calculation shows
\begin{align}
(\mathbb{I}_A\otimes R_B(45^°))|\psi\rangle= \frac{1}{\sqrt 2}(\cos 22.5^°|\updownarrow\updownarrow\rangle-\sin 22.5^°|\updownarrow\leftrightarrow\rangle+\sin 22.5^°|\leftrightarrow\updownarrow\rangle+\cos 22.5^°|\leftrightarrow\leftrightarrow\rangle).
\end{align}
Again, if the polarization are the same, then they go through either one or the other but not both: therefore $$ p=\frac{1}{2}\cos^2 22.5^°+\frac{1}{2}\cos^2 22.5^°\approx 85\%.$$
I fear that here my reasoning in not correct... in fact, I was expecting to get the complementary $15\%$! Where does it go wrong?
"
['resource-request']," Title: What is a good video resource for quantum computing?Body: Can anyone refer me to a good video resource for quantum computing? I found this post helpful Currently, what are the best structured courses available online on quantum computing?, but Vazirani's youtube course has many videos deleted.
"
"['programming', 'quantum-gate', 'qiskit', 'quantum-state', 'quantum-circuit']"," Title: Qiskit: how can you use a different state for each shot in a quantum circuit?Body: I am trying to run a quantum circuit many times, each time using a different random state - a single qubit i.e. $|\psi\rangle= a|0\rangle + b|1\rangle$ with different $a$ and $b$. Once each qubit has gone through the circuit, I am saving the state vector of the final state, and converting this to spherical coordinates by calculating $\theta$ and $\phi$. I append each $\theta$ and $\phi$ value to a list and then plot them on a histogram (omitted below).
Whilst this works, for large num_states it is very slow, so I am wondering if there is a way to use the 'shots' feature when executing the circuit, since you can write:
job = execute(qc, backend, shots=1000)
I tried playing around with this but found after the initial random state was generated, it repeated the circuit with the same state for the number of shots, rather than doing a different state each time. I'd like to use the shots feature as I believe this will be much quicker since OpenMP is built into Qiskit.
Any ideas on how I might be able to implement a different state each time using shots would be much appreciated:)
import numpy as np
from qiskit import(
QuantumCircuit,
execute,
Aer)
from math import pi
from qiskit.quantum_info import random_statevector
#----------------------------------------------------------------------#
backend = Aer.get_backend('statevector_simulator')
def simulate_states(num_states):
qc = QuantumCircuit(1)
theta_vals = []
phi_vals = []
for i in range(num_states):
random_state = random_statevector(2).data
qc.initialize(random_state, 0)
qc.z(0)
job = execute(qc, backend)
result = job.result()
out_state = result.get_statevector()
theta, phi, alpha_r, alpha_i, beta_r, beta_i = state_coords(out_state)
theta += pi/2
theta_vals.append(theta)
phi_vals.append(phi)
return theta_vals, phi_vals
def state_coords(statevector):
"""
determines the spherical coordinates of a state on the Bloch sphere i.e. calculates \theta and \phi.
"""
alpha = statevector[0]
alpha_r = alpha.real
alpha_i = alpha.imag
beta = statevector[1]
beta_r = beta.real
beta_i = beta.imag
theta = np.arcsin(2*((alpha_r*beta_r) - (alpha_i*beta_i)))
phi = 2*np.arccos(2*((alpha_r**2)+(beta_r**2))-1)
return theta, phi, alpha_r, alpha_i, beta_r, beta_i
```
"
"['programming', 'quantum-gate', 'qiskit', 'quantum-circuit']"," Title: Qiskit: is there a quick way to work out the spherical coordinates for a given qubit statevector?Body: I am trying to calculate the spherical coordinates of different qubit states (i.e. working out $\theta$ and $\phi$ from: $|\psi\rangle = e^{-i\phi/2}\cos(\theta/2)|0\rangle + e^{i\phi/2}\sin(\theta/2)|1\rangle$.
At the moment I am using the below function although I don't think it's working properly since it breaks when theta is close to zero in this line:
phi = np.arccos((1/np.sin(theta/2))*((alpha_r*beta_r) + (alpha_i*beta_i)))
Is there a quick way to get the spherical coordinates for a state where $\theta$ is 0 to $\pi$ and $\phi$ is 0 to $2\pi$? I figure this must be built into Qiskit since when you do plot_bloch_multivector() it converts a state to a vector on a Bloch sphere.
Any ideas would be much appreciated:)
def state_coords(statevector):
alpha = statevector[0]
alpha_r = alpha.real
alpha_i = alpha.imag
beta = statevector[1]
beta_r = beta.real
beta_i = beta.imag
theta = np.arccos((alpha_r**2)-(alpha_i**2))
if theta==0:
phi=0
else:
phi = np.arccos((1/np.sin(theta/2))*((alpha_r*beta_r) + (alpha_i*beta_i)))
if ((alpha_r*beta_i) - (alpha_i*beta_r)) < 0:
phi += pi
return theta, phi, alpha_r, alpha_i, beta_r, beta_i
"
"['information-theory', 'state-discrimination']"," Title: Is the quantum state discrimination success probability always $\lambda_0\langle\mu(0),\rho_0\rangle+\lambda_1\langle\mu(1),\rho_1\rangle$?Body: Consider the standard quantum state discrimination setup: Alice sends Bob either $\rho_0$ or $\rho_1$. She picks $\rho_0$ and $\rho_1$ with probabilities $\lambda_0$ and $\lambda_1$, respectively. Bob performs some two-outcome measurement $\mu$ on the state he receives and has to decide whether Alice sent $\rho_0$ or $\rho_1$.
We assume Bob knows the possible states $\rho_0,\rho_1$, as well as the probabilities $\lambda_0,\lambda_1$.
Denote with $p_i(b)\equiv p_i^\mu(b)\equiv \langle \mu(b),\rho_i\rangle\equiv \mathrm{Tr}(\mu(b)\rho_i)$ the probability of Bob observing the outcome $b\in\{0,1\}$ when the state he received is $\rho_i$.
If Bob measures the outcome $b$, his best guess is that he received the $\rho_i$ with $i$ maximising $\lambda_i p_i(b)$.
This follows from simple Bayesian considerations, fully analogous to the classical state discrimination scenario discussed in this other question.
Consequently, when Bob finds the outcome $b$, the probability of his guess being correct is
$$p_{\rm correct}(b) = \frac{\max_i \lambda_i p_i(b)}{p(b)} = \frac{\max_i \lambda_i p_i(b)}{\sum_i \lambda_i p_i(b)}.$$
The overall success probability, estimated before knowing the measurement outcome, is therefore
$$p_{\rm correct} = \sum_b p(b) p_{\rm correct}(b) = \sum_b \max_i \lambda_i p_i(b).\tag X$$
This is all nice and well. However, the success probability for this type of scenario is usually given (e.g. in Watrous' TQI, section 3.1) as the expression:
$$p_{\rm correct}'=\sum_{i\in\{0,1\}} \lambda_i p_i(i).\tag Y$$
This expression is intuitively clear: if Bob receives $\rho_i$, which happens with probability $\lambda_i$, then he correctly guesses that the state was $i$ with probability $p_i(i)$.
Nonetheless, I wonder: are (X) and (Y) always equivalent?
I suppose that if we assume that the best guess changes with the observed outcome (e.g. if Bob finds $b=0$ then his best guess is $i=0$, and if he finds $b=1$ his best guess is $i=1$), then (X) and (Y) are equivalent up to a relabeling of the POVM.
But can we always assume this? Isn't it possible that there are scenarios in which, regardless of the observed outcome, Bob's best guess should always be the same?
Admittedly, this sounds like a weird scenario, but I can't tell whether it can be ruled out altogether (well except in the trivial case in which $\rho_0=\rho_1$). It amounts to asking whether
$$\underbrace{\lambda_0 p_0(0)>\lambda_1 p_1(0)}_{\text{measuring $0$ best guess is $\rho_0$}} \Longrightarrow
\underbrace{\lambda_0 p_0(1) < \lambda_1 p_1(1)}_{\text{measuring $1$ best guess is $\rho_1$}}.$$
Because $p_i(0)+p_i(1)=0$, this is true for $\lambda_0=\lambda_1$, but I'm not sure it holds for the general case.
"
"['textbook-and-exercises', 'tensor-product']"," Title: Is the order of the tensor product in $|\phi\rangle\otimes|\chi\rangle=|\chi\rangle\otimes|\phi\rangle$ relevant?Body: I am reading this book “Quantum Computing Explained” by David McMahon. I found the following statement on page 74
Note that the order of the tensor product is not relevant, meaning
$|\phi\rangle \otimes |\chi\rangle = |\chi\rangle \otimes
|\phi\rangle$
I found it surprising to face this in a quantum computing book, because this is not true. Have any of you read the book or have any idea how it could be true? (Though as I said, I don’t think it is true).
"
"['quantum-gate', 'circuit-construction']"," Title: What is the action of sandwiching an operator with two CNOT gates?Body: When a gate is sandwiched (or conjugated) by two CNOT gates, what effect does it have on the gate being sandwiched? For example, in the figure below, it is clear what effect the controlled $R_y(\theta)$ has. The question is how the CNOT gates modify the behaviour of the controlled $R_y(\theta)$ gates.
"
"['measurement', 'textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Why does $\sum_n \langle n|M_m\rho M_m^\dagger|n\rangle$ simplify to $\langle \psi|M_m^\dagger M_m|\psi\rangle$?Body: I was trying to derive the formula for $p(m)$ in exercise 8.2 on page 357 in Nielsen & Chuang. But I am wondering what rule I can apply to simplify this
$$\mathrm{tr}(\mathcal{E}_m(\rho) )= \sum_n \langle n | M_m \rho M_m^{\dagger} | n\rangle = \sum_n \langle n | M_m | \psi\rangle
\langle \psi | M_m^{\dagger} | n\rangle $$
to $\langle\psi|M_m^{\dagger}M_m|\psi\rangle$?
Because after this I can’t find any idea to boil down to this.
"
"['programming', 'quantum-gate', 'qiskit']"," Title: How can we construct a control-control y-rotation (CCRy) gate in Qiskit?Body: Qiskit has a CRy gate, however I couldn't find a CCRy (double control Ry) gate implementation. How can we construct the CCRy circuit given below in Qiskit without any ancillary qubits?
Edit:
A quick note on another solution, when using the mcry gate to perform control-control y-rotation. I had been initializing quantum circuits via:
from qiskit.circuit import QuantumCircuit
circ = QuantumCircuit(4, 4)
circ.mcry(q_controls=[0, 1], q_target=2, q_ancillae=None) # Gives error saying q_target needs to be a qubit
As shown in the linked solution, one needs to define quantum registers and pass those objects as parameters to the quantum circuit to avoid this issue. In general, this makes me wonder if the latter is a better practice than what I had been doing previously (shown above).
"
"['qiskit', 'quantum-circuit', 'cloning']"," Title: Symmetric Universal Quantum Cloning Machine (UQCM) N --> M for unknown statesBody: Does it exist a schematic diagram of the quantum circuit implementing the symmetric UQCM N--> M for unknown states? If yes, does anyone know a Qiskit implementation of it?
"
"['circuit-construction', 'swap-test']"," Title: Implementing a SWAP-Test for samples with large numbers of featuresBody: I am trying to calculate the distance between sets of vectors. To do this I can create a SwapTest circuit (described here on page 34) and encode a feature vector with a U3 gate, then apply H and CSWAP gates to calculate the overlap. When your feature vectors are length 3 this seems fairly easy, as this can be encoded entirely by one U3. Each U3 parameter will represent a feature. I've done this with vectors of length 2, and have used the overlap as a measure to decide which 2 vectors are "closest".
However, what if we add a 4th or 5th or 10th feature? I imagine we could then also use a second qubit, encode the 5 features over two U3 gates. However, I have trouble seeing how to construct the rest of the circuit.
If we take two states, A and B, each with 6 features we could split this over 2 U3 gates each. Do we perform the "normal" SwapTest on each half of each state. Ie, find the overlap of the upper half of A and the upper half of B, then do the same for the lower half? This seems reasonable, but how would I be able to combine this into 1 value I can use to compare to another set of vectors?
"
"['quantum-gate', 'algorithm']"," Title: What is the general method for creating real gate sequences from mathematical algorithms?Body: Background
I have been doing research on quantum computing on my own for over a year now and I feel like I may have missed a fundamental step. I have no idea how to take a mathematical algorithm and create an equivalent gate sequence for an actual Quantum Computer to follow. I would like to be able to read articles on quantum algorithms and be able to create circuits from them, but unless I can find an example of how the gates are set up I am stuck. Even more frustrating is when gates are shown but are just representations of subroutines instead of the basic gates (example on page 5).
Grover's Algorithm Example
For example, I am pretty familiar with Grovers algorithm. For Grover's algorithm you perform the following steps (I'm borrowing from Wikipedia a bit):
- Initialize all qubits to a $\left| 0 \right>$ except for a specified qubit (the oracle qubit according to Wikipedia) you initialize to $\left| 1 \right>$; this will be the target of the Orcale.
- Put all qubits, except for ancilla bits, into a superposition using Hadamard gates. The mathematical algorithm says that this is equivalent to the following:
${\displaystyle |s\rangle ={\frac {1}{\sqrt {N}}}\sum _{x=0}^{N-1}|x\rangle .}$
I can kind of see how this would translate to Hadamard gates because
we have the $\sqrt{N}$ on the denomonator.
- Next comes the trickiest part in my opinion, the Orcale. The oracle, a black box function (in my experience) can be created by formulating the problem as a SAT problem and then creating an equivalent quantum circuit that ultimately flips the "target bit." The mathemitacal algorithm says this is equivelent to ${\displaystyle |x\rangle |q\rangle \,{\overset {U_{\omega }}{\longrightarrow }}\,|x\rangle |q\oplus f(x)\rangle ,}$ where $U_w$ is the oracle and $|q\rangle$ is that subroutine as an operatior.
Again, this seems a little intuitive to me because I know the
$|q\rangle$ should XOR the oracle qubit.
- Grover's diffusion operator is pretty darn confusing. Wikipedia defines this operator to be
${\displaystyle 2|s\rangle \langle s|-I}$.
From experience I know this can be achieved by sandwiching a large
controlled Z, with target on last logical qubit that isn't the oracle
qubit, by H and X gates like so:
I have no earthly idea how I would have figured that out from the
instructions "${\displaystyle 2|s\rangle \langle s|-I}$"
- Repeat steps 3 and 4 $O \sqrt{N}$ times and then measure.
Question
What are some general methods or practices for creating gate sequences from mathematical algorithms? Seeing as there are many ways to create equivalent gate sequences, I am assuming that performing this process is an art that takes practice and experience. That being said, where should I start? What advice can you give me?
"
['qiskit']," Title: Is it better to initialize quantum circuits in Qiskit by passing QuantumRegister and ClassicalRegister objects?Body: From the perspective of building quantum computation software based on Qiskit, which approach to defining quantum circuits is more robust?
from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister
qr1 = QuantumRegister(3, 'qr1')
qr2 = QuantumRegister(4, 'qr2')
cr = ClassicalRegister(4, 'cr')
circ = QuantumCircuit(qr1, qr2, cr)
OR,
circ = QuantumCircuit(7, 5)
So far I've been using the latter approach, but it seems like I might run into trouble later as the software matures and I add more functionalities. Any opinion from an experienced Quantum Computation Software Developer would be greatly appreciated!
"
"['quantum-gate', 'physical-realization', 'architecture']"," Title: Is there any quantum gate that can change quantum hardware topology(architecture)?Body: I read about this paper
Hardware-aware Heuristic for the Qubit Mapping problem in the NISQ Era.
I wonder there is the only SWAP gate that can change the quantum hardware topology.
Is there any gates that can change it except Bridge?
"
"['programming', 'qiskit']"," Title: QISKit not installing in PyCharmBody: I am attempting to setup a PyCharm project to study and work through the QISKit textbook. However I seem to be running into a propblem seting it up.
I have setup a python enviroment via anaconda (PyCharm does this automatically). I run pip install qiskit which returns the Failed buidling wheel for h5py error but I read online that this can be ignored.
I tried to import from qiskit but got an error saying ther is no reference to qiskit.
I tried the auto fix of installing the qiskit package again but it had an error displayed in the below screenshot.
Help would be appreciated in setting up my PyCharm project.
Many thanks.
"
"['grovers-algorithm', 'oracles']"," Title: In Grover's oracle, how is the matrix $U_f$ derived for a generic $n$?Body: Grover's algorithm works by iteration of the operator $$\tag{1}G:=U_S^\perp U_f=H^{\otimes n}U_0^\perp H^{\otimes n}.$$
I know how to write down the matrix for $U_S^\perp$ (the inversion about the average value of the amplitudes), and also how it is implemented in a circuit (essentially, a CNOT gate between $X$ and $H$ gates).
But what about $U_f$? In the theory, the oracle is defined by its action of the tensor product of the input and output registers as $$\tag{2}U_f|x\rangle |y\rangle=|x\rangle |y\oplus f(x)\rangle,$$ where $f$ returns $0$ for all input states but for a specified $x_0$, in which case it returns $1$. But more concretely, I have the following questions:
- how is the matrix form of $U_f$ for a generic $n$ derived (specifically for the first few qubits $n=1,2,3$), and
- what does its implementation in a circuit actually look like in terms of fundamental gates?
"
"['measurement', 'textbook-and-exercises', 'probability']"," Title: Measurement probability of a state from three hilbert spacesBody: I'm curious how to find the probability measurement of a state when one qubit is measured. For example this state:
$|\gamma\rangle = \frac{1}{\sqrt{2}}(| 010 \rangle + | 101 \rangle )$
Assuming these are qubits and if we measure the last qubit in the $| + \rangle ,| - \rangle $ basis, what is the probability measurement of the state after measuring the third qubit?
A probability usually means something like $ |\langle\phi|\psi \rangle|^2 $ but if we take the results from after measuring the last qubit in the $+,-$ basis we get:
$|\psi_+\rangle$ = $\frac{1}{2}(| 01 \rangle + | 10 \rangle )$
$|\psi_-\rangle$ = $\frac{1}{2}(| 01 \rangle - | 10 \rangle )$
How would we calculate the corresponding measurement probabilities of these two states? Is it really just $ |\langle\psi_+|\psi_+ \rangle|^2 $ Sounds too easy/doesn't make much sense.
"
"['quantum-gate', 'unitarity', 'state-preparation']"," Title: How to prepare a random 1-qubit superposition for data encodingBody: Let's assume we have a normalized data vector $\vec{x}= [x_1,x_2]$. How can I prepare a state $$|\psi\rangle = x_1|0\rangle+x_2|1\rangle$$
for any $\vec{x}$. I know that this state is in general not reachable through a single rotation, but is there a systematic way of finding a sequence of unitaries (let's call it $U_s$ here), that performs a transformation, such that $U_s|0\rangle=|\psi\rangle$?
Thanks!
"
"['quantum-state', 'density-matrix', 'partial-trace']"," Title: What is the conjugate transpose of $|0\rangle_{A}|1\rangle_{B}$?Body: Suppose a composite state is in $|0\rangle_{A}|1\rangle_{B}$. Then their conjugate transpose would be
$\langle 0|_{A}\langle 1|_{B}$?
Note: Why this question? Because I was checking MIT's "Quantum Information Science's 2010 class's homework solution of 3" (link) Page 2
Here is the corresponding problem set.(In case you feel curious) (link)
"
"['algorithm', 'quantum-fourier-transform']"," Title: Intuition behind the use of inverse FFT in Quantum Circuit for Hamming weightBody: I have found this question from MIT problemset.
I could only design the circuit for 3 qubits. But they have a general solution that shows this circuit.
I am trying to understand this circuit (from the application of $R_k$ and then the $FT^\dagger$). Can anybody explain the idea so that I can design these kinds of circuits on my own next time?
"
"['resource-request', 'cryptography']"," Title: Sources for quantum cryptography and post quantum cryptographyBody: I am a beginner in quantum computing, and I understand the basics of quantum computing.
Can anyone suggest me a beginners material for quantum cryptography and post quantum cryptography? Book, Video or lecture notes, anything will do, given it is good for beginners.
"
"['quantum-gate', 'circuit-construction', 'unitarity', 'phase-estimation', 'quantum-circuit']"," Title: 3-qubit phase shift gate/circuit implementation without any Ancilla qubitsBody:
Hi, I need help me with figuring out the 3-qubit phase shift circuit without any ancillas similar to the 2-qubit circuit shown in below attached picture....... Please do let me know! Thanks in advance! Also, I've written down the matrix/operator equivalent to 3-qubit phase-shift circuit in the picture itself... Restrictions would be to not use any Ancilla's and it would be better if we can implement using only CNOT & single qubit gates.
"
"['shors-algorithm', 'cryptography']"," Title: Can I have access to break my Windows BitLocker keyBody: Is it possible to have access to a quantum computer to break a BitLocker key (maybe with Shor's algorithm) and have access to my data?
Here what happened to me: after I've changed my LENOVO X270 laptop faulty RAM and internal keyboard, now at boot there is a Bitlocker screen it is asking me for a BitLocker key! I don't have it in my Microsoft/OneDrive account, on a printout I saved, on a USB flash drive, in an Azure Active Directory, held by a system administrator or whatsoever! This is logical: despite BitLocker comes preinstalled in Windows but I never ran and less configured it! Please trust me, I am in IT for +30 years and even if I had Alzheimer's disease I will remember it!
So, after googling and searching on Microsoft KB, I've found out that there are thousands (if not millions) of Windows users to whom it happened too. I believe it was triggered by a Windows system update and security measures which I never ever set!
I've obviously contacted Microsoft Support, checked since the past sleepless 3 weeks a lot of KBs, forums tried many prompt commands, BIOS settings, watched hours of videos, contacted recovery software companies (like Elcomsoft, Passware, TheGrideon...) all of them said their product cannot help in my case because my drive was encrypted with a numeric password which is a recovery key.
I didn't want to reinstall Windows or bring my laptop to a hardware recovery store as I don't want to take the risk to make my data unrecoverable and also if I cannot find a solution, I am definitely going to hire a lawyer and file a class-action lawsuit against Microsoft: to all Windows users to whom it happened, please contact me.
(mayThanks.
"
"['textbook-and-exercises', 'pauli-gates']"," Title: How do I decompose the given $4\times 4$ matrix in terms of Pauli matrices?Body: I have been working on a question where I have to decompose this matrix in terms of Pauli Matrices:
\begin{bmatrix}1&0&0&1\\0&0&0&0\\0&0&0&0\\1&0&0&1\end{bmatrix}
I already have a solution but I don't understand the solution I've been given, this is the solution:
First there is a truth table:
+------+-----------+
|Input | Output |
+------+-----------+
| |00> | |00>+|11> | = 1/2(|00>+|11>+|11>+|11>)
| |01> | 0 | = 1/2(|01>-|01>+|10>-|10>)
| |10> | 0 | = 1/2(|10>-|10>+|01>-|01>)
| |11> | |11>+|00> | = 1/2(|00>+|00>+|11>+|11>)
+------+-----------+
I understand the truth table, but I don't understand the things after the "=" and I also don't understand how the final answer is achieved. This is the final answer:
$$ \frac{1}2(I_1 \otimes I_2) + \frac{1}2(Z_1 \otimes Z_2) + \frac{1}2(X_1 \otimes X_2) - \frac{1}2(Y_1 \otimes Y_2) $$
Any help in understanding the solution would be really appreciated. Thank you!
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang', 'gate-synthesis', 'matrix-representation']"," Title: How does a general rotation $R_\hat{n}(\theta)$ related to $U_3$ gate?Body: From eqn. $(4.8)$ in Nielsen and Chuang, a general rotation by $\theta$ about the $\hat n$ axis is given by
$$
R_\hat{n}(\theta)\equiv \exp(-i\theta\hat n\cdot\vec\sigma/2) = \cos(\theta/2)I-i\sin(\theta/2)(n_xX+n_yY+n_zZ).
$$
From the qiskit textbook, a generic single-qubit 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}.
$$
I tried to work out the matrix representation of $R_\hat{n}(\theta)$ but it looks like the first entry of that should be $\cos(\theta/2)-i\sin(\theta/2)n_z$, which is different from that of $U(\theta,\phi,\lambda)$, i.e. $\cos(\theta/2)$.
I'm wondering how does $R_\hat{n}(\theta)$ related to $U_3$ gate? In other words, given a unit vector $\hat n$ and a rotation angle $\theta$, can we represent $R_\hat{n}(\theta)$ using $U_3$?
"
['quantum-fourier-transform']," Title: Calculating the QFFT according to CoppersmithBody: I have come through an interesting paper by Don Coppersmith (https://arxiv.org/pdf/quant-ph/0201067.pdf), and I was wondering what was your view on the $Q_{JK}$ ("twiddle") transformation, which is defined as:
$\omega^{2^{L-1-J+K}}$
How can the matrices be obtained on the basis of this definition? Substituting the terms in the equation itself is trivial, but determining the position inside the matrix is something more challenging, at least for me. Which kind of operation allow to obtain the matrix $P_1Q_{12}$ given the two initial matrices?
Thank you in advance for your time.
"
"['programming', 'qiskit', 'universal-gates']"," Title: How can we code a ccz (control control z, equivalent of Toffoli on Z and not on X) gate in Qiskit language?Body: How can we code in Qiskit, a ccz gate ?
In python (in https://qiskit.org/textbook/ch-algorithms/grover.html), we see three instructions :
qc.h(nqubits-1)
qc.mct(list(range(nqubits-1)), nqubits-1) # multi-controlled-toffoli
qc.h(nqubits-1)
In qiskit , a Hadamard gate can be coded as : circuit.h(qreg[i]).
But what is it this "mct" gate ? i've not seen it in Qiskit documentation.
"
['pauli-gates']," Title: What is the procedure of finding z-y decomposition of unitary matrices?Body: The title explains it all. Suppose one needs to find z-y decomposition of unitary matrix H or T. What is the step by step process to find it?
"
"['programming', 'qiskit', 'error-correction', 'resource-request', 'qasm']"," Title: Quantum Error Correction implementation in Qiskit, OpenQASM or other languages based on PythonBody: Where can we find example(s) of implementation code in a programming language of Quantum Error Correction, whether with the standard method of measurement or the automatic method without measurement (with control operators) ?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How do I Initiate with my own alpha and beta values instead of starting form qubit in state zero in IBM Q?Body: Let's say I have normalized values of $\alpha$ and $\beta$ as
$\alpha =(0.27524094128159016+0.8257228238447705j)$
$\beta =(-0.22019275302527214+0.4403855060505443j)$
How do I initialize my circuit starting from these values instead of qubit q[0] to be in state $|0\rangle$.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises']"," Title: How to prove that the transpose operation maps an arbitrary qubit to its complex conjugate?Body: How to prove that the transpose operation maps an arbitrary qubit to its complex conjugate, $|\psi^*\rangle \rightarrow |\psi\rangle$
"
"['programming', 'ibm-q-experience', 'qasm']"," Title: Is it possible to see the probabilities values of qubit ( alpha and beta) while measuring on IBM Quantum experience?Body: Is it possible to see what are the values of $\alpha$ (probability of being in state zero) and $\beta$ (probability of being in state one) while running on IBM Quantum simulator (we can call it state vector).
"
['vqe']," Title: Encoding a discrete functional in variational $n$-qubit statesBody: So I have a discreet functional $f(x_{1},x_{2},...,x_{k})$ that I want to encode in a variational state: $|\psi(\lambda)>$. The number of variables in my functional takes values $k=9,18,30$.
I want the parameters $x_{1},x_{2}...x_{k}$ to be the amplitudes of my state. I can encode $2^n$ parameters with $n$ qubits, however as for the number of variables given $k=9,18,30$, I can not write $k=2^{n}$, where $n$ is an integer for these values of $k$. I was wondering if there is any nice way around this.
Thank you
"
"['programming', 'qiskit', 'circuit-construction', 'ibm-q-experience', 'quantum-circuit']"," Title: How to make a half adder for x number of qubits with min. cost?Body: How to make a half adder for N inputs and getting the output on another x+1 output. Where x is numbers of qubit and N=2^x. please take a example of a circuit(x must be greater then 4 or 5 for example purpose ) for more understanding . Here is the example for 2 qubit half adder.
"
"['quantum-state', 'quantum-operation']"," Title: Dimensionality and value of $\mathbb{I}_A$ in Quantum operationsBody: I was checking this question answer but I still can't get what is the value and dimension of $\mathbb{I}_A$ in this question and on the answer. Is it an identity matrix or some vector?
It also appears in the answer as $\mathbb{I}$ multiple times.
"
"['quantum-state', 'resource-request', 'research', 'quantum-optics']"," Title: Sidebands in spin-oscillator coupled devicesBody: I am researching spin-oscillator hybrid devices (particularly those coupled to NV centers), and I have come across this paper investigating the strain field of a cantilever and its effect on the NV centre. I know the resolved sideband regime is that the resonance frequency has to be larger than the ESR spectra linewidth, but why is this necessary/important? I cannot seem to find even the smallest explanation on this.
"
"['programming', 'qiskit', 'simulation', 'qaoa']"," Title: Statevector Simulation of QAOA always finds exact solutionBody: My question is simple: does applying QAOA with a statevector simulation always result in a perfect solution?
I'm trying to calculate the best $\gamma$ & $\beta$ that solve certain problems but my statevector simulation of problem always finds the exact solution with a single stage ($p=1$) of QAOA.
I know that in a in a real quantum device, the entire statevector isn't calculated (the whole point of quantum computing!) but rather multiple 'shots' are processed to build up a statistical picture.
Using these inputs, a typical solver like COBYLA won't work as well as they assume each function value they get is true. As such, getting the best possible $\gamma$ & $\beta$ values is harder than when using the statevector simulation, which can get arbitarily close as this guide says. Is this where the need for multiple stages of the QAOA comes from? We cannot get as high quality angles with shot based simulators and so we need more stages ?
I first noticed this when trying to solve the MIS problem using the statevector simulator in qiskit and was getting perfect results each time up to $N=14$ nodes, which seemed a little crazy. At first, I thought this was perhaps due to the QAOA being 'good' at this sort of problem and thought I would have to simulate at higher $N$'s before more stages were needed. I then tried the same setup on a MAXCUT ($N=12$) problem and got the same outcome: QAOA always finding an optimum solution with just one stage. I know from this paper that multiple stages were needed for MAXCUT at the same region of N's (and graph complexity) and so this is what leads me to think QAOA evaluates perfectly when the entire statevector is calculated. Am I correct ?
EDIT: I've included the Qiskit Code I've used to generate this.
For completion I've included all my code but the relevant bit is outside of all the functions. Here is what these functions do:
weighted_erdos_graph generates an Erdos-Renyi graph using the standard networkx implementation with randomly weighted nodes. own_maximum_weighted_independent_set_qubo Is taken from D-Wave, and generates the QUBO for a given graph. This is in the form of a dictionary which convert_to_array converts to a numpy array for ease of manipulation. the_auto_doco_mod (I had Wallace and Gromit on the mind...) takes this numpy array and converts this to a QuadracticProgram, with the binary variables interpretted as quadractics (I know this is a bit hacky, but it works).
from qiskit import IBMQ, Aer, QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.aqua import aqua_globals, QuantumInstance
from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
from qiskit.optimization.algorithms import MinimumEigenOptimizer, RecursiveMinimumEigenOptimizer
from qiskit.optimization import QuadraticProgram
from qiskit.optimization.applications.ising.docplex import get_operator
import numpy as np
from docplex.mp.model import Model
from docplex.cp.expression import binary_var_list
######### Functions ####################
def own_maximum_weighted_independent_set_qubo(G, weight=None, lagrange=2.0):
"""Return the QUBO with ground states corresponding to a maximum weighted independent set.
Parameters
----------
G : NetworkX graph
weight : string, optional (default None)
If None, every node has equal weight. If a string, use this node
attribute as the node weight. A node without this attribute is
assumed to have max weight.
lagrange : optional (default 2)
Lagrange parameter to weight constraints (no edges within set)
versus objective (largest set possible).
Returns
-------
QUBO : dict
The QUBO with ground states corresponding to a maximum weighted independent set.
Examples
--------
>>> from dwave_networkx.algorithms.independent_set import maximum_weighted_independent_set_qubo
...
>>> G = nx.path_graph(3)
>>> Q = maximum_weighted_independent_set_qubo(G, weight='weight', lagrange=2.0)
>>> Q[(0, 0)]
-1.0
>>> Q[(1, 1)]
-1.0
>>> Q[(0, 1)]
2.0
"""
# empty QUBO for an empty graph
if not G:
return {}
# We assume that the sampler can handle an unstructured QUBO problem, so let's set one up.
# Let us define the largest independent set to be S.
# For each node n in the graph, we assign a boolean variable v_n, where v_n = 1 when n
# is in S and v_n = 0 otherwise.
# We call the matrix defining our QUBO problem Q.
# On the diagnonal, we assign the linear bias for each node to be the negative of its weight.
# This means that each node is biased towards being in S. Weights are scaled to a maximum of 1.
# Negative weights are considered 0.
# On the off diagnonal, we assign the off-diagonal terms of Q to be 2. Thus, if both
# nodes are in S, the overall energy is increased by 2.
cost = dict(G.nodes(data='node_weight', default=1))
scale = max(cost.values())
Q = {(node, node): min(-cost[node] / scale, 0.0) for node in G}
Q.update({edge: lagrange for edge in G.edges})
return Q
def weighted_erdos_graph(nodes, prob, seed =None):
"""Generates an erdos graph with weighted nodes
https://en.wikipedia.org/wiki/Erd%C5%91s%E2%80%93R%C3%A9nyi_model
Node weights randomly assigned with the same seed as the erdos graph
"""
graph = nx.erdos_renyi_graph(n=nodes, p =prob, seed=seed, directed=False)
np.random.seed(seed)
graph_weights = np.random.randint(10,size = nodes)
for i in range(0,nodes):
graph.nodes[i]["node_weight"] = graph_weights[i]
#print(list(graph.nodes(data=True)))
return graph
def the_auto_doco_mod(qubo_array,model_name,constant):
"""
Function that takes the QUBO array created for a graphing problem and converts it to a docplex model
ready for qiskit
Directly constructs the quadractic program with reference to this page
"""
number_of_variables = len(qubo_array[1]) # gets the number of variables from the length of the square qubo matrix
#mdl = Model('model_name')
mod = QuadraticProgram()
for variable in range(0,number_of_variables): # creates the binary variables from the size of the matrix
var_name = "x_" +str(variable)
mod.binary_var(name =var_name)
mod.minimize(quadratic =qubo_array) # can put in all constraints as quadractic as the binary variables mean that x_0 ^ 2 = x_0 in both cases
# not sure of the impact of this on performance however
print(mod.export_as_lp_string())
return mod
def convert_to_array(dictionary):
"""
Function to convert qubo dictionary from dwave into a numpy array
"""
####### Generate the matrix ##########
key_list = dictionary.keys()
matrix_size= np.max([element[0] for element in key_list]) # gets the matrix size by taking the biggest number from the list of keys: a bit hacky but hey, it's 3 am
qubo = np.zeros((matrix_size +1, matrix_size +1))
###### Adds diagonal values ######
for item in dictionary.items():
position = item[0]
value = item[1]
qubo[position] = value
return qubo
################## Graph Generation, QUBO & QuadracticProgram Formulation #######
erdos_14_7_456 = gp.weighted_erdos_graph(12,0.7,456)
erdos_14_array= convert_to_array(own_maximum_weighted_independent_set_qubo(erdos_14_7_456))
qp = the_auto_doco_mod(erdos_14_array,'Erdos 14',2)
######### Setting up the Statevector Simulator #######
aqua_globals.random_seed = np.random.default_rng(123)
seed = 1456
backend = Aer.get_backend('statevector_simulator')
###### Generating the Circuit #####
quantum_instance = QuantumInstance(backend,seed_simulator=seed, seed_transpiler=seed)
######## Algorithms ########
qaoa = QAOA(quantum_instance=quantum_instance, p = 1)
exact_mes = NumPyMinimumEigensolver()
######### Applying the solvers ########
qaoa_optimizer = MinimumEigenOptimizer(qaoa)
exact = MinimumEigenOptimizer(exact_mes)
########## Results ########
qaoa_result = qaoa_optimizer.solve(qp)
print("Qaoa\n",qaoa_result)
np_result = exact.solve(qp)
print("Numpy\n",np_result)
This gives the output:
Qaoa
optimal function value: -2.2222222222222223
optimal value: [0. 0. 0. 1. 1. 0. 1. 0. 0. 0. 0. 0.]
status: SUCCESS
Numpy
optimal function value: -2.2222222222222223
optimal value: [0. 0. 0. 1. 1. 0. 1. 0. 0. 0. 0. 0.]
status: SUCCESS
```
"
"['quantum-state', 'quantum-operation', 'tensor-product', 'linear-algebra']"," Title: In Stinespring dilation, can we always use a mixed state as the ancilla?Body: The Stinespring dilation theorem states that any CPTP map $\Lambda$ on a system with Hilbert space $\mathcal{H}$ can be represented as $$\Lambda[\rho]=tr_\mathcal{A}(U^\dagger (\rho\otimes |\phi\rangle\langle \phi|)U)$$ where $\mathcal{A}$ is an ancilla, $|\phi\rangle\in\mathcal{A}$ is an arbitrary pure state, and $U$ is a unitary on the joint system $\mathcal{H}\otimes\mathcal{A}$. Importantly, this works for any choice of the state $|\phi\rangle\in\mathcal{A}$ -- that is, neither does $|\phi\rangle\in\mathcal{A}$ have to depend on $\Lambda$, nor is a specific choice of $|\phi\rangle\in\mathcal{A}$ required.
Would this representation still be valid if, instead of attaching an ancilla in the pure state $|\phi\rangle\langle\phi|$, we instead attached an ancilla in some arbitrary mixed state $\sigma$? That is, given a state $\sigma$ of $\mathcal{A}$, I would like to know whether
for every CPTP channel $\Lambda$,
there exists a unitary $U$ on $\mathcal{H}\otimes\mathcal{A}$ such that
$$\Lambda[\rho]=tr_\mathcal{A}(U^\dagger (\rho\otimes \sigma)U).$$
"
"['notation', 'quantum-memory']"," Title: What does the term efficiency mean when talking about quantum memories?Body: Lots of papers about quantum memories talk about the efficiency generally or the storage/retrieval efficiency as a figure of merit. What exactly does this term mean?
My intuition would be that it would be related to the fidelity between the state that goes into the memory and the state that comes out, since I would have thought that was the most important figure of merit, but the same papers also talk about fidelity, so it can't be that. And why is it important that it is high?
My understanding of quantum memory is that you want to store a state for a long time with little decoherence, but that seems to only depend on the fidelity.
"
"['pauli-gates', 'trapped-ion']"," Title: Expanding two rotation operatorsBody: I have the following operators acting on two qubits, denoted as $(1)$ and $(2)$:
$$T_1=\displaystyle\exp\left(-i\frac{\pi}{4}Z\otimes Z\right)\cdot R_z^{(1)}\left(\frac{\pi}{2}\right)\cdot R_z^{(2)}\left(\frac{\pi}{2}\right),\quad T_2=R_y^{(2)}\left(-\frac{\pi}{2}\right)\cdot C_Z\cdot R_y^{(2)}\left(\frac{\pi}{2}\right).$$
I should prove that up to global phases $T_1=C_Z$ and $T_2=C_X$ (the controlled $Z$ and $X$ gates).
For convenience, I omit the labels for the qubits, which should be clear by the ordering. Using the usual expansion for rotations, I ended up finding
$$T_1=\frac{1}{2\sqrt 2}(\mathbb I\otimes\mathbb{I}-iZ\otimes Z)(\mathbb I\otimes \mathbb I-iZ\otimes\mathbb I)(\mathbb I\otimes \mathbb I-i\mathbb I \otimes Z)=\frac{1+i}{\sqrt 2}\begin{pmatrix} -Z \\ & \mathbb I\end{pmatrix},\\ T_2=\frac{1}{2}(\mathbb I\otimes \mathbb I+i\mathbb I\otimes Y)C_Z(\mathbb I\otimes \mathbb I-i\mathbb I\otimes Y)=\begin{pmatrix} \mathbb I & \\ & X\end{pmatrix}.$$
So, I've checked the calculations a few times and it looks like there is something wrong with the first operator. Here's the catch: there was a mistake in the original $T_2$ I was given that I had to change in order to find the correct sequence to obtain a $C_X$, and there might be a similar problem with $T_1$ (unless I am of course making some mistake somewhere). Does anyone see what the issue may be?
(As a reference, $T_1$ comes from the interaction shift in NMR computing, while $T_2$ from Wineland's experiment with trapped ions).
"
['quantum-gate']," Title: Implementing controlled $U_3$ gate from $R_{\hat{n}}$ with given parametersBody: This is a follow-up question to solve for parameters of a controlled $U_3$ gate. Suppose I have the unit vector $\hat{n} = (n_x,n_y,n_z)$ and an angle $\xi$ (assume we know both of them). Then, we could calculate
$$
\begin{align}
\begin{aligned}
R_{\hat{n}}(\xi) &= \cos(\frac{\xi}{2})I-i\sin(\frac{\xi}{2})(\hat{n}\cdot\vec\sigma)\\
&= \cos(\frac{\xi}{2})I-i\sin(\frac{\xi}{2})\begin{bmatrix}
n_z & n_x-in_y\\
n_x+in_y & -n_z
\end{bmatrix}\\
&=\begin{bmatrix}
\cos(\frac{\xi}{2})-i\sin(\frac{\xi}{2})n_z & -i\sin(\frac{\xi}{2})(n_x-in_y)\\
-i\sin(\frac{\xi}{2})(n_x+in_y) & \cos(\frac{\xi}{2})+i\sin(\frac{\xi}{2})n_z
\end{bmatrix}
\end{aligned}
\end{align}
$$
Then, an arbitrary single qubit rotation could be written as $U = e^{i\alpha}R_{\hat{n}}(\xi)$. Assume we also know the value of $\alpha$, how can we implement the controlled-$U$ in qiskit? I'm really confused with how can I utilize the (controlled) $U_3$ gate, which is defined as
\begin{align}
U_3(\theta,\phi,\lambda)=
\begin{bmatrix}
\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{bmatrix}.
\end{align}
More specifically, if we want to implement the controlled version of \begin{align}
U = e^{i\alpha}R_{\hat{n}}(\xi)
\end{align}
Which should be treated as $U_3$? $U$ or $R_{\hat n}(\xi)$? Any suggestions for figuring out the arguments of $U_3$? Do I need to worry about phase kickback?
Thanks a lot for the help!
"
"['measurement', 'probability', 'povm', 'state-discrimination']"," Title: How to find the POVM that optimally distinguishes between two given states?Body: A quantum state preparation machine emits a state $\rho_0$ with probability $2/3$ and emits the state $\rho_1$ with probability $1/3$. We aim to make the best guess which one is it using a set of two POVM operators $\{E_0,E_1\}$. The probability of success is simply:
\begin{equation}
p_{\text{succ}}=\frac{2}{3}\text{tr}(E_0\rho_0)+\frac{1}{3}\text{tr}(E_1\rho_1).
\end{equation}
How to find the POVMs such that $p_{\text{succ}}$ is maximized? Note that the states need not be necessarily qubits, they can be general qudits.
My guess is that we can take $E_0=\rho_0$ and $E_1=I-\rho_0$, in which case, if the density matrices have a corresponding pure orthonormal states, we have $p_{\text{succ}}=1$, which should be the case. But how to check if that is optimal?
"
"['programming', 'qiskit', 'quantum-state']"," Title: Can I see Probability in complex form after measuring the state of the qubit on quantum computer?Body:
Let's say I have a qubit
$$\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$$
so when we measure it will calculate $|\alpha_1 + i\alpha_2|^2$ and $|\beta_1 + i\beta_2|^2$ ,and it will give the state with highest probability.
enter preformatted text here
vector = [159+625j,3+71j]
print(vector)
norm = np.linalg.norm(vector)
print(norm)
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
initial_state = vector/np.linalg.norm(vector)
print('initial state is')
print(initial_state)
qc.initialize(initial_state, 0)
qc.x(0) ###### for not gate
qc.h(0) ####### for hadamard gate
a = qc.draw()
print(a)
simulator = Aer.get_backend('statevector_simulator')
qobj = assemble(qc) # Create a Qobj from the circuit for the simulator to run
result = simulator.run(qobj).result() # Do the simulation and return the result
out_state = result.get_statevector()
print(out_state)
Now the code to run on Quantum computer is
enter preformatted text here
IBMQ.load_account()
#provider = IBMQ.get_provider = ('ibm-q')
provider = IBMQ.load_account()
qcomp= provider.get_backend('ibmq_qasm_simulator')
job = execute(qc,backend=qcomp)
from qiskit.tools.monitor import job_monitor
job_monitor(job)
result = job.result()
plot_histogram(result.get_counts(qc))
when we run this on Quantum computer we will get a graph with probabilities on it are those probabilities calculated using $|\alpha_1 + i\alpha_2|^2$ and $|\beta_1 + i\beta_2|^2$ these formulas?
is it possible to extract in the form of a complex number like $a+ib$ not just like 0.865 or something like that, can I see what are my $\alpha$'s and $\beta$ 's after measuring?
"
"['programming', 'quantum-gate', 'qiskit', 'quantum-state']"," Title: How do I get sate vector for each shot running on a quantum computer?Body: I was running this code on a quantum computer how can I generate a state vector for each shot while running on a quantum computer?
qikit code
## initiate alpha beta with own values
vector = [alpha,beta]
print('non normalised vector form a multi vector is')
print(vector)
norm = np.linalg.norm(vector)
print(norm)
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
initial_state = vector/np.linalg.norm(vector)
print('initial state is')
print(initial_state)
qc.initialize(initial_state, 0)
qc.x(0) ###### for not gate
qc.h(0) ####### for hadamard gate
a = qc.draw()
print(a)
simulator = Aer.get_backend('statevector_simulator')
qobj = assemble(qc) # Create a Qobj from the circuit for the simulator to run
result = simulator.run(qobj).result() # Do the simulation and return the result
out_state = result.get_statevector()
print(out_state)
from qiskit import IBMQ
IBMQ.load_account()
#provider = IBMQ.get_provider = ('ibm-q')
provider = IBMQ.load_account()
qcomp= provider.get_backend('ibmq_qasm_simulator')
job = execute(qc,backend=qcomp)
from qiskit.tools.monitor import job_monitor
job_monitor(job)
result = job.result()
plot_histogram(result.get_counts(qc))
"
"['qiskit', 'textbook-and-exercises', 'unitarity']"," Title: Textbook 2.5 (Qiskit) - Unitary and Hermitian matricesBody: In section 2.5 of the Qiskit textbook, it states that $X$, $Y$, $Z$ and $H$ are examples of unitary Hermitian matrices. As I understand it, this means that the following rule applies: $$UU^\dagger=U^\dagger U=1$$
I can't get the second part of this to work. Taking $X$ as an example: $$\begin{bmatrix}0 & 1\\1 & 0\end{bmatrix}.\begin{bmatrix}0 & 1\\1 & 0\end{bmatrix}$$
We can immediately see that $U U^ \dagger=U^\dagger U$ (as they're the same), but when I do an inner product, I get: $$(0\times0)+(1\times1)+(1\times1)+(0\times0)=2$$
Am I doing my matrix multiplication wrong, or am I forgetting something?
"
"['qiskit', 'cirq', 'machine-learning', 'quantum-enhanced-machine-learning', 'nisq']"," Title: What are the libararies for Machine Learning on NISQ Chip? And What are the roadmaps?Body: Nowadays quantum learning is hiring. And we can see mainly two different area. One of them is variational algorithms part. And the other one is classical learning for quantum systems like NISQ. (Some of scientists call both areas as quantum learning wheras some scientists call the second one as a classical learning for quantum system)
Regarding variational part, there are many libraries like tensorflow quantum, qiskit ...
But for the second part, I would like to learn what is good. For instance we can simulate photonic chips with Simphony or gds helpers. But my aim is not to simulate photonic chips. My aim is to train integrated photonic chips for noises. So which libraries are good for that. For instance is cirq enough for that? or should I use another libraries? Or should I start to simulate my chip and after that I should use some additional libraries like tensorflow quantum or qiskit or cirq?
"
"['quantum-walks', 'dynamics']"," Title: How to prove that a naive quantum random walk is non-unitaryBody: A 2000 paper by Nayak and Vishwanath provides an analysis of the dynamics of quantum random walks. In this paper, they mention a "naive" approach to defining a walk. I include the quote as follows:
In direct analogy, one may naively try to define quantum walk on the
line as follows: at every time step, the particle moves, in
superposition, both left and right with equal amplitudes (perhaps with
a relative phase difference). However, such a walk is physically
impossible, since the global process is non-unitary.
Intuitively, I imagine this is the case because, without further qualification, it seems that the various probability amplitudes would interfere constructively and lead to a wavefunction that was not normalized. Although it still seems like it might be possible to induce a relative phase difference such that normalization is achieved.
How does one prove/verify the author's statement in a formal way that would be satisfying to theorists?
"
"['density-matrix', 'linear-algebra']"," Title: Does every channel admit a Stinespring dilation using as ancilla a mixed state?Body: The Stinespring dilation theorem states that any CPTP map $\Lambda$ on a system with Hilbert space $\mathcal{H}$ can be represented as $$\Lambda[\rho]=tr_\mathcal{A}(U^\dagger (\rho\otimes |\phi\rangle\langle \phi|)U)$$ where $\mathcal{A}$ is an ancilla, $|\phi\rangle\in\mathcal{A}$ is an arbitrary pure state, and $U$ is a unitary on the joint system $\mathcal{H}\otimes\mathcal{A}$. Importantly, this works for any choice of the state $|\phi\rangle\in\mathcal{A}$ -- that is, neither does $|\phi\rangle\in\mathcal{A}$ have to depend on $\Lambda$, nor is a specific choice of $|\phi\rangle\in\mathcal{A}$ required.
Would this representation still be valid if, instead of attaching an ancilla in the pure state $|\phi\rangle\langle\phi|$, we instead attached an ancilla in some arbitrary mixed state $\sigma$? That is, given a state $\sigma$ of $\mathcal{A}$, I would like to know whether
for every CPTP channel $\Lambda$,
there exists a unitary $U$ on $\mathcal{H}\otimes\mathcal{A}$ such that
$$\Lambda[\rho]=tr_\mathcal{A}(U^\dagger (\rho\otimes \sigma)U).$$
"
"['quantum-gate', 'quantum-state', 'entanglement', 'textbook-and-exercises', 'superposition']"," Title: How to get a qubit into superposition?Body:
I have a qubit
$$\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$$
so if i give values $\alpha_1 + i\alpha_2 = 1 + 4i$ and $\beta_1 + i\beta_2 = 3 + 4i$ i will nomralise these and give it to psi
now when I measure using qiskit and plot it will be like 0.6 in state zero and 0.4 in state is there any way that I can make it an equal probability?
I tried passing it through Hadamard gate but it does not give me equal probability.
"
"['classical-computing', 'speedup', 'quantum-advantage']"," Title: Generally speaking, are quantum speedups always due to parallelization of a given problem?Body: We know that quantum computers use the wave-like nature of quantum mechanics to perform interference. Sometimes we can use this interference to perform specific algorithms that will cause enough interference to have speedup relative to a classical computer.
But, generally speaking, are quantum speedups always due to parallelization of a given problem?
The converse statement might be more clear: Is there an example of quantum speedup for an algorithm in which the classical equivalent is not parallelizable?
EDIT:
To try to make this even more clear, imagine that I have a classical problem that I will apply some specific classical code to solve (such as searching for a certain element in a list by looping through each element and checking if it matches the described element).
Practically speaking: If I were to optimize this code with a GPU, I would identify what parts of my code can be parallelized. (and I probably wouldn't be thinking of things like P=NP). For GPUs, I don't think I need to solve some general proof about P=NP or NP = CP in order to get an intuitive sense that GPUs speed up code when things can be parallelized.
Are quantum computers the same? Generally speaking (in the same way I am thinking about GPU speedup), are speedups always do to parallelization?
"
"['tomography', 'bb84', 'qkd']"," Title: Can quantum state tomography break bb84?Body: I am currently reading through this paper and read some of the wikipedia pages on weak measurement and quantum tomography and I am curious if weak measurement could be used to break BB84 quantum key distribution. In particular: couldn't an eavesdropper estimate the states going through the channel? Especially since there are only 4 possible states to estimate.
"
['terminology']," Title: What is meant by the term ""quantum interference""?Body: What is meant by the term "quantum interference" in the context of quantum computing and quantum algorithms?
"
"['qiskit', 'quantum-state', 'teleportation']"," Title: Can I keep data into qubit and teleport?Body: I was reading about teleportation I have some question about it. Can I keep normalized data (some customized data) on probability amplitudes (which are complex numbers) of a qubit (Alice's side)? Then after teleporting this qubit can I retrieve custom data on the receiving side (called as Bob's side)? Is this possible scenario or not? Is there any Qiskit code running on quantum computer available for this?
"
['programming']," Title: Should I learn a low-level QC programming language?Body: I've referred to some programming language recommendation questions on here, so I thought I'd post a follow-up question here. I'm a total beginner to the field but want to seriously learn it. Is there a low-level, QC-equivalent of assembly language, and is it worth it to learn that at this stage? Do existing QC programming languages provide that low-level functionality?
And a minor second clarification - if I commit to learning any particular framework like Qiskit or Q#/QDK - is there a risk of that framework going obsolete depending on which company wins out in this QC race in the future?
"
"['quantum-state', 'bloch-sphere', 'clifford-group']"," Title: Which states can reached using single-qubit Clifford gates?Body: Starting with the qubit state $|0\rangle$, which single-qubit states can be obtained by applying single-qubit Clifford gates, i.e. Pauli + Hadamard + $S$ gates?
"
"['unitarity', 'clifford-group']"," Title: How can I construct a universal transformation using Clifford+T gates?Body: How can I construct, using Pauli, Hadamard and $T$ gate, a universal transformation $U$ such that $U|0\rangle$ has a less than $\frac{\pi}{4}$ complementary angle with $|0\rangle$?
"
"['unitarity', 'information-theory', 'entropy']"," Title: How do Rényi entropies act under unitary time evolution?Body: I am trying to find information/ help on Rényi entropies given by
$$ S_n(\rho) = \frac{1}{1-n} \ln [Tr(\rho^n)] $$
and how it acts under unitary time evolution? Is the entropy independent on the state of $\rho$ i.e it doesn't matter if $\rho$ is pure or mixed? I am also unsure on how to apply Von Neumann's equation
$$ \rho(t) = U(t, t_0) \rho(t_0) U^{\dagger} (t, t_0) $$
In order to see how it acts.
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix', 'entropy']"," Title: Calculate the von Neumann Entropy of a two-qubit entangled stateBody: After working through an exercise I got a confusion answer/solution that either may be because I've made a mistake or I'm not understanding von Neumann Entropy.
I have the two qubit system
$$ | \psi \rangle = \cos(\theta) \rangle 1 \rangle | 0 \rangle + \sin(\theta) | 0 \rangle | 1 \rangle $$
And I want to calculate the von Neumann entropy
$$ S = - Tr ( \rho_A \ln \rho_A ) $$
I got $\rho_A$ as
$$ \rho_A = \begin{pmatrix}
\cos^2 (\theta) & 0 \\ 0 & \sin^2 (\theta)
\end{pmatrix} $$
Thus the von Neumann entropy as
$$ S = - Tr ( \begin{pmatrix}
\cos^2 (\theta) & 0 \\ 0 & \sin^2 (\theta)
\end{pmatrix} \ln \begin{pmatrix}
\cos^2 (\theta) & 0 \\ 0 & \sin^2 (\theta)
\end{pmatrix} ) $$
The natural log of the matrix is
$$ \ln \rho_A = PDP^{-1} $$
$$ = \begin{pmatrix}
1 & 0 \\ 0 & 1
\end{pmatrix} \begin{pmatrix}
\ln(\cos^2 (\theta)) & 0 \\ 0 & \ln(\sin^2 (\theta))
\end{pmatrix} \begin{pmatrix}
1 & 0 \\ 0 & 1
\end{pmatrix} $$
$$ = \begin{pmatrix}
\ln(\cos^2 (\theta)) & 0 \\ 0 & \ln(\sin^2 (\theta))
\end{pmatrix} $$
$$ S = - Tr ( \begin{pmatrix}
\cos^2 (\theta) \cdot \ln(\cos^2 (\theta)) & 0 \\ 0 & \sin^2 (\theta) \cdot \ln(\sin^2 (\theta))
\end{pmatrix} ) $$
Perhaps I am not understanding but this answer does not make any sense? The trace of that matrix cannot be simplified further and I don't get an actual answer that doesn't depend on $\theta$. Also in this case the values of $\theta$ which make $\rho_A$ a pure state is any $\theta$ and the same can be said for values of $\theta$ which make is a maximally mixed state?
"
"['simulation', 'hamiltonian-simulation', 'unitarity', 'linear-algebra']"," Title: Matrix multiplication through Block EncodingsBody: For a project, I want to simulate a matrix multiplication on a simulated quantum circuit. Assuming that we have a matrix $A\in \mathbb{R}^{m\times n}$ stored in a quantum superposition, i.e.
$$|A\rangle= \frac{1}{||A||_F}\sum_{i,j=0}^{n-1}{a_{ij}}|i,j\rangle$$
and a vector $b\in \mathbb{R}^{n\times 1}$ stored in
$$|b\rangle= \frac{1}{||b||}\sum_{i}^{n-1}{b_{i}}|i\rangle$$
How can I find a unitary, such that
$$U|b\rangle\approx|Ab\rangle?$$.
I'm right now looking at block-encodings (https://arxiv.org/abs/1804.01973, https://arxiv.org/abs/1806.01838), where they argue, that we can find a block encoding of $A$ as a unitary of form
$$U=\left(\begin{array}{cc}
A / \alpha & . \\
. & .
\end{array}\right)$$
by decomposing it into two state-preparation unitaries $U_L$ and $U_R$, s. t.
$$
\begin{array}{l}
U_{L}:|i\rangle|0\rangle \rightarrow |i\rangle\left(\sum_{j=0}^{n-1}{\frac{A_{i,j}}{||A_{i,\cdot}||_F}|j\rangle} \right)=|i\rangle|A_{i,\cdot}\rangle\\
U_{R}:|0\rangle|j\rangle \rightarrow \left(\sum_{i=0}^{n-1}{\frac{||A_{i,\cdot}||}{||A||_F}|i\rangle} \right)|j\rangle=|\tilde{A}\rangle|j\rangle
\end{array}
$$
where $|A_{i,\cdot}\rangle$ represents the $i$-th row of A and $|\tilde{A}\rangle$ represents the vector of the row-norms of $A$, i.e $\tilde{A}\in \mathbb{R}^m$ with $\tilde{A}_i = ||A_{i,\cdot}||$ (see Theorem 5.1 https://arxiv.org/pdf/1603.08675.pdf). Then they claim that $U=U_{L}^{\dagger} U_{R}$ is a block-encoding of A (see https://youtu.be/zUpHcpIq0Ww?t=1678).
However, I struggle to find the circuits for $U_L$ and $U_R$, even for a simple $n=m=2$ problem. Any hints?
"
"['quantum-gate', 'quantum-state', 'mathematics', 'textbook-and-exercises', 'tensor-product']"," Title: How does the sum of two operators act on a two-level system of qubits?Body: I am confused how the sum of N operators will act on an N-level system of qubits. Here, lets say N=2 so the state is $|00⟩_{CD}$. Then how will this operator $ X_{C} + Z_{D} ⊗ I_{C} + X_{D}$ act on this state?
Is it distributive like this:
$ (I _{C} + X_{D}) |00⟩_{CD} = I_{C}|00⟩_{CD} + X_{D}|00⟩_{CD} = |00⟩_{CD} + |01⟩_{CD}$?
And then $ X_{C} + Z_{D}$ would act on each of the terms ($|00⟩_{CD}$ + $|01⟩_{CD}$) above, giving 4 terms?
Some intuition on how/why this happens would be appreciated. How can you construct the sum of the matrices of $I _{C}$ and $X_{D}$?
"
"['quantum-state', 'physical-realization', 'error-mitigation']"," Title: Crosstalk error of simultaneous cnotsBody: We can use simultaneous randomized benchmarking (SRB) to quantify the crosstalk impact of simultaneous CNOTs. The crosstalk error is caused by many reasons, for example, the always-on ZZ interaction, the crosstalk between microwave lines.
My question is, is the number given by SRB experiment an average of all these reasons? Which one is the most important reason to cause crosstalk error between simultaneous cnots? Why is the error rate of cnot increased a lot during simultaneous executions?
"
"['quantum-gate', 'quantum-state', 'algorithm', 'entanglement', 'bell-basis']"," Title: What gate combinations create entangled two-qubit states?Body: I know that in order to make a two quit entangled state, this quantum circuit is used:
But I was wondering if there are any other gate combinations which also create entangled two quit states.
If there are other quantum circuits which achieve this, I was wondering if they would also create any one of the four bell states. Thanks in advance.
Cross-posted on physics.SE
"
"['quantum-gate', 'entanglement', 'teleportation', 'communication', 'qutrit']"," Title: Can someone elaborate how to use Qutrits to do teleportation? And the unitary operation Bob needs to do?Body: I can understand doing teleportation by using qubits, however, I am stuck there when it comes to qutrits and the operation Bob needs to perform. Suppose Alice and Bob are sharing the most entangled states in the beginning ie:$\frac{1}{\sqrt3}(|00\rangle+|11\rangle+|22\rangle)$ and teleport a qutrit $|\psi\rangle=a|0\rangle+b|1\rangle+c|2\rangle$.
Like how to get the 9 bell states?
And if the outcome is |ψ10⟩ Then what should Bob do?
"
"['algorithm', 'grovers-algorithm', 'oracles']"," Title: How can Grover's algorithm be implemented when having a string or other data type as input?Body: For some reason, I'm having difficulty with a seemingly very basic component of Grover's. When reading most explanations, the problem is framed as "consider an unstructured database of N items. If we are looking for value $\omega$, then the oracle marks the item, the amplitude is increased," and so on. However, my understanding is this, and please correct me:
"Given an unstructured database of N items, a quantum database exists containing N items with indices $|0\rangle ... |N\rangle$. If we are looking for a value $\omega$, an oracle function finds $\omega$ in the database, marks the index $|X\rangle$ for $\omega$, and the algorithm proceeds to increase the amplitude of $|X\rangle$".
In this understanding, the quantum states act as indices for "real" entries in some unstructured database, like names or phone numbers. I am getting confused in that most explanations seem to be
- Considering a specific quantum state to look for, i.e. $|1001\rangle$.
- Implementing an oracle specifically for the purpose of marking and amplifying this state, and
- Showing that the oracle did, in fact, amplify that state.
I would think that the point of the oracle would be to mark whichever state acted as the index for a desired value $\omega$, not the other way around. That being said, how could someone implement this in the context of having a string or other data type as input? I’m more focused on the concept in general, but the issue of data types arises for me necessarily.
I.e., looking for value "1" as $\omega$ in this table:
| Index |
Value |
| 00> |
2 |
| 01> |
0 |
| 10> |
3 |
| 11> |
1 |
should use the oracle to find 1, mark the state $|11\rangle$, and amplify $|11\rangle$ to act as a return value.
Any advice would be greatly appreciated.
"
"['programming', 'qiskit', 'algorithm', 'vqe']"," Title: Why does the Qiskit tutorial for the Variational Quantum Linear Solver not work properly?Body: I am following this very nice qiskit tutorial on how to implement a simple variational quantum linear solver (VQLS). There are 3 examples implemented in the tutorial all of which are solving the $Ax=b$ problem, however I can only get the first one to work consistently. To be clear, for the discussion below, I am using the exact code given on their page.
Looking at their second example where $A = 0.55I + 0.225Z_2 + 0.225Z_3$ the solver fails to find an adequate solution. To show this, I use a metric defined on their page to measure the accuracy of the solution: $b(Ax)/|Ax|^2$. An accurate solution will be near $1$, however, they report $0.2920$ demonstrating that their method has failed. This is strange because they claim that it has succeeded. This can be easily checked by taking the optimized parameters they provide which are given as the following vector:
x: array([2.38122341, 1.98992817, 4.69971104, 1.56178653, 3.12971691,1.56423666, 0.66469388, 4.26774393, 0.7439952 ])
These parameters can be directly input into their apply_fixed_ansatz function to obtain the solution $x$. Doing this, one finds that $Ax\neq b$.
My question is, is the tutorial wrong as I have stated? If so, how is it wrong and what can I do to fix it? Otherwise, am I misunderstanding the tutorial and if so, where am I going wrong?
"
"['programming', 'qiskit', 'vqe', 'chemistry']"," Title: Need some help with simulating molecules with VQEBody: I have studied the example of the simulation of LiH molecule in Learning Quantum Computation using Qiskit. It is available on this link: https://qiskit.org/textbook/ch-applications/vqe-molecules.html#VQE-Implementation-in-Qiskit .
I don't understand the following cell:
Why freeze_list and remove_list are initialized in this way?
How does this procedure work?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'density-matrix']"," Title: How do you mix two pure states to obtain a mixed state?Body: If we have the following two states
\begin{equation}
|\psi\rangle_1 = \frac{1}{\sqrt{2}}|0\rangle_A|0\rangle_B + \frac{1}{\sqrt{2}} |1\rangle_A |1\rangle_B
\end{equation}
\begin{equation}
|\psi\rangle_2 = \frac{1}{\sqrt{2}}|0\rangle_A|0\rangle_B - \frac{1}{\sqrt{2}} |1\rangle_A |1\rangle_B
\end{equation}
How do you mix them with the same proportion to create a mixed state? What would be the resulting density operator?
"
"['programming', 'qiskit', 'ibm']"," Title: Error while running Qiskit code on real quantum computerBody: I was trying to run this code on a quantum computer but I was getting an error can anyone suggest how to resolve this error?
enter preformatted text here
vector = [(159+625j), (3+71j)]
norm = np.linalg.norm(vector)
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
initial_state = vector/np.linalg.norm(vector)
print('initial state is')
print(initial_state)
qc.initialize(initial_state, 0)
qc.x(0) ###### for not gate
qc.h(0) ####### for hadamard gate
qc.snapshot('final', snapshot_type='statevector')
a = qc.draw()
print(a)
IBMQ.load_account()
#provider = IBMQ.get_provider = ('ibm-q')
provider = IBMQ.load_account()
qcomp= provider.get_backend('ibmq_belem')
job = execute(qc,backend=qcomp)
from qiskit.tools.monitor import job_monitor
job_monitor(job)
result = job.result()
plot_histogram(result.get_counts(qc))
When I ran this through the quantum computer I am getting this error:
Cannot unroll the circuit to the given basis, ['id', 'rz', 'sx', 'x', 'cx', 'reset'].
No rule to expand instruction multiplex1_dg.
"
"['quantum-state', 'projection-operator', 'trace-distance']"," Title: If $\rho \approx_{\varepsilon}\sigma$, how to find $\Pi\rho\Pi$ to ensure that $\text{supp}(\Pi\rho\Pi)\subset\text{supp}(\sigma)$?Body: Let $\rho$ and $\sigma$ be positive semidefinite operators with trace less than or equal to 1. Let $\rho\approx_{\varepsilon}\sigma$ i.e. they are close in some distance, such as the trace distance.
Assume that we have $\text{supp}(\rho)\not\subset\text{supp}(\sigma)$ i.e. there exists some vector $v$ such that $v^\dagger\rho v > 0$ but $v^\dagger\sigma v = 0$. It seems like I should be able to apply some projector to $\rho$ to obtain $\rho' = \Pi\rho\Pi$ where
- $\rho'\approx_{\varepsilon}\rho$
- $\text{supp}(\rho')\subset\text{supp}(\sigma)$
The intuition is that there are only some at most $\varepsilon-$small eigenvalues that I need to remove from $\rho$ to get it into the support of $\sigma$. Can someone help with how to construct such a projector?
"
"['quantum-gate', 'circuit-construction', 'gate-synthesis', 'unitarity']"," Title: Find unitary such that $U:|i\rangle|0\rangle\rightarrow|i\rangle|A_i\rangle$Body: Let's assume I have two qubits of state $|A_0\rangle$ and $|A_1\rangle$ correspondingly stored in a quantum memory. How do I find a Unitary $U$ that acts on another register of 2-qubits such that
$$U:|i\rangle|0\rangle\rightarrow|i\rangle|A_i\rangle?$$
Is such a unitary even possible or is this forbidden due to the no-cloning theorem? However, I don't want to clone the states $|A_0\rangle$ and $|A_1\rangle$, but rather do some kind of multiplexing with them.
That's what my register looks like:
In the end, I want to turn the $|0\rangle$ qubit into $|A_i\rangle$ depending on the state of the $|i\rangle$ qubit. Is something like this generally possible?
"
"['programming', 'quantum-circuit', 'photonics', 'nisq', 'strawberryfields']"," Title: Design NISQ Circuit with StrawberryFieldsBody: I am trying to design this circuits with strawberry fields. However I could not connect my first and second qubit mode:
orange boxes are beam splitters, blue boxes are phase shifters. The green box is nothing. (There was a letter of brand so I wanted to close it)
First two lines corresponds to 2 modes of my first qubit: Let's say: 0_a and 1_a and the other two lines corresponds my second qubit modes Let's say 0_b and 1_b
My code is here:
prog = sf.Program(4)
with prog.context as q:
ops.BSgate() | (q[0], q[1])
ops.BSgate() | (q[2], q[3])
ops.Rgate(0.5719) | q[0]
ops.BSgate() | (q[0], q[1])
ops.Rgate(-1.9782) | q[1]
ops.BSgate() | (q[0], q[1])
ops.Rgate(-1.9782) | q[2]
ops.BSgate() | (q[2], q[3])
ops.Rgate(-1.9782) | q[2]
ops.BSgate() | (q[2], q[3])
eng = sf.Engine("fock", backend_options={"cutoff_dim": 5})
prog.print()
#prog.draw_circuit(tex_dir='./circuit_tex', write_to_file=True)
My result is here
and indeed I could not make this connection:
Any help for me?
Am I writing to correct code?
"
"['quantum-state', 'quantum-operation']"," Title: Does a quantum channel map the maximally mixed input state into an output state with maximal rank?Body: Consider a quantum channel $\Phi : M_n \rightarrow M_m$ and let $\frac{\mathbb{I}_n}{n}$ be the maximally mixed input state. For all input states $\rho\in M_n$, is it true that
$$\quad \text{rank} \, \Phi (\rho) \leq \text{rank}\, \Phi \left(\mathbb{\frac{I_n}{n}}\right)?$$
"
"['algorithm', 'notation']"," Title: What is meant by $\log(m)$ qubitsBody: I am reading a paper on Quantum Computing. What does it mean when authors says "$\log(m)$-qubits. I know what does $n$-qubit mean where $n$ is positive integer, but $\log(m)$ may not be an integer, in that case how would we define $\log(m)$ qubit.
https://www.researchgate.net/publication/348796217_Quantum_Bloom_filter_and_its_applications
"
"['quantum-state', 'quantum-operation']"," Title: Minimal output dimension of a quantum channelBody: Consider quantum channels $\Phi : M_n \rightarrow M_{d_1}$ and $\Psi : M_n \rightarrow M_{d_2}$ with $d_1\leq d_2$. We say that $\Phi$ is isometrically extended by $\Psi$ (denoted $\Phi \leq_{\text{iso}} \Psi$) if $\exists$ an isometry $V: \mathbb{C}^{d_1} \rightarrow \mathbb{C}^{d_2}$ such that
$$\forall \, \rho\in M_n: \qquad \Psi (\rho) = V\Phi (\rho) V^\dagger . $$
Now, define the minimal output dimension of a channel $\Psi : M_n \rightarrow M_{m}$ as follows:
$$\text{min out }(\Psi) = \text{min} \{d \in \mathbb{N} : \exists \, \text{channel } \Phi : M_n \rightarrow M_d \text{ such that } \Phi \leq_{\text{iso}}\Psi \}.$$
I claim that for any given channel $\Psi : M_n \rightarrow M_m$, $$\text{min out }(\Psi) = \text{rank}\,\Psi (\mathbb{I_n}),$$ where $\mathbb{I_n}\in M_n$ is the identity matrix. Can someone help me prove this?
"
"['algorithm', 'ibm-q-experience', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: How do we implement QKNN algorithm on our datasetBody: What could be the steps to implement a distance based classifier (eg Qknn) on our dataset using quantum computing?
I read a paper on "Distance based classifier using Iris dataset". I wanted to implement the same on my machine considering any random dataset taking 2 datapoints and 2 features as considered in the paper. SO do i need to make some changes in the gates or where do i need to put my data values?
"
"['programming', 'ibm-q-experience', 'resource-request']"," Title: Does IBM have a publicly available tutorial on applied quantum computing and how does one use it? Any Reviews of the Tutorial?Body: I found this link and I am wondering if anyone has used it to learn or develop applications? I would like to know if people find it worth the time. I am reading the material by the way.
https://www.ibm.com/quantum-computing/developers/
"
"['vqe', 'optimization']"," Title: Is there a general proof of convergence of variational quantum eigensolvers (VQEs) to the minimum eigenvalue?Body: For QAOA it is known that in the large $p$ limit, the algorithm finds the minimum/maximum (see article A Quantum Approximate Optimization Algorithm).
Is there in general a proof for VQE starting from, let's say, uniform superposition state? Is there a standard construction of a circuit (ansatz preparation? not sure about the terminology) that the algorithm converges in some limit?
"
['ibm-q-experience']," Title: Process 3 MB of data in IBMBody: How can I process a 3 MB csv file in IBMQ?
The memory shows 433 MB. Is this the maximum file size that I can upload and process in IBMQ?
"
"['programming', 'machine-learning', 'openpulse']"," Title: Is qiskit documentation about determining $|0\rangle$ and $|1\rangle$ incorrect?Body: I'm using pi-pulse pulses on qubit Armonk for determining 0 and 1 by Machine Learning. But when I run the code from https://qiskit.org/textbook/ch-quantum-hardware/calibrating-qubits-pulse.html. I get an incorrect distribution of states $|0\rangle$ and $|1\rangle$.
For example, in the Qiskit textbook, this image looks like:
About 3 months ago, the image that I got by using this textbook was correct, but now it's not.
When I use Machine Learning for old states, I get excellent results, but now my algorithms have failed on this task.
Please, help me with my problem. I don't know, how to fix it. Why did this happen? That is the problem?
"
"['quantum-operation', 'communication', 'partial-transpose', 'channel-capacity']"," Title: What are examples of zero capacity quantum channels with Choi rank less than $d$?Body: All the currently known examples of quantum channels with zero quantum capacity are either PPT or anti-degradable. These notions can be conveniently defined in terms of the Choi matrix of the given channel:
- A channel is said to be PPT if its Choi matrix is positive under partial transposition. In other words, the partial action of such a channel on any bipartite state results in a state which stays positive under partial transposition. Maximally entangled states cannot be distilled from such states at any positive rate, which is why these states are also called bound entangled. This fact can be used to show that quantum information cannot be reliably transmitted through these channels and hence these channels have zero quantum capacity.
- A channel is said to be anti-degradable if its Choi matrix admits a two-copy symmetric extension. Such a channel operates on any input state to yield a combined output-environment state which is symmetric under exchange. One can use this fact to show that if these channels can be used to reliably transmit quantum information, it would lead to a violation of the no-cloning theorem. Hence, anti-degradable channels have zero quantum capacity.
The aforementioned classes of channels are really distinct in the sense that one class is not a subset of the other or vice versa. The two classes have a non-trivial intersection which is known to contain the well-know class of entanglement-breaking channels. Interested readers should refer to this wonderful paper for a more thorough discussion on these concepts.
I am interested in examples of such zero capacity channels $\Phi : M_d \rightarrow M_d$ which have Choi ranks strictly less than $d$. Recall that the Choi rank of a channel is the rank of its Choi matrix which equals the minimal number of Kraus operators required in the channel's Kraus representation. For $d=2$, the rank constraint forces us to look at only unitary conjugations of the form $\Phi (\rho) = U\rho U^\dagger$, which have strictly positive capacity. For the next dimension $d=3$, all examples of zero capacity channels that I know of have Choi ranks $\geq 3$ (such as the PPT channels in the depolarizing/dephasing family or the anti-degradable amplitude damping channels). Hence the question: Are there known examples of zero capacity qutrit channels with Choi rank $=2$?
Cross posted on physics.SE
"
['ibm-q-experience']," Title: How to do a POVM measurement of a quantum state in IBM's Quantum Composer?Body: I'm new to IBM, so I'm still figuring things out. I want to make a POVM measurement of a quantum state for state discrimination purposes. In other words I want a measurement that has three outcomes:
A: It's state A with 100 % certainty (or x %)
B: It's state B with 100 % certainty (or x %)
C: Can't determine if it's state A or B.
Can anyone help with how to do this in IBM's Quantum Composer?
"
"['circuit-construction', 'state-discrimination']"," Title: Conditional Statements on a Quantum ComputerBody: I've been struggling with this for a while now, and whilst I suspect the answer is unknown or very complicated, I thought I'd ask regardless.
Suppose I have some states $|\psi_i\rangle = \sum_{j=1}^n a_{ij} |j\rangle : i,n\in\mathbb{Z}^+$, and $\langle\psi_i|\psi_i\rangle=1$ holds true (i.e., are normalsied). I also have some conditional statements about the measured values these states are allowed to take to be a valid solution to my problem, using only XOR ($\oplus$) and AND ($\land$).
For instance, I might have three states $|\psi_1\rangle$, $|\psi_2\rangle$, and $|\psi_3\rangle$, which, when measured, in order to satisfy my problem must also satisfy $(\psi_1\oplus \psi_2)\land(\psi_2\oplus\psi_3)\land(\psi_1\oplus \psi_3)$. Of course, when I talk about satisfying a condition after measurement, I mean to a high probability.
How does one, or can one, go about implementing this kind of logic in a quantum circuit? I feel that since each operation would entangle the states, that this is not possible.
I've thought about and tested a Swap test, but this has a number of issues.
Any help or thoughts would be greatly appreciated.
"
"['programming', 'qiskit']"," Title: How can I represent Pauli Measurements in Qiskit's QuantumCircuit object?Body: Is there a way to represent measurements in other bases in Qiskit? The default measurement is in the Z (computational) basis. Can I also depict measurement in X, Y and general Pauli Measurements?
I know that I can apply a suitable unitary and then measure in the Z basis, but I am looking for a way to add the measurements to the circuit almost like "gates". I will be putting many such measurements in sequence in my circuits.
I will be happy to use any external/in-development tool that allows this and interfaces well with Qiskit.
"
"['quantum-gate', 'resource-request']"," Title: Are multi-qubit control RX gates scaling exponentially?Body: In https://arxiv.org/pdf/quant-ph/0303063.pdf it a method shown for implementing a multi-qubit controlled phase shift gate thath scales exponentially with n.
Are there new methods to implement these gates in polynomial time?
And does anybody know if there is a paper descring the method for impelemnting a multi-qubit controlled gate that Qiskit uses for its MCMT gate?
https://qiskit.org/documentation/stubs/qiskit.circuit.library.MCMT.html
"
"['textbook-and-exercises', 'quantum-operation']"," Title: Show that $\lambda |\phi^+\rangle \langle\phi^+| + (1-\lambda )|\phi^-\rangle \langle\phi^-|$ is the Choi–Jamiołkowski matrix of a quantum channelBody: I'm curious how to show how this matrix:
$$c = \lambda |\phi^+\rangle \langle\phi^+| + (1-\lambda )|\phi^-\rangle \langle\phi^-|$$
is the Choi–Jamiołkowski matrix of a quantum channel for any $\lambda \in [0,1]$
"
"['simulation', 'hamiltonian-simulation', 'unitarity', 'linear-algebra']"," Title: What's the state-of-the-art to calculate $|Ab\rangle$, given a matrix $|A\rangle$ and a vector $|b\rangle$ in QRAM encodingBody: Assuming that we have a matrix $A\in \mathbb{R}^{m\times n}$ stored in a quantum superposition, i.e.
$$|A\rangle= \frac{1}{\|A\|_F}\sum_{i,j=0}^{n-1}{a_{ij}}|i,j\rangle$$
and a vector $b\in \mathbb{R}^{n\times 1}$ stored in
$$|b\rangle= \frac{1}{\|b\|}\sum_{i=0}^{n-1}{b_{i}}|i\rangle.$$
How can I find a unitary, such that
$$U|b\rangle\approx|Ab\rangle?$$
"
"['quantum-state', 'partial-trace']"," Title: If $\text{supp}(\rho_{AB})\subset \text{supp}(\sigma_{AB})$, is $\text{supp}(\rho_{A})\subset \text{supp}(\sigma_{A})$?Body: For any linear operator $A$, the support of $A$ is the orthogonal complement of its kernel. Hence when we say, $supp(A)\subset supp(B)$, we have that for any vector $v$ in the kernel of $B$ i.e. $Bv = 0$, it also must be that $Av = 0$.
My question is if it is true (and if yes, how to show) that support containments for quantum states are preserved under partial trace. That is, if
$$\text{supp}(\rho_{AB})\subset \text{supp}(\sigma_{AB})$$
is it true that
$$\text{supp}(\rho_{A})\subset \text{supp}(\sigma_{A})$$
"
"['textbook-and-exercises', 'quantum-operation', 'kraus-representation']"," Title: What is the Kraus representation of the quantum channel with Choi $\lambda |\phi^+\rangle \langle\phi^+| + (1-\lambda )|\phi^-\rangle \langle\phi^-|$?Body: This matrix
$$c_{\lambda} = \lambda |\phi^+\rangle \langle\phi^+| + (1-\lambda )|\phi^-\rangle \langle\phi^-|$$
is the Choi–Jamiołkowski matrix of a quantum channel for any $\lambda \in [0,1]$.
The questions I am trying to solve are:
Provide a Kraus (operator-sum) representation of the quantum channel $T_{\lambda}$ that is described by $c_{\lambda}$ and show that $T_{1/2}$ is an entanglement breaking quantum channel and describe its action on the bloch sphere.
"
"['entanglement', 'information-theory', 'linear-algebra', 'entanglement-negativity', 'partial-transpose']"," Title: Is there an identity for the partial transpose of a product of operators?Body: The partial transpose of an operator $M$ with respect to subsystem $A$ is given by
$$
M^{T_A} := \left(\sum_{abcd} M^{ab}_{cd} \underbrace{|a\rangle \langle b| }_{A}\otimes \underbrace{|c \rangle \langle d|}_B\right)= \left(\sum_{abcd} M^{ab}_{cd} |b\rangle \langle a| \otimes |c \rangle \langle d|\right).
$$
Is there an identity for the partial transpose of the product of operators,i.e.
$$
(AB)^{T_A}= \quad ?
$$
I suspect that in general $(AB)^{T_A} \neq B^{T_A} A^{T_A} $ or even $\neq A^{T_A}B^{T_A}$.
What if $A=B$?
"
"['quantum-gate', 'qudit']"," Title: How does the NOT gate generalize beyond binary?Body: If we are working with qudits instead of qubits, how do the NOT and CNOT gates work? If the control state for a qubit system is $|1\rangle$, what is it for a $d$-ary qudit system, and why?
For instance, in a qutrit system with three basis states $|0\rangle,|1\rangle,|2\rangle$: if one had a CNOT gate, which state would trigger the NOT gate?
"
"['quantum-gate', 'qiskit', 'ibm-q-experience']"," Title: How to create a unitary gate using normalized complex numbers in qiskit?Body: If I have a normalized $(\alpha,\beta)$ as $(0.24506+0.9633i,0.0046238+0.10943i)$ for a qubit $\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$, how can I generate angles for a unitary gate by using above data and can I run this on qiskit?
"
"['textbook-and-exercises', 'pauli-gates', 'bloch-sphere', 'linear-algebra', 'tomography']"," Title: Why can any density operator be written this way? (quantum tomography)Body: From page 24 of the thesis "Random Quantum States and Operators", where $(A,B)$ is the Hilbert-Schmidt inner product:
\begin{aligned}
\rho &=\left(\frac{1}{\sqrt{2}} I, \rho\right) \frac{1}{\sqrt{2}} I+\left(\frac{1}{\sqrt{2}} X, \rho\right) \frac{1}{\sqrt{2}} X+\left(\frac{1}{\sqrt{2}} Y, \rho\right) \frac{1}{\sqrt{2}} Y+\left(\frac{1}{\sqrt{2}} Z, \rho\right) \frac{1}{\sqrt{2}} Z \\
&=\frac{(I, \rho) I+(X, \rho) X+(Y, \rho) Y+(Z, \rho) Z}{2} \\
&=\frac{I+\operatorname{tr}(X \rho) X+\operatorname{tr}(Y \rho) Y+\operatorname{tr}(Z \rho) Z}{2}
\end{aligned}
This is used for explaining quantum tomography. Can someone please explain each step clearly? I have pretty basic QC and linear algebra knowledge.
"
"['programming', 'cirq', 'pauli-gates']"," Title: Is there a way to present conjugate transpose of a Y Pauli rotation as a Cirq Operator?Body: Given:
Ry(theta) acting on one qubit
I'm trying to use existing Cirq Operators to build the conjugate transpose of the above gate. I need the operator to produce the exact unitary of the given gate for the given theta.
I'v already used cirq.optimizers.single_qubit_matrix_to_gates. It gives YPowGates but the global phase changes with theta. I need either the exact unitary of the gate or another conversion that its global phase does not change with theta.
"
"['programming', 'qutip']"," Title: Trying to simulate Weak Value Amplification using QuTiPBody: Weak Value Amplification is a procedure in which one consider a bipartite Hamiltonian of the form $H = g A \otimes B$, where $A$ is called system, $B$ is called meter and $g$ is the extremely small parameter we are interested to measure by amplification. The procedure goes as follows:
(1) The system and meter is initialized by some initial state $\vert\Psi\rangle=\vert\psi_{i}\rangle \otimes \vert \phi\rangle$. The evolution of the system $U = \exp(-igA \otimes B)$ is approximated to $1_{A}\otimes 1_{B}-ig A\otimes B$, since $g$ is extremely small. we get
$$U\vert\Psi_{i}\rangle\approx(1_{A}\otimes 1_{B}-ig A\otimes B)\vert\psi_{i}\rangle \otimes \vert \phi\rangle,$$
$$(1_{A}\vert\psi_{i}\rangle\otimes 1_{B}\vert \phi\rangle-ig A\vert\psi_{i}\rangle\otimes B\vert\phi\rangle).$$
(2) After the evolution, the system is post selected onto some final state $\vert\psi_{f}\rangle$ (which is nearly orthogonal to the initial state)
$$\langle\psi_{f}\vert U\vert\Psi_{i}\rangle\approx P_{s}(1_{B}\vert\phi\rangle - ig A_{w}B\vert\phi\rangle)$$.
Where $P_s = \langle\psi_{f}\vert\psi_{i}\rangle$ is the post-selection probability and $A_{w} = \langle\psi_{f}\vert A\vert\psi_{i}\rangle/P_{s}$ is called the weak value.
(3) If i re-exponentiate the above term, we get
$$\frac{\langle\psi_{f}\vert U\vert\Psi_{i}\rangle}{P_{s}}=\exp(-igA_{w}B)\vert\phi\rangle$$
where the exponential on the RHS is the Kraus operator acting on the meter intial state, using which one can estimate the small parameter $g$.
My attempt at solving:
(step 1) I prepare the initial state say psi1 and evolved the state according the Hamiltonian using mesolve for a short time t = np.linspace(0, 0.01, 50)
result = mesolve(H, psi1, t, c_ops = [], e_ops =[])
(step 2) The evolved state is result.states[49], but the problem I am facing is how do I make post-measurement on this with the final state?
One such dumb attempt, I did was taking the final state psif and sandwiched directly with result.states[49] as
eta = psif.dag()*result.states[49]
But my objective was to do the post-selection at a specific time, like say I weakly evolve the system for a short time say 0 to 0.1 seconds and do post-selection exactly at 0.05th second. I am really lost what to do from my (step 1). Is there a way to do post-selection in QuTiP at a specific time?
"
"['physical-realization', 'classical-computing', 'architecture']"," Title: Are classical analogues of quantum computers using superposed waves possible?Body: The trick of quantum computing is to take the advantage of wave mechanics (superposition) and entanglement. This allows to perform parallel computations/manipulations with $2^n$ superposed waves for $n$ bits.
This principle does not rely on quantum mechanics. Superposed waves do also exist in classical mechanics (although I am not sure we can make the number of tones also scale exponentially with the size, but there could be some profit).
Are there examples of efforts to create classic analogues of quantum computers that use superposed waves and manipulate those, instead of using bits in silicon chips?
(I do not mean efforts to create a virtual quantum computer)
This question might be generalized. Are/were there any efforts to try to move away from binary computers?
"
['quantum-state']," Title: Can we use space to achieve absolute zero for a quantum computer?Body: Why can't we use space to maintain absolute zero temperature required by the qubit chips and connect it to a satellite to perform computations?
"
"['programming', 'qiskit', 'ibm-q-experience', 'simulation']"," Title: Memory Requirements for Qiskit Aer SimulatorBody: I'm trying to work out how much memory is used for simulations of different sizes using the Aer simulator.
Here are my calculations:
$$ \text{Number of Qubits} = n $$
$$ \text{Number of Amplitudes} = 2^{n} $$
$$ \text{Array Size } = {2^n}^2 = 2^{2n} $$
$$ \text{ Memory in Bytes needed for double precision complex number } = 16 $$
$$ \text{ Memory needed (Bytes)} = 16 *2^{2n} $$
(I'm a bit confused at the exact definition of a GB of ram whether it's in powers of ten or two)
From this, simulations of circuits with over 18 qubits are rather difficult.
My questions are these:
- Are these calculations correct ?
- Does this stand true for both the shot based 'qasm-simulator' and 'statevector' simulator?
- AER is well coded: does it have simplifications like those described in the solution to this answer (How much memory is required to simulate a 48-qubit circuit?)?
I realise that my calculations are the worse case scenario. I think the statevector matrix would be upper triangular and so at least half of the amplitudes would be 0, meaning there would be at least some memory gained through sparse matrices !
Thank-You !
"
"['algorithm', 'complexity-theory', 'classical-computing', 'shors-algorithm']"," Title: Classical algorithm with complexity similar to Shor's discovered: Are there more efficient quantum algorithms than Shor's?Body: In the article Fast Factoring Integers by SVP Algorithms the author claims that he discovered classical algorithm for factoring integers in polynomial time. The Quantum Report mentioned here that it has similar performance to Shor algorithm which is often considered to ignite interest in quantum computers.
Of course, the new classical algorithm has to be examined closely before it is confirmed that it is really so fast as claimed.
However, I would like to know if there are other quantum algorithms besides Shor and quantum binary optimization based.
Has it been proven that Shor algorithm is optimal or could there be another even faster quantum algorithms for integers factoring?
"
"['quantum-gate', 'qiskit', 'circuit-construction', 'mathematics', 'gate-synthesis']"," Title: From mathematical notation to quantum circuit, in generalBody: I am learning the basics of quantum computing using Qiskit and I encountered a problem when I tried to solve some of our course exercises. I feel like I am missing an invisible step, the step from mathematical notation to the quantum circuit.
I am familiar with the Dirac notation and the matrices of the quantum gates, and how they transform the inputs. I can understand for instance how to achieve the effect of a Toffoli gate while only using two-qubit gates. However the problem arises when I try to encode a mathematical transformation into quantum gates. Let's start simple:
When I first learned about a CNOT gate I understood the effect, and therefore the conclusion that it was the quantum version of XOR did not surprise me that much. It just seemed a handy side-effect. Hence I can encode
$$|y⟩_1|x⟩_0→|x⊕y⟩_1|x⟩_0$$
by a CNOT gate.
qc = QuantumCircuit(q)
qc.cx(0,1)
Then I got an exercise to build a half adder:
$$|z⟩_2|y⟩_1|x⟩_0→|z⊕xy⟩_2|x⊕y⟩_1|x⟩_0$$
This confused me a lot because I do not now how to encode the AND part. Hence even this
$$|z⟩_2|y⟩_1|x⟩_0→|xy⟩_2|y⟩_1|x⟩_0$$
I would not know. Luckily the book walks over the 'adding' part of the half-adder, which is when I learned that a Toffoli gate would do the job.
qc = QuantumCircuit(3)
qc.ccx(0, 1, 2)
qc.cx(0, 1)
I hope you can see the step I am missing: I know 'tricks' for some solutions, but I don't know how to encode a general mathematical transformation. Hence I was baffled when I was asked about unitary function encoding, and to encode the following,
$$U:|y⟩|x⟩↦|f(x)+y \mod 2^m⟩|x⟩$$
where $f$ is an arbitrary boolean function $f:\{0,1\}^n↦\{0,1\}^m$. I had NO clue how to approach this.
Therefore my question is the following. How do I encode an arbitrary mathematical expression like I have given above to a quantum circuit? Most importantly: What are the general steps you take when you approach a problem like this? Right now this might seem like simple questions, but I need to understand this to be able to solve the (to me) much harder questions later in the book.
If anything is unclear I am happy to clarify.
"
"['programming', 'qiskit', 'quantum-circuit']"," Title: How do I convert a Quantum Circuit into a qobjBody: I have a Quantum Circuit launched but I want to convert it into a qobj to use the function .run from qiskit, I've tried to use the function:
qobj = assemble(QuantumCircuit)
but it returns
'QuantumCircuit' object has no attribute 'config'
and I've failed to find the "config" needed on the qiskit instructions.
Does anyone know's how do I convert it properly and fill's this configurations?
Here is a print of the qobj after assemble:
QASM Qobj: 3d6e9e20-290e-4c7d-a2e7-c0b5a8e38f2e:
Config: {'init_qubits': True,
'memory': False,
'memory_slots': 3,
'n_qubits': 3,
'parameter_binds': [],
'shots': 1024}
Header: {}
Experiments:
QASM Experiment:
Header:
{'clbit_labels': [['c', 0], ['c', 1], ['c', 2]],
'creg_sizes': [['c', 3]],
'global_phase': 0.0,
'memory_slots': 3,
'n_qubits': 3,
'name': 'circuit',
'qreg_sizes': [['q', 3]],
'qubit_labels': [['q', 0], ['q', 1], ['q', 2]]}
Config:
{'memory_slots': 3, 'n_qubits': 3}
Instruction: ry
params: [1.0]
qubits: [0]
Instruction: rz
params: [2.0]
qubits: [0]
Instruction: h
qubits: [0]
Instruction: measure
qubits: [0]
memory: [0]
Instruction: ry
params: [1.0]
qubits: [2]
Instruction: rz
params: [2.0]
qubits: [2]
Instruction: measure
qubits: [2]
memory: [2]
Instruction: ry
params: [1.0]
qubits: [1]
Instruction: rz
params: [2.0]
qubits: [1]
Instruction: sdg
qubits: [1]
Instruction: h
qubits: [1]
Instruction: measure
qubits: [1]
memory: [1]
it still's return the same error.
"
"['quantum-state', 'measurement', 'trace-distance']"," Title: Approximating an ensemble with an orthogonal ensembleBody: Consider an arbitrary ensemble $\{p_x\rho_x\}_{x\in X}$ and define the state
$$ \rho = \sum_{x\in X} \vert x \rangle\langle x \vert \otimes p_x\rho_x. $$
I am interested in understanding the quantity
$$ \inf_{\xi, \hspace{2mm}\xi_x\perp\xi_{x'}} \Vert \rho - \xi \Vert_1, \quad\quad \text{with } \Vert\cdot\Vert_1 = \operatorname{Tr}\vert\cdot\vert, $$
where the infimum is taken over all orthogonal ensembles, that is for the ensemble $\{q_x\xi_x\}_{x\in X}$ we define
$\xi = \sum_{x\in X}\vert x \rangle\langle x \vert \otimes q_x\xi_x$ and we assume $\xi_x\perp \xi_{x'}$ for all distinct $x,x'\in X$ in the sense $\operatorname{Tr}\xi_x\xi_{x'} = 0$. In particular, my curiosity is directed at having some intuition as to what a good choice of $\xi$ depending on $\rho$ is when trying to minimize the expression above. For instance, one could let $\{M_x\}_{x\in X}$ denote a set of orthogonal projections and define $\xi_x = \frac{M_x\rho_x M_x}{\operatorname{Tr} M_x\rho_x M_x}$ and $q_x = p_x$. Then
\begin{align*}
\Vert \rho - \xi\Vert_1 &= \sum_{x\in X} \Vert p_x\rho_x - p_x\xi_x\Vert_1 \\
&= \sum_{x\in X} p_x\left\Vert \left(1 - \frac{1}{\operatorname{Tr} M_x\rho_xM_x}\right)M_x\rho_xM_x - (Id-M_x)\rho_x(Id-M_x)\right\Vert_1 \\
&= \sum_{x\in X} p_x\left(\left(\frac{1}{\operatorname{Tr} M_x\rho_xM_x}-1\right)\operatorname{Tr} M_x\rho_xM_x + \operatorname{Tr} (Id-M_x)\rho_x(Id-M_x)\right) \\
&= 1 - \sum_{x\in X}\operatorname{Tr}(2M_x-Id)p_x\rho_x \\
&= 2\left(1 - \sum_{x\in X}\operatorname{Tr}M_xp_x\rho_x\right)
\end{align*}
So choosing $\{M_x\}_{x\in X}$ such that $\sum_{x\in X}\operatorname{Tr}M_xp_x\rho_x$ is maximized is a decent choice! However, is this optimal in general? Or are there any other natural constructions of $\xi$, which give a pretty good upper bound on the quantity in question?
Any help is appreciated!
"
"['quantum-gate', 'quantum-state', 'algorithm', 'tensor-networks']"," Title: Folded MPS state with Mid-circuit measurementBody: Among some documents I found to make a MPS state on quantum circuit, I can make it with stepped arrangement of unitary operators.
|0>--U-----M
|
|0>--U--U--M
|
|0>-----U--M
And also Honeywell or IBM machine support Mid-circuit measurement and qubit reuse, which we can fold this quantum circuit like,
|0>--U--M |0>--U--M
| |
|0>--U---------U--M
How can I think about bond dimension on this quantum circuit?
Do I have to use multiple qubits to make larger number of bond dimension on MPS state?
"
"['quantum-state', 'entanglement', 'unitarity', 'tensor-product']"," Title: If you apply a unitary transformation to an entangled state, is it still entangled?Body: See title. If this is not true, is there a counter example? If it is not true, does it hold true for certain combinations of unitaries and entangled states?
"
"['algorithm', 'physical-realization', 'machine-learning', 'quantum-enhanced-machine-learning', 'applications']"," Title: Claimed ""potential revenue"" from machine learning in 2023?Body: In this plot:
taken from here, IonQ is claiming to have a potential application in machine learning by 2023. What applications could they have in mind?
From what I understand, modern error correction prevents obtaining speedup from any quadratic algorithms, so the only realistic speedup could be done with algorithms faster than polynomial. From this chart:
It seems like there aren't any ML applications that are faster than quadratic without "the fine-print" that they might not be do-able in a real-life situation.
Is there something I'm missing here?
"
['algorithm']," Title: How to code the ""minimum search"" algoirithm of Dürr and Hoyer with Grover's search?Body: I am a beginner in quantum computing. I have already computed the SAT quantum solver with Grover search and then, I would like to compute the "minimum search" of Dürr and Hoyer. I am not getting how to code this algorithm. Can someone please share the coded program?
"
"['quantum-state', 'quantum-operation', 'unitarity', 'partial-trace']"," Title: What is the most general quantum operation that preserves the marginal?Body: Suppose I have two states $\rho_{AB}$ and $\sigma_{AB}$ such that the marginals $\rho_A = \sigma_A$. What is the most general operation that could have acted on $\rho$ to output $\sigma$?
For example, if there was no reduced state constraint, I think one can always find a unitary $U_{ABC}$ where $C$ is a purifying system such that $U_{ABC}\vert\rho_{ABC}\rangle = \vert\sigma_{ABC}\rangle$.
Now enforcing $\rho_A=\sigma_A$, is it true that there exists some unitary $U_{BC}$ that achieves $(I_A\otimes U_{BC})\vert\rho_{ABC}\rangle = \vert\sigma_{ABC}\rangle$? Or some other way to achieve such a transformation?
"
"['programming', 'qiskit']"," Title: How to set matplolib as default circuit drawer?Body: I've already tried the instructions on the qiskit page and even from this other question What is the location of the Qiskit config file?
but it doesn´t work, the circuit keeps looking as text based, even i restarted jupyter notebook, and nothing. The settings.conf file wasn't in the directory so i created one but still no results.
"
"['programming', 'quantum-gate', 'qiskit', 'compiling']"," Title: Two qubit gate decomposition using QiskitBody: I am writing some python code to be able to optimise the total error in two qubit gate decomposition.
I am using the Qiskit module qiskit.quantum_info.synthesis.two_qubit_decompose
My question relates to the difference between the two classes given in this code. One is TwoQubitWeylDecomposition and seems to decompose using the KAK1 method detailed on page two here.
The other, TwoQubitBasisDecomposer() allows you to input which specific two-qubit gate you want to use in the decomposition of an arbitrary SU(4) (e.g. CNOT, Molmer-Sorensen etc).
One of the methods of this class allows you to find the fidelity of a target unitary, using $0$, $1$, $2$ or $3$ implementations of the basis gate of your choice (higher fidelity with more basis gate usage). However, you have to turn the target unitary into the TwoQubitWeylDecomposition class, otherwise, you get errors (target doesn't have the attribute .a).
I'm uncertain why the target unitary needs to be a TwoQubitWeylDecomposition class. The documentation isn't very helpful either.
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Why is the subscript like this in the equation $\sum_i |\psi_i\rangle \langle\psi_i| = \sum_{ijk} u_{ij} u_{ik}^{*}|\phi_j\rangle \langle\phi_k|$?Body: In Nielsen's book when proving "Unitary freedom in the ensemble for density matrices"(Theorem 2.6):
$$\text{Suppose }|\widetilde{\psi_i}\rangle = \sum\limits_{j}u_{ij} |\widetilde{\phi_j}\rangle$$
Then in Equation 2.168:
$$ \sum_i |\widetilde{\psi_i}\rangle \langle\widetilde{\psi_i}| = \sum_{ijk} u_{ij} u_{ik}^{*}|\widetilde{\phi_j}\rangle \langle\widetilde{\phi_k}|$$
In equation 2.168 adjoint of the tilded psi has now the element in the unitary matrix u being ik conjugated($u_{ik}^*$). Now I understand that the column index after the adjoint will not be the same due to the transpose(hence k instead of j), what I don't understand is why the row index (i) is unchanged. I know it's probably something simple that I am missing, but I would appreciate your help.
"
"['measurement', 'notation', 'povm']"," Title: What is the relation between POVMs and observables (as Hermitian operators)?Body: Let $\renewcommand{\calH}{{\mathcal{H}}}\calH$ be a finite-dimensional Hilbert space.
An observable $A$ is here a Hermitian operator, $A\in\mathrm{Herm}(\calH)$.
A POVM is here a collection of positive operators summing to the identity: $\{\mu(a): a\in\Sigma\}\subset\mathrm{Pos}(\calH)$ such that $\sum_{a\in\Sigma} \mu(a)=I$, for some register $\Sigma$.
An observable $A$ is given physical meaning via the mapping $\rho\mapsto \operatorname{Tr}(A\rho)$ for any state $\rho$, which gives us the expectation value of $A$ on $\rho$.
On the other hand, a POVM $\mu$ is given physical meaning interpreting $\Sigma$ as the set of possible outcomes, with the outcome $a$ occurring with probability $\operatorname{Tr}(\mu(a)\rho)$.
A POVM is always a collection of observables, but not all collections of observables are POVMs.
Intuitively, I understand the process of "measuring an observable $A$" as tantamount to performing the (projective) POVM corresponding to the eigenvectors of $A$, then attaching numbers (the eigenvalues of $A$) to the corresponding outcomes, and obtaining the corresponding expectation value in the limit of many measurements.
In this sense, I would be led to say that POVMs are more "fundamental" than observables, in the sense that observables amount to measuring a POVM and then doing post-processing on the corresponding measurement results.
On the other other hand, in several contexts observables, rather than POVMs, are given the spotlight. To name one example, we discuss the uncertainty principle in terms of observables, not in terms of POVMs.
In this sense, it seems like observables are generally regarded as "more fundamental".
In light of this, is there any general statement that can be made about the relations between observables and POVMs?
Should they be regarded as simply incomparable ideas, or is there merit in thinking of observables as equivalent to post-processing of measurement (POVM) results? Or are there reasons to instead use observables as the primitive idea, and think of POVMs as simply special sets of observables?
While the title might one lead to believe this question is similar to this other one I asked previously, the questions are really completely different; the apparent similarity is due to the different possible meanings of the term "observable" in different contexts.
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang', 'linear-algebra']"," Title: On what basis can we write a positive operator as $A=\sum_k\lambda_k|k\rangle\langle k|$?Body: In Nielsen & Chuang's book equation 2.172 says
$$A=\sum_{i}|\widetilde{\psi_i}\rangle \langle \widetilde{\psi_i}| = \sum_j |\widetilde{\phi_j}\rangle \langle \widetilde{\phi_j}|.$$
Then it makes the assumption that A can be written as
$$A=\sum_{k} \lambda_{k}|k\rangle\langle k|$$
where the kets are orthonormal vectors and lambdas are strictly positive. On what basis are these two assumptions made? Namely the positivity and orthonormality.
"
"['programming', 'quantum-gate', 'qiskit', 'algorithm', 'hhl-algorithm']"," Title: Quantum implementation of arcsinBody: I am looking to implement a quantum version of the arcsinus function. Such a problem is motivated by the HHL algorithm where $x\mapsto 1/x$ and $\arcsin$ can be used to get $1/x$ from the computational basis state into the amplitude.
My questions are based on the paper Optimizing Quantum Circuits for Arithmetic (arxiv link :https://arxiv.org/abs/1805.12445).
Their idea is to use a polynomial approximation of the function $f$ and to partition the domain $\Omega$ of study of $f$ :
$$
\Omega = \bigcup_{i=1}^M \Omega_i \quad \Omega_i\cap \Omega_j = \emptyset \, \forall i \neq j
$$
and then perform a case distinction for each input, evaluating a different polynomial for $x\in \Omega_i$ and $y\in \Omega_j$, $i\neq j$. $M$ is chosen in order to achieve a certain precision and the degree of the polynomials are all bounded by a constant $d$.
Evaluating a single polynomial $P(x) = \sum_{i=0}^d a_ix^i$ can be done using the Horner scheme, where one iteratively performs a multiplication by $x$ and an addition by $a_i$ for $i\in \{d, d-1, \cdots 0\}$ :
$$ a_d \mapsto a_dx+a_{d-1} \mapsto a_dx^2+a_{d-1}x + a_{d-2} \mapsto \cdots \mapsto P(x)$$
At iteration $i$, the last iterate is added by ${a_i}$, while this does not represent any difficulty in classical computing, a register has to hold the set of coefficients ${a_i}$, and has to be changed at each iteration. In their paper, the authors assume that $\mathrm{NEXT}_a$ implements such an operation.
My question : How can one implement efficiently the function $\mathrm{NEXT}_a$ ?
"
"['qiskit', 'mathematics']"," Title: How can I generate a quaternion using Qiskit?Body: I noticed there's a Quaternion class in qiskit docs (Here). I've seen there're a couple of methods such as norm and normalize, but I'm not quite familiar with this class and wondering how can I generate a random quaternion and use those methods available in qiskit? Also, can we use quaternions to solve the practical problems in quantum computing?
"
"['quantum-operation', 'kraus-representation']"," Title: How do I derive Stinespring and Kraus representations of a map such that $\Lambda(\rho)=|0\rangle\langle0|$ for all $\rho$?Body: Can't find any info on Stinespring dilation so I thought I could post here. If I have a qubit complete positive map $\Lambda$, that maps all inputs to the output $|0\rangle$, $\Lambda(\rho)=|0\rangle\langle0|$ how can I derive a Stinespring dilation for $\Lambda$ and the corresponding Kraus operators?
"
"['quantum-gate', 'hamiltonian-simulation']"," Title: Distant quantum gates between uncoupled qubitsBody: Is there any formalism to perform quantum gates between two qubits (let's say in a superconducting quantum network) to perform a quantum gate between two qubits which are not directly coupled? I want to ask the same question for any known physical model of quantum computing. Another way of saying is that, if it is possible to indirectly couple two qubits via some unitary transformations on the Hamiltonian of a system?
One example could be to ask if in a linear chain of three qubits $A,B$ and $C$, is it possible to do a SWAP gate between $A$ and $C$ not directly involving $B$, meaning without first swapping with $B$. I am not asking in the sense of quantum circuit where the answer could be possibly a 'no'. I am asking more from a Hamiltonian point of view.
"
"['physical-realization', 'quantum-advantage', 'applications']"," Title: Is it possible to design a Quantum Computing Advantage to deploy an application on the web?Body: I need to understand the frontier and practical applications of quantum computing.
Is it possible to design a Quantum Computing Advantage to deploy an application on the web, such as a browser, modeling molecules, bot writing code, and other very specific applications?
can a quantum computer work with the internet/web of today ?
"
"['textbook-and-exercises', 'bernstein-vazirani-algorithm']"," Title: Worked example of Bernstein-Vazirani - understanding bitwise productBody: From chapter 3.3 or the Qiskit Textbook, I'm trying to follow the worked example of the quantum solution for Bernstein-Vazirani.
I'm having trouble with what I think should be a trivial bit of classical computation - specifically, the bitwise product $s\cdot x$
In the problem description, the black-box function takes the form: $$f(x)=s \cdot x \mod2$$
Given the example and separate videos, I think what this is doing is a logical AND between every bit in the string $s$ and the input $x$, then calculating $\mod2$ of the result to populate the single output. This would make sense as it would mean the classical solution would require you to run the function with each input bit set in turn to determine the value of $s$.
Where I'm struggling is the subsequent worked example, where we have the string $s=11$ and the quantum oracle output is being defined as:$$|\upsilon _{2} \rangle=\frac{1}{2}((-1)^{00\cdot11}|00\rangle+(-1)^{01\cdot11}|01\rangle+(-1)^{10\cdot11}|10\rangle+(-1)^{11\cdot11}|11\rangle)$$
I'm fine with, this, but then it simplifies to:$$|\upsilon_2\rangle=\frac{1}{2}(|00\rangle-|01|\rangle-|10\rangle+|11\rangle)$$
My problem with this is the signs preceding each state. As $|01\rangle$ and $|10\rangle$ are negative and the rest are positive, that means that the exponents $(00\cdot11)$ and $(11\cdot11)$ are even values (or 0), while $(01\cdot11)$ and $(10\cdot11)$ are odd.
I can't see any way that this happens. If I apply the logical AND described above, I get: $$00\cdot11=00=0$$
$$01\cdot11=01=1$$
$$\color{red}{10\cdot11=10=2}$$
$$\color{red}{11\cdot11=11=3}$$
These last two would give me the wrong signs. I've also tried multiplication of the equivalent decimal values, but that doesn't work either.
What's the correct mechanism for calculating $nn\cdot nn$ in this equation?
"
"['hamiltonian-simulation', 'chemistry', 'solid-state']"," Title: Fermionic occupation operator and nearest neighbor Fermionic hopping interaction as a qubit operatorBody: How to express Fermionic occupation operator $(\hat{a}_j^\dagger\hat{a}_j)$ and nearest neighbor Fermionic hopping interaction ($H_h= J\sum_{i=1}\hat{a}_i^\dagger \hat{a}_{i+1}+\hat{a}_{i+1}^\dagger \hat{a}_{i})$ as a qubit operators.
"
"['density-matrix', 'nielsen-and-chuang']"," Title: Can we write the density operator as a sum of mixed states?Body: In every resource I find (like Nielsen and Chuang or online courses), the density operator is defined as follows: we consider a sequence of pure states $\left|\psi_i\right\rangle$ with associated probabilities $p_i$. If the system is in state $\left|\psi_i\right\rangle$ with probability $p_i$, then its density operator is given by:
$$\rho = \sum_ip_i\left|\psi_i\right\rangle\left\langle\psi_i\right|.$$
However, I do not understand the necessity of $\left|\psi_i\right\rangle$ being pure states for this. For instance, let us say that the system is in state (potentially mixed) $\rho_i$ with probability $p_i$ (that is, $\rho_i$ is a density operator). Then we can prove that its density matrix is given by:
$$\rho=\sum_ip_i\rho_i.$$
For this, I use the Lemma defined in this answer, assuming it is correct. We consider an arbitrary unitary $\mathbf{U}$ and an arbitrary basis state $|x\rangle$. Applying $\mathbf{U}$ on the system, we obtain, with probability $p_i$:
$$\mathbf{U}\rho_i\mathbf{U}^\dagger.$$
The probability of measuring $|x\rangle$ in this situation is thus given by:
$$\mathrm{tr}\left(|x\rangle\langle x|\mathbf{U}\rho_i\mathbf{U}^\dagger\right).$$
Since this situation happens with probability $p_i$, the probability of measuring $|x\rangle$ is finally given by:
$$\sum_ip_i\mathrm{tr}\left(|x\rangle\langle x|\mathbf{U}\rho_i\mathbf{U}^\dagger\right).$$
On the other hand, applying $\mathbf{U}$ on $\rho$ gives:
$$\mathbf{U}\rho\mathbf{U}^\dagger=\sum_ip_i\mathbf{U}\rho_i\mathbf{U}^\dagger$$
which means that the probability of measuring $|x\rangle$ is given by, using the linearity property of the trace:
$$\sum_ip_i\mathrm{tr}\left(|x\rangle\langle x|\mathbf{U}\rho_i\mathbf{U}^\dagger\right).$$
Hence, for any unitary $\mathbf{U}$ and any basis state $|x\rangle$, the probabilities of measuring $|x\rangle$ after having applied $\mathbf{U}$ on those systems are equal, hence their density matrices are identical.
I cannot see the error here, but on the other hand, I find it surprising that I did not find any mention to this (or I've missed it, which is also quite likely). Is this result correct? Otherwise, where's my mistake?
"
"['algorithm', 'resource-request', 'research']"," Title: Is there any firm evidence that quantum computers can be more powerful than classical?Body: I am new to the field and I am very confused about the status of things right now. Sorry, but this confusion also spills into the framing of my questions.
First, a more CS-style question.
As far as I understand historically since the invention of Shor's factoring algorithm or around that time the confidence that quantum computers will be able to outperform classical in some tasks has grown. However, there is still very little or no rigorous evidence for that. I've found this account in the QuantaMagazine of the result on the oracle separation between BQP and BPP. The significance of this result is not clear to me, but the very fact that it's relatively new seems to be quite telling.
At the same time I'm constantly bumping into different papers that claim to de-quantize some important class of problems, say here for quantum machine learning and here for quantum simulations. I do not know whether these results are universally accepted but at least there seems to be no apparent reason why they could not be true in principle. So my first concrete question is
Is there an accessible review somewhere that explains the current status of the affairs?
Next, a more sociological one.
If my impression is correct, and the theoretical advantage of classical algorithms over quantum is not really established, how should I think about the large investments going into the quantum computing industry right now?
I understand that this is not a very scientific question, but perhaps there are scientifically motivated answers? For example although Grover's algorithm does not provide an exponential speed-up it still increases performance and maybe this is enough for some practical purposes? Or perhaps one expects that although some types of problems may formally be polynomial-time for both classical and quantum computers, the real-life performance may still be much more favorable in the quantum case?
Related to the last question, are there any applications that are expected to be possible on the near-term quantum computers, say 10 to 20 years? Is there a good review of such prospects?
"
"['programming', 'openfermion']"," Title: Openfermion : `get_sparse_operator` issueBody: I am trying to use operfermion to calculated the eigen values for different molecules.
Tried for Hydrogen, LithiumHydride, Water. It works fine.
When Itried to calculated the same thing for
Ozone, Oxygen, HCN etc., the program finally got killed after consuming all the memory.
Any help is deeply appreciated.
Here is the sample code to reproduce the issue
from numpy import pi
from openfermion.chem import MolecularData
geometry=[['O',[0,0,0]],['O',[0,1.0885,0.6697]],['O',[0,-1.0885,0.6697]]]
basis='sto-3g'
multiplicity=1 #singlet
charge=0 #neutral
ozone_molecule=MolecularData(geometry,basis,multiplicity,charge)
from openfermionpsi4 import run_psi4
ozone_molecule = run_psi4(ozone_molecule,
run_mp2=True,
run_cisd=True,
run_ccsd=True,
run_fci=True)
two_electron_integrals = ozone_molecule.two_body_integrals
orbitals = ozone_molecule.canonical_orbitals
ozone_filename = ozone_molecule.filename
ozone_molecule.save()
one_body_integrals = ozone_molecule.one_body_integrals
from openfermion.transforms import get_fermion_operator, jordan_wigner
ozone_qubit_hamiltonian = jordan_wigner(get_fermion_operator(ozone_molecule.get_molecular_hamiltonian()))
from openfermion.linalg import get_sparse_operator
from scipy.linalg import eigh
ozone_matrix= get_sparse_operator(ozone_qubit_hamiltonian).todense()
eigenvalues, eigenvectors = eigh(ozone_matrix)
print(eigenvalues)
This consumes roughly 128 GB of RAM and finally gets killed.
"
"['programming', 'ibm-q-experience']"," Title: Recover backend information in working remotely with the IBM-QCBody: I'm reading the details of qiskit following this paper (I know it's a little bit dated, but some things shown there should be in principle still accessible). For concreteness I'm trying to see the characteristics of the backend
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('ibmq_quito')
Now, according to the reference, the backend have to be equipped with the configuration files. However, if I do
backend.configuration()
I only get
<qiskit.providers.models.backendconfiguration.QasmBackendConfiguration object at 0x7f5f567af760>
How can I display the full information for this backend, e.g. backend_name, backend_version, etc. etc.?
"
"['qiskit', 'algorithm', 'vqe']"," Title: What does it mean to have a negative cost (aka loss) function?Body: In the Variational Quantum Linear Solver (VQLS) paper they define four cost functions (2 global and 2 local) and state in Appendix B that "all four cost functions are non-negative." However, in the qiskit VQLS tutorial where they implement one of the global cost functions you can see from their output that the cost function tends to negative numbers (~$-25$). Does this imply that they have an incorrect implementation of the cost function? What does it mean to have a negative cost function?
For some context, I am working with the local cost function, and it sometimes goes negative but not always. The reason I ask these questions is because I am unsure about how to handle convergence for my optimizer for negative cost functions.
"
['complexity-theory']," Title: Degree of $N$-bit Majority function is larger or equal to $N/2$Body: I am looking to prove that the $N$-bit Majority function $f$, which is 1 if its input $x \in \{0, 1\}^N$
has Hamming weight $> N/2$, and 0 if its input has Hamming weight $\leq N/2$ has degree $\text{deg}f\geq N/2$. We assume that $N$ is even. Any hints or suggestions are most welcome.
Note that an $N$-variate multilinear polynomial $p$ is a function $p: \mathbb{C}^{N} \rightarrow \mathbb{C}$ we can write as
$$
p\left(x_{0}, \ldots, x_{N-1}\right)=\sum_{S \subseteq\{0, \ldots, N-1\}} a_{S} \prod_{i \in S} x_{i}
$$
for some $a_{S}\in \mathbb{C}$. The degree of $p$ is defined as $\operatorname{deg}(p)=\max \left\{|S|: a_{S} \neq 0\right\} .$ Moreover, we may use that every function $f:\{0,1\}^{N} \rightarrow \mathbb{C}$ has a unique representation as such a polynomial.
"
['cluster-states']," Title: On Cluster States: Measuring in $|+\rangle$ and $|-\rangle$ basis vs. some other computational basisBody: I'm currently learning quantum information and I seem to miss some important points on cluster states.
My question is this:
If we want to get one qubit disentangled from the quantum cluster state we measure it in the$\vert\pm\rangle$ computational basis because in this case we would get a classical outcome, right?
On the other hand, if we measure in some other computational basis defined as
$$\vert\beta_j (\alpha)\rangle = \frac{1}{\sqrt2}(e^{i\alpha/2} \vert0\rangle \pm e^{-iα/2} \vert1\rangle)$$
we’re actually performing a pure quantum computational task, so we’re not making a classical measurement of it, right?
Also, how do we experimentally implement the latter?
"
"['quantum-gate', 'ibm-q-experience', 'error-correction', 'ibm']"," Title: Why is a 15-qubit IBM quantum computer not working correctly?Body: I just wanted to implement an algorithm for adding two 2-bit binary numbers. And it works, but only on an IBM 32-qubit simulator. And on a real 15-qubit computer, ibmq_16_melbourne, it produces very strange results.
I don't understand what I'm doing wrong. Or maybe the quantum computer is so noisy?
I also tried to rewrite the algorithm for the structure of this computer, so that the qubits used in one operation are connected or are quite close.
But it didn't help.
About the algorithm:
qubits 0-2 are the result. Qubits 3-4 are the first number. Qubits 5-6 are the second number. The remaining qubits play the role of transfer flags.
I set qubits 3 and 5 to one using the NOT operation (I didn't understand how to apply units to them in another way). So at the output of the algorithm, I should get "010". But I get basically a different result.
"
['hamiltonian-simulation']," Title: How to construct a Hamiltonian for an ensemble of atoms interacting with each other?Body: How to construct a Hamiltonian for an ensemble of atoms interacting with each other?
For example if the one atom hamiltonian can be written as:
$$\hat{H}=\left(\begin{matrix}0&\Omega_p(t)&0\\\Omega_p(t)&0&\Omega_r(t)\\0&\Omega_r(t)&0\end{matrix}\right)$$
so the many atoms Hamiltonian can be written as
$$\hat{\mathcal{H}}=\hat{H}\otimes\hat{H}\otimes...\otimes\hat{H}+\sum_{j,k}^{N}V_{jk}\left|R\rangle_j\langle R\right|\otimes\left|R\rangle_k\langle R\right|$$
where $\Omega_p(t)$ and $\Omega_r(t)$ are arbitrary functions, $|R\rangle$ is the Rydberg stat $V$ is the interaction energy between Rydberg states, and $N$ is the number of atoms.
I am using Wolfram Mathematica and every-time I do a simulation for 3 atom, it does not work properly.
"
"['quantum-gate', 'pauli-gates', 'angular-momentum']"," Title: How to prove the fundamental equation in the theory of angular momentum $\sum_{l=x,y,z}\langle J_l^2\rangle\le\frac{N(N+2)}{4}$?Body: How to prove the inequality$$\sum_{l=x,y,z}\langle J_l^2\rangle\le\frac{N(N+2)}{4}$$
where $J_l = \mathop{\Sigma}_{i=1}^N \frac{1}{2}\sigma_l^{i}$, and $\sigma_l^i$ is pauli matrix acting on the $i$th qubit,
$N$ stands for the number of qubits, and $\langle\,.\rangle$ denotes the average over $N$ qubits? The $N$ qubits may be entangled.
"
['adiabatic-model']," Title: Why do I get this extra factor when working out the dynamics of an adiabatic quantum computation?Body: I was trying to revise my understanding of adiabatic quantum computation via a simple example. I'm familiar with the overall concept -- that you have an overall Hamiltonian
$$
H(s)=(1-s)H_0+s H_f
$$
where $s$ is a function of time, starting from $s=0$ and finishing at $s=1$. You prepare your system in the ground state of $H_0$ (known) and, provided the Hamiltonian changes slowly enough, your final state will be close to the ground state of $H_f$. The "slowly enough" condition is typically phrased in terms of the energy gap between the ground and first excited state, $\Delta$. A typical assumption is
$$
\frac{ds}{dt}=\epsilon\Delta^2
$$
for small $\epsilon$ (I haven't been back to pick through more detailed statements).
So, my plan was to test
$$
H(\theta)=-\cos\theta X-\sin\theta Z,
$$
starting from $\theta=0$ and the system in $|+\rangle$. For all values of $\theta$, the gap is a constant (2) so, in essence, I have the conversion $\theta=4\epsilon t$ and the evolution time will be $\pi/(8\epsilon)$ and should leave the system in the state $|0\rangle$. However, when I tried to do this calculation, I didn't get this answer. Am I screwing up, or is there some condition that tells me I shouldn't expect the adiabatic theorem to hold in this case?
Details of how I tried to do the calculation:
Let
$$
|y_{\pm}\rangle=(|0\rangle\pm i|1\rangle)/\sqrt{2}.
$$
We have that
$$
H|y_{\pm}\rangle=\pm ie^{\mp i\theta}|y_{\mp}\rangle.
$$
We can decompose any state in this basis,
$$
|\psi\rangle=a|y_+\rangle+b|y_-\rangle,
$$
so we can talk about the time evolution of the coefficients
$$
\frac{d}{dt}\begin{bmatrix} a \\ b \end{bmatrix}=4\epsilon\frac{d}{d\theta}\begin{bmatrix} a \\ b \end{bmatrix}=\begin{bmatrix}
0 & e^{-i\theta} \\ -e^{i\theta} & 0
\end{bmatrix}\begin{bmatrix} a \\ b \end{bmatrix}
$$
I can perform a variable transformation
$$
\tilde a=e^{i\theta/2}a,\quad \tilde b=e^{-i\theta/2}b
$$
which then satisfy
$$
4\epsilon\frac{d}{d\theta}\begin{bmatrix} \tilde a \\ \tilde b \end{bmatrix}=i\begin{bmatrix}
2\epsilon & -i \\ i & -2\epsilon
\end{bmatrix}\begin{bmatrix} \tilde a \\ \tilde b \end{bmatrix}
$$
This is (finally!) something I can do something useful with! Taking the small $\epsilon$ limit, I essentially have
$$
\frac{d}{d\theta}\begin{bmatrix} \tilde a \\ \tilde b \end{bmatrix}=i\frac{1}{4\epsilon}Y\begin{bmatrix} \tilde a \\ \tilde b \end{bmatrix}
$$
I can put in my initial conditions and compare what I expected at the end. The problem is that I have an extra phase of the form $e^{i\pi/(8\epsilon)}$ floating around, and the taking of the small $\epsilon$ limit seems problematic as this varies rapidly between all possible values.
"
"['quantum-gate', 'complexity-theory', 'probability']"," Title: Estimating output amplitudes of quantum circuits as GapP functionsBody: Let's fix a universal gate set comprising of a Hadamard gate and a Toffoli gate. Consider an $n$ qubit quantum circuit $U_{x}$, made up of gates from that universal set, applied to initial state $|0^{n} \rangle$.
The transition amplitude $\langle 0^{n}| U_x |0^{n} \rangle$ can be written as
\begin{equation}
\langle 0^{n}| U_x |0^{n} \rangle = \frac{f - g}{\sqrt{2^{h}}},
\end{equation}
where $h$ is the number of Hadamard gates and $f$ and $g$ are two #P functions. This equivalence is proven in https://arxiv.org/abs/quant-ph/0408129 (equation 6).
Let's say that we are given an efficient classical description of $U_x$ and we want to estimate this transition amplitude classically, upto inverse polynomial additive error. We do not care whether our estimated value preserves the sign of the original output amplitude.
A naive way to estimate the transition amplitude classically, given an efficient description of the circuit $U_{x}$ as the input, would be to estimate $f$ and $g$ individually, upto inverse polynomial additive error. Something like this is hinted in Section V of the paper linked.
But don't we need oracle access to the formulas corresponding to $f$ and $g$ (ie, two Boolean/3SAT formulas such that $f$ is the number of solutions for one, and $g$ is the number of solutions for the other) to individually estimate $f$ and $g$ respectively (upto an inverse polynomial additive error)?
Can we efficiently get a description of these two corresponding Boolean formulas just from the description of the quantum circuit $U_x$ given to us as input (and hence, not need oracle access to these formulas in the input)?
"
"['quantum-gate', 'universal-gates']"," Title: Basic gates setsBody: There are several basic gate sets allowing to construct any gate on a quantum gate-based computer, e.g.:
- $H$, $T$, $CNOT$ (sometimes enriched to $H$, $T$, $S$, $X$, $CNOT$),
- rotations $Rx$, $Ry$ and $Rz$ and $CNOT,$
- Toffoli gate + $H,$
- Fredkin gate + $H.$
I am wondering whether there are any other universal sets usually used in quantum computation. What are advantages and drawbacks of these sets?
"
"['ibm', 'superconducting-quantum-computing', 'photonics', 'spintronics']"," Title: Optical quantum computers VS Superconducting quantum computers VS Electron-spin quantum computersBody: One of the main problems of superconducting quantum computers is that it is necessary to maintain a very low temperature (near absolute zero).
Such cooling is very expensive and complex.
Why, then, are Intel, IBM, and many other corporations developing superconducting quantum computers? After all, it was possible to use a photon as a qubit.
And what about electron-spin quantum computers?
Are there any corporations that have advanced in their development? Do they require cooling to absolute zero?
In most of the materials that I came across, it was said about spin of the electron. But using it in the real world is somehow unpopular. Perhaps there are reasons for this?
I would like to know the advantages and disadvantages of developing superconducting quantum computers, optical quantum computers and electron-spin quantum computers.
"
"['quantum-state', 'information-theory', 'communication']"," Title: States used in lossless quantum compression?Body: I was reading about quantum compression in this article and have some doubts regarding an example mentioned. Specifically, I have two questions:
- In example they represented $|a\rangle = \dfrac{1}{\sqrt{15}}|00\rangle + \dfrac{1}{\sqrt{15}}|10\rangle +\dfrac{2}{\sqrt{15}}|01\rangle + \dfrac{1}{\sqrt{15}}|11\rangle$. How can they call this a quantum state given that the sum of square magnitudes of the amplitudes is not equal to one?
- If they are compressing kets ($|10\rangle$ to $|1\rangle $) then what is the point of the amplitudes $\dfrac{1}{\sqrt{15}}$?
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: Can I use Quantum lab during IBM Quantum certification exam?Body: Hello I am about to take the IBM Quantum Qiskit dev exam. I don't know if I can use the quantum lab (Qiskit) during the exam. Does anyone know?
"
"['entanglement', 'density-matrix', 'trace']"," Title: Does $\mathrm{Tr}(\rho\sigma) > 0$ prove that a state $\sigma$ is separable?Body: As an example I have the density matrix:
$\rho = \frac{1}{3}(| \phi^+ \rangle\langle\phi^+| + | 00 \rangle\langle 00|+| 11 \rangle\langle11| )$
And the two-qubit state is:
$\frac{1}{3}(| \phi^- \rangle\langle\phi^-| + | \psi^+ \rangle\langle \psi^+|+| \psi^- \rangle\langle \psi^-| )$
The trace of $\rho$*state is greater than zero. Does that suffice to show that it is separable?
"
"['programming', 'quantum-gate', 'quantum-state', 'algorithm']"," Title: is it possible to eliminate a certain possibility of an outcome of 3+ qbitsBody: Let's say I have n qbits each in a superposition $\begin{pmatrix} \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} \end{pmatrix}$ so each possible outcome has a probability of $\frac{1}{2^n}$. Is it possible for me to suppress the probability of one outcome?
E.g. I have 3qbits, I want to remove the possibility of reading 101 when I measure the qbits. Possible outcomes:$\begin{bmatrix} 000\\ 001\\010\\011\\100\\101\\110\\111 \end{bmatrix}$ probabilities of outcomes: $\begin{bmatrix} 0.125\\ 0.125\\0.125\\0.125\\0.125\\0.125\\0.125\\0.125\end{bmatrix}$ -> $\begin{bmatrix} 0.143\\ 0.143\\0.143\\0.143\\0.143\\0\\0.143\\0.143\end{bmatrix}$
Is this possible? How could I do that?
Furthermore, is it possible for me to remove the possibility of reading 2 outcomes: say 101 and 110.
Possible outcomes:$\begin{bmatrix} 000\\ 001\\010\\011\\100\\101\\110\\111 \end{bmatrix}$ probabilities of outcomes: $\begin{bmatrix} 0.125\\ 0.125\\0.125\\0.125\\0.125\\0.125\\0.125\\0.125\end{bmatrix}$ -> $\begin{bmatrix} 0.167\\ 0.167\\0.167\\0.167\\0.167\\0\\0\\0.167\end{bmatrix}$
Note: I don't actually care about the remaining probabilities of the outcomes, as long as they are nonzero.
"
"['mathematics', 'quantum-fisher-information', 'quantum-metrology']"," Title: What happens in the Cramer-Rao bound if the quantum Fisher information is zero?Body: The famous Cramer-Rao bound is $$\Delta\theta\ge\frac{1}{\sqrt {F[\rho,H]}}$$
But what happens if the denominator vanishes, i.e., $F[\rho,H]=0$ ($F[\rho,H]$ here stands for the quantum fisher information in the unitary process)? For example, $F[\rho,H]$ can be zero in this paper below eq$(26)$.
"
"['terminology', 'quantum-fisher-information', 'quantum-metrology']"," Title: What is the difference between ""Shot-Noise-Limit"" and ""Standard Quantum Limit""?Body: It seems that in a lot of papers in the field of quantum metrology, there are two terms Shot-Noise-Limit and Standard Quantum Limit which are frequently referred to. What's the difference between them, because it seems they all refer to the limit $\Delta \theta\ge\frac{1}{\sqrt{N}}$.
"
['teleportation']," Title: What do we mean by teleporting state $|\psi\rangle$ through state $|\phi\rangle$?Body: What does it mean to teleport a state through another state? According to most of the online sources, we use a bell state for teleportation. What would be the outcome if we use any other possible state $|\phi\rangle$ to teleport $|\psi\rangle$? Would that even make sense to do?
"
['ibm-q-experience']," Title: What is the actual precision of the IBM quantum computer?Body: In working with the IBM quantum computer, one can use for example the composer in order to build simple quantum algorithms. Essentially, one usually feeds a phase in order to affect one of the qubits. While for instance phases like $\pi/2$ can be applied "faithfully" into the real backends, one can add in the composer phases like 0.0983498491221321 (i.e. Float64).
I would like to ask what is the actual "precision", i.e. up to which significant figure does the real backends can achieve. I suppose it also depends on the backend that one chooses, so it should be a list of how much precision we can achieve in each one of the real machines.
"
"['mathematics', 'd-wave', 'annealing', 'adiabatic-model', 'embedding']"," Title: Why is it so important to have uniform chain lengths in a minor embedding?Body: Very brief background
In quantum annealing, the discrete optimization problem we wish to solve (such as finding the minimum of $b_1b_2 - 3b_1 + 5b_3b_4$ for binary variables $b_i$) may have a connectivity between the variables that doesn't match the connectivity between the qubits in the hardware. To deal with this, we may use more than one physical qubit to represent one logical qubit, so that at least one member of the "chain" of physical qubits, is connected in hardware to the other logical qubits that the original problem demands.
Literature that says "uniform" chains are preferred
If in the final embedding of the logical problem into the hardware graph, all "chains" span the same number of qubits, then the embedding is called "uniform". This definition is given in the second paragraph of section 1.1 of this excellent paper by D-Wave, which strongly emphasizes the desire to have "uniform" chains, and prioritizes uniformity of the chain lengths over pretty much every other property that we would think is important for solving our problem most efficiently (i.e. having uniform chains is more important than minimizing the total number of qubits, total number of couplings between the qubits, total number of "chains", longest length of "chains", total number of qubits inside "chains", etc.).
The paper's only justification for desiring uniform chain lengths, is given in this sentence:
"One desirable feature of native clique embeddings
is uniform chain length, which results in uniform, predictable chain dynamics throughout the anneal [13]."
Reference [13] is Davide Venturelli's excellent 2014 paper. While [13] does do quite a substantial amount of analysis about quantum annealing and embedding of graphs, where are they portraying the message that uniform chains are preferred over other aspects such as "total number of qubits used" and "total number of qubit-qubit couplings"?
The reason why I ask
The team at D-Wave that designed the Pegasus architecture describes "optimal embeddings" based on the triangle embedding, which is an embedding that's sold based on being uniform (see the second paragraph of section 1.1 in the first paper referenced in this question).
However, the triangle embedding for 12 logical qubits with all-to-all connectivity, requires 48 physical qubits, 102 qubit-qubit couplings, and 12 chains of length 4 while the following embedding only requires 46 physical qubits, 100 qubit-qubit couplings and some chains with a length of only 3:
{0: [42, 31, 39, 47], 1: [25, 61, 53, 49], 2: [56, 32, 8], 3: [40, 29, 37, 45], 4: [13, 10, 58, 34], 5: [28, 36, 44], 6: [12, 59, 35, 11], 7: [27, 63, 55, 51], 8: [60, 52, 26, 50], 9: [24, 48, 62, 54], 10: [14, 57, 9, 33], 11: [43, 30, 46, 38]}
The embedding here seems superior to the triangle embedding in every single way except that instead of having all chains contain 4 qubits, it has some chains with 4 qubits and some with 3 qubits. All along in this research area, people have always told me that shorter chains are more desirable, which completely makes sense since they require fewer qubits and couplings, but the above papers suggest that we'd rather have some chains longer than necessary in order to have uniformity: why is uniformity so important here, that we would rather use more qubits and qubit-qubit couplings than mathematically needed, even when there's embeddings that require fewer resources and have chain lengths that are only 1 or 2 qubits shorter than others in the same embedding?
"
"['quantum-gate', 'error-correction']"," Title: Calculating length of code words in quantum information(compression)Body: I was studying this article by Boestrom and Felbinger.
We define the significant length of the codewords in the preparation of the communication protocol : $$L_c(w_i) = \lceil log_k(i) \rceil$$
We can also calculate the base length of the codewords :
$$ \underline L _c(x)= \max_{i=1,...,d} \{L_c(w_i) | \ |\langle w_i|x\rangle|^2 > 0 \} \tag{101}$$
After explaining the protocol, they give an explicit example with a source message set :
$$ \chi = \{|a\rangle,|b\rangle, |c\rangle, |d\rangle, |e\rangle, |f\rangle, |g\rangle, |h\rangle, |i\rangle, |j\rangle \}$$
The Authors then calculate that :
$$\underline L _c (a) = 0 ; \underline L _c (b) = \underline L _c (c) = \underline L _c (d) = 1 \tag{136}$$
$$ \underline L _c (e) = \underline L _c (f) = \underline L _c (g) = \underline L _c (h) = \underline L _c (i) = \underline L _c (j) =2 \tag{137}$$
I have troubles understanding the equation 101 and how it calculates the length of the strings. Maybe explaining the examples in equations 136 and 137, will help too.
Thanks for reading, hope you can help !
"
['quantum-state']," Title: How do you visualize multi-qubit interactions?Body: I am trying to understand single qubit operations from Bloch sphere, but I was told that the limitation of Bloch sphere is that it can only visualize or simulate 1 qubit.
What are some instances do I need to know or visualize multi-qubit interactions? How do Quantum computer scientist or students currently use to visualize or understand multi-qubit interactions? And lastly, what are some information does one need to know from a multi-qubit interaction?
I understand the question is a little broad as I am new to this field, just asking this out of curiosity and I'm also interested to explore ideas on how to visualize this as well!
"
"['quantum-gate', 'quantum-state']"," Title: Transformation of Operation Order for H,T Single Quantum GateBody: Suppose I want to apply an $H$-gate transformation to an arbitrary quantum state $|\sigma\rangle$, and then a $T$-gate transformation to the arbitrary quantum state $|\sigma\rangle$.
The quantum state is transformed into $TH|\sigma\rangle$.
But I can't do $H$-gate first now, I only can use a $T$-gate first. The quantum state transformation is $T|\sigma\rangle$, regardless of the global phase.
How do I transform to get the quantum state $TH|\sigma\rangle$ which is what I want at the beginning?
To explain my question, an example is given below:
$$R_x(\theta)^aR_z(\theta)^b=(-1)^{ab}R_z(\theta)R_x(\theta).$$
"
"['programming', 'qiskit']"," Title: Error when attempting to visualize controlled hadamard gate state matrix with qiskitBody: I'm trying to get used to the qiskit module and quantum circuits in general, before tackling a QML project. So I'm going through the tutorial on the documentation page regarding gates. I've gotten as far as the controlled Hadamard gate. I can create the circuit and print it out, but once I try to run the job, I get an error:
q0_0: ──■──
┌─┴─┐
q0_1: ┤ H ├
└───┘
Simulation failed and returned the following error message:
ERROR: [Experiment 0] Circuit contains invalid instructions {"gates": {ch}} for "unitary" method
I had to modify the sample code a little because it threw a few deprecation errors and I couldn't get it to display the circuit or the matrix as it stood.
The example code (gathered into 1 from the tutorial):
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from math import pi
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
from qiskit import BasicAer
backend = BasicAer.get_backend('unitary_simulator')
q = QuantumRegister(2)
qc = QuantumCircuit(q)
qc.ch(q[0],q[1])
qc.draw()
job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)
The main change I had to make, was irt. the .draw() and execute() functions. I got some errors there when importing. Since I couldn't find a provider called BasicAer I went with the Aer provider. for all single-qubit states, this worked as well as for controlled X Y and Z gates.
from qiskit import \
QuantumCircuit,\
QuantumRegister,\
ClassicalRegister
from qiskit.providers.aer import UnitarySimulator
import numpy as np
backend = UnitarySimulator()
n = 2
q = QuantumRegister(n)
qc = QuantumCircuit(q)
qc.ch(q[0], q[1]) # LSB first
print(qc)
job = backend.run(qc)
I tried to google the error message, but I couldn't find any previous issues regarding this, nor any particular error message like it.
The error refers to a "Unitary" method. This could be the unitary_simulator/UnitarySimulator the tutorial used versus the one I imported. Testing it, the code seems to run, though I struggle to see the output. In addition, an error is then thrown at the decimal bit in the tutorial. It seems like I could make it work if I changed the import method, but I don't quite understand why. There were also some deprecation warnings for the tutorial in earlier parts, which my previous methods avoided, in particular regarding the Unitary operator and the decomposition into u3, u2 and u1.
Is the BasicAer.get_backend('unitary_simulator')method in the process of phasing out, or is it an either or situation? is there a particular reason for the difference in the functionality between the 2?
>>> qiskit.__qiskit_version__
{'qiskit-terra': '0.17.0', 'qiskit-aer': '0.8.0', 'qiskit-ignis': '0.6.0', 'qiskit-ibmq-provider': '0.12.2', 'qiskit-aqua': '0.9.0', 'qiskit': '0.25.0'}
Edit:
I got a tip from a TA regarding the use of execute() which does let the program run. From a quick look at the documentation, it seems like there are few differences between the execute() and backend.run(), though according to this it could be that the execute() transpiles the circuit first? but I don't quite see why that would allow for unitary operations.
Another thing, I have tested the same type of imports on singular bit gates such as the U gate, and on 2-qubit gates such as the CX gate, which both work with the unitary operator from what I understand. And there are no new function calls for the CH gate.
I guess part of it is that I don't see why it fails for the CH and not for H, U or CX or others.
"
['ibm-q-experience']," Title: Understanding the heavy output problemBody: In this paper (or more pedagogically here) it is given a way to compute the Quantum Volume of a quantum computer (qc), specifically aimed at the IBM qcs.
In all this process I found some dark spots that I would like to understand. First of all we need the heavy outputs $H_U$ which can be obtained from a "classical" computation. Obviously in the implementation the transpiler will do some optimizations so from an original $U$ ($m$ qubits and depth $d$) we will get the transpiled $U'$. The probability of sampling a heavy output with this $U'$ is strangely
$$
h_U = \sum_{x\in H_U} q_U(x).
$$
- Ok I buy that this quantity works, but why to sum it over all possibles $x\in H_U$ is still unclear to me.
- The probability of observing a heavy output is then $h_d = \int h_UdU$. In the paper mentioned the Algorithm 1 computes $h_d$, right?
- As far as I understand, this algorithm simply constructs the frequency plot between a realization of $U$ vs the number of heavy outputs found in a certain number of trial initial state $|00\dots 0\rangle$ ($m$-spins), right?
- Then if 3 is correct, $h_d$ can be computed from the (normalized) histogram just constructed. However the authors give the formula
$$
\frac{n_h-2\sqrt{n_h(n_s-n_h/n_c)}}{n_c n_s}>2/3,
$$
to validate if $h_d$ has been achieved. How is this formula found? Is it some numerical (e.g. Simpson) rule?
- On the other, one can measure how well the $U'$ resembles $U$ by computing the fidelity $F_{\mathrm{avg}}(U,U')$. Where does this quantity enters for computing $V_Q$? $\log_2 V_Q =\mathrm{argmax}_m \; \mathrm{min}(m,d(m))$ doesn't tell much...
"
"['quantum-gate', 'universal-gates']"," Title: Does anyone know the list of all known universal sets of quantum gates?Body: Does anyone know the list of all known universal sets of quantum gates? I know only two such sets: Cliffords + $T$ and rotations + CNOT.
"
"['physical-realization', 'classical-computing', 'applications']"," Title: Quantum computer speedups for classically efficient applicationsBody: I'm interested in learning about cases where a quantum computer could be used to perform tasks with only a constant (albeit large) factor of improvement in execution speed over classical computers. For example, in a talk about this paper it was mentioned that a photonic quantum computer might be able to evaluate functions of the form
$$
f(x, y) = \exp \left(\frac{(x - y)^2}{\sigma^2} \right)
$$
at a rate on the order of terahertz frequency ($\sim 10^{-12}$ seconds), which might give a significant procedural advantage compared to evaluating such a function classically on a PC at a rate that's presumably less than gigahertz ($\sim 10^{-9}$ seconds). So while the quantum evaluation isn't asymptotically faster it might still be a useful as specialized hardware to compute a very specific, broadly useful function (similar to how GPU's and TPU's are employed).
Are there any other interesting examples of the possibility to use a quantum computer to do an otherwise classically efficient task? Also I'm not so worried about QEC overhead and classical pre/post-processing overhead but the "clock rates" for executing gates and performing measurement on the quantum hardware are relevant.
"
"['q#', 'oracles']"," Title: Quantum Katas - Tutorials - Oracles - Task 3.3 (OR oracle of all bits except for a single bit)Body: Let $x$ be an arbitrary state composed of $N$ qubits and $k$ be an integer such that $0\leq k \leq N.$
The task is to ignore the $k$-th bit and to flip the sign of $x$ if any of the remaining bits are equal to 1. In other words, flipping the sign of $x$ is independent of the $k$-th bit, but it is dependent on the existence of 1's lurking in $x$.
The solution I came up with is the following, which, unfortunately, I cannot implement.
Regardless of what $x$ is we flip its sign. There are two cases we should correct for, namely, the binary representations of 0 and $2^k$. Could not we take care of these two scenarios by using the ControlledOnInt function by setting $\textit{numberstate}$ to 0 (first we have the $X$ gate act on $x[k]$, so that $Z$ flips $x$) and $2^k$, the $\textit{oracle}$ to $Z$, the $\textit{control register}$ to $[x]$ and the $\textit{target register}$ to $x[k]$? Also, why can't the control and target registers be the same?
How could we implement the above with an auxiliary qubit?
In the second case where $x$ is the binary representation of $2^k$, we could use the task 3.2 from the same tutorial (flips the sign of $x$ if the $k$-th qubit is 1), but I am also having trouble with that task. I have been able to implement the OR oracle (task 3.1 of the same tutorial), but it was done with a marking oracle, not a phase oracle.
"
"['quantum-state', 'density-matrix', 'bloch-sphere']"," Title: How to get Bloch sphere Cartesian coordinates from density matrixBody: I am vexed by a particular derivation. Given a state $\psi$ and corresponding density matrix $\rho = |\psi\rangle \langle \psi|$, or $\rho = \begin{bmatrix} a & c \\ b & d \end{bmatrix}$, I can compute the Bloch sphere coordinates as the following (in Python):
a = rho[0, 0]
b = rho[1, 0]
x = 2.0 * b.real
y = 2.0 * b.imag
z = 2.0 * a - 1.0
This code works, but - how? I fail to properly derive it. Any hints or pointers are appreciated.
"
"['measurement', 'textbook-and-exercises']"," Title: How to perform a projective measurement on one component of a composite system?Body: For simplicity, let $|\phi\rangle|\psi\rangle\in\Bbb C^2\otimes\Bbb C^2$. I know how to compute the projective measurement $\{P_m\}_m$ of $|\phi\rangle|\psi\rangle$ on $\Bbb C^2\otimes\Bbb C^2$, but I wonder how to measure the first component of $|\phi\rangle$ of $|\phi\rangle|\psi\rangle$ with respect to a projective measurement $\{P_m\}_m$ on $\Bbb C^2$. And I also wonder will the second component collapses after the measurement? What will be the resulting state? PS. I haven't seen the explaination in N&C's book. A reference is also welcomed.
"
"['quantum-state', 'physical-realization', 'physical-qubit']"," Title: Is it possible to perform quantum computation between different Hilbert spaces?Body: Let us consider a protocol between Alice and Bob. Alice works in a $2^n$-dimensional Hilbert space $\mathcal{H}_A$, using $n$ qubits. Bob works in a $(1+2^n)$-dimensional Hilbert space using qdits. For instance, for $n=128$, Bob would work with two high-dimensional qdits, since $1+2^{128}$ is the product of two large primes.
Since $\mathcal{H}_B$ is isomorphic to $\mathbb{C}^{2^n+1}$, it is possible to write any state $|\psi\rangle_{\mathcal{H}_B}\in\mathcal{H}_B$ as:
$$|\psi\rangle_{\mathcal{H}_B}=\sum_{i=0}^{2^n}\psi_i|i\rangle_{\mathcal{H}_B}\,.$$
Let us say that Alice prepares the following state:
$$|\varphi\rangle_{\mathcal{H}_A} = \sum_{i=0}^{2^n-1}\varphi_i|i\rangle_{\mathcal{H}_A}$$
and sends it to Bob. Now, Bob wants to transform this state into:
$$|\varphi\rangle_{\mathcal{H}_B} = \sum_{i=0}^{2^n-1}\varphi_i|i\rangle_{\mathcal{H}_B}+0\left|2^n\right\rangle_{\mathcal{H}_B}$$
and to apply an unitary matrix $\mathbf{U}_{\mathcal{H}_B}$ such that $\mathbf{U}_{\mathcal{H}_B}\left|2^n\right\rangle_{\mathcal{H}_B}=\left|2^n\right\rangle_{\mathcal{H}_B}$ and $\mathbf{U}_{\mathcal{H}_B}^\dagger\left|2^n\right\rangle_{\mathcal{H}_B}=\left|2^n\right\rangle_{\mathcal{H}_B}$ (that is, $\mathbf{U}_{\mathcal{H}_B}$ does not add the $\left|2^n\right\rangle_{\mathcal{H}_B}$ state in the superposition for any other state and is defined as the identity for this state). This would transform the state in :
$$\mathbf{U}_{\mathcal{H}_B}|\varphi\rangle_{\mathcal{H}_B}=\sum_{i=0}^{2^n-1}\alpha_i|i\rangle_{\mathcal{H}_B}\,.$$
Finally, Bob transforms back this quantum state into a $n$-qubit quantum state and sends it back to Alice.
Does this make sense? Is it possible to consider such a protocol, where one converts a quantum state lying in an Hilbert space to one in another Hilbert space?
"
"['entanglement', 'non-locality', 'bell-experiment']"," Title: What is an example of an entangled state whose correlations are describable with a local hidden variable model?Body: When talks about CHSH inequality, we always say that the states that violate the inequality are entangled, while some states that do not violate the inequality can also be entangled.
For the latter case, i.e. for those states which are entangled but do not violate the inequality, we can find a local hidden variable model to describe them.
Is there some specific example to construct such a model and describe how the inequality is holding while the state is entangled?
"
"['programming', 'qiskit', 'hamiltonian-simulation', 'qaoa']"," Title: Calculating the ground states of an Ising Hamiltonian on a real quantum computerBody: I have followed this tutorial and based on it, I've written the following function in qiskit, which can explicitly calculate the ground states of a transverse-field Ising Hamiltonian.
from qiskit import *
import numpy as np
def Hamiltonian(n,h):
pow_n=2**n
qc = np.empty(2*n-1, dtype=object)
#Creating the quantum circuits that are used in the calculation of the Hamiltonian based on the number of qubits
for i in range(0, 2*n-1): #2n-1 is the number of factors on the n-site Hamiltonian
qr = QuantumRegister(n)
qc[i] = QuantumCircuit(qr) #create quantum circuits for each factor of the Hamiltonian
#print(i)
if (i<=n-2): #for the first sum of the Hamiltonian
qc[i].z(i) #value of current spin
qc[i].z(i+1) #and value of its neighboring spin
else: #for the second sum of the Hamiltonian
qc[i].x(2*n-2-i) #2*n-2 gives the proper index since counting starts at 0
#Run each circuit in the simulator
simulator = Aer.get_backend('unitary_simulator')
result = np.empty(2*n-1, dtype=object)
unitary = np.empty(2*n-1, dtype=object)
Hamiltonian_Matrix=0
#Get the results for each circuit in unitary form
for i in range(0, 2*n-1):
result[i] = execute(qc[i], backend=simulator).result()
unitary[i] = result[i].get_unitary()
#print(unitary[i])
#And calculate the Hamiltonian matrix according to the formula
if (i<=n-2):
Hamiltonian_Matrix=np.add(Hamiltonian_Matrix,-unitary[i])
else:
Hamiltonian_Matrix=np.add(Hamiltonian_Matrix,-h*unitary[i])
print("The",pow_n,"x",pow_n, "Hamiltonian Matrix is:")
print(Hamiltonian_Matrix)
#Now that we have the Hamiltonian
#find the eigenvalues and eigenvectors
w, v = np.linalg.eig(Hamiltonian_Matrix)
print("Eigenvectors")
print(v)
print("Eigenvalues")
print(w)
minimum=w[0]
min_spot=0
for i in range(1, pow_n):
if w[i]<minimum:
min_spot=i
minimum=w[i]
print(min_spot)
groundstate = v[:,min_spot]
#the probability to measure each basic state of n qubits
probability = np.square(groundstate).real
print("The probability for each of the",pow_n,"base states is:")
print(probability)
print("The probabilities for each of the",pow_n,"base states add up to:")
print ("%.2f" % np.sum(probability))
My problem with this piece of code I've written is that it can only run on a unitary simulator. To my understanding (which may lack some of the underlying physics), the Hamiltonian itself is not a "purely" quantum calculation, since there are additions to be made which cannot be expressed with a quantum (unitary) gate, and this is why the resulting Hamiltonian matrix is also not unitary. For example, if you run Hamiltonian(3, 1), the Hamiltonian matrix is:
[[-2.+0.j -1.+0.j -1.+0.j 0.+0.j -1.+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 -1.+0.j 0.+0.j 0.+0.j]
[-1.+0.j 0.+0.j 2.+0.j -1.+0.j 0.+0.j 0.+0.j -1.+0.j 0.+0.j]
[ 0.+0.j -1.+0.j -1.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j -1.+0.j]
[-1.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j -1.+0.j -1.+0.j 0.+0.j]
[ 0.+0.j -1.+0.j 0.+0.j 0.+0.j -1.+0.j 2.+0.j 0.+0.j -1.+0.j]
[ 0.+0.j 0.+0.j -1.+0.j 0.+0.j -1.+0.j 0.+0.j 0.+0.j -1.+0.j]
[ 0.+0.j 0.+0.j 0.+0.j -1.+0.j 0.+0.j -1.+0.j -1.+0.j -2.+0.j]]
Does this mean that there is no way for this approach to run on a real quantum computer where all you can do is measurements on the qubits? I've seen different approaches online such as QAOA or the use of transformations, but I thought if it's so easy to do it with unitaries and some additions, there should be a way to do it with measurements as well.
"
"['programming', 'cirq']"," Title: How to avoid Cirq: State_vector is not normalized error for Feedback-loop in optimizer?Body: I am doing a VQE in Cirq, but sometimes I get this error while running steps of the classical optimization loop:
State_vector is not normalized instead had norm 1.0000000010132789
And therefore the program interrupts.
Is there anything I can do to avoid this? Because my state should be normalized the way I constructed the circuit.
"
"['entanglement', 'textbook-and-exercises', 'density-matrix']"," Title: Given $|\psi\rangle=(U_A\otimes U_B)|0,0\rangle$, is $|\psi\rangle\!\langle\psi|$ always a product state?Body: say I have some state in the combined space $\psi$ ∈ $H_A\otimes H_B$, where $\psi=U_A \otimes U_B|0,0\rangle$ (operators from respective spaces), and $\rho_A, \rho_B$ the respective density matrices.
Is the following statement true:
$|\psi\rangle \langle\psi|$ = $\rho_A \otimes \rho_B$ ?
If yes, how can I show it? Thanks in advance
"
"['programming', 'qiskit', 'hhl-algorithm']"," Title: In the HHL alghoritm, how can I transform my hermitian matrix into a unitary operator?Body: I'm studying the HHL algorithm and I'm trying to do an his implementation but, there are some points that I don't understand how I can transform my hermitian Matrix into its unitary operator?
In Qiskit textbook I found this explanation about HHL algorithm.
It says that after load the input data, we have to do QPE, but for QPE I need to transform my matrix A into $e^{iAt}$, how can I do that? The textbook doesn't explain.
Re-edit:I start with the first question and I use an example.
I know that every hermitian matrix could be written as $e^{-iAt}$, using Pauli Gates.
If I have the following matrix $ A=\begin{bmatrix} 1&-\frac{1}{3}\\ -\frac{1}{3}&1\\ \end{bmatrix}$, I can write it as $A=-\frac{1}{3}X+\mathbb{1} $, so the exponential matrix is $e^{-iAt}=e^{-i(-\frac{1}{3}X+\mathbb{1})t}=e^{-i(-\frac{1}{3}X)t}e^{-i(\mathbb{1})t}$, I can write the last equality because the two operator commute. I want to write this in terms of gates, following the instruciton of previous posts I can write the term $e^{-i(\mathbb{1})t}$ as U1(-t) on control qubit. For $e^{-i(-\frac{1}{3}X)t}$, I know that $e^{-i(X)t}$ is equal to $HR_z(2t)H$,so, in my case, I can write $e^{-i(-\frac{1}{3}X)t}=HR_z(-2\frac{t}{3})H$
I tried to implement in qiskit the circuit, I find 100% of probability to have |11>, but I expect to have 100% of probability to have |10>, what am I doing wrong?
This is my code
t=2*np.pi*3/8
qpe = QuantumCircuit(3, 2)
qpe.h(2) #inizializzo il vettore (1,1) con H gate
for qubit in range(2):
qpe.h(qubit) #applico H gate ai control bit
repetitions = 1
for counting_qubit in range(2):
for i in range(repetitions):
qpe.p(-t,counting_qubit)
qpe.h(2)
qpe.crz(-2/3*t,counting_qubit,2)
qpe.h(2)
repetitions *= 2
qpe.barrier();
qpe.draw()
def qft_dagger(qc, n):
"""n-qubit QFTdagger the first n qubits in circ"""
# Don't forget the Swaps!
for qubit in range(n//2):
qc.swap(qubit, n-qubit-1)
for j in range(n):
for m in range(j):
qc.cp(-math.pi/float(2**(j-m)), m, j)
qc.h(j)
# Apply inverse QFT
qft_dagger(qpe, 2)
#Measure
qpe.barrier()
for n in range(2):
qpe.measure(n,n)
qpe.draw()
My circuit
My result on simulator
Re-edit: I noticed that if I remove the minus sign to the gates, the result is correct, but I don't understand why
"
"['entanglement', 'entanglement-witness', 'quantum-fisher-information', 'quantum-metrology']"," Title: Error in the Toth's 2012 paper: ""Multipartite entanglement and high-precision metrology""?Body: This paper is a paper in 2012 and cited by a lot of papers. And there does not exist comment in arxiv or error statement in PRA. But when I reading this paper, I think the right part of the eq(23) should be $2M+(N-M)(N-M+2)$ instead of $M+(N-M)(N-M+2)$. Is there someone who happens to read this paper, so he or she can tell me if this place is truly an error or just my misunderstanding?
My reasoning based on two methods, the first method is to get the contradiction, the second method is to show my proof.
Contradiction: Right below the eq(24), he stated:
Any state that violates Eq.(23) has fewer than $M$ unentangled particles.
And the state below Eq.(29) shows that the state $\mid 1\rangle \bigotimes\mid D_{N-1}^{N/2-1}\rangle$ has Quantum Fisher Information $(\frac{N^2}{2}+\frac{1}{2},\frac{N^2}{2}+\frac{1}{2},0)$,corresponding to three Quantum Firsher Information components, so the total Quantum Fisher Information is $N^2+1$, which violate the $M+(N-M)(N-M+2)$ with $M=1$. But we know $\mid 1\rangle \bigotimes\mid D_{N-1}^{N/2-1}\rangle$ is not the state which has fewer than $M(M=1)$ unentangled particles.
My Proof: Just like the skill he used in the first equation in Eq.(20), i.e.,$$\sum_{l=x,y,z}(\Delta J_l)^2_{\mid\psi_{k-producible}\rangle}=\sum_m\sum_{l=x,y,z}(\Delta J_l)^2_{\mid\psi_{m}\rangle}.$$ That is, change the total sum to the product part sum, $\mid\psi_{k-producible}\rangle=\mid\psi_1^{(N_1)}\rangle\bigotimes\mid\psi_2^{(N_2)}\rangle\bigotimes...$(his Eq.(18)) .
So what I do here, is combine the Observation 1, i.e., $\sum_{l=x,y,z}F_Q[\rho,J_l]\le 2N$ and observation 2, i.e., $\sum_{l=x,y,z}F_Q[\rho,J_l]\le N(N+2)$, change the variable $N$ in the first inequality($2N$) to $M$, and the variable $N$ in the second inequality($N(N+2)$) to $N-M$, we get the inequality in Eq.(23), but just $2M$ instead of $M$.
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: Can we convert two single qubit states into single mixed state?Body: Consider two qubits
$$\left| \psi_1 \right> = \alpha \left|0\right> + \beta \left|1\right>$$ and $$\left| \psi_2 \right> = \alpha_1 \left|0\right> + \beta_1 \left|1\right>$$
Is it possible to convert these into a single mixed state $\left| \psi\right> $ ? and can I able to extract back $\left| \psi_1 \right> $ and $\left| \psi_2 \right> $ form the mixed state $\left| \psi\right> $?
"
"['quantum-gate', 'hadamard']"," Title: What is the outcome when you apply 2 hadamard gates on CNOTBody: So when I run through risk, it displayed it had an equal 25% chance to get 00 01 10 11 respectively.
I know how the CNOT output looks like when you apply hadamard gate on control part before CNOT, but I'm not quite sure how the outcomes look like when you add a 2nd hadamard gate to it.
Here is what I mean:
Thanks in advance
"
"['entanglement', 'textbook-and-exercises', 'hadamard']"," Title: Is the tensor product of 2 Hadamard gates entangled?Body: Assume that you have a system of two qubits in the state $|11 \rangle$. Apply $H \otimes H$, where $H$ is the Hadamard matrix. Is the state $(H \otimes H)|11\rangle$ entangled?
I know if we take the tensor product of 2 Hadamard gate we get our initial state, but I'm not quite sure what I'm supposed to do here.
I'm more curious how can I represent $H |11\rangle $, I know $H|1\rangle= \dfrac{|0\rangle - |1\rangle}{\sqrt(2)}$ , so is $H|11 \rangle = \dfrac{1}{\sqrt(2) } \big( |00\rangle-|11 \rangle \big)$ or $H|11\rangle= \dfrac{1}{\sqrt(2) } \big(|00\rangle-|10\rangle-|01\rangle+|11\rangle \big) $
Any help would be great.
Thanks in advance.
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises']"," Title: How do I show that $R_z(\theta)=e^{-iZ\theta/2}$?Body: I know that an $R_z (\theta)$ gate is equivalent to the unitary transformation $e^{-iZ * \theta/2}$ but I'm not sure how we get there.
I know that for every Hermitian matrix there is a corresponding Unitary matrix as $ U = e^{iH} $
where the eigenvalues are exponentiated and the eigenstates remain the same. But I don't see how in this case, it leads to the matrix $$\left(\begin{array}{cc}e^{-i \frac{\lambda}{2}} & 0 \\ 0 & e^{i \frac{\lambda}{2}}\end{array}\right)$$
and not:
$$\left(\begin{array}{cc}e^{i} & 0 \\ 0 & e^{-i}\end{array}\right)$$
I feel like I'm missing something really obvious
"
"['annealing', 'adiabatic-model', 'quantum-walks']"," Title: Relationship of Adiabatic Quantum Computing speedup to Quantum Random Walk hit timeBody: Considering the following two phenomena:
- Adiabatic quantum computing in general exhibits a quadratic speedup over classical simulated annealing, though for some Hamiltonians it may be faster (while for others slower). Typically, quantum tunneling is referred to as the reason for this speedup. (Mukherjee, S., Chakrabarti, B. Multivariable optimization: Quantum annealing and computation. Eur. Phys. J. Spec. Top. 224, 17–24 (2015). https://doi.org/10.1140/epjst/e2015-02339-y)
- Quantum walks on graphs in general exhibit quadratic improved hit time over their classical counterparts, though for some nodes in some graphs this may be exponentially fast while for others it may be slower. In describing the reason behind this, authors usually refer not to tunneling but interference, pointing out that amplitudes on some graph nodes will constructively interfere while others will destructively interfere. (Kempe, J. Discrete Quantum Walks Hit Exponentially Faster. Probab. Theory Relat. Fields 133, 215–235 (2005). https://doi.org/10.1007/s00440-004-0423-2)
Are these separate phenomena, or are they two different statements of the same underlying result? I noticed (through my distinctly non-random sampling of a few papers on each) that quantum walk papers rarely mention adiabatic computation, and vice versa.
"
"['gate-synthesis', 'universal-gates', 'clifford-group']"," Title: Do we need to use an ancillary qubit when decomposing arbitrary $U(2^n)$ gates using Clifford+T universal gate sets?Body: As I know, we can decompose $U$ without ancilla if it's from special unitary group $SU(2^n)$. Do we need to use ancilla qubit on decomposing arbitrary $n$-qubit $U$ using Clifford+T universal gates set?
"
"['quantum-state', 'ibm-q-experience', 'bloch-sphere']"," Title: What is the difference between Bloch's sphere and IBM's Q-sphere?Body: I'm new to Quantum Computing and I've been trying to understand single-qubit operations, quantum phases etc through Bloch's Sphere visualization. However, in IBM's Circuit Simulator, they seem to be using something called Q-sphere. Why are we using Q-sphere instead of Bloch's sphere? Wouldn't Bloch's sphere be a more accurate representation?
"
"['qiskit', 'quantum-gate', 'quantum-state']"," Title: How to keep angles in degrees into quantum circuit using qiskit?Body: Qubit in polar form $$\left|\psi\right\rangle=\cos(\theta/2)\left|0\right\rangle+\sin(\theta/2)\left|1\right\rangle $$
Now lets say i want to keep $\cos(\theta/2) = 50.400 $ degrees angle and $\sin(\theta/2) = 35.80 $ degrees angle into a qubit using qiskit? or how can i convert these angles into a gate so that state zero $\left|0\right\rangle$ which is default input in qiskit to get to desired state $\left|\psi\right\rangle=50.400\left|0\right\rangle+35.80\left|1\right\rangle $ using the angles
"
"['entanglement', 'unitarity', 'graph-states']"," Title: Unitary interaction term of two-qubit graph stateBody: Consider the controlled phase gate $$U_{ab}(\varphi_{ab}) := e^{-i \varphi_{ab}H_{ab}}~~~~\text{where}~~~~H_{ab} := |1 \rangle^{a} \langle 1 | \otimes |1 \rangle^{b} \langle 1 |$$ is the two-qubit interaction. We can show that $$H_{ab} = \frac{1}{4}( I_{ab}-\sigma_{z}^{a}-\sigma_{z}^{b}+H_{ab}^{I})$$ where $H^{I}_{ab} = e^{-i \varphi_{ab} \sigma^a_z \sigma^b_z}$ and therefore $$U_{ab}(\varphi_{ab}) = e^{-\frac{i\varphi_{ab}}{4}}e^{\frac{i\varphi_{ab}}{4} \sigma^a_z}e^{\frac{i\varphi_{ab}}{4}\sigma^b_z}e^{-i \varphi_{ab} \sigma^a_z \sigma^b_z}.$$ Is it clear how it follows then that for $\varphi_{ab}= \pi$ we have $$U_{ab}(\pi) = |0\rangle^{a} \langle 0 | \otimes I^b + |1\rangle^{a} \langle 1 | \otimes \sigma^b_z,$$ where $I$ is the identity, as stated in Eq. (22) on page 13 of the paper "Entanglement in Graph States and its Applications (2006)" by M.Hein. Thanks for any assistance.
"
"['programming', 'qiskit', 'universal-gates']"," Title: How to use qiskit transpile with Clifford + T basis?Body: How can I transpile using universal $Clifford + T$ gates set? I have only seen examples using rotations + $CNOT$.
This is what I have tried
from qiskit import *
from qiskit.quantum_info import Operator
from qiskit.compiler import transpile
%matplotlib inline
u = Operator([[0, 0, 1, 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, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0]])
qc = QuantumCircuit(3)
qc.unitary(u, [0,1,2], label='u')
result = transpile(qc, basis_gates=['u1', 'u2', 'u3', 'cx'], optimization_level=3)
result.draw(output='mpl')
And this example works fine. But when I was trying to set:
basis_gates=['h', 's', 't', 'cx']
It doesn't work.
Could you help me, please?)
UPDATE:
After comments I've tried this:
pip install git+https://github.com/LNoorl/qiskit-terra.git@feature/sk-pass
and then:
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.library import TGate, HGate, TdgGate, SGate
from qiskit.transpiler.passes import SolovayKitaevDecomposition
from qiskit import *
from qiskit.quantum_info import Operator
from qiskit.compiler import transpile
%matplotlib inline
u = Operator([[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]])
qc = QuantumCircuit(3)
qc.unitary(u, [0,1,2], label='u')
print('Orginal circuit:')
print(qc)
basis_gates = [TGate(), SGate(), HGate()]
skd = SolovayKitaevDecomposition(recursion_degree=2, basis_gates=basis_gates, depth=5)
discretized = skd(qc)
print('Discretized circuit:')
print(discretized)
But it outputs only this:
Orginal circuit:
┌────┐
q_0: ┤0 ├
│ │
q_1: ┤1 u ├
│ │
q_2: ┤2 ├
└────┘
Discretized circuit:
┌────┐
q_0: ┤0 ├
│ │
q_1: ┤1 u ├
│ │
q_2: ┤2 ├
└────┘
Where is a problem?
"
"['ibm-q-experience', 'grovers-algorithm']"," Title: 4Q Grover circuit working in simulator, however producing nonsense in actual quantum computerBody: I am a noob at quantum computing but I am certain the circuit is correct. I've tried increasing the number of shots, changing the quantum computer. I think it might be a problem with my ccccx gate? I am not sure I implemented it correctly. I've also been hearing something about connectivity, but my internet connection shouldn't be an issue?
I live in Australia and I've been using mainly IBM Quito. That computer has a shockingly of low queue 100 compared to the 10k queueing for the one in my city Melbourne, is there a known problem with IBM Quito?
For context my 2 qubit, 3 qubit circuit works perfectly. 2 qubit circuit works flawlessly 100% of the time finding the hidden variable. 3 qubit circuit has some hiccups but it still works maybe 70% of the time. 4 qubit one works maybe 10% of the time.
"
['quantum-gate']," Title: Given 2 unknown qubits, which series of gates can put them in an equal superposition of $\vert 00 \rangle$ and $\vert 11 \rangle$?Body: You have 2 qubits, the states of which are unknown to you. They are either in the state $\vert 0 \rangle$ or $\vert 1\rangle$. Which sequences of gates can be applied so as to put the system in the state $\frac{1}{\sqrt{2}}$($\vert 00 \rangle$ + $\vert 11\rangle$)?
"
"['qiskit', 'quantum-state', 'algorithm', 'circuit-construction', 'inner-product']"," Title: Does the circuit with qubit-wise CZ gates compute the inner product of two states? If not, is there another circuit that does?Body: I've been searching for a quantum algorithm to compute the the inner product between two $n$-qubit quantum states, namely $\langle\phi|\psi\rangle$, which is in general a complex number.
One can get $|\langle\phi|\psi\rangle|^2$ through thte SWAP test for multiple qubits, but this is not really the inner product as the information of the real and imaginary parts are lost.
I came across this qiskit page, which claims that the task can be done by simply using CZ gates. I'm not sure if I am mistaken, but it seems to me that such a circuit works for computational basis states, but not for general quantum states. Could somebody help me confirm if this is actually the case?
If the above algorithm doesn't work for general quantum states, what algorithm would you suggest?
"
"['qiskit', 'algorithm']"," Title: What algorithm does Qiskit use to decompose arbitrary n-qubit unitaries on Rotations + CNOT?Body: I found that Qiskit uses Unroll3qOrMore in the transpiler class function to decompose an arbitrary $n > 2$ unitary and represent it as a directed acyclic graph (DAG). But I can't find an algorithm (or paper for it). Could you help?
"
['algorithm']," Title: Integer Eigenvalues leading to periodicityBody: I've been reading a number of papers about approximate algorithms and they mention that when the standard Ising Hamiltonian of the form
$$
H_{c}=\sum_{} c_{i} Z_{i} +\sum_{} J_{i j} Z_{i} Z_{j}, $$
has integer eigenvalues, the value of $$
F_{p}(\boldsymbol{\gamma}, {\boldsymbol{\beta}})= \left\langle\psi_{p}(\boldsymbol{\gamma}, {\boldsymbol{\beta}})\left|H_{C}\right| \psi_{p}(\boldsymbol{\gamma}, {\boldsymbol{\beta}})\right\rangle,
$$
where, $$
|\psi_{p}(\boldsymbol{\gamma}, \boldsymbol{\beta})\rangle=U_{B}\left(\beta_{p}\right) U_{C}\left(\gamma_{p}\right) \cdots U_{B}\left(\beta_{1}\right) U_{C}\left(\gamma_{1}\right)|+\rangle^{\otimes N}
$$
is periodic, but the value when $H_{c}$ is not integer eigenvalued isn't: why is this ?
Cross-posted on physics.SE
"
"['algorithm', 'resource-request', 'vqe']"," Title: List of problems that can be reduced to finding the ground state of a HamiltonianBody: I'm doing some reading into Variational Quantum Eigensolvers (VQEs), Quantum Approximate Optimization Algorithms (QAOAs), and other similar algorithms.
I know that the point is to find the ground state of a Hamiltonian. I'm interested in making/finding a list of all the different problems that we know we can solve in this way.
For example, I've seen references to applications in chemistry, material science, and even graph theory. Can you point me to an existing list of applications, or list some places I can go to find more? Google searches for "applications of finding ground state of Hamiltonian" are not giving me anything interesting.
What I'm most interested in is how one can translate the problem into the specific Hamiltonian that they want to solve, and then specifically what they learn about the problem when they find the ground state energy.
"
"['grovers-algorithm', 'terminology', 'quantum-walks']"," Title: What is meant by ""perfect state transfer""?Body: In discussions on many quantum algorithms especially related to quantum walks, I have seen the term "perfect state transfer" used to describe some property apparently related to the periodicities of the walk/algorithm, but I cannot quite grasp the significance of the term, or why it would be useful concept to consider.
For example using Grover's algorithm to find a single marked state by applying iterations to a state initially prepared on the uniform superposition over all input vectors will not necessarily reach back to the uniform superposition, thus there may not be perfect state transfer with Grover's iteration. (I think).
Is there a succinct way to understand "perfect state transfer", and why this is an interesting concept to study?
The Wikipedia article is not bad, but I suspect there might be more to be said..
"
"['quantum-gate', 'algorithm', 'phase-kickback', 'bernstein-vazirani-algorithm']"," Title: In the Bernstein-Vazirani circuit, if the secret is all 0s, would the oracle just be nothing?Body: I'm self-studying quantum computing and have gone through the Wikipedia article on the Berstein-Vazirani algorithm and believe that I understand it. I'm looking to verify my understanding and hope that someone could help me.
If I have an 8 bit secret of all 0s, would the oracle just be nothing? Alternatively, if it was all 1s, would my oracle CNOT each input with the output qubit?
"
"['quantum-gate', 'quantum-state', 'probability']"," Title: Intuitions about probabilities relating to evolving a two-qubit state through a CNOT gateBody:
If the initial state of $|x_0\rangle = \alpha |0\rangle + \beta |1\rangle$ and $|x_1\rangle =|0\rangle$, and the final state at the barrier is $|10\rangle$ (in the form $|x_1x_0\rangle$), what would the state of this system be in the form $|00\rangle + |01\rangle + |10\rangle + |11\rangle$?
Since $x_0$ is the control qubit, it seems the CNOT gate only does something when $x_0$ is in the $|1\rangle$ state. Does this mean that $x_0$ would effectively be "copied" onto $x_1$? What would the state of this system be?
"
"['programming', 'qiskit', 'measurement', 'openpulse']"," Title: Measuring second excited state |2> using ""calibrations"" not Open PulseBody: I am tying to measure the second excited state in a system that does not support Open Pulse. Instead I am using calibrations. The method detailed here does not work. I get the error "AttributeError: 'IBMQBackend' object has no attribute 'instruction_schedule_map'".
Using the method detailed here reproduces the same error "AttributeError: 'NoneType' object has no attribute 'instruction_schedule_map'".
Is there a different way to access the measurement calibrations in a system which does not support pulse?
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: How is quantum machine learning reversible?Body: Say I have a binary classification network, which takes in inputs and classifies them. I can put in different inputs and get the same output, right? So does that not make QML non reversible, since just by looking at the output, I will never know the input?
"
"['physical-qubit', 'superconducting-quantum-computing']"," Title: Clean way of approximating an oscillator by a qubitBody: Let me consider a (quantum) Harmonic oscillator of (bare) Hamiltonian:
$$H_0=\frac{p^2}{2m}+\frac{1}{2} m \omega^2 x^2$$
(I can add to it an anharmonicity $V=\alpha x^4$ if necessary for the purpose of this question.)
The main purpose of my question is to know how we can properly approximate it to a two level system as often done in superconducting qubit.
The Harmonic oscillator annihilation/creation operators are defined as:
$$a=\sqrt{\frac{\hbar}{2 m \omega}}(x+\frac{i}{m \omega}p)$$
$$a^{\dagger}=\sqrt{\frac{\hbar}{2 m \omega}}(x-\frac{i}{m \omega}p)$$
I end up with $H_0=\hbar \omega a^{\dagger} a$
Now, let's assume that for any reason I know that the dynamic should be restricted to the two first levels only: I want to approximate my system by a two level system.
One way that I thought we could do is to take the energy gap $\hbar \omega_0$ between the two first level, and to consider:
$$H_0=-\frac{\hbar \omega_0}{2} \sigma_z$$
But let's assume that our oscillator is interacting with a driving field $F(t)$ via:
$$H=H_0+H_d(t)$$
$$H_d=f(p)*F(t)$$
Where $f(p)$ is a polynome in $p$ for instance. How should I modify $f(p)$ for the two level approximation ?
I initially believed that the mapping oscillator $\to$ qubit would consist in $a \to \sigma_-$. But doing so we end up with $p^{2n}$ and $x^{2n}$ being proportional to identity (if $H_d(t)$ involves even power of $p$ the interaction then vanishes).
Indeed,
$$p=i\sqrt{\frac{\hbar m \omega}{2}}(a^{\dagger}-a) \to \sqrt{\frac{\hbar m \omega}{2}} \sigma_y$$
$$x=\sqrt{\frac{\hbar}{2 m \omega}}(a^{\dagger}+a) \to \sqrt{\frac{\hbar}{2 m \omega}} \sigma_x$$
My question is thus:
How, given an oscillator potentially interacting with "something else" with polynomial interaction in $x$ and $p$ should I define the associated two level description. For the "bare" Hamiltonian it is clear but as soon as interaction are involved it is not so clear for me. Is it normal that indeed terms of order $p^2$ vanish in the interaction ?
"
"['quantum-operation', 'fidelity', 'tomography', 'quantum-process-tomography']"," Title: What is the best method for estimating average channel fidelity?Body: This thesis shows an efficient way to estimate average channel fidelity (in chapter 4). However, it is somewhat old (from 2005). Are there any better methods out there? By better I mean: are there other methods that can achieve the same accuracy of estimation but with fewer qubits? (or put another way, are there methods that can achieve higher accuracy with the same amount of qubits)
I imagine some methods for fidelity estimation and/or quantum tomography of single qubits could be used to modify and improve the method from the thesis I cited. If so, does anyone specifically know which methods could be used, and how? Thanks!
"
"['quantum-operation', 'fidelity', 'tomography', 'quantum-process-tomography']"," Title: What is the best quantum process tomography method?Body: This question is somewhat related to this question. What is currently the best method for quantum process tomography? By best I mean, the one that can achieve the best accuracy of estimation per qubit used.
"
"['quantum-state', 'entanglement', 'tensor-product']"," Title: Is it possible to retrieve $|\psi_1\rangle,|\psi_2\rangle$ from their tensor product $|\psi_1\rangle\otimes|\psi_2\rangle$?Body: Consider two quantum states$$\left| \psi_1 \right> = \alpha \left|0\right> + \beta\left|1\right>$$ and $$\left| \psi_2 \right> = \gamma \left|0\right> + \delta\left|1\right>$$
Now tensor product of two states gives
$$\left| \psi \right> = \left|\psi_1\right> \otimes \left|\psi_2\right>$$
$$\left| \psi \right> = \alpha\gamma \left|00\right> + \alpha\delta\left|01\right> + \beta\gamma \left|10\right> + \beta\delta\left|11\right>$$
Is it possible to factor the state $\left| \psi \right> $ and get $\left| \psi_1 \right> $ and $\left| \psi_2 \right> $ back?
"
"['programming', 'qiskit', 'quantum-fourier-transform']"," Title: Qiskit QFT matrix does not match with DFT matrixBody: The unitary matrix associated with the QFT circuit in Qiskit does not match the actual DFT matrix. In fact, all the imaginary components have their sign flipped (QFT and DFT matrices seems to be each other's complex conjugate). Is that the correct behavior?
Note that the QFT circuit already includes the swap gates at the end of the circuit.
import numpy as np
from scipy.linalg import dft
from qiskit import *
from qiskit.circuit.library import QFT
n = 2
dft_matrix = (1/np.sqrt(2**n)) * dft(2**n)
qft_matrix = execute(QFT(n), Aer.get_backend('unitary_simulator')).result().get_unitary()
# remove components almost zero for enhanced visualization
eps = 0.00001
dft_matrix.real[np.abs(dft_matrix.real) < eps] = 0
dft_matrix.imag[np.abs(dft_matrix.imag) < eps] = 0
qft_matrix.real[np.abs(qft_matrix.real) < eps] = 0
qft_matrix.imag[np.abs(qft_matrix.imag) < eps] = 0
dft_matrix, qft_matrix
The matrices have values:
dft_matrix=
array([[ 0.5+0.j , 0.5+0.j , 0.5+0.j , 0.5+0.j ],
[ 0.5+0.j , 0. -0.5j, -0.5+0.j , 0. +0.5j],
[ 0.5+0.j , -0.5+0.j , 0.5+0.j , -0.5+0.j ],
[ 0.5+0.j , 0. +0.5j, -0.5+0.j , 0. -0.5j]]),
qft_matrix=
array([[ 0.5+0.j , 0.5+0.j , 0.5+0.j , 0.5+0.j ],
[ 0.5+0.j , 0. +0.5j, -0.5+0.j , 0. -0.5j],
[ 0.5+0.j , -0.5+0.j , 0.5+0.j , -0.5+0.j ],
[ 0.5+0.j , 0. -0.5j, -0.5+0.j , 0. +0.5j]])
"
"['textbook-and-exercises', 'quantum-fourier-transform']"," Title: What is the quantum Fourier transform of $\alpha|0\rangle+\beta|1\rangle$?Body: Given $|\psi\rangle = \alpha |0\rangle + \beta |1\rangle$ and $|\alpha|^2 + |\beta|^2 = 1$, what would the quantum Fourier transform of $|\psi\rangle$ be? I know it is of the form $\frac{1}{\sqrt{2}}(x |0\rangle + y |1\rangle)$, but how would I determine $x$ and $y$?
Is it possible that $QFT(|\psi\rangle) = |\psi\rangle$?
"
"['grovers-algorithm', 'quantum-circuit', 'simons-algorithm']"," Title: How could one implement a circuit using Grover's algorithm to solve a linear system of equations?Body: Given the following system:
$$\begin{bmatrix}0 & 1 & 0\\1 & 1 & 1\\1 & 0 & 1\end{bmatrix}
\begin{bmatrix}s_2\\ s_1\\ s_0\end{bmatrix} = \begin{bmatrix}0\\ 0\\ 0\end{bmatrix}$$
How could one implement a circuit such that the output is $|1\rangle$ when $|s_0\rangle$, $|s_1\rangle$, and $|s_2\rangle$ are solutions? Is this possible using Grover's algorithm and without hardcoding the solutions?
"
"['programming', 'qiskit', 'simulation', 'unitarity']"," Title: How accurate are Qiskit’s unitary and Statevector simulators for very large circuits?Body: Background: I wrote a code that takes a Qiskit circuit C as an input and outputs a random circuit C’ such that C and C’ have the same unitaries. I tested my code using Qiskit’s Statevector simulator and Qiskit’s unitary simulator (using np.allclose). I tested over 20 circuits of various sizes, all passed the tests successfully, EXCEPT for one circuit, where sometimes I get the same unitaries and state vectors and sometimes I don’t. The circuit is quite large, with 10 qubits, 20 CNOT’s and a bunch of non-Clifford gates. The random output for this circuit can be incredibly large (e.g., more than 300 layers and a ridiculous number of CNOT’s). I’m pretty sure that there’s no error in my code, which leads me to ask:
Question: is there a certain size/complexity threshold of a circuit beyond which Qiskit’s unitary and Statevector simulators might return inaccurate results? In case that this never happens, is there any other explanation for the peculiar behavior that I described?
"
['measurement']," Title: Is there a list of known quantum measurements?Body: Quantum Measurement can be divided into General Measurements, Projective measurements and general POVMs. And there are also some special kinds of quantum measurements that have their own name, such as :
- adiabatic measurement (protective measurement)
- weak measurement
- quantum nondemolition measurement and so on.
Is there a list of those special kinds of measurements?
"
"['quantum-gate', 'quantum-state', 'entanglement']"," Title: How to calculate the evolution of ket states through a simple quantum circuit?Body: I am having difficulties with the calculations of qubits.
I think I can do them, but it feels so massivly inefficient!
In this tutorial grover's algorithm for example, there's a simple oracle given for the binary bitcombination '110':
(bit-order is as usual swapped, so most significant bit is q2 - at least I think so)
what I've tried so far:
let $a = |110>$
the first step I thought would be to apply the x on the top bit and the Hadamard on the bottom bit so:
$a' = |111>$
$a'' = \frac{1}{\sqrt{2}}(|011> - |111>)$
next I would think: only when the second and third bit are equal to 1 then the first bit swaps:
$a''' = \frac{1}{\sqrt{2}}(|111> - |011>)$
next I negate the top (third) bit:
$a^{4'} = \frac{1}{\sqrt{2}}(|110> - |010>)$
and finally I use Hadamard on the bottom (first) bit:
$\displaystyle a^{5'} = \frac{1}{2} \Big(|010> - |110> -\big(|010> + |110>\big)\Big)$
$= -|110>$
and yes, thats exactly what I want. But is there a way to calculate this alternively with some matrices or tensors? where I can use the form of
$ |110> = \begin{pmatrix} 0\\0\\0\\0\\0\\0\\1\\0 \end{pmatrix}$
How can I represent the layer with X() and H() mixed?
"
"['quantum-state', 'tomography', 'quantum-fisher-information']"," Title: How does the quantum Fisher information provide bounds for the estimation of output states?Body: Assume you have some quantum process $Q$ (e.g. quantum state tomography) that intakes initialised states $\rho_{i}$, $i=1,\ldots,n$ and gives some output $\rho'_i$.
$$
\rho_1 \to Q \to \rho'_1 \\
\rho_3 \to Q \to \rho'_2 \\
\vdots \\
\rho_n \to Q \to \rho'_n
$$
Then, assume we can estimate these outputs using some method and we produce estimates $\hat \rho_i$.
$$
\hat \rho_1 \text{ estimates } \rho'_1 \\
\hat \rho_2 \text{ estimates } \rho'_2 \\
\vdots \\
\hat \rho_n \text{ estimates } \rho'_n \\
$$
How can I use the notion of the Quantum Fisher Information for finding bounds on how well these output states $\rho'_i$ can be estimated by my methods? E.g. if the density matrix formed by the initial states corresponds to that of a qubit ($n=4)$:
$$
\rho = \sum_{i=1}^{4} \lambda_i |i\rangle \langle i | = \sum_{i=1}^{4} \lambda_i \rho_i.
$$
In this case, do I need to compute $F_Q[\rho,\hat\rho]$? If so, how is this done? System can be closed for simplicity so that evolution is unitary.
"
"['qiskit', 'grovers-algorithm']"," Title: Does Grover's algorithm always give the correct answer with 100% certainty for two-qubit states?Body: In the Qiskit tutorial on Grover's algorithm it is stated that with a 2 qubit algorithm the chance of measuring the "right" state is already 100%.
But I thought that the algorithm would amplify the 'right' amplitude around 9 times and respectively the probability around 3 times.
Is this depending on the variation of grovers algorithm used? Where does the 100% suddenly came from, if other multi-qubit states do not get to 100%?
Edit:
I want to work with the Quantum Reinforcement Learning Paper of Dong et al.
There they propose to use some sort of grovers algorithm to make use of the probability amplification of a 2 qubit system. This would need a slower approach to 100% as far as I understand. There would be no point in their proposal, if it reaches 100% after just 1 iteration.
"
"['complexity-theory', 'quantum-circuit', 'bernstein-vazirani-algorithm']"," Title: How do I construct the oracle for a general Bernstein-Vazirani circuit?Body: Say I have a secret of length $n$, $s = |x_{n-1}x_{n-2}...x_0 \rangle$. If I want to construct an oracle for this problem would I just insert a CNOT gate on every qubit where the secret's value is 1? And just do nothing to all of the 0 qubits?
How would I determine the asymptotic complexity of this circuit in its worst-case situation?
"
"['entanglement', 'quantum-operation', 'cryptography']"," Title: Can a qubit be entangled with an arbitrary quantum state, without altering it?Body: For example, if an adversary were to get hold of one half of an entangled 2-qubit quantum state, $|\psi \rangle$, travelling along a channel, would they be able to entangle one of their own qubits with that state $|\psi \rangle$, and then re-insert $|\psi \rangle$ back into the channel unaffected? (even though they do not know the value of $|\psi \rangle$)
To further elaborate:
A 'sender' $S$, prepare two qubits (denoted as $|\psi_1 \rangle$ and $|\psi_2 \rangle$) entangled with each other as the state $|\psi \rangle$. $S$ sends one of the qubits, $|\psi_2 \rangle$, to a 'receiver' $R$ along some channel. While the qubit, with state $|\psi_2 \rangle$, is travelling through the channel on its way to reach $R$, an 'adversary', call them $A$, entangles one of their own qubits with the qubit $S$ sent, without affecting its state $|\psi_2 \rangle$. Thus, resulting in $3$ qubits all entangled with each other, and the $2$ original qubit states $S$ prepared are maintained. Is this scenario possible??
edit: I didn't frame my question in the way I meant to. It is obvious that the state will change if entangling a third qubit with it: it is now a new state of 3 qubits instead of 2. My question I was really trying to ask was: can an 'adversary' make a third qubit be entangled with an existing 2 qubit entangled pair, in a way such that the 'sender' and 'receiver' are unaware of it. My answer down below explains how this is possible.
"
"['quantum-circuit', 'bernstein-vazirani-algorithm']"," Title: What does it mean for a circuit to be a valid instance of the Bernstein-Vazirani problem?Body:
What does it mean for a circuit to be a valid instance of the Bernstein-Vazirani problem? It's not clear to me in the above circuit what the X gate is doing on the $b$ qubit. I guess it's just inverting the result? That would mean this encodes the secret 1111, correct?
Is this a valid instance? What function would you say the oracle is implementing, just an inversion?
"
"['programming', 'qiskit', 'bernstein-vazirani-algorithm']"," Title: Bernstein Vazirani Algorithm widget (bv_widget) in the Qiskit documentationBody: I'm new to quantum computing and Qiskit, so please be patient with me. I'm going through the info on Bernstein Vazirani. Here is the link to the section: https://qiskit.org/textbook/ch-algorithms/bernstein-vazirani.html.
About midway down the page, at the end of the example section, is a widget: bv_widget. I have attempted to run the widget and apply the steps mentioned in the section. I apply the hadamards, then the oracle and then the hadamards again. But there seems to be no way of performing a measurement to determine the result. I tried placing bv_widget.measure(2,2) as the last line in the code sample, but that didn't work. Neither did just using the word measure(2,2).
What am I missing here? Is there a way to perform a measurement?
PS A similar piece of code is at the end of the chapter, and I'm running into the same problem with it.
Thanks for your help.
Doug
"
"['programming', 'qiskit', 'noise']"," Title: How to turn a 'term' in a QuantumError into a QuantumError?Body: A QuantumError class may have many terms, and we can use .error_term(position) to have a look at each term. But it returns a list instead of another QuantumError class. What should I do if I want to find out how this single term works in the noise model?
"
"['quantum-gate', 'algorithm', 'grovers-algorithm']"," Title: Can I use Grover's algorithm for a function that has multiple arguments which satisfy it?Body: Let's say we have a function $f(x)$, where $f(011) = 1$, and $f(111) = 1$.
Can I still use Grover's algorithm with this function, and receive the result of either $011$, or $111$?
"
"['programming', 'cirq', 'pyquil', 'projectq']"," Title: Bloch sphere visualization using Cirq, ProjectQ, PyQuilBody: Is there a way to visualize the Bloch sphere using Cirq, ProjectQ, and/or PyQuil, as it is possible using plot_bloch_vector in Qiskit?
"
"['quantum-gate', 'measurement', 'quantum-circuit', 'quantum-enhanced-machine-learning']"," Title: Why are 3, rather than 2 gates used in quantum variational circuits?Body: In the hello many worlds tensorflow tutorial and in the lockwood paper (2020) I have seen that often in QVC the following combination of gates is used:
$R_z(\theta), R_y(\theta), R_x(\theta)$
I am wondering if not just two of them would suffice for reach every measurable quantum state.
I thought, that certain quantum states are only theoretically different, so for example:
$|\psi> = \frac{1}{\sqrt2}\big(|0> + |1>\big)$
and
$|\psi> = \frac{1}{\sqrt2}\big(i|0> + i|1>\big)$
are, when measured collapsing to 50% to $|1>$ and to 50% to $|0>$
So my question is, why would we need to add a third gate, if already 2 gates suffice, to gain every possible probability when measuring?
"
"['complexity-theory', 'quantum-circuit']"," Title: Is the complexity of a quantum circuit constant in the depth of the circuit?Body: Take a quantum circuit on $n$ qubits, you have some sequence of gates.
You can represent these gates as hermitian matrices, and then with some padding, you could take the product of these matrices, by closure would be a hermitian matrix, a quantum operation.
Then you have who knows how many gates into one single, but complicated $n$-ary gate.
On a perfect fidelity machine, this could be o(1) right. Does this logic make sense? I feel like it shouldn't be independent of the depth, or a lot of classical circuit problems become constant time on a QC.
"
"['qiskit', 'hhl-algorithm']"," Title: What are the correct eigenvalues to use in controlled rotation in HHL?Body: I'm studying the HHL algorithm from the qiskit textbook, but I don't understand what $\lambda$ we have to use. If my matrix $A$ has eigenvalues that can be written in a binary representation, then, after QPE, in that register we just have an $n$-bit representation of the eigenvalues. Otherwise, in that register, we have an $n$-bit approximation, $2^n \frac{\lambda t}{2\pi}$. When I do controlled rotation, I have to calculate $2\arcsin(C/\lambda_j)$. My question is, which $\lambda_j$'s are the real eigenvalues of $A$: the values stored in the register or only $ \frac{\lambda t}{2\pi}$? My question arises because in this paper the authors use the exact eigenvalues, which can be written in a binary representation, but, the textbook uses $\frac{\lambda t}{2\pi}$, wherein this case, the eigenvalues cannot be written in a binary notation. Can't I always use the value inside the register $(2^n \frac{\lambda t}{2\pi})$ regardless of the representation?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Why does applying a Hadamard gate three times to $|0\rangle$ result in a tiny imaginary component in the $|1\rangle$ amplitude?Body: I'm using qiskit with the online IBM Quantum Lab and when I run the following code
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_bloch_multivector
qc = QuantumCircuit(1)
qc.h(0)
qc.h(0)
qc.h(0)
out = execute(qc,Aer.get_backend('statevector_simulator')).result().get_statevector()
print(out)
plot_bloch_multivector(out)
... it results in the following state vector for the qubit:
[0.70710678+0.00000000e+00j 0.70710678+1.57009246e-16j]
As you can see there's a very small imaginary component in the |1> amplitude.
These imaginary values pop up often with qiskit, such as:
qc.x(0)
qc.h(0)
--> [ 0.70710678+0.00000000e+00j -0.70710678+8.65956056e-17j]
or even very small non-imaginary numbers, such as:
qc.x(0)
qc.h(0)
qc.h(0)
--> [6.123234e-17+0.00000000e+00j 1.000000e+00-2.22044605e-16j]
Is this something unique to quantum mechanics/computing that actually has practical consequences when doing computation, or perhaps simply a quirk of Python's scientific notation implementation.
"
"['quantum-state', 'information-theory', 'communication', 'channel-capacity']"," Title: What was the meaning of Lossless Quantum compression?Body: I was reading few questions regarding lossless quantum compression on stack exchange, then out of curiosity, I started reading this article. After reading I end up being confused about what does quantum compression really means? For example take$$|\psi\rangle=(|00\rangle+|10\rangle)/\sqrt{2}$$ article was saying compression means making $|00\rangle$ to $|0\rangle$ and $|10\rangle$ to $|1\rangle$, then storing the length and append zeros to decompress. Why can't they measure the quantum state and store the information, instead of compressing the quantum state? What was the use of the density matrix in this entire article is it just to measure the information?
"
"['programming', 'qiskit']"," Title: Qiskit: count the type of gates on the qubit with the largest number of gates in a multi-qubit circuitBody: I would like to know the number and type of all the gates on the wire/qubit with the largest operations in a quantum circuit with multiple qubits. Is there any inbuilt functionality, or what is the shortest way to do so?
"
"['circuit-construction', 'mathematics', 'non-locality']"," Title: Is the No-Cloning Theorem Violated in $C^\ast$-Circuit Models?Body: In Cleve, et al., the authors discuss self-embezzlement of a catalyst state $\psi$, making the statement on page 2,
[B]y local operations, state $\psi\otimes(\vert 0 \rangle \otimes \vert 0 \rangle)$
is mapped to $\psi \otimes \psi$ within fidelity
$1-\epsilon$.... [W]e allow the catalyst to be any pure state that is
non-trivially entangled in the sense that it can be used to
approximately attain the maximal violation of the CHSH inequality....
When $\epsilon=0$, this is referred to as exact self-embezzlement. Moreover, Theorem 1.3 in the paper states, "In the $C^\ast$-circuit model, exact self-embezzlement is possible."
If $\psi$ is unknown, it seems clear that exact self-embezzlement would violate the no-cloning theorem. However, I don't see anything in the paper that implies $\psi$ is known. In particular the $\ast$‑automorphism, discussed at the top of page 11, does not seem to require that $\psi$ be known.
My question is,
- Does this paper imply that the no-cloning theorem is violated in $C^\ast$-circuit models?
N.B. the authors show that self-embezzlement cannot be approximated to arbitrary precision in the conventional quantum circuit model, so thinking of the results in terms of some form of closure of the conventional circuit model is not helpful.
"
"['quantum-state', 'superconducting-quantum-computing', 'tomography']"," Title: What is the IQ plane?Body: I struggle to find any information on Nielsen and Chuang or similar texts on the exact definition of the so-called IQ plane (I think this is a notion closely related to solid state quantum computers such as transmon).
Can you provide a simple explanation of what the IQ plane or recommend some references that clearly explain it and its relation to the estimation of quantum states when one performs quantum state tomography?
"
"['quantum-gate', 'clifford-group']"," Title: If $C$ is a Clifford circuit, is there necessarily a Clifford circuit $C'$ such that $CT=TC'$?Body: Let $C$ be a Clifford circuit, is there necessarily a Clifford circuit $C'$ such that $CT=TC'$ (where $T$ is taken as applying the $T$ gate to the same qubit on both sides)?
"
"['qiskit', 'ibm-q-experience']"," Title: Can I use the same qiskit account on two laptops?Body: I have two laptops with different accounts of Jupyter Notebook. I'm wondering can I use the same qiskit account (with the same token) on both laptops? I'm worried that if I run the token on my new laptop, the original one will be terminated. Thanks!
"
"['programming', 'quantum-gate', 'ibm-q-experience']"," Title: What is the relationship between the (sx) error rate listed in calibration and the angle/amplitude errors calculated using the fitter?Body: The IBM Quantum services website lists calibration statistics for their devices, including the (sx) error rate per qubit, which is listed as a single number. One can also manually calibrate a device using the ampcal_1Q_circuits and anglecal_1Q_circuits functions in Ignis, but doing so results in two different numbers for the sx amplitude error and angle error. What is the relationship between these two errors and the number listed on the website?
"
"['quantum-gate', 'entanglement']"," Title: Is there a simple quantum gate that shows off the power of Quantum interference?Body: I'm trying to build a deep understanding of where the power of quantum computing comes from when compared to probabilistic computing. A naive observation might be that probabilistic computing would be just as powerful since both give you a single result from a set of possible results with a certain probability. I've come to understand that quantum computing is more powerful, because unlike with probabilistic computing, quantum computers can make the probabilities interfere with each other to suppress undesired results, and enhance desired results.
Is there a simple quantum gate that shows this suppression and enhancements of results in action? I think that that would really help me tie the intuition behind quantum computers to the concrete mathematical description of quantum gates.
And how does all this relate to entanglement? Is entanglement required to get useful results out of interference?
"
"['quantum-gate', 'physical-qubit', 'superposition']"," Title: Does a CNOT quantum gate violate no cloning theorem?Body: I am a curious quantum computing learner. :)
Once observe the CNOT gate:
as you can see there it converts a |+> to |-> in the top or to say in another way it clones the |->
state. So does this violate "No Cloning Theorem".
Say for example when you apply a CNOT gate to a qubit in superposition then that is indeed as the
same as cloning the qubit in superposition.
"
"['programming', 'qiskit', 'quantum-state', 'simulation', 'density-matrix']"," Title: What is the superop simulator in Qiskit for?Body: I'm trying to understand what the use case of a superop simulator would be. My understanding is that density matrix is generally more resource intensive than state vector, but it has additional capabilities to support noisy channels and such. And also my understanding is that every circuit has a corresponding superop that can be extracted from it via QIS, but I believe that can be obtained via calculation rather than simulation. So I don't understand what a superop simulator is for. I know it's even more resource intensive than density matrix, but what additional capabilities does it provide?
"
['qiskit']," Title: Qiskit Tomography and Noise Mitigation with a Measurement Mid-ExecutionBody: I'm struggling to get a program running where I have a circuit with a measurement and reset mid-execution and I want to use noise mitigation and state tomography together.
The circuit is defined
qreg_q = QuantumRegister(2, "q")
creg_c = ClassicalRegister(1, "c")
qc = QuantumCircuit(qreg_q, creg_c)
qc.u(1, 1, 1, qreg_q[0])
qc.cu(1, 0, 0, 0, qreg_q[0], qreg_q[1])
qc.cx(qreg_q[1], qreg_q[0])
qc.measure(qreg_q[1], creg_c[0])
qc.reset(qreg_q[1])
N.B I don't need the measurement result here.
I then create my tomography circuits from this
from qiskit.ignis.verification.tomography import state_tomography_circuits, StateTomographyFitter
qpt_circs = state_tomography_circuits(qc, qreg_q[0])
and the calibration circuits
import qiskit.ignis.mitigation.measurement as mc
cal_qr = QuantumRegister(2)
cal_cr = ClassicalRegister(2)
meas_calibs, state_labels = mc.complete_meas_cal(qublit_list=[0])
Using a simulator with a noise-model
backend = provider.get_backend('ibmqx2')
sim = AerSimulator.from_backend(backend)
I run the calibration circuit
job_cal = sim.run(meas_calibs, shots=8192)
meas_fitter = mc.CompleteMeasFitter(job_cal.result(), state_labels)
I then run the tomography circuits
qpt_circs_compiled = transpile(qpt_circs, sim)
job_tomo = sim.run(qpt_circs_compiled, shots=8192)
result = job_tomo.result()
tomo_state = StateTomographyFitter(result, qpt_circs)
I'm able to obtain a state from the result with tomography
state = tomo_state.fit()
However the noise mitigation fails
meas_filter = meas_fitter.filter
mitigated_results = meas_filter.apply(result)
with QiskitError: "Unexpected state label '0 0', verify the fitter's state labels correspond to the input data".
It seems to me that the tomography circuits add a second classical register that the noise mitigation circuits isn't configured to process properly. How can I get around this so I can mitigate the noise in my density matrix output?
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'quantum-process-tomography']"," Title: In quantum process tomography, how does $\chi$ characterize a quantum process?Body: I'm working through Nielsen and Chuang and I'm pretty confused by the discussion of quantum process tomography. I'm trying to work through an example of 1-qubit state tomography given by N&C (box 8.5), which provides an algorithm for determining $\chi$ in terms of block matrices and density matrices (determined by state tomography). The process seems pretty straight forward, but how does $\chi$ characterize a quantum process?
"
"['programming', 'quantum-state', 'algorithm', 'grovers-algorithm', 'quantum-advantage']"," Title: Can I use Grover's algorithm on overlapping sets of qubits?Body: Let's say I have 3 qubits: $q_1,q_2,q_3$.
I want to apply Grover's algorithm on q1,q2, such that q1,q2 $\neq$ 10 and do the same for q2,q3, so that q2,q3 $\neq$ 11. The final possible combinations of the qubits q1,q2,q3 should then be:
000
001
010
110
And they shouldn't be:
011
100
101
111
If this is possible then couldn't I solve 3sat in polynomial time with a quantum computer? Couldn't I just remove the possibility of each clause being unsatisfied from a set of qbits representing the variables in the 3sat problem and then collapse the qbits to see if the final result is satisfiable?
Example of how I think a quantum computer would solve an instance of a 3sat problem in polynomial time:
Note: each computation should be on a set of 3 qbits at a time which should take $2^{3/2}$ time with Grover's algorithm, or O(1) in big O notation)
Variables = ${a,b,c,d,e}$
clauses = ${(\neg a \vee b \vee \neg c),(b \vee c \vee d),(\neg b \vee \neg c \vee d),(c \vee \neg d \vee e),(c \vee \neg d \vee \neg e)}$
We have qubits $q_a, q_b, q_c, q_d, q_e$
for $q_a, q_b, q_c$ we remove the possibility of 101 (since this would not satisfy the 1st clause)
for $q_b, q_c, q_d$ we remove the possibility of 000 and 110 (since those would not satisfy the 2nd and 3rd clause)
for $q_c, q_d, q_e$ we remove the possibility of 010 and 011 (since those would not satisfy the 4th and 5th clause)
Now the possible outputs of the qbits are:
00100
00101
00110
00111
01000
01001
01110
01111
11000
11001
11110
11111
So if I collapse the qbits I should remain with one of these combinations which satisfies the problem. If there is no possible solution, the qbits will just collapse into something meaningless which will not satisfy the problem.
If anyone can show me the flaw in my logic, please let me know, I highly doubt I solved 3sat. I'm just trying to learn.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Why I am getting this error when I try to open the Quantum Lab in the IBM Quantum experience?Body: I am using quantum labs in IBM Quantum Experience to my circuits. But from yesterday onwards (May-03-2021) this error message is being shown on my screen. Does anyone have any idea about this issue?
"
"['programming', 'cirq', 'qudit']"," Title: Why `cirq` needs `Qid` class instead of just `Qudit` class?Body: I am just wondering in what way cirq.Qid class generalizes qudits. From cirq.Qid documentation we read that it
Identifies a quantum object such as a qubit, qudit, resonator, etc.
I am not sure what this resonator means and if it is somehow connected to other qudits in the system.
Could anyone clarify it?
"
"['entanglement', 'mathematics', 'density-matrix', 'models']"," Title: Modeling building blocks for quantum computationBody: If I would design library for quantum computation I would naively consider a sequences of entangled qudits with unit length as a building blocks. I.e., unit length elements from $$\mathbb{C}^{d_{1}}\otimes \mathbb{C}^{d_{2}}\otimes\cdots\otimes\mathbb{C}^{d_k}$$
and denote this space by $S^{d_1d_2\dots d_k}$, because it is in fact a unit sphere.
Then any circuit would be just a unitary operator $U$ acting on $\mathbb{C}^{d_{1}}\otimes \mathbb{C}^{d_{2}}\otimes\cdots\otimes\mathbb{C}^{d_k}.$
If we would like to consider mixed states then that would be taking an arbitrary probability measure $P$ on $S^{d_1d_2\dots d_k}.$ It would be convenient because the probabilities on the output of $U$ would be modeled by pushforward measure $U_*(P)$, i.e. $P\circ U^{-1}.$ Even more generally if we would have an arbitrary measurable function $f:S^{d_1d_2\dots d_k}\to\Omega$ then the previous would still hold, thus we can define quantum measurement in this manner as well (and any quantum operation as well).
If we have any quantum hardware then the question boils down whether we can set up any pure state and mixed states and whether an abstract unitary operation/function $(U/f)$ have a realization in hardware. To test if a hardware works we just gather statistics.
Does the formalism that I describe constitutes of all possible operations that quantum computer can do? If so, is there any quantum computation library which is based on the formalism that I sketched above?
"
"['density-matrix', 'teleportation']"," Title: Quantum teleportation of a mixed state through a pure state?Body: Let's assume we have a register of qubits present in a mixed state
$$\rho = \sum_i^n p_i|\psi_i\rangle \langle \psi_i|$$
and we want to teleport $\rho$ through a random pure state $|\phi\rangle$. What would be the result of this teleportation?
Additionally, what would happen if $|\phi\rangle$ is one of the pure states $|\psi_i\rangle$, $\rho$ is composed of?
I do struggle a little with the density matrix formalism of QC, therefore, I could use some help here.
"
"['programming', 'qiskit', 'ibm-q-experience', 'simulation', 'qasm']"," Title: Why does running my circuit on Quantum Hardware produce such unexpected results?Body: I am using Jupyter Notebook with Qiskit.
I have created a program that can add two 3-bit numbers together. When I simulate this program on a qasm_simulator it works as expected and I can add any two 3-bit numbers together such as:
$011 + 110 = 1000$
However, when I try to get the result on real quantum hardware (IBMQ) it gets very unexpected results as seen below.
I know there will obviously be noise when using the quantum hardware but the results aren't even close to what they should be, does anyone know why?
My code:
%matplotlib inline
# Importing standard Qiskit libraries
from qiskit import QuantumRegister
from qiskit import ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from qiskit.tools.monitor import job_monitor
from qiskit.providers.ibmq import least_busy
# Loading IBM Q account(s)
provider = IBMQ.load_account()
## Create COUT sub-routine
q0 = QuantumRegister(1) # First number
q1 = QuantumRegister(1) # Second number, then sum
q2 = QuantumRegister(1) # Carry bit i
q3 = QuantumRegister(1) # Carry bits i+1
# Build a COUT sub-circuit
COUT_qr = QuantumRegister(4)
COUT = QuantumCircuit(q0,q1,q2,q3,name='COUT')
COUT.ccx(q1[0],q2[0],q3[0])
COUT.cx(q1[0],q2[0])
COUT.ccx(q0[0],q2[0],q3[0])
# convert to a gate
COUT_inst = COUT.to_instruction()
## reverse COUT sub-routine
q0 = QuantumRegister(1) # First number
q1 = QuantumRegister(1) # Second number, then sum
q2 = QuantumRegister(1) # Carry bit i
q3 = QuantumRegister(1) # Carry bits i+1
# Build a COUT sub-circuit
reverseCOUT = QuantumCircuit(q0,q1,q2,q3,name='reverseCOUT')
reverseCOUT.ccx(q0[0],q2[0],q3[0])
reverseCOUT.cx(q1[0],q2[0])
reverseCOUT.ccx(q1[0],q2[0],q3[0])
# convert to a gate
reverseCOUT_inst = reverseCOUT.to_instruction()
## Create SUM sub-routine
q0 = QuantumRegister(1) # First number
q1 = QuantumRegister(1) # Second number, then sum
q2 = QuantumRegister(1) # Carry bit i
# Build a COUT sub-circuit
SUM = QuantumCircuit(q0,q1,q2,name='SUM')
SUM.cx(q0[0],q2[0])
SUM.cx(q1[0],q2[0])
# convert to a gate
SUM_inst = SUM.to_instruction()
# n is the length of the qubits you are adding together
n = 3
a = QuantumRegister(n,'a') # First number
b = QuantumRegister(n+1,'b') # Second number, then sum
c = QuantumRegister(n,'c') # Carry bits
cl = ClassicalRegister(n+1) # Classical output
# Combining all of them into one quantum circuit
qc = QuantumCircuit(a, b, c, cl)
# initialise numbers:
qc.x(0)
qc.x(1)
#qc.x(2)
qc.x(3)
#qc.x(4)
qc.x(5)
## Create the circuit to add two 3-bit numbers
# COUT
qc.append(COUT,[c[0],a[0],b[0],c[1]])
qc.barrier()
# COUT
qc.append(COUT,[c[1],a[1],b[1],c[2]])
qc.barrier()
# COUT
qc.append(COUT,[c[2],a[2],b[2],b[3]])
qc.barrier()
qc.cx(c[2],b[2])
qc.barrier()
# reverse COUT
qc.append(reverseCOUT,[c[1],a[1],b[1],c[2]])
qc.barrier()
# SUM
qc.append(SUM,[c[1],a[1],b[1]])
qc.barrier()
# reverse COUT
qc.append(reverseCOUT,[c[0],a[0],b[0],c[1]])
qc.barrier()
# SUM
qc.append(SUM,[c[0],a[0],b[0]])
qc.barrier()
# Measure qubits and store results in classical register cl
for i in range(3+1):
qc.measure(b[i], cl[i])
# Run the experimient 1024 times and get stats
counts = execute(qc,Aer.get_backend('qasm_simulator')).result().get_counts()
plot_histogram(counts)
# Run on Quantum Hardware
provider = IBMQ.get_provider(hub='ibm-q')
backend = least_busy(provider.backends(filters=lambda x: x.configuration().n_qubits >= 10
and not x.configuration().simulator
and x.status().operational==True))
print("least busy backend: ", backend)
# Run it
shots = 2048
transpiled_qc = transpile(qc, backend, optimization_level=3)
qobj = assemble(transpiled_qc, shots=shots)
job = backend.run(qobj)
job_monitor(job)
# Plot results
counts = job.result().get_counts()
plot_histogram(counts)
"
"['complexity-theory', 'quantum-circuit', 'bernstein-vazirani-algorithm']"," Title: Worst Case Asymptotic Complexity of Berstein-VaziraniBody: How would one determine the worst-case asymptotic complexity ($\theta$) of a Bernstein-Vazirani circuit encoding the secret 1111?
"
"['measurement', 'quantum-operation', 'povm']"," Title: What are examples of extremal non-projective POVMs?Body: Fix some finite-dimensional space $\mathcal X$. Define a POVM as a collection of positive operators summing to the identity: $\mu\equiv \{\mu(a):a\in\Sigma\}\subset{\rm Pos}(\mathcal X)$ such that $\sum_{a\in\Sigma}\mu(a)=I_{\mathcal X}$, where $\Sigma$ denotes some finite register.
A POVM $\mu$ is said to be extremal if it cannot be written as a (nontrivial) convex combination of other POVMs.
Moreover, we say that a POVM is projective if each $\mu(a)$ is a (not necessarily unit trace) projection.
As discussed in Watrous' book, one can prove that any projective POVM is extremal.
Does the implication work in the other direction as well? If not, what are examples of extremal non-projective POVMs?
(Impossible for binary-outcome POVMs)
At least in the case of two-element POVMs, this doesn't seem to be possible: if $\mu(1)+\mu(2)=I$, then they are mutually (unitarily) diagonalisable. In an appropriate choice of basis, we can write
$$\mu(1)= \operatorname{diag}(s_1,...,s_n),
\qquad \mu(2)=\operatorname{diag}(1-s_1,...,1-s_n),$$
for some $s_i\in[0,1]$. Such a POVM is projective iff $s_i\in\{0,1\}$ for all $i=1,...,n$.
Suppose that the POVM is not projective, and thus there is some $s_i\in(0,1)$. Let us assume without loss of generality that $s_1\in(0,1)$.
Define the Hermitian operators
$$\theta(1)\equiv \operatorname{diag}(\epsilon,0,...,0),
\qquad
\theta(2)\equiv \operatorname{diag}(-\epsilon,0,...,0),$$
for some $\epsilon< \min(s_1,1-s_1)$.
Then $\mu\pm\theta$ are again two POVMs, and
$$\mu=\frac{1}{2}((\mu+\theta)+(\mu-\theta)),$$
and thus $\mu$ is not extremal.
However, this argument relies on the POVM elements being mutually diagonalisable, which is only the case for two-outcome POVMs.
"
"['resource-request', 'non-locality', 'games']"," Title: Who first studied nonlocal games with probabilistic predicate?Body: For some background, a nonlocal game consists of questions $x,y\in X,Y$ and answers $a,b \in A,B$; the pair of questions $x,y$ is asked with probability $\mu(x,y)$, and a referee accepts the pair of answers $a,b$ for the pair of questions $x,y$ with probability $V(a,b,x,y)$. This function $V:A \times B \times X \times Y \to [0,1]$ is the predicate of the nonlocal game. The case I just defined is the most general one, of a probabilistic predicate. Usually, though, papers deal with only with the case of deterministic predicates, where $V(a,b,x,y)$ is always either $0$ or $1$, so the referee simply accepts of rejects a given answer pair for a given question pair.
What I want to know is who first studied nonlocal games with probabilistic predicate. Cleve et al., who pretty much started the are, only defines games with deterministic predicate. The earliest reference I know that talks about games with probabilistic predicate is Buhrman et al.. It doesn't seem to be the first one, though, they talk as if the concept is already known.
"
"['algorithm', 'circuit-construction', 'entanglement']"," Title: How do you build a circuit to make an equal superposition of $n$ outcomes?Body: Suppose we start with $|00...0\rangle$.
We want to build an equal superposition over $|0\rangle + ... + |n-1\rangle$.
When $n=2^m$ for some $m$, I know I can do this using $H^{\otimes m}$.
What is the general circuit for this (i.e. in case $n$ is not power of 2)?
"
"['quantum-state', 'density-matrix', 'fidelity', 'trace-distance']"," Title: How to find the distance between a given $\rho$ and the nearest pure state(s)?Body: I have a $d$-dimensional state $\rho$. Is there any way to find the (possibly not unique) trace distance to the nearest pure state:
$$
\min_{|\psi\rangle} \,\,\lVert \rho - |\psi\rangle\langle \psi| \rVert_1
$$
where $\lVert A\rVert_1 = \mathrm{tr}\,\sqrt{A^\dagger A}$. I am not concerned with actually identifying $|\psi\rangle$. An answer that finds the maximum fidelity with a pure state is equally good for my purposes.
For instance, with $d=2$ we can use the Bloch sphere picture to solve this problem: if we represent $\rho$ and $|\psi\rangle \langle \psi|$ as
\begin{align}
\rho &= \frac{I + \vec{r}\cdot \vec{\sigma}}{2}\\
|\psi\rangle \langle \psi| &= \frac{I + \vec{s}\cdot \vec{\sigma}}{2} \quad, \quad \lVert \vec{s}\rVert=1
\end{align}
where $\vec{\sigma} = (\sigma_1, \sigma_2, \sigma_3)$ is the vector of Pauli operators, then the closest point $\vec{s}$ on the surface of the sphere (pure state) to a point internal to the sphere (mixed state) will lie along the ray formed by $(0,0,0)$ and $\vec{r}$, so the desired pure state is just
$$
\vec{s}= \frac{1}{\lVert \vec{r} \rVert} \vec{r}
$$
and the corresponding distance is $d(\rho, |\psi\rangle\langle\psi|) = 1 - \lVert \vec{r} \rVert$. However I don't really know how to extend this kind of approach for $d>2$ because I can't really wrap my head around the geometry of higher dimensional state spaces.
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Drawing the circuit in Qiskit - how to set same style as in Composer?Body: A quantum circuit can be visualized in Qiskit with circuit.draw. A drawing style can be set with parameter output which can have values mpl, text or latex (e.g circuit.draw(output='mpl')).
I am wondering if there is a way to use the same symbols and colors as in IBM Quantum composer since none of the above allow me to do so.
"
['fidelity']," Title: Given $\rho,\sigma$, bound $\min F(\bar\rho,\sigma)$ over $\bar\rho$ such that $F(\bar\rho,\rho)\ge1-\epsilon$Body: Let $\rho, \sigma$ be states such that
$$F(\rho,\sigma) = \delta >0,$$
where $F(\rho,\sigma) = \|\sqrt{\rho}\sqrt{\sigma}\|_1$. Now consider all possible states $\bar{\rho}$ such that $F(\bar{\rho},\rho) \geq 1 - \varepsilon$ for $0<\varepsilon<\delta$. Can one find an upper bound for
$$\min\limits_{\bar{\rho}}F(\bar{\rho},\sigma)$$
Obviously, $\delta$ is the trivial upper bound found by choosing $\bar{\rho} = \rho$ but it's not clear if one can always do better.
"
"['many-body-systems', 'xxz-model', 'quantum-phase-transition']"," Title: How to calculate $\langle\sigma_i^z\rangle$ with the method of symmetry in Heisenberg XXZ model?Body: The Hamiltonian of Heisenberg's XXY model is given by:
$$
H=\sum_{j=1}^{N}\left[S_{j}^{x} S_{j+1}^{x}+S_{j}^{y} S_{j+1}^{y}+\Delta S_{j}^{z} S_{j+1}^{z}\right]
,$$
where $S_{j}^{u}=\sigma_{j}^{u} / 2(u=x, y, z), \sigma_{j}^{u}$ are the Pauli spin- $\frac{1}{2}$
operators on site $j, \Delta$ is the anisotropy parameter, and $\sigma_{j+N}^{u}=\sigma_{j}^{u} .$
The Hamiltonian has two symmetries: (i) a discrete parity $\mathbb{Z}_{2}$ symmetry over the plane $x y: \sigma^{z} \rightarrow-\sigma^{z}$, and (ii) a continuous U1 symmetry that rotates the spins in the $x z$ plane by any angle $\theta$. But why does the $\mathbb{Z}_{2}$ symmetry implies that $\left\langle\sigma_{i}^{z}\right\rangle=0$ and $\left\langle\sigma_{i}^{x} \sigma_{j}^{z}\right\rangle=\left\langle\sigma_{i}^{y} \sigma_{j}^{z}\right\rangle=0$? This was described in this paper, while I cannot see how can I only use the symmetry without knowing the specific form of the eigenvector to get such a result.
"
"['programming', 'ibm-q-experience']"," Title: Is there a way to run ""in the background"" code sent to the IBM backends?Body: I use different qiskit backends to run my code. Since the maximum number of shots is $2^{13}$, sometimes I need to send the same code several times with a "different ticket". I am wondering if there is an equivalent way to run in the background, similar to the command nohup, to run qiskit code so that it runs all the instances one would like (or waiting in the queue as they are sent!)
"
"['programming', 'qiskit', 'ibm-q-experience', 'ibm']"," Title: Is there any way to obtain the number of qubits of a given backend in Qiskit?Body: I'm testing out a program in different IBMQ mock backends, and I want the program to use the maximum number of qubits in each case. Is there any function/method to extract the number of qubits of a given backend, so that I don't have to manually look it up every time?
Extra: Is there any way to automate the process of selecting each of these mock backends? My plan is to create an array
fake_servers = [FakeAlmaden(), FakeAthens(), FakeBelem(), FakeBoeblingen()]
etc, but if there's a more straightforward way, I'd like to know about it...
"
"['quantum-gate', 'matrix-representation', 'quantum-circuit']"," Title: Method to derive Matrix description of a circuitBody: This question is about finding a matrix description of a specific circuit. I am learning quantum computing through edX's Quantum Information Science lecture series. The question below is the one I am stuck on
Could someone please explain a systematic way to go about finding the matrix representation of a 2-qubit circuit (so that I can apply it to this)
"
"['entanglement', 'correlations']"," Title: What is the relationship between entanglement and quantum correlation?Body: What is the relationship between entanglement and quantum correlation? Are they synonym?
Sometimes, these two words look like synonym; people use one word to explain another,
These states are not a simple tensor product of the states of each qubit but rather a superposition that describes quantum correlations (entanglement) between the qubits.
On the other hand, it seemed we need to distinguish these two words,
If you read a randomly selected nontechnical account of quantum entanglement, you will likely be told that measuring a particle in one place can instantly change another particle elsewhere, no matter the distance between the two. Surprisingly, this is something that Paul Halpern never claims in his new book, Synchronicity. ...to connote an “acausal connecting principle.” Quantum correlations, in Halpern’s view, are a special case of synchronicity.
Excerpted from Quantum correlations at a distance needn’t necessarily be “spooky”
1st paragrah
Moreover, is the following expression correct? (http://memoirs.is.kochi-u.ac.jp/Vol26/MemoirsF26-6.pdf 2.3.2, I translated it into English)
The quantum correlation MUST exist in the entanglement state; however, even if there is a quantum correlation, it cannot be called entanglement. For example, when the relationship between qubits A and B is $|\psi\rangle=\frac{1}{\sqrt{2}}(|0_A0_B\rangle+|1_A1_B\rangle)$, which cannot be separated by the tensor product. In other words, it is an entanglement state, and there exists a quantum correlation.
After measuring, this state changes to $|0_A0_B\rangle$ or $|1_A1_B\rangle$. There is a quantum correlation in $|0_A0_B\rangle$ or $|1_A1_B\rangle$ state, but it is no longer an entanglement state.
"
"['complexity-theory', 'shors-algorithm', 'quantum-fourier-transform']"," Title: What is the quantum query complexity of the period finding routine of Shor's algorithm?Body: It seems like it should be a function of N - O(log N), to minimise probability of getting a multiple of the period. However, Prof Preskill's lec notes mention:
Thus we solve Period Finding if the sampled values of k have no common factor, which is true with high probability after a constant number of trials. Hence the quantum query complexity of Period Finding is constant (even better than for Simon's problem).
What am I missing?
"
"['hhl-algorithm', 'speedup', 'linear-algebra']"," Title: HHL algorithm for linear systems with a real matrix and a real right sideBody: HHL algorithm can be used for solving linear system $A|x\rangle=|b\rangle$. If we put $|b\rangle$ (to be precise its normalized version) into the algorithm and measuring ancilla to be $|1\rangle$ we are left with the state
$$
\sum_{i=1}^n \beta_i\frac{C}{\lambda_i}|x_i\rangle,
$$
where $|x_i\rangle$ is ith eigenvector of matrix $A$, $\lambda_i$ is respecitve eigenvalue and $\beta_i = \langle b|x_i\rangle$ is ith coordinate of $|b\rangle$ in basis composed of eigenvectors of $A$.
It is known that HHL brings exponential speed-up, however, to get whole state $|x\rangle$ we need to do a tomography which cancels the speed-up completely.
However, let us assume that $A$ is real matrix and $|b\rangle$ is real vector. Since HHL assumes that $A$ is Hermitian, $\lambda_i$ are real. Eigenvalues satisfy relation $A|x_i\rangle = \lambda_i|x_i\rangle$ and since they are real and $A$ is real, it follows that we can find $|x_i\rangle$ to be real (despite that fact that they are orthogonal basis of $\mathbb{C}^n$). As a result, coeficients $\beta_i$ are also real as they are inner product of two real vectors.
In the end we are left with real probability amplitudes $\beta_i\frac{C}{\lambda_i}$ in the state above.
This all means that in case of real matrix and real right side, we can simply measure probabilities of possible outcomes in an output register and do not have to employ tomography. Hence, for real systems $Ax=b$, we are able to get whole solution and at the same time the exponential speed-up is preserved.
Is my reasoning right or am I missing something?
"
"['quantum-gate', 'arithmetic']"," Title: Formulate Controlled-Not as mapping (including modulo-2 addition)Body: We often see that the controlled-not gate is written as
$CNOT |x y \rangle = |x\rangle |x \oplus y\rangle$.
Now, would it be possible to further expand this to get a general equation?
$$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes \left((\alpha_0 |0\rangle + \beta_0 |1\rangle) \oplus (\alpha_1 |0\rangle + \beta_1 |1\rangle) \right) \ ,$$
where $\oplus$ is XOR or modulo-2 addition.
However, expanding this to
$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes \left((\alpha_0 |0\rangle + \beta_0 |1\rangle) + (\alpha_1 |0\rangle + \beta_1 |1\rangle) \!\! \mod 2\right)$
does not seem right. Would this operator distribute? Does it behave the same way as in 'standard' algebra, i.e.
$$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes ((\alpha_0 + \alpha_1\!\!\!\mod 2)|0\rangle) + (\beta_0 + \beta_1 \!\!\! \mod 2) |1\rangle) \ ?$$
"
"['programming', 'qiskit', 'openpulse']"," Title: Pulse waveform for 2-qubit circuitBody: I'm trying to reproduce the Bell-state pulse display as shown in this tutorial.
The code is very short:
bell = QuantumCircuit(2, 2)
bell.h(0)
bell.cx(0,1)
qc = transpile(bell,backend)
sched_circ = schedule(qc,backend)
sched_circ.draw()
but if I use the backend ibmq_armonk there are not enough qubits and, for ibmq_qasm_simulator, Qiskit-pulse is not supported.
Is there a way to get it working? I do not need to run the waveforms on a device - I just want to analyze them.
P.S. If anyone has a compact IO protocol writing/reading scheduler pulses for multi-qubit Qiskit circuits in HD5 format I'd be interested to collaborate.
Follow up:
After I upgraded my qiskit to ver 0.25.3 the backend=FakeOpenPulse2Q() works exactly as suggested below.
Thanks for the help.
Jan
"
"['quantum-process-tomography', 'blind-quantum-computing']"," Title: Process Tomography for Blind Quantum ComputationBody: Process Tomography can identify the quantum channel, while Blind Quantum Computation strives to hide the inputs using quantum gates.
Given the user executes the same blind circuit multiple times (of the order of times required to do process tomography), why can't the server do process tomography to break the blindness?
"
"['qiskit', 'ibm-q-experience', 'compiling']"," Title: Qiskit logical to physical qubit mappingBody: I want to run a simulation using qasm with a realistic noise model from a backend, specifying a coupling_map as well as an initial_layout. I do that via a QuantumInstance which in turn is passed to an algorithm. Now, two questions regarding that qubit layout:
- I know that the transpiler may change the mapping of logical to physical qubits. Furthermore, I pass a circuit to the algorithm as an argument and the algorithm then adds an ancilla qubit to the circuit.
Is there a way for me to verify the final logical to physical qubit mapping after transpiling?
- Could that automatic adding of an ancilla cause problems when using
QuantumInstance with a specific initial_layout?
"
"['programming', 'qiskit', 'quantum-gate', 'unitarity', 'linear-algebra']"," Title: How do you compute the compiled unitary of a quantum circuit comprised of different $n$-input gates?Body: Given a quantum circuit consisting of two qubits, how is the compiled unitary of the circuit computed when we have different input type gates? (X-gate, H-gate are single-input gates, CNOT is a 2-input gate).
qc = QuantumCircuit(2)
qc.x(1)
qc.h(0)
qc.cnot(0,1)
usim = Aer.get_backend('unitary_simulator')
qobj = assemble(qc)
unitary = usim.run(qobj).result().get_unitary()
array_to_latex(unitary, pretext="\\text{Circuit = } ")
Section 2.2 of Qiskit shows how the simultaneous operations of two single-input gates are represented by computing the tensor product of the two gates, and that when we apply a gate to one bit at a time, we represent the unitary as the tensor product with the identity matrix. For the circuit above, how do we compile the circuit's unitary for the $4\times 4$ CNOT matrix,
$$
\text{CNOT} = \begin{pmatrix}
1 & 0 & 0 & 0\\
0 & 0 & 0 & 1\\
0 & 0 & 1 & 0\\
0 & 1 & 0 & 0\\
\end{pmatrix},
$$
and the $2\times 2$ $X$ and $H$ matrices?
"
"['programming', 'qiskit', 'ibm-q-experience', 'transpile']"," Title: Qiskit: Transpilation and the CircuitSamplerBody: I am using Qiskit's opflow and its CircuitSampler to evaluate matrix elements / expectation values. Now, going beyond statevector and simple qasm simulations, I want to introduce noise of a real device, specify qubit-connectivity (coupling_map), and choose which physical qubits the logical qubits of my circuit are mapped to (initial_layout). This is all specified in a QuantumInstance which is then passed to the CircuitSampler,
result = CircuitSampler(QuantumInstance).convert(operator).eval()
How do all these specifications for transpilation translate through the CircuitSampler and into the final output? I.e., does CircuitSampler transpile the circuits inside, e.g., ListOp before sampling? And how can I check which physical qubits the logical ones were mapped to during transpilation?
I am confused by this sentence in the documentation:
The CircuitSampler aggressively caches transpiled circuits to handle re-parameterization of the same circuit efficiently.
What does this mean?
"
"['quantum-gate', 'circuit-construction']"," Title: How to make a circuit for the CNOT using $H$ and $CZ$ gates?Body: How can we draw a circuit that is based on the gates $H, CZ$ that implements $CNOT$.
I know that the $H$ gate is like that:
And also the $CZ$ gate is:
But I'm not sure how to draw this with the implementation of $CNOT$.
"
['quantum-gate']," Title: constructing a CNOT gate using a CZ and H gatesBody: How can I construct a CNOT gate using a CZ and H gates?
And I also need to prove it using these identities:
\begin{equation}
H = (1/\sqrt{2})(X+Z)\\
XZ = -ZX\\
X^2 = Z^2 = H^2 = 1\\
HXH = Z\\
HZH = X\\
\end{equation}
Thank you!
"
"['quantum-gate', 'ibm-q-experience', 'circuit-construction']"," Title: Is RYY gate not available in IBM Quantum Composer?Body:
If so, why? How to create the RYY-gate in the composer?
"
"['mathematics', 'quantum-fisher-information', 'quantum-metrology']"," Title: Unit vanishes in the Quantum Cramer-Rao Bound?Body: The Quantum Cramer-Rao Bound states that the precision we can achieve is bounded below by:
$$(\Delta \theta)^2\ge\frac{1}{mF_Q[\varrho,H]},$$
where $m$ is the number of independent repetitions, and $F_{\mathrm{Q}}[\varrho, H]$ is the quantum Fisher information.
The question is, the left side of the bound is the variance of the parameter $\theta$, so it might have a unit while the right side is Quantum Fisher Information which does not possess a unit.
"
"['programming', 'qiskit', 'openpulse']"," Title: configuration of FakeOpenPulse2QBody: Can you help me to configure the FakeOpenPulse2Q() to produce more realistic pulses?
The code below instantiates 2 circuits and generates the waveforms for each.
The top waveform frame is 1-qubit circuits with a single U3 gate using backend='ibmq_armonk' works fine.
The bottom waveform frame is generated by FakeOpenPulse2Q() for a 2-qubit circuit using the same U3 gate on qubit 0 and the waveforms have the right structures but their shapes are simplified.
I'm guessing FakeOpenPulse2Q requires a definition of calibrated X90 and CNOT gates for each qubit. Can you help me to
a) transfer the X90 calibration of qubit 0 from ibmq_armonk to FakeOpenPulse2Q()
b) use the same X90 calibration for qubit 1, except shift the drive & read frequencies by 300 and 400 MHz, respectively
c) define a realistic CNOT gate in FakeOpenPulse2Q
Thanks
Jan
import matplotlib.pyplot as plt
from qiskit import IBMQ
from qiskit import QuantumCircuit, transpile,schedule
from qiskit.test.mock import FakeOpenPulse2Q
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')
backend1 = provider.get_backend('ibmq_armonk')
backend2 = FakeOpenPulse2Q()
circ1 = QuantumCircuit(1,name='1Qcirc')
circ1.u(0.4,0.6,0.9,0)
qc1 = transpile(circ1, basis_gates=['u1','u2','u3'], optimization_level=1)
circ2 = QuantumCircuit(2,name='2Qcirc')
circ2.u(0.4,0.6,0.9,0)
circ2.sx(1)
qc2 = transpile(circ2, basis_gates=['u1','u2','u3'], optimization_level=1)
sched1=schedule(qc1,backend1)
sched2=schedule(qc2,backend2)
fig=plt.figure(1,facecolor='white', figsize=(14, 8))
ax1=plt.subplot2grid((3,1), (0,0), rowspan=1)
ax2=plt.subplot2grid((3,1), (1,0), rowspan=2)
sched1.draw('IQXDebugging', axis = ax1, show_waveform_info = True)
sched2.draw('IQXDebugging', axis = ax2, show_waveform_info = True)
print('circuit1:'); print(circ1)
print('circuit2:'); print(circ2)
plt.tight_layout()
plt.show()
"
"['physical-realization', 'physical-qubit', 'ibm', 'google-sycamore']"," Title: Does a quantum computer exist today?Body: I agree that this may not be an easy question to answer.
But lately, I increasingly come across the fact that many news materials and research papers in the field of quantum technologies say that at the moment there is no quantum computer in the world. Instead, they argue that there are only prototypes of a quantum computer.
So what do Google, IBM, and other large companies produce?
Are these really just prototypes of a quantum computer?
What about D-Wave computers (like a 2000 qubit quantum computer)?
What characteristics distinguish a quantum computer from a prototype quantum computer?
And why then do some talk about a quantum computer, while others talk about a prototype of a quantum computer?
"
"['programming', 'd-wave', 'annealing', 'quantum-computing-for-finance']"," Title: How to decide bias in Hamiltonian Ising model?Body: I am trying to code finance portfolio optimisation problem into a quantum annealer, using the Hamiltonian Ising model. I am using the dwave module
neal.sampler.SimulatedAnnealingSampler.sample_ising
I was wondering how one gets to decide what the bias is? I don't really get how that works. On the documentation of Dwave it says the following:
There also was this example code:
import neal
>>> sampler = neal.SimulatedAnnealingSampler()
h = {'a': 0.0, 'b': 0.0, 'c': 0.0}
J = {('a', 'b'): 1.0, ('b', 'c'): 1.0, ('a', 'c'): 1.0}
sampleset = sampler.sample_ising(h, J, num_reads=10)
print(sampleset.first.energy)
"
"['quantum-gate', 'circuit-construction']"," Title: Toffoli upside down - an equivalent circuitBody: It is known that an "upside-down" CNOT is equivalent to a "normal CNOT" surrounded by Hadamard gates as shown in this picture.
I am wondering whether there is a similar circuit equivalent to Toffoli gates controlled by qubits below the target qubit or with the target qubit in the middle as shown here.
The only way I was able to find so far is to take a decomposition of the Toffoli gate (e.g.here), redraw the circuit in order to have it upside down, and replace upside-down CNOTs with the construction above.
I am looking for a more elegant way similar to that of the CNOT.
"
"['quantum-state', 'machine-learning', 'tomography', 'quantum-process-tomography']"," Title: Quantum State Tomography from IQ plane dataBody: Background:
I am given to understand that the steps of Quantum State Tomography (QST) are as follows for a single qubit:
- The qubit is in the state $\psi=a_0|0\rangle+a_1|1\rangle$ with density matrix $\rho = |\psi\rangle\langle\psi|$.
- Decompose $\rho$ in terms of the Pauli basis:
$$
\rho = \frac{1}{2}\left( I_{2\times 2} + \sum_{A}\langle \sigma_A \rangle \sigma_A \right)
$$
where $A=x,y,z$ and $\sigma_A = (\sigma_x,\sigma_y,\sigma_z)$ the 3d vector of 2x2 Pauli matrices (generators of SU(2)).
- Then there are the "measurement equations":
$$
\begin{pmatrix}p_0\\p_1 \end{pmatrix} = \begin{pmatrix}\beta_I^{|0\rangle} & \beta_A^{|0\rangle}\\ \beta_I^{|1\rangle} & \beta_A^{|1\rangle} \end{pmatrix}\begin{pmatrix} \langle I_{2\times 2} \rangle\ \\ \langle \sigma_A \rangle \end{pmatrix}
$$
where the parameters $\beta$ tell us about the bias of our system and allow us to convert probabilities of the system being in the $|0\rangle$ or $|1\rangle$ state to (unphysical) measurement expectations.
I took this from this source (click).
Question:
I understand steps 1 and 2.
- I am very unclear as to what step 3 entails. That is, how one obtains any of the info in the equation of step 3? I understand that
we want to somehow use the matrix of coefficients $\beta$ together
with the probabilities $p_0,p_1$ in order to estimate the rightmost
vector with the expectations?
- In order to do so, if this is the case, one needs the $p_0,p_1$
values. They are read from the IQ plane (if transmon or xmon are
used). But what about the $\beta$ matrix? Where do its values come in
order to obtain what we really want, the expectation values of the
measurement operators?
- Finally, having these expectation values, how do we proceed to
estimate the state? I.e., to do tomography?
"
"['programming', 'qiskit']"," Title: Inverse of Statevector.from_label in QiskitBody: In Qiskit I can construct a computational basis statevector in the following fashion
from qiskit.quantum_info import Statevector
sv = Statevector.from_label('10')
print(sv.data)
which gives [0.+0.j 0.+0.j 1.+0.j 0.+0.j] . If I have the data for a statevector in the computation basis, is there a built-in way to return a corresponding string? For [0.+0.j 0.+0.j 1.+0.j 0.+0.j] I should get back '10'. More generally, if the state is not in the computational basis it would be nice to get a linear combination of the basis states.
"
"['quantum-gate', 'quantum-circuit']"," Title: How does $|00\rangle$ evolve through an Hadamard and a CNOT gate?Body: If we have this given circuit:
![]()
So the output for $|0\rangle$ will be: $\frac{1}{\sqrt{2}}\left(|00\rangle + |11\rangle\right)$
And we have this given circuit:
![]()
What will be the output for $|00\rangle$ and why?
"
"['quantum-gate', 'pauli-gates', 'superposition']"," Title: Gate Cost to Transform Superposition of Hamming weight 1 states to superposition of arbitrary basis states?Body: Say you have something like a general-coefficient $n$-qubit W-state, i.e.,
$$
|\psi\rangle\equiv\sum_{j=1}^n a_j X_{j}|0\rangle^{\otimes n} \ ,
$$
where $a_j$ are normalized complex coefficients. Using $X$, $CNOT$, $SWAP$, Toffoli gates and the like, how many gates do we need to change the superposition basis from the set of $n$ Hamming weight $1$ states to an arbitrary set of $n$ length-$n$ bitstrings?
I have a feeling it's going to be exponentially large but I'm not sure.
"
"['simulation', 'machine-learning', 'quantum-enhanced-machine-learning', 'clifford-group']"," Title: When and how do we use basis embedding?Body: It is suggested in various sources that a possible approach to representing classical data as a quantum state is simply to take the binary sequence $x$ and turn it to $|x\rangle$ (i.e., "basis embedding"). However, all of the implementations of quantum machine learning algorithms that I found use more complicated feature maps. Furthermore, according to the popular SVM paper of Havlicek et al, "To obtain an advantage over classical approaches we need to implement a map based on circuits that are hard to simulate classically".
Therefore, my questions are:
- Since the map that turns $|0...0\rangle$ to $|x\rangle$ (for $x\in \{0,1\}^n$) can be implemented by a Clifford circuit, which can be efficiently simulated classically, does the above quote imply that no quantum advantage will be obtained by using it as our feature map? If not, then where's my mistake?
- Are there any examples in the literature of quantum machine learning algorithms that actually use basis embeddings?
"
"['programming', 'stim']"," Title: Performing a generic single-qubit Pauli error channel in stimBody: I have a Pauli channel with disjoint probabilities $P_I$, $P_X$, $P_Y$, $P_Z$ (meaning $P_I + P_X + P_Y + P_Z = 1$) corresponding to Pauli errors I, X, Y, Z. Is there some way apply this Pauli channel in Stim?
"
"['programming', 'qiskit']"," Title: Is there a way I can reduce the code for generating simple circuits with the same structure?Body: here's the code I'm using to generate 3 quantum circuits with the same structure (They're only differed by the first U3 gate on the qubit):
quancs = QuantumCircuit(1) # Circ 1
quancs.u3(gamma,beta,delta,0)
quancs1 = QuantumCircuit(1) # Circ 2
quancs1.u3(2,3,2,0)
quancs1.u3(gamma,beta,delta,0)
quancs2 = QuantumCircuit(1) # Circuit 3.
quancs2.u3(-2.5,2,-2,0)
quancs2.u3(gamma,beta,delta,0)
results = execute(quancs, simulator).result()
results1 = execute(quancs1, simulator).result()
results2 = execute(quancs2, simulator).result()
I treated the circuits separately to obtain the results. I'm wondering is there a way I can simplify/shorten this code? Thanks for the help!
"
"['algorithm', 'quantum-circuit', 'swap-test']"," Title: In a Swap Test why is the control qubit influenced and aren't the target qubits altered?Body: I am in a study group learning about quantum computing using O'Reilly - Programming Quantum Computing. I'm a developer, not a physicist. :) I feel like my question is rudimentary but I can't seem to find an answer here or anywhere else.
I'm confused on the Swap test; why it works and why doesn't it affect the qubits being swapped. Not the physics behind why the measurements diverge or approach |1>, but rather why the condition qubit of the cswap operation is altered at all.
I understand the cswap operation swaps two qubits based on a condition qubit. You might say the condition qubit has an influence on the swapped qubits.
However, a Swap Test shows that the condition qubit itself will be changed based on how closely the target qubits are equal. How do the swapped qubits have any influence back on the condition qubit? And furthermore, during the swap test aren't we potentially swapping the qubits? Should we be swapping them back so that our test doesn't actually change the state of the target qubits?
"
"['circuit-construction', 'unitarity']"," Title: Can any ""control-something unitary"" be written with control and target spaces flipped?Body: Consider a simple two-qubit gate such as the CNOT. The typical presentation of this gate is
$$\text{CNOT} = |0\rangle\!\langle0|\otimes I + |1\rangle\!\langle1|\otimes X,$$
with $X$ the Pauli $X$ gate. This gate can also be written reversing the role of control and target, as
$$\text{CNOT} = I\otimes |+\rangle\!\langle+| + Z\otimes |-\rangle\!\langle-|.$$
Is this sort of trick a general feature of unitary gates which have a "control-target structure" (that is, unitaries acting on a bipartite space which are block-diagonal in some basis)?
More precisely, consider a generic unitary $\mathcal U:\mathcal H_A\otimes\mathcal H_B\to\mathcal H_A\otimes\mathcal H_B$ which has the form
$$\mathcal U = \sum_i |u_i\rangle\!\langle u_i|\otimes U_i,$$
for some orthonormal set $\{|u_i\rangle\}_i\in\mathcal H_A$ and collection of unitaries $\{U_i\}_i$.
Is there always a set of orthonormal vectors $\{|v_j\rangle\}_j\subset\mathcal H_B$ and collection of unitaries $\{V_j\}_j$ such that
$$\mathcal U = \sum_j V_j\otimes |v_j\rangle\!\langle v_j|$$
also holds?
This question is closely related to General approach for switching control and target qubit, albeit here I'm focusing on a more general case.
"
"['quantum-gate', 'linear-algebra']"," Title: Quantum gates with respect to phase anglesBody: We can say that
$X (\cos \frac{\theta}{2} |0\rangle + e^{i \phi}\sin \frac{\theta}{2} |1\rangle) = \cos \frac{\pi-\theta}{2} |0\rangle + e^{-i \phi}\sin \frac{\pi-\theta}{2} |1\rangle$,
a fact that can be derived by multiplying the $X$ matrix and the state vector and using angle identities:
$X (\cos \frac{\theta}{2} |0\rangle + e^{i \phi}\sin \frac{\theta}{2} |1\rangle) = e^{i \phi}\sin \frac{\theta}{2} |0\rangle + \cos \frac{\theta}{2} |1\rangle = e^{i \phi}\cos \frac{\pi - \theta}{2} |0\rangle + \sin \frac{\pi - \theta}{2} |1\rangle = \cos \frac{\pi-\theta}{2} |0\rangle + e^{-i \phi}\sin \frac{\pi-\theta}{2} |1\rangle$
Is there a writeup somewhere or a standard way to derive this identity for other gates, i.e. $Y, Z, H, \sqrt{Y}$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to simplify a circuit with repeated same parts?Body: If I have a circuit with 3 qubits and repeated gates as follow:
circ = QuantumCircuit(3, 3)
for i in range(100):
# some gates, details is not important
circ.rx(0.1, 0)
circ.ry(0.1, 1)
circ.ccx(0,1,2)
Clearly the repeated gates will be transpiled (and uploaded to IBMQ via Internet) 100 times. How can I change the code so that the repeated part only need to be transpiled (and uploaded) one time?
"
"['algorithm', 'grovers-algorithm']"," Title: What is the point of Grover's algorithm, really?Body: This is a question desguised as a rant. There is a similar question here, What's the point of Grover's algorithm if we have to search the list of elements to build the oracle?, but the answers have not helped me much.
I have seen a few explanations of Grover's algorithm. I do not understand it, and the problem is not the mathematics. The story told by the sources is: given states $|x\rangle$ and $|\psi\rangle$, there is an operator $U$ such that you apply it so many times to $|\psi\rangle$ and the result is $|x\rangle$.
Surely the point of the algorithm is not to turn $|\psi\rangle$ into $|x\rangle$, is it?
If it is, then it should be called Grover's transformation, not Grover's search. And for that I have a much simpler algorithm: just apply the operator $\frac{|x\rangle\langle x|}{\langle x|\psi\rangle}$ (it requires a single run and works with 100% efficiency). Why is this not acceptable?
I have seen an analogy with phones. Suppose you want to find out who owns a particular phone number. Classically you must search the entire phone book (this analogy is getting out of touch with reality, but never mind that for the moment). Fine. So in the quantum setting I suppose you might have the state $|\psi\rangle$ which is your phone book, written in terms of energy eigenstates as $|\psi\rangle=\frac{1}{\sqrt{N}}\sum_i|\phi_i\rangle$, and you might ask "who is the state in there with energy $E_i$?", and the answer should be $\phi_i$.
But if I must know $|\phi_i\rangle$ in order to build the Grover operator $U$, then I see no point. Can I create $U$ without knowing $|\phi_i\rangle$ beforehand?
"
"['entanglement', 'models', 'terminology']"," Title: Where is entanglement present and absent in the one clean qubit model of computation?Body: Based on my limited and poor understanding, a quantum circuit in the "one clean qubit" model of quantum computation generally acts on a single pure (clean) qubit tensored with $n-1$ qubits in a maximally mixed state. The clean qubit can serve as a control to apply an arbitrary unitary $U$ to the maximally mixed qubits, and measuring this clean qubit in the $X$ or $Y$ basis enables characterizations of some properties of $U$ (such as its real and imaginary trace, which is likely classically difficult.)
I was inspired to consider the one clean qubit model of computation by a recent (2021) video of Yoganathan on her "Looking Glass Universe" channel, wherein she describes and summarizes the approach she and her colleagues took to answering an open problem on the power of such a model in the absence of entanglement. The headline is that the one clean qubit model without entanglement is classically tractable.
But as I begin to study their paper, it's not quite clear to me what's even meant by the one clean qubit model with and without entanglement.
What, in particular, is and is not entangled in the one clean qubit model?
The pure qubit would be entangled with mixed qubits after application of $U$, right? Or am I wrong, and even after the controlled application of $U$ the clean qubit need not be entangled with/is separable from the mixed qubits? If so, what is entangled in the simple circuit in the Wikipedia article?
EDIT: I am wrong! While nonetheless carrying in its amplitude some properties of $U$ (such as the real/imaginary trace), a (bi)partition between the clean qubit and the other qubits after application of $U$ has no entanglement, no matter what $U$ is. When one clean qubit is able to calculate the trace of $U$ efficiently, the the one clean qubit may have entanglement in other partitions wherein [the clean qubit $\otimes$ some other mixed qubits] is entangled with the remaining mixed qubits, but there is no entanglement in the "obvious" partition! This is what @DaftWullie has emphasized.
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'cryptography', 'bb84']"," Title: Show when $a_k$ and $b_k$ are correlated when measuring in different bases, in the BB84 protocolBody: I'm trying to answer the following question about the BB84 protocol from Nielsen and Chuang's Introduction to Quantum Information.
As I understand it, the string $b$ is determining whether we are measuring in the computational basis or the Hadamard basis. I decided to test the claim in the question with an example.
Let $\vert\phi\rangle = \alpha \vert 0 \rangle + \beta \vert 1\rangle$ and assume we are measuring in the $\{\vert - \rangle, \vert + \rangle\}$ basis. That means our measurement is
$(\vert - \rangle \langle - \vert + \vert + \rangle \langle + \vert)\vert \phi \rangle = \frac{\alpha}{\sqrt{2}}\vert 0 \rangle + \frac{\beta}{\sqrt{2}}\vert 1 \rangle$
To me this is clearly wrong. Not only does it suggest we can figure something out about the state which $\vert \phi \rangle$ was prepared in, but we don't even have that $\frac{1}{\sqrt{2}}(\alpha + \beta) = 1$. Could I have guidance as to what I am doing incorrectly, or pointers about how to go about this proof?
EDIT: Applying these projections yields
$$\frac{\alpha + \beta}{\sqrt{2}}\vert + \rangle + \frac{\alpha - \beta}{\sqrt{2}}\vert - \rangle$$
We can take probabilities like $|\langle + \vert \phi \rangle|^{2}$, and I am still unsure how to prove that they are uncorrelated.
EDIT2: I have a solution and will update it soon.
"
"['programming', 'qiskit', 'ibm-q-experience', 'qasm']"," Title: How to import circuit libraries into qiskitBody: Im trying to put the QFT circuit in my qiskit circuit but im having trouble:
import numpy as np
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, transpile, Aer, IBMQ
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *
from math import sqrt
from qiskit.quantum_info import DensityMatrix
from qiskit.circuit.library import QFT
# Loading your IBM Q account(s)
provider = IBMQ.load_account()
qc = QuantumCircuit(1,1)
init = [sqrt(3/4),-sqrt(1/4)]
qc.initialize(init,0)
qc.h(0)
qc.x(0)
qc.h(0)
qc.QFT(0)
display(qc.draw())
s0 = DensityMatrix(qc)
sim = Aer.get_backend('unitary_simulator')
job = transpile(qc,sim)
state = sim.run(job).result().get_unitary()
print(qc.qasm())
"
"['ibm-q-experience', 'error-correction', 'shors-algorithm', 'ibm']"," Title: Who is responsible for implementing quantum error correction?Body: There are various options for error correction. For example, the Shore code or a whole class of surface codes.
But I don't really understand at what level they should be implemented.
For example, I have any circuit that implements an algorithm that requires 3 qubits. A quantum computer has at least 27 qubits.
Therefore, I can use the Shore code to correct errors, because the 9-qubit Shore code corrects any errors.
To start correcting the errors, I need to allocate 3 logical qubits at the upper level (the level of creating the algorithm) and 27 physical qubits at the lower level.
Thus, after each operation (for example, after operation H) on one logical qubit, I have to insert an implementation of the Shore code. Do I understand correctly? But won't it create a lot more errors (because every statement has an error)?
"
"['programming', 'qiskit', 'algorithm', 'ibm-q-experience']"," Title: Time result for my algorithmBody: I've used the function result.time_taken to know the amount of time used to execute a task on the real chip, but I don't understand if the result is in seconds or in milliseconds, because if I run my circuit with 1 shot my result is 7.8, if I run my circuit with 1024 shots my result is 8.4. How is this possible? Does the time include only time to execute the algorithm, or other times (for instance the initialization of my input...)?
"
"['ibm-q-experience', 'ibm']"," Title: IBM quantum computer giving the wrong result?Body: This is the first time I am using the IBM quantum computer. I tried to run a circuit (see below the first picture) but the results I got don't match the theoretical results shown (see below the second picture). I am honestly not sure what to do or why this happens. I also tried to run different circuits but they seem to have to same problem so I am probably misinterpreting something. I also tried to use a different quantum processor but they give the same problem.
Thanks in advance.
"
"['hamiltonian-simulation', 'pauli-gates', 'linear-algebra']"," Title: Prove that any Hermitian Matrix is a real linear combination of Pauli operatorsBody: This is an important result in Quantum Computing because it means that the Hamiltonian of a Quantum System can be encoded as a sequence of real numbers and their corresponding Pauli Operator.
How do we prove this result?
(Note I am assuming that the Hermitian is of size $2^n \times 2^n$, and so by Pauli Operator I mean n-fold tensor products of the 2x2 Pauli Matrices)
"
"['qiskit', 'ibm-q-experience', 'vqe', 'optimization']"," Title: Qiskit Portfolio Optimization : Does the resulting matrix show the stock combination to select?Body: The IBM Qiskit Portfolio Optimization sample finally provides an array similar to [1,0,1,1] representing the 4 digits as the stocks. So does the 0 and 1 represent the corresponding stock and whether to invest it or not ?
Is there any possibility to get in a weighted form such as invest 10% in stock #1 and 30% in stock #2 and so on.
"
"['programming', 'quantum-gate', 'circuit-construction']"," Title: How do you build the modified Toffoli gate using only local unitary and CNOT operations?Body: How do you build a circuit for a modified Toffoli gate using only local unitary operations and CNOT operations? The two-qubit unitary operation is given by: $\text{diag}\{1, 1, 1, e^{i\phi}\}$.
"
['entanglement']," Title: Argue positivity of mean value of an entanglement witness matrix for all separable stateBody: Given $\
\hat{W}=\mathbf{1}_{A B}+\sigma_{x}^{A} \otimes \sigma_{x}^{B}-\sigma_{y}^{A} \otimes \sigma_{y}^{B}-\sigma_{z}^{A} \otimes \sigma_{z}^{B}
$
how can i show that for every separable state $\hat{\sigma}_{A B},\
\langle\hat{W}\rangle_{\rho} \equiv \operatorname{Tr}\left[\hat{W} \hat{\sigma}_{A B}\right]\geq 0$ ?
I have tried different things but the most promising seems to bee the following one. I know that if $\hat{\sigma}_{AB}^{T{A}}$ (partial transpose of $\hat{\sigma}_{AB}$ with respect to $A$
) is positive semi definite. Moreover I know that $\hat{W}_{AB}^{T{A}}$
is positive semi definite (I compute explicitly the matrix and its eigenvalues). My idea now was do to the following
\begin{equation} Tr[\hat{W}_{AB}\hat{\sigma}_{AB}] = Tr[\hat{W}_{AB}(\hat{\sigma}_{AB}^{T{A}})^{T{A}}] = Tr[\hat{W}_{AB}^{T{A}}\hat{\sigma}_{AB}^{T{A}}] = \ Tr[\sum_{k}\lambda_k{|\lambda}_k\rangle\langle{\lambda}_k|\hat{\sigma}_{AB}^{T{A}}] = \sum_{k}\lambda_k Tr[ \langle{\lambda}_k|\hat{\sigma}_{AB}^{T_{A}}|{\lambda}_k\rangle] \geq 0 \end{equation}
the problem here is that in the third inequality I use a technical lemma and i am not sure that I can apply it
"
"['programming', 'qiskit']"," Title: Replacement of FermionicOperator from qiskit.chemistry in qiskit_natureBody: qiskit.chemistry.FermionicOperator here is very useful for converting fermionic operators to qubits operators. qiskit.chemistry has been deprecated. I went through the migration guide they have but I can't seem to find the replacement of FermiOpetator in qiskit_nature. Anyone know this? Thanks a lot.
"
"['architecture', 'technical-standards', 'quantum-volume']"," Title: Can we calculate the quantum volume of a classical computer?Body: The quantum volume is typically taken as a popular metric to determine the capability of a quantum computer to solve complex problems. Since the end goal is to develop quantum computers that can solve problems that classical computers cannot, I am wondering if one can calculate a quantum volume associated to a classical computer. If one did this for the largest supercomputers, then this could give, for example, a value of the quantum volume that must be surpassed for quantum computers to be advantageous over classical computers.
"
"['quantum-gate', 'quantum-state', 'physical-qubit']"," Title: What's free evolution for a period T?Body: I am currently studying a model of a quantum (atomic) clock. And in this paper, I came across the term "Free evolution for a period T":
- Free evolution for a period T where a phase difference of Φ
accumulates between the oscillator and the qubits $\psi_{2} =\begin{pmatrix}1 & 0 \\0 & e^{-i\phi} \end{pmatrix}\psi_{1}$.
I was able to find references to this term in some other scientific works, but they also do not explain what it means.
It would be great to see a simple explanation of this term.
"
"['quantum-gate', 'ibm']"," Title: CNOT error rate of 1 in IBM backendsBody: I have noticed that some CNOT gates (for instance, between qubits 1 and 2 in ibmq_casablanca) display an error rate of 1 while typical error rates are of course much smaller. How is that even possible? What does it mean?
"
"['programming', 'qiskit', 'chemistry']"," Title: Add FreezeCoreOrbitals on ElectronicStructureProblemBody: I want to freeze core orbitals of my molecule and I know ElectronicStructureProblem has the possibility (es_problem = ElectronicStructureProblem(driver=driver, q_molecule_transformers=FreezeCoreTransformer())). Then, when I run the code to calculate the ground state energy of my molecule (res = calc.solve(problem=es_problem)), it says that 'FreezeCoreTransformer' object is not iterable. Which is the way then to freeze core orbitals without using deprecated libraries of Qiskit?
Thank you very much in advance!
"
"['quantum-gate', 'matrix-representation']"," Title: What is the square root of the NOT gate?Body: I have encountered different matrix of operator "the Square Root of NOT gate".
For example, the matrix is specified here:
$\sqrt {NOT} = \frac{1}{2}\left( {\begin{array}{*{20}{c}}
{1 + i}&{1 - i}\\
{1 - i}&{1 + i}
\end{array}} \right)$
And here a completely different matrix is given:
$\sqrt {NOT} = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}}
1&{ - i}\\
{ - i}&1
\end{array}} \right)$
Applying them to the vector $\left| 0 \right\rangle = \left( {\begin{array}{*{20}{c}}
1\\
0
\end{array}} \right)$, we get different results:
$\sqrt {NOT} \left| 0 \right\rangle = \frac{1}{2}\left( {\begin{array}{*{20}{c}}
{1 + i}&{1 - i}\\
{1 - i}&{1 + i}
\end{array}} \right)\left( {\begin{array}{*{20}{c}}
1\\
0
\end{array}} \right) = \frac{1}{2}\left( {\begin{array}{*{20}{c}}
{1 + i}\\
{1 - i}
\end{array}} \right)$
$\sqrt {NOT} \left| 0 \right\rangle = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}}
1&{ - i}\\
{ - i}&1
\end{array}} \right)\left( {\begin{array}{*{20}{c}}
1\\
0
\end{array}} \right) = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}}
1\\
{ - i}
\end{array}} \right)$
Where is the correct matrix of the operator $\sqrt {NOT} $ specified?
"
"['hamiltonian-simulation', 'quantum-circuit']"," Title: From QUBO problem to quantum circuitBody: Can you describe how to convert some QUBO problem $$f(x_1, ..., x_n) = \sum\limits_{1 \le i < j \le n} \alpha_{i,j} \, x_i \, x_j$$ into its equivalent quantum circuits? Is it preferrable to start with the Ising formulation of the same problem (whose conversion from QUBO is explained here)?
"
"['circuit-construction', 'quantum-circuit']"," Title: Transform circuit with 3 CNOTs in one with limited interactions on the first qubitBody:
Is it possible to translate the above circuit into an equivalent one where the number of interaction gates with the first qubit is 1?
"
"['textbook-and-exercises', 'error-correction', 'nielsen-and-chuang']"," Title: Knill-Laflamme condition derivation in Nielsen&Chuang: issue to understand a part of the proofBody: I have some trouble to understand the proof in Nielsen&Chuang about Knill-Laflamme conditions.
The conditions:
Let $C$ be a quantum code and $P$ the projector onto $C$. Suppose
$\mathcal{E}$ is a quantum operatiion with operation elements
$\{E_i\}$. A necessary and sufficient condition for the existence of
an error-correction operation $\mathcal{R}$ correcting $\mathcal{E}$
on $C$ is that:
$$P E_i^{\dagger} E_j P = \alpha_{ij} P$$
For some Hermitian matrix $\alpha$ of complex numbers.
To show the sufficient condition, he diagonalizes the matrix $\alpha$. Doing this, we end up with a simpler condition:
$$ P F_k^{\dagger} F_l P = d_{kl} P $$
Where $d_{kl}$ is the matrix element of a diagonal matrix.
The polar decomposition tells us that there exist a unitary $U_k$ such that:
$$F_k P = U_k \sqrt{P F_k^{\dagger} F_k P} = \sqrt{d_{kk}} U_k \sqrt{P} = \sqrt{d_{kk}} U_k P \tag{1}$$
My question
At this point, he says that the effect of $F_k$ is therefore to rotate the coding subspace into the subspace defined by the projector:
$$P_k \equiv U_k P U_k^{\dagger}$$
I am not sure to understand precisely this statement. I agree that $P_k F_k P = F_k P$ such that $P_k$ stabilizes the space $F_k C$. But how to be sure that $P_k$ is exactly a good projector. What I mean is that veryfing $P_k F_k P = F_k P$ is for sure not enough as $P_k=I$ would also do the job for instance.
"
"['qiskit', 'vqe', 'optimization']"," Title: Set the bounds for ansatz parameters in VQEBody: How can I make intervals for free parameters when I use VQE function? (https://qiskit.org/documentation/stubs/qiskit.algorithms.VQE.html)
I have built a parametrized ($\theta_1,...,\theta_n$) circuit without using ansatz in Qiskit Circuit Library and I would like to set e.g. $\theta_i \in \left[0,\pi\right]$.
"
"['ibm-q-experience', 'grovers-algorithm']"," Title: issues running a 32 qubit grover's algorithmBody: I have a 32 qubit grover's algoritm however whenever I run it on the simulator that IBM offers it always ouputs a probability of 1 on every single result.
Is there a way to run circuits larger then 32 qubits without the "randomness" of a quantum computer? I tried but I got an error saying that the simulator only supports up to 16 qubits.
I also found that whenever the number of quantum gates is larger then 2000 the simulator just comes back with an error, since the grover operator has to be repeated sqrt(n) number of times this is actually a pretty big issue. Anyone have any idea how to circumvent this?
"
"['mathematics', 'textbook-and-exercises', 'matrix-representation']"," Title: How do I apply a matrix to a ket state?Body: If we have the following matrix:
$$\frac{1}{\sqrt{2}}\begin{pmatrix}1&1&0&0\\ 1&-1&0&0\\ 0&0&1&-1\\ 0&0&1&1\end{pmatrix}$$
How do we find the output for $|00\rangle $?
"
"['algorithm', 'shors-algorithm']"," Title: Is the final state in the quantum period finding algorithm entangled?Body: In the period finding algorithm (see the picture), through the standard procedure in quantum computing algorithms, we have $$U_f|\Psi\rangle|0^n\rangle=\frac{1}{\sqrt{2^n}}\left(\sum_{x=0}^{2^n-1}|x\rangle\right)\otimes|f(x)\rangle.$$
Then the next key step, we apply the measurement. My question is, if we apply the measurement with computational basis $P_m$ only in the second component (the space where $|f(x)\rangle$ lives), then this measurement with respect to the whole composite system is $I\otimes P_m$.
Then follow this viewpoint, the "first" component should not be changed after the measurement right? (Since $\left(\sum_{x=0}^{2^n-1}|x\rangle\right)$ and $|f(x)\rangle$ are clearly not entangled, i.e. it can be written as the form $|\phi\rangle\otimes|\psi\rangle$). Therefore the resulting state should be something like $\underbrace{\left(\sum_{x=0}^{2^n-1}|x\rangle\right)}_{\text{unchanged}}\otimes|f_0\rangle$.
Where did I have the mistake?
"
['entanglement']," Title: What do states that are uncorrelated with respect to a given local measurement look like?Body: Consider a bipartite state $\rho$, and let $\Pi^A\equiv \{\Pi^A_a\}_a$ and $\Pi^A\equiv\{\Pi^B_b\}_b$ be local projective measurements.
Suppose that measuring $\rho$ in these bases gives uncorrelated outcomes. More precisely, this means that the probability distribution
$$p(a,b)\equiv \operatorname{Tr}[(\Pi^A_a\otimes \Pi^B_b)\rho],\tag A$$
is uncorrelated: $p(a,b)=p_A(a)p_B(b)$ for some $p_A,p_B$.
I should stress that I'm considering this property for a fixed basis here, so this can easily hold regardless of the separability of $\rho$.
Given $\Pi^A,\Pi^B$, is there a way to characterise the set of $\rho$ producing uncorrelated measurement outcomes?
For example, if the measurements are rank-1 and diagonal in the computational basis, $\Pi^A_a=\Pi^B_a=|a\rangle\!\langle a|$, then any state of the form
$$\sum_{ab} \sqrt{p_A(a) p_B(b)} e^{i\varphi_{ab}}|a,b\rangle\tag B$$
will give uncorrelated outcomes (assuming of course $p_A,p_B$ are probability distributions).
These are product states for $\varphi_{ij}=0$, but not in general.
Nonpure examples include the maximally mixed state (for any measurement basis) and the completely dephased version of any pure state of the form (B).
Is there a way to characterise these states more generally? Ideally, I'm looking for a way to write the general state satisfying the constraints. If this is not possible, some other way to characterise the class more or less directly.
"
"['textbook-and-exercises', 'error-correction', 'nielsen-and-chuang']"," Title: What does measurement mean in quantum error correction(syndrome diagnosis)?Body: In the case of the simple three-qubit repetition code, the encoding consists of the mappings $|0\rangle \rightarrow\left|0_{\mathrm{L}}\right\rangle \equiv|000\rangle$ and $|1\rangle \rightarrow\left|1_{\mathrm{L}}\right\rangle \equiv|111\rangle$. For the bit flip channel there are four error syndromes, corresponding to the four projection operators:$$
\begin{aligned}
P_{0} &=|000\rangle\langle 000|+| 111\rangle\langle 111|, \\
P_{1} &=|100\rangle\langle 100|+| 011\rangle\langle 011|, \\
P_{2} &=|010\rangle\langle 010|+| 101\rangle\langle 101|, \\
P_{3} &=|001\rangle\langle 001|+| 110\rangle\langle 110| .
\end{aligned}
$$
In Nilsen and Chuang's book, they stated the syndrome analysis is a measurement, e.g. $\langle\psi\mid P_1\mid\psi\rangle.$ But we only have one $\mid\psi\rangle$ at the beginning while four projection operators. I think the measurement should be like:
i.e., the way we would not disturb the original state. But it seems in the textbook, they didn't mention this kind of measurement. Did I understand right?
The reason I have this doubt is that I saw a picture in a paper:
where the $R$ in the picture stands for error recovery while there seems no measurement in $R$.
"
"['entanglement', 'complexity-theory', 'unitarity', 'cryptography', 'qma']"," Title: How can one cheat in Mahadev's classical verification protocol if one can find a ""claw''?Body: I was going through the seminal paper of Urmila Mahadev on Classical Verification of Quantum Computations(for an overview see this excellent talk by her). As a physicist by training, I am not very familiar with cryptographic strategies. Thus, I am not sure how exactly an adversary prover can get away with cheating if he can break the computational assumption of hardness of LWE (learning with errors) and thereby find a claw for the Trapdoor claw-free function pair.
Specifically, the protocols starts out with the quantum prover creating an arbitrary state that he expects to pass the Local Hamiltonian test (so ideally the ground state of the Hamiltonian). For this state, the prover just looks at a single qubit part of his state (I am also very confused as to how the entanglement between the different qubits don't play any role here) and the author assumes this to be some pure state $|\psi\rangle=\alpha_0|0\rangle+\alpha_1|1\rangle. $ To commit to this state, the prover entangles this state with the two pre-images $x_0,x_1$ of the trapdoor clawfree function pair $f_0,f_1$ using a quantum oracle and sends back the classical string $y=f(x_0)=f(x_1)$. At this point, the prover holds the state $|\psi_{ent}\rangle=\alpha_0|0\rangle|x_0\rangle+\alpha_1|1\rangle|x_1\rangle$ which is a state that he himself doesn't know the full description of because it is hard to know $x_0 \; \text{and}\; x_1$ (actually even one of bit of $x_1$) simultaneously. The rest of the paper uses this ignorance to tie the hands of the prover and states that if the prover applies some arbitrary unitary to his state $|\psi_{enc}\rangle$ this U is computationally randomized both by the state encoding and the decoding of the verifier.
But my question is a lot simpler (and naive). I don't understand how the prover can apply an arbitary unitary even if he knew the full description of the state $|\psi_{enc}\rangle$. If the ground state of the Hamiltonian is unique, how can the prover apply a known unitary to his state and still expect to pass the Local Hamiltonian test? I am sure I am missing something trivial.
Also, it would be nice if someone can explain why the entanglement between the different qubit of the ground state can be just ignored and why the mixed case treatment is identical to the analysis done assuming pure states for each qubit.
Thanks in advance.
"
"['entanglement', 'correlations']"," Title: Do entangled states always result in some form of correlation?Body: Consider a bipartite state $\rho$, and denote with $\Pi^A\equiv \{\Pi^A_a\}_a$ and $\Pi^A\equiv\{\Pi^B_b\}_b$ local projective measurements.
Let the associated joint probability distribution be $p_\Pi$, and denote with $p_{\Pi,A},p_{\Pi,B}$ the marginal distributions:
$$p_\Pi(a,b)\equiv \operatorname{Tr}[(\Pi^A_a\otimes \Pi^B_b)\rho],
\quad p_{\Pi,A}(a) \equiv \operatorname{Tr}[(\Pi^A_a\otimes I)\rho],
\quad p_{\Pi,B}(b) \equiv \operatorname{Tr}[(I\otimes \Pi^B_b)\rho]. \tag A$$
We say that the measurement outcomes are uncorrelated if $p_\Pi(a,b)=p_{\Pi,A}(a)p_{\Pi,B}(b)$.
If $\rho$ is pure and separable (i.e. it is a product state), then regardless of the choice of $\Pi_A,\Pi_B$ we always have uncorrelated outcomes.
If $\rho$ is separable but not necessarily pure, this is no longer the case, intuitively because one can have "classical correlations".
A pure, entangled state also always gives rise to correlations, if measured in the basis of its Schmidt decomposition.
What about a generic entangled state? Given an arbitrary entangled $\rho$, is there always a measurement basis with respect to which measurement outcomes are correlated? While this sounds like it must be the case, I'm failing to see a good way to show it at the moment.
More formally, this is akin to asking whether there is an entangled state $\rho$ such that, for any pair of projective measurements $\Pi^A,\Pi^B$ (though I think one can more generally take any local POVM here), we have
$$\operatorname{Tr}[(\Pi^A_a\otimes\Pi^B_b)\rho]
= \operatorname{Tr}(\Pi^A_a\rho_A)
\operatorname{Tr}(\Pi^B_b\rho_B).$$
"
"['quantum-state', 'entanglement']"," Title: Given $|\psi\left(t\right)\rangle=\sum_{n=0}^{N}c_{n}\left(t\right)|N_{1}\rangle_{a}|N_{2}\rangle_{b}$, what is the expression for $c_n(t)$?Body: We have:
$$|\psi\left(t\right)\rangle=e^{-iH_{NL}t}|N\rangle_{a}|0\rangle_{b}$$
Also
$$|\psi\left(t\right)\rangle=\sum_{n=0}^{N}c_{n}\left(t\right)|N_{1}\rangle_{a}|N_{2}\rangle_{b}$$
I would like to know whether
$$c_{n}\left(t\right)=\langle N_{2}|\langle N_{1}|e^{-iH_{NL}t}|N_{1}\rangle_{a}|N_{2}\rangle_{b}$$
is the right way to express.
"
"['qiskit', 'error-correction', 'stabilizer-state']"," Title: How to calculate the generators of a list of stabilizer?Body: Let's say we have a list of stabilizers: {'YZY*', 'XYY*', 'YZYZ', 'Z*Z*', '*XZ*', 'XZX*', 'ZX*Z', 'XZXZ', 'YYX*', 'Z*ZZ'}. Is there any existed formula or function (eg. in qiskit) that can calculate its generators?
"
['physical-realization']," Title: Is this QEC scheme technology dependant?Body: Is this [1] type of error correction also usable for ion-trap based quantum computers?
Is it quantum technology dependent?
[1] P. Das et al., “A Scalable Decoder Micro-architecture for Fault-Tolerant Quantum Computing,” pp. 1–19, 2020. arXiv:2001.06598v1 online available
"
"['quantum-gate', 'unitarity']"," Title: How to represent a sine function in the statevector $|\psi\rangle = sin(kx)$Body: Is there a quantum circuit that encodes the statevector so that the coefficients of the statevector $|\psi\rangle$ corresponds to a discrete representation of $sin(kx)$ in $[0,1]$?
In particular, I'd like to have a set of gates that scales and works for all qubit number $n$. I'd be happy with $sin(x)$ but ideally, I'm looking for higher frequencies multiples as well.
By statevector I am referring to the set of probabilities $(\psi_1,\psi_2,...,\psi_N)$ associated with $|00...0\rangle$, $|00...1\rangle$,...,$|11...1\rangle$ that one gets when reading the output. Please note that I am thinking in the framework of variational algorithms. In these cases, given a qubit register $|\textbf{q}\rangle=|q_1\rangle \otimes ... \otimes |q_n\rangle$, we encode vectors as
\begin{equation}
|\psi\rangle=\sum_{k=0}^{N-1} \psi_k |\text{binary(k)}\rangle
\end{equation}
It is this vector in particular whose entries $\psi_i$ I want to encode to represent a sine. For example, for 3 qubits this vector will have $N=8$ entries. If you divide [0,1] uniformly in $[x_0, ...,x_{N-1}]$, I am looking for an unitary such that $\psi_i=sin(x_i)$. (Or I guess would be more correct to say $sin(2\pi x_i)$)
If possible, I'm looking for both theoretical explanation and practical circuit implementation that I could run and test (not just "theoretically there is an oracle..." etc.). Also, among the possible set of unitaries, clearly the shallower and less connected, the better.
If the question isn't clear please ask for clarification in the comments - I'll be happy to improve it.
"
"['information-theory', 'fidelity']"," Title: How does $F(\psi, \phi) = [\sum_{x}\sqrt{p(x)q(x)}]^{2}$Body: From Quantum Information Theory by Mark Wilde, pg 243 asks to show that $F(\psi, \phi) = [\sum_{x}\sqrt{p(x)q(x)}]^{2}$, which is described as the Bhattacharyya overlap, or classical fidelity, between distributions $p(x)$ and $q(x)$. However, anywhere I look it up, said overlap is given as $\sum_{x}\sqrt{p(x)q(x)}$. No square is involved. Moreover, I am unsure if the means by which I arrive at this is correct?
For $|\psi\rangle = \sum_{x}\sqrt{p(x)}|x\rangle$ and $|\phi\rangle = \sum_{x}\sqrt{q(x)}|x\rangle$, where $|x\rangle$ is an orthonormal basis, if get:
$$F(\psi,\phi)=|\langle \psi|\phi\rangle|^{2}=\sqrt{\langle \psi|\phi\rangle\langle \phi|\psi\rangle}^{2}= \sqrt{\sum_{x}\sqrt{p(x)}\sqrt{q(x)}\sum_{x}\sqrt{q(x)}\sqrt{p(x)}}^{2}=$$
$$
=\sqrt{\left(\sum_{x}\sqrt{p(x)q(x)}\right)^{2}}^{2}=\left(\sum_{x}\sqrt{p(x)q(x)}\right)^{2}$$
This looks right, but it's not equal to the overlap it is supposedly equivalent to, and I wonder if I have made an error somewhere?
"
"['quantum-state', 'density-matrix', 'nonclassicality']"," Title: Why are commuting density operators said to be ""classical states""?Body: In quantum information it is commonly said that a set of states $S=\{ \rho_i \}_i$ is classical if $[\rho_m, \rho_n] = 0, \,\forall \rho_m,\rho_n \in S$. This is meant in the sense that all observed behaviors (results from quantum measurements on the states in $S$) could be reproduced by using only a classical variable. Additionally, if the support of $S$ has dimension $d$, you would only need (classical) dits to do so.
What is a good justification for this? Is this considered a definition or is it really a result?
Edit: as asked, here is an example of the affirmation made in the first paragraph (taken from https://arxiv.org/abs/1207.2574):
The lemma in question is below. But as far as I understand, it only shows that given the assumption that the probabilities are reproducible with classical (i.e. pair-wise commuting) states, then "classical measurements" (defined likewise) are also enough. Am I missing something here?
"
"['quantum-state', 'quantum-optics', 'angular-momentum']"," Title: What are spin-coherent states?Body: Trying to understand the paper; https://arxiv.org/pdf/1702.02577.pdf and ran into "spin-coherent" states.
I wonder those are.
"
"['programming', 'qiskit']"," Title: Qiskit package installed locally, but not running in jupyter notebookBody: I believe I have installed qiskit on my computer. Running pip list or pip3 list in terminal returns:
qiskit 0.26.0
qiskit-aer 0.8.2
qiskit-aqua 0.9.1
qiskit-ibmq-provider 0.13.1
qiskit-ignis 0.6.0
qiskit-terra 0.17.3
However when I then open a jupyter notebook and try
import qiskit
I get told that there is no module named qiskit available. Does anyone know what I am doing wrong?
"
"['programming', 'qiskit']"," Title: Running qiskit on jupyter notebook certverification error: unable to get local user certificateBody: I have code which runs on the IBMQ website perfectly, however copying and pasting the same code (and including my API token) the same code does not run when I try and run it on a real quantum computer from Jupyter notebook. My code is :
import math
import certifi
import matplotlib.pyplot as plt
import numpy as np
from math import pi
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute, Aer,BasicAer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
backend = BasicAer.get_backend('unitary_simulator')
IBMQ.save_account('My_token', overwrite=True)
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q-research')
#circuit I want to run
def circtest(x1,x2,shotsin):
maxShot=shotsin
import random
zz=[x1,x2]
qr=QuantumRegister(1)
my_layout={qr[0]:4}
circuit2 = QuantumCircuit();
circuit2.add_register(qr)
cr=ClassicalRegister(1)
circuit2.add_register(cr)
circuit2.initialize(zz,0)
circuit2.measure(0,0);
device = provider.get_backend('ibmq_casablanca')
Cfin=circuit2;
result = execute(circuit2,backend=device,shots=maxShot).result()
counts = result.get_counts(0)
return counts
However running the simple test
#simple test
circtest(1,0,100)
returns the following error:
---------------------------------------------------------------------------
SSLCertVerificationError Traceback (most recent call last)
<ipython-input-3-8d451fe64647> in <module>
1 #simple test
----> 2 totcirc1Qx(1,0,100)
<ipython-input-2-5ff78fcf31bb> in totcirc1Qx(x1, x2, shotsin)
23 device = provider.get_backend('ibmq_casablanca')
24 Cfin=circuit2;
---> 25 result = execute(circuit2,backend=device,shots=maxShot).result()
26
27 counts = result.get_counts(0)
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in result(self, timeout, wait, partial, refresh)
274 """
275 # pylint: disable=arguments-differ
--> 276 if not self._wait_for_completion(timeout=timeout, wait=wait,
277 required_status=(JobStatus.DONE,)):
278 if self._status is JobStatus.CANCELLED:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in _wait_for_completion(self, timeout, wait, required_status, status_queue)
909
910 try:
--> 911 status_response = self._api_client.job_final_status(
912 self.job_id(), timeout=timeout, wait=wait, status_queue=status_queue)
913 except UserTimeoutExceededError:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/api/clients/account.py in job_final_status(self, job_id, timeout, wait, status_queue)
367 start_time = time.time()
368 try:
--> 369 status_response = self._job_final_status_websocket(
370 job_id=job_id, timeout=timeout, status_queue=status_queue)
371 except WebsocketTimeoutError as ex:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/api/clients/account.py in _job_final_status_websocket(self, job_id, timeout, status_queue)
419 else:
420 raise
--> 421 return loop.run_until_complete(
422 self.client_ws.get_job_status(job_id, timeout=timeout, status_queue=status_queue))
423
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nest_asyncio.py in run_until_complete(self, future)
68 raise RuntimeError(
69 'Event loop stopped before Future completed.')
---> 70 return f.result()
71
72 def _run_once(self):
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py in result(self)
199 self.__log_traceback = False
200 if self._exception is not None:
--> 201 raise self._exception
202 return self._result
203
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py in __step(***failed resolving arguments***)
256 result = coro.send(None)
257 else:
--> 258 result = coro.throw(exc)
259 except StopIteration as exc:
260 if self._must_cancel:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/api/clients/websocket.py in get_job_status(self, job_id, timeout, retries, backoff_factor, status_queue)
256 while current_retry_attempt <= retries:
257 try:
--> 258 websocket = await self._connect(url)
259 # Read messages from the server until the connection is closed or
260 # a timeout has been reached.
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/api/clients/websocket.py in _connect(self, url)
165 # Isolate specific exceptions, so they are not retried in `get_job_status`.
166 except (SSLError, InvalidURI) as ex:
--> 167 raise ex
168
169 # pylint: disable=broad-except
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/qiskit/providers/ibmq/api/clients/websocket.py in _connect(self, url)
161 try:
162 logger.debug('Starting new websocket connection: %s', url)
--> 163 websocket = await connect(url)
164
165 # Isolate specific exceptions, so they are not retried in `get_job_status`.
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/websockets/legacy/client.py in __await_impl__(self)
620 async def __await_impl__(self) -> WebSocketClientProtocol:
621 for redirects in range(self.MAX_REDIRECTS_ALLOWED):
--> 622 transport, protocol = await self._create_connection()
623 # https://github.com/python/typeshed/pull/2756
624 transport = cast(asyncio.Transport, transport)
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py in create_connection(self, protocol_factory, host, port, ssl, family, proto, flags, sock, local_addr, server_hostname, ssl_handshake_timeout, happy_eyeballs_delay, interleave)
1079 f'A Stream Socket was expected, got {sock!r}')
1080
-> 1081 transport, protocol = await self._create_connection_transport(
1082 sock, protocol_factory, ssl, server_hostname,
1083 ssl_handshake_timeout=ssl_handshake_timeout)
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py in _create_connection_transport(self, sock, protocol_factory, ssl, server_hostname, server_side, ssl_handshake_timeout)
1109
1110 try:
-> 1111 await waiter
1112 except:
1113 transport.close()
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py in __await__(self)
282 if not self.done():
283 self._asyncio_future_blocking = True
--> 284 yield self # This tells Task to wait for completion.
285 if not self.done():
286 raise RuntimeError("await wasn't used with future")
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py in __wakeup(self, future)
326 def __wakeup(self, future):
327 try:
--> 328 future.result()
329 except BaseException as exc:
330 # This may also be a cancellation.
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py in result(self)
199 self.__log_traceback = False
200 if self._exception is not None:
--> 201 raise self._exception
202 return self._result
203
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py in data_received(self, data)
526
527 try:
--> 528 ssldata, appdata = self._sslpipe.feed_ssldata(data)
529 except (SystemExit, KeyboardInterrupt):
530 raise
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py in feed_ssldata(self, data, only_handshake)
186 if self._state == _DO_HANDSHAKE:
187 # Call do_handshake() until it doesn't raise anymore.
--> 188 self._sslobj.do_handshake()
189 self._state = _WRAPPED
190 if self._handshake_cb:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py in do_handshake(self)
942 def do_handshake(self):
943 """Start the SSL/TLS handshake."""
--> 944 self._sslobj.do_handshake()
945
946 def unwrap(self):
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)
I assume I am just missing some way in which I can communicate with the actual devices but I am not sure what this is
"
"['programming', 'quantum-enhanced-machine-learning', 'tfq']"," Title: Sympy suddently does not work together with TFQBody: I work with tensorflow-quantum and use sympy for parameter updating.
Suddenly, without (manually) updating or changing anything this error comes up:
File "/home/eli/anaconda3/lib/python3.8/site-packages/tensorflow_quantum/core/serialize/serializer.py", line 93, in _symbol_extractor
if isinstance(expr, sympy.mul.Mul):
AttributeError: module 'sympy' has no attribute 'mul'
Has anyone had this before? Do you have any suggestions for what I can try to fix this?
I am working on Ubuntu 20.04.2 LTS
TFQ version 0.4.0
Sympy version 1.8
the error occurs when I build my PQC layer:
model = tf.keras.Sequential([tf.keras.layers.Input(shape=(), dtype=tf.string),
tfq.layers.PQC(circuit, [cirq.Z(q) for q in builder.get_valid_outputs()]),
], name = model_type)
and it worked like this a long time.
"
"['algorithm', 'mathematics', 'grovers-algorithm']"," Title: Can Grover's algorithm be applied to differential equation solving?Body: As I understand Grover's algorithm, given the output of a black-box function, can be used to find the corresponding input (or set of inputs if the function is not one-to-one). It is therefore potentially useful for solving inversion problems that are hard to solve/invert directly but are easy to verify.
Two areas of math that fit that criteria are zero-finding and differential equation solving, i.e. solving a differential equation may be difficult, but checking whether a proposed solution is correct is relatively easy. However, I am unable to find any discussion of whether Grover's algorithm is applicable to this type of problem, which leads me to believe that it's probably not. If that's the case, why not? Is it a fundamental problem, or just that there are already classical algorithms that outperform Grover's?
"
"['programming', 'qiskit']"," Title: What may I read from DensityMatrix charts when running simple Qiskit code?Body: Let's say I am running this code and I obtain picture below using Qiskit DensityMatrix class.
from qiskit.quantum_info import DensityMatrix
from qiskit.visualization import plot_state_city
qc2 = QuantumCircuit(2,2)
qc2.h(0)
qc2.cx(0,1)
qc2.draw('mpl')
state2 = DensityMatrix.from_instruction(qc2)
plot_state_city(state2.data)
How may I interpret this 'DensityMartix' chart? For what cases is it useful?
I have searched in Qiskit Documentation but did not find something beginner could digest. Will be grateful for any hints and directions.
"
['programming']," Title: How to code density matrix in python?Body: how to do this in python using for loop $\rho = \sum_i p(x)|x\rangle\langle x|$ where $X = {x1,x2,....}$ and $P = {p1,p2,p3...}$ i have tried this loop but tis not working
for x,y in zip(prob,kets):
sum += x * np.outer(y,y)
print(sum)
"
"['algorithm', 'optimization', 'qaoa']"," Title: What's the role of mixer in QAOA?Body: In QAOA algorithm, two terms are being discussed; 1) clause or cost (C) Hamiltonian and 2) mixer consisting of pauli X gates.
What is the role of this mixer? Not clear why it comes after the C. Doesn't it cause the state to flip after evaluating C?
"
"['quantum-gate', 'annealing']"," Title: Is Quantum Annealing threatened by the Quantum Gates approach?Body: Since Quantum Annealing is extremely powerful for optimization it is limited in scope.
However, when a universal Quantum Computer based on gates arrives, it will have a wider scope including optimization as well.
In a such scenario will the annealing approach be obsolete?
"
"['d-wave', 'annealing']"," Title: What is the state-of-the-art annealing device for solving Ising problems?Body: I understand that in addition to D-Wave's quantum annealer, there have been other unconventional (although non-quantum) Ising solvers like the one from Toshiba, Fujitsu, the Coherent Ising machine, etc.
Which of these annealers perform best on, say, the travelling salesman problem ? Has there been any demonstrated advantage for any of these (including D-Wave's) over classical approaches ?
"
"['measurement', 'physical-realization']"," Title: How does measuring in the $|\pm\rangle$ basis works in experiments?Body: I don't get how measuring in different bases works in experiments. From an experimental point of view, what do we do to measure in $|\pm \rangle$ basis?
If I'm getting it right measuring in the computational basis means just recording a click on the detector behind the PBS. Whereas when we want to measure in $|\pm \rangle$ basis we put a half-wave plate between the PBS and the detector.
"
"['quantum-state', 'mathematics', 'measurement', 'textbook-and-exercises']"," Title: Expectation value of a quantum circuitBody: The expectation value of an operator $A$ is defined by this equation $\langle A \rangle_\psi = \sum_j a_j |\langle \psi | \phi_j \rangle|^2 $.
My first question is does it mean that the expectation can be a negative value?
If we want to calculate the observable $Z$ in the state $|1\rangle$, the expectation value is -1, right?
Suppose we have a four-qubit circuit, and we measure it using qiskit. As the measurement is done on $Z$ basis, it corresponds to calculate the expectation value of observable $ZZZZ$. Let's say the output state is $|0001\rangle$ using a simulator.
Since the eigenvalue of $|0001\rangle$ is -1, the expectation value, in this case, is -1. (Is it correct?)
When I execute the circuit on a real quantum chip with shots 1170, I get the result like: $|0000\rangle : 100$, $|0001\rangle :900 $, $|1001\rangle : 50$, $|0011\rangle : 120$.
How can I calculate the expectation value based on the results?
Is it equal to the sum of each state times its probability ($0\times\frac{100}{1170} + 1\times\frac{900}{1170}+ 9\times\frac{50}{1170} + 3\times\frac{120}{1170}$)
or the sum of state probability times its eigenvalue $(1\times100 + (-1)\times900 + 1\times50 + 1\times120)/1170$?
"
"['quantum-gate', 'algorithm', 'complexity-theory', 'quantum-circuit']"," Title: Is there a quantum implementation like HashSet?Body: There are many data structures in classical computers, like Tree, HashSet, etc. These data structures give convenience to the performance (time complexity) of algorithms. I am wondering how to create a similar data structure on a quantum computer. Specifically, I want to know if there is a quantum HashSet that supports $\mathcal{O}(1)$ cost for adding and accessing elements. If not, how might one implement a hash function on a quantum computer?
I think a quantum computer can do at least the same as a classical computer, but I could not find a solution on Google.
"
"['measurement', 'povm']"," Title: Moving between $\sum_{I}E_{i}=I$ and $\sum_{i}M^{\dagger}M=I$ for non-hermitian $M$Body: If $\sum_{i}E_{i}=I$ is a set of POVM's and $\sum_{i}M^{\dagger}M=I$ is a set of general measurement operators, I have always been confused on how to move from one to the other, in regards to the expression of $M=\sqrt{E_{i}}$
If $E_{i}$ is a projector, then $\langle\Psi|E_{i}\Psi\rangle=\langle\Psi|\sqrt{E_{i}}\sqrt{E_{i}}\Psi\rangle=\langle\Psi|M^{\dagger}M\Psi\rangle=\langle\Psi|P^{\dagger}P\Psi\rangle=\langle\Psi|P\Psi\rangle$, due to the properties of the projector.
If $E_{i}$ is not a projector, then $\langle\Psi|E_{i}\Psi\rangle=\langle\Psi|\sqrt{E_{i}}\sqrt{E_{i}}\Psi\rangle=\langle\Psi|M^{\dagger}M\Psi\rangle$
But how can the second equality aboce hold if $M$ isn't hermitian, such as $M_{0}=|0\rangle\langle0|, M_{1}=|0\rangle\langle1|$? In this case, $\sum_{i}M^{\dagger}M=I$ still holds, and this is used as an example in N&C as a set of measurement operators. However, both N&C and other books frequently use the notation of $E_{i}=\sqrt{E_{i}}\sqrt{E_{i}}$. But it's clear from the above example that $M_{1} \neq M_{1}^{\dagger}$, as it's not hermitian.
If $M_{1}=\sqrt{E_{i}}$, but it isn't hermitian, then $M_{1}^{\dagger} \neq \sqrt{E_{1}}$ and so the product of them $\neq E_{1}$
I feel like I am missing something obvious here, but apart from it being related to the non-uniqueness of sqaure roots for matrices, I am not sure what.
"
"['resource-request', 'quantum-circuit']"," Title: What are some standard ways to visualize non-unitary processesBody: In quantum computing, quantum circuits are a common model for visualizing unitary evolution. If I want to represent a unitary $U$ acting on a $2$-qubit state $|00\rangle$ followed by a measurement in the computational basis then I can draw the following picture:
This representation is concise and unambiguous: $U$ is a unitary process, $|00\rangle$ and $U$ are both defined over $2$ qubits, both measurements are applied to single qubits in the computational basis, etc.
Now suppose I want to represent an arbitrary quantum channel $\mathcal{E}: \mathbb{C}^{4 \times 4} \rightarrow \mathbb{C}^{4\times 4}$ (completely positive, trace preserving). What are ways to visualize this (non-unitary) process $\mathcal{E}$ acting on an input $U|\psi\rangle$? I would appreciate suggestions that are used in publications or other main-stream references.
Possible approaches I have considered and their drawbacks:
- I could just add another "gate" $\mathcal{E}$ to the diagram above, and comment that $\mathcal{E}$ is a CPTP map. But this seems dangerous because $\mathcal{E}$ is represented in the same way as other unitary operators even though it represents a more general quantum process. This violates readers' expectations and could cause confusion. For example:
- I could define $V$ to be an isometric extension of $\mathcal{E}$ and add an ambiguous number of ancillary qubits so that my operators are still unitary. However this seems like overkill, since I might choose to define $\mathcal{E}$ in terms of Kraus operators and don't to provide the formalism for an isometry for $\mathcal{E}$ for the sole purpose of providing a picture of my process:
- I could introduce a different style of box to represent $\mathcal{E}$, but this seems non-standard so it might defeat the purpose of providing a clear description of the process $\mathcal{E}$. And its not clear what style of box one should use if they do take this approach. For example:
"
['noise']," Title: understanding final state of a QPU interacting with the environmentBody: As stated in UT's QML course for a QPU that is interacting with the environment:
The environment is defined by a temperature $T$, and if we let the
system equilibrate, the QPU will become thermalized at temperature
$T$. As we saw in the notebook on evolution in open and closed
systems, the energy of the states will follow a Boltzmann
distribution: $\rho_0=\frac{1}{Z} e^{-H/T}$ where $Z=tr (e^{-H/T})$ is
a normalization factor (called the partition function), ensuring
that $tr(\rho_0)=1$. The inverse temperature $1/T$ is often denoted by
$\beta$, so the state can also be written as $\rho_0=\frac{1}{Z}
> e^{-\beta H}$. If $H$ has a discrete basis of orthonormal eigenstates
$\{|n\rangle\}$ with eigenvalues $\{E_n\}$, we can write $H=\sum_n E_n
> |n\rangle \langle n|$ and $\rho_0=\frac{1}{Z} \sum_n e^{-E_n/T}
> |n\rangle \langle n|$ (since exponentiating a diagonal operator
consists in exponentiating the elements of the diagonal). Hence, the
thermal density matrix is a mixed state where each eigenstate of $H$
with energy $E$ has a classical probability $P(E)=\frac{1}{Z}
> e^{-E/T}$, a Boltzmann distribution. We can see that the minimum
energy eigenstate will have the highest probability. When $T
> \rightarrow 0$, the minimum energy eigenstate will have a probability
close to $1$. When $T \rightarrow \infty$, all the eigenstates tend to
have equal probability
Does this mean that after running an algorithm in a system interacting with the environment, instead of getting an output pure state, we get a mixed state described by $\rho_0$?
"
"['programming', 'qiskit']"," Title: Saving vectorized circuits in QiskitBody: Is there a way to save vectorized images in Qiskit? I am using
circuit.draw('latex', filename='./file.pdf')
They type of the image is a pdf, but it looks like a png exported as a pdf. For reference I attach here a figure of the differences I point out.
Hopefully some differences can be noticed. The top subfigure was made with Quantikz, while the other directly with Qiskit. The difference that the top is vectorized and the other looks like it isn't.
EDIT:
The problem is solved using what luciano pointed out. I just want to add that the resulting pdf circuit may still need some cleaning. Apparently the figure is not "tight framed", I attach an example of what I mean
The letters that appear at the bottom are part of the figure caption. One can see that there's a huge space between the image and the caption, along with a border that frames the image.
"
"['quantum-state', 'trace-distance']"," Title: General expression for a state that is close in trace distance to a pure stateBody: Suppose we are given that a quantum state $\rho$ is close in trace distance to a pure state $\vert\psi\rangle\langle\psi\vert$. That is
$$\|\rho - \vert\psi\rangle\langle\psi\vert\|_1 \leq \varepsilon,$$
where $\|A\|_1 = \text{Tr}\sqrt{A^\dagger A}$.
Is it true that $\rho = (1 - \varepsilon)\vert\psi\rangle\langle\psi\vert + \varepsilon\vert\psi^\perp\rangle\langle\psi^\perp\vert$? This seems to ignore the possibility of off-diagonal terms so I think it's not the most general way to write $\rho$. So what is the most general expression for $\rho$?
The motivation for this comes from the fact that the trace distance and fidelity satisfy the Fuchs van de Graaf inequality
$$\|\rho - \vert\psi\rangle\langle\psi\vert\|_1 \leq \sqrt{1 - F(\rho, \vert\psi\rangle\langle\psi\vert)}$$
and equality holds if $\rho$ is also pure. Here, we have a state that is almost pure and I am trying to show that the Fuchs van de Graaf inequality is also "almost" an equality.
"
"['programming', 'ibm-q-experience', 'embedding']"," Title: Data embedding using IBM quantum composerBody: How do you use the IBM quantum composer to encode some data $(a,b,c,d)$ represented by a vector ket in which $a,b,c,d$ have been normalized to one? $a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$
"
"['error-correction', 'stabilizer-code', 'clifford-group']"," Title: Proof that encoder for a stabilizer code is in the Clifford groupBody: Given a stabilizer code on $n$ qubits defined by a set of stabilizers $S_1,\cdots S_m$; The encoder $E$ is a matrix in $U(2^n)$ (unitary group) such that $S_i E v = E v$. I'm pretty sure that $E$ is always in the clifford group (a subgroup of $U$) and I think the proof shouldn't be too hard but I can't think of it. Does anyone know how to show this or a reference.
"
"['entanglement', 'quantum-circuit']"," Title: How to calculate the amount of entanglement for each qubit in a quantum computerBody: I am an electrical engineer and am learning about quantum computing. I am writing a simulator in Python to help with the learning process.
The code that I have can simulate up to 10 qubits. I have (so far) implemented the CNOT gate along with most of the single qubit gates.
My computed final state vectors match with those from the IBM Quantum Composer, so I am encouraged that I'm on the right track.
Quantum Composer shows the amount of entanglement for each qubit in a circuit, and this is the part that I'm having a lot of difficulty figuring out. IBM has given clues to how they do it, but it's very confusing to me due to my lack of education in this subject. See the first image below for their description.
I am able to create the density matrix for my system, and from my reading it seems that partial traces of the density matrix are key to finding the per-qubit entanglement values.
For the circuit show below, IBM shows that qubits 0,2 and 3 are "maximally entangled" with values of 0.5 (shown on the right with the three smaller black circles), while qubit 1 has no entanglement with its value of 1.0 (the larger circle).
Could someone either describe the steps to find the per-qubit entanglement values or point me in the proper direction?
Thank you very much.
The four images below:
IBM's definition of measure of entanglement.
Circuit for three entangled qubits and one with no entanglement.
State vector for this circuit.
Probability amplitudes vs basis state (in a bar graph).
"
['qiskit']," Title: Time to prepare for Fundamentals of Quantum Computation Using Qiskit v0.2X?Body: I am a novice programmer with some skills in C++, C#, and Python.
Would anybody have an idea about the average time needed to prepare for this certification?
(Fundamentals of Quantum Computation Using Qiskit v0.2X )
If you can share your own experience, that would be of great value as well.
Thanks in advance.
Ruben
"
"['entanglement', 'vqe', 'optimization']"," Title: Role of entanglement in a VQE ansatz for combinatorial problemsBody: Variational Quantum Eigensolver is used in quantum chemistry and combinatorial optimization (CO). I'm interested in the latter. In the CO setting a Hamiltonian is a diagonal matrix with real entries and it can be expressed as a linear combination of Puali Z matrices.
From what I read a few ansatz' were proposed: hardware efficient ansatz, Hamiltonian variational ansatz and unitary coupled cluster ansatz.
Regardless of the architecture of the ansatz, it seems the entanglement is a very desired property as it somehow improves classical optimization part.
I don't understand why we need entanglement for solving CO problems? I could just use an RY gate on each qubit and that would allow me to span all states with real amplitudes.
However, when I ran a small experiment with an ansatz containing only RY gates, the results were worse than the same ansatz with some extra CNOT gates. So it does seem that entanglement is important. But what does it do?
My intuition (which is incorrect) tells me that entanglement could significantly reduce the space of solutions because some states become too correlated. Think about the following 2 qubit system which produces the EPR state. In this contrived case we only cover half of a solution space which might be really bad for some problems. I expect the same behaviour mildly manifest itself in systems with more qubits.
Thank you.
"
"['quantum-state', 'density-matrix', 'tensor-networks']"," Title: How to find the $A_i$ in the matrix product state representation?Body: From what I understand, MPS is just a simpler way to write out a state, compared to the density matrix. But how do I get those $A_i$ matrices? From all the examples I read, people just somehow "have" the matrices in their pocket already. Is there a way to generate them from some random state, say $|\Psi\rangle = \alpha|\uparrow\rangle^{\otimes N}+\beta|\downarrow\rangle^{\otimes N}$, or some random density matrix? Feel free to set $N$ to small numbers if it becomes too complicated, I just really want to see an example of how this works in general, not just a GHZ state! Thanks a lot!
Crosspost with: https://physics.stackexchange.com/questions/638206/how-to-translate-from-a-state-density-matrix-formalism-to-matrix-product-state-r
"
"['error-correction', 'resource-request', 'physical-qubit', 'fidelity', 'superconducting-quantum-computing']"," Title: How do the extra energy levels of a transmon qubit affect computation/fidelity?Body: I was reading about transmon qubits, and I know that they are not true two-level systems. Are there any math/papers which talk about how those extra energy levels affect the computation? I'm assuming it may have a small effect.
"
"['quantum-gate', 'quantum-state', 'swap-test']"," Title: In the swap test, how is the final probability $P(0)$ calculated?Body: Does anyone know much about quantum dot product:
Lets say:
$$|\psi \rangle = \frac{|0\rangle_1|\overrightarrow{x_i}\rangle_2 + |1\rangle_1|\overrightarrow{x_j}\rangle_2}{\sqrt 2}$$
$$|\phi \rangle = \frac{\|\overrightarrow{x_i}\| |0\rangle_1 - \|\overrightarrow{x_j}\| |1\rangle_1}{\sqrt Z}.$$
and assume Z is given
$$ Z = \|\overrightarrow{x_i}\|^2 + \|\overrightarrow{x_j}\|^2 $$
Now feeding $| 0 \rangle_1|\psi \rangle_2|\phi \rangle_3$ into the following dot product gate and take a projective measurement in "0" $| 0 \rangle$ in the basis of {$| 0 \rangle$, $| 1 \rangle$}
Which is essentially $\frac {1}{2}(| 0 \rangle_1|\psi \rangle_2|\phi \rangle_3 + | 1 \rangle_1|\psi \rangle_2|\phi \rangle_3 + | 0 \rangle_1|\phi \rangle_2|\psi \rangle_3 - | 1 \rangle_1|\phi \rangle_2|\psi \rangle_3)$ (1) before measurement.
Now I was told that the Probability of "0" is $P(0) = \frac{1}{2}(1+\frac{\|\overrightarrow{x_i} - \overrightarrow{x_j}\|^2}{2Z})$ (2)
But I cannot derive the steps between (1) and (2), can someone perhaps show me the way?
Cross-posted on physics.SE
"
"['entanglement', 'simulation', 'memory-space', 'space-complexity']"," Title: Why does entanglement complicate quantum simulation?Body: To model a single qubit one would need enough memory for $2$ complex numbers. If we have an $N$ qubit system, we would have to store $2N$ complex numbers.
The general statement is that to store an $N$-qubit system, one would require memory for $2^N$ complex numbers. My understanding is that entanglement somehow transforms $2N$ into $2^N$ but I don't understand how.
So why do entangled systems require more memory than non-entangled ones?
"
"['programming', 'qiskit', 'q#']"," Title: Things that I can compare between QDK and QiskitBody: I am planning to write an article which compares QDK and Qiskit
Mainly talking about the different interfaces, and difference in running few algorithms
What all parameters should I compare and take into account, Would love some suggestions
"
"['quantum-gate', 'matrix-representation', 'quantum-circuit']"," Title: How to represent a CNOT gate operating on three-qubit states as a matrix?Body: I am wondering how to represent these kinds of circuits as a matrix. Is there any formula for doing this?
"
"['algorithm', 'quantum-circuit', 'randomised-benchmarking']"," Title: What is the shortest-circuit-depth quantum-benchmarking algorithm?Body: An algorithm implementing a model whose results are known, and from the known results, the benchmarking of the device could be done. What is the currently known shortest circuit depth algorithm that has been used on a real device? An additional criterion is that it should be scalable.
"
"['error-correction', 'fault-tolerance']"," Title: Accuracy threshold theorem: what is the physical probability of failure exactlyBody: In this famous paper is derived the quantum accuracy threshold theorem for concatenated codes.
I have questions for the case errors are assumed to be local and Markovian.
In the so called level-1 simulation for concatenated codes, we basically put error correction inbetween each encoded gate.
Some usefull concepts are the notions of Rec and exRec. A 1-Rec: is an encoded gate followed by quantum error correction. And a 1-exRec is an error correction step followed by an encoded gate, followed again by quantum error correction.
It can be shown that because of quantum error correction, an algorithm will output a wrong answer if there are two fault within an exRec. A fault is defined as a physical gate that did not work as expected.
The probability of such event is upper bounded by: $p=A \epsilon^2$, where $A$ is the number of pair of fault location and $\epsilon$ is the probability that the noisiest physical gate fails.
From that it is possible after further calculation to show the accuracy threshold theorem (introducing the notion of concatenations).
My question
All the reasonning is based on the fact that it is possible to infer a probability that any given gate in the circuit fails. From a classical world I would totally understand the argument and the construction. But the quantum noise is more complicated than being purely probabilistic. And I would like to understand if it is a restricting assumption or if all Markovian quantum noise can be understood with this reasonning.
In the case of "standard" error correction, if you have an initial quantum state, that you make it go through some noise channel, because of error discretization we can make sense of the notion of error probability. Basically, we will have some probability of bit-flip or phase-flip errors due to the noise channel after the syndrome measurement.
In the fault tolerance scenario, if the error correction happened to be perfect (which is not), I could regroup all the set of gates before the error correction and define a "big" noise channel from it. In this scenario it would be like in the previous paragraph and it would make sense to define a probability of failure induced by this noise channel.
However, if I want to relate the properties of this "big" noise channel to the properties of the noise channel of each individual gates. The task might not be easy. Indeed if I define the noise channel of a CPTP $\mathcal{E}$ that tries to implement the ideal unitary $\mathcal{U}$ as the map $\mathcal{N}$ veryfing:
$$\mathcal{E}=\mathcal{N} \circ \mathcal{U}$$
If I have $N$ gates before QEC, I would have:
$$\mathcal{E}_N \circ ... \mathcal{E}_1=\mathcal{N}_N \circ \mathcal{U}_N \circ ... \circ \mathcal{N}_1 \circ \mathcal{U}_1$$
Ahd the noise channel "relevant" for QEC is defined as $ \mathcal{N}_{\text{tot}}$ which verifies:
$$ \mathcal{E}_N \circ ... \mathcal{E}_1 = \mathcal{N}_{\text{tot}} \circ \mathcal{U}_N \circ ... \circ \mathcal{U}_1 $$
Relating $\mathcal{N}_{\text{tot}}$ to the $\{\mathcal{N}_{i}\}$ is not an easy task because among other things of commutation issues.
And this is basically my issue here. In the fault tolerance construction the reasonning consists in some kind of probabilistic reasonning. If one gate "fails" with a probability $\epsilon$, then before QEC, I will have an error (which I can correct). But the quantum noise is non probabilistic, there are all the commutation issues that I just talked for instance. Thus I really don't understand the reasonning if I "think quantum" instead of with classical error probabilities. I could for instance expect some "quantum amplitudes" effects, or "crossed" contribution between all those gates which cannot be understood with classical probabilities.
Thus: how to understand why it is fine to assume that each gate fails with a given probability in FT construction ? How is this probability strictly defined ?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: IBM Quantum API for Java DevelopersBody: As far as I know, IBM Quantum provides two types of APIs: one for Qiskit, and the other for third-party uses (API for developers).
In this question, there are several arguments about using the API for developers, there are even useful links to some sources.
But now IBM has changed the interface of its platform, and I can't figure out where to get the API token for developers (while the API token for Qiskit is in the most prominent place).
I would also like to see an example of using the API in action in Java. Example of a program that sends a schema to IBM Quantum and gets the result.
In total, I have two questions:
- Where is the API token for developers?
- Example of using the API in Java.
"
"['quantum-gate', 'pauli-gates']"," Title: How does Spin Measurement correspond to quantum NOT gate?Body: Newbie in quantum computing (and stack overflow) here. I am confused regarding the relation between spin measurement in quantum mechanics and the quantum NOT gate.
I have a Bloch sphere picture of a single qubit in mind:
$$ $$
From the Stern-Gerlach experiment, we know that for spin oriented in the z-direction ($|0\rangle$ or $|1\rangle$) with a detector oriented in the z-direction ($S_z$) to leave the spin of the particle unchanged, whereas if our detector was tilted to be aligned with the x-axis ($S_x$), then there is a 50% probability of our detector outputting $\hbar/2$ and orienting the particle in $|+X\rangle$, and there is a 50% probability of our detector outputting $-\hbar/2$ and orienting the particle in $|-X\rangle$.
$$ $$
However, we also know that the quantum NOT (bit-flip) gate is simply applying Pauli matrix $\sigma_x$
such that
$\sigma_x |0\rangle$ = $\sigma_x \begin{bmatrix}
1 \\
0
\end{bmatrix}$ = $\begin{bmatrix}
0 \\
1
\end{bmatrix}$ = $|1\rangle$ and similarly $\sigma_x |1\rangle$ = $|0\rangle$.
I guess I see how the matrix multiplication works out for the NOT gate, but this doesn't seem to fit with our SG-experiment picture! We know $S_x = \frac{\hbar}{2} \sigma_x$, it seems as if applying $S_x$ on $|Z+\rangle$ (aka $|0\rangle$) doesn't orient the spin to $|X+\rangle$ or $|X-\rangle$, but instead simply flips the spin to $|Z-\rangle$.
Where does my intuition go wrong? Is applying a NOT gate to a qubit and "measuring" a qubit with a perfectly oriented detector not the same thing? (If not, how do we physically apply a gate on a qubit?)
"
"['measurement', 'quantum-operation', 'nielsen-and-chuang', 'povm', 'state-discrimination']"," Title: Umambiguous discrimination using POVM with highest discriminate probabilityBody: I was studying Nielsen&Chuang's textbook (about page 92), and come up with a question that I cannot solve it.
Given one of the two state $|\psi_1\rangle=|0\rangle$ and $|\psi_2\rangle=\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$ (both initial state has equal prior probability $\frac{1}{2}$). If I want to apply the umambiguous discrimination: Construct POVM $\{\Pi_i\}$ where $i\in\{1,2,\text{inconclusive}\}$, and outcome $1$ when given $|\psi_1\rangle$, $2$ when given $|\psi_2\rangle$ and $\text{inconclusive}$ if it is unluckily to determine the case.
How large can the success probability $\sum_{i=1}^2\frac{1}{2}P(\text{outcome}~ i\mid\text{given}~|\psi_i\rangle)$ be? Is it possible to attan as large as $\frac{1}{4}$? How to concretely construct one?
"
"['density-matrix', 'bloch-sphere']"," Title: When does Hermitian operator with unit trace become a density operator?Body: The definition of density operators is that (i) positive semidefinite; and (ii) unit trace. Given a Hermitian matrix $\rho$ (say, the size is $2\times 2$) with unit trace, I know that such matrix may not be positive semidefinite. However, I find some lecture notes on the internet states that such $\rho$ is a density operator iff the bloch vector $\textbf{r}$ of $\rho$ has $\ell_2$ norm $\leq 1$. How to prove that?
My attempt: $\text{Tr}(\rho^2)=\frac{1}{2^2}\left((I+\textbf{r}\cdot E)(I+\textbf{r}\cdot E)\right)=\frac{1}{2}(1+\|\textbf{r}\|^2)$. But I can't go further. (I'm quite unfamiliar with the trace properties in linear algebra)
"
"['algorithm', 'grovers-algorithm', 'simons-algorithm']"," Title: Implementing EQP Simon's (removing trivial solution)Body: I have been studying Brassard and Hoyer's paper, An Exact Quantum Polynomial-Time Algorithm for Simon's Problem (https://arxiv.org/abs/quant-ph/9704027).
I have successfully implemented Section 4.1 Shrinking a Subgroup with a 3-qubit system in Qiskit. Now, I'm attempting to implement Section 4.2 Removing 0 from a subgroup and Section 4.3 Composing our new QP-Algorithm.
Specifically, I'm examining the Proof of Theorem 4.
I'm attempting to explicitly define one of the $\chi$ functions and then apply Lemma 8 to better understand what's going on.
Here's my attempt at defining $\chi_0$.
$\chi_0(g) = g_0$
Now apply Lemma 8 to $\chi_0$.
$A = \{ g \in G | g_0 = 1\}$
$B = \{ g \in G | g_0 = 0\}$
Now defining $S_A$. (The first $i$ in the RHS denotes imaginary $i$)
$S_A|i\rangle|\psi_i\rangle = i|i\rangle|\psi_i\rangle$ if $i \in A$
$S_A|i\rangle|\psi_i\rangle = |i\rangle|\psi_i\rangle$ if $i \in B$
Now if I actually write out the matrix for this operator it should look like this.
$$\begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & i & 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 & i & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & i & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & i \\ \end{matrix} $$
$S_{\{0\}}$ is defined as the operator that changes the phase by $i$ if and only if the state is the zero state. Creating this matrix is trivial.
The paper then defines the Grover Iteration as $G = AS_{\{0\}}A^{-1}S_A$ where $A$ is some uniform superposition. I am able to obtain $A$.
My questions are first are there any errors in my above analysis? Second what does $A^{-1}$ denote in this context and how could I obtain it? Lastly, how could I implement this in Qiskit? Any tips would be greatly appreciated. Thanks in advance!
"
"['programming', 'qiskit', 'optimization', 'qaoa']"," Title: QAOA not returning solution for simple clustering problemBody: I am following University's of toronto QML course and there's a section where QAOA is applied to cluster a set of vectors by mapping the clustering problem into a Maxcut problem. Unfortunately qiskit's QAOA is not returning the right solution (even within the course's notebook lecture), so I am a bit lost in the implementation.
The (4) points are (top two are on the top left corner and bottom two on the bottom right corner)
data = array([[ 0.11 , 0.143],
[ 0.121, 0.109],
[-1.515, 1.629],
[-1.512, 1.678]])
And the distance matrix (used as the 'weight' matrix of the maxcut graph) is
w = array([[0. , 0. , 2.202, 2.234],
[0. , 0. , 2.233, 2.265],
[2.202, 2.233, 0. , 0. ],
[2.234, 2.265, 0. , 0. ]])
(distances < 0.5 were mapped to 0 as pre-processing).
Using Qiskit's max_cut class, we map w into an Ising problem. We also verify the best solution
qubit_operators, offset = max_cut.get_max_cut_qubitops(-w)
// checking for solutions (cleary 0011 and 1100 are the solutions)
(0, 0, 0, 0) 4.466870101471442
(0, 0, 0, 1) 0.031168254348417523
(0, 0, 1, 0) -0.031168254348417523
(0, 0, 1, 1) -4.466870101471442
(0, 1, 0, 0) 0.03160476231770515
(0, 1, 0, 1) 0.0001477223286934226
(0, 1, 1, 0) -0.0001477223286934226
(0, 1, 1, 1) -0.03160476231770515
(1, 0, 0, 0) -0.03160476231770515
(1, 0, 0, 1) -0.0001477223286934226
(1, 0, 1, 0) 0.0001477223286934226
(1, 0, 1, 1) 0.03160476231770515
(1, 1, 0, 0) -4.466870101471442
(1, 1, 0, 1) -0.031168254348417523
(1, 1, 1, 0) 0.031168254348417523
(1, 1, 1, 1) 4.466870101471442
after inputting the mapped operator and running it on Qiskit's QAOA
from qiskit.aqua import get_aer_backend, QuantumInstance
from qiskit.aqua.algorithms import QAOA
from qiskit.aqua.components.optimizers import COBYLA
from qiskit.aqua.translators.ising import max_cut
p = 1
#w = -w
qubit_operators, offset = max_cut.get_max_cut_qubitops(-w)
p = 1
optimizer = COBYLA()
qaoa = QAOA(qubit_operators, optimizer, p)
backend = get_aer_backend('statevector_simulator')
quantum_instance = QuantumInstance(backend, shots=10)
result = qaoa.run(quantum_instance)
The output is the following:
{'num_optimizer_evals': 13,
'min_val': 0.0,
'opt_params': array([0., 0.]),
'eval_time': 0.32109689712524414,
'eval_count': 13,
'energy': 0.0,
'eigvals': array([0.]),
'min_vector': array([0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j,
0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j,
0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j]),
'eigvecs': array([[0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j,
0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j,
0.25+0.j, 0.25+0.j, 0.25+0.j, 0.25+0.j]])}
It seems as if the QAOA never evolves (optimal $\gamma$ and $\beta$ are 0) and stays in the mixer's ground state.
Has anyone experienced the same problem?
I'm using Qiskit's 0.9.0 (otherwise code is not compatible with the course).
"
"['entanglement', 'foundations', 'quantum-metrology']"," Title: Biggest variance of $h=\sum_i H_i$?Body: What's the biggest variance of $h=\sum_i H_i$ where $H_i$ is the hamiltonian act on the ith qubit?
If the n qubits state is separable, i.e., the state is $\mid\psi_1\rangle\otimes\mid\psi_2\rangle\otimes\cdots\mid\psi_n\rangle$. Obviously, the biggest variance, $\max\limits_{\mid\psi\rangle}(\Delta h)^2$, is $N(\lambda_M-\lambda_m)^2/4$, where $\lambda_M \text{ and } \lambda_m$ are biggest and smallest eigenvalue of $H_i$ respectively. To see this, we can use the general formula for state $\mid\psi_i\rangle\equiv \cos(\theta)\mid0\rangle+\sin(\theta)e^{i\phi}\mid1\rangle$. We then calculate the variance of one part: $\mid\psi_i\rangle$ and will get the biggest variance is when $\theta=\frac{\pi}{4}$, and the variance is $(\lambda_M-\lambda_m)^2/4$. At last the total variance of $N$ parts can be added as $N(\lambda_M-\lambda_m)^2/4$.
But how to prove if the total state $\mid\psi\rangle$ is not necessarily separable, the biggest variance of $h$ becomes $(N\lambda_M-N\lambda_m)^2/4$ instead of $N(\lambda_M-\lambda_m)^2/4$?
"
"['quantum-state', 'algorithm', 'entanglement']"," Title: Is it true that for a quantum algorithm to be efficient it must feature a highly entangled state at some point?Body: I'm wrapping my head around how and why quantum computers can provide advantage over classical. A basic and naive argument is that the dimension of the Hilbert space of $n$ qubits grows as $2^n$. However, without exponentially sized circuits of 1- and 2-qubit gates only a tiny fraction of all the Hilbert space can be reached. Another explanation I have encountered is that it is the entanglement (and not simply a dimension of the Hilbert space) that is the resource allowing for quantum speed-ups. Whether this is true or not I have the following question.
Should one expect that an efficient quantum algorithm will produce a highly entangled state at some point? If the entanglement is not maximal, should it be possible in principle to run the algorithm on a fewer number of qubits (outsourcing some part of the computation to a classical computer)?
"
"['complexity-theory', 'classical-computing', 'quantum-advantage', 'performance']"," Title: When is a Quantum Computer Slower Than a Classical Computer?Body: Someone offhandedly mentioned to me that quantum computers are sometimes significantly (I guess they meant asymptotically) slower than classical computers.
Unfortunately, I didn't get any arguments nor examples for this statement, and I'm not able to figure the limitations out myself.
I tried to look up articles on the web and questions on StackExchange, but everything is about the problems where quantum computers are faster.
None of them mention how solutions to the rest of the problems compare in speed, at least not what I could find.
Question: What are examples where quantum computers are significantly/asymptotically slower than classical computers?
"
"['algorithm', 'complexity-theory', 'classical-computing']"," Title: Can the difference between quantum and classical circuits be attributed to different paths in the Hilbert space?Body: One of the explanations I have encountered for why quantum computation can provide speed-up over the classical is a picture that in the Hilbert space much more paths are allowed quantum-mechanically than classically. Indeed, it seems that we are only allowed to travel along computational axes classically, but quantum-mechanically we can take shortcuts. Is this picture morally correct? Is it possible to present some very explicit illustration? Say for the Deutsch problem or for the Grover algorithm with minimum qubits?
"
"['quantum-state', 'bloch-sphere']"," Title: How to write the eigenvectors of a mixture of two pure states?Body: Let $|\psi_1\rangle,|\psi_2\rangle$ be two pure states. Assume $\langle\psi_1|\psi_2\rangle\neq0$, and consider the convex combination
$$\rho\equiv p_1 |\psi_1\rangle\!\langle\psi_1| + p_2 |\psi_2\rangle\!\langle\psi_2|,$$
with $p_1+p_2=1$.
Suppose we are interested in the pure state corresponding to the largest (smallest) projection probability. In other words, we want a state $|\phi\rangle$ that maximises (minimises)
$p_1 |\langle\phi|\psi_1\rangle|^2 + p_2 |\langle\phi|\psi_2\rangle|^2.$
Algebraically, this can be found by simply computing the eigenvectors of $\rho$. Doing so gives
$$|\phi_\pm\rangle = N_\pm\left(
(A\pm\sqrt{A^2+4z^2})|\psi_1\rangle +
2z |\psi_2\rangle
\right),$$
with $A\equiv p_1 + p_2(2F-1)$, $F\equiv |\langle\psi_1|\psi_2\rangle|^2$, $z\equiv\langle\psi_1|\psi_2\rangle$.
Now, because we are effectively operating on the span of two pure states, we can assume without loss of generality that these are qubits, and represent everything in the Bloch sphere.
Is there a nice geometrical characterisation of where the eigenvectors $|\phi_\pm\rangle$ end up being represented in the Bloch sphere in relation to $|\psi_i\rangle$? By "nice" I mean something like "$|\phi_\pm\rangle$ sit in the plane spanned by $|\psi_i\rangle$ and at the angle so and so between them".
For $p_1=p_2$ I find that $|\phi_+\rangle$ sits exactly in between $|\psi_1\rangle$ and $|\psi_2\rangle$. More precisely, denoting with $\vec r_\phi$ the Bloch vector of $|\phi\rangle$, we have
$$\vec r_{\phi_\pm}=\pm N (\vec r_{\psi_1} + \vec r_{\psi_2}).$$
This stops being the case for $p_1\neq p_2$. Is there a similarly nice solution for the general case?
"
"['programming', 'qiskit', 'ibm-q-experience', 'openpulse']"," Title: Qiskit Pulse NotebookBody:
When I downloaded the source code from Qiskit Notebook Accessing Higher Energy States and tried to execute it, the output and graph seem wrong in the step finding the frequency step which leads to the failure of other parts. I have tried to update the library "Sample Pulse" to the new library "Waveform". However, the output is still incorrect. I think the data given for IBM-Armonk is out of date. Does anyone know what is the problem?
Basically, I can not find the correct output when executing the code to find Rabi Oscillations. Here the code
num_rabi_points = 50 # number of experiments (ie amplitudes to sweep out)
# Drive amplitude values to iterate over: 50 amplitudes evenly spaced from 0 to 0.75
drive_amp_min = 0
drive_amp_max = 0.75
drive_amps = np.linspace(drive_amp_min, drive_amp_max, num_rabi_points)
# Create schedule
rabi_01_schedules = []
# loop over all drive amplitudes
for ii, drive_amp in enumerate(drive_amps):
# drive pulse
rabi_01_pulse = pulse_lib.gaussian(duration=drive_samples,
amp=drive_amp,
sigma=drive_sigma,
name='rabi_01_pulse_%d' % ii)
# add commands to schedule
schedule = pulse.Schedule(name='Rabi Experiment at drive amp = %s' % drive_amp)
schedule |= pulse.Play(rabi_01_pulse, drive_chan)
schedule |= measure << schedule.duration # shift measurement to after drive pulse
rabi_01_schedules.append(schedule)
# Assemble the schedules into a program
# Note: We drive at the calibrated frequency.
rabi_01_expt_program = assemble(rabi_01_schedules,
backend=backend,
meas_level=1,
meas_return='avg',
shots=NUM_SHOTS,
schedule_los=[{drive_chan: cal_qubit_freq}]
* num_rabi_points)
"
"['grovers-algorithm', 'resource-request']"," Title: Is there recent research on experimental implementations of Grover's algorithm with more than 5 qubits?Body: I could only find experimental work on Grover's algorithm upto 5 qubits here. Is there any more recent research for larger database sizes where Grover's algorithm is employed? Is there any known method that is optimal to construct $C^nZ$ that is scalable for construction of Grover's algorithm with more than 5 qubits?
"
"['quantum-gate', 'gate-synthesis']"," Title: Is it possible to make a Toffoli gate using only CNOTS and ancillas?Body: I have tried to make a Toffoli gate using only CNOTs and some ancilla qubits but I do not get the unitary. It seems it is not possible without additional gates? What could I do to prove it?
I have tried something like CNOT(c0,a0),CNOT(c1,a0),X(a0),CNOT(a0,t) (and then reversing the whole operation for the ancilla) , where c are the control qubits, a are the ancilla qubits and t is the target. This method does not work because when c0 and c1 are both 0 then it also changes the target qubit.
I know that you can generalize Toffoli to $n$ qubits using normal Toffolis and ancillas.
"
"['quantum-gate', 'measurement', 'vqe', 'pauli-gates', 'optimization']"," Title: Measurement on a specific basis and proof of circuit outputBody: I am trying to understand a proof from Practical optimization for hybrid quantum-classical algorithms. In particular, I need clarifications on how do you perform the measurement on a different basis presented below and the last step of the proof.
First, let's start with some notation: $V(\theta)$ is an ansatz of the most general shape
\begin{equation}
V({\theta})=\prod_{l=1}^{L}V_l(\theta_l)W_l
\end{equation}
Where $V_l(\theta_l)=\exp(-i\theta_lU_l)$, $U_l$ is an Hermitian operator, $W_l$ is also an unitary (doesn't matter now). Moreveover, you can always decompose $U$ as a linear combination of Paulis $U_l=\sum_{\mu}^{l_U}u_\mu \sigma_{\mu}^{(U)}$. Similarly, for any Hermitian $H=\sum_{\nu}^{l_G}h_\nu \sigma_{\nu}^{(H)}$. Finally, when "splitting" the gate sequence $V$ we write in short $V_-=\prod_{l=1}^{k-1}V_l(\theta_l)W_l$ and $V_+=\prod_{l=k}^{L}V_l(\theta_l)W_l$
Given this circuit, I am trying to understand the output presented by the author. The proof goes as follows:
Applying $V_-$ and $H$ to the initial state yields: $V_-|{\textbf{0}}\rangle(|{0}\rangle+|{1}\rangle)(1/\sqrt{2})$. Then, a controlled $\sigma_{\mu}^{(U)}$ gate results in
\begin{equation*}
\frac{1}{\sqrt{2}}\left(V_-|{\textbf{0}}\rangle|{0}\rangle+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle|{1}\rangle \right)
\end{equation*}
then
\begin{equation*}
\frac{1}{\sqrt{2}}\left(V_-|{\textbf{0}\rangle}|{0}\rangle+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle|{1}\rangle \right) \xrightarrow{S, V_+} \frac{1}{\sqrt{2}}\left(V|{\textbf{0}}\rangle|{0}\rangle+iV_+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle|{1}\rangle \right)
\end{equation*}
finally, an Hadamard on the ancilla and the circuit output is:
\begin{equation*}
\begin{aligned}
&|{\psi_{\mu}}\rangle=\frac{1}{\sqrt{2}}\left(V|{\textbf{0}}\rangle|{+}\rangle+iV_+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle|{-}\rangle\right)= \\
& = \frac{1}{2}[(V|{\textbf{0}}\rangle+iV_+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle)|{0}\rangle +(V|{\textbf{0}}\rangle-iV_+\sigma_{\mu}^{(U)}V_-|{\textbf{0}}\rangle)|{1}\rangle)]
\end{aligned}
\end{equation*}
Now comes the difficult bit, which is measuring along a different basis on a set of qubits, and measuring on the canonical on the ancilla.
The author says: Recalling that $\langle i|\hat{\sigma}_{z}^{(a)}|j\rangle=\delta_{i j}(-1)^{j},$ one can easily verify that:
\begin{equation}
\left\langle\psi_{\mu}\left|\hat{\sigma}_{\nu}^{(H)} \otimes \hat{\sigma}_{z}^{(a)}\right| \psi_{\mu}\right\rangle=-\Im\left[\left\langle 0\left|V^{\dagger} V_{+} \hat{\sigma}_{\mu}^{(U)} \hat{V}_{+}^{\dagger} \hat{\sigma}_{\nu}^{(H)}V\right| 0\right\rangle\right]
\end{equation}
- How do you prove this very last step?
- How do you practically implement this measurement operator above if you were to implement it on a QC? (You can also use an example, like assume $\sigma_v$ is $X$ on some qubits or whatever you prefer).
Don't hesitate to ask for clarifications if necessary, I am open to suggestions to improve this question.
When answering, please do so in a simple and understandable format, without skipping too many steps so that a beginner can also understand
"
"['qiskit', 'quantum-gate', 'quantum-state', 'phase-estimation', 'quantum-circuit']"," Title: What is the significance of the phase angle?Body: I've the following circuit which gives an output of 1 with a phase angle of 3π/4. When we measure the circuit all we get is the state 1 (On actual QC, it's 90% of the time 1). Is the information about the phase angle lost by measuring the state? Could the phase angle also be part of the output?
OPENQASM 2.0;
include "qelib1.inc";
qreg q[1];
creg c[1];
u(pi/2,pi/2,0) q[0];
h q[0];
u(pi/2,pi/2,pi/2) q[0];
measure q[0] -> c[0];
"
"['programming', 'qiskit', 'quantum-gate', 'pennylane']"," Title: How to create the equivalent of the Qiskit rxx gate in Pennylane?Body: How can I create the Pennylane equivalent of:
from qiskit import QuantumCircuit
circ = QuantumCircuit(2, 2)
circ.rxx(theta=0.3, qubit1=0, qubit2=1)
"
"['entanglement', 'measurement', 'photonics', 'optical-quantum-computing', 'quantum-optics']"," Title: How is measurement performed on a stream of polarized photons?Body: Is it possible to use a simple laser to measure qubits in optical quantum computers, or is a single-photon emitter absolutely necessary? If you can do it with a simple laser, how would you go about measuring it since you wouldn't have to measure a single photon but rather a stream of them?
"
['quantum-optics']," Title: How to build a single-photon emitter at homeBody: Hey any of you people know if it's possible to make a DIY single-photon emitter? I've been searching for an answer for quite some time now and all I've come across that's helpful is this:
https://www.nature.com/articles/s41467-019-10917-3
Anyone have an alternate solution?
Thank you
"
"['qiskit', 'machine-learning', 'pennylane']"," Title: Differentiable Programming of Quantum ComputersBody: Recently, I have tried PennyLane and TensorFlow Quantum. These platforms are said to provide differentiable programming of quantum computers but I can't understand it clearly though.
I have searched about differentiable programming and found out that it allows for gradient-based optimization of parameters in the program. Does differentiable programming of quantum computers supplied us with a faster way to do gradient descent such as parameter shift rules, natural gradient, ...
Except for PennyLane and TensorFlow Quantum, Can we do differentiable programming of quantum computers on other platforms like Qiskit, Cirq, ...
"
"['terminology', 'foundations', 'quantum-optics']"," Title: Why do we use 'modes' in quantum optics?Body: In this material, it gives the definition of modes:
The modes are basically defined by the properties of coherence and orthogonality: modes are orthogonal solutions of the wave equation.
Since the modes are eigenfunctions in this material, why do we need to use a new term 'mode' instead of the original one, i.e., eigenfunctions?
"
"['quantum-gate', 'textbook-and-exercises']"," Title: Does Z gate swap complex amplitudes of $|0\rangle$ and $|1\rangle$?Body: I am reading Quantum Computing 1st Edition By Parag Lala, this book says
It seemed that the Z gate swapped the complex amplitudes $\alpha$ and $\beta$.
Can Z gate implement that, or are there any errata? Because
$$
\begin{pmatrix} \alpha \\ -\beta \end{pmatrix} = \alpha\begin{pmatrix} 1 \\ 0 \end{pmatrix} - \beta\begin{pmatrix} 0 \\ 1 \end{pmatrix} \neq \alpha\begin{pmatrix} 0 \\ 1 \end{pmatrix} + \beta\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \alpha|1\rangle + \beta|0\rangle
$$
And, is it true that Z Gate merely add $\pi$ to the relative phase $\phi$ of a superposition $|q\rangle$?
$$
|q\rangle = \alpha|0\rangle + e^{i\phi}\beta|1\rangle
$$
$$
Z|q\rangle = \alpha|0\rangle + e^{i(\phi+\pi)}\beta|1\rangle
$$
"
['gate-synthesis']," Title: Tool to verify $CNOT$ (or any interacting 2-qubit gate)Body: Is there any tool to define a circuit and verify if it works as desired?
It would be interesting to find ways of performing interacting gates - e.g. CNOT gate - between non adjacent qubits.
Hence I'd like an efficient way to define a circuit with any number of qubits, and verify whether it performs the CNOT between two of them (no matter what happens the other qubits).
"
"['programming', 'qiskit', 'quantum-state']"," Title: Setting initial state in Qiskit unitary simulatorBody: I'm getting started in IBM quantum lab for quantum computing. My task is to put quantum state $|0\rangle$ on the 1st qubit and state $|1\rangle$ on second one. I tried using this method to initialize it as:
qc.initialize(0,0)
qc.initialize(1,1)
but when I run in the unitary simulator, I get the following error:
Simulation failed and returned the following error message:
ERROR: Failed to load qobj: Invalid qobj "initialize" instruction ("params" is incorrect length).
I also tried using reset method but it displayed error as well
qc.reset(0)
qc.reset(1)
qc.x(1)
If anyone knows how to set state to a specific qubit in Qiskit it would be great, thanks in advance
The full code:
#Creating a quantum circuit with two qubits
qc=QuantumCircuit(2)
#Set the state of the first qubit to|0⟩ and set the state of the second qubit to|1⟩.
qc.initialize(0,0)
qc.initialize(0,0)
#or
#qc.reset(0)
#qc.reset(1)
#qc.x(1)
#Applying Hadamard to both qubits
qc.h(0)
qc.h(1)
#Applying CNOT operator, where the controller qubit is the first qubit and the target qubit is the second qubit
qc.cx(0,1)
#Applying Hadamard to both qubits
qc.h(0)
qc.h(1)
display(qc.draw())
usim = Aer.get_backend('unitary_simulator')
qobj = assemble(qc)
unitary = usim.run(qobj).result().get_unitary()
array_to_latex(unitary, pretext="\\text{Circuit = }\n")
"
"['quantum-gate', 'gate-synthesis']"," Title: What gate should one use to perform $R_y$ using a single $R_z$ + Clifford gates?Body: I know how to perform Rz rotations with the least amount of T gates, eg by using Efficient Clifford+T approximation of single-qubit operators by Peter Selinger. Similarly, one could use H Rz H to perform an Rx rotation. This seems to me like a simple question, what gate should one use to perform Ry using a single Rz + Clifford gates?
"
"['quantum-gate', 'circuit-construction', 'simulation', 'gate-synthesis', 'universal-gates']"," Title: How to create CNOT from an entangling gate and arbitrary single-qubit gates?Body: I am working on the classical simulation of quantum circuits. I know how to efficiently implement the following entangling gate, which -- in the following paper: https://arxiv.org/pdf/1803.02118 -- was declared to be an entangling gate that is sufficient to realize arbitrary quantum circuits together with 1-qubit gates. The gate is given by
$$
U_\text{entangle}=\frac{1}{2}\begin{pmatrix}
ie^{i\pi/4} & e^{i\pi/4} & e^{i\pi/4} & -ie^{i\pi/4} \\
e^{-i\pi/4} & ie^{-i\pi/4} & -ie^{-i\pi/4} & e^{-i\pi/4} \\
e^{-i\pi/4} & -ie^{-i\pi/4} & ie^{-i\pi/4} & e^{-i\pi/4} \\
-ie^{i\pi/4} & e^{i\pi/4} & e^{i\pi/4} & ie^{i\pi/4}
\end{pmatrix}.
$$
I want to implement the CNOT gate, which is given by
$$
\text{CNOT}=\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{pmatrix}.
$$
I am looking for an expression of CNOT in terms of $U_\text{entangle}$. In the most general form, this is given by
$$
\text{CNOT} = A\: U_\text{entangle}\: B \:U_\text{entangle}\: C U_\text{entangle}\: D \dots U_\text{entangle} \: Z
$$
where $A,B,C,\dots,Z$ are arbitrary combinations of 1-qubit gates. Hence even $A$ for instance can be composed of several 1-qubit gates.
I now want to find such matrices $A,\dots$ that give me a representation of $U_\text{entangle}$ in terms of CNOT and 1-qubit gates.
Is there an algorithm / a procedure to follow in order to determine the circuit that realizes CNOT? Is $U_\text{entangle}$ maybe a famous gate that has already been shown to produce CNOT with single-qubit unitaries? If the ''decomposing'' procedure doesn't follow a strict rule, are there at least any tips / rules of thumb you can give in order to find such a decomposition?
Any help is really appreciated! Many thanks in advance!
"
"['quantum-state', 'complexity-theory', 'quantum-advantage', 'probability']"," Title: Relation between approximate counting and samplingBody: Consider the following statement of Stockmeyer counting theorem.
Given as input a function $f:\{0, 1\}^{n} \rightarrow \{0, 1\}^{m}$
and $y \in \{0, 1\}^{m}$, there is a procedure that runs in randomized
polynomial time, with access to an $\text{NP}^{f}$ oracle (that is, in $\text{FBPP}^{\text{NP}^{f}})$, and output
an estimate $\alpha$ such that \begin{equation} (1 - \epsilon)p \leq
\alpha \leq (1 + \epsilon)p, \end{equation} for \begin{equation} p=
\frac{1}{2^{n}}\sum_{x \in \{0, 1\}^{n}}f(x). \end{equation}
This version can be found in Theorem 21
this paper.
Here are my two questions:
- Consider a quantum circuit $C$ run on the all $|0^{n}\rangle$. For $x \in \{0, 1\}^{n}$, consider an output probability
\begin{equation}
p_x = |\langle x|C|0^{n}\rangle|^{2}.
\end{equation} Because of Stockmeyer's theorem, for any quantum circuit $C$ can we multiplicatively estimate $p_x$ to error $\epsilon$, for any $x \in \{0, 1\}^{n}$, in $\text{FBQP}^{\text{NP}^{S}}$, where $S$ is an exact sampler from the output distribution of $C$?
Note that it is trivial to sample from the output distribution of a
quantum circuit in quantum randomized polynomial time, so, if the
answer to this question is yes, does it mean we can compute this
estimate in $\text{FBQP}$ itself and not need the oracle?
- Can we multiplicatively estimate $p_x$, to error $\epsilon$, for a uniformly randomly chosen $x$, in $\text{FBQP}^{\text{NP}^{S}}$? The paper I linked seems to indicate that we can, in Lemma 23, but I do not see how.
Basically, I do not understand what $f$ of Stockmeyer's counting theorem is in either of these cases. How does the existence of a sampler $S$, for the output distribution of a quantum circuit, relate to the $f$ in Stockmeyer's theorem --- can we construct an explicit $f$ using the circuit and the sampler $S$? Does sampling imply approximate counting by Stockmeyer's argument?
"
"['entanglement', 'notation']"," Title: What is the notation for factoring a state when non-adjacent qubits are entangled?Body: Suppose I have the entangled state
$$|\psi\rangle = \frac{1}{\sqrt{2}}(|000\rangle + |110\rangle).$$
If i want to factor the non-entangled parts of this state out, I can easily write that down as
$$|\psi\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle) \otimes |0\rangle.$$
Suppose now, however, that I have a state
$$|\phi\rangle = \frac{1}{\sqrt{2}}(|000\rangle + |101\rangle).$$
In $|\phi\rangle$, qubits $1$ and $3$ are entangled as opposed to qubits $1$ and $2$ in $|\psi\rangle$. Is there a notation for factoring out qubit $2$ in this state that is elegant like for $|\psi\rangle$?
"
"['programming', 'qiskit', 'grovers-algorithm', 'quantum-circuit']"," Title: Does Qiskit Statevector has actual speed up for Grover Search?Body: From Qiskit document, the Statevector can be used to specify the oracle of Grover Search. After seeing the source code of the operators, it seems a statevector is converted to a rank-1 projector operator. In this case, the operator may not be unitary.
The code below can be run on a real IBMQ machine.
from qiskit import *
from qiskit.quantum_info import Statevector
from qiskit.aqua.algorithms import Grover
from qiskit import QuantumCircuit
oracle = Statevector([0,0,0,0,0,1,1,0])
good_state = ['110','101']
grover = Grover(oracle=oracle, good_state=good_state)
# backend = provider.get_backend('ibmq_lima')
backend = BasicAer.get_backend('qasm_simulator')
result = grover.run(quantum_instance=backend)
print('Result type:', type(result))
print()
print('Success!' if result.oracle_evaluation else 'Failure!')
print('Top measurement:', result)
However, it does not make sense to me because the operator here is not unitary.
I am wondering if Statevector of Qiskit has actual speed up or it is just for illustration of Grover Search. Besides, how does it realize when the operator is not unitary?
"
"['programming', 'qiskit', 'vqe', 'optimization']"," Title: What explains my anomalously scaled up VQE?Body: I am trying to implement VQE from the Qiskit to obtain the ground state of a very specific Hamiltonian that has been generated via a docplex minimized quadratic model. The model has been converted to an Ising Hamiltonian using Qiskit's Optimization module. The resultant Hamiltonian denoted by H is as follows:
from qiskit.providers.aer import AerSimulator, QasmSimulator
from qiskit.algorithms import VQE
from qiskit.algorithms.optimizers import COBYLA
from qiskit.circuit.library import TwoLocal
from qiskit import *
from qiskit.opflow import OperatorBase
from qiskit.opflow import Z, X, I # Pauli Z, X matrices and identity
import pylab
import matplotlib.pyplot as plt
import numpy as np
H = 504.0 * I^I^I^I^I^I^I^Z+1008.0 * I^I^I^I^I^I^Z^I+2016.0 * I^I^I^I^I^Z^I^I+504.0 * I^I^I^I^Z^I^I^I+1143.7999999999997 * I^I^I^Z^I^I^I^I+2287.6 * I^I^Z^I^I^I^I^I+4575.200000000001 * I^Z^I^I^I^I^I^I+1143.7999999999997 * Z^I^I^I^I^I^I^I+98.0 * I^I^I^I^I^I^Z^Z+196.0 * I^I^I^I^I^Z^I^Z+392.0 * I^I^I^I^I^Z^Z^I+49.0 * I^I^I^I^Z^I^I^Z+98.0 * I^I^I^I^Z^I^Z^I+196.0 * I^I^I^I^Z^Z^I^I+93.1 * I^I^Z^Z^I^I^I^I+186.2 * I^Z^I^Z^I^I^I^I+372.4 * I^Z^Z^I^I^I^I^I+46.55 * Z^I^I^Z^I^I^I^I+93.1 * Z^I^Z^I^I^I^I^I+186.2 * Z^Z^I^I^I^I^I^I
backend = QasmSimulator()
optimizer = COBYLA(maxiter=2000)
ansatz = TwoLocal(num_qubits=8, rotation_blocks='ry', entanglement_blocks=None, entanglement='full', reps=1, skip_unentangled_qubits=False, skip_final_rotation_layer=False)
# set the algorithm
vqe = VQE(ansatz, optimizer, quantum_instance=backend)
#run it with the Hamiltonian we defined above
result = vqe.compute_minimum_eigenvalue(H)
This however yields the error:
'Circuit execution failed: ERROR: [Experiment 0] QasmSimulator: Insufficient memory for 141-qubit circuit using "statevector" method. You could try using the "matrix_product_state" or "extended_stabilizer" method instead.'
My questions are:
- How and why does my circuit yield 141 qubits when there are only 8 Pauli Operators in each term of my Hamiltonian? What am I missing conceptually?
- How do we calculate the number of qubits required when solving this sort of problem?
"
"['programming', 'qiskit', 'qudit']"," Title: Implementing quDit algorithms in Qiskit using quBitBody: How do you implement any $d$-dimensional qudit circuit in qiskit using qubits to simulate on an actual quantum computer?
"
"['mathematics', 'pauli-gates', 'stabilizer-code', 'clifford-group']"," Title: A question from Aaronson 2004 paperBody: In Aaronson's paper about the efficient simulation of a stabilizer circuit
(https://journals.aps.org/pra/pdf/10.1103/PhysRevA.70.052328),
I have a problem with finding the reason why the following statement holds.
Restating the statement in the end of the 4th page of the paper,
Let $\{R_{h+n}\}$ with $h=1...n$ are the Pauli stabilizer of a state $|{\psi}\rangle$.
If $Z_a$ commutes with all of $\{R_{h+n}\}$, then
$$\sum_{h=1}^n c_hR_{n+h} = \pm Z_a$$
for a unique choice of $c_1 \dots c_n \in {0,1}$.
But for $|\psi\rangle=|11\rangle$, we have stabilizers of ${II, ZZ}$ only, and its combination can make neither of single-qubit $Z$ gate.
If I have misunderstood, I will be very appreciative if you can correct it.
Thank you in advance.
"
"['quantum-gate', 'quantum-optics']"," Title: In (O'Brien et al. 2004), why is the target qubit not affected when the control is $\vert 0\rangle$?Body: I'm currently reading this paper https://arxiv.org/abs/quant-ph/0403062 but I fail to understand how the input of the control qubit affects the output of the target qubit. I do understand that when the logical value of the control qubit channel is $\vert 0\rangle$ the qubit in the channel of the target qubit is not affected. But I don't see how does the gate work when the control and target qubit have a logical value of $\vert 1\rangle$.
"
"['quantum-gate', 'quantum-control']"," Title: Does control and target matter in the CZ (Controlled-Z) Gate?Body: IBM Quantum Experience and other Algorithm Creators generally draw the CZ gates like this:
Does it not matter which qubit is the control and which is the target? If so why?
"
"['algorithm', 'error-correction', 'clifford-group']"," Title: Calculating symplectic dual of a codeBody: Stabilizer codes can be treated as symplectic codes over $\mathbb{F}_2$ (or over $\mathbb{F}_p$ when taking about q-dits). While treating error class, symplectic dual of the code plays a crucial part (Normlizer of the stabilizer if we wish to talk in group theoretic terms).
For classical hamming codes, given a code in either parity check form or generator matrix form, it is quiet easy to calculate corresponding forms for the dual.
Is there an efficient (preferably classical) algorithm to compute this for symplectic code?
"
"['hamiltonian-simulation', 'd-wave', 'annealing']"," Title: What do the numbers in the Ising sampleset mean?Body: I am trying to create a portfolio optimization with the DWave Quantum Computer. I wrote some code trying to somehow reconstruct the following Ising model paper:
Ai is the maximum amount of money that can be invested in the i-th asset.
B is the total budget.
Ri denote the random variable representing the return from asset i.
This is how I tried to code it:
import datetime
import pandas as pd
import fix_yahoo_finance as yf
import pandas_datareader.data as web
import numpy as np
import neal
import dimod
from dwave.system import DWaveSampler
import random
import hybrid
def cov(a,b):
return a.cov(b)
def hi(price, returns, cov):
#mean price
Ai = np.mean(price)
#mean expected return
E = np.mean(returns)
# hi = -(1/2)((1/3)*cov(Ri,Rj) + (1/3)Ai^2 - (1/3)E(Ri) - 2B(1/3)*Ai)
h = (-(1/2)*((1/3)*cov + (1/3)* (Ai ** 2) - (1/3)* E - 2*100*(1/3)*Ai))
return h
yf.pdr_override()
start = datetime.datetime(2018,1,3)
end = datetime.datetime(2021,1,1)
all_data = {ticker: web.get_data_yahoo(ticker,start,end)
for ticker in ['AAPL','IBM','MSFT','GOOGL']} #Note: GOOG has become GOOGL
price = pd.DataFrame({ticker:data['Adj Close']
for ticker,data in all_data.items()})
volume = pd.DataFrame({ticker:data['Volume']
for ticker,data in all_data.items()})
returns = price.pct_change() #calculate the percentage of the price
returns = returns.dropna()
print(returns.tail())
a = cov(returns['AAPL'], returns['IBM'])
b = cov(returns['IBM'], returns['MSFT'])
c = cov(returns['MSFT'], returns['GOOGL'])
d = cov(returns['GOOGL'], returns['AAPL'])
apple = hi(price['AAPL'],returns['AAPL'], a)
ibm = hi(price['IBM'],returns['IBM'], b)
microsoft = hi(price['MSFT'],returns['MSFT'], c)
google = hi(price['GOOGL'],returns['GOOGL'], d)
sampler = neal.SimulatedAnnealingSampler()
#qpu = DWaveSampler()
h = {apple: 0.0, ibm: 0.0, microsoft: 0.0, google: 0.0}
#energy changes when bias value changes
J = {(apple, ibm): 0.0, (ibm, microsoft): 0.0, (google, apple): 0.0, (apple, microsoft): 0.0, (ibm, google): 0.0}
sampleset = sampler.sample_ising(h, J, num_reads=10, annealing_time=2000)
print(sampleset)
And this is the output sampleset:
I was wondering what the numbers on top meant, so the -224463.77916595488 1414.5773363996423 etc. and if this is correct
"
"['quantum-circuit', 'gottesman-knill']"," Title: In quantum circuits, why does $UNU^\dagger$ act on states in the same way $N$ acts before the operation?Body: I understand that the Schrodinger picture changes the quantum states, while the Heisenberg picture changes the operators. In this paper The Heisenberg Representation of Quantum Computers, in equations 1,2, what does it mean that "so after the operation, the operator $UNU^\dagger$ acts on states in just the way the operator $N$ did before the operation"?
"
"['qiskit', 'quantum-circuit', 'qasm']"," Title: Is there a way to within a quantum circuit work out if a qubit is in a superposition or not?Body: Preferably using the gates found in QASM/Qiskit and the qubit stays in the superposition and no measurement is made, i.e. the output of if it is in a superposition or not is a binary answer in another qubit.
"
['ibm-q-experience']," Title: $T_1/T_2$ thermal relaxation exampleBody: The built in noise models in Qiskit have an example of $T_1/2T_2$ relaxation here. I have a couple of doubts; the notebook is not very clear in some of the steps.
Why does one need $T_2\leq 2T_1$? There's no reference on this, is it too obvious why it should be so? It is also defined time_u3 = 100 # (two X90 pulses), does this referes to the gate_length?
"
"['quantum-state', 'swap-test', 'inner-product']"," Title: How to calculate inner product of quantum states with other method than swap test?Body: In connection to this question, I am wondering how to calculate value $\langle \psi|\phi \rangle$ for arbitrary quantum states $|\psi\rangle$ and $|\phi\rangle$.
A swap test is able to return only $|\langle \psi|\phi \rangle|^2$ which means that sign of the product is forgotten in case the inner product is real. Moreover, information about real and imaginary parts is lost in case of complex result.
Do you know about any more general method how to calculate the inner product than swap test?
"
['ibm-q-experience']," Title: ""us"" units on relaxation times $T_j$ in the IBM backendsBody: A pretty lame question but, the backends relaxation times $T_1,T_2$ are given in us units. What are those? (Frequencies are given in GHz... Is it really $\mu s$ but IBM can't display the $\mu$ in the information chart?)
"
"['programming', 'algorithm', 'circuit-construction', 'quantum-circuit', 'transpile']"," Title: What are standard/most popular data formats to represent quantum circuits including hardware specifications?Body: On an abstract level one draws a circuit diagram with wires and gates. Different software frameworks like qiskit, circ etc. probably have different ways to represent these circuits.
My first question is if there is now a single standard (or highly compatible with others) format for representing "textbook" quantum circuits?
If we are to run the circuit on an actual hardware we need to get much more specific about the abstract circuit representation. We need to tailor it to the native gates of the hardware, qubit connectivity, physical properties (time to perform gates, error rates etc.). This is called transpilation.
The second question is if there is any standard extended format for quantum circuits that would take into account the hardware data. Or perhaps there is a clever way to separate device specification from the abstract description of a circuit?
"
['algorithm']," Title: Question about theorem 5 of the Quantum Counting, Brassard et al. paperBody: In this paper, when proving theorem 5, the authors let $f = \frac{P\theta}{\pi}$ and claim they "apply the Fourier transform on a sine (cosine) of period $f$". However, I just could not find where the sine of cosine is. It seems that the previously mentioned $\sin((2m+1)\theta)$ does not have a period $f$.
Furthermore, they later claim that when $f$ is an integer and $f > 0$, $|\Psi_3\rangle$ could be expressed as some $a|f\rangle + b|P-f\rangle$. Where does this come from? I just could not derive it according to the formula of Fourier transform. Any help would be really appreciated!
"
"['quantum-gate', 'nielsen-and-chuang', 'quantum-circuit', 'deutsch-jozsa-algorithm', 'quantum-parallelism']"," Title: Quantum parallelism and Deutsch's algorithm - what is $U_f$ really?Body: I'm trying to understand quantum parallelism ideas leading the Deutsch's algorithm. The circuit in question is
I understand that we end up with
$$|\psi_3 \rangle = \pm | f(0) \oplus f(1) \rangle \left[ \frac{|0 \rangle - |1 \rangle }{\sqrt{2} } \right].$$
Then by measuring the first qubit we can determine $f(0) \oplus f(1),$ and the claim is that we have thus determined a global property of $f(x),$ namely $f(0) \oplus f(1),$ using only one evaluation of $f(x)$.
I have three questions:
- Where does that single evaluation of $f(x)$ actually occur? Is it in the construction of $U_f$?
- What is $U_f$ in this case? I realize it depends on $f$, but how can we build it using at most one evaluation of $f$?
- In the circuit above, the $x$ input to $U_f$ is $(|0\rangle + |1 \rangle)/\sqrt{2})$. What does it mean to apply (classical) $f$ to this $x$?
I realize all 3 of these questions are probably tied up somehow.
"
"['textbook-and-exercises', 'quantum-fourier-transform']"," Title: What are the input and output of QFT and IQFT, respectively?Body: I have read two opposite explanations about QFT and IQFT from 2 books for beginners of Quantum Computing. Which one is correct?
The first book said, if we input an n-qubit non-superposition state into QFT, the QFT will output an n-qubit superposition state with periodical phases. On the other hand, IQFT swaps the input and output of QFT; we can apply IQFT to find the period hidden in an input state because the amplitude of the state, which matches the period(or frequency), will be amplified.
e.g., If we input |010〉into QFT, QFT will output a uniformly distributed superposition whose phases shifted two rotations(periods), the 1st rotation is from |000〉 to |011〉, and the 2nd one is from |100〉to |111〉. And if we input the output into IQFT, it will output |010〉.
The second book told me an opposite fact, that QFT allows us to determine how many rotations the relative phase makes per register, and we can use the IQFT to prepare periodically varying register superpositions easily.
e.g.
QFT allows us to determine that the frequency of repetition it contained was 2 (i.e., the relative phase makes two rotations per register)
We can use the invQFT to easily prepare periodically varying register superpositions
"
"['programming', 'qiskit', 'quantum-gate']"," Title: Decomposition of gate $R_{y}$ into specific basisBody: How can I decompose gate $R_{y}(\theta)$ into gate $R_{x}(\alpha)$ and gate $R_{z}(\beta)$. And how to perform it on Qiskit, is there any function to do it.
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: Why are the probabilities $|\alpha|^2$ and $|\beta|^2$ when measuring in the computational basis?Body: In measurement in the computational basis, I was being told that it is a way to extract information from a qubit, and it outputs a classical bit.
For the quantum state $\alpha |0\rangle + \beta |1\rangle$, the possible outputs are:
$0$, with probability $|\alpha|^2$ and
$1$, with probability $|\beta|^2$.
Why are the probabilities $|\alpha|^2$ and $|\beta|^2$? I assume this is related to the figure below? (where $\alpha$ being the possibilities for it to fall in the x-axis and $\beta$ for the y-axis?)
"
"['algorithm', 'resource-request', 'cryptography']"," Title: Paper references on how quantum algorithms have an impact on cryptography?Body: Could you please help me in finding some research paper references on the impact of Quantum algorithms on symmetric and asymmetric cryptography ?
Also, I request if I can get some references or notes demonstrating the impact on cryptography with particular algorithms as shown below:
- Bernstein–Vazirani algorithm
- Simon's algorithm
- Quantum phase estimation algorithm
- Shor's algorithm Hidden subgroup problem
- Grover's algorithm Quantum counting
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: Does the definition of separability of pure states require the components of the summands to be pure?Body: Does the definition of separability of pure states require the components of the summands to be pure? More precisely, let $\rho$ be a pure state (i.e., $\rho=|\phi\rangle\langle\phi|$) on the space $H_A\otimes H_B$. If it is possible to write $\rho=\sum_{i}p_i(\rho_A^{i}\otimes\rho_B^{i})$, then we say that $\rho$ is separable. I want to ask whether here we require that all $\rho_A^{i}$'s and $\rho_B^{i}$'s are themselves being pure. (Or maybe we can prove that whether they are pure or mixed does not matter?)
"
"['programming', 'qiskit', 'quantum-enhanced-machine-learning']"," Title: What is the kernel used in the IBM Qiskit's source code?Body: I want to redefine the QSVM code for a different kernel. But what is the kernel actually used in the IBM Qiskit's source code? And where is it defined, exactly. QSVM on Qiskit.
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang', 'deutsch-jozsa-algorithm']"," Title: In the Deutsch-Jozsa algorithm, why is the resulting amplitude for the constant and balanced cases $\pm 1$ and $0$, respectively?Body: I am currently learning from Nielsen and Chuang and I am currently learning about Deutsch-Jozsa algorithm. However, I am stumped with the mathematics of the algorithm at the following section:
I understand intuitively that it works very similarly with Deutsch algorithm where we could measure a global state of the function with only 1 measurement, but I couldn't do it mathematically. Why is the amplitude simply so without including the $x \cdot z$ factor? I am also having a hard time on the summation over $x$ on the amplitudes. Why is the resulting amplitude for the constant case is $\pm 1$ and 0 for the balanced case?
"
"['non-locality', 'nonclassicality', 'quantum-discord']"," Title: Why is the quantum discord of $\rho$ zero iff $\rho=\sum_j p_j \pi_j\otimes \rho_j$ for mutually orthogonal projections $\pi_j$?Body: In (Wiseman 2012), the author mentions (equation (4), page 6), that a state $\rho$ has zero quantum discord (more precisely, zero Alice-discord) if and only if it can be written in the form
$$\rho = \sum_j p_j \pi_j\otimes \rho_j,$$
for some probability distribution $p_j$, some collection of orthogonal projections $\{\pi_j\}_j$ on Alice's system, and some collection of states $\rho_j$ on Bob's system.
By "Alice-discord" I mean here the discord with respect to measurements performed by Alice (the first system). More precisely, the discord is defined here
$$\delta_A(\rho) =I(\rho) - \max_{\{\Pi^A_j\}} J_{\{\Pi^A_j\}}(\rho)
= S(\rho_A) - S(\rho) + \min_{\{\Pi^A_j\}} S(\rho_{B|\{\Pi^A_j\}}),$$
where $I$ and $J$ are the two classically equivalent forms of the mutual information, and the maximisation and minimisations are performed with respect to possible measurements performed by Alice.
The author mentions this as "well known" and does not provide a reference. Is there an easy way to see why this is the case? Alternatively, what is a reference discussing this fact?
"
"['mathematics', 'textbook-and-exercises', 'bloch-sphere']"," Title: Why is there no angle for the $z$ axis in the Bloch sphere?Body: I see that in Bloch spheres, there is an angle for the $x$ and $y$ axes but not for the $z$ axis. Why?
"
"['measurement', 'error-correction', 'quantum-circuit', 'stabilizer-code']"," Title: translating between measurement based and circuit based quantum computationBody: I think I understand circuit based QC (CBQC) well enough; I know very little about MBQC. From what I read it seems that they are somehow "equivalent". I'd like to check this with a concrete example from QECC. I can find circuits to encode/decode a stabilizer code; we can take the perfect $[[5,1,3]]$ code as an example https://www.cgranade.com/python-quaec/. How would I translate these circuits to MBQC counterparts?
"
['entanglement']," Title: How to describe the transformation induced by the CNOT on arbitrary input states?Body: Introductions to Quantum Computing treat the Control qubit of a CNOT as unchanged, and this is true for some Control values, eg |0⟩, |1⟩, and (at least when used with a Hadamard-transformed |1⟩ Target) a Hadamard-transformed |1⟩.
But some other Control values, including a Hadamard-transformed |0⟩, apparently lead to entangled final states, by definition changing the Control.
Where can I find a more complete explanation of CNOT final qubit states (unchanged/changed/entangled) and the related initial states ?
"
"['quantum-state', 'information-theory', 'fidelity', 'partial-trace', 'trace-distance']"," Title: Trace distance between mixed state and pure state vs trace distance between their purificationsBody: Let $\rho$ be a mixed state and $\vert\psi\rangle\langle\psi\vert$ be a pure state on some Hilbert space $H_A$ such that
$$\|\rho - \vert\psi\rangle\langle\psi\vert \|_1 \leq \varepsilon,$$
where $\|A\|_1 = \text{Tr}\sqrt{A^\dagger A}$. Does there exist a purification $\vert\phi\rangle\langle\phi\vert$ of $\rho$ and a (trivial) purification $\vert\psi\rangle\langle\psi\vert\otimes\vert 0\rangle\langle 0\vert$ living on Hilbert space $H_A\otimes H_B$ such that
$$\|\left(\vert\phi\rangle\langle\phi\vert - \vert\psi\rangle\langle\psi\vert\otimes\vert 0\rangle\langle 0\vert\right) \|_1 \leq \varepsilon? \tag{1}$$
I am aware that the fidelity between purifications can be bounded using Uhlmann's theorem. One can then use the Fuchs van de Graaf inequalities and come back to trace distance but the resulting bound in (1) goes as $\sqrt{\varepsilon}$. Can one do better and achieve (1)?
"
"['quantum-gate', 'gate-synthesis', 'vqe']"," Title: Reducing an ansatz to a shallower circuitBody: Given a very general hardware efficient ansatz as in Figure:
and say that you already know all the rotation parameter for the gates in the red box, is there any way to build a gate sequence that approximates the effect of those gates but requires fewer gates?
For example, imagine that just coincidentally you could have obtained a very similar same state vector to the one obtained in the sequence in the red box just by using a few $X$ and $CNOT$, then you could "compress" that gate sequence and have it easier to run.
However, I would imagine generally speaking a shallower representation is not always possible. Is there a computationally cheap and simple mathematical procedure that allows checking if that gate sequence can somewhat be represented by a smaller gate set?
Don't hesitate to ask for clarification in the comments if necessary
"
"['programming', 'qiskit']"," Title: How to map an arbitrary Fermionic operator to Spins (Qubits)?Body: There are several Tutorials from Qiskit demonstrating the use of PySCF driver. Usually, it takes as input the geometric structure of the molecule -> second quantised-operators -> JW or Parity mapping -> VQE.
However, I do not want to input a molecule but other Fermionic based operators, e.g. Fermi-Hubbard model. How do I do that?
"
['zx-calculus']," Title: ZX-Calculus: understand clifford+T/general ZX rulesBody: This paper that proves the completeness of the ZX-Calculus introduces different gates:
and
However, they seem very cryptic to me (except maybe the rule E). What is the intuition (what they mean, and how they where obtained) behind these rules? I guess some of them (maybe the last one) has something to do with trigonometry, but it's not really trivial when looking at them.
And is there a way to "decompose" them to remember/understand them easily? I can indeed see some structures that appear in several places (like a red node with one or two attached nodes with same angles), but it's still a bit hard for me to make sense of this…
"
"['algorithm', 'grovers-algorithm', 'superposition', 'oracles']"," Title: How can one evaluation of $U_f$ in Grover's algorithm use only one query of $f$?Body: I am very much new to quantum computation and do not have a background in quantum mechanics, which I believe is at the root of my confusion around Grover's algorithm.
Suppose that we have a search range of $N = 2^n$ elements and a black box function $f$ where for $N-1$ elements we have that $f(x) = 0$ and for one marked element, $x_0$, we have that $f(x_0) = 1$.
I understand that we take $n$-qubits initally in the $\left|0\right>^{\otimes n}$ state and the apply the Hadamard gate to put them in the $\left|+\right>^{\otimes n}$ state, an equal linear combination of all the possible bit-strings. Then we apply $U_f$ which essentially flips the phase of our marked element and leaves the rest alone, and thus can be written as
\begin{equation}
U_f = I - 2\left|x_0\right> \left<x_0\right|.
\end{equation}
However, I am confused at how one evaluation of $U_f$ on $\left|+\right>^{\otimes n}$ only requires one query of our black box $f$ for this to be quadratic speedup over classical algorithms. Is this due to the some quantum physical property of the "superposition?
"
"['programming', 'qiskit']"," Title: (solved(?)) Quantum circuit in a loop increasing qubit ids throughout despite attempts to resetBody: I have a parameterized circuit attempting to classify a set of features for various samples. I need to reencode the features per sample, but through the epochs, the computations slow down considerably and after some time, the code throws a mostly nonsensical error regarding the existance of a '1' state on the measured bit. I think the circuit is maintained between runs and that the qubits somehow keep getting added to the circuit. I'd like a clean circuit for each sample, but despite adding an explicit del statement to the circuit, the issue remains.
The code for creating the circle:
def modelCircuit(self, printC=False):#, backend='qasm_simulator', shots=1000):
"""
Set up and run the model with the predefined encoders and ansatzes for the circuit.
"""
self.quantum_register = qk.QuantumRegister(self.n_quantum)
self.classical_register = qk.ClassicalRegister(self.n_classic)
self.circuit = qk.QuantumCircuit(self.quantum_register, self.classical_register)
self.model()
job = qk.execute(self.circuit,
backend=qk.Aer.get_backend(self.backend),
shots=self.shots,
seed_simulator=self.seed
)
results = job.result().get_counts(self.circuit)
self.model_prediction = results['1'] / float(self.shots)
if printC:
print(self.circuit)
del(self.circuit)
return self.model_prediction
where the self.model() is among a set of implemented models. the current one is:
def basicModel(self):
"""
scaling with pi to avoid mapping 0 and 1 to the same rotation.
"""
for i, feature in enumerate(self.feature_vector):
#self.circuit.ry(np.pi*feature, self.quantum_register[i])
self.circuit.rx(np.pi*feature, self.quantum_register[i])
self.circuit.ry(self.theta[i], self.quantum_register[i])
for qubit in range(self.n_quantum - 1):
self.circuit.cx(self.quantum_register[qubit], self.quantum_register[qubit + 1])
self.circuit.ry(self.theta[-1], self.quantum_register[-1])
self.circuit.measure(self.quantum_register[-1], self.classical_register)
The output of the printed circuits are as follows. Note the increasing id's on the qubits.
┌─────────────┐ ┌────────────┐
q0_0: ┤ RX(0.93084) ├─┤ RY(3.8075) ├──■─────────────────────────────
└─┬──────────┬┘ ├────────────┤┌─┴─┐
q0_1: ──┤ RX(5π/8) ├──┤ RY(4.6079) ├┤ X ├──■────────────────────────
┌┴──────────┴┐┌┴────────────┤└───┘┌─┴─┐
q0_2: ─┤ RX(0.3065) ├┤ RY(0.87303) ├─────┤ X ├──■───────────────────
└┬──────────┬┘└┬────────────┤ └───┘┌─┴─┐┌────────────┐┌─┐
q0_3: ──┤ RX(π/17) ├──┤ RY(1.9646) ├──────────┤ X ├┤ RY(4.1605) ├┤M├
└──────────┘ └────────────┘ └───┘└────────────┘└╥┘
c0: 1/════════════════════════════════════════════════════════════╩═
0
0%| | 0/100 [00:00<?, ?it/s] ┌─────────────┐ ┌────────────┐
q7_0: ┤ RX(0.93084) ├─┤ RY(3.8075) ├──■─────────────────────────────
└─┬──────────┬┘ ├────────────┤┌─┴─┐
q7_1: ──┤ RX(5π/8) ├──┤ RY(4.6079) ├┤ X ├──■────────────────────────
┌┴──────────┴┐┌┴────────────┤└───┘┌─┴─┐
q7_2: ─┤ RX(0.3065) ├┤ RY(0.87303) ├─────┤ X ├──■───────────────────
└┬──────────┬┘└┬────────────┤ └───┘┌─┴─┐┌────────────┐┌─┐
q7_3: ──┤ RX(π/17) ├──┤ RY(1.9646) ├──────────┤ X ├┤ RY(4.1605) ├┤M├
└──────────┘ └────────────┘ └───┘└────────────┘└╥┘
c1: 1/════════════════════════════════════════════════════════════╩═
0
1%|█▎ | 1/100 [00:00<00:27, 3.58it/s] ┌──────────┐ ┌────────────┐
q140_0: ─┤ RX(2π/9) ├──┤ RY(3.8075) ├──■─────────────────────────────
┌┴──────────┤ ├────────────┤┌─┴─┐
q140_1: ┤ RX(5π/12) ├──┤ RY(4.6079) ├┤ X ├──■────────────────────────
├───────────┴┐┌┴────────────┤└───┘┌─┴─┐
q140_2: ┤ RX(0.3065) ├┤ RY(0.87303) ├─────┤ X ├──■───────────────────
└┬──────────┬┘└┬────────────┤ └───┘┌─┴─┐┌────────────┐┌─┐
q140_3: ─┤ RX(π/17) ├──┤ RY(1.9646) ├──────────┤ X ├┤ RY(4.1605) ├┤M├
└──────────┘ └────────────┘ └───┘└────────────┘└╥┘
c20: 1/═══════════════════════════════════════════════════════════╩═
0
2%|██▋ | 2/100 [00:00<00:27, 3.61it/s] ┌─────────────┐ ┌────────────┐
q273_0: ┤ RX(0.46542) ├─┤ RY(3.8075) ├──■─────────────────────────────
└─┬─────────┬─┘ ├────────────┤┌─┴─┐
q273_1: ──┤ RX(π/2) ├───┤ RY(4.6079) ├┤ X ├──■────────────────────────
┌─┴─────────┴─┐┌┴────────────┤└───┘┌─┴─┐
q273_2: ┤ RX(0.22987) ├┤ RY(0.87303) ├─────┤ X ├──■───────────────────
└─┬──────────┬┘└┬────────────┤ └───┘┌─┴─┐┌────────────┐┌─┐
q273_3: ──┤ RX(π/17) ├──┤ RY(1.9646) ├──────────┤ X ├┤ RY(4.1605) ├┤M├
└──────────┘ └────────────┘ └───┘└────────────┘└╥┘
c39: 1/════════════════════════════════════════════════════════════╩═
0
If anyone knows how I can just reset the circuit and keep the qubits to 4 through the simulations, I'd appreciate it.
Edit:
attempt at clarifying slow down. Some efforts to try and solve the issue as well as the error taking ~10 hrs to manifest makes finding the error difficult, but the rate of iterations starts at
4.84it/s at the first epoch, with abt. 100 iterations per epoch to
2.89s/it at the 20th. -> roughly 20s on the 1st epoch to ~300 seconds at the 20th, with more slowdown the further you go
the error persists between instantiation of the class as well, something noticed when reducing the number of epochs to run from 100 to 20 in order to try to get some data to work on.
Edit2:
We were in talks with TA's regarding the issue, and they suggested naming the registers when initializing them. This sped up the process somewhat.
The error thrown was likely a result of the job section, where the output relied on the ratio of '1' outcomes. adding an if test for this solved the error, though not the increase in computation time.
About an hour or so after the conversation, a partner found the code working fine on their windows laptop. mine is still slow on linux. I'll probably try to work out the issue through the week.
Edit3:
I've revised the code on my end with removing the registers when creating the circuit. The code starts out quite a bit faster, but the performance deteriorates still. the new functions:
def encoder(self):
"""
mapping features scaled to 1 onto bloch sphere.
scaling with pi to avoid mapping 0 and 1 to the same rotation.
"""
for i, feature in enumerate(self.feature_vector):
self.circuit.rx(np.pi*feature, i)
for qubit in range(self.n_quantum - 1):
self.circuit.cx(qubit, qubit + 1)
def ansatz(self, iteration=0):
"""
Rotating qubit states by parameters theta around bloch sphere
to adjust model for prediction of encoded features
"""
for i in range(self.n_quantum):
self.circuit.ry(self.theta[iteration*self.n_quantum +i], i)
for qubit in range(self.n_quantum - 1):
self.circuit.cx(qubit, qubit + 1)
def measure(self):
"""
measuring the final qubit after applying the final model
parameter as a bias
"""
self.circuit.ry(self.theta[-1], -1)
self.circuit.measure(-1, 0)
def basicModel(self):
self.encoder()
self.ansatz()
self.measure()
for creating the model. the basicModel function is set as self.model during the initialization. Next comes
def modelCircuit(self, printC=False):#, backend='qasm_simulator', shots=1000):
"""
Set up and run the model with the predefined encoders and ansatzes for the circuit.
"""
self.circuit = qk.QuantumCircuit(self.n_quantum, self.n_classic)
self.model()
job = qk.execute(self.circuit,
backend=qk.Aer.get_backend(self.backend),
shots=self.shots,
seed_simulator=self.seed
)
results = job.result().get_counts(self.circuit)
counts = 0
for key, value in results.items():
if key=='1':
counts += value
self.model_prediction = counts / float(self.shots)
return self.model_prediction
the modelCircuit is called int the train function
def train(self, target, epochs=100, learning_rate=.1, debug=False):
"""
Uses the initial quess for an ansatz for the model to train and optimise the model ansatz for
the given cost/loss function.
"""
from tqdm import tqdm
mean_loss = np.zeros(epochs)
accuracy = np.zeros_like(mean_loss)
for epoch in range(epochs):
# setup of storage arrays
thetaShift = np.zeros([self.n_samples,len(self.theta)])
loss = np.ones(self.n_samples)
lossDerivative = np.zeros_like(loss)
acc = 0
for sample in tqdm(range(self.n_samples)):
#self.feature_vector = self.featureMatrix.iloc[sample]
self.feature_vector = self.featureMatrix[sample, :]
out = self.modelCircuit()
acc += np.round(out)==target[sample]
loss[sample] = self.lossFunction(out, target[sample])
lossDerivative[sample] = self.lossDerivative(out, target[sample])
theta_gradient = np.zeros_like(self.theta)
for i in range(self.n_model_parameters):
self.theta[i] += np.pi / 2
out_1 = self.modelCircuit()
self.theta[i] -= np.pi
out_2 = self.modelCircuit()
self.theta[i] += np.pi / 2
theta_gradient[i] = (out_1 - out_2) / 2
if debug:
print(f'output 1: {out_1}')
print(f'output 2: {out_2}')
#thetaShift[sample, i] = - learning_rate * theta_gradient * np.mean(lossDerivative) # theta gradient for vairable shift.
thetaShift[sample, i] = theta_gradient[i]
accuracy[epoch] = float(acc)/self.n_samples
mean_loss[epoch] = np.mean(loss)
self.theta -= learning_rate * np.mean((thetaShift * lossDerivative.reshape(-1,1)), axis=0)
print("mean loss per epoch: ", mean_loss[epoch])
print("accuracy per epoch: ", accuracy[epoch])
return self.theta, mean_loss, accuracy
printouts for the base model to terminal:
┌─────────────┐ ┌────────────┐
q_0: ┤ RX(0.93084) ├──■──┤ RY(2.3533) ├────────────────────■──────────────────────────────────
└─┬──────────┬┘┌─┴─┐└────────────┘┌────────────┐ ┌─┴─┐
q_1: ──┤ RX(5π/8) ├─┤ X ├──────■───────┤ RY(5.9735) ├────┤ X ├───────■────────────────────────
┌┴──────────┴┐└───┘ ┌─┴─┐ └────────────┘┌───┴───┴────┐┌─┴─┐
q_2: ─┤ RX(0.3065) ├─────────┤ X ├───────────■───────┤ RY(4.5993) ├┤ X ├──■───────────────────
└┬──────────┬┘ └───┘ ┌─┴─┐ ├────────────┤└───┘┌─┴─┐┌────────────┐┌─┐
q_3: ──┤ RX(π/17) ├────────────────────────┤ X ├─────┤ RY(3.7615) ├─────┤ X ├┤ RY(3.7769) ├┤M├
└──────────┘ └───┘ └────────────┘ └───┘└────────────┘└╥┘
c: 1/═══════════════════════════════════════════════════════════════════════════════════════╩═
0
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:13<00:00, 7.28it/s]
mean loss per epoch: 0.6493203309690068
accuracy per epoch: 0.78
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:27<00:00, 3.59it/s]
mean loss per epoch: 0.6415613508592234
accuracy per epoch: 0.8
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:42<00:00, 2.38it/s]
mean loss per epoch: 0.6337758611894215
accuracy per epoch: 0.8
over a few epochs. more directly, the iterations per second are
7.28it/s 3.59it/s 2.38it/s
Edit 4:
I tested yesterday with the results as above. Today I wanted to check for memory leaks with the suggested tracemalloc.
The program runs fine now. I don't know what happened, but I did do a system update and follow the recomendation bellow in regards to removing the registers. I made no further changes than those in the example above. The issue seems fixed, but I don't know why.
"
"['programming', 'ibm-q-experience', 'simulation']"," Title: How can I specify the qubits on quantum computers that I want to use?Body: Suppose I have the following 2-qubit quantum circuit:
qrz = QuantumRegister(2,'q')
crz = ClassicalRegister(3,'c')
qc = QuantumCircuit(qrz,crz)
qc.rx(np.pi/3,0)
qc.cry(np.pi/2,0,1)
I want to run this circuit on a real quantum computer, depending on the real-time error rate, I might want to use different qubits on the hardware. For example, suppose here's the calibration data of my backend:
Is there a way I can specify that I want to use qubit 4 and 5 on this quantum computer? I tried to generate a quantum circuit with 6 qubits and append my quantum circuit to qubit 4 and 5, then run the entire circuit on that quantum computer. Is there a simpler way I can do that without generating another large circuit? Thanks!
"
"['programming', 'qiskit', 'quantum-gate', 'superconducting-quantum-computing', 'openpulse']"," Title: How does the pulse.Shiftphase instruction in Qiskit Pulse work?Body: I have some questions regarding the mechanism of Qiskit pulse.ShiftPhase instruction:
- Does it work like a Phase Shift $P(\theta)=\begin{bmatrix} 1 & 0 \\0 & e^{i\theta}
\end{bmatrix}$ gate, a Global Phase Shift $Ph(\theta)=\begin{bmatrix} e^{i\theta} & 0 \\0 & e^{i\theta}
\end{bmatrix}$ gate, or a $R_z(\theta)=\begin{bmatrix} e^{-i\theta/2} & 0 \\0 & e^{i\theta/2}
\end{bmatrix}$ gate?
- I read that when I apply a
ShiftPhase it'd affect all the pulses following, meaning everytime I apply a pulse there will be a phase shift gate right? So if I only want to apply only one RZ/PS/Global PS gate should I apply a reversal phase shift after a pulse, or would that equivalently mean I have applied a PS/GPS/RZ($ -\theta$) gate?
- How is the free Z rotation tracked by software in the case of a qutrit (3 energy levels) or more, and how does
ShiftPhase work in this case?
Many thanks!
"
"['quantum-state', 'entanglement', 'w-state']"," Title: Entanglement distribution of W-State over different locationsBody: I would like to create a quantum system with the gates for a W state where each qubit is at a different location. Entanglement distribution has been proven in several research articles. I'm new to this space and interested:
- if three qubits W-state can be implemented where each qubit has a different location?
- if in this case, measuring q1 will fix the measurement of q2 and q3 (if one is 1 the others are 0) and only one measurement of the distributed qubits will be possible?
- if this would also be possible for n qubits W-state over n locations?
"
"['quantum-state', 'entanglement']"," Title: Quantum based lottery using W-State and spatial separationBody: I'm thinking of a use case of building a quantum based lottery. Using a W-state with spatial separation (see this question) the circuit is build at one location and afterwards the n qubits are distributed to n locations. Once one qubit is measured the winner (qubit with value 1) should be fixed. At each location it can be measured independently if the qubit at this location is the winner.
Questions:
- Are my considerations correct?
- How far are we from such feasibility?
- What does it need at each location?
"
"['programming', 'qiskit', 'ibm-q-experience', 'error-correction', 'phase-estimation']"," Title: QPE Circuit test on Quantum Computer ('ibmq_16_melbourne')Body: After several atempts, I cannot mitigate the error when running the code on a NISQ, via the qiskit library (more specifically on the 'ibmq_16_melbourne').
I've already mapped the connected qubits and simplified my circuit to the basic gates accepted by the backend.
The code is as it follows:
from qiskit import *
from qiskit.circuit.library.standard_gates import HGate
from qiskit.circuit.library import QFT, WeightedAdder
from qiskit.visualization import plot_histogram
def qft_dagger(qc, n):
"""n-qubit QFTdagger the first n qubits in circ"""
# Don't forget the Swaps!
for qubit in range(n//2):
qc.swap(qubit, n-qubit-1)
for j in range(n):
for m in range(j):
qc.cp(-math.pi/float(2**(j-m)), m, j)
qc.h(j)
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')
#backend = Aer.get_backend('qasm_simulator')
shots = 8192
#INFO CIRC
nCountingQ = 3
w = 3.8
#LISTS
tempo = []
eigenvalues = []
allCircs = []
#DEF TEMPO
t0 = 0
tmax = 2
nrInvervalos = 70
deltaT = tmax/nrInvervalos
t = t0
qr = QuantumRegister(4,'qr')
cr = ClassicalRegister(3,'cr')
#CICLO
while t<tmax:
circ = QuantumCircuit(qr,cr)
theta = 2*w*t
#HADAMARD
for i in range(nCountingQ):
circ.h(i)
#UNITARY
repetitions = 1
for counting_qubit in range(nCountingQ):
for i in range(repetitions):
circ.rz(theta/2,nCountingQ)
circ.cx(counting_qubit,nCountingQ)
circ.rz(-theta/2,nCountingQ)
circ.cx(counting_qubit,nCountingQ)
repetitions *= 2
#QFT
qft_dagger(circ,nCountingQ)
#MEASUREMENT
for i in range(nCountingQ):
circ.measure(i,i)
#ATUALIZAR TEMPOS
tempo.append(t)
t+=deltaT
#ADICIONAR CIRC A TODOS
allCircs.append(circ)
And I execute the code with the following command:
job = execute(allCircs, backend = backend, shots = shots, initial_layout={qr[0]:4, qr[1]:9, qr[2]:11, qr[3]:10})
Finally, I process the data with a weighted average:
answer = job.result().get_counts()
#MEDIA PESADA
for x in answer:
#print(x)
numerador = 0
denominador = 0
for key,value in x.items():
key = int(key,2)
numerador += (key/2**nCountingQ)*value
denominador += value
media_pesada = numerador/denominador
eigenvalues.append(media_pesada)
The results I should've be obtaining are:
But what I'm consistently obtaining is (extremely random):
Unfortunaly, I couldn't find the correct information to help me mitigate this specific errors
Thank you for your time!
"
"['measurement', 'quantum-operation', 'information-theory']"," Title: Does the von Neumann entropy equal the smallest accessible Shannon entropy?Body: I've been reading about the von Neumann entropy of a state, as defined via $S(\rho)=-\operatorname{tr}(\rho\ln \rho)$. This equals the Shannon entropy of the probability distribution corresponding to the basis of eigenvectors of $\rho$.
Given a POVM measurement $\{\Pi_j\}$, this maps a state $\rho$ into a vector of probabilities $p_j^\Pi=\operatorname{tr}(\Pi_j \rho)$, and we can associate a Shannon entropy $H(p^\Pi)$ to any such probability distribution $p^\Pi$.
Is it always the case that $H(p^\Pi) \ge S(\rho)$? Or more precisely, can we say that, for any state $\rho$, the von Neumann entropy $S(\rho)$ equals the minimal Shannon entropy, minimized over the set of possible measurements performed on $\rho$?
This is clear for pure states, as for those we have $S(\rho)=0$, but I'm not sure how to see it in the general case. I'm not even sure this is actually true, as for a maximally mixed state I think this would mean that the Shannon entropy is equal regardless of the measurement basis. Maybe it holds if the minimization is restricted to measurements with a number of components equal to the dimension of the state?
"
"['quantum-gate', 'classical-computing']"," Title: Are circuits with more than 1000 gates common?Body: I have seen circuits with 30 qubits and around 500 gates. Also circuits with 32 qubits and 6000 gates. Are circuits with more than 1000 gates common in quantum computing? Are there many quantum algorithms that require more than 1000 gates? How common are they?
"
"['qiskit', 'programming', 'ibm-q-experience', 'quantum-circuit', 'error-mitigation']"," Title: Apply readout error mitigation to mid-circuit measurementBody: I'm trying to construct a quantum circuit with 3 mid-circuit measurements, here's an example:
qrz = QuantumRegister(2,'q')
crz = ClassicalRegister(3,'c')
qc = QuantumCircuit(qrz,crz)
for i in range (3):
qc.append(qc1(...),[0,1]). # qc1 is some circuit segment.
qc.measure(1,i)
qc.barrier()
qc = transpile(qc,backend=backend,optimization_level=2,initial_layout = [0,1])
I'm wondering if I could perform the readout error mitigation in this case. Here's what I'm trying to do:
import matplotlib.pyplot as plt
qlist = [1] # Suppose we want to perform the mid-circuit measurement on this qubit.
cal_circuits, state_labels = complete_meas_cal(qubit_list= qlist,circlabel='mcal')
print(len(cal_circuits))
cal_job = execute(cal_circuits,
backend = backend,
shots = 1024,
optimization_level = 0
)
cal_results = cal_job.result()
meas_fitter = CompleteMeasFitter(cal_results, state_labels) # Generate the complete fitter.
fig, ax = plt.subplots(figsize=(10, 10))
meas_fitter.plot_calibration(ax)
meas_filter = meas_fitter.filter
Is there a way I can apply the filter to the qubit that I measured 3 times? Thanks for the help:)
"
"['error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: Degenerate vs non-degenerate errorsBody: One of the key features of quantum error correction that makes it different from classical error correction. When code is non-degenerate, an error $E$ takes codewords to different words. codewords.
Formally, for all basis vectors $c_i$, we get $\langle c_i, E c_i \rangle=0$.
This behavior is much more closer to classical error correction. Does this make decoding(/detecting) of non-degenerate codes easier since there is a very well developed classical machinery in many cases?
The traditionally way to detect or correct errors (at least for stabilizer codes) is getting syndrome by looking at commuting relations and then do syndrome decoding. The second step of syndrome decoding resembles closely to classical counterpart.
Does that make degenerate error intrinsically harder to detect, or to put it other way, easier for non-degenerate errors?
The motivation for this question is trying to understand can there be a reason where one prefers non-degenerate codes over degenerate codes.
"
"['entanglement', 'partial-trace']"," Title: Does the entangibility of density operators rely on what component spaces are being specified?Body: Is the entangibility of density operators relied on what component spaces are being specified?
More precisely, let $H$ be a Hilbert space, $\rho$ be a density operator on $H$. Suppose we were not given any information about $H$. i.e., it is possible that $H=H_A\otimes H_B$, or $H=H_C\otimes H_D$, and perhaps that $\dim H_A\neq\dim H_C$ and $\dim H_B\neq\dim H_D$. If $\rho$ is, say being entangled with respect to $H_A$ and $H_B$, is $\rho$ also necessarily entangled with respect to $H_C$ and $H_D$?
"
"['quantum-gate', 'unitarity', 'quantum-circuit', 'universal-gates']"," Title: Are SU($n$) operations enough for quantum computation?Body: Usually we want a quantum computer that can perform all foreseeable unitary operations U($n$).
A quantum processor that can naturally perform at least 2 rotation operators $R_k(\theta)=\exp(-i\theta\sigma_k/2)$, where $\sigma_k$ are the Pauli matrices; can generate any SU(2) rotation of the Bloch sphere. And the usual Pauli operations (up to a global phase) can be generated by just choosing the right angle $R_k(-\pi)=i\sigma_k$. By creating some controlled-$i\sigma_x$, I guess we could generate all SU($n$). Would a quantum processor restricted to SU($n$) operations limit the power to simulate quantum systems and other algorithms of interest?
Edit: note that controlled-SU(2) gates are still in SU(4).
"
['textbook-and-exercises']," Title: How to prove that tensor products of two pure density operators is again pureBody: I came up with an intuitive guess that tensor product $\phi\otimes\psi$ of two pure states $\phi,~\psi$ (which are density operators) is again pure. However, I tried to use basic linear algebra and proved nothing. Should I use Schmidt composition? Or is there an easier way to prove it?
"
"['resource-request', 'vqe', 'optimization', 'qaoa', 'annealing']"," Title: Quantum annealing - studies showing empirical evidence for better performance in comparison with classical computersBody: Currently, it is not known wheter quantum anneling or algorithms like VQE and QAOA for general purpose quantum computers bring about any increase in computational power. However, there are some studies indicating that in some cases quantum annealing (and VQE and QAOA) shows better performance than simulated annealing and similar heuristics for QUBO on classical computer. To name some of these studies:
Could anybody please provide me with links to some other studies (no matter what kind of task being solved) concerning performace of quantum annealing (or QAOA and VQE algorithms)?
"
"['qiskit', 'programming']"," Title: Qiskit: Get approximate execution timeBody: The IBMQ web interface shows both queue position and an approximate execution time for every pending job (see image below). Is there a way to retrieve this information via Qiskit? I know that qiskit.providers.ibmq.job.IBMQJob has a queue_position() method, but what about the approximate execution time?
Thanks in advance!
"
['quantum-state']," Title: Is the composite state necessarily mixed when there are all but exactly one mixed state?Body: Let $\rho_A$ be a mixed state (density operator). If we wish, we can purify it and get a $\rho_{AB}$ that is pure on some composite Hilbert space $H_{AB}$. And by the question I just ask, How to prove that tensor products of two pure density operators is again pure, we know that tensor product of pure states is again pure. Observing the results above, I just come up with a natural question: how about tensor product of all but exactly one mixed states? Is such composite state necessarily mixed? (I'm not a English speaker, which might have used a weird grammar; to be clear, I mean $\otimes_{i\in I} \rho_i$ is mixed whenever $\exists !~i\in I,~\rho_i$ is mixed) If we cannot make any conclusion, how about composite of all but exactly one pure state?
"
"['quantum-gate', 'quantum-state', 'entanglement', 'universal-gates']"," Title: Entanglement properties of $SU(8)$ quantum circuits vs nearest-neighbor $SU(4)$ quantum circuitsBody: For this question, fix three qubits $q_1, q_2, q_3$. I'll use the notation $U_{123} \in SU(8)$ to denote an arbitrary quantum circuit/unitary on the three qubits, and $U_{12}, U_{23} \in SU(4)$ to denote arbitrary circuits/unitaries on nearest-neighbour qubits $q_1,q_2$ and $q_2, q_3$ respectively. Let $|\psi\rangle = U_{23}U_{12}|000\rangle$.
In $|\psi\rangle$, it is possible for qubits $q_1$ and $q_3$ to be entangled with each other (for example, the GHZ state $1/\sqrt{2}(|000\rangle + |111\rangle)$ can be constructed using a circuit of the form $U_{23}U_{12}$ acting on $|000\rangle$). However, there are no entangling gates that act directly on qubits $q_1$ and $q_3$ in the circuit that defines $|\psi\rangle$. In other words, entanglement between $q_1$ and $q_3$ can only be created by "passing the entanglement through $q_2$". My question is: does this create some restriction on the entanglement between $q_1$ and $q_3$ that can be characterized mathematically?
Something that might be relevant is, I think it is true is that $SU(8)$ unitaries can be approximated by nearest-neighbour $SU(4)$ unitaries, if I allow for arbitrarily many of them:
$$ U_{123} = \prod_{i=1}^{K}U_{23}^i U_{12}^i.$$
(the $i$'s are indices, not exponents) This is a consequence of the fact that $\text{CNOT}$ gates plus rotations are computationally universal, together with the fact that the $\text{SWAP}$ circuits are in $SU(4)$, meaning that I can swap qubits $1,2,3$ around and create arbitary circuits using nearest-neighbour circuits with swapped qubits. But what is unique about the $K=1$ case is that you lose the ability to swap qubits $1,2$ or $2,3$, because the restriction in the definition of the circuit implies that you cannot swap them back.
There is a related question on whether entanglement is transitive, but my question is different because here, I am entangling qubits $q_2$ and $q_3$ after qubits $q_1$ and $q_2$ are already entangled. In that question the only assumption that is made is that $q_1, q_2$ and $q_2, q_3$ are entangled, and there they are asking the opposite question of whether it is necessary that $q_1$ and $q_3$ are entangled.
"
"['quantum-state', 'textbook-and-exercises', 'superposition']"," Title: What is the Schmidt decomposition for the 00 + 01 state?Body: If I try to write the two-qubit state $$ |\psi \rangle = \frac{|0 \rangle |0 \rangle + |0 \rangle |1 \rangle}{\sqrt{2}}$$ as $$ |\psi \rangle = \lambda_0 |\phi_0 \rangle |\phi_0 \rangle + \lambda_1 |\phi_1 \rangle |\phi_1 \rangle $$ for states $|\phi_0 \rangle = a |0 \rangle + b |1 \rangle$ and $|\phi_1 \rangle = c |0 \rangle + d |1 \rangle$, and real constants $\lambda_0$ and $\lambda_1$, I arrive at some contradiction that the quantity $\lambda_0 a b + \lambda_1 c d$ must equal both $1/\sqrt{2}$ and $0$, which makes me think a Schmidt decomposition for this state doesn't exist. However, the Schmidt decomposition theorem states that it can be done for any pure state $|\psi \rangle$ of a composite system.
I must have misunderstood what the Schmidt decomposition actually is or I am doing things the wrong way, I would appreciate it if someone could enlighten me on this.
"
"['nielsen-and-chuang', 'fidelity']"," Title: How to prove generalized Uhlmann's theorem?Body: I think the Uhlmann theorem should be in general of this form:
Let $\rho$ and $\sigma$ be density operators acting on $A$, with Schmidt degrees at most $r$, and let $B$ be another Hilbert space with dimension at least $r$, so that $\rho, \sigma$ can both be purified over $B$.
Let $\left|\psi_{\rho}\right\rangle, \left|\psi_{\sigma}\right\rangle$ denote arbitrary purifications of them over $A \otimes B$, then
$$
F(\rho, \sigma)=\max _{\left|\psi_{\rho}\right\rangle, \left|\psi_{\sigma}\right\rangle}\left|\left\langle\psi_{\rho} \mid \psi_{\sigma}\right\rangle\right|^{2}
$$
Therefore, in general, the fidelity is the maximum overlap between
purifications.
In all the proofs I found (such as the one in Nielson and Chuang), the Uhlmann theorem is proved only for the case where $A\simeq B$. How to prove this general case?
Edit: In Fidelity for Mixed Quantum States (Richard Jozsa, 1993), Uhlmann theorem is proved in this general case (as can be seen from Definition 1 and Theorem 2). However, I find the proof dubious, and would like another reference on this.
"
"['shors-algorithm', 'quantum-fourier-transform']"," Title: In Shor's algorithm, how is ${\rm QFT}_n|x\rangle$ split into its even and odd components?Body: I am auditing a course on quantum computing. Since this is not paid, I dont have any staff support to ask questions. Therefore I am asking the stackoverflow community to help me with it. This is regarding QFT for Shor's algorithm.
The instructor created the following equation to transform integer into binary. The term $y_0$ is 0 when the integer is even and it is 1 when the integer is odd.
$$y \equiv (y_{n-1}, y_{n-2}, \dots,y_1, y_0) \equiv 2y' + y_0.$$
Below is QFT equation, which I understand.
$$QFT_n |x\rangle = \frac{1}{\sqrt{2^n}} \sum_{y \in \mathbb{Z}_{2^n}} \omega^{xy}|y\rangle.$$
Then he said that he is breaking the equation into two parts. The left term is even and the right term is odd.
$$= \frac{1}{\sqrt{2^n}} \bigg[ \sum_{y' \in \mathbb{Z}_{2^{n-1}}} \omega^{2xy'}|y'0\rangle + \sum_{y' \in \mathbb{Z}_{2^{n-1}}} \omega^{x(2y'+ 1)}|y'1\rangle \bigg].$$
I would appreciate if someone can clarify the following:
- How did we get $\mathbb{Z}_{2^{n-1}}$?
- How did the term $2y' + y_0$ become $|y'0\rangle$?
"
['bloch-sphere']," Title: What does the notation $|+\rangle,|−\rangle,|±i \rangle$ mean in Bloch sphere?Body: The axis in a a 2D diagram like the following, usually represent 2 quantities. Eg in pic below, $x$ represents time and $y$ represents velocity
What gets measured along each axis of a Bloch sphere? In other words what do the different axis of Bloch sphere represent? I read that $z$ is $|0⟩$ or $|1⟩$ (spin), $x$ is $|+⟩$ or $|-⟩$ and $y$ is $|i⟩$ or $|-i⟩$. But what do they mean?
"
"['algorithm', 'mathematics', 'grovers-algorithm', 'foundations']"," Title: How to compute the eigenvector of this complex matrix in Grover's algorithm?Body: We know that SO(3) matrix stands for the proper rotation in 3D space. But when I read this paper, there is a SO(3) matrix stands for the general query matrix of Grover's algorithm in SO(3) form:
$$
\left(\begin{array}{ccc}
R_{11} & R_{12} & R_{13} \\
R_{21} & R_{22} & R_{23} \\
R_{31} & R_{32} & R_{33}
\end{array}\right),
$$
where $$R_{11}=\cos \phi\left(\cos ^{2} 2 \beta \cos \theta+\sin ^{2} 2 \beta\right)+\cos 2 \beta \sin \theta \sin \phi\\R_{12}=\cos 2 \beta \cos \phi \sin \theta-
\cos \theta \sin \phi\\R_{13}=-\cos \phi \sin 4 \beta \sin ^{2} \frac{\theta}{2}+\sin 2 \beta \sin \theta \sin \phi\\R_{21}=-\cos (2 \beta) \cos \phi \sin \theta+
\left(\cos ^{2} \frac{\theta}{2}-\cos 4 \beta \sin ^{2} \frac{\theta}{2}\right) \sin \phi\\R_{22}=\cos \theta \cos \phi+\cos 2 \beta \sin \theta \sin \phi\\ R_{23}=-\cos \phi \sin 2 \beta \sin \theta-
\sin 4 \beta \sin ^{2} \frac{\theta}{2} \sin \phi\\R_{31}=-\sin 4 \beta \sin ^{2} \frac{\theta}{2}\\R_{32}=\sin 2 \beta \sin \theta\\R_{33}=\cos ^{2} 2 \beta+\cos \theta \sin ^{2} 2 \beta.$$
The paper says that the eigenvector of this matrix is $\mathbf{l}=\left(\cot \frac{\phi}{2},1,-\cot 2 \beta \cot \frac{\phi}{2}+\cot \frac{\theta}{2} \csc 2 \beta\right)^{T}$.
I know this question is very basic and I've tried to use Matlab to calculate it. But I just can't figure out how can the author got the eigenvector of such a simple form? Can it be manually calculated? Is there a better way to compute the eigenvector of this kind of parameterized matrix?
"
"['quantum-state', 'partial-trace']"," Title: Permutation invariant states have permutation invariant purifications - proof?Body: I don't remember where I came across the statement but I'm pretty sure it is true and am interested in understanding why it holds. For any $n-$ register state $\rho^n \in H^{\otimes n}$ that is permutation invariant, there exists a purification that is also permutation invariant.
That is, if
$$\pi \rho^n = \rho^n$$
for any permutation $\pi$ among the $n$ registers, then there exists a purification $\vert\Psi^n\rangle\langle\Psi^n\vert \in (H\otimes H)^{\otimes n}$ of $\rho^n$ such that
$$(\pi\otimes \pi)\vert\Psi^n\rangle\langle\Psi^n\vert = \vert\Psi^n\rangle\langle\Psi^n\vert$$
for any permutation $\pi$. How does one see that this is true?
"
"['quantum-gate', 'circuit-construction']"," Title: Can I freely rearrange the controlled-shift gates in this 3-qubit circuit?Body: Consider a fixed set of gates of the kind $\land_n(P_{\varphi})$. With $P_{\varphi}$ being a relative phase shift gate by $\varphi$.
Can I assert that any permutation of that set is equivalent?
Example:
Can I rearrange this circuit at my liking and always get the same evolution?
"
"['programming', 'ibm-q-experience', 'ibm']"," Title: How do I send a quantum circuit to IBM for execution?Body: I have, let's say, the following quantum circuit:
The QASM code of this quantum scheme has the following form:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[5];
reset q[0];
reset q[1];
reset q[2];
reset q[3];
reset q[4];
x q[0];
x q[1];
x q[2];
x q[3];
x q[4];
measure q[0] -> c[0];
measure q[1] -> c[1];
measure q[2] -> c[2];
measure q[3] -> c[3];
measure q[4] -> c[4];
I want to send the QASM code to IBM and get the result. In our case, I want to get [1, 1, 1, 1, 1].
I don't understand which endpoints I should send my requests to (probably POST requests) and what I should pass in the message body (in the JSON object).
I was able to execute a GET request to log in and get my access token (access ID). But I don't know what to do next.
There is no complete documentation for the API. Here is what is available now.
In what form I would like to see the answer (here I show how to log in and get an access token):
First step: get an access token.
HTTP request method: POST
Endpoint: https://api.quantum-computing.ibm.com/v2/users/loginWithToken
JSON request: {
"apiToken": "YOUR_API_TOKEN"
}
JSON response: {
"id": "YOUR_ACCESS_ID_TOKEN",
"ttl": "YOUR_ACCESS_ID_TOKEN_LIFETIME",
"created": "YOUR_ACCESS_ID_TOKEN_CREATIONDATE",
"userId": "YOUR_USER_ID"
}
Second step: I can't figure out which requests to send next to execute my QASM code and get the result [1, 1, 1, 1, 1].
"
"['measurement', 'nielsen-and-chuang']"," Title: Measurement interpretation - do individual operators get applied?Body: The description of measurement operators in Nielsen and Chuang is as follows:
Quantum measurements are described by a collection $\{M_m\}$ of
measurement operators. These are operators acting on the state space
of the system being measured. The index $m$ refers to the measurement
outcomes that may occur in the experiment. If the state of the quantum
system is $|\psi \rangle$ immediately before the measurement then the
probability that result $m$ occurs is $$p(m) = \langle \psi |
M_m^{\dagger} M_m |\psi \rangle,$$ and the state of the system after
the measurement is $$\frac{M_m | \psi \rangle }{ \sqrt{\langle \psi |
M_m^{\dagger} M_m |\psi \rangle} }.$$
In order to make a measurement, I'm confused as to whether an individual operator $M_m$ is applied, or if the whole set $\{M_m\}$ is somehow applied.
This confusion stems from: Suppose we have $|\psi \rangle = \frac{1}{\sqrt{2}}|0 \rangle + \frac{1}{\sqrt{2}}|1 \rangle$ and measurement operators $\{M_0 = |0 \rangle \langle 0 |,M_1 = |1 \rangle \langle 1 |\}$. If I can choose to apply $M_0$, then I get outcome 0 with probability $p(0) = 1/2$ and the state after measurement is $\frac{M_0 |\psi\rangle}{1/\sqrt{2}} = |0 \rangle.$ So I don't know how to reconcile the fact that there is only a 1/2 chance of getting outcome 0, yet the system is in a pure state $|0\rangle$ afterwards. Does it somehow make sense that $M_0$ gives me outcome 1 yet leaves the system in state $|0\rangle$, or do I need to somehow imagine that the entire set $\{M_0, M_1\}$ gets applied? Or is there some other interpretation?
It's also possible that I am confusing the measurement outcomes $0,1$ with the basis states $|0 \rangle, |1 \rangle$?
"
"['measurement', 'quantum-operation', 'tensor-product']"," Title: For a bipartite operator $M\in L(H_{AB})$, suppose $0\leq M\leq \mathbb{I}$. Prove $M^{AB}\leq M^A\otimes \mathbb{I}$Body: As stated in the title, let $M$ be a linear operator on a finite bipartite Hilbert space. Suppose $0\leq M^{AB}\leq \mathbb{I}$ and $0\leq M^A,M^B\leq\mathbb{I}$, where $M^A=\mathrm{Tr}_B\left(M^{AB}\right)$ and $M^B=\mathrm{Tr}_A\left(M^{AB}\right)$. Is it always true that
$$ M^{AB} \leq M^A\otimes \mathbb{I}_B? $$
It trivially holds for product operators, that is $M^{AB} = M^A\otimes M^B$, but the general statement is not clear to me.
Any help is appreciated.
"
"['measurement', 'bell-basis']"," Title: Measure a state in Hadamard basisBody: I can't understand how a state measure on the Hadmard basis collapses to $$ |+\rangle =\dfrac{|0\rangle+|1\rangle}{\sqrt{2}} $$ or $$ |-\rangle =\dfrac{|0\rangle-|1\rangle}{\sqrt{2}} $$
as they dont see to be deterministic outputs as $ |0\rangle $ or $ |1\rangle $.
"
"['quantum-state', 'machine-learning', 'embedding']"," Title: Normalize and encode real data in a way that encode collinear vectors with different valuesBody: Now, I am working on a quantum supervised learning problem and I have a problem with amplitude encoding.
Before being encoded, a vector $(a_1, a_2,\dots,a_n)$ must be normalized in such a way that $\sum_i |a_i|^2 = 1$
Thereby, the two following vectors would be encoded in the same way :
$(1, 2, 3, 4)$ and $(2, 4, 6, 8)$ normalized as $(0.18, 0.36, 0.54, 0.73)$ :
$0.18\lvert 00\rangle + 0.36\lvert 01\rangle + 0.54\lvert 10\rangle + 0.73\lvert 11\rangle$.
But in the case of a classification/regression problem I could have a different target for this two vectors and my circuit would not be able to treat them differently.
Is there a way to normalize/encode vectors differently to keep a difference between colinear vectors ?
[Edit :] the final goal is to make a regression model based on a variational circuit as explained on this website but for a different problem :
http://docs.qulacs.org/en/latest/apply/5.2_qcl.html
"
"['qiskit', 'ibm-q-experience', 'error-mitigation']"," Title: Guide for Qiskit's Measurement Error Mitigation?Body: I'm reading about error correction mainly in the Qiskit Measurement error mitigation chapter contains what it seems and easy way to "clean up" the noise obtained in the IBM (or NISQ) devices. One thing that I feel is missing is what is the logic behind the method?
The example in the ebook is clear, but I would like to know what it is that way. I started looking in the literature and found, as expected, different approaches to do so. What is (or resembles most) the method presented in Qiskit? Can someone provide literature?
"
"['quantum-state', 'information-theory', 'unitarity', 'optimization', 'trace-distance']"," Title: Minmax theorem for optimization over isometries and statesBody: I have the following minmax problem and I am wondering if the order of the minimum and maximum can be interchanged and if yes, why?
Let $\|\cdot\|_1$ be the trace norm defined as $\|\rho\|_1 = \text{Tr}(\sqrt{\rho^\dagger \rho})$. This gives us a distance measure between quantum states i.e. $\|\rho - \sigma\|_1$. Consider Hilbert spaces $A,B,E$ and $R$.
The optimization problem I have is
$$\max\limits_{\phi_{AR}} \min_{V_{E\rightarrow E}}\|(I_A\otimes V_{E\rightarrow E})(U_{A\rightarrow BE}\otimes I_R)\phi_{AR} - (U'_{A\rightarrow BE}\otimes I_R)\phi_{AR} \|_1$$
where $U_{A\rightarrow BE}, U'_{A\rightarrow BE}, V_{E\rightarrow E}$ are all isometries and $\phi_{AR}$ is a pure state. So my optimization is over the set of isometries and pure states neither of which is a convex set. However, note that the optimizations involved are on different Hilbert spaces.
Is it true or false that
$$\max\limits_{\phi_{AR}} \min_{V_{E\rightarrow E}}\|(I_A\otimes V_{E\rightarrow E})(U_{A\rightarrow BE}\otimes I_R)\phi_{AR} - (U'_{A\rightarrow BE}\otimes I_R)\phi_{AR} \|_1 = \min_{V_{E\rightarrow E}}\max\limits_{\phi_{AR}} \|(I_A\otimes V_{E\rightarrow E})(U_{A\rightarrow BE}\otimes I_R)\phi_{AR} - (U'_{A\rightarrow BE}\otimes I_R)\phi_{AR} \|_1$$
and if true, what is the justification? I am aware that I can always upper bound the LHS with the RHS using the maxmin inequality.
"
['error-correction']," Title: Stabilizer codes: why is $N(S)/S$ homomorphic to the Pauli group on $k$ qubitsBody: Given an abelian subgroup $S$ of the Pauli group on $n$ qubits with $r$ independent generators we obtain an $2^{n-r}$-dimensional subspace stabilized by $S$. By picking a basis for this space, it is easy to build a representation of the Pauli group on $k$ qubits generated by some set of matrices $\overline{X_i}, \overline{Z_i}$. However, I fail to see how to do so in a way that ensures that $\overline{X_i}, \overline{Z_i}$ are Pauli matrices in the original basis. The common way to build these logicals is to consider the quotient $\mathcal{N}(S)/S$, and note that it corresponds to the Pauli group on $k$ qubits, but I cannot quite prove it.
"
"['algorithm', 'phase-estimation', 'amplitude-amplification']"," Title: What is the difference between amplitude amplification, amplitude estimation, and phase estimation?Body: I'm confused about the difference among Amplitude amplification (AA) , phase estimation (PE), and Amplitude Estimation.
I thought I understood AA and PE somewhat but when I heard the amplitude estimation and the circuit looked so similar to phase estimation.
I think I missed something here. Sorry, still new to the field.
"
"['quantum-gate', 'textbook-and-exercises', 'notation']"," Title: Can Dirac notation be used with 2 or more gates?Body: Can Dirac notation be used with 2 or more gates?
I've been trying to do the math with the $X$ and $Z$ ($X\otimes Z$) gates but I'm not getting the answer I should. In fact, the answer makes no sense.
I'm new, so I'm trying to understand whether or not this notation will work mathematically when combining gates.
It works out fine when using matrix math, so I'm wondering if something like this is a limitation of Dirac notation.
"
['google-sycamore']," Title: What determines the repetition rate in Google's Weber datasheet?Body: The second page of the datasheet of Google's Weber system mentions a repetition rate. How is this repetition rate calculated?
https://quantumai.google/hardware/datasheet/weber.pdf
I understand that repetition rate refers to how fast an experiment can be repeated (number of shots per second). I know that to reduce SPAM errors, one way of repeating an experiment is to wait for the T1 decay to ensure that the qubit is reset to |0> before starting the next shot. Other methods like restless measurements can also be used for increasing the repetition rate. My question, more precisely, is whether Sycamore relies on the T1 decay for repeating shots or uses some other technique.
Also, I don't understand how the number of shots affects the repetition rate. The Weber datasheet shows that the typical repetition rate for 2K repetitions is 0.3KHz while it's 2.1KHz for 20K repetitions.
Thanks!
"
"['programming', 'qiskit']"," Title: Superposition of a subset of integersBody: I am trying to do the superposition of a subset of integers using qiskit. For instance: $|13\rangle + |14\rangle + ... |N\rangle$ (uniform superposition) without the part $|0\rangle + |1\rangle + ... + |12\rangle$. Is it possible? How can I proceed?
"
"['measurement', 'information-theory', 'entropy', 'nonclassicality']"," Title: How is the additivity of accessible information, $\frac{1}{n} I_{\rm acc}(\rho^{\otimes n})=I_{\rm acc}(\rho)$, proved?Body: Let $\rho^{XA}$ be a classical-quantum state of the form
$$ \rho^{XA} = \sum_{x\in X} p_x |x\rangle\langle x|\otimes \rho_x^A, $$
and let the accessible information be given by
$$ I_{acc}(\rho^{XA}) = \sup_M I(X:Y), $$
where $M = \{M_y\}$ is a POVM and $Y$ is a random (classical) variable with joint probability distriubtion $\Pr(X = x, Y = y) = \operatorname{Tr} M_y p_x\rho_x$.
I have seen it referenced in papers (e.g. Uncertainty, Monogamy and Locking of Quantum Correlation, Proposition 6) that the accessible information is additive, that is
$$ \frac{1}{n}I_{acc}(\rho^{\otimes n}) = I_{acc}(\rho), $$
however, they reference a russian paper by Holevo (A. S. Holevo. Information theoretical aspects of quantum measurements.), and from what I gather (I don't speak/read russian) he in fact shows
$$ I_{acc}(\rho^{XA}) \leq I(X:A)_\rho. $$
Is additivity actually easy to see from this result, or am I missing something entirely?
I would appreciate any help.
"
"['error-correction', 'nielsen-and-chuang', 'stabilizer-code']"," Title: Construction of arbitrary Normalizer Gates using H, S and CNOT GatesBody: This question is in reference to Exercise 10.40 of Nielsen and Chuang's textbook, which is an attempt to prove the theorem that any $n$ qubit Normalizer gate can be built out of $H$, $S$, and $CNOT$ gates. For reference, a normalizer gate is any gate $U$ such that $UVU^\dagger \in G_n$ whenever $V \in G_n$. Here, $G_n$ is the $n^{th}$ order Pauli Group. The problem attempts to prove this theorem in three steps using mathematical induction.
- First, we prove that any single qubit normalizer can be built using $H$ and $S$ gates.
- Second, we are given an $n + 1$ qubit Normalizer $U$ that satisfies the conditions $UZ_1U^\dagger = X_1 \otimes g$ and $UX_1U^\dagger = Z_1 \otimes g'$ for some $g, g' \in G_n$. We are given a circuit (shown below) that implements $U$ in terms of controlled $g, g'$, a Hadamard $H$ and an $n$ qubit unitary $U'$ defined by $U'|\psi\rangle = \langle0|U(|0\rangle \otimes |\psi\rangle)$. We are asked to show by induction that the circuit uses $O(n^2)$ $H$, $S$, and $CNOT$ gates to build $U$.
- Third, we use the above results to prove that any $n$ qubit Normalizer gate can be built out of $H$, $S$, and $CNOT$ gates.
Now, part 1 is easily done, once you realize that single-qubit normalizers are essentially $90^o$ rotations on the Bloch sphere which are generated by $\sqrt{X}$ and $\sqrt{Z}$ and hence by $H$ and $S$.
For part 2, there are several things to show. First, if $g$ is a single qubit operator in $G_1$, then it is easily implemented using around 5 $H$ or $S$ and a single CNOT. For $g \in G_n$, we need $O(n)$ such gates. Now, if an inductive proof is in play, we will recursively break down $U'$ using a similar circuit so the total number of gates is
$$O(n) + O(n - 1) + \dots + O(1) = O(n^2)$$
There are a few other things to do before part 2 is done though. First, we need to show that $U'|\psi\rangle = \langle0|U(|0\rangle \otimes |\psi\rangle)$ defines a unitary operator. This is done in this question. Next, we need to show that the shown circuit really does implement $U$. This is also easy to do using the same procedure as outlined in the same question (and a little bit of tedious math).
However, showing this requires the use of the two conditions $UZ_1U^\dagger = X_1 \otimes g$ and $UX_1U^\dagger = Z_1 \otimes g'$, so to complete the induction, we need to show that $U'$ satisfies similar conditions. Also, it is easy to see that these two conditions are not true for a general Normalizer $U$ (consider the $SWAP$ gate for which $UZ_1U^\dagger = Z_2$ and $UX_1U^\dagger = X_2$), which is a problem for proving part 3.
So, summarizing, here are my questions:
- Is it necessarily true that $U'$ as defined above satisfies the two conditions $UZ_1U^\dagger = X_1 \otimes g$ and $UX_1U^\dagger = Z_1 \otimes g'$? If so, how? If not, how do we complete the inductive proof?
- What if $U$ in general does not satisfy these conditions? How do we generalize this for an arbitrary $n + 1$ qubit normalizer $U$?
"
"['algorithm', 'quantum-fourier-transform', 'hadamard']"," Title: What is the relation between Hadamard transformation and QFT?Body: I am new to the field and I can't help having a feeling that Hadamard and Fourier Transform are somehow related, but it is not clear to me how.
Any explanation on how these two are related would be appreciated.
"
"['measurement', 'physical-realization', 'photonics', 'optical-quantum-computing']"," Title: What are the most popular QND measurement implementations used in photonic quantum computers?Body: What components are used in order to perform QND measurement in photonic quantum computers?
"
"['textbook-and-exercises', 'grovers-algorithm', 'nielsen-and-chuang', 'amplitude-amplification']"," Title: In the amplitude amplification algorithm in Nielsen and Chuang's book, why is the error probability $M/N$?Body:
I was able to follow til the yellow-highlighted sentences, which seems to be important to understand. Why M/N is the probability of error? If so 1 - M/N would be the probability of success?
"
"['entanglement', 'measurement']"," Title: How do local quantum gates affect an entangled state?Body: (1)
Assume we have the Bell State $$ \frac{\lvert 0_{A}0_{B}\rangle + \lvert 1_{A}1_{B}\rangle}{\sqrt{2}} $$
where A and B stand for Alice and Bob.
Now say Bob applies the X gate to his qubit.
I think we get $$ (I\otimes X) \frac{\lvert 0_{A}0_{B}\rangle + \lvert 1_{A}1_{B}\rangle}{\sqrt{2}} = \frac{\lvert 0_{A}1_{B}\rangle + \lvert 1_{A}0_{B}\rangle}{\sqrt{2}} $$
I would have thought that after being entangled, they would always be correlated to measuring the same value but it seems now they will always measure opposite values. Is this right?
(2)
What about $$ (I\otimes H) \frac{\lvert 0_{A}0_{B}\rangle + \lvert 1_{A}1_{B}\rangle}{\sqrt{2}} = \frac{\lvert 0_{A}+_{B}\rangle + \lvert 1_{A}-_{B}\rangle}{\sqrt{2}} = \frac{\frac{1}{\sqrt{2}}\left[\lvert 0_{A}0_{B}\rangle + \lvert 0_{A}1_{B}\rangle\right] + \frac{1}{\sqrt{2}}\left[\lvert 1_{A}0_{B}\rangle - \lvert 1_{A}1_{B}\rangle\right]}{\sqrt{2}} = \frac{1}{2}\left[\lvert 0_{A}0_{B}\rangle + \lvert 0_{A}1_{B}\rangle\right] + \frac{1}{2}\left[\lvert 1_{A}0_{B}\rangle - \lvert 1_{A}1_{B}\rangle\right] $$
It seems like the Hadamard Gate just messed up entanglement.
"
['mathematics']," Title: What is a projection operation and how does it work?Body: I am reading about the Quantum Pigeon Hole Principle and having trouble understanding how the states are measured. Specifically from this paper. From equation (4) through equation (7).
"
"['entanglement', 'werner-states']"," Title: How do I represent a Werner state in ket notation?Body: I want to represent Werner state in the form of ket vector notation. Is there a way in which I can represent it in vector form?
"
"['quantum-gate', 'algorithm', 'qaoa']"," Title: Is the cost Hamiltonian unitary in QAOA?Body: I am trying to implement QAOA and there are things I don't understand at all.
The expansion of $H$ into Pauli $Z$ operators can be obtained from the canonical expansion of the cost-function $C$ by substituting for every binary variable $x_i ∈ {0,1}$ the operator $x_i \rightarrow (1−Z_i)/2$. (according to Qiskit tutorial).
But this operator looks like $[[1, 0], [0, 0]]$ which is not unitary.
I am optimizing a complicated QUBO function and the mapped Hamiltonian does not to seem unitary either.
How do I apply $H$ to $|\beta, \gamma\rangle$ to get $\langle\beta, \gamma| H |\beta, \gamma\rangle$?
"
"['quantum-state', 'superposition']"," Title: How does superposition apply to quantum computing?Body: beginner here. I've always heard explanations on quantum computing, all about superposition, entanglement, etc.
But how does superposition actually apply to quantum computing? Yeah, its "in between" a 1 and a 0 but why does this matter? How do quantum computers actually use this feature, and why is it so important?
"
"['quantum-state', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Regrouping the terms in expression 1.31 in Quantum Computing and Quantum Information, Nielsen and ChuangBody: I'm trying to reproduce the passage from expression 1.31 to 1.32 in the book Quantum Computing and Quantum Information, by Michael Nielsen and Isaac Chuang.
Expression 1.31 is:
$$|\psi_2\rangle = \frac{1}{2}\left[
\alpha(|0\rangle+|1\rangle)(|00\rangle+|11\rangle)+\beta(|0\rangle-|1\rangle)(|10\rangle+|01\rangle)
\right].$$
It is said in QCQI that by regrouping the terms you can reach expression 1.32:
$$|\psi_2\rangle = \frac{1}{2}\left[
|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)
\right].$$
I have been trying for hours all kinds of algebraic tricks to go from 1.31 to 1.32 without success. By the way, it seems to me impossible to do so, since there is no term with $+\beta|1\rangle$ in expression 1.31.
Does anyone have any suggestion on how to make this happen?
"
"['mathematics', 'topological-quantum-computing', 'anyons']"," Title: Can you make anyons in 3 dimensions using rings?Body: I heard that anyons can only be made in 2 dimensions because when you visualize the spacetime diagram of a 2-dimensional system with point particles, you can get braids, but if you do the same with a 3-dimensional system, you get only the un-braid since all braids can be unbraided in 4 dimensions.
But we can make braided surfaces in 4-dimensions by moving around rings in 3 dimensions! So does that mean we get 3 dimensional anyons if there are rings that behave like point-particle anyons?
I tried googling the keywords, but got no answers. I did find a video talking about braided surfaces using rings (Braids in Higher Dimensions - Numberphile).
"
"['quantum-state', 'partial-trace', 'correlations']"," Title: If the partial traces $\rho_A,\rho_B$ are pure, does it imply that $\rho$ is a product state?Body: Suppose $\rho$ is some bipartite state such that the partial traces $\rho_A={\rm Tr}_B\rho$ and $\rho_B={\rm Tr}_A\rho$ are both pure. Does this necessarily imply that $\rho$ is a product state?
This seems intuitively obvious, as the partial states being pure means that no information is lost neglecting the correlations between the states, but I can't come up with an easy way to show it formally.
"
"['programming', 'qiskit', 'quantum-state']"," Title: quantum label classification using qiskitBody: I am generating points for classification. Some will be above the main diagonal, while others will be below (blue or red).
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score
import random
m, b = 1, 0
lower, upper = -40, 40
num_points = 80
x1 = [random.randrange(start=-40, stop=40) for i in range(num_points)]
x2 = [random.randrange(start=-40, stop=40) for i in range(num_points)]
y1 = [random.randrange(start=lower, stop=m*x+b) for x in x1]
y2 = [random.randrange(start=m*x+b, stop=upper) for x in x2]
plt.plot(np.arange(-40,40), m*np.arange(-40,40)+b)
plt.scatter(x1, y1, c='red')
plt.scatter(x2, y2, c='blue')
plt.show()
x1, x2, y1, y2 = np.array(x1).reshape(-1,1), np.array(x2).reshape(-1,1), np.array(y1).reshape(-1,1), np.array(y2).reshape(-1,1)
x_upper = np.concatenate((x2, y2), axis=1)
x_lower = np.concatenate((x1, y1), axis=1)
X = np.concatenate((x_upper, x_lower), axis=0)
res1 = np.array([-1]*len(x1))
res2 = np.array([1]*len(x2))
y = np.concatenate((res1, res2), axis=0)
Next, I split the data into a training and test dataset.
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30)
The next step is to apply the quantum classification algorithm to all test points, in which I calculate the value for the first qubit. With respect to this result, I label the test points. I get the following:
import qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import Aer
from qiskit import execute
import numpy as np
%matplotlib inline
backend_sim = Aer.get_backend('qasm_simulator')
def quant_state(x1, x2, backend_sim = backend_sim):
x1 = x1
x2 = x2
r = x1 * x1 + x2 * x2
a = np.sqrt(1 + 2*r)
psi = [0, 0, 0.5, 0, 0, -0.5, 0, 0, 1/(np.sqrt(2)*a), 0, x1/(np.sqrt(2)*a), x2/(np.sqrt(2)*a), x1/(np.sqrt(2)*a), x2/(np.sqrt(2)*a), 0, 0]
qc = QuantumCircuit(4)
qc.initialize(psi, [0,1,2,3])
qc.h(0)
qc.measure_all()
job_sim = execute(qc, backend_sim, shots=1000)
result_sim = job_sim.result()
counts = result_sim.get_counts(qc)
quantumState_1 = 0
for i in counts.keys():
list_i = list(i)
if list_i[len(list_i) - 1] == '1':
quantumState_1 += counts[i]
return quantumState_1
quant_res = []
for i,j in zip(X_test[:, 0], X_test[:, 1]):
qs = quant_state(i, j, backend_sim = backend_sim)
if qs >= 500:
quant_res.append(1)
else:
quant_res.append(-1)
def get_color(y,zn):
colors = []
for i in range(len(y)):
if y[i] == zn:
colors.append('red')
else:
colors.append('blue')
return(colors)
quantColors = get_color(quant_res, 1)
plt.scatter(X_train[:, 0], X_train[:, 1], c = colors)
plt.scatter(X_test[:, 0], X_test[:, 1], c = quantColors, marker = "x")
plt.plot(np.arange(-40,40), m*np.arange(-40,40)+b)
plt.show()
In the end I get this result:
from sklearn.metrics import f1_score
f1_score(y_test, quant_res)
0.2162162162162162
where the crosses are predicted results.
Can someone explain, why this classification is working wrong?
"
"['error-correction', 'stabilizer-state', 'cluster-states']"," Title: What is the effect of measuring a node in a cluster state?Body: I'm still quite confused about the post-measurement state when a node of a cluster state is measured.
As far as I'm aware, for a cluster state, a given node $j$ will have a stabilizer
$$X_j\bigotimes_{k\in N_j}Z_k$$
for the set of nodes $N_j$ around $j$.
I don't understand the post-measurement state of one of these nodes. Say this $j$-th node is measured, the node will disappear from the cluster, but what will the remaining cluster state look like and what will the stabilizers be for each remaining node?
An explanation or a link to an explanation would be wonderful.
"
"['programming', 'qiskit', 'vqe', 'chemistry']"," Title: Use one_body_integrals to know which orbitals to freeze in ElectronicStructureProblemBody: In exercise 5 of the this year's IBM Quantum Challenge, you need to use the FreezeCoreTransformer (along two_qubit_reduction and z2symmetry_reduction) to reduce the number of qubits to 4 and achieve a cost of 3. I managed to figure out that the optimal array to pass to the remove_orbitals parameter was [3,4]; however, I did this by experimenting with different arrays.
In the Qiskit slack, I saw that the one body integrals of the QMolecule are supposed to give you an insight on which orbitals to freeze. However, they didn't explain how to use it to figure this out.
The molecule and one body integrals I am working with is the following.
molecule = 'Li 0.0 0.0 0.0; H 0.0 0.0 1.5474'
driver = PySCFDriver(atom=molecule)
qmolecule = driver.run()
Matrix(np.round(qmolecule.one_body_integrals, 10))
$$
\displaystyle \left[\begin{array}{cccccccccccc}-4.7385372413 & 0.1075391382 & 0.1675852953 & 0.0 & 0.0 & -0.0302628413 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.1075391382 & -1.5131757719 & 0.0343466943 & 0.0 & 0.0 & -0.0680291694 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.1675852953 & 0.0343466943 & -1.1291622926 & 0.0 & 0.0 & 0.031432226 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & -1.1407709359 & 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.1407709359 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\-0.0302628413 & -0.0680291694 & 0.031432226 & 0.0 & 0.0 & -0.9418187042 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -4.7385372413 & 0.1075391382 & 0.1675852953 & 0.0 & 0.0 & -0.0302628413\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.1075391382 & -1.5131757719 & 0.0343466943 & 0.0 & 0.0 & -0.0680291694\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.1675852953 & 0.0343466943 & -1.1291622926 & 0.0 & 0.0 & 0.031432226\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -1.1407709359 & 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.1407709359 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -0.0302628413 & -0.0680291694 & 0.031432226 & 0.0 & 0.0 & -0.9418187042\end{array}\right]
$$
How am I supposed to interpret this matrix to know which orbitals to freeze?
"
"['qiskit', 'amplitude-amplification', 'quantum-computing-for-finance']"," Title: How to load time-series stock data into quantum amplitude estimationBody: Now I got some time-series data as showing example below:
I have spent a period of time realizing the QAE from qiskit, and I found that the tutorial used uncertainty model to reproduce data, while I want it to become my time-series data.
So here's the main question, how should I do to transform it?
Can anyone helps me, please?
"
"['entanglement', 'information-theory', 'entropy', 'state-distillation']"," Title: Why does the entanglement entropy give the number of singlets required to create a given state?Body: I've read that, given a bipartite pure state $|\Phi\rangle$, its entanglement (equivalently here, von Neumann) entropy $E(\Phi)$ gives the asymptotic number of singlets required to create $n$ copies of $|\Phi\rangle$. More specifically, that for all $\epsilon>0$ there is a large enough $n$ such that, given $m$ copies of a singlet state $|\Phi^-\rangle$, Alice and Bob can produce $n$ copies of $|\Phi\rangle$ with $m/n\le (1+\epsilon)E(\Phi)$.
I think this roughly means that $E(\Phi)$ is the number of singlets required to generate each copy of $|\Phi\rangle$.
This is mentioned in this paper by Wooters: http://www.rintonpress.com/journals/qic-1-1/eof2.pdf, around equation 3.
To back up this statement, they cite this paper by Bennett and collaborators. I know that the above statement is shown in this paper, but I was wondering if there was a way to briefly sketch the reasoning, or more generally a way to understand the intuition behind it. More recent takes on this result would also be welcome, if there is any.
"
"['grovers-algorithm', 'vqe', 'qaoa']"," Title: How does the performance of QAOA and VQE compare to Grover's?Body: I believe finding the optimal solution is guaranteed for Grover's Algorithm along with quadratic speed-up according to Nielsen and Chuang's book.
I wonder if there is any statement regarding QAOA and VQE for the performance such as success probability or/and speed aspect.
"
"['programming', 'qiskit', 'gate-synthesis', 'compiling', 'transpile']"," Title: Transpilation into custom gate set in qiskitBody: In qiskit, I can transpile a given circuit into a some predefined gate set as follows (just an example)
from qiskit import QuantumCircuit
from qiskit.compiler import transpile
from qiskit.circuit.random import random_circuit
basis_gates = ['id', 'u3', 'cx']
qc = random_circuit(3, 1, seed=0)
qc_trans = transpile(qc, basis_gates=basis_gates)
I have several related questions.
- Where can I find an exhaustive list of operators allowed as
basis_gates?
- For any operator label from the list of allowed basis gates, how can I find the precise meaning of the corresponding gate, say as a matrix representation?
- Most importantly, can I add my own custom gates to use as basis gates? Can I add parametric gates? For examples as far as I can tell
qiskit standard tools include Rxz and Ryz gates but no Rxy gate. Can I make one?
Example of a (trivial) transpilation into custom gate set failing
from qiskit import QuantumCircuit
from qiskit.compiler import transpile
qc = QuantumCircuit(2, name='mycx')
qc.cx(0, 1)
mycx = qc.to_gate()
qc = QuantumCircuit(2)
qc.cx(0, 1)
transpile(qc, basis_gates=['id','mycx'])
gives me a TranspileError.
"
['boson-sampling']," Title: Is the pfaffian for gaussian fermions what the hafnian is for gaussian bosons?Body: In some recent papers, e.g. Phys. Rev. Lett. 119, 170501, the problem of gaussian boson sampling is shown to be related to the hafnian of a certain matrix. When applied to the adjacency matrix of a graph, the hafnian gives the number of perfect mathings in that graph.
On the other hand, for some oriented graphs the number of perfect matchings is given by the pfaffian of the antisymmetric adjacency matrix.
Question: Is the pfaffian related to "fermion sampling"?
"
['machine-learning']," Title: Prove the parameter shift rule in case of generator is Pauli matrixBody: I'm studying the parameter shift rule and got stuck when doing an example with Pauli operators in https://arxiv.org/abs/1803.00745.
With $f=e^{-i\mu\frac{\sigma_i}{2}}$, $\partial_\mu f=\frac{(-i\sigma_i)}{2}f=(-\frac{1}{2}if)\sigma_i$ (1).
Because $\frac{1}{2}\sigma_i$ has eigenvalues $\pm\frac{1}{2}$, so $r=1/2$ and $s=\frac{\pi}{4r}=\frac{\pi}{2}$.
$\rightarrow\partial_\mu f=\frac{1}{2}(f(\mu+\frac{\pi}{2})-f(\mu-\frac{\pi}{2}))$
$
=\frac{1}{2}(e^{-i(\mu+\frac{\pi}{2})\frac{\sigma_i}{2}}-e^{-i(\mu-\frac{\pi}{2})\frac{\sigma_i}{2}})
$
$
=\frac{1}{2}(e^{-i(\frac{\pi}{4}\sigma_i)}-e^{i(\frac{\pi}{4}\sigma_i)}) f(\mu)
$
$
=-\frac{1}{2}i(2\sin(\frac{\pi}{4}\sigma_i)) f(\mu)=-\frac{1}{2}i(\frac{2}{\sqrt{2}}\sigma_i) f(\mu)
$ (2)
The results from (1) and (2) seem to not be the same, I don't know what points I missed.
Thanks for reading!
"
"['quantum-gate', 'unitarity']"," Title: How to construct an $n\times n$ unitary matrix taking an arbitrary $|\psi\rangle$ to a target state $|\phi\rangle$?Body: I came across Lecture 12 here https://viterbi-web.usc.edu/~tbrun/Course/ that does this but I was not able to understand. An example would be very helpful
"
"['continuous-variable', 'quantum-optics', 'gaussian-states']"," Title: Why is a state Gaussian if and only if its covariance matrix satisfies $\boldsymbol\sigma+i\boldsymbol\Omega\ge0$?Body: Let $\rho$ be a Gaussian state, described by the $2N\times 2N$ covariance matrix $\newcommand{\bs}[1]{{\boldsymbol{#1}}}\bs\sigma$. Denote with $\bs\Omega$ the $N$-mode symplectic form associated with the space:
$$\bs\Omega\equiv \bigoplus_{k=1}^N\bs\omega, \qquad \bs\omega\equiv \begin{pmatrix}0&1\\-1&0\end{pmatrix}.$$
It is then the case that $\bs\sigma+i\bs\Omega\ge0$.
Moreover, a matrix $\bs\sigma$ is the covariance matrix of some state if and only if this condition is satisfied.
This is mentioned often in this context, for example in (Weedbrook et al. 2011), eq. 17 in page 6, or in (Adesso et al. 2014), eq. (29) in page 11. In both cases, they cite Simon and collaborators (1987 and 1994) for this result.
These papers seem however quite dense in content, and use a formalism I'm not familiar with.
Is there a simple way to see where this result comes from? A relevant modern review or similar resource proving this result would also be welcome.
"
"['qiskit', 'quantum-circuit', 'quantum-enhanced-machine-learning', 'embedding']"," Title: Quantum circuit for the ZZ feature mapBody: Havlicek et al. propose a feature map for embedding $n$-dimensional classical data on $n$ qubits: $U_{\phi(x)}H^{\otimes n}$, where
$$
U_{\phi(x)} = \exp (i \sum_{S \subseteq [n]} \phi_S(x) \prod_{i \in S} Z_i) \\
\phi_i(x) = x_i, \; \phi_{\{i, j\}}(x) = (\pi - x_0)(\pi - x_1)
$$
and $Z_i$ is a $Z$-gate on the $i$-th qubit.
I'm currently considering the 2-dimensional, 2-qubit case,
$$
U_{\phi(x)} = \exp(i x_0 Z_0 + i x_1 Z_1 + i (\pi - x_0) (\pi - x_1) Z_0 Z_1),
$$
and trying to find out, how do I get from the above definition to the circuit, as it is implemented in Qiskit:
┌───┐┌──────────────┐
q_0: ┤ H ├┤ U1(2.0*x[0]) ├──■─────────────────────────────────────■──
├───┤├──────────────┤┌─┴─┐┌───────────────────────────────┐┌─┴─┐
q_1: ┤ H ├┤ U1(2.0*x[1]) ├┤ X ├┤ U1(2.0*(π - x[0])*(π - x[1])) ├┤ X ├
└───┘└──────────────┘└───┘└───────────────────────────────┘└───┘
My reasoning for the first 2 $U1$ rotations is that since $\exp(i \theta Z) = RZ(2 \theta)$ up to global phase and $RZ$ is equivalent to $U1$ up to global phase, we might as well use $U1(2 \phi_i(x))$. Is that correct?
And if so, how do we then get $CX \; U1(2 \phi_{\{0, 1\}}(x)) \; CX$ from $\exp(i \phi_{\{0, 1\}}(x) Z_0 Z_1)$?
"
"['programming', 'qiskit', 'ibm']"," Title: Qiskit - lesson 3 - with AbeBody: Coding for Qiskit
I watched this video:
https://www.youtube.com/watch?v=RrUTwq5jKM4
Using Mac OS Big Sur
Using Jupyter 2.0.8
Using Python 3.8
The below code did not work and therefore installed pylatexenc ('pip install pylatexenc') It installed successfully. I then restarted jupyter and It still prints the same error. When I try to reinstall pylatexenc - it says it already there. I tried running while Jupyter is on and in a new terminal (Mac) window I tried to reinstall it- get the same message. Tried 'import pylatexenc *' at beginning of code - does not work - any advice
Code:
from qiskit import *
from pylatexenc import *
qr = QuantumRegister(2)
cr = ClassicalRegister(2)
circuit = QuantumCircuit(qr, cr)
%matplotlib inline
circuit.draw()
circuit.h(qr[0])
circuit.draw(output='mpl')
Here is the error message:
ImportError Traceback (most recent call last)
<ipython-input-8-bd220039ee1c> in <module>
----> 1 circuit.draw(output='mpl')
~/opt/anaconda3/lib/python3.8/site-packages/qiskit/circuit/quantumcircuit.py in draw(self, output, scale, filename, style, interactive, plot_barriers, reverse_bits, justify, vertical_compression, idle_wires, with_layout, fold, ax, initial_state, cregbundle)
1496 from qiskit.visualization import circuit_drawer
1497
-> 1498 return circuit_drawer(self, scale=scale,
1499 filename=filename, style=style,
1500 output=output,
~/opt/anaconda3/lib/python3.8/site-packages/qiskit/visualization/circuit_visualization.py in circuit_drawer(circuit, scale, filename, style, output, interactive, plot_barriers, reverse_bits, justify, vertical_compression, idle_wires, with_layout, fold, ax, initial_state, cregbundle)
221 cregbundle=cregbundle)
222 elif output == 'mpl':
--> 223 image = _matplotlib_circuit_drawer(circuit, scale=scale,
224 filename=filename, style=style,
225 plot_barriers=plot_barriers,
~/opt/anaconda3/lib/python3.8/site-packages/qiskit/visualization/circuit_visualization.py in _matplotlib_circuit_drawer(circuit, scale, filename, style, plot_barriers, reverse_bits, justify, idle_wires, with_layout, fold, ax, initial_state, cregbundle)
515
516 global_phase = circuit.global_phase if hasattr(circuit, 'global_phase') else None
--> 517 qcd = _matplotlib.MatplotlibDrawer(qubits, clbits, ops, scale=scale, style=style,
518 plot_barriers=plot_barriers, layout=layout,
519 fold=fold, ax=ax, initial_state=initial_state,
~/opt/anaconda3/lib/python3.8/site-packages/qiskit/visualization/matplotlib.py in __init__(self, qubits, clbits, ops, scale, style, plot_barriers, layout, fold, ax, initial_state, cregbundle, global_phase, qregs, cregs)
126 self.plt_mod = plt
127 if not HAS_PYLATEX:
--> 128 raise ImportError('The class MatplotlibDrawer needs pylatexenc. '
129 'to install, run "pip install pylatexenc".')
130 self._clbit = []
"
"['quantum-state', 'quantum-operation']"," Title: Prove that a Bell state is invariant under the single-qubit gate acting on both qubitsBody: I have a Bell state ${\Psi}^{-}= \frac{1}{\sqrt2} (|01\rangle - |10\rangle).$
How can I prove that this state is invariant (up to a global phase), when doing the same unitary $U$ on each qubit?
That is, how can I show that, for all $2\times 2$ unitaries $U$, we have:
$$(U\otimes{U})|{\Psi}^{-}\rangle = e^{i\theta}|{\Psi}^{-}\rangle?$$
Actually I don’t really understand if $U$ is generic, or it’s some particular operation. Is there some data missing?
I know $U$ acts only one one qubit but the last expression acts on two qubits.
I’m really lost.
Any help would be appreciated. Thanks!
"
"['circuit-construction', 'simulation']"," Title: Which single fixed unitary can be used to efficiently simulate arbitrary quantum circuit?Body: Let $|p\rangle|00\ldots0\rangle$ be an initial (basis) state, where $p$ is a binary encoding of the circuit to be simulated and zeros are the working space. We apply some fixed unitary transformation $U$ repeatedly $k_p$ times to the initial state and then measure. Whatever final state we obtain is interpreted as an encoding of the final measured state of the simulated circuit.
Intuitively, $U$ must exist as this is how the universe supposedly works to allow implementation of quantum computers within. But how do we actually realise such a $U$?
"
"['quantum-operation', 'information-theory', 'linear-algebra']"," Title: Permutation covariant channels and their Stinespring dilationsBody: I am interested in a quantum channel from $A^{\otimes n}$ to $B^{\otimes n}$ denoted as $N_{A^{\otimes n} \rightarrow B^{\otimes n}}(\cdot)$. Let $\pi(\cdot)$ be a permutation operation among the $n$ registers. I am given that
$$N_{A^{\otimes n} \rightarrow B^{\otimes n}}\left(\pi_{A^{\otimes n}}(\cdot)\right) = \pi_{B^{\otimes n}} \left(N_{A^{\otimes n} \rightarrow B^{\otimes n}}(\cdot)\right)$$
The Stinespring dilation of $N_{A^{\otimes n}\rightarrow B^{\otimes n}}(\cdot)$ is an isometry $V_{A^{\otimes n}\rightarrow B^{\otimes n}E}$ such that
$$\text{Tr}_E\left(V (\cdot) V^\dagger\right) = N(\cdot)$$
Does there exist a Stinespring dilation of $N_{A^{\otimes n}\rightarrow B^{\otimes n}}$ such that
$$V_{A^{\otimes n} \rightarrow B^{\otimes n}E}\pi_{A^{\otimes n}} = \pi_{B^{\otimes n}}V_{A^{\otimes n} \rightarrow B^{\otimes n}E}$$
It is clear that one can achieve this if permutation operations on the $E$ are also allowed but now we are only allowed to permute on $B^n$.
"
"['algorithm', 'qma']"," Title: How do we understand Jordan's Lemma?Body: In quantum computing protocols, jordan's lemma keeps cropping up. See, for example, here: https://cims.nyu.edu/~regev/teaching/quantum_fall_2005/ln/qma.pdf
For any two projectors $\phi_1$, $\phi_2$, there exists an orthogonal decomposition of the Hilbert space into one-dimensional and two-dimensional subspaces that are invariant under both $\phi_1$ and $\phi_2$. Moreover, inside each two-dimensional subspace, $\phi_1$ and $\phi_2$ are rank-one projectors.
What does a decomposition of a hilbert space mean? Can anyone give an example? I sort of understand the proof but I don't understand what the theorem is trying to say or how it is useful.
"
"['classical-computing', 'performance']"," Title: Why can't quantum computation replace classical computation?Body: I am not a total novice of quantum computation (have read the first 6 chapters of Nielsen and Chuang, though not familiar with every part), but there are some fundamental questions that I don't know answers well.
One question that has bothered me is that I often hear comments which say that quantum computers can not be regarded as a replacement for classical ones.
However, we also know that all classical circuits can be simulated by quantum circuits. Put it another way, every Boolean function $f:\{0,1\}^k\to\{0,1\}$ can be computed by using a quantum circuit.
So, how to correctly understand the problems that a quantum computer might encounter when doing a classical computer's job? I know a strong restriction on quantum computing is that we can't read the resulting qubits state directly, but has to use quantum measurement so that we can only get one of the computational basis states probabilistically. However, I don't see this is a difficulty if what we want to do is only to compute a Boolean function.
Following are some possible answers I've thought of:
- Quantum computers can do everything classical computers do, but no more efficiently if we only use the standard technique to simulate classical circuits. Quantum computers outperform classical ones only when special quantum algorithms exploiting superpositions of quantum states are applied, such as the quantum Fourier transform (QFT).
- In Nielsen and Chuang (Section 5.1), it says QFT cannot replace classical discrete Fourier transform. Besides the problem that the amplitudes cannot be directly accessed by measurement, it points out that the worse problem is that "there is in general no way to efficiently prepare the original state to be Fourier transformed." Maybe such kind of problems is important for many applications.
Are the above answers right? Are there other important reasons quantum computers cannot replace the classical ones?
"
"['programming', 'algorithm', 'qaoa']"," Title: How to calculate Alpha and Beta values for QAOA Max-cut problem manually?Body: I'm new to Quantum Computing. I came across solving the Max-cut problem using QAOA. For example, if I have a $U3$ gate with parameters $U3(0,0, \gamma_{XYZ})$ gamma parameter at $p=X$ between logical qubit Y and Z; and $Rz(\beta_X)$ beta parameter at $p=X$, how do I calculate the values of $\gamma$ and $\beta$?
"
"['entanglement', 'physical-realization']"," Title: Why is entanglement creation difficult?Body: No matter from the true physical realization to date or from some papers, it seems that multipartite entanglement creation is difficult. However, the circuit showing below can easily create entanglement at least from the perspective of gates:
The H in the picture above means the Hardmard gate, and the other four blue items are the control-x gate. The circuit can change $\mid 0\rangle^{\otimes n}$ into GHZ state.
So since the circuit realization of entanglement is clearly easy, why the entanglement creation in practice become a hard thing? Does it mean that the control-x gate or Hardmard gate is hard to realize, or there are some other reasons which make the realization of the circuit above very difficult?
"
"['quantum-state', 'pauli-gates']"," Title: What does it mean that a qubit is a triple $(H,X,Z)$ with $H$ Hilbert space and $X,Z$ Pauli operators?Body: In this paper, http://users.cms.caltech.edu/~vidick/teaching/fsmp/fsmp.pdf, it gives the definition of a qubit as follows:
A qubit is a triple $(H, X, Z)$ consisting of a separable Hilbert space H and
a pair of Hermitian operators $X, Z$ acting on a H such that $X^2 = Z^2 = Id$ and ${X, Z} = XZ + ZX = 0$.
What does this mean and why does this work? Can I choose any two pauli observables?
"
"['programming', 'qiskit', 'ibm-q-experience', 'vqe', 'chemistry']"," Title: How do I identify a VQE job run in real hardware?Body: I am running a VQEUCCFactory for H2 on a real hardware device.
res=VQEUCCFactory(quantum_instance=QuantumInstance(provider.get_backend('ibmq_athens'),
shots=8000)
optimizer=optimizer,
initial_state=initial_state)
I left it running offline and when I go to check the results I get more than one job_id. So when I want to simulate another molecule, I obtain more jobs_id. Therefore at the end I cannot identify which jobs_id belongs to each molecules.
Is there any way to add a tag or name to my jobs to identify which molecule corresponds to each group of jobs? I have seen that it can be done (https://quantum-computing.ibm.com/lab/docs/iql/manage/account/ibmq) but I don't know how to implement the job_name of job_tag parameters to my code above.
Thank you very much in advance for the help!
"
"['programming', 'qiskit', 'ibm-q-experience', 'qasm']"," Title: IF statement in OpenQASM2.0 on IBM Quantum Experience -- errorBody: I have written the following toy .qasm file, which has some adaptive measurements:
OPENQASM 2.0;
include "qelib1.inc";
qreg q_1[2];
qreg q_aux[2];
creg c_1[2];
creg c_aux[2];
h q_1[0];
cx q_1[0],q_aux[0];
measure q_aux[0] -> c_aux[0];
if(c_aux[0]==1) s q_1[0];
h q_1[0];
cx q_1[0],q_1[1];
cx q_1[1],q_aux[1];
measure q_aux[1] -> c_aux[1];
if(c_aux[1]==1) s q_1[1];
measure q_1[0] -> c_1[1];
The if statement is using the formatting that you can find in page 20 of https://arxiv.org/abs/2104.14722 :
The problem is that when I try importing this into Qiskit, I get an error:
So it looks like Qiskit is not liking the notation with the square brackets.
I have done some tests and have noticed that if I replace the if statements by something of the sort of:
if(c_aux0==1) s q_1[0];
...
if(c_aux1==1) s q_1[1];
then I wouldn't have an error. However, in general, this requires that I replace a single n-bit classical register, by n single-bit classical registers which I don't particularly like.
Does anyone know why the QasmError is happening? (Recall that my original code appears to be valid, according to https://arxiv.org/abs/2104.14722 .)
Thank you in advance!
sorry everyone this is my first experience with StackExchange and I think I've messed up and made the question as an unregistered user and so I can't seem to be able to change it properly. So I am using this answer to try to add some info (I know this is not how it is supposed to go, I apologize).
@luciano: thank you for your answer, but while the arxiv document is for OpenQASM 3 as you point out, the little snippet of code I took is (in theory) for OpenQASM 2. At least the top of page 20 (right before the code) states:
"As an example, consider an inverse quantum Fourier transform circuit as written in OpenQASM 2". So I think that this should work even for OpenQASM 2.0. But when I do:
qc1 = QuantumCircuit.from_qasm_file(f'{file_loc}{file_name}.qasm')
I get the error that I mentioned. That's what has me confused.
[Edit made by karatechop, copy pasted from answer that was meant to be edit to the question.]
"
"['programming', 'qiskit']"," Title: Qiskit: set_frequency workaround in PulseSimulatorBody: I am trying to run exercise 4 from the recent IBM Quantum Challenge using a PulseSimulator since the device used in the challenge is not available for public use. A snippet of what I am trying to run is the following:
from qiskit import pulse, IBMQ, assemble
from qiskit.pulse import Play, Schedule, DriveChannel, Gaussian, AcquireChannel
from qiskit.providers.aer import PulseSimulator
from qiskit.tools.monitor import job_monitor
import numpy as np
# Constants and units
job_params = {
'meas_level': 1,
'meas_return': 'avg',
'shots': 512
}
spec_range = 0.300 # GHz
num_spec01_freqs = 71
GHz = 1.0e9 # Gigahertz
# Helper functions
def get_exc_chans(gv):
return [AcquireChannel(i) for i in range(gv['backend_config'].n_qubits)]
def get_spec01_freqs(center_freqs, qubit):
center_freq = round(center_freqs[qubit], -8) # 2 significant digits
return np.linspace(center_freq/GHz - spec_range/2,
center_freq/GHz + spec_range/2, num_spec01_freqs)
# Set up backend and config
provider = IBMQ.load_account()
backend_name = 'ibmq_armonk'
backend_real = provider.get_backend(backend_name)
backend = PulseSimulator.from_backend(backend_real)
qubit = 0
backend_config = backend.configuration()
exc_chans = get_exc_chans(globals())
dt = backend_config.dt
backend_defaults = backend.defaults()
center_frequency = backend_defaults.qubit_freq_est
inst_sched_map = backend_defaults.instruction_schedule_map
# |0⟩ -> |1⟩ pulse
# Retrieve calibrated measurement pulse from backend
meas = inst_sched_map.get('measure', qubits=[qubit])
# The same spec pulse for both 01 and 12 spec
drive_amp = 0.25
drive_duration = inst_sched_map.get('x', qubits=[qubit]).duration
# Calibrated backend pulse use advanced DRAG pulse to reduce leakage to the |2> state.
# Here we will use simple Gaussian pulse
drive_sigma = drive_duration // 4 # DRAG pulses typically 4*sigma long.
spec_pulse = Gaussian(duration=drive_duration, amp=drive_amp,
sigma=drive_sigma, name=f"Spec drive amplitude = {drive_amp}")
# Construct an np array of the frequencies for our experiment
spec_freqs_GHz = get_spec01_freqs(center_frequency, qubit)
# Create the base schedule
# Start with drive pulse acting on the drive channel
spec01_scheds = []
for freq in spec_freqs_GHz:
with pulse.build(name="Spec Pulse at %.3f GHz" % freq) as spec01_sched:
with pulse.align_sequential():
# Pay close attention to this part to solve the problem at the end
pulse.set_frequency(freq*GHz, DriveChannel(qubit))
pulse.play(spec_pulse, DriveChannel(qubit))
pulse.call(meas)
spec01_scheds.append(spec01_sched)
qobj = assemble(spec01_scheds, backend=backend, **job_params)
spec01_job = backend.run(qobj)
job_monitor(spec01_job)
However, everytime I run this I get the following (not very helpful) error message:
Job Status: job incurred error
I opened an issue about this in the Qiskit Aer GitHub repository (issue #1264) and got a response. They told me that "the set/shift frequency instructions are not supported by the pulse simulator". And they suggested the following workaround:
A way to bypass this issue as a user is to manually add an oscillation to the pulse envelopes. E.g. if the channel's LO frequency is $w$, but you want to set it to $v$ for a given pulse (or pulses), convert the pulse to an explicit WaveForm specified in terms of a sample list, then multiply the sample array $exp(i(v-w)t)$, where $t$ is the array of associated times. I may be missing some book keeping here but some version of this should work.
As simple as this sounds, I don't quite understand how to do this. Can anyone explain to me, with code, how to do this? Or point me to somewhere where this is done?
"
"['measurement', 'notation', 'probability']"," Title: How to get probability when the coefficient in wave function is a matrix?Body: Following this circuit:
With $\mathcal{G}, A$ being unitary matrices and $|\psi\rangle$ the initial state.
First, the system is:
$\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)\;\otimes|\psi\rangle$
Next:
$\frac{1}{\sqrt{2}}(|0\rangle\otimes\mathcal{G}|\psi\rangle+|1\rangle\otimes A|\psi\rangle)$
This paper shows that:
A measurement of the ancilla selects one of the two branches and results in either the state $\mid\psi^{'}_0\rangle=\frac{1}{2 \sqrt{p_0}}(\mathcal{G}+A)\mid\psi\rangle$ with probability
$$p_0=\frac{1}{4}\langle\psi\mid(\mathcal{G}+A)^\dagger(\mathcal{G}+A)\mid\psi\rangle$$
This sentence makes me confused about how to get the amplitude when it is a matrix? And how about the state $\mid\psi^{'}_0\rangle$, I think it should be $\frac{1}{2}(\mathcal{G}+A)$
Thanks for reading!
"
"['algorithm', 'complexity-theory']"," Title: Accessing parameter in oracle and their relationBody: I am actually a newbie in quantum computing. I do have some doubts regarding quantum query complexity.
From what I understood is that we can't explicitly give the input and use oracle for this purpose. Let's say $O_x|i,b\rangle$ to $|i,b \operatorname{xor} x_i\rangle$ where $x_i$ is the $i$-th bit input and $i$ is the index.
The algorithm just consists of oracles and unitary operators. I wanted to know how do you really access the element? I mean we can't really give this 'i' Don't we? I didn't really found that intuitive.
Also, will the oracle of the algorithm be the same for whatever input we wanted to give?
"
"['qiskit', 'ibm-q-experience', 'ibm']"," Title: When will Qiskit Runtime be available to all users?Body: IBM's Qiskit Runtime was recently made available to a select group of users. Have they announced when it will be available to all users or when they might open it back up to a second round of new users?
"
"['quantum-gate', 'gate-synthesis', 'exponentiation']"," Title: How to implement the power of a product of quantum gates as a circuit?Body: Suppose I have quantum gates (i.e. unitary matrices) $A$ and $B$, and I want to implement $(AB)^x$ in a circuit. If $x$ is integer, I can simply apply $A B$ repeatedly $x$-times. But what if $x$ is a real number? Is there a way to decompose $(A B)^x$ into say a product of powers of $A$ and $B$? I'm fine with some approximation.
I was thinking there might be a relation to Hamiltonian Simulation and I also looked into Trotter formulas, but could not see how to do it. In general $A$ and $B$ do not commute.
"
"['complexity-theory', 'classical-computing', 'random-quantum-circuit']"," Title: What is the counting argument for the number of elementary operations required for a random function?Body: What is the counting argument for the following statement (classical)?
"A random function on n bits requires $e^{\Omega(n)}$ elementary operations."
It appears in the introduction of PRL 116, 170502 (2016): Efficient Quantum Pseudorandomness.
Is it that since there are infinitely many n-bit boolean functions, implementing one such randomly chosen function using elementary operations would require an exponentially large number? (I'm assuming that elementary operations here mean two-bit universal gates.)
Also, why $\Omega(n)$ and not $O(n)$?
Thanks in advance.
"
"['circuit-construction', 'quantum-circuit']"," Title: How can a Sagnac interferometer be described by a quantum circuit?Body: I am looking to translate interferometric processes onto a quantum circuit model and am running into issues regarding feedback and the reuse of circuit elements. My question is framed in terms of a Sagnac interferometer but applies to translating more general problems onto quantum circuits.
At its heart, a Sagnac interferometer applies some unitary $U$ to a target system if the control is in some state $|0\rangle$ and the opposite unitary $U^\dagger$ to the target system if the control is in state $|1\rangle$. This is easy to implement with a quantum circuit if we have an individual gate implementing each of $U$ and $U^\dagger$; then we only need two control gates. But the crux of Sagnac interferometry is that $U^\dagger$ arises from implementing $U$ backwards: the control qubit governs the direction in which the target system experiences the unitary $U$. Can this be represented by a quantum circuit?
The first step is straightforward: if control is in $|0\rangle$, implement $U$, otherwise ignore. I could envision the next step to be: if control is in $|1\rangle$, reflect backward through the circuit. Is this allowed? Is there a standard method for doing this?
Perhaps there is a way of implementing some controlled gate that says "if the control is in some state, perform a complex conjugation operation on the next gate" can that be done, instead? And, if so, can that be done in arbitrary dimensions?
At the end of the day, Sagnac interferometry needs the two processes to be able to reinterfere with each other, so an ideal solution would allow for that, but we can postpone that problem for now.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: How do we change the basis of a given qubit state?Body: I'm reading this paper (Link to pdf) about a test of entanglement with three particles.
I wanted to ask if there is any mathematical shortcut to express one quantum state on another basis like the author has done it from H and V basis to H', V' , L and R? Or for example writing a superposition of computational basis in terms of + and - states
"
"['quantum-gate', 'ibm', 'google-sycamore']"," Title: Good resources for seeing qubit control pulse shapes (Transmon qubits)Body: I'm looking for resources which can show the pulse shapes for various single-qubit and two-qubit gates.
More specifically, is there any resource which can show me calibrated pulse shapes so that I can compare those shapes with the ideal, analytical pulse shapes?
A good reference to see what I mean by analytical pulse shapes and pulse shapes for optimal control which are obtained after calibration can be found here. Fig 4 clearly shows how the optimal pulse shape varies from the analytical one.
I understand that pulses are stored as digital words on the AWG/DAC memory and from the reference above, it seems that individual samples of the pulse are optimized rather than the pulse as a whole (by changing duration, amplitude etc.). From Qiskit's calibration tutorial on the other hand, I see that calibration for an X gate involves finding the right drive amplitude, the calibration granularity does not go to the individual samples that make up the pulse.
So what's the norm for control pulses for providers like Google, IBM? Does waveform shaping during calibration involve tuning individual samples of a pulse or are pulses kept symmetric by changing only the duration and amplitude? I'm aware of how qiskit allows users to look at the pulse schedule for an experiment and I can probably get shapes for the gates I need but I was wondering if there are other resources which could allow me to compare calibrated and analytical pulse shapes.
Thanks!
"
"['programming', 'quantum-gate']"," Title: How do I construct a Breidbart gate in Qiskit?Body: Based on this : https://qiskit.org/textbook/ch-states/single-qubit-gates.html
How do I construct a Breidbart gate (which is like the Hadamard gate but with $\pi/8$ instead of rotating by $\pi/4$)? I want to use it to perform measurement in the Breidbart Basis, by measuring in the Z basis afterwards.
"
['circuit-construction']," Title: Minimum number of T gates needed to perform two overlapping ToffolisBody: Consider this circuit:
How many T gates are needed to implement it, in the stabilizer+T gate set? The circuit can use cliffords, measurement, classical feedback, ancilla qubits, and T gates. Only T gates cost.
I know how to do it with 8 T gates, but don't know an easy way to show it can't be done with 4.
"
"['quantum-gate', 'quantum-state', 'q#']"," Title: Circuit to transform $|0\rangle$ into $\alpha|0\rangle + \beta|1\rangle$ for any $\alpha, \beta$Body: Hi I'm new to QC and doing some katas in Q#.
I got stuck on this excercise and would appreciate help:
Quantum circuit to get following state qubit: $\alpha|0\rangle + \beta|1\rangle$ when the input is $|0\rangle$ and of course $|\alpha|^2+|\beta|^2=1$.
Thanks!
"
"['programming', 'quantum-gate', 'quantum-state', 'simulation']"," Title: Is a black-box gate whose output is conditional on the value of an input amplitude possible?Body: Suppose we have a qubit in the state $|q\rangle = a |0\rangle + b |1\rangle$, and another ancilla qubit $= |0\rangle$.
I wish to have the following black-box gate:
if |a| > 0.8, then turn the ancilla to |1⟩
else leave the ancilla unchanged at |0⟩.
Is it possible to construct such a black-box gate?
(Background information: I do not want to use measurement on $|q\rangle$ because that will terminate the quantum process. I need to continue the quantum process. In my case, the resulting ancilla state is used to control the subsequent quantum computing as part of a larger quantum system where computation process will differ depending on whether the ancilla qubit is 0 or 1.)
"
"['quantum-state', 'algorithm', 'complexity-theory', 'oracles']"," Title: Learning k positions of a Boolean function with a quantum computerBody: Consider a Boolean function with multiple outputs $f: \{0, 1\}^{n} \rightarrow \{0, 1\}^{m}$, and consider being given oracle access to the function $f$. Let us denote the oracle by $O_f$. For an $x \in \{0, 1\}^{n}$ and $b \in \{0, 1\}^{m}$,
\begin{equation}
O_f |x\rangle |b\rangle = |x\rangle|b\oplus f(x)\rangle,
\end{equation}
where $\oplus$ is the bitwise XOR operator. Now, let's say we have a quantum computer and we want to learn the value of $f$ in $k$ positions, $x_1, x_2, \ldots, x_k \in \{0, 1\}^{n}$. Let's also say that we know these positions beforehand.
I want to prove that for a worst case function $f$, it takes the quantum computer at least $k$ queries to $O_f$ to do this. If that is not true, what is the lower bound on the number of queries?
The problem is that the quantum computer can generate superpositions like
\begin{equation}
\sum_{x \in \{0,1\}^{n}} \alpha_{x} |x \rangle |f(x)\rangle,
\end{equation}
where $\alpha_{x} \in \mathbb{C}$, for each $x \in \{0, 1\}^{n}$. Do these reveal sufficient information about the function to solve the task I mentioned with less than $k$ queries?
"
"['complexity-theory', 'random-quantum-circuit']"," Title: What constitutes generic dynamics, and how is it different from a fully random function?Body: What constitutes generic dynamics? And how is it different from a fully random function?
From what I understand, a fully random function is one that is "Haar" random. And generic dynamics, at least colloquially, sounds like the same thing.
This statement appears in PRL 116, 170502 (2016): Efficient Quantum Pseudorandomness.
Thanks.
"
"['quantum-state', 'physical-qubit', 'bell-basis']"," Title: Why does $(XZ\otimes I)|\Phi^+\rangle$ equal the Bell state $|\Psi^-\rangle$?Body: I'm slightly confused by the solution provided below by a suggested solution online to convert |$\phi^+$⟩ to |$\psi^-$⟩.
I tried doing the operation XZ but I got $\frac{1}{\sqrt2}$(|10⟩-|01⟩) instead of |$\psi^-$⟩.
However, applying ZX seems to provide me with the right answer.
Would appreciate the verification!
$$
\begin{align}
(XZ \otimes I) |\Phi^+\rangle &= \frac{1}{\sqrt{2}}(XZ|0\rangle \otimes I |0\rangle + XZ |1\rangle \otimes |1\rangle) \\
&= \frac{1}{\sqrt{2}}(X|0\rangle \otimes I|0\rangle - X|1\rangle \otimes I |1\rangle) \\
&= \frac{1}{\sqrt{2}}(|1\rangle \otimes |0\rangle - |0\rangle \otimes |1\rangle) \\
&= |\Psi^-\rangle
\end{align}
$$
"
"['quantum-gate', 'algorithm', 'circuit-construction', 'quantum-circuit']"," Title: Can an arbitrary circuit be represented using two commands (qsel package)?Body: I was watching this entertaining video by David Bacon (as in "Bacon-Shor code", Cirq, ...) :
video of talk where he mentions the package he wrote:
(qsel), that describes simulating quantum circuits using two commands : "entanglement" and "superposition".
This seems bizarre. There's no documentation on how to start with a circuit and end up in a sequence of such commands. Is anyone familiar with the package or the underlying idea?
"
"['quantum-gate', 'mathematics', 'terminology']"," Title: Who was the first to call the phase gates $P(\pi/2)$ and $P(\pi/4)$ the $S$ and $T$ gates, and were they motivated by generators of the modular group?Body: Within the theory of quantum gates, a common pair of single-qubit phase gates are the $P(\pi/2)=S$ and $P(\pi/4)=T$ gates, with
$$S= \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix},\:T = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \frac{\pi}{4}} \end{bmatrix}.$$
We have, for example, $T^4=S^2=Z$.
See this Wikipedia article.
Within the theory of presentations of $\mathrm{PSL}(2, \mathbb Z)$ (the modular group), we have the two generators, $S$ and $T$, with:
$$S : z\mapsto -\frac1z,\:T : z\mapsto z+1.$$
We have, for example, $S^2=(ST)^3=I$
See this Wikipedia article.
But, in matrix form, these generators do not look like those above:
$$S = \begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}, \:
T = \begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix}.$$
Are the $S$ and $T$ labels used in quantum computation just coincidentally the same as those used to describe generators of the modular group? Or is there some deeper relation that I'm not immediately seeing? What is the origin of $S$ and $T$ gates used in quantum computation?
"
"['qiskit', 'programming', 'quantum-gate', 'algorithm']"," Title: ibmq_16_melbourne system of Qiskit giving wrong result for Bernstein-Vazirani AlgorithmBody: I have just started learning Qiskit and to begin I tried running the Bernstein Vazirani Algorithm(secret number detector) on qasm_simulator and the ibmq_16_melbourne system and compared their results. My results on the Qasm simulator exactly matches the secret number, but I am getting wrong result on the real system.
Please review my codes, circuits and results below:
import qiskit
from qiskit import IBMQ
import time
from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.visualization import plot_bloch_multivector
import matplotlib.pyplot as plt
from qiskit.tools.monitor import job_monitor
#IBMQ.save_account('Account key',overwrite=True) # Run it for once
# 6 bit secret number
secretNumber= '101001'
circuit= QuantumCircuit(6+1,6) # 6 qubit for secret no. +1 qubit
circuit. h([0,1,2,3,4,5])
circuit.x(6)
circuit.h(6)
circuit.barrier()
# splitting the string into char
splitSecretNumber= list(secretNumber)
lengthofSecretNumber= len(splitSecretNumber)
x=0
while(x< lengthofSecretNumber):
if(str(splitSecretNumber[x])=='1'):
circuit.cx(int(x),6)
x=x+1
circuit.barrier()
circuit.h([0,1,2,3,4,5])
circuit.barrier()
circuit.measure([0,1,2,3,4,5],[0,1,2,3,4,5])
circuit.draw(output="mpl")
simulator= Aer.get_backend('qasm_simulator')
simulationResult = execute(circuit,simulator, shots=1).result()
counts= simulationResult.get_counts()
print(counts)
plot_histogram(simulationResult.get_counts(circuit))
plt.show()
The histogram and circuit obtained are for Qasm simulator are as below:
![]()
Python Code executed on ibmq_16_melbourne system using Pycharm IDE-
import qiskit
from qiskit import IBMQ
import time
from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.visualization import plot_bloch_multivector
import matplotlib.pyplot as plt
from qiskit.tools.monitor import job_monitor
#IBMQ.save_account('Account key',overwrite=True) # Run it for once
# 6 bit secret number
secretNumber= '101001'
circuit= QuantumCircuit(6+1,6) # 6 qubit for secret no. +1 qubit
circuit. h([0,1,2,3,4,5])
circuit.x(6)
circuit.h(6)
circuit.barrier()
# splitting the string into char
splitSecretNumber= list(secretNumber)
lengthofSecretNumber= len(splitSecretNumber)
x=0
while(x< lengthofSecretNumber):
if(str(splitSecretNumber[x])=='1'):
circuit.cx(int(x),6)
x=x+1
circuit.barrier()
circuit.h([0,1,2,3,4,5])
circuit.barrier()
circuit.measure([0,1,2,3,4,5],[0,1,2,3,4,5])
circuit.draw(output="mpl")
IBMQ.load_account()
provider=IBMQ.get_provider('ibm-q')
realMachine= provider.get_backend('ibmq_16_melbourne')
result = execute(circuit,realMachine, shots=1000).result()
counts= result.get_counts()
print(counts)
plot_histogram(counts)
plt.show()
The histogram and circuit obtained are for ibmq_16_melbourne system are as below:
Please help, I am completely stuck. I could not find what is going wrong.
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: Is VQA quicker than classical machine learning?Body: Variational Quantum Algorithm (VQA) is a kind of quantum algorithm corresponding to classical machine learning. Unlike the square speed up of Grover's algorithm, the circuit in VQA does not seem to guarantee being faster than classical machine learning. So, is VQA faster than classical machine learning? If not, why is there a lot of research in this field?
"
"['algorithm', 'unitarity']"," Title: Fastest way to solve Gram Schmidt orthogonalization in quantum computerBody: Suppose we have $n$ (large) dimensional vector space and I want to orthogonalize $n$ linearly independent vectors using the Gram-Schmidt orthogonalization process. Is there some time-bound on how quickly a quantum computer can complete this process? Or is there any best known quantum algorithm for this?
"
"['programming', 'qiskit', 'hamiltonian-simulation', 'vqe']"," Title: Are inconsistent results between different VQE runs justified?Body: I made this post a while ago, where I learned I could use qiskit's VQE to calculate (or approximate) the Transverse Field Ising Hamiltonian and other similar Hamiltonians. After working with my code for a while, I managed to write the "functional programming version" that I wanted, and I started testing it.
My concern comes from the fact that every time I run the VQE, I may get very different results, despite not messing with the ansatz, the optimizer, the initial point or the Hamiltonian. Upon searching about it, I found this thread saying that if you don't set an initial point, it may be chosen at random. I tried to set the seed myself as suggested there, or setting a zero initial point list to pass as the parameter, but neither seemed to change the inconsistency. Is this somehow justified? Can it be fixed or is it something that I'm going to have to deal with? I've tried researching this myself, but there don't seem to be any good sources online that don't require a high-level understanding of the papers they are based on.
Below I'm showing you an example, and how different the results I'm getting can be.
Let's say that I have the following 3-site Ising chain Hamiltonian.
from qiskit.opflow import Z, X, I, Zero
h = 0
H = -(Z^Z^I)-(I^Z^Z)-h*((X^I^I)+(I^X^I)+(I^I^X)) #3-site Hamiltonian
For h=0 (as specified here with great detail) you should expect results that show every spin in the -z direction, that is |000> in this case. So I set up the VQE like so
from qiskit.providers.aer import QasmSimulator
from qiskit.algorithms import VQE
from qiskit.algorithms.optimizers import COBYLA
from qiskit.circuit.library import EfficientSU2
from qiskit.visualization import plot_histogram
backend = QasmSimulator()
optimizer = COBYLA(maxiter=1000)
ansatz = EfficientSU2(3)
vqe = VQE(ansatz, optimizer, quantum_instance=backend)
result = vqe.compute_minimum_eigenvalue(H)
groundstates = probability_calculator(result)
#this is a function that I wrote to take
#VQE results and output probabilities with qiskit's histogram functions. It doesn't
#matter here since I've tested it and know it's not the reason for the
#inconsistencies
#(or you can just ignore this if you don't trust me and check the "raw" VQE results
#provided in the screenshots below).
plot_histogram(groundstates)
Now I run this snippet of code 6-7 times. First and second time, I get the following result (with a bit of a difference in probabilities, obviously)
The third time, I get the following result, which is a completely "flipped" version of the one I'm expecting
The last time I run it, I get the following results
It really makes no sense with my knowledge why this happens. I obviously chose a very simple case to demonstrate here, just to prove my point without having to mess with the math. You can do the same for h=100 where you would expect an equal superposition. The results look overall better (statistically speaking), but you will occasionally get a result that makes no sense.
To clarify my question once again: The VQE runs a minimum of 1000 times. What I don't get is how it can yield such different results without messing with the code at all, just because you rerun it. I can't find myself if this inconsistency is expected, or if I'm missing something I should have taken into account.
"
"['programming', 'qiskit']"," Title: Qiskit: total number of parameters after composing parametrized circuitsBody: I'm trying to use the .compose() method to join two parametrized circuits, specifically TwoLocal instances from the qiskit.circuit.library.
While I would expect that .num_parameters_settable() would be the sum of the parameters in each circuit, the final circuit will have only as many settable parameters as only one of them.
Version: qiskit-0.26.2
Thank you very much for your help!
My code is:
from qiskit.circuit.library import TwoLocal
import numpy as np
rot = TwoLocal(
int(np.sum(num_qubits)),
"ry",
[],
reps=1,
skip_final_rotation_layer=True,
parameter_prefix="p",
)
var = TwoLocal(
int(np.sum(num_qubits)),
"ry",
"cx",
entanglement="linear",
reps=1,
skip_final_rotation_layer=True,
)
rot.num_parameters_settable()
>> 2
rot.compose(var, inplace=True)
rot.num_parameters_settable()
>> 2
"
"['algorithm', 'unitarity', 'amplitude-amplification']"," Title: Manipulating the amplitude of state based on the state informationBody: In the past, I thought I have seen quantum circuits/algorithm techniques to change the amplitude of state based on the state?
$\lvert \psi \rangle = \sum_x \ C_x \lvert x \rangle$, here $C_x$ is just constant (i.e. as in simple superpositions)
and after some $U$, $\lvert \psi \rangle = \sum_x \ C_x (x) \lvert x \rangle$
The amplitude changes based on the $\lvert x \rangle$ state.
Any pointer or reference would be appreciated.
"
"['quantum-gate', 'matrix-representation', 'shors-algorithm']"," Title: Matrix for $U^{2^j}$ from Shor's algorithm for any $a$ and $N$Body: I'm implementing Shor's algorithm from scratch and therefore want to implement a unitary gate $U$ such that $U^{2^j}|y\rangle = |a^{2^j}y \: \text{mod} \: N\rangle$. I know that an efficient way of doing this is by following the procedure presented by Stephane Beauregard in Circuit for Shor's algorithm using 2n+3 qubits; and this is what I'm going to be using.
Out of curiosity, I wanted to know if there is any way of building these unitaries without resorting to some clever insights like done in the paper or other efficient implementations, i.e. if there is something more beginner friendly. I was specifically wondering if there is a way of constructing the matrix for $U^{2^j}$ and then just use Qiskit's unitary to gate function. I know this would be very inefficient, but does anyone know how to do this?
I found this answer that does what I'm asking but it relies on already knowing the order $r$. Is there some way to do it for any $a$ and $N$ without having to know the order of $a^x \: \text{mod} \: N$ beforehand?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: The expectation of a measurement of qubit 2 after qubit 1 has been measuredBody: In section 1.2.4 (page 13) of these lecture notes http://users.cms.caltech.edu/~vidick/teaching/fsmp/fsmp.pdf, it says
\begin{aligned}\left\langle\psi\left|X_{1}^{0} Z_{2} X_{1}^{0}\right| \psi\right\rangle+\left\langle\psi\left|X_{1}^{1} Z_{2} X_{1}^{1}\right| \psi\right\rangle &=\left\langle\psi\left|X_{1} Z_{2} X_{1}\right| \psi\right\rangle \\ &=\left\langle\psi\left|Z_{2} X_{1}^{2}\right| \psi\right\rangle \\ &=\left\langle\psi\left|Z_{2}\right| \psi\right\rangle \end{aligned}
given that $X_{1}=X_{1}^{0}-X_{1}^{1}$ where this is the spectral decomposition, but I don't see how this can be. How did the negative terms cancel out?
"
"['programming', 'qiskit', 'quantum-circuit', 'transpile']"," Title: Transpilation on restricted topology does not yield an equivalent circuit in QiskitBody: Here is an MWE: a simple circuit on three qubits with a CNOT acting on qubits 0 and 2. The coupling map prohibits a two-qubit gate between qubits 0 and 2 and so qubit 1 must get involved.
from qiskit import QuantumCircuit
from qiskit.compiler import transpile
from qiskit.transpiler import CouplingMap
from qiskit.quantum_info import Operator
from qiskit.circuit.library import Permutation
from itertools import permutations
qc = QuantumCircuit(3)
qc.cx(0, 2)
coupling_map = CouplingMap([[0, 1], [1, 0], [1, 2], [2, 1]])
transpiled_qc = transpile(qc, basis_gates=['cx'], coupling_map=coupling_map)
Now, if I check
Operator(transpiled_qc).equiv(qc) # False
Although the resulting circuit looks reasonable
I thought that the difference between the original and the transpiled circuit might be a permutation of qubits, but the following check did not work either
for p in permutations([0, 1, 2]):
permutted_qc = qc.compose(Permutation(3, p))
print(Operator(transpiled_qc).equiv(permutted_qc)) # All False
Addition
If I fix the initial_layout in the transpilation options
transpiled_qc = transpile(qc, basis_gates=['cx'],
coupling_map=coupling_map, initial_layout=[0, 1, 2])
then the resulting circuit
is indeed equivalent to the transpiled circuit plus a permutation
permutted_qc = qc.compose(Permutation(3, [1, 0, 2]))
print(Operator(transpiled_qc).equiv(permutted_qc)) # True
My questions is now I guess -- how to be systematic about it? How to read out an appropriate permutation before trying all options (I have much more complicated circuits in mind). I mean, isn't it a basic human need to transpile a circuit and get True as a result of the equivalence test?
"
"['quantum-state', 'fidelity', 'trace-distance']"," Title: If $\rho,\sigma$ are classical-quantum states, can the fidelity $F(\rho,\sigma)$ be expressed in terms of $F(\rho_i,\sigma_i)$?Body: Let $\rho = \sum_i \vert i\rangle\langle i\vert \otimes \rho_i$ and $\sigma = \sum_i\vert i\rangle\langle i\vert\otimes\sigma_i$ where we are using the same orthonormal basis indexed by $\vert i\rangle$ for both states.
The quantum fidelity is defined as $F(A,B) = \|\sqrt{A}\sqrt{B}\|_1$ (one can also define it as the square of this quantity if that helps). Can one express
$$F(\rho,\sigma)$$
in terms of the various $F(\rho_i,\sigma_i)$? For the trace distance, one has indeed that $\|\rho - \sigma\|_1 = \sum_i \|\rho_i - \sigma_i\|_1$ so does the fidelity also have a similar property?
"
"['quantum-state', 'density-matrix', 'probability', 'wigner-function']"," Title: Properties of frames in quasiprobability representationBody: Let $\mathbb{C}^{d}$ be a complex Euclidean space.
Let $\mathsf{H}(\mathbb{C}^{d})$ be the set of all Hermitian operators, mapping vectors from $\mathbb{C}^{d}$ to $\mathbb{C}^{d}$. I had some questions about the notation introduced in this paper (page 2.)
A quasiprobability representation of a qudit over $\Lambda$ is defined
by a frame $\{F(λ) : λ \in \Lambda\}$ and a dual frame $\{G(λ) : λ ∈
Λ\}$, which are (generally over-complete) bases for
$\mathsf{H}(\mathbb{C}^{d})$, satisfying \begin{equation} A =
\sum_{\lambda \in \Lambda} G(\lambda) ~\text{Tr}[A F(\lambda)],
\end{equation} for all $A$.
Here are my questions.
- What is the cardinality of the set $\Lambda$? Each $A \in \mathsf{H} (\mathbb{C}^{d})$ has $d^{2}$ elements. If the frames are to be overcomplete bases of $\mathsf{H} (\mathbb{C}^{d})$, does it mean that
\begin{equation}
|\Lambda| \geq d^{2}?
\end{equation}
- What is the relation between $F(\lambda)$ and $G(\lambda)$?
"
"['information-theory', 'fidelity', 'linear-algebra']"," Title: Clarification on Watrous' proof of Alberti's theorem on the fidelity functionBody: I am reading John Watrous' quantum information theory book. In the proof of Theorem 3.19 (practically the Alberti's theorem on the characterization of the fidelity function) he claims the following fact: given two Hermitian operators $Y_0, Y_1$ on a complex Euclidean space $\mathcal{X}$, the operator
$$
\begin{pmatrix}
Y_0 & -\mathbb{1} \\ -\mathbb{1} & Y_1
\end{pmatrix}
$$
on $\mathcal{X} \oplus \mathcal{X}$ is positive semidefinite if and only if both $Y_0$ and $Y_1$ are positive definite and satisfy $Y_1 \geq Y_0^{-1}$. I do not immediately see how this can be proven. He says that Lemma 3.18 can be used for this purpose, but I still do not get how to link these two results. Someone is willing to help?
For convenience I write here the statement of Lemma 3.18. It says the following: given two positive semidefinite operators $P,Q$ and a linear operator $X$ on $\mathcal{X}$, the operator
$$
\begin{pmatrix}
P & X \\ X^* & Q
\end{pmatrix}
$$
on $\mathcal{X} \oplus \mathcal{X}$ is positive semidefinite if and only if there exists an operator $K$ such that $X = \sqrt{P} K \sqrt{Q}$ and $||K|| \leq 1$. Here $^*$ stands for the conjugate transposition and $|| \cdot ||$ is the spectral norm.
"
"['programming', 'qiskit', 'ibm-q-experience', 'vqe']"," Title: How to find the expectation value of several circuits using Qiskit aqua operator logic?Body: I am using the method from this SE answer to calculate the expectation value using qiskit aqua operator logic which works well for a single circuit. Here is a simplified code snippet to demonstrate how it works.
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, Aer
import numpy as np
from qiskit.aqua import QuantumInstance
from qiskit.aqua.operators import PauliExpectation, CircuitSampler, StateFn, CircuitOp, CircuitStateFn
qctl = QuantumRegister(1)
psi = QuantumCircuit(qctl)
psi = CircuitStateFn(psi)
qctl = QuantumRegister(2)
op = QuantumCircuit(qctl)
op.z(0)
op.ry(np.pi/4,0)
op = CircuitOp(op)
backend = Aer.get_backend('qasm_simulator')
q_instance = QuantumInstance(backend, shots=1024)
measurable_expression = StateFn(op, is_measurement=True).compose(psi)
expectation = PauliExpectation().convert(measurable_expression)
sampler = CircuitSampler(q_instance).convert(expectation)
print('Expectation Value = ', sampler.eval())
However, I am applying it to a VQE application and for each iteration I have $x>1$ circuits. There is no issue when I run on my local machine because there is no queue time, but on the IBMQ machines I would like to submit a batch of the aqua expectation value circuits for each iteration to reduce queue times. For a list of circuits I can submit a batch using the IBMQJobManager() function, however, the method I am using does not store circuits as a list. My question is, can I use the jobmanager with the aqua expectation value to submit a batch of jobs to IBMQ? If not, is there a different way to submit a batch of the aqua expectation value circuits?
"
"['qiskit', 'circuit-construction', 'grovers-algorithm']"," Title: Is there an efficient way to create entangled states using Qiskit?Body: I am trying to implement Grover's search using Qiskit. And I would like to create entangled states so I could search for the index of a specific value in a list. For example, if the third element in the list has value 7, then the corresponding state should be $|3\rangle|7\rangle$. One way to do that is to construct a particular circuit for each element after the hadamard transform but it seems to be hard. Is there an efficient way in Qiskit to do that so I will not need to construct the circuit for every element in the list? Thank you for your help!
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: 'Geometric difference' in Google's 'Power of data in quantum machine learning' paperBody: Has anyone ever tried to implement the geometric difference metric introduced in the Google's power of data paper? It is defined in Eq. 5.
My implementation of the metric is as follows.
def geometric_difference(kernel_1, kernel_2):
# diff = -1
diff = np.sqrt(np.linalg.norm(
np.matmul(np.matmul(np.sqrt(kernel_2),
np.linalg.inv(kernel_1)),
np.sqrt(kernel_2)), np.inf))
return diff
I understand that when I compute the geometric difference of a kernel matrix with itself, it should give $1$.
However, I am getting $3.5425853205393496$ which is greater than $1$ for the following matrix.
M = np.array([[1.0, 0.9864463445333996, 0.9740668604480669, 0.9522423474912594, 0.9924537684077833, 0.8895864607254809, 0.8911800123689296, 0.9273022835638276, 0.9093065295855488, 0.942937484839194], [0.9864463445333996, 1.0, 0.9362292204642889, 0.9058183417109515, 0.9720042335801492, 0.8236054328646096, 0.8311148112692656, 0.873310656326527, 0.8563983095457245, 0.9095079241006527], [0.9740668604480669, 0.9362292204642889, 1.0, 0.9251948438121138, 0.9922213493721925, 0.9667491686359904, 0.9689939767213887, 0.9872801673373786, 0.9786773752322605, 0.9889003372198818], [0.9522423474912594, 0.9058183417109515, 0.9251948438121138, 1.0, 0.9299880514954331, 0.8633016543725155, 0.8480159549979944, 0.8846832119506772, 0.8549651220805452, 0.8625840477854568], [0.9924537684077833, 0.9720042335801492, 0.9922213493721925, 0.9299880514954331, 1.0, 0.9286669208701384, 0.9333471169337565, 0.9608763731749859, 0.9493255688093539, 0.9761062630584328], [0.8895864607254809, 0.8236054328646096, 0.9667491686359904, 0.8633016543725155, 0.9286669208701384, 1.0, 0.9980284463169727, 0.994348065667556, 0.993861166093055, 0.9695176223678753], [0.8911800123689296, 0.8311148112692656, 0.9689939767213887, 0.8480159549979944, 0.9333471169337565, 0.9980284463169727, 1.0, 0.9957851054969118, 0.9982181534658013, 0.9791400659545252], [0.9273022835638276, 0.873310656326527, 0.9872801673373786, 0.8846832119506772, 0.9608763731749859, 0.994348065667556, 0.9957851054969118, 1.0, 0.9978737256112197, 0.9885554512243394], [0.9093065295855488, 0.8563983095457245, 0.9786773752322605, 0.8549651220805452, 0.9493255688093539, 0.993861166093055, 0.9982181534658013, 0.9978737256112197, 1.0, 0.989447655967652], [0.942937484839194, 0.9095079241006527, 0.9889003372198818, 0.8625840477854568, 0.9761062630584328, 0.9695176223678753, 0.9791400659545252, 0.9885554512243394, 0.989447655967652, 1.0]])
Could anyone help me to understand what I am doing wrong?
"
"['algorithm', 'complexity-theory', 'classical-computing']"," Title: What are the types of models of computation aside from the quantum query model?Body: It looks like in a lot of quantum algorithms, we use the quantum query model. I wanted to know what are the other types of models of computation, used in quantum computing as well as in classical computing?
On what model of computation are algorithms (such as Binary Search, Sorting, etc.) based?
"
"['measurement', 'optimization', 'd-wave', 'performance', 'embedding']"," Title: How to improve embedding process in D-Wave?Body: I am quite new to the quantum computing field.
Currently, I am trying to solve a combinatorial optimization problem on a D-Wave system, which I successfully translated into QUBO form. I also managed to implement it with the D-Wave Python library.
However, when the solution domain increases, the embedding processing time becomes so large compared to effective QPU access time, that the advantage of solving such a problem with quantum computing disappears. Of course, I tried different embedding approaches provided by D-Wave library. Maybe, I neglected some aspects which can turned into particular values that can be passed as parameters to the sampler. Besides, I also tried using qbsolv but I don't see any improvement.
If more information on the problem formulation is needed, I will be glad to provide it. Anyway, I am seeking help or general advices.
Many thanks in advance!
"
"['textbook-and-exercises', 'quantum-operation', 'kraus-representation']"," Title: How to use the Kraus operators to represent the total density matrix instead of the reduced one?Body: In Nielsen's book, the Kraus operator can be attained by trace out the enviroment:
$$\operatorname{Tr}_{\rm env}[\hat{U}(|\psi\rangle\otimes|0\rangle)(\langle\psi|\otimes\langle 0|)\hat{U}^\dagger].
$$
And hence we can define the Kraus operator as $\Pi_l = \langle l|\hat{U}|0\rangle$.
But why can we write the total state $|\Psi\rangle=\hat{U}(|\psi\rangle\otimes| 0\rangle)$ as $|\Psi\rangle = \sum_l(\Pi_l|\psi\rangle)\otimes|l\rangle$?
"
['quantum-operation']," Title: Is the map $\rho\rightarrow Tr(\sigma\rho)$ completely positive?Body: Let $\sigma$ be a fixed positive semidefinite matrix (edit: need unit trace too as pointed out if we want trace nonincreasing). Is the map
$$N:H\rightarrow\mathbb{C}$$
given by $N(\rho) = Tr(\sigma\rho)$ completely positive? Note that it is positive and trace nonincreasing. If yes, what are its Kraus operators?
"
['hhl-algorithm']," Title: What is the largest linear system of equations solved using HHL experimentally?Body: Can someone tell what is the largest system of equations solved using HHL algorithm experimentally?
I know the $8$ x $8$ system has been solved experimentally. Has someone gone beyond this to solve $16$ x $16$ or $32$ x $32$ or beyond?
If yes please provide the resource link and also mention the number of qubits used to design the circuit.
"
"['mathematics', 'textbook-and-exercises']"," Title: Upper bound on the distance between two distinct orthonormal vectorsBody: I need to prove that if $\phi$ and $\psi$ are distinct vectors of an orthonormal set then $|| \phi - \psi|| \leq \sqrt{2} $.
Going by the definition of norm, $|| \phi - \psi||^2$ is the inner product $\langle\phi - \psi|\phi - \psi\rangle$. By linearity of inner products I get $\langle \phi|\phi\rangle - \langle \phi|\psi\rangle - \langle \psi|\phi\rangle + \langle \psi|\psi\rangle$, which equals $2$ by orthonormality conditions. And thus, $|| \phi - \psi|| = \sqrt{2} $.
But how does one get the $\leq$ relation instead of $=$ above?
"
"['qiskit', 'transpile']"," Title: Transpiling with dynamical decoupling sequenceBody: I am testing circuits which contain mid-circuit reset operations, using Qiskit and IBM Quantum hardware. For 2 qubit simulations, I have a reset operation on one of the qubits and would like to test having simple dynamical decoupling sequences, such as an XXYY gate sequence acting on the idle qubit. But when I transpile the circuit, this transpiles to the identity. Is there any way to keep these dynamical decoupling sequences un-transpiled without going to pulse level?
Edit: I have gotten around this by inserting barriers around the resets, breaking up the circuit according to barriers (using this How to split a Quantum Circuit on a barrier in Qiskit?), then transpiling the circuits without resets separately.
"
"['cryptography', 'qkd']"," Title: Does the bit generated password using QKD protocols need to be converted to another base?Body: I am currently implementing some QKD protocols using Qiskit and I came up with the following question: After the protocol is finished, a true random password is generated using 0s and 1s, however, and here my question, do these passwords need to be converted to another base? Maybe hexadecimal? Or are they used as they are?
When I mean by used is to using them, for instance, as a key for the one time pad.
"
['measurement']," Title: What is the observable to measure spin along some direction for a 2 qubit system?Body: Let $M$ be the $2 \times 2$ matrix corresponding to the observable to measure spin along some arbitrary axis $\vec{v}$. This matrix is given by following formula:
\begin{equation}
M = v_x X + v_y Y + v_z Z
\end{equation}
where $X, Y, Z$ are $2 \times 2$ Pauli matrices and $\vec{v} = (v_x, v_y, v_z)$. E.g., see this
Now if I have a 2 qubit system, then what is the $4 \times 4$ matrix to measure the spin of the first qubit along $\vec{v}$?
"
"['grovers-algorithm', 'hhl-algorithm', 'optimization', 'speedup']"," Title: Solving linear system $Ax=b$ with exponential speed-up via binary optimization?Body: The main disadvantage of HHL algorithm for solving $A|x\rangle = |b\rangle$ is that exponential speed-up is reached only in case we are interested in value $\langle x|M|x\rangle$, where $M$ is a matrix. In case we want to know solution $|x\rangle$ itself, we neeed to do measurement which cancel the speed-up out completely.
In the article Experimental realization of quantum algorithm for solving linear systems of equations a method encoding matrix $A$ into a Hamiltonian and using adibatic quantum computation for solving the linear system is proposed. Unfortunately, the authors do not discuss complexity of the algorithm in terms of the dimensions of matrix $A$ but only a condition number of $A$.
This article inpired me to translate problem $A|x\rangle = |b\rangle$ to a binary optimization task:
- each row of $A|x\rangle = |b\rangle$ is $\sum_{j=1}^{n}a_{ij}x_j = b_i$
- hence solution of $A|x\rangle = |b\rangle$ fulfills $f(x)=\sum_{i=1}^{n}(\sum_{j=1}^{n}a_{ij}x_j - b_i)^2=0$
- minizing $f(x)$, we come to the solution
- since variables $x_i \in \mathbb{R}$ (I do not assume complex matrix $A$ and vector $|b\rangle$), we have to express them in binary number system, e.g. $x_i = \sum_{k=-m_1}^{m_2}2^k x_{ik}$, where $m_1, m_2 \in \mathbb{N}$ specify accuracy and $x_{ik}$ is $k$th bit in binary representation of variable $x_i$
In the end, we came to binary optimization task
$$
\sum_{i=1}^{n}\left(\sum_{j=1}^{n}a_{ij}\sum_{k=-m_1}^{m_2}2^k x_{jk} - b_i\right)^2
\rightarrow \min
$$
Such minimization can be done with algorithms like QAOA or VQE, or a quantum annealing machine. However, in this case we do not have any proof (only empirical) that such algorithms bring about any advantage over classical computing.
But a QUBO solver based on Grover's algorithm is proposed in Grover Adaptive Search for Constrained Polynomial Binary Optimization. Since Grover's algorithm provides quadratic speed-up we are now better off than in case of quantum annealers (or QAOA or VQE).
Additionally, assuming that we are able to construct qRAM, we can employ improved Grover, introduced in The Effective Solving of the Tasks from NP by a Quantum Computer, which reaches exponential speed-up.
In the end, we would be able to solve a linear system with exponential speed-up offered by HHL and at the same time to get rid of HHL disadvantages.
Does this idea make sense or is there some flaw? I would appreciate any comment and ideas.
EDIT:
I did some further research in the above. I realized that my first proposal ignored signs. So, I added for each variable a signum binary variable (qubit). Each binary representation of variable in the linear system is now multiplied by term $(2s_i - 1)$. The term is -1 for $s_i = 0$ and 1 for $s_i = 1$. As a result, we are able to solve any linear system in real numbers. However, introducing new binary variables for signs complicates the optimization. Because of squares in the objective function, we get terms like $s_is_jx_ix_j$. This means that the optimization is no longer QUBO but HUBO (higher-order unconstrained binary optimization).
Fortunatelly, this can be overcome with method discussed e.g. in paper Towards Prediction of Financial Crashes with a D-Wave Quantum Computer, allowing to convert many-body interaction Hamiltonian to Ising one but at cost of ancilla qubits. In the end we are left with QUBO task but with more qubits - signs and ancillas.
"
"['quantum-operation', 'kraus-representation']"," Title: Can Kraus operators change a mixed state into a pure state?Body: It seems that Kraus operators cannot change a pure state into a mixed one (wrong). For any pure state can be written as $|\psi\rangle\langle\psi|$, so after the Kraus operators. It becomes $$\sum_l\Pi_l|\psi\rangle\langle\psi|\Pi_l^\dagger = |\phi\rangle\langle\phi|.$$
But does there exist some Kraus operators that can change the mixed state $\rho$ into a pure state?
"
"['measurement', 'bell-basis']"," Title: Inconsistent result trying to simulate measurement of a 2 qubit systemBody: Consider a 2 qubit system in the initial state:
$$
\begin{pmatrix}
0 \\ \frac{\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} \\ 0
\end{pmatrix}
$$
the so-called Bell-pair. Now let's measure the spin of the first qubit along Pauli "$X$ direction". Pauli $X$ matrix is defined here for reference. To do this we will construct the matrix $I \otimes X$ as explained here (or you can do $X \otimes I$ which will measure the spin of the other qubit; whether you do $I \otimes X$ or $X \otimes I$ is irrelevant to the point I am going to make in the question).
$I \otimes X$ equals
$$
\begin{pmatrix}
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \\
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0
\end{pmatrix}
$$
Now to simulate the measurement, we need to perform a eigenvalue decomposition of this matrix which is given by:
$$
\begin{pmatrix}
-\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\
0 & -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \\
\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\
0 & \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2}
\end{pmatrix}
$$
The columns are the eigenvectors associated with eigenvalues $-1, -1, 1,$ and $1$.
Assume the measurement yielded $-1$ corresponding to the first eigenvector. (Side note for advanced readers: there are only 2 unique eigenvalues but the 4 eigenvectors are distinguishable as they are orthogonal - refer to section 2.2.4 in Nielsen and Chuang p. 86 if needed.) The wavefunction is now going to collapse to the first eigenvector which is:
$$
\begin{pmatrix}
\frac{\sqrt{2}}{2} \\ 0 \\ -\frac{\sqrt{2}}{2} \\ 0
\end{pmatrix}
$$
and is same as equation 2.104 in Nielsen and Chuang p. 88 (side note again: the flip in sign of the eigenvector is unimportant and does not make a difference) or refer this
Now we will measure the spin of the other qubit along $X$. To do this, we create the complementary matrix $X \otimes I$ which is given by:
$$
\begin{pmatrix}
0 & 1 & 0 & 0 \\
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{pmatrix}
$$
The eigenvectors of this matrix are
$$
\begin{pmatrix}
-\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\
\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\
0 & -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \\
0 & \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2}
\end{pmatrix}
$$
and associated eigenvalues are once again $-1, -1, 1,$ and $1$.
Now I am interested in the probabilities of measuring these eigenvalues. The formula to do that is given by equation 2.103 in Nielsen and Chuang or one can refer to the same paragraph from lecture notes I pasted above.
The collapsed wavefunction after the first measurement can be verified to be same as:
\begin{equation}
\psi' = -\frac{1}{2} q_1 + \frac{1}{2} q_2 + \frac{1}{2} q_3 -\frac{1}{2} q_4
\end{equation}
where $q_i$ are the eigenvectors of $X \otimes I$ and listed above for clarity. And so the probabilities of observing the 4 eigenvalues are given by modulus square of the coefficients above. In other words, they are all $0.25$.
and that brings me to my question. The math I have done above is nothing but a simulation of the EPR experiment. And all the books say that once the spin of the first qubit has been measured to be $-1$ it is guaranteed that the spin of the second qubit will be $+1$ but I am getting a half and half probability of the spin of the second qubit as well. What gives?
"
"['programming', 'quantum-circuit', 'pennylane']"," Title: How can I write unit tests for a pennylane circuit?Body: I have several mixing unitary circuits written using Pennylane to be used in the QAOA algorithm. Furthermore, I'd like to write unit tests for these mixing circuits to ensure that the code is doing what it is supposed to in the future as changes are made to the codebase. Consider the basic example:
def x_mixer(beta, wires):
for i in wires:
qml.RX(beta, wires=i)
Currently, I'm thinking of using assert statements to check that the output of:
dev = qml.device('lightning.qubit', wires=2, shots=10000)
circuit = qml.QNode(mixer_circuit, dev)
result = circuit(0.5, wires=[0, 1])
is a certain value. Now one issue is that the results themselves are probabilistic and change during each run. My first question: What's the best way to get around this? Can you set random_seed in any of the simulator devices?
In general if someone has ideas on how to do unit testing for Pennylane circuits, it would be really appreciated.
"
"['qiskit', 'circuit-construction', 'grovers-algorithm']"," Title: Understanding Grover’s Oracle for 3-SATBody: First of all I'm very new to the quantum computing world so this might seem trivial to you, but it's a hump I was unable to get over for days now.
So I'm talking about the version that Qiskit has implemented for their 3-SAT example
Their example clauses look like this:
I recreated their code and printed the circuit to get an understanding of how the oracle works:
Obviously the first 3 Qubits represent the variables, the 5 Qubits labelled c seem to be simple booleans that indicate wether a clause is satisfied, the one labelled o is some sort of output and the remaining 3 are some sort of ancillaries.
What happens in the first 3 Qubits seems obvious as well (not 100% confident though), it just transforms the given clauses into binary values on the qubits.
After the modification of the qubits there is an OR-Circuit that checks wether any one of the qubits satisfies the given clause. If that is the case, it flips the Qubit representing the corresponding clause (c0 for the first clause). I think it also flips the a0 Qubit, but I am unsure as to what the purpose of this is.
This is repeated for every clause, until an AND-Circuit finally checks if all clauses are satisfied. I fail to understand what it does to the ancillary Qubits though.
After that the entire Circuit apart from the AND-Circuit is repeated to get back to the initial state.
I am confused as to how the output of this oracle actually looks. In other examples of Grover's Oracle it just flips the correct combinations but in this case that does not seem to make sense. Also I am confused as to where the measurement is actually taken, is it the ancilliary qubits?
I am sorry for presenting such a broad and vague question, but I don't know how to explain the issue I have any further.
For completeness sake I will also add the entire algorithm to hopefully clear up some confusion:
The Grover's algorithm in this case can be described as this circuit:
Where the Grover Operator Q is equal to:
"
"['physical-realization', 'photonics', 'optical-quantum-computing', 'quantum-optics']"," Title: What is an electro-optic switch?Body: I found an implementation of a CNOT in photonic QC and I just couldn't find any info on a component named "electro-optic switch"
- What does it do exactly?
- How does it work?
The implementation in question is this: https://arxiv.org/pdf/quant-ph/0607185
"
"['quantum-state', 'density-matrix', 'vqe', 'state-preparation']"," Title: How can a density matrix be prepared on a quantum register?Body: I am currently trying to implement the VQSE algorithm.
There the biggest eigenvalues and their corresponding eigenvectors of a density matrix $\rho$ are computed.
In contrast to VQE, the matrix $\rho$ is not used in the cost function (as observable), but as the input for the circuit.
Lets say $\rho$ is in $\mathbb{C}^{2^n \times 2^n}$ so the eigenvectors are in $\mathbb{C}^{2^n}$. I need $n$ qubits to represent the eigenvectors. I could just interpret the density matrix 'flattened' as a $\mathbb{C}^{{2^n}{2^n}} = \mathbb{C}^{2^{2n}}$ vector. Then I could do something like amplitude encoding on $2n$ qubits to represent the matrix. But I am very certain that this is not the idea of the paper. There $\rho$ has to be encoded in $n$ qubits. I looked into density matrix purification but I do not know if/how I can compute that for an arbitrary density matrix where I don't know how the density matrix got composed.
Edit:
Is purification of the density matrix the right idea? But then how can that be done for an arbitrary density matrix? (Let $\rho = \sum_i p_i \left|\psi_i\right\rangle\left\langle\psi_i\right|$, I know the values of $\rho$ but not of $\left|\psi_i\right\rangle$ or $p_i$). Or is there another way to encode a density matrix of $n$ qubit states in an $n$ qubit quantum register?
"
"['complexity-theory', 'classical-computing', 'fourier-sampling']"," Title: Why is sampling considered difficult on a classical computer but easy on a quantum computer?Body: It is my understanding that classical computers have a hard time sampling results from an output from a quantum circuit, but quantum computers find it very easy to do so. Why is this?
"
"['machine-learning', 'quantum-enhanced-machine-learning']"," Title: Reconstructing classical data from quantum feature mapsBody: In the paper [Supervised learning with quantum enhanced feature spaces (Nature, arxiv) by Havlicek et al., a feature map is defined by
$$| \Phi(\bar{x})\rangle=U_{\Phi(\bar x)}H^{\otimes n} U_{\Phi(\bar x)}H^{\otimes n} |0\rangle^{\otimes n},$$
where $U_{\Phi(\bar x)}=\exp(i \sum_{S\subseteq [n]} \phi_S(\bar x) \prod_{i\in S} Z_i)$.
I'm interested in the case where $|S| \leq 2$, $\phi_{\{i\}}(\bar x)=x_i$ and $\phi_{\{i,j\}}(\bar x)=(\pi-x_i)(\pi-x_j)$.
My question: given $|\Phi( \bar x)\rangle$, is there any way to reconstruct $\bar x$? You may assume that each $x_i$ is from $[-\pi, \pi]$.
"
"['programming', 'qiskit', 'quantum-circuit']"," Title: Cascade/Feedforward quantum circuitsBody: I would like to know if it is possible implement the following situation in Qiskit (either using the simulators or real quantum computers).
Consider this illustrative toy example:
The arrows illustrate that the outcomes $\{\sigma_1,...,\sigma_i\}$ determine the unitaries $U_j$ for $j=i+1,...,n$.
That is, the idea is that the unitary $U_2$ can only be determined once the outcome $\sigma_1$ is known, then the unitary $U_3$ can be determined once $\sigma_1$ and $\sigma_2$ are known, and so on and so forth as we move along the circuit.
The main idea and difficulty is precisely that we do not know the unitaries a priori and need to calculate them from the previous outcomes. (Note that determining all the possible unitary sequences before we start the computation would mean $2^n$ possible sequences for a computation with $n$ layers.)
So basically, I need Qiskit to run the blue box, do the first measurement and stay in "stand-by" (so to speak) while I determine what $U_2$ is. Once I have that information I would have to append $U_2$ to the previous circuit and execute this new portion of the circuit alone (i.e. without running the previous one again!). (If Qiskit re-executes the first block again, it might get the wrong outcome for $\sigma_1$ and everything will be ruined). Is this possible at all? If not: (i) what is the next best thing? and (ii) is there a prediction for when such functionality will be available and in which shape?
Thank you all!
EDIT:
I seem to be looking for this: https://www.ibm.com/blogs/research/2021/02/quantum-phase-estimation/ ("dynamic quantum circuits"). There is also the arxiv pre-print reporting this: https://arxiv.org/abs/2102.01682.
Now, I need only understand if this is a functionality that is accessible to general IBMQ users like myself, or if it is still to be made available.
Particularly, what I want is what the authors call "real-time compute" or "classical real-time logic". Because what I want to write is an algorithm that requires a dynamic circuit, not a static one.
"
"['hadamard', 'quantum-walks']"," Title: How does a Hadamard discrete-time quantum walk result in a skewed distribution?Body: I was reading this tutorial about discrete random walk and got confused by the following paragraph.
After the succession of Hadamard applications ($H$), I wonder how do we get skewed distribution. I can understand this could happen with noise or erroneous $H$ operation. If the Hadamard operation is perfect, then it would produce the equal split and yield the classical behavior, no?
Thanks.
"
"['quantum-gate', 'continuous-variable']"," Title: Is there a way to directly construct controlled gates in continuous variable (CV) quantum computation?Body: We know that a universal gate set for CV quantum computation is that of squeezing, beam splitters, and some nonlinear gate (e.g. this answer). We also know from Knill, Laflamme, and Milburn that linear optics plus some postselection is enough to universally do CV quantum computation (e.g. this answer). Is there a direct way to implement an arbitrary controlled operation in CV quantum computation? More specifically, can this be done using only Gaussian states and, perhaps, postselection (which, I guess, makes states non-Gaussian)?
The controlled gates I am envisioning are controlled Gaussian operations such as displacements that depend on whether or not a control mode is vacuum or nonvaccum. An operator of the form
$$cD\sim|0\rangle\langle 0|\otimes \hat{D}(\beta_1)+ |\alpha\rangle\langle \alpha|\otimes \hat{D}(\beta_2)$$ would be ideal, where I realize there will be problems with the overlap $\langle \alpha|0\rangle$.
Is this type of thing directly possible, or do we have to convert between a whole bunch of things to make progress (eg create TMSV, post select on a single photon in one mode, use the single photon to control some phase shift, then use the phase shift to do some Gaussian operation)?
Even a gate like
$$cD\sim|0\rangle\langle 0|\otimes \hat{D}(\beta_1)+ |1\rangle\langle 1|\otimes \hat{D}(\beta_2)$$ would be helpful - I could see this being easier.
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'inner-product']"," Title: How can I prove inequality from 4.66 to 4.67 in Nielson and Chuang's book?Body: I am reading chapter 4 of Nielson and Chuang's QCQI book.
I cannot prove the inequality from (4.66) to (4.67) in page 195.
That inequality is the following:
$$ |\langle\psi|U^\dagger M|\Delta\rangle|+|\langle\Delta|MV|\psi\rangle| \leq \|{|\Delta\rangle}\| + \|
|\Delta\rangle \|$$
$U,V$ are arbitrary unitary operators, $|\psi\rangle$ is an arbitrary state, $M$ is an POVM element, and $|\Delta\rangle = (U-V)|\psi\rangle$.
How can I prove this inequality?
"
"['quantum-gate', 'nielsen-and-chuang', 'gate-synthesis', 'quantum-circuit', 'hadamard']"," Title: How to visualize Hadamard gate as $X$-$Z$-$X$ decomposition?Body: In the book Quantum Computation and Quantum Information by Nielsen and Chuang, chapter 4, exercise 4.4 (pg. 175), the author has asked to express Hadamard gate as product of $R_x$, $R_z$ rotations and $e^{i\phi}$ for some angle $\phi$. I have found two answers for the same.
- Rotating the Hadamard gate parallel to $|0\rangle$ performing the rotation about $Z$ axis and reverting back to original position. Elaborate mathematical visualisation can be found in the question asked here. Rewriting rotations as:
\begin{array}
\
&= e^{i\pi/2}R_z(-\pi/2)R_x(-\pi/4)R_z(\pi)R_x(\pi/4)R_z(\pi/2) \\
&= \frac{1}{\sqrt{2}}
\begin{bmatrix}
1 & 1\\
1 & -1 \end{bmatrix}\\
&=H
\end{array}
I have understood this decomposition very well. Though, its cumbersome to arrive write this decomposition. This led me to the second option.
- The other way is analytically explained in this pdf. This yields $X$-$Z$-$X$ decomposition as:
\begin{array}
\
&= e^{i\pi/2}R_x(\pi/2)R_z(\pi/2)R_x(\pi/2) \\
&= \frac{1}{\sqrt{2}}
\begin{bmatrix}
1 & 1\\
1 & -1 \end{bmatrix}\\
&=H
\end{array}
Now, how should I visualize, or intuitively arrive at this second decomposition?
The only way that comes to my mind is to transform $|0\rangle$ and $\frac{|0\rangle + i|1\rangle}{\sqrt{2}}$ around rotation vector of Hadamard gate under $X$-$Z$-$X$ transformation as discussed in point 1 (here). Are there better visualizations possible?
[First edit]
By visualization, I mean, the mental shortcut to decompose Hadamard gate into $R_x(\beta)R_z(\gamma)R_x(\rho)$, without doing the complete matrix multiplication, like,just knowing the Bloch angles made by the axis of rotation of Hadamard gate I can decompose it as $R_z(-\pi/2)R_x(-\pi/4)R_z(\pi)R_x(\pi/4)R_z(\pi/2)$ without bothering to multiply five $2X2$ matrices.
"
"['mathematics', 'linear-algebra']"," Title: Creating orthogonal quantum states from a set of given (possibly linearly independent) quantum statesBody: I want to understand how to orthogonalize a system of qubits.
Suppose I have $n$ sets of quantum states like
$$\{ |1_i\rangle|2_i\rangle|3_i\rangle \cdots|k_i\rangle \mid i=1 \dots n \}$$ where $i=1, \dots, n$ is number of states in the sets with $k$ tensor products.
Now I am interested in orthogonalizing these set of $n$ states. Especially I want to use the Gram-Schmidt orthogonalization procedure here.
But I don't understand how to think from here.
Cross-posted on math.SE
"
"['qiskit', 'hamiltonian-simulation', 'quantum-fourier-transform', 'phase-estimation']"," Title: Implementation of the Phase Estimation algorithmBody: I've been working on implementing quantum phase estimation in Qiskit for a $2^n \times 2^n$ Hamiltonian as part of my bachelor project, I'm using Trotterization as my Hamiltonian simulation of choice and can't quite get it to work. All my tests of the individual parts of the circuit seem correct at a glance and yet it isn't working properly.
The code is available here. To go through the relevant aspects of the code quickly, I firstly define QFT_dagger, then implement three functions that allow for Hamiltonian simulation (pauli_traces, exp_product and decompose). Last function before running the code, is PhaseEst, that runs the full phase estimation algorithm, using the functions mentioned prior.
I've tried running this for the Pauli $X$ gate as my Hamiltonian and with values of $t$ mostly ranging from $1$ to $5$ and $r = (t^2/\epsilon)$, with $\epsilon$ being the desired error, usually of size $1$ to $0.1$. This seems to give best results for $t = 1$ if at all reasonable results. I've also tried replacing my Hamiltonian simulation code with that of fellow user Davit Khachatryan.
If anyone might have an inkling as to what may be causing the implementation to fall flat, then kindly let me know. Additionally, if further information is required, feel free to let me know.
"
"['quantum-state', 'entanglement', 'quantum-optics']"," Title: How is this expression for a GHZ state obtained in the nature paper by Pan et al. (2000)?Body: Can someone tell me how the authors of the paper "Experimental test of quantum nonlocality" (Nature link to abstract) have rewritten their equation 1 in terms of equation 2 and 3?
"
"['quantum-operation', 'noise', 'kraus-representation', 'quantum-control']"," Title: What are examples of Kraus operators describing the process of control error?Body: Noise, such as photon loss or dephasing, is often described with Kraus operators.
Are there examples of Kraus operators describing the process of control error?
"
"['quantum-gate', 'textbook-and-exercises', 'tensor-product']"," Title: How the single qubit unitary (U) calculates when apply a gate to only one qubit at a time?Body: Qiskit Textbook, Chapter 2, Section 2.2. Single Qubit Gates on Multi-Qubit Statevectors (here).
In here, they have described that: If we want to apply a gate to only one qubit at a time (such as in the circuit below), we describe this using tensor product with the identity matrix, e.g.: $X\otimes I$.
By executing the given code, the tensor product matrix generated corresponds to when X-gate is applied to qubit 1 in circuit.
qc = QuantumCircuit(2)
qc.x(1)
qc.draw()
# Simulate the unitary
usim = Aer.get_backend('unitary_simulator')
qobj = assemble(qc)
unitary = usim.run(qobj).result().get_unitary()
# Display the results:
array_to_latex(unitary, pretext="\\text{Circuit = } ")
The output is:
When I tried to change the $X$ gate position to qubit 0 (qc.x(0)) then the tensor product matrix is changed (refer to image attached below). My doubt is: in this case how is the tensor product calculated, shouldn't it be the same?
"
"['measurement', 'entropy']"," Title: Computing $H(Z|B)$ in a bipartite density matrix $\rho_{AB}$Body: Let's say Bob prepares a bipartite quantum state $\rho_{AB}$ to be shared between him and Alice. Bob sends Alice's part to her lab. Alice measures her subsystem $A$ in the computational basis $\mathcal{Z}$. Now we want to know the uncertainty in Alice's system given Bob's quantum memory register($B$). This quantity is denoted as $H(Z|B)$.
I was reading this paper by Berta et al. where they mention in a footnote (page 2, footnote 4) that $H(R|B)$ is the conditional von Neumann entropy of the following state:
$$
\left(\sum_j |\psi_j \rangle \langle\psi_j| \otimes \mathbb{1} \right) \rho_{AB} \left(\sum_j |\psi_j \rangle \langle\psi_j| \otimes \mathbb{1} \right),
$$
where $|\psi_j \rangle$ is the eigenvector of the measurement $\mathcal{R}$. In our case, this would be $\mathcal{Z}$.
My confusion now is this. We know that the sum of eigenvectors of the computational basis $\mathcal{Z}$ makes up the identity matrix $\mathbb{1}$ again. In this case, isn't it becoming the following?
$$
\left(\mathbb{1} \otimes \mathbb{1} \right) \rho_{AB} \left( \mathbb{1} \otimes \mathbb{1} \right) = \rho_{AB},
$$
in which case the conditional von Neumann entropy is simply $H(A|B)$. In the end, are we getting $H(Z|B) = H(A|B)$? This does not seem correct though. Thanks in advance.
"
"['quantum-gate', 'circuit-construction', 'complexity-theory', 'gate-synthesis', 'optimization']"," Title: Complexity of $n$-Toffoli with phase differenceBody: I'm interested in the $n$-Toffoli gates with phase differences. I found a quadratic technique in section 7.2 of this paper.
Here's the front page of the paper.
Here's an image of the section that I'm referring to.
Does anyone know if there has been any improvement on the decomposition of the general n-qubits control X with phase differences in terms of elementary gates up to this day? Phase differences have to be consistent but not need fixing. Feedback is not allowed and no ancilla qubits are used.
And also what is the theoretical lower bound?
"
"['qiskit', 'grovers-algorithm']"," Title: Grover's algorithm outputting random/incorrect resultsBody: I am sorry if this question is trivial, I am relatively new to QC. Here is my grover's circuit, as you can see it is displaying that it has a 100% probability of measuring 100
however when placed into the quantum simulator (IBMQ statevector) here is the result:
I am stumped as to why this is the case. it clearly displays 100% output probability which means the algorithm is working right? Or am I missing something fundamental?
Edit:
OKAY? I fixed it somehow? by getting rid of the bottom H gate? I am even more confused than I was before. Why is this working, how does this work?
"
"['programming', 'qiskit']"," Title: Issues in calculating exact runtime on ibmq_16_melbourneBody: I am working on calculating the exact runtime of a quantum circuit on the ibmq_16_melbourne device. I am using the API result.time_taken to calculate the run time.
result = execute(circuit, backend, shots=8000).result()
counts = result.get_counts(circuit)
print(counts)
print("Time taken: ", result.time_taken)
I executed by python code on ibm quantum lab (which is a Jupyter notebook) and also using Pycharm on my laptop. I get huge variations in the results. So, I concluded that result.time_taken does not provide the run time correctly. I am going through the documentation, but still could not find the solution.
Please provide some solution to calculate exact runtime.
"
"['quantum-state', 'measurement']"," Title: What are the possible initial states that can be prepared in a lab for use in a quantum computation?Body: So here's something that's been bothering me. Given the time evolution of the wavefunction can only be unitary or discontinuous as a process of the measurement. So let the observables for our Hamiltonian be position $\hat x$, momentum $\hat p$ and energy $\hat H$. Does this mean the only possible states I can prepare in the lab are:
$$|\phi_1 \rangle = |E_0 \rangle $$
or
$$|\phi_2 \rangle = U|x_0 \rangle $$
or
$$|\phi_3 \rangle = U|p_0 \rangle $$
where $U$ is the unitary operator at arbitrary $t$, $| x_0\rangle$ is an arbitrary position eigenket, $|p_0 \rangle$ is an arbitrary momentum eigenket and $|E_0 \rangle$ is an arbitrary energy eigenket? Am I correct in interpreting this as meaning that there are only certain quantum computations which can be performed with such a system (in the sense that there is limited initial data one might input)?
Cross-posted on physics.SE
"
"['programming', 'qiskit']"," Title: IBMQ.load_account() is failingBody: When I try IBMQ.load_account or IBMQ.delete_account gives an error in the ubuntu machine and the error is,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anaconda3/lib/python3.7/site-packages/qiskit/providers/ibmq/ibmqfactory.py", line 291, in delete_account
stored_credentials, _ = read_credentials_from_qiskitrc()
File "/home/anaconda3/lib/python3.7/site-packages/qiskit/providers/ibmq/credentials/configrc.py", line 86, in read_credentials_from_qiskitrc
new_credentials = Credentials(**single_credentials) # type: ignore[arg-type]
TypeError: __init__() got an unexpected keyword argument 'efault_provider'
The qiskit version I used is
{'qiskit-terra': '0.17.4',
'qiskit-aer': '0.8.2',
'qiskit-ignis': '0.6.0',
'qiskit-ibmq-provider': '0.14.0',
'qiskit-aqua': '0.9.2',
'qiskit': '0.27.0',
'qiskit-nature': None,
'qiskit-finance': None,
'qiskit-optimization': None,
'qiskit-machine-learning': None}
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'information-theory', 'entropy']"," Title: Understanding the definition of entropy in the joint entropy theorem derivationBody: 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}
I do not understand the last step $- \sum_ip_i\log p_i = H\left(p_i\right)$. I thought the definition of binary entropy is $H(p_{i}) = -p_{i}\log p_{i} - (1-p_{i})\log (1-p_{i})$. This does not give the desired equality.
Moreover, it is rather confusing that $i$ is used as a running index, and suddently it becomes a fixed index in the last equality.
Thanks for any helps.
"
"['algorithm', 'vqe', 'chemistry', 'applications']"," Title: Is VQE or one of its variations enough to help with medicine development?Body: One of the reasons quantum computing is often hyped in media is because of how it'll help with vaccine and medicine development. For example, this article in Financial Express and this other in Venture Beat.
However, these articles just say things like
Quantum computing can speed up vaccine development by solving complex equations with higher accuracy than classical computing.
and
The continued development of quantum computers, if successful, will allow for end-to-end in-silico drug discovery and the discovery of procedures to fabricate the drug.
The second article I linked also talks about how a quantum computer only takes about 286 qubits to simulate penicillin while classical computers would take over $10^{86}$ bits. It doesn't talk about the algorithm used to perform this simulation, but I guess it is VQE or some variation of it.
My question is: is VQE or one of its variations enough to actually help with vaccine/medicine development? If not, is there any algorithm that has been or is being developed with the purpose of helping vaccine/medicine development?
I found some references in this answer. But I would like to know more about the details of the specific algorithms they're developing, e.g. what properties of the molecules they try to simulate they are exploiting, what has resulted from these algorithms that may be useful outside of this niche purpose, and anything like this.
"
"['quantum-gate', 'circuit-construction', 'mathematics', 'quantum-circuit', 'probability']"," Title: Marginal output probability of first bit for constant-depth circuitsBody: Consider a constant depth $1\text{D}$ quantum circuit, which is applied to the input state $|0^{n}\rangle$, and whose output is measured in the standard basis. You can assume that the gates of the circuit come from a fixed universal gate set, like $\{\text{Toffoli}, \text{Hadamard} \}$.
Let $p_{x_1}$ be the marginal probability of the first bit of the output. Is it true that
\begin{equation}
p_{x_1} = \frac{1}{2} \pm c,
\end{equation}
for some $0 \leq c \leq \frac{1}{2}$ that has no dependence on $n$, but that depends on the gates used and the depth of the circuit?
An observation (which might be relevant) is to note that the backward lightcone of the first bit is of a constant size. Hence, only a constant fraction of the inputs "influence" what happens to the first bit. For every given constant depth circuit, we can cleave out a different quantum circuit, having a constant number of inputs and a constant number of gates such that the marginal probability of the first bit is same for both circuits. Since there is no dependence of $n$ in the second circuit, is this sufficient to conclude what I want?
"
"['programming', 'qiskit', 'transpile']"," Title: Why qiskit transpiler makes different results everytime? (Non-deterministic)Body: I tried to do qubit mapping called 'SABRE' and execute transpiled quantum circuit.
I use FakeTokyo backend which has some noise because it is mock version of IBMQ 20-Tokyo.
I know using this backend makes some noise but will not change final result when I measure my circuit. But, when I transpile my quantum circuit like below code, the result is always different. I wonder why this happens.
Source code:
from qiskit.test.mock import FakeTokyo
from qiskit.circuit.measure import measure
from qiskit.execute_function import execute
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.compiler import transpile
backend = FakeTokyo()
final_circuit = transpile(circuits=circuit,
backend=backend,
routing_method='sabre',
layout_method='sabre',
basis_gates=['u1', 'u2', 'u3', 'cx', 'id'])
final_circuit.barrier()
final_circuit.measure_all()
results = execute(final_circuit, backend).result()
counts = results.get_counts()
print("result : ", counts)
circuits = circuit means I input list of quantum circuits into transpile function. I really don't know why the results always different.
"
"['grovers-algorithm', 'complexity-theory', 'quantum-circuit']"," Title: Query complexity on Quantum Pattern Matching of Mateus AlgorithmBody: I am trying to understand the complexity of the Mateus and Omar algorithm for quantum pattern matching, it is clear to me from the pseudocode that the query complexity is $O(\sqrt{N})$, apart from the cost of setting up the initial state:
$$
\frac{1}{\sqrt{N-M+1}}\sum_{k=1}^{N-M+1}|k,k+1,...,k+M-1⟩
$$
After that, they conclude that the algorithm has an efficient compile time of $O(N\log^{2}(N)\times |\Sigma|)$ and a total runtime of $O(M\log^{3}(N)+N^{3/2}\log^{2}\log(M))$, but query complexity $O(\sqrt{N})$.
My question is, if I devise an algorithm with, for example, a processing step of $O(N^{2})$ circuit complexity but $O(\sqrt{N})$ query complexity. Is it completely fine to say that it is faster than a classical equivalent with, for example $O(N)$ complexity? I'm a bit stuck trying to figure this out.
"
"['programming', 'qiskit', 'measurement']"," Title: How to get measurement result on QiskitBody: I want to get measurement result from my circuit output, like '00', '01', '10', or '11' because want to process it further classically. Any suggestion? We can see the highest probability '01'. How I can extract the result?
"
['unitarity']," Title: What is the general formula for unitary rotations in terms of Pauli spin operators?Body: Recently I have read a paper in which they have used a unitary transformation as follows:
$$U_{\frac{7\pi}{16}}=\cos\left(\frac{7\pi}{8}\right)\sigma_{z}+\sin\left(\frac{7\pi}{8}\right)\sigma_{x}$$
Here $ \sigma_{x} $ and $\sigma_{z}$ are the Pauli operators. I didn't understand where this came from? Also are any other combinations of sigma operators with any angles is a Unitary rotation? Do anyone know of any general formula for Unitary rotation? Any references would be great.
Please see Eq. (3) in the paper: Experimental test of local observer-independence.
Why I am concerned about the above unitary operator is:
Please see the below definition for the rotation operators. Here there is an imaginary $i$ coming which is not in the paper I have mentioned.
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang', 'quantum-circuit', 'universal-gates']"," Title: Exercise 4.41 in N&C book QCQI: how can i implement $R_z(\theta)$ using the circuit shown and $Z$?Body: I'm studying Nielsen and Chuang's book.
I cannot solve one of the questions in the exercise 4.41.
The question is the last one that is
Explain how repeated use of this circuit and Z gates may be used to apply a $R_z(\theta)$ gate with probability approaching 1.
I found the last state of the circuit is
$|\psi_{3}\rangle = |00\rangle(\frac{10^{1/2}}{4})e^{i\pi/4}R_z(\theta)|\psi\rangle +(-|01\rangle-|10\rangle+|11\rangle)\frac{1}{4}e^{-i\pi/4}Z|\psi\rangle$
I put the picture of the circuit below.
How can i solve this problem?
Thanks
"
"['quantum-state', 'algorithm']"," Title: How to decompose given 4x4 matrix to one and two qubit unitary matrices?Body: I have matrix $B=\begin{bmatrix}0&&0&&0&&0\\0&&1&&0&&0\\0&&0&&2&&0\\0&&0&&0&&3\end{bmatrix}$.
By doing $A=e^{\pi i B/2}$, I get $A=\begin{bmatrix}0&&0&&0&&0\\0&&i&&0&&0\\0&&0&&-1&&0\\0&&0&&0&&-i\end{bmatrix}$. Now I have to implement this gate to two qubits with controlled operation, Controlled-A. How can I implement this gate? This is the paper from which I got matrices A and B and they have implemented Controlled-A gate. I am curious how they did that. I tried to read the references they provided but couldn't get anything related to this.
Research Paper
Any hints or approaches would be helpful.
"
"['mathematics', 'unitarity']"," Title: How to sample vectors close to the minimum eigenvector of a unitary matrix?Body: Say that we have an unknown $2^{n}\times2^{n}$ unitary matrix $U$ with eigenvectors $|v_{i}\rangle$ and eigenvalues $e^{2\pi j \theta_{i}}$and we want to sample a vector, say $|\phi \rangle$. Since the eigenvectors of $U$ form an orthonormal basis, $|\phi \rangle$ can be written as
$$ |\phi \rangle = \sum_{i} \alpha_{i}|v_{i} \rangle,$$
where $|\alpha_{i}|^{2}$ is the probability of $|\phi \rangle$ collapsing to any of the eigenvector states $|v_{i}\rangle$.
Let us assume that there is no degeneracy and there exists some minimum eigenvalue $\theta_{k}$ with the associated eigenvector $|v_{k}\rangle$. What I want to know is whether there is a way to sample $|\phi \rangle$ such that amongst all the eigenvectors $|v_{i}\rangle$, it is closest to $|v_{k}\rangle$. In other words, $|\phi \rangle$ is such that -
$$ | \langle v_{k}|\phi\rangle|^{2} > | \langle v_{i}|\phi\rangle|^{2},\qquad \forall\ i \neq k.$$
"
['simons-algorithm']," Title: How is the factorization of the XOR operator done?Body: I am trying to understand Simon's Algorithm now, but I am confused as to how the factorization of the XOR operator in $$\begin{aligned}
\alpha_y &= \frac 1{\sqrt 2}(-1)^{r\cdot y} + (-1)^{(r \oplus s)\cdot
y}\\ &=\frac 1{\sqrt 2}(-1)^{r\cdot y}(1+ (-1)^{s\cdot
y})\end{aligned}$$ works. After the factorization, ${r\cdot y}$ and ${s\cdot y}$ seem to just be products of one another.
"
"['quantum-gate', 'algorithm', 'circuit-construction', 'unitarity']"," Title: An algorithm to perform Gram-Schmidt orthogonalization of linearly independent state vectorsBody: In the first paragraph of the 2nd section of this article, it is stated that given a set of linearly independent $n$-qubit state vectors, Alice can perform the Gram-Schmidt procedure to obtain orthogonal quantum states.
But I know the Gram-Shmidt process is not a unitary operation, so is it possible to come up with an algorithm, using ancillary qubits or something?
I.e., if we have $M$ arbitrary, linearly independent $n$-qubit state vectors $\{ |x_1\rangle, |x_2\rangle, |x_3\rangle, \cdots , |x_M\rangle \}$ do we have an algorithm to perform Gram-Schmidt orthogonalization on this set to obtain a set of mutually orthogonal state vectors and can we construct the corresponding circuit?
"
"['programming', 'qiskit']"," Title: Are job IDs unique across backends?Body: Are job IDs unique across backends, or is it possible that two jobs on two different backends have the same job ID? I'd like to use the job ID as primary key in a database.
Thanks in advance!
"
['graph-states']," Title: Quantum Graph states hand computationBody: I am reading an article on Quantum Graph states. I wanted to ask a few questions.
The Graph state is $$|G\rangle=\prod_{e\in G}CZ |+\rangle^{\otimes n}$$
Now my first question is if I apply the Controlled Z gate say between vertices $a$ and $b$ then do I also apply the Controlled Z between $b$ and $a$. I have done the calculation on 3 qubits with edges between vertices $(1,2)$ and $(1,3)$ with applying CZ between $(1,2)$ and $(1,3)$ and not $(2,1)$ and $(3,1)$. My calculations are
$$|G\rangle=\prod_{e\in G}CZ |+\rangle^{\otimes 3}=|000\rangle+|010\rangle+|100\rangle-|110\rangle+|001\rangle+|011\rangle-|101\rangle-|111\rangle$$
Is this correct?
Further, the paper that I am reading said that if I apply the $S$ gate on the first qubit
the state is changed to $$|0++\rangle+i|1--\rangle$$ but I am getting $$|0++\rangle-i|1--\rangle$$
The paper that I am reading is https://journals.aps.org/pra/abstract/10.1103/PhysRevA.78.042309.
"
"['programming', 'qiskit', 'quantum-gate']"," Title: Extract the Crosstalk noise of a circuit in QiskitBody: I'm new to Quantum Computing. How to extract the cross-talk noise of a quantum circuit using qiskit? Can someone provide an example code for this?
"
"['quantum-state', 'entanglement', 'measurement', 'textbook-and-exercises', 'state-discrimination']"," Title: Distinguishing $\frac{| 0 \rangle + e^{i\theta} |1 \rangle}{\sqrt{2}} $ from $| 0 \rangle/|1 \rangle$ with probability $1/2 + \epsilon$Body: I am given one copy of one of two quantum states -
- $\frac{| 0 \rangle + e^{i\theta} | 1 \rangle}{\sqrt{2}} $, for some unknown fixed $\theta$.
- One of $| 0 \rangle/|1 \rangle$ - don't know which one, but one of the two.
I need to guess which one of the above two cases it is. Note that one can always guess this with probability $1/2$. So, to make the problem non-trivial we want to guess with any probability better than $1/2$ - i.e. with $1/2 + \epsilon$, for any $\epsilon > 0$.
Here are some more details on the constraints/things I have tried, but don't work.
- The state need not be reusable after this guess - so we can perform any kind of measurement we want. The only constraint is that we are only given one copy of the quantum state.
- This problem is different from quantum state distinguishability problem. Why? because here we are only given one copy of the quantum state. In addition, we need to tell apart the two cases with any probability better than $1/2$.
- This can also be thought of geometrically in the bloch sphere - in the first case, the quantum state lies in the X-Y plane and in the second case, it lies along the Z-axis.
- Note also that if $\theta$ were known in the first case - like if the first case were $|+\rangle$, then we could just measure in the $\{|+\rangle,|-\rangle\}$ basis - then if we were given $|+\rangle$, we always observe $|+\rangle$ outcome, while if we were given $|0\rangle / |1\rangle$, we would observe $|-\rangle$ as well and we could tell the two cases apart with probability $3/4$.
- I have also tried to think of if we can use POVMs to do this - this paper - https://arxiv.org/pdf/quant-ph/0604189.pdf - gives a way to visualize POVMs geometrically - but I can't think of how to use it either.
- Note that I can peform a CNOT on a $|0\rangle$ state with the given state as control - and in that case, if it were case 1, then I get an entangled state, while in case 2, I get a product state. Hence, this problem can also be seen as telling apart an entangled state from product state but using a single copy. However, it seems much easier than general single copy entanglement detection, because here I only need to tell apart the cases with any probability $1/2 + \epsilon$. Looking up some research literature on single copy entanglement detection, I found this - https://www.nature.com/articles/s41534-017-0055-x.pdf - but it seems the paper's results are on special kinds of states and not general quantum states.
- A final way which I haven't exhausted is applying a unitary and doing multiple measurements somehow - even though the state collapses after each measurement, maybe there is a way I can count how many measurements I need till I get some particular state, which is detectable. But can't think of anything in this line.
Any help/leads would be very appreciated / any thoughts on if this is not possible as well.
Thanks!
"
"['information-theory', 'entropy', 'mutual-information']"," Title: How to prove the positivity of the conditional quantum mutual information, $I(A;B|C)\ge0$?Body: I was reading Wilde's 'Quantum Information Theory' and saw the following theorem at chapter 11 $(11.7.2)$:
$$
I(A; B | C) \ge 0,
$$
where,
$$
I(A;B|C) := H(A|C) + H(B | C) - H(AB|C).
$$
I know that the mutual information is non-negative, i.e.
$$
I(A;B) \ge 0,
$$
where,
$$
I(A;B) := H(A) + H(B) - H(AB).
$$
Now if we have access to an additional subsystem $C$, this can't decrease the mutual information of $A$ and $B$. But I was looking for sort of formal proof of this. I was trying to apply the non-negativity of mutual info. into this, but not sure how to proceed. Thanks in advance!
"
"['mathematics', 'linear-algebra', 'probability', 'simons-algorithm']"," Title: How is the probability of success for Simon's algorithm determined?Body: In step 3 of Simon's algorithm, we are told to "Repeat until there are enough such $y$’s that we can classically solve for $s$."
It then goes on:
The above are from this course notes.
I am not sure how this probability was calculated. Especially, why are there $2^{n-1}$ $y$'s such that $$y \cdot s = y_1s_1+y_2s_2 +\cdots y_ns_n = 0$$
I understand that there are n-1 non-trivial, linearly independent solutions to $y \cdot s = 0$, but how is $2^{n-1}$ obtained?
"
"['algorithm', 'complexity-theory', 'quantum-circuit', 'quantum-advantage', 'random-quantum-circuit']"," Title: Feynman method and polynomial time algorithm for XQUATHBody: Consider the Feynman algorithm for simulating quantum circuits, as given here.
Consider the XQUATH conjecture for random quantum circuits from here, given by
(XQUATH, or Linear Cross-Entropy Quantum Threshold Assumption). There
is no polynomial-time classical algorithm that takes as input a
quantum circuit $C \leftarrow D$ and produces an estimate $p$ of
$p_0$ = Pr[C outputs $|0^{n}\rangle$] such that \begin{equation}
E[(p_0 − p)^{2}] = E[(p_0 − 2^{−n})^{2}] − Ω(2^{−3n}) \end{equation}
where the expectations are taken over circuits $C$ as well as the
algorithm’s internal randomness.
It is mentioned in the paper that the Feynman method comes close to spoofing XQUATH. The authors remark:
The simplest way to attempt to refute XQUATH might be to try $k$
random Feynman paths of the circuit, all of which terminate at $|0^{n}
\rangle$, and take the empirical mean over their contributions to the
amplitude.
Does this yield a polynomial time algorithm though? What is the time taken to compute each Feynman path? Assume that each gate is acts non trivially on at most two qubits.
On a related note, the wikipedia link, it is mentioned that the Feynman algorithm, in general, takes $4^{m}$ time and $(m+n)$ space --- I do not see why that is so.
"
"['quantum-state', 'mathematics', 'unitarity']"," Title: What is the eigenvalue distribution of arbitrary unitary matrices?Body: I had a question regarding the nature of the eigenvalue distribution of unitary matrices.
Searching for the answer I found that the unitary matrices which are sampled randomly have a defined eigenvalue distribution. What I would like to know is that can we comment on the distribution of the eigenvalues for any arbitrary unitary matrix too? It would be really great if someone could point to some resources for this. Thanks!
"
['graph-states']," Title: Possible typo in the paper ""Graph states for quantum secret sharing""Body: Continuing from my last question that I posted about a paper on Graph States. I have another doubt regarding a possible typo error in the paper. Here it goes. The authors define a 'labeled state' as
$$|G_{\vec{l}}\rangle=\bigotimes_{i}X_i^{l_{i1}}Z_i^{l_{i2}}|G'\rangle$$where G is a graph state.
Then they define an 'encoded graph state' as $$ |G_{\vec{l}_{*2}}\rangle=\bigotimes_{i}Z_i^{l_{i2}}|G'\rangle $$ and say that the encoded graph state is the labeled graph state with $l_{1i}=0, \forall i$.
Here $\vec{l}_{i*}=(l_{i1},l_{i2})$ for the i-th vertex, $\vec{l}_{*j}=(l_{1j},l_{2j},....l_{nj})$ for the $j$ th bit over all the $n$ vertices, and $\vec{l}=(\vec{l}_{1*}, \vec{l}_{2*},........\vec{l}_{n*}$, each $l_{ij}\in \{0,1\}$.
My question is shouldn't the condition be $l_{i1}=0, \forall i$, because only then the X gate is removed. Can somebody check?
The link for the paper is https://journals.aps.org/pra/abstract/10.1103/PhysRevA.78.042309
"
"['programming', 'd-wave']"," Title: Output of D-Wave LeapHybrid solver takes long to evaluateBody: we made the strange observation that the evaluation of the output in form of the dimod.SampleSet takes a long time to evaluate especially in comparison to the actual sampling step. Here is a minimal code example
import networkx as nx
import dimod
K_7 = nx.complete_graph(7)
bqm = dimod.generators.random.ran_r(1, K_7)
start = time.time()
hybrid_solver = LeapHybridSampler(solver = None, connection_close = False, token = TOKEN)
print('\nDuration init hybrid sampler', time.time() - start)
start = time.time()
sample_set = hybrid_solver.sample(bqm, time_limit=TIME_LIMIT_CLASSIC_SOLVER)
print('\nDuration get sample', time.time() - start)
start_time = time.time()
print(sample_set)
print('\n Duration print sample set', time.time() - start_time)
with the following output
Duration init hybrid sampler 2.8732540607452393
Duration get sample 2.669390916824341
0 1 2 3 4 5 6 energy num_oc.
0 -1 +1 +1 -1 -1 +1 +1 -9.0 1
['SPIN', 1 rows, 1 samples, 7 variables]
Duration print sample set 13.532737016677856
This means that the evaluation of the print statement right after the sampling of the hybrid solver is done, takes a long time to evaluate, much longer than the actual init and sampling step. We further made the observation, that if I print the sample set in another cell after waiting for roughly 13 seconds, the print statement is almost immediately evaluated. I also switched 'connection_close' from True to False and vice versa but nothing changed.
This makes me guess that there is still some sort of connection of the hybrid sampler to the backend ongoing which first needs to be closed before the sample set can be evaluated/printed locally.
Any ideas on how to fix this?
Thanks in advance and best regards,
Simon
EDIT: The question was answered in the dwave community forum: https://support.dwavesys.com/hc/en-us/community/posts/4403113729943-Output-of-LeapHybrid-takes-long-to-evaluate?page=1#community_comment_4403163648279
The reason is that the processing happens asynchronously.
"
"['programming', 'qiskit', 'quantum-gate', 'quantum-circuit']"," Title: How to construct a controlled $V$ gate in qiskit?Body: I have come across most of the quantum circuit which contains gate such as controlled $V$ and $V^{\dagger}$ but I dont know how to code it in Qiskit.
"
"['quantum-state', 'tomography']"," Title: Lower bounds on the number of measurements outcomes required for quantum state tomographyBody: It seems that in order to reconstruct a quantum state, a large number of measurements is typically used.
- Are there any known theoretical lower bounds on the number of measurements required to reconstruct a state?
- Do we get different lower bounds if we consider pure states instead of mixed states?
"
['quantum-fourier-transform']," Title: Rephase gate in implementaion of QFT of arbitray sizeBody: Talking about how exact size of QFT is achieved, both paper 1 and paper 2 skipped the implementation of gate $U$ that can do:
$$U|\alpha, \beta⟩ \mapsto exp\left(\frac{i2\pi}{N} \alpha\beta\right)|\alpha, \beta⟩$$
for arbitrary $N$ and arbitrary $\alpha,\beta \in \left\{0,..., 2^n-1\right\}$
(they believe this gate is easy).
Here is how I implement it:
I use the fact that
$\text{CONTROL}-P(\theta)|a, b⟩\mapsto e^{i\theta a b}|a, b⟩$
, where
$P(\theta)=\begin{pmatrix} 1 & 0 \\ 0 & e^{i\theta} \end{pmatrix}$ and $a,b\in \left\{0, 1\right\}$. Then,
$$
\begin{align}
exp&\left(\frac{i2\pi}{N} \alpha\beta\right)|\alpha, \beta⟩ \\
&=exp\left(\frac{i2\pi}{N} \sum_{i,j} 2^{i+j} \alpha_i \beta_j\right)|\alpha_0...\alpha_{n-1} , \beta_0...\beta_{n-1}⟩ \\
&=\bigotimes_{i, j} exp\left(\frac{i2\pi}{N}2^{i+j}\alpha_i \beta_j\right)|\alpha_i, \beta_j⟩ \\
&=\bigotimes_{i, j} \text{CONTROL}-P(\phi_{ij})|\alpha_i, \beta_j⟩, \text{ where } \phi_{ij}=\frac{2\pi}{N}2^{i+j}.
\end{align}
$$
Therefore, I apply
$\text{CONTROL}-P(\theta)$ to $|\alpha_i, \beta_j⟩$ $\forall$ $i,j\in\left\{0,..., n-1\right\}$
and hence complete implementation of gate $U$.
Is this implementaion about $U$ correct?
Or more specficially, how do we achieve the operation
$|x, \Phi_0⟩\mapsto|x, \Phi_x⟩$?
Here
$$ |\Phi_n⟩=\text{QFT} |n⟩=\frac{1}{\sqrt{N}}\sum_{k=0}^{N-1}exp(\frac{i2\pi}{N}nk)|k⟩ $$
"
['stabilizer-code']," Title: Problem Understanding Logical X and Z operatorsBody: I am trying to understand the concept of Logical X and Z operators. That ${\bar{X}}$ and ${\bar{Z}}$, if that is what it is called.
I have multiple questions regarding this diagram. Help me understand wrt this figure and also if possible give some example:-
- How is that ${\bar{X}}$ and ${\bar{Z}}$ is calculated or found ?
- How is the ${\bar{X}}$ and ${\bar{Z}}$ different from the generators - IIIXXXX, IXXIIXX, XIXIXIX, etc. or is it any different?
- What is the meaning of the last line of fig. "Logical ${\bar{X}}$ and ${\bar{Z}}$ is TRANSVERSAL" ?
- Is the ${\bar{X}}$ and ${\bar{Z}}$ also called as "Encoded X and Z operators"
"
"['qiskit', 'transpile', 'sabre']"," Title: How to check accuracy of SABRE algorithm?Body: I'm studying the qubit mapping algorithm called SABRE. SABRE is an algorithm for solving qubit mapping problem effectively. It uses multiple SWAP gates to execute quantum circuit on real quantum device by mapping virtual qubits to physical qubits. Since each quantum devices has its own coupling graph (Connection of physical qubits), SABRE algorithm consider it and add additional SWAP gates to make quantum circuit executable on quantum device. If you want to see more detail about it you can see this paper. https://arxiv.org/abs/1809.02573
From now, I will tell you my problem. I can access the SABRE algorithm by using qiskit.
https://qiskit.org/documentation/stubs/qiskit.transpiler.passes.SabreSwap.html
I use qiskit transpiler to use SABRE and I know transpiler use random seed for each execution that makes every results not to be same.
Then how to check if the SABRE algorithm is right or wrong?
Is there any way to check SABRE algorithm's correctness?
I really wonder about this issue. Please kindly check my question and reply.
"
"['measurement', 'textbook-and-exercises', 'pennylane']"," Title: Why is $\langle \psi| \sigma_z |\psi \rangle=\cos(\phi_1)\cos(\phi_2)$ for $|\psi\rangle=R_y(\phi_2)R_x(\phi_1)|0\rangle$?Body: I'm trying some example with the rotation gates and stuck here:
$$\langle \psi| \sigma_z |\psi \rangle
= \langle 0 | R_x(\phi_1)^\dagger R_y(\phi_2)^\dagger \sigma_z R_y(\phi_2) R_x(\phi_1) | 0 \rangle
= \cos(\phi_1)\cos(\phi_2).
$$
How did they get $\cos(\phi_1)\cos(\phi_2)$?
I pleased to know some clear steps to have an intuition about it. Thanks!
"
"['algorithm', 'vqe', 'linear-algebra']"," Title: Variational Quantum Linear Solver (Hadamard test): circuit questionBody: Trying to understand the circuit/algorithm for VQLS and I found this diagram to show the high-level idea of doing the Hadamard test in this tutorial. But I am not quite sure why we need the two circuit blocks in the red box that I drew.
I appreciate the insight.
"
"['error-correction', 'topological-quantum-computing']"," Title: What do Z logical errors look like in 3d color codes?Body: I am trying to better understand (standard, not gauge) 3d color codes. In particular, I am working with the lattice proposed in 1.
I understand how X error works, forming strings of the kind Vertex -> Cell -> Face -> Cell -> Vertex, where the Vertices and Faces are of the same color. (Notice that this is in the "dual picture", where qubits are at cells). An X error will happen if there is a string-net starting from one cell (qubit) and propagating to each face of the tetrahedra.
I would like to have a similar understanding of Z errors. From figure 2 in 2 it can be seen that Z logical errors propagate via the two-colored edges (we are in the dual picture, so faces -> edges) alternating edges of opposite coloring. For example
red-yellow edge -> cell -> blue-green edge -> cell -> red-yellow edge.
What I am confused about is how Z logical errors look like. From 2 I would guess these have something to do with error branes encircling the face of the corresponding color, but I do not see it clearly.
My question is How do logical Z errors look like in this situation? Secondly, is it possible that I am getting it wrong that the lattice described in 1 and 3 can be used for non-gauge color codes?
Thanks a lot!
H Bombín, Gauge color codes: optimal transversal gates and gauge fixing in topological stabilizer codes
H. Bombin and M. A. Martin-Delgado, Topological Computation without Braiding
Benjamin J. Brown, Naomi H. Nickerson & Dan E. Browne Fault-tolerant error correction with the gauge color code
"
"['quantum-fisher-information', 'quantum-metrology', 'metrics']"," Title: Does the symmetric logarithmic derivative operator have a geometric interpretation?Body: In the context of Bures metric and quantum Fisher information, an important object is the symmetric logarithmic derivative (SLD). This is usually introduced as a way to express the derivative of a parametrised state as a superoperator acting on the state itself.
More precisely, let $\theta\mapsto\rho_\theta$ be some (differentiable) parametrisation of a set of states. The SLD is then the operator $L$ such that
$$\partial_\theta\rho_\theta = \frac12 (L\rho_\theta+\rho_\theta L)\equiv \frac12 \{L,\rho_\theta\}.$$
This is discussed e.g. here in (Toth and Apellaniz 2014) in Eq. (83), or (Paris 2008) in Eq. (3). The Wikipedia page on the Bures metric also introduces the basic relevant definitions.
It seems clear that the SLD operator has some geometric significance. For one thing, it appears prominently on the expression for the metric induced by the Bures distance:
$$[d(\rho,\rho+d\rho)]^2 = \frac12 \operatorname{Tr}(\partial_{\mu}\rho L_\nu)d\theta^\mu d\theta^\nu.$$
Is there a more direct way to see where this operator comes from? A way to justify why an operator whose anticommutator with $\rho_\theta$ produces $\partial_\theta\rho_\theta$ should be interesting? Or a way to justify why the SLD, in particular, gives the correct expression for the Bures metric?
"
"['entanglement', 'density-matrix', 'information-theory']"," Title: Can one quantify entanglement between different parts of a system?Body: Consider some state $|\psi\rangle$ of $n$ qubits. One can take any subsystem $A$ and compute its density matrix $\rho_A =Tr_{B} |\psi\rangle \langle\psi|$. The entanglement between subsystem $A$ and the rest of the system $B$ is quantified for example by von Nemumann entropy associated with the density matrix. For example, the subsystem $A$ can be first $k$ qubits and subsytem $B$ the remaining $n-k$.
Now, is it possible to associate in a similar way some measure of entaglment between two particular subsystems that do not sum up to the total system? Say, is it in any way reasonable to ask what is entanglement between qubit 1 and qubit 2? Intuitively, if the state of the system is something like $\sqrt{2}|\psi\rangle=|000000\dots\rangle+|110000\dots\rangle$ then I should be able to say that the first two qubits are maxiamally entangled with each other but not at all with the remaining qubits. But can one do this in general?
"
"['programming', 'qiskit']"," Title: How does one access data from retired backends?Body: I am having trouble retrieving data using Qiskit from jobs I ran on a currently retired system. However, I can still retrieve the same data from the dashboard (GUI), so I think the data are still there. For instance, the following code works just fine for retrieving counts data from an old job I ran on Melbourne (currently in service):
BACKEND='ibmq_16_melbourne'
JOB_ID='6009735f4ae4e567f432feca'
my_backend = provider.get_backend(BACKEND)
my_job = my_backend.retrieve_job(JOB_ID)
COUNTS = my_job.result().get_counts()
However, the same code but trying to retrieve data from a job that ran on Vigo fails:
BACKEND='ibmq_vigo'
JOB_ID='60037fbf2159c338e734e663'
my_backend = provider.get_backend(BACKEND)
my_job = my_backend.retrieve_job(JOB_ID)
COUNTS = my_job.result().get_counts()
The error message I get is
QiskitBackendNotFoundError: 'No backend matches the criteria'
Is there an alternative way to do this?
Thank you!
Jorge
"
"['textbook-and-exercises', 'grovers-algorithm']"," Title: How does applying Z gate to $|0\rangle$ change the phase of other states during reflection about $|s\rangle$ in Grover algorithm in Qiskit textbookBody: I am trying to understand the Reflection Gate - Us explained for 2 qubits in the qiskit textbook. In the explanation it is mentioned that first Hadamard gate is applied to change the state $|s\rangle$ to $|0\rangle$ then a circuit adds negative phase to all the states orthogonal to $|s\rangle$ and this is done by applying 2 $Z$ (one each on both the qubits) gates followed by a controlled $Z$. I am confused about this because once $|s\rangle$ goes to $|0\rangle$ there won't be any superposition so $Z$ gates won't do anything at all because the effect of $Z$ gates on computational basis is to change $|1\rangle$ to $-|1\rangle$. Can someone please explain. This question is different from other questions asked so please do not link it to other questions.
"
"['complexity-theory', 'quantum-advantage', 'probability', 'random-quantum-circuit', 'haar-distribution']"," Title: Spoofing XQUATH with the Feynman methodBody: Consider the XQUATH conjecture for random quantum circuits, as mentioned here.
(XQUATH, or Linear Cross-Entropy Quantum Threshold Assumption). There
is no polynomial-time classical algorithm that takes as input a
quantum circuit $C \leftarrow D$ and produces an estimate $p$ of
$p_0$ = Pr[C outputs $|0^{n}\rangle$] such that \begin{equation}
\mathbb{E}[(p_0 − p)^{2}] = \mathbb{E}[(p_0 − 2^{−n})^{2}] − Ω(2^{−3n}) \end{equation}
where the expectations are taken over circuits $C$ as well as the
algorithm’s internal randomness.
The authors remark that
The simplest way to attempt to refute XQUATH might be to try $k$
random Feynman paths of the circuit, all of which terminate at
$|0^{n}\rangle$, and take the empirical mean over their contributions
to the amplitude.
However, this approach will only yield an improvement in mean squared error over the trivial algorithm that decays exponentially with the number of gates in the circuit, rather than the number of qubits.
What is a proof of the second line (for random quantum circuits)? I tried using a Chernoff bound --- it does not work.
"
['graph-states']," Title: Quantum Graph state paper query (Phy Rev A)Body: The authors of the paper Graph States for Quantum Secret Sharing https://journals.aps.org/pra/abstract/10.1103/PhysRevA.78.042309 define a 'labeled state' as
$$|G_{\vec{l}}\rangle=\bigotimes_{i}X_i^{l_{i1}}Z_i^{l_{i2}}|G\rangle$$where G is a graph state.
Then they define an 'encoded graph state' as $$ |G_{\vec{l}_{*2}}\rangle=\bigotimes_{i}Z_i^{l_{i2}}|G\rangle $$ and say that the encoded graph state is the labeled graph state with $l_{1i}=0, \forall i$.
Here $\vec{l}_{i*}=(l_{i1},l_{i2})$ for the i-th vertex, $\vec{l}_{*j}=(l_{1j},l_{2j},....l_{nj})$ for the $j$ th bit over all the $n$ vertices, and $\vec{l}=(\vec{l}_{1*}, \vec{l}_{2*},........\vec{l}_{n*}$, each $l_{ij}\in \{0,1\}$.
With this framework they try to define a secret sharing protocol. However before the actual protocol, they give an example. I am understanding bits of the theory but not all of it, Here it is
- For a 4-party scheme, they prepare a graph state $$Z^{l_{12}}\otimes Z^{l_{22}}\otimes Z^{l_{32}}\otimes Z^{l_{42}} \left(|0+++\rangle+|1---\rangle\right)$$, corresponding to this they have 4 stabilizers (generators) of the stabilizer group $K_1=XZZZ,K_2=ZXII,K_3=ZIXI,K_4=ZIIX$, with eigenvalues $(l_{12},l_{22},l_{32},l_{42})$.
My first understanding about the eigenvalues is that $l_{i2}$ are eigenvalues because those are the indices (powers) where we have possible commuting issues between the $X$ and $Z$ gate, so when they are zero the eigenvalues are $1$ and when they are $1$ they eigenvalues are $-1$, and correspondingly the the graph states are orthogonal (since they correspond to different eigenvalues). Is my undertanding okay or atleast near okay? Shouldn't the eigenvalues be
$(-1)^{l_{i2}} \forall~i$?
"
"['qiskit', 'quantum-state', 'quantum-fourier-transform', 'quantum-circuit']"," Title: How do I find the state of each qubit at the end of the circuit?Body: I have this Quantum Fourier Transform (QFT) and I want to know how to find the final state of each qubit if q0, q1, q2 start in the states $|0\rangle$, $|1\rangle$, $|0\rangle$.
Do I go along the wire of each qubit and multiply the operations together. i.e. for q_0:
$|q_0\rangle = |0\rangle * H$
For $|q_1\rangle$:
$|q_1\rangle = |1\rangle * H$
For $|q_2\rangle$:
$|q_2\rangle = |0\rangle * H * P(\pi/2)$
Then swap for $|q0\rangle$ and $|q2\rangle$?
Also is there any software that can find the states of the qubits before being measured?
(The circuit is from the Qiskit implementation)
"
"['qiskit', 'quantum-gate', 'quantum-circuit']"," Title: Understand the circuit of Normal DistributionBody:
This is the circuit for NormalDistribution(3, mu=1, sigma=1, bounds=(0, 2)). How do I understand what this circuit is doing?
"
"['qiskit', 'quantum-fourier-transform', 'quantum-circuit']"," Title: Why are these two QFT circuits equivalent?Body: I am new to quantum computing and have been trying to understand the Quantum Fourier Transform (QFT). Through my research using both the Qiskit textbook and other sources, I see differences in how the circuit is actually implemented. My question is: Why are the two circuits below equivalent? Does the order of the wires in each circuit matter? To me they look significantly different as even the operations are being done on different qubits.
For example;
From the Qiskit Textbook:
From other sources:
"
"['quantum-state', 'circuit-construction', 'machine-learning', 'quantum-circuit']"," Title: Circuit state preparation using amplitude encodingBody: I am following an example of preparing an input state using amplitude encoding from this book.
How to calculate $\beta_1^1$ using given formula above? In my understanding, $\beta_1^1 = 2\arcsin(\frac{\alpha_2}{\alpha_0})$ which is not equal to zero.
"
"['programming', 'qiskit']"," Title: QuantumInstance object has no attribute ""name""Body: I follow qiskit tutorial "Portfolio optimization". When I executed this cell, I encounter the attribute error as the title(picture showed below).
Do anyone know how to fix this problem?
It seems like the problem is inside the package, so I have no idea...
"
"['cryptography', 'graph-states']"," Title: How to measure and get the result in a Graph stateBody:
According to this definition, suppose I have a graph on $3$ vertices, $v_1,v_2,v_3$, such that I have the Graph state vector $$|G\rangle= |0++\rangle+|1++\rangle$$ Suppose I have a secret say $S=1$,so the encrypted graph becomes $$ZZZ|G\rangle$$, I see that I have $B=\{1,2,3\}$ as a c-accessible set since I have $D=\{1\}$ such that $|D|=1$, and $Odd(D)=\{2,3\}\subseteq \{1,2,3\}$. So for reconstruction players $2,3$ apply an S gate and player $1$ applies a $H$ gate so the state becomes $$|+\rangle\{(|0\rangle+i|1\rangle)(|0\rangle+i|1\rangle)\}+ |-\rangle\{(|0\rangle-i|1\rangle)(|0\rangle-i|1\rangle)\}$$
Now how do I proceed with the measurement, what does it say about measurement. For instance if Player 1 measures $|0\rangle$ on the first qubit, I am left with $$(|0\rangle+i|1\rangle)(|0\rangle+i|1\rangle)+(|0\rangle-i|1\rangle)(|0\rangle-i|1\rangle)$$, after that if Player 2 measures again $|0>$, then the third player is left with only the $|0>$ state on his qubit and say he measures it. So a total of $s_i=0+0+0$ and since $G_D$= empty graph, I get the reconstructed secret as $0$ which is not correct. Please can somebody tell how to measure, and what exactly is to be done.
"
"['programming', 'qiskit', 'quantum-gate', 'unitarity', 'universal-gates']"," Title: How efficient is Qiskit's unitary decomposition?Body: In Qiskit's extension package we have the UnitaryGate module that you can initialize using a unitary matrix and then add it to your circuit. How efficiently is this decomposition done under the hood?
Also, if I wanted to do the decomposition myself, what's the best way of doing so?
"
"['algorithm', 'complexity-theory', 'quantum-advantage', 'quantum-volume']"," Title: Is there a practical architecture-independent benchmark suitable for adversarial proof of quantum supremacy?Body: Recent quantum supremacy claims rely, among other things, on extrapolation, which motivates the question in the title, where the word "adversarial" is added to exclude such extrapolation-based quantum supremacy claims.
To clarify the exact meaning of the question imagine that we are looking for a benchmark "Bench" useful in the following scenario. Bob (who does not have access to a quantum computer) wants to verify the Eve's claim that she has a moderately-powerful quantum computer. They follow the following generic protocol:
- Bob: what is your score on Bench?
- Eve: $N$.
- Bob and Eve exchange messages following the Bench protocol, e.g. Bob can send challenges to Eve, and Eve should then send responses to those challenges.
- Following the protocol Bench, Bob reaches the conclusion on whether Eve has passed.
If Eve indeed has the powerful quantum computer, she should be able to pass this test with high probability (aka sensitivity) and if she does not, she should not be able to pass it with "only" using a few powerful classical supercomputers / clusters with non-negligible probability $= 1 -$specificity for sufficiently large $N$. Note that specific values of sensitivity and specificity are not important, since if one has a benchmark with sensitivity and specificity of $2/3$, one can repeat it e.g. 193 times and apply majority voting to get sensitivity and specificity of $99.9999\%$.
Architecture-independent means that the benchmark is useful for Eve's claim for a wide range of architectures Eve could use. Finally, by "practical" in the question I mean that the benchmark should be useful for near-term quantum computers. For example, one could use elliptic curve discrete logarithm problem as a benchmark, but it seems that this would require a quantum circuit depth of the order of $10^{10}$ to beat a classical supercomputer, thus would not be applicable to near-term quantum computers.
Recently IBM popularized quantum volume as a benchmark, which, similarly to Sycamore quantum supremacy claim, relies on sampling of the output distribution of a pseudo-random quantum circuit. However, it seems that these benchmarks all rely on a classical simulator or extrapolation (digital error model), neither of which satisfy the premise of this question:
- E.g. if Eve claims log quantum volume large enough to show quantum supremacy (e.g. 100), then it is not clear how would we verify that, since the verifications of sampling-based tests above rely on our ability to compute the probabilities of the outputs via simulation of a quantum circuit on a classical hardware.
- If Eve claims smaller log quantum volume (e.g. 42), for which the circuit can be simulated on classical hardware, nothing prevents Eve to simulate it herself without having access to a quantum computer.
- Finally, if Eve's argument relies on extrapolation, nothing prevents her from using classical simulation for small circuit depths (which she can simulate and Bob can verify) and picking random outputs for larger ones (which Bob can't verify).
Similarly, "Advanced quantum supremacy using a hybrid algorithm for linear systems of equations" does not seem to be the answer, since it seems to rely on the classical simulation to verify the results of the quantum computation.
"
"['nielsen-and-chuang', 'information-theory', 'entropy']"," Title: How can the entropy of quantum states increase after projective measurements?Body: I'm reading Nielsen and chuang 11.3.3 Measurements and Entropy.
It says after measurement, one's entropy increases.
How is this possible? Shouldn't measurement decrease one's uncertainty?
"
"['quantum-state', 'information-theory', 'linear-algebra']"," Title: Is the quantum mutual information variance bounded from above?Body: The relative entropy variance between two quantum states $\rho$ and $\sigma$ is defined to be
$$V(\rho\|\sigma) = \text{Tr}(\rho(\log\rho - \log\sigma)^2) - D(\rho\|\sigma)^2,$$
where $D(\rho\|\sigma)$ is the quantum relative entropy.
Analogous to the mutual information, one can define the mutual information variance for a bipartite state $\rho_{AB}$ by choosing the second argument of the relative entropy variance to be the product of the marginals $\rho_A\otimes\rho_B$. The mutual information is bounded by $\log d^2$, where $d$ is the dimension of the registers $A$ and $B$. My question is if the mutual information variance is also bounded? That is,
$$V(\rho_{AB}\|\rho_A\otimes\rho_B) \leq \ ?$$
"
"['quantum-state', 'noise', 'nisq', 'transpile']"," Title: How do you quantify the figurative 'cost' of a quantum circuitBody: Many gates are not available on a real computer and therefore the circuit must be transpiled into a specific set of gates. I have seen this equation below which is used to to determine the 'cost' of a quantum circuit:
Cost = 10NCNOT + Nother
where:
NCNOT : number of CNOT gates
Nother : number of other gates
I am wondering which other considerations are not captured by this equation? Especially given that we live in the Noisy Intermediate-Scale Quantum (NISQ) technology era.
It has obviously left out the number of qubits in a circuit which contributes massively to noise. What else should it take into account though? very curious
"
"['programming', 'qiskit', 'qasm']"," Title: Is it true that QasmSimulator is much slower than StatevectorSimulator, or am I doing something wrong?Body: I'm trying to calculate the expectation value of some operator for a state that comes out of a quantum circuit using Qiskit. I was initially using StatevectorSimulator, but I also wanted to experiment with QasmSimulator. I Followed this answer in trying to calculate expectation values using QasmSimulator. However I noticed that Qasmsimulator is almost $40$ times slower than StatevectorSimulator for doing the same task. Here is a minimal code for comparison:
import time
from numpy import conjugate, pi
from qiskit import QuantumCircuit, transpile
from qiskit.providers.aer import QasmSimulator, StatevectorSimulator
from qiskit.utils import QuantumInstance
from qiskit.opflow import CircuitStateFn, PauliExpectation, CircuitSampler, StateFn
from qiskit.opflow import PauliOp, PauliSumOp
from qiskit.quantum_info import Pauli
# The details of the PauliOp and the quantum circuit I guess are irrelevant.
# What follows is just an example of some operator (qubit_op) to calculate
# the expectation value for and a quantum circuit for enerating the statevector.
qubit_op = PauliOp(Pauli('IIZZIZZZ')) + PauliOp(Pauli('IIXXXZZX'))
start = time.time()
qc = QuantumCircuit(8)
for i in range(4):
for j in range(7):
qc.cx(j, j+1)
qc.rz(pi/2, 7)
for j in range(7)[::-1]:
qc.cx(j, j+1)
qc.h([*range(8)])
qc = transpile(qc)
print(f'time took to build the circuit: {time.time() - start}s')
start = time.time()
simulator = StatevectorSimulator()
result = simulator.run(qc).result()
psi = result.get_statevector()
qubit_mat = qubit_op.to_matrix()
qubit_op_ev = conjugate(psi.T) @ qubit_mat @ psi
t1 = time.time() - start
print(f'time to calculate expectation value using StatevectorSimulator: {round(t1, 4)}s')
start = time.time()
simulator = QasmSimulator()
QI = QuantumInstance(simulator, shots=1000)
psi = CircuitStateFn(qc)
ms = StateFn(qubit_op, is_measurement=True) @ psi
pe = PauliExpectation().convert(ms)
samp = CircuitSampler(QI).convert(pe).eval().real
t2 = time.time() - start
print(f'time to calculate expectation value using Qasmsimulator: {round(t2, 4)}s')
print(f'QasmSimulator is {t2/t1} times slower than StatevectorSimulator')
Running this code gives the following output:
time took to build the circuit: 0.9908s
time to calculate expectation value using StatevectorSimulator: 0.0074s
time to calculate expectation value using Qasmsimulator: 0.2886s
QasmSimulator is 38.8306 times slower than StatevectorSimulator
It's somewhat surprising to me that QasmSimulator is that much slower (I would have thought it would be faster). So I guess I have two questions:
- Is this the expected behavior for
Qasmsimulator to be slower?
- If not, what is it I'm doing wrong?
"
"['programming', 'qiskit', 'gate-synthesis']"," Title: How exactly does the QuantumCircuit.decompose() method work?Body: From what I can understand from the source code, the circuit is converted into a DAG before the decomposition transpiler is performed onto the DAG circuit.
How does converting to a DAG circuit help us recognise the gate operations needed to reach a certain state say for example the entangled state $\frac{1}{\sqrt{2}}(|00\rangle +|11\rangle)$. Or basically, how does that decomposition work?
"
"['quantum-state', 'entanglement', 'measurement', 'quantum-operation']"," Title: Do sequences of operations (including measurements) applied to different halves of an entangled pair always commute?Body: Let us say $A$ has one half of an entangled qubit pair, and $B$ has the other half. $A$ may be able to perform any type of operation on their half of the pair, such as unitary operations, entangling the qubit with other qubits, etc... followed by a final measurement of the qubit. $B$ has the same capabilities. However, one of either $A$ or $B$ must finish all their operations and their measurement before the other can begin operating on their qubit. This results in two cases:
Case (1): $A$ performs all of their operations on their half of the qubit pair, then measures their half of the qubit pair, then $B$ performs all of their operations on their half of the qubit pair, then measures their half of the qubit pair.
Case (2): $B$ performs all of their operations on their half of the qubit pair, then measures their half of the qubit pair, then $A$ performs all of their operations on their half of the qubit pair, then measures their half of the qubit pair.
Will the expected outcome of the measurement results in Case (1) and Case (2) always be the same?
EDIT: An example to be more clear about what I mean by 'the measurement results' and how this question does not imply breaking the no-communication theorem:
Case (1) always gives $A$ and $B$ the same measurement results and Case (2) gives $A$ and $B$ different measurement results (with some probability less than or equal to 1 and greater than 0) would classify the 'measurement results' in Case (1) and Case (2) as being 'different' and thus the operations 'not commuting'. Furthermore, this example does not break the no-communication theorem with the following condition: $A$'s likelihood of measuring $1$ or $0$ on their half of the qubit pair is not dependent on whether they are in Case (1) or Case (2), and $B$'s likelihood of measuring $1$ or $0$ on their half of the qubit pair is not dependent on whether they are in Case (1) or Case(2).
"
"['circuit-construction', 'quantum-fourier-transform', 'shors-algorithm']"," Title: Two possible ways how to implement Shor's AlgorithmBody: Among many paper describing circuit solving period finding problem and discrete logarithm problem (DLP) (for simplity, let's say $g \equiv x^r$ (mod n) and try to find $r$), there are two variants that people usually ignore:
- Some paper use inverse QFT instead of QFT.
- Before applying QFT, some paper prepare the state as
$$\frac{1}{q}\sum_{a, b}|a, b, g^ax^b⟩$$ instead of
$$\frac{1}{q}\sum_{a, b}|a, b, g^ax^{-b}⟩$$
From this post and probability reduction we know these variants do not affect the probability analysis. However, in pratical implementation, variant no. 2 may save one quantum modular inverse operation. Also, I heard that using inverse QFT makes the probability analysis neater than using QFT, but I did not find any supporting document.
Therefore, is there any other reason that such preferences are made?
"
"['complexity-theory', 'quantum-circuit']"," Title: Why is depth complexity relevant?Body: Since gate complexity correspond to the number of gate for a given quantum circuit, it seems that depth complexity bring no more information about quantum complexity than gate complexity. So does gate complexity encompass depth complexity ?
"
"['qiskit', 'programming', 'quantum-gate']"," Title: How to implement parametric iSWAP gate in Qiskit?Body: I'm trying to implement the parametric $\text{iSWAP}$ gate, also known as $\text{XY}(\theta)$, in Qiskit.
$$
\text{XY}(\theta)=
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos{\theta/2} & i\sin{\theta/2} & 0 \\
0 & i\sin{\theta/2} & \cos{\theta/2} & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}.
$$
Furthermore, once I've implemented this gate I would like to use it in order to decompose quantum circuits in terms of single-qubit gates and $\text{XY}(\theta)$ as the only two-qubit gate.
What are the steps that I need to do in order to achieve this?
Cheers!
"
"['quantum-gate', 'quantum-state', 'algorithm', 'complexity-theory']"," Title: Postselection and hardness of estimating amplitudesBody: Let $A$ be a class of quantum circuits such that
\begin{equation}
\text{Post}A = \text{Post}BQP,
\end{equation}
where $\text{Post}$ indicates post-selection. Is only this amount of information sufficient to conclude that it is $\# P$ hard to estimate each output amplitude of a circuit in the class $A$, in the worst case, upto an inverse polynomial multiplicative error?
Note that it should be $\# P$ hard to compute each output amplitude of a circuit in $\text{Post}BQP$ upto inverse polynomial multiplicative error (as it is $\# P$ hard to compute each output amplitude of a circuit in $BQP$ upto the same error).
"
"['programming', 'ibm-q-experience']"," Title: Recover qubits used in an actual computationBody: How do I recover from a certain job_id in the IBM backends which qubits where used?
I would be interested to know if for instance, in a batch of say 50 jobs, 25 of them are run in qubits 0 and 1 but the other half in say 5 or 7.
"
"['gate-synthesis', 'quantum-circuit']"," Title: Is it possible to push back an $H$ gate to a $CZ$ gate?Body:
Given the above scenario. Is it possible to "push back" the $H$ gate operation to occur before $CZ$?
Formally I am looking for some operation $CZ\cdot(U_1\otimes U_2) = H\cdot CZ$.
"
"['entanglement', 'linear-algebra', 'bell-basis', 'povm']"," Title: Does a basis of maximally entangled states exist for two-qubit or two-qutrit system so that the density matrices of the basis states don't commute?Body: I want to find a basis of maximally entangled states $|\Psi_i\rangle$, for $\mathcal{H}^{2} \otimes \mathcal{H}^{2}$ and, $\mathcal{H}^{3} \otimes \mathcal{H}^{3}$ such that the density matrices of those states don't commute with each other.
If $\rho_{i} = |\Psi_i\rangle \langle\Psi_i|$
I need the following condition to be met:
$[\rho_{i},\rho_{j}] \ne 0$ for at least one pair of indices $i, j$.
I have tried using quasi Bell states, and Bell states in $|+\rangle, |-\rangle$ basis etc. but haven't succeeded yet.
If one or more such bases exist, how should I go about constructing one? If such a basis doesn't exist, what would be the next best basis in terms of entanglement, given that non-commutativity and entangled states are my priority. The orthogonality requirement can be discarded if necessary.
"
"['quantum-operation', 'noise', 'kraus-representation']"," Title: Determining whether there exists an equivalent set of unitary Kraus operatorsBody: I have a CPTP quantum channel $\mathcal{E}$ that I've characterized by an operator sum representation $\{E_i\}$ for $i=1, \dots, m$ which acts on an input state like
$$
\mathcal{E}(\rho) = \sum_{i=1}^m E_i \rho E_i^\dagger
$$
with $\sum_i E_i^\dagger E_i = I$. I would like to know if there is an alternative Kraus representation with operators $\{F_j\}$ for $j=1, \dots, n$ that satisfies similar properties, $\mathcal{E}(\rho) =\sum_{j=1}^n F_j \rho F_j^\dagger$ and $\sum_{j=1}^n F_j^\dagger F_j=I$ but also that each new operator is proportional to a unitary,
$$
F^\dagger_j F_j = F_j F_j^\dagger = c_j I
$$
for some real $c_j$. For example a choice of dephasing channel satisfies this property since it can be defined either by the operators $\{\frac{1}{\sqrt{2}}I, \frac{1}{\sqrt{2}}Z\}$ or $\{|0\rangle\langle 0 |, |1\rangle \langle 1|\}$.
I do understand that the two channels must be related by some unitary transformation $U$ with, $E_i = \sum_j U_{ij} F_j$ but this seems only to constrain the problem for specific choices of $\{E_i\}$.
"
"['programming', 'matrix-representation', 'amazon-braket']"," Title: How to get the matrix representation of a circuit in Amazon braket?Body: Say I define a circuit using the amazon-braket-sdk, for example:
braket_circuit = braket.circuits.Circuit()
braket_circuit.h(0)
braket_circuit.h(1)
braket_circuit.h(2)
braket_circuit.rx(0, np.pi / 4)
braket_circuit.ry(1, np.pi / 2)
braket_circuit.rz(2, 3 * np.pi / 4)
Are there any built-in functions that allow you to retrieve the matrix representation of the entire circuit? If all else fails, I know that I can go moment-by-moment, gate-by-gate, and use tensor products to iteratively calculate the circuit's unitary. However, I'm hoping for a one-liner similar to cirq.protocols.unitary or qiskit.quantum_info.Operator.data. Does such a function exist in braket? The braket.circuits.quantum_operator.QuantumOperator class contains a to_matrix method, but it's not clear if or how a braket Circuit can be converted to a QuantumOperation without defining a new, custom QuantumOperation which would of course require its own implementation of the to_matrix method. Thanks for any help in advance!
"
"['entanglement', 'measurement', 'textbook-and-exercises', 'bell-basis']"," Title: Calculating probability that two entangled qubits are the same when measured in different basesBody: Given the entangled state
\begin{equation}
|\Phi^+\rangle = \frac{1}{\sqrt 2} |00\rangle + \frac{1}{\sqrt 2} |11\rangle
\end{equation}
I am trying to calculate the probability that the two qubits end up being the same when measured in different bases and getting different answers with 2 different methods.
Method 1 is given by Section 2.2 p. 21 of this lecture note and reproduced below for convenience:
The answer according to this is $\cos^2 \theta$
Method 2: Consider the expected value of the product of the qubit spins (measuring qubit is technically measuring its spin).
\begin{equation}
\begin{split}
E[s_a \times s_b] & = (s_a \times s_b) \textrm{Prob}(s_a = s_b) + (s_a \times s_b) \textrm{Prob}(s_a \neq s_b) \\
& = +1 \cdot \textrm{Prob}(s_a = s_b) - 1 \cdot \textrm{Prob}(s_a \neq s_b) \\
& = p - (1 - p) \\
& = 2 p - 1
\end{split}
\end{equation}
which gives:
\begin{equation}
\textrm{Prob}(s_a = s_b) = \frac{1 + E[s_a \times s_b]}{2}
\end{equation}
and $E[s_a \times s_b]$ turns out to be equal to $a_x b_x - a_y b_y + a_z b_z$ where $\vec{a}$ and $\vec{b}$ are the axes chosen for measurement of the spins. See equation 11 in this for reference. I checked by hand and the formula is correct.
Method 1 $\neq$ Method 2. What gives?
"
"['mathematics', 'linear-algebra']"," Title: In the context of block-encoding, what does $|0\rangle\otimes I$ represent?Body: New to quantum and ran into the block-encoding. Having a bit of trouble understanding $|0\rangle \otimes I$.
$|0\rangle$ is just a vector but $I$ is an $n$ by $n$ matrix? Not clear how vector can be tensorproducted with a matrix? I know I am missing something here.
Any help could be appreciated.
"
"['quantum-operation', 'trace-distance']"," Title: Is the trace norm monotone with respect to quantum operations?Body: The trace norm is defined to be $$\| K \| = \mathrm{tr}\sqrt{K^\dagger K}.$$
Is it true that we have
$$\| \mathcal E(K) \|\leq \|K\|,$$
for any quantum operation $\mathcal{E}: A\otimes B \to A\otimes B$?
If it is not true, then is it at least true for hermitian $K$?
I'm asking this because trace norm defines a distance measure on the space of density operators $d(\rho, \sigma) = || \rho - \sigma ||$, and I think it should be true that pushing two states through a quantum operation should not increase the distance between them, as it destroys distinctions that used to be visible.
Theorem 9.2 on p.406 in Nielsen & Chuang shows that this is true when $\mathcal E$ is trace-preserving and $K = \rho - \sigma$ where $\rho, \sigma$ are density operators, but I'm asking if the more general case is true, where $\mathcal E$ is not required to be trace-preserving, and $K$ is not required to be a difference of two density operators.
"
['stabilizer-code']," Title: How to distinguish logical X vs logical Z in the stabilizer code with $k=1$?Body: Let's say I have a stabilizer code with $k=1$. I calculate the normalizer and find the values of $A,B$ that are anticommuting and are not in the stabilizer group. How do I know which one to assign to $\bar X$ and which one to $\bar Z$? Would an arbitrary choice work?
"
"['algorithm', 'quantum-fourier-transform', 'shors-algorithm']"," Title: Why don't we use exact QFT in Shor's algorithm?Body: In DLP ($g \equiv x^r$ (mod $p$) with known order of $x$ as $p$), Shor algorithm applies QFT to the state
$$\frac{1}{p}\sum_{a, b}^{p-1}|a, b, g^ax^b⟩$$
Here QFT is of size $q$ that satisfies $(p-1)\le q< 2(p-1)$. Then the state becomes
$$\frac{1}{pq}\sum_{a, b}^{p -1}\sum_{c, d}^{q - 1}\text{exp}(\frac{i2\pi(ac+bd)}{q})|a, b, g^ax^b⟩$$
The amplitude of the state $|c, d, g^k⟩$is
$$|\frac{1}{pq}\sum_{a+br\equiv k\,(\text{mod}\,p)}^{p -1}\text{exp}(\frac{i2\pi(ac+bd)}{q})|$$
In Shor algorithm, $q$ also satisfies $\log_2(q)\in\mathbb{N}$ because size of QFT is only limited to power of 2, and hence in most of cases $p\ne q$. Then the probability analysis becomes a mess, and we need to run the circuit polynomial times to get a nice pair of $(c, d)$ (so-called "good state").
However, if $p=q$, then the amplitude becomes
$$|\frac{1}{p^2}\sum_{b=0}^{p -1}\exp(\frac{i2\pi(kc+b(d-cr))}{p})|$$
This is the easy case of DLP described in original paper of Shor algorithm, which proves that in this situtation $c$ and $d$ must satisfy $d=cr\,(\text{mod}\,p)$. If $c$ and $p$ is coprime, then we get the result.
Here $p=q$ can be achieved by exact QFT of arbitrary size $N$ that does
$$|a, 0⟩\mapsto|\Phi_a, 0⟩,\text{ where }|\Phi_a⟩=\frac{1}{\sqrt{N}}\sum_{c=0}^{N-1}\exp(\frac{i2\pi}{N}ac)|c⟩$$
There is a lot of spare auxiliary qubits after modular operations. Thus, we don't need additional qubits for implementing exact QFT.
Exact QFT has $O(n^2)$ operation complexity. It should be acceptable compared with $O(n^3)$ complexity of the entire circuit. However, all paper I read use non-exact QFT to solve DLP. Is there any shortage of exact QFT that I missed?
"
"['programming', 'qiskit', 'qasm']"," Title: Use of Data loaders or State Initialization CircuitsBody: I have recently started working on qiskit and I am struggling to use qc.initialize API in any practical or useful application. I have read at multiple places that they are used to feed data to the quantum circuits.
For developing an understanding of the quantum computers, I executed the code of Bernstein Vazirani Algorithm(secret number detector) on qasm_simulator using Pycharm IDE as shown below without using any initialization circuit.
import qiskit
from qiskit import IBMQ
import time
from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.visualization import plot_bloch_multivector
import matplotlib.pyplot as plt
from qiskit.tools.monitor import job_monitor
#IBMQ.save_account('Account key',overwrite=True) # Run it for once
# 6 bit secret number
secretNumber= '101001'
circuit= QuantumCircuit(6+1,6) # 6 qubit for secret no. +1 qubit
circuit. h([0,1,2,3,4,5])
circuit.x(6)
circuit.h(6)
circuit.barrier()
# splitting the string into char
splitSecretNumber= list(secretNumber)
lengthofSecretNumber= len(splitSecretNumber)
x=0
while(x< lengthofSecretNumber):
if(str(splitSecretNumber[x])=='1'):
circuit.cx(int(x),6)
x=x+1
circuit.barrier()
circuit.h([0,1,2,3,4,5])
circuit.barrier()
circuit.measure([0,1,2,3,4,5],[0,1,2,3,4,5])
circuit.draw(output="mpl")
simulator= Aer.get_backend('qasm_simulator')
simulationResult = execute(circuit,simulator, shots=1).result()
counts= simulationResult.get_counts()
print(counts)
plot_histogram(simulationResult.get_counts(circuit))
plt.show()
Please guide me to convert this code to take Input data using initialization circuit. Also, please suggest me some good papers to read on initialization. Thanks in advance.
"
"['programming', 'qiskit', 'quantum-enhanced-machine-learning']"," Title: Quantum Machine Learning: how to get effective time of training/scoringBody: I am trying to examine the potential of Quantum Machine learning in terms of performance and time compared to classical algorithms. I am using both Qiskit's QSVM and scikit's SVM with Qiskit Quantum Kernel.
I would like to know if it is possible to get the training and scoring time for these algorithms. A simple time.time() does not take into account the queue on IBM servers and is not useful for the purpose. I know that for circuits one can use job.time_taken, but I don't understand how to use it in this context if it is possible.
I attach the very simple code I am using to define and training the model.
model = SVC(kernel=Qkernel.evaluate, probability=True) #Qkernel is the Quantum Kernel
model.fit(data_train.values, target_train.values)
At https://github.com/Qiskit/qiskit-aqua/issues/628 (Jul 2019) it is claimed that "the job completion for real devices does not currently report executions times". Is that so? How can then be proved the time-quantum advantage with respect to the classical counterpart?
"
"['algorithm', 'grovers-algorithm']"," Title: How to find all marked items by quantum search algorithm(Grover's algorithm)?Body: We know that the Grover algorithm outputs a marked item. Now we want to know the locations of all items. I can't find any paper to solve this problem.
"
"['qiskit', 'simulation']"," Title: What is the maximum number of qubits that can be simulated by Qiskit using any method?Body: I'm looking to write an algorithm (potentially) using Qiskit, and am trying to find out what the maximum number of Qubits is that Qiskit can support with various simulation methods.
From reading other answers on here, and using Qiskit a bit, I have found that the Qasm simulator has a maximum of 30(?), but that Qiskit supports also using a GPU.
I assume the number of qubits a GPU can simulate depends on the GPU in question, but I am wondering if anyone knows how to find out what that number would be for a given GPU?
In addition, are there any other methods using Qiskit or otherwise wherein you can simulate a quantum computer running a complex algorithm, for example, one which requires several real numbers (including decimals) as variables? Not looking for specifics necessarily - any pointers will do, but specifics are very welcome!
Thanks in advance, and apologies if this is a silly question or I've missed something.
"
['ionq']," Title: IonQ signup process and access via Google CloudBody: I'm trying to sign up in ionq, but it seems that one needs to habilitate at least the Google Cloud Platform. The documentation is not too clear and I have -10 of experience for cloud platform.
Does anyone know if, to access via google, one needs to pay? Or is it possible to get a free account similar as in the IBM quantum experience?
"
"['mathematics', 'pauli-gates', 'linear-algebra']"," Title: Is decomposing high-dimensional states in terms of Pauli matrices impossible?Body: I've been trying to decompose a 3x3 density matrix with 3-dimensional Pauli matrices but it doesn't work for all matrices.
For example, the density matrix of the state $|0\rangle + |1\rangle + |2\rangle$ can be decomposed by obtaining the coefficients of the equation $\rho = a_{X}X + a_{Y}Y + a_{Z}Z + a_{V}V + a_{X^2}X^2 + a_{Y^2}Y^2 + a_{Z^2}Z^2 + a_{V^2}V^2 + a_{I}I $ using trace, e.g. $a_X = Tr(\rho X)/3 $. Here, $Y=XZ, V=XZ^2$, and X and Z are $3 \times 3$ Pauli matrices shown in https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices.
On the other hand, when I tried to decompose the state $|0\rangle + |2\rangle$ using the above equation, the result was not the same as $|0\rangle + |2\rangle$.
Is it impossible to decompose a high-dimensional matrix using Pauli matrices?
Cross-posted on physics.SE
"
"['programming', 'qiskit', 'hhl-algorithm']"," Title: Difference in HLL applicationsBody: I am new to Qiskit and I have seen two types of simple 2X2 $Ax=b$ system solutions. I am wondering what the difference is exactly. They both occur on a simulator backend, but the first gives me a Euclidean norm and the second gives me a horrible state vector answer and associated (very low) probability.
code 1
matrix = np.array([[1, -1/3], [-1/3, 1]])
vector = np.array([1, 0])
naive_hhl_solution = HHL().solve(matrix, vector)
code 2
def create_eigs(matrix, num_ancillae, num_time_slices, negative_evals):
ne_qfts = [None, None]
if negative_evals:
num_ancillae += 1
ne_qfts = [QFT(num_ancillae - 1), QFT(num_ancillae - 1).inverse()]
#Construct the eigenvalues estimation using the PhaseEstimationCircuit
return EigsQPE(MatrixOperator(matrix=matrix),
QFT(num_ancillae).inverse(),
num_time_slices=num_time_slices,
num_ancillae=num_ancillae,
expansion_mode='suzuki',
expansion_order=2,
evo_time=None,
negative_evals=negative_evals,
ne_qfts=ne_qfts)
def HHLsolver(matrix, vector, backend, no_ancillas, no_time_slices):
orig_size = len(vector_b)
#adapt the matrix to have dimension 2^k
matrix, vector, truncate_powerdim, truncate_hermitian = HHL.matrix_resize(matrix_A, vector_b)
#find eigenvalues of the matrix wih phase estimation (i.e. calc. exponential of A, apply
#phase estimation) to get exp(lamba) and then inverse QFT to get lambdas themselves
eigs = create_eigs(matrix, no_ancillas, no_time_slices, False)
#num_q – Number of qubits required for the matrix Operator instance
#num_a – Number of ancillary qubits for Eigenvalues instance
num_q, num_a = eigs.get_register_sizes()
#construct circuit for finding reciprocals of eigenvalues
reci = LookupRotation(negative_evals=eigs._negative_evals, evo_time=eigs._evo_time)
#preparing init state for HHL, i.e. the state containing vector b
init_state = Custom(num_q, state_vector=vector)
#construct circuit for HHL based on matrix A, vector B and reciprocals of eigenvalues
algo = HHL(matrix, vector, truncate_powerdim, truncate_hermitian, eigs,
init_state, reci, num_q, num_a, orig_size)
#solution on quantum computer
result = algo.run(quantum_instance = backend)
print("Solution:\t\t", np.round(result['solution'], 5))
print("Probability:\t\t %f" % result['probability_result'])
print("Quantun result storage:\t",result)
#refence solution - NumPyLSsolver = Numpy LinearSystem algorithm (classical).
result_ref = NumPyLSsolver(matrix, vector).run()
print("Classical Solution:\t", np.round(result_ref['solution'], 5))
matrix_A = np.array([[1, -1/3], [-1/3, 1]])
vector_b = [1, 0]
processor = Aer.get_backend('statevector_simulator')
no_ancillas = 3 #number of ancilla qubits
no_time_slices = 50 #number of timeslices in exponential of matrix A (exp(i*A*t))
HHLsolver(matrix_A, vector_b, processor, no_ancillas, no_time_slices)
"
['physical-realization']," Title: What does a quantum logic gate look like in a universal quantum computer?Body: I am familiar with logic gates which are in classical computers. They are made up of semiconductor devices like diodes and transistors.
There are some companies which are working on the universal quantum computers such as Google, IBM, Honeywell.
How does quantum logic gates such as Pauli-X,Y,Z, Hadamard, CNOT, CCNOT look like in the circuits of those universal quantum computers? I have referred to many white papers, but in all of them I saw them representing these gates as matrices.
Are Quantum logic gates even physically realized yet OR are they only theoretically proved using matrices?
Can you please attach some real picture of these processors, and point out the quantum logic gates?
"
"['programming', 'qiskit']"," Title: How to assemble two quantum circuits which has each own qubit mapping state?Body: I'm curious about something.
I tried to do some qubit mapping using SABRE algorithm. Suppose I have two quantum circuits and apply SABRE algorithm to both of them. Then each of them has its own qubit mapping states. After that, I want to compose them to make it as one long quantum circuit. How can I do it?
I used python code and qiskit. I have already searched qiskit API and used some functions (compose, combine, append). But the circuits could not be combined. How can I assemble two quantum circuit which have different qubit mapping state respectively?
Thank you
"
"['quantum-gate', 'gate-synthesis', 'universal-gates', 'reversible-computation']"," Title: Universality for reversible classical computationBody: Is there any way to check whether a set of gates (for example, take the set comprising of the CNOT gate and the Hadamard gate) is universal for reversible classical computation?
I can think of trial and error methods, like checking whether we can construct a Toffoli gate or a Fredkin gate with our gate set.
But is there a better way --- perhaps a deterministic algorithm --- to check this?
A sufficient condition to check this would be to check whether the gate set is universal for quantum computation. But, there may be gate sets that are universal for reversible classical computation but not universal for quantum computation (for example, the Toffoli gate). How to check these intermediate cases?
"
['mathematics']," Title: Strange binomial formula for operators?Body: Does the binomial formula $(a+b)^n=\sum_i C_n^ia^ib^{n-i}$ still work when $n$ is replaced by operator $\hat{n}$(an operator), where $a$ and $b$ are numbers? Since it's not the normal binomial formula mentioned in a lot of cases, and also can't be easily explained by the operator function, which is a definition in a Taylor-expansion way. So, does the formula work right? It seems okay to me.
Edit $C_{\hat{n}}^i$ will stands for $\frac{1}{i!}\hat{n}(\hat{n}-I)(\hat{n}-2I)...(\hat{n}-iI)$, and the original problem I met is to simplify the expression
$$
\begin{align}
\sum_{l=0}^\infty l\frac{(1-\eta)^l}{l!}(a^\dagger)^l\eta^{\hat{n}}a^l
\tag{1}
\end{align}
$$
into
$$
\begin{align}
(1-\eta)\hat{n}
,\tag{2}\end{align}$$
where $\hat{n}$ is photon number operator, $a^\dagger$ is the creation operator, $a$ is the annihilation operator, $\eta$ and $l$ are real numbers. My way is to think about the expectation value of eq. (1) with respect to the Fock state $|n\rangle$, so the sum over $\infty$ will become the sum over $n$, and we can have real number to be calculated and use the calculation skill where we used in the expectation value of binomial distribution, i.e., $\sum_{i=0}^n iC_n^ia^i(1-a)^{n-i}=na$.
But I think if we can use $C_\hat{n}^i=\frac{1}{i!}\hat{n}(\hat{n}-I)(\hat{n}-2I)...(\hat{n}-iI)$, then the formula $(a+b)^{\hat{n}}=\sum_i C_{\hat{n}}^ia^ib^{\hat{n}-iI}$ should be reasonable. I know Taylor expansion to treat $a+b$ together as a number can get the polynomial form of operator $\hat{n}$, but can the formula with binomial expansion alike get the same result while different form? Anyway, the original motivation for me to do so is to simplify eq. (1) into eq. (2).
"
"['quantum-state', 'fidelity', 'stabilizer-state']"," Title: What is a stabilizer state?Body: I am reading through the paper "Direct Fidelity Estimation from Few Pauli Measurements" (arXiv:1104.4695) and it mentions 'stabilizer state'.
"The number of repetitions depends on the desired
state $\rho$. In the worst case, it is $O(d)$, but in many cases of
practical interest, it is much smaller. For example, for
stabilizer states, the number of repetitions is constant,
independent of the size of the system..."
"
"['algorithm', 'quantum-circuit']"," Title: Block encoding technique: what is it and what is it used for?Body: I was wondering if someone could explain to me what this technique called "block encoding" does, and what it is used for at a high level, found in arXiv:1806.01838.
It is in section 4.1, definition 43; shown below.
I encountered this topic while reading this (arXiv:2012.05460) paper, where it is mentioned just above lemma 7; shown below.
I am told that block encoding is used to reduce the 3D circuit down to a 2D circuit, by applying block encoding k times, to get the leading schmidt vector of this circuit. However, I'm not sure if this is the correct intuition, and I certainly don't understand the symbols in the definition of block encoding. If my question isn't really clear I'm happy to elaborate!
"
"['qiskit', 'quantum-state', 'ibm-q-experience']"," Title: What is this pulse experiment showing?Body: The following results in the figure were achieved using Qiskit pulse by doing the following pulse sequence;
{ $\frac{\pi}{2}$, delay $\tau$, $\pi$, delay $\tau$, $\frac{\pi}{2}$}
The figure is the average of 1024 shots.
This experiment looks very similar to applying the following sequence which is done to measure the T1 time of a qubit which is the it takes a qubit to decay to its ground state from its excited state;
{ $\pi$, delay $\tau$, $\pi$, delay $\tau$, $\pi$ }
I am trying to understand what the first experiment is used for and what the the results from the figure even show.
"
"['circuit-construction', 'quantum-enhanced-machine-learning', 'quantum-neural-network']"," Title: Data encoding in the quantum perceptron modelBody:
In this paper, this figure shows the perceptron model used for quantum neural network.
When realizing the inner product between weight vector and input vector, it defines a unitary transformation $U_W$, such that $U_W|\phi_W\rangle = |1\rangle^ {\otimes N} $.
My question is, what's the intuition behind this? Why should the quantum state be $|1\rangle^ {\otimes N} $?
"
"['programming', 'error-correction', 'stabilizer-code', 'stabilizer-state']"," Title: Are there any packages that can calculate stabilizer tableau of a QECCBody: I'm experimenting with some small quantum error correcting codes (QECC). For example
$[[5,1,3]]$, $[[8,3,3]]$ or toric codes $[[2d^2,2,d]]$ ($d=2,3,\cdots$). The last one
being defined by redundant stabilizers. What packages can take in a set of $m'$ stabilizers
and produce the tableau? ($m'$ could be larger than $m=n-k$ in case stabilizers are not independent).
Here are the details for the $[[8,3,3]]$ code : the code is in standard form; $1=X$, $2=Z$, $3=XZ$;
[[3,0,2,2,1,1,3,0],
[2,3,0,2,1,3,0,1],
[2,0,3,0,1,2,1,3],
[2,2,0,1,0,1,3,3],
[2,2,2,2,2,2,2,2],
[2,2,0,2,0,2,0,0],
[2,0,2,2,0,0,2,0],
[0,2,2,2,0,0,0,2],
[2,0,0,0,0,0,0,0],
[0,2,0,0,0,0,0,0],
[0,0,2,0,0,0,0,0],
[0,0,0,2,0,0,0,0],
[0,0,0,0,1,0,0,0],
[0,2,2,0,1,1,0,0],
[2,0,0,2,1,0,1,0],
[0,0,2,2,1,0,0,1]]
first 5 rows of the matrix above are stabilizers; next 3 are logical Z; next 5 are destabilizers; last 3 logical X.
"
"['fidelity', 'state-space-geometry', 'metrics']"," Title: What is the connection between Bures metric and (finite) Bures distance?Body: The Wikipedia page discussing the Bures metric introduces it as the Hermitian 1-form operator $G$ defined implicitly by $\rho G+G\rho = \mathrm d\rho$, and which induces the corresponding Bures distance, which reads
$$[d(\rho,\rho+\mathrm d\rho)]^2 = \frac12 \operatorname{Tr}(\mathrm d\rho \,G).$$
Shortly thereafter, they give the corresponding finite version of this metric, which turns out to have the form
$$[D(\rho_1,\rho_2)]^2 = 2\Big(1 - \operatorname{Tr}\left|\sqrt{\rho_1}\sqrt{\rho_2}\right|\Big).$$
These two expression do not look particularly similar. How does one go from one to the other?
I suppose this should involve taking the geodesic curve connecting $\rho_1$ and $\rho_2$, and then integrating the infinitesimal form over it, but I'm not sure how to actually perform such a calculation.
"
['deferred-measurement']," Title: What is a proof for the principle of deferred measurement?Body: Does anyone know of a proof for the 'principle of deferred measurement'?
"
"['programming', 'qiskit']"," Title: HLL Algorithm results interpretationBody: I have the following HLL qiskit implementation and really need some help interpreting the results!
CODE ------------------------------
from qiskit import QuantumRegister, QuantumCircuit
t = 2 # This is not optimal; As an exercise, set this to the
# value that will get the best results. See section 8 for solution.
nqubits = 4 # Total number of qubits
nb = 1 # Number of qubits representing the solution
nl = 2 # Number of qubits representing the eigenvalues
theta = 0 # Angle defining |b>
a = 1 # Matrix diagonal
b = -1/3 # Matrix off-diagonal
# Initialize the quantum and classical registers
qr = QuantumRegister(nqubits)
# Create a Quantum Circuit
qc = QuantumCircuit(qr)
qrb = qr[0:nb]
qrl = qr[nb:nb+nl]
qra = qr[nb+nl:nb+nl+1]
# State preparation.
qc.ry(2*theta, qrb[0])
# QPE with e^{iAt}
for qu in qrl:
qc.h(qu)
qc.p(a*t, qrl[0])
qc.p(a*t*2, qrl[1])
qc.u(b*t, -np.pi/2, np.pi/2, qrb[0])
# Controlled e^{iAt} on \lambda_{1}:
params=b*t
qc.p(np.pi/2,qrb[0])
qc.cx(qrl[0],qrb[0])
qc.ry(params,qrb[0])
qc.cx(qrl[0],qrb[0])
qc.ry(-params,qrb[0])
qc.p(3*np.pi/2,qrb[0])
# Controlled e^{2iAt} on \lambda_{2}:
params = b*t*2
qc.p(np.pi/2,qrb[0])
qc.cx(qrl[1],qrb[0])
qc.ry(params,qrb[0])
qc.cx(qrl[1],qrb[0])
qc.ry(-params,qrb[0])
qc.p(3*np.pi/2,qrb[0])
# Inverse QFT
qc.h(qrl[1])
qc.rz(-np.pi/4,qrl[1])
qc.cx(qrl[0],qrl[1])
qc.rz(np.pi/4,qrl[1])
qc.cx(qrl[0],qrl[1])
qc.rz(-np.pi/4,qrl[0])
qc.h(qrl[0])
# Eigenvalue rotation
t1=(-np.pi +np.pi/3 - 2*np.arcsin(1/3))/4
t2=(-np.pi -np.pi/3 + 2*np.arcsin(1/3))/4
t3=(np.pi -np.pi/3 - 2*np.arcsin(1/3))/4
t4=(np.pi +np.pi/3 + 2*np.arcsin(1/3))/4
qc.cx(qrl[1],qra[0])
qc.ry(t1,qra[0])
qc.cx(qrl[0],qra[0])
qc.ry(t2,qra[0])
qc.cx(qrl[1],qra[0])
qc.ry(t3,qra[0])
qc.cx(qrl[0],qra[0])
qc.ry(t4,qra[0])
qc.measure_all()
#-------------------------------
qc.draw(fold=-1)
from qiskit import BasicAer, ClassicalRegister, IBMQ
from qiskit.compiler import transpile
from qiskit.ignis.mitigation.measurement import (complete_meas_cal,CompleteMeasFitter,
MeasurementFilter)
backend = provider.get_backend('ibmqx2') # calibrate using real hardware
layout = [2,3,0,4]
chip_qubits = 5
# Transpiled circuit for the real hardware
qc_qa_cx = transpile(qc, backend=backend, initial_layout=layout)
meas_cals, state_labels = complete_meas_cal(qubit_list=layout, qr=QuantumRegister(chip_qubits))
qcs = meas_cals + [qc_qa_cx]
job = backend.run(qcs, shots=10)
result = job.result()
counts = result.get_counts()
print(counts) # there are 17 of these ... why?
OUTPUT -------------------------------
[{'0000': 7, '0001': 2, '0010': 1},
{'0001': 9, '1001': 1},
{'0010': 7, '0011': 3},
{'0001': 1, '0010': 1, '0011': 7, '0110': 1},
{'0000': 1, '0100': 8, '1100': 1},
{'0000': 1, '0100': 1, '0101': 8},
{'0010': 1, '0110': 7, '0111': 2},
{'0010': 2, '0110': 2, '0111': 6},
{'0000': 2, '1000': 5, '1100': 3},
{'0001': 4, '1000': 2, '1001': 3, '1010': 1},
{'0010': 2, '1010': 5, '1011': 3},
{'0001': 1, '0111': 1, '1010': 2, '1011': 5, '1111': 1},
{'0100': 1, '1000': 1, '1100': 5, '1101': 2, '1110': 1},
{'0001': 1, '0101': 1, '1001': 1, '1101': 7},
{'0110': 1, '1010': 1, '1110': 6, '1111': 2},
{'1010': 2, '1011': 1, '1111': 7},
{'0001': 2, '0011': 1, '0101': 1, '0110': 1, '1000': 1, '1100': 2, '1110': 1, '1111': 1}]
Questions ----------------------------------
(1) It appears that each of terms {} are a superposition state where the count/prob amplitudes are given for the comprising 4 qubit states. Is this a correct way to read this?
(2) If the above is true, why are there 17 states here?
(3) Lastly, how can I relate these counts or the subsequent histogram back to the solution vector X = {1.125,0.375}?
I can't seem to find a decent book on practical quantum computing for linear systems, so any recommendations are great there!
Thanks in advance! -Corey
"
"['qiskit', 'resource-request']"," Title: Where can we find Qiskit exercises solution/answers?Body: Where can we find Qiskit Exercises solution/answers, is there any website for it?
Or any alternative way to check our answer/solution?
"
"['entanglement', 'textbook-and-exercises']"," Title: How can the state $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$ be entangled if both spins are the same?Body: I'm reading Qiskit's documentation. https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html#3.2-Entangled-States- and they show qubits entangled as $|00\rangle$ (both qubits spin down) or $|11\rangle$ (both qubits spin up). Also written as
$$
\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)
$$
From my understanding, entanglement requires one particle to be spin up and the other spin down. How is the above entangled state possible?
"
"['programming', 'ibm-q-experience']"," Title: FileNotFoundError: No such file or directory. This error occurs while giving a data path to upload datafile(present on desktop) in IBMQBody: I am trying to implement https://qiskit.org/textbook/ch-machine-learning/machine-learning-qiskit-pytorch.html#3.-Let's-code!- in IBMQ using a dataset present on my desktop.
While uploading a dataset in IBM Q,
train = pd.read_csv("C:/Users/akanm/OneDrive/Desktop/Dataset/train.csv")
when I check the current working directory with the help of command os.cwd, it shows:
/home/jovyan.
How do I change the path to my desktop where the data file is present so that it does not give errors as:
No such file or directory
Tried the commands Change Directory but still, the same error occurs.
"
"['qiskit', 'quantum-gate', 'quantum-state', 'ibm-q-experience', 'simulation']"," Title: How can I simulate the Avg CNOT Error on IBMQ Backends?Body: I want to know exactly how to estimate the Avg CNOT Error rate for IBMQ Backends?
For instance, I tried to estimate the Avg CNOT Error rate for Belem Backend; I randomly prepared the 00,01,10,11 states, applied a CNOT between those qubits, and got the results, but I couldn't get a similar value for the interaction Error for the 0 qubit and the 1 qubit, which is written on an excel file (ibmq_belem_calibrations).
If I can simulate the Error rate estimation with a quantum circuit, then how can I do this?
"
"['quantum-gate', 'simulation', 'quantum-circuit', 'universal-gates', 'clifford-group']"," Title: Explicit states with high $T$ countBody: It is well known, that the Clifford $+T$ gate set consisting of the gates $\lbrace H, S, CNOT, T \rbrace$ is universal for quantum computation, that is, for any n-qubit unitary $U:\left( \mathbb{C}^2\right)^{\otimes n} \rightarrow \left( \mathbb{C}^2\right)^{\otimes n}$ and for every $\epsilon >0$, there is a unitary $V$ composed of gates from the Clifford $+T$ gate set such that
$$\|U |0\rangle ^{\otimes n} - V|0\rangle ^{\otimes n}\|<\epsilon$$
Let now $\mathcal{C} = \lbrace V |0\rangle ^{\otimes n}: V \text{ composed from Clifford }+T \text{ gates}\rbrace$ and define the $T$-count $\tau(|c\rangle )$ of an element $|c\rangle \in \mathcal{C}$ as the minimal number $r$ such that there is a quantum circuit $V$ composed of arbitrarily many Clifford gates and $r$ $T$-gates such that $ |c\rangle = V |0\rangle ^{\otimes n}$.
The $T$-count can be arbitrarily large: Clearly, the universality of $\mathcal{C}$ implies that $\mathcal{C}$ is infinite. But since the Clifford group is (up to prefactors of the form $e^{i\theta}, \theta \in [0,2\pi]$) finite, we only reach (up to prefactors) a finite number of states with a finite number of $T$-gates.
Now my question: Do we know explicit families of states which have high $T$-count? An example for what I am looking for can be found on page 18 of this paper. There, the authors show - using the stabilizer nullity as a monotone - that for the controlled $Z$ gates with $n-1$ controls $C^nZ$, the state $C^nZ |+\rangle ^{\otimes n}$ has $T$-count $\Omega(n)$ (it is well known that $C^nZ |+\rangle ^{\otimes n}\in \mathcal{C}$, see e.g. Nielsen Chuang).
Another example would probably be $|T\rangle^{\otimes n}$, where $|T\rangle = T |+\rangle $ (and all obvious variations of this).
I wonder if there are explicit examples where the $T$-count scales stronger with $n$. For example, I would be interested in seeing an explicit example of a family of states $|\Psi_n\rangle \in \left( \mathbb{C}^2\right)^{\otimes n}$ such that $\tau (|\Psi_n\rangle) = \Omega(f(n))$ where $f$ is maybe superlinear or even exponential.
(Maybe an interesting related observation: One will not be able to show something like this using the stabilizer nullity, since the stabilizer nullity is always bounded by the number of qubits!)
Alternatively: As the $T$-count can be arbitrarily large even for one qubit unitaries by the above argument, one can of course also ask the following (stronger) variant: Can we explicitly give a family $|\Psi_n\rangle \in \mathbb{C}^2$ such that $\tau(\Psi_n) > \tau(\Psi_{n-1})$ for all $n\in \mathbb{N}$?
I am quite new to this part of quantum information theory, any kind of insights are welcome - and also any kind of comment on my introductory thoughts.
"
"['programming', 'ibm-q-experience']"," Title: Trying to connect IBM Quantum to External APIBody: Is it possible to connect a quantum computer to openlibary.org API? How do I find the public IP address to my quantum instance?
"
"['quantum-state', 'density-matrix', 'pauli-gates', 'fidelity']"," Title: Prove the fidelity can be written in terms of Pauli expectation values as ${\rm tr}(\rho\sigma)=\sum_k \chi_\rho(k)\chi_\sigma(\rho)$Body: I am reading through "Direct Fidelity Estimation from Few Pauli Measurements" and it states that the measure of fidelity between a desired pure state $\rho$ and an arbitrary state $\sigma$ is $\mathrm{tr}(\rho\sigma)$. It then describes a 'characteristic function' $\chi_\rho(k) = \mathrm{tr}(\rho W_k/\sqrt d)$ where $W_k (k = 1, ... , d^2)$ are all possible Pauli operators (n-fold tensor products of $I$, $X$, $Y$ and $Z$). It then states that:
$$\mathrm{tr}(\rho\sigma) = \sum_k \chi_\rho(k) \chi_\sigma(k)$$
Which is where I get confused. How do the two equal each other? A proof is much appreciated.
Additionally, what do they mean by 'characteristic function'. Is it the type of characteristic function defined in probability theory. If so, I don't see how it is derived.
"
"['ibm-q-experience', 'circuit-construction', 'qasm', 'quantum-computing-for-finance']"," Title: How to build and visualize circuit from matrix?Body: In paper Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience, the authors use gate $U_j$ and its decomposition
$$
U_j =
\begin{pmatrix}
\mathrm{e}^{ia} & 0 & 0 & 0 \\
0 & \mathrm{e}^{ib} & 0 & 0 \\
0 & 0 & \mathrm{e}^{ic} & 0 \\
0 & 0 & 0 & \mathrm{e}^{id} \\
\end{pmatrix}=
\begin{pmatrix}
1 & 0 \\
0 & \mathrm{e}^{i(c-a)}
\end{pmatrix}
\otimes
\begin{pmatrix}
\mathrm{e}^{ia} & 0 \\
0 & \mathrm{e}^{ib}
\end{pmatrix}
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & \mathrm{e}^{i(d+c-a-b)} \\
\end{pmatrix}.
$$
Note that they denote exponent $d+c-a-b$ by $x$ in the paper.
Then they present implementation of controlled version of $U_j$ with this circuit:
and also provide QASM code
cu1 ( c−a ) x , y ;
u1 ( a ) x ;
cu1 ( b−a ) x , z ;
ccx x , y , z ;
cu1 ( ( d−c+a−b ) / 2 ) x , z ;
ccx x , y , z ;
cu1 ( ( d−c+a−b ) / 2 ) x , y ;
cu1 ( ( d−c+a−b ) / 2 ) x , z ;
I am so confused about this. Can someone explain how the matrix, the image and the code connect to each other? It seems that each describe different circuit.
"
"['mathematics', 'adiabatic-model']"," Title: Penalty Function for XOR gateBody: I was reading a paper on Gates for Adiabatic Quantum Computer. In the paper, there were different penalty functions already given in the form of the following table:
I do not quite understand the process for getting the penalty functions, in which the penalty functions contain extra variables (like XOR Gate). Can anyone please explain the Math behind this? I have tried to find some resources, but I was not able to get any good ones. It will be of great help if anyone can explain how these penalty functions are derived, or even a good resource will do fine.
"
"['quantum-operation', 'noise', 'fidelity', 'bb84']"," Title: How are eavesdroppers detected when using BB84 in the presence of noise?Body: I would like to expand upon this question: What is the probability of detecting Eve's tampering, in BB84?
Let's say that when the receiver (colloquially referred to as Bob) receives a qubit and measures it in the correct basis, the receiver still has a small percent chance of getting an incorrect measurement of the qubit due to noise. How does the protocol 'make room' for this error by accurately determining when the noise is a result of error, or a result of an eavesdropper?
"
"['grovers-algorithm', 'hhl-algorithm', 'amplitude-amplification']"," Title: Combining Amplitude Amplification with HHLBody: I'm recently learning about how to apply Grover search techniques to other places. An example I've come across is to amplify the probability of measure a $\lvert 1 \rangle$ of the ancilla qubit in HHL to reduce the expected number of trials to find a solution.
From the original HHL algorithm, I know that after applying QPE, the state of the registers are the following:
$$
\sum_{j=0}^{N-1} b_j \lvert \lambda_j \rangle \lvert u_j \rangle \left( \sqrt{1 - \frac{C^2}{\lambda_j^2}} \lvert 0 \rangle + \frac{C}{\lambda_j} \lvert 1 \rangle \right)
$$
To make things simple, we can represent this state using some generic state vector $\psi_0, \psi_1$ and probability $p$.
$$
\Psi = \sqrt{1 - p} \lvert \psi_0 \rangle \lvert 0 \rangle + \sqrt{p} \lvert \psi_1 \rangle \lvert 1 \rangle
$$
We need to repeat this $O(\frac{1}{p})$ times in order to measure a $\lvert 1 \rangle$ of the ancilla qubit. However, we can apply Grover-like Amplitude Amplification here to get $O(\frac{1}{\sqrt{p}})$ runtime instead.
In order to do so, we first define some initial state $\psi_{init}$ of the HHL system and a circuit (unitary $Q$) that takes the initial state to the $\Psi$ we got above.
$$
Q \lvert \psi_{init} \rangle = \sqrt{1 - p} \lvert \psi_0 \rangle \lvert 0 \rangle + \sqrt{p} \lvert \psi_1 \rangle \lvert 1 \rangle
$$
Once we have this form, we can construct the Grover search oracle $U = I \otimes Z$ (do nothing for the $\psi$, but flip the sign of the ancilla if it's 1). Then, we can also construct the Grover diffusion operator $R = 2 Q \lvert \psi_{init} \rangle \langle \psi_{init} \rvert Q^{\dagger} - I$, which is a reflection along the initial state.
After applying the Grover operators $U, R$ multiple times (to be exact, $O(\frac{1}{\sqrt{p}})$), we can measure a 1 from the ancilla qubit.
However, the thing that I don't quite understand is - in the original HHL we are essentially relying on the $\frac{1}{\lambda_j}$ coefficient to build the inverse of the original $\mathbf{A}$ matrix. If we amplify the probability of measuring $\lvert 1 \rangle$ on the ancilla using Grover, doesn't that mean we also involuntarily destroy the original coefficient because now it's been amplified to something else?
I'm wondering whether my concern is valid, or is there anyway to fix the coefficient skewing after we measure the ancilla qubit?
Thanks!
"
"['programming', 'qiskit']"," Title: How do you create a square pulse in Qiskit?Body: I am wondering how to create a square pulse in Qiskit. I am working off this Qiskit documentation but still cannot figure out how to create a square pulse.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'quantum-fourier-transform']"," Title: Find the conditions under which the state $|\phi\rangle = \sum_{y=0}^{2^n -1} e^{\frac{2 \pi i a y}{2^n}} |y\rangle$ is unentangledBody: Show that the state $ |\phi\rangle = \sum_{y=0}^{2^n -1} e^{\frac{2 \pi i a y}{2^n}} |y\rangle $ is unentangled if $a \in \{ 0,1,...,2^n - 1\} $ and $|\phi\rangle$ can be expressed in the form $ \otimes_{i=1}^{n} |0\rangle + \alpha_i |1\rangle$, for proper amplitudes $ \alpha_i $.
I tried to verify for the special $n=2$, that is, for $a = 0$ I get $|\phi\rangle = (|0\rangle + |1\rangle ) \otimes (|0\rangle + |1\rangle )$ and so on.
"
"['qiskit', 'quantum-gate', 'circuit-construction', 'quantum-circuit']"," Title: What is the correlation between Toffoli and a more generic rotation shown in qiskit textbookBody: Can someone help me understand the correlation between the 2 diagrams in the qiskit textbook.
"
"['entropy', 'min-entropy']"," Title: Prove that for a cq-state $\rho_{XE}$, $H_\infty(X|E) \ge H_\infty(X) - \log|E|$Body: Given a classical-quantum(cq) state $\rho_{XE}$, where the $X$ register is classical, I want to prove the following:
$$
\begin{align}
H_\infty(X|E) \ge H_\infty(X) - \log|E|,\tag{1}
\end{align}
$$
i.e., the conditional min-entropy of $X$, having access to the quantum register $E$ is at least the min-entropy of $X$ minus the log of dimension of the quantum register $E$.
The term $H_\infty(X|E)$ is defined as the following:
$$
H_\infty(X|E) := \underset{\sigma_E}{\sup} \max\{\lambda \in \mathbb{R} : 2^{-\lambda} \mathbb{I} \otimes \sigma_E - \rho_{XE} \ge 0\}
$$
It is my understanding that, $X$ is a classical register and in this case the min-entropy is defined as:
$$H_\infty(X) = -\log \underset{x}\max p_x,$$
for the classical probability distribution $\{p_x\}_x$ of the random variable $X$. From this, we can easily see that,
$$
H_\infty(X) \le H(X) \le \log|X|.
$$
I also know that,
$$
H(X|E) \le H(X),
$$
because conditioning can not increase entropy. Here is what I tried,
$$
\begin{align*}
H_\infty(X|E) &\le H(X|E) \\
&= H(XE) - H(E) \\
&= H(X) + \sum_x p_x H(\rho_x) - H(E) \\
&\ge H(X) + \sum_x p_x H(\rho_x) - \log |E|,
\end{align*}
$$
and you see the obvious problem with my reasoning. What is the correct approach to prove equation (1)? Thanks in advance.
"
"['programming', 'qiskit']"," Title: How can I get the number of measurements where any specific qubit is equal to 0?Body: Say I am using a 100 qubit quantum computer, but my circuit is such that I am only interested in the output of a particular qubit. So for example I want to know how many outcomes had a result of 0 on the 50th qubit. Is there an easy way to do this rather than writing out all possible combinations which have this result?
Obviously writing all the combinations becomes more computationally expensive as the number of qubits increases.
"
"['programming', 'qiskit', 'measurement']"," Title: Qiskit equivalent of get_expectation_value() in ProjectQBody: Is there a corresponding function that has the same function as function get_expectation_value() in Project Q?
Get the expectation value of qubit_operator w.r.t. the current wave function representeenter preformatted text hered by the supplied quantum register.
Args:
- qubit_operator: Operator to measure.
- qureg: Quantum bits to measure.
Returns: Expectation value
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, Aer
import numpy as np
from qiskit.aqua import QuantumInstance
from qiskit.aqua.operators import PauliExpectation, CircuitSampler, StateFn, CircuitOp, CircuitStateFn
qctl = QuantumRegister(10)
psi = QuantumCircuit(qctl)
psi.h(0)
psi = CircuitStateFn(psi)
qctl = QuantumRegister(10)
op = QuantumCircuit(qctl)
op.z(0)
op.ry(np.pi/4,0)
op = CircuitOp(op)
backend = Aer.get_backend('qasm_simulator')
q_instance = QuantumInstance(backend, shots=1024)
measurable_expression = StateFn(op, is_measurement=True).compose(psi)
expectation = PauliExpectation().convert(measurable_expression)
sampler = CircuitSampler(q_instance).convert(expectation)
print('Expectation Value = ', sampler.eval())
"
"['programming', 'qiskit', 'circuit-construction', 'sabre', 'qubit-mapping']"," Title: How to assemble two quantum circuits whose qubit mapping states are different each other?Body: I uploaded similar question before, but the answer was not I want. I think I should show you in more detail about my question.
I use SABRE algorithm which can do qubit mapping for executing quantum circuit on the real quantum hardware. But I really wonder how I can assemble two quantum circuits that has each own qubit mapping state.
For example...
These two quantum circuits have own their qubit mapping states respectively.
I use qiskit to make programming code on linux.
Above one is the first quantum circuit.
Above one is the second quantum circuit.
As you can see they have own qubit mapping state. (First : 3 -> 6, but the second : 3 -> 7)
How can I assemble them without any problem? Is there any way to do it?
I already did qiskit's operation(compose, combine, append) but they didn't work.
Also '+' operation didn't work.
This is the code how I assemble two quantum circuit
circuit = circuits[0]
for cir in circuits[1:]: # start from index 1
circuit += cir
'circuits' is a list of quantum circuit. So, I use for loop to add circuits one by one. I also used qiskit's operations like 'append', 'combine', 'compose', 'extend', but all of them didn't working. They just couldn't add more circuits. In case of '+', it didn't consider about qubit mapping state of each quantum circuit and just add circuits directly... So it has problem too. You can see the results on my other question.
I really wonder how I can add quantum circuits ( assemble quantum circuits ) considering each qubit mapping state of them.
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: Amplitude Amplification for searching $|0\rangle$ in an unknown stateBody: For one known (invertible) function that does:
$$f:H^{\otimes 2n}\times H^{\otimes 2n}:|x⟩|0⟩\mapsto|x⟩|y⟩$$
I want to find a similar (invertible) function that does:
$$g:H^{\otimes 2n}\times H^{\otimes2n}:|0⟩|y⟩\mapsto|x⟩|0⟩$$
so that $f \ast g$ maps $|0⟩|y⟩$ to $|x⟩|y⟩$.
To do so, I prepare a state $|0, y_x⟩$ and do the following operations:
$$|0, y_x⟩ \mapsto \frac{1}{\sqrt{2^{n}}}(\sum^{2^n-1}_{k\,=\,0}|k⟩)|y_x⟩ = \frac{1}{\sqrt{2^{n}}}\sum^{2^n-1}_{k\,=\,0}|k⟩|y_x⟩ $$
Now apply $f^{-1}$ to $|k⟩|y_x⟩$, which gives:
$$\frac{1}{\sqrt{2^{n}}}\sum^{2^n-1}_{k\,=\,0}f^{-1}(|k⟩|y_x⟩)=...+\frac{1}{\sqrt{2^{n}}}|x⟩|0⟩$$
I verfied that only when $k=x$, the second register of $f^{-1}(|k⟩|y_x⟩)$ contains $|0⟩$. Denote $|\varphi⟩$ as the state of second register. The only information I know, is that $|\varphi⟩$ contains $|0⟩$ with amplitude $\frac{1}{\sqrt{2^{n}}}$. Is that possible that I can use amplitude amplification to significantly increase the amplitude of $|0⟩$?
"
"['entanglement', 'quantum-advantage', 'random-quantum-circuit', 'haar-distribution']"," Title: Spreading of entanglement with depth for Haar random statesBody: Consider a Haar random quantum state of depth $d$. Consider any bipartition of this state. According to this paper (page $2$):
Haar-random states on $n$ qudits are nearly maximally entangled across
all cuts simultaneously. Random quantum circuits on $L \times L \times
\cdots L$ arrays of qudits achieve similar near-maximal entanglement
across all possible cuts once the depth is $\Omega(L)$, and before
this time, the entanglement often spreads “ballistically."
The comment indicates that the entanglement entropy is near maximal for linear depths. But, how much entanglement entropy is there for logarithmic and constant depths, and what is meant by "ballistic spreading"?
"
['ibm-q-experience']," Title: Adding collaborator to project during reservationBody: If I add a collaborator to an IBM Quantum Education project during a system reservation, do they immediately get priority access to the reserved system? Or do I need to add them before the reservation starts?
"
"['textbook-and-exercises', 'unitarity']"," Title: Why is it not easy to distinguish $U|\psi\rangle$ and $U'|\psi\rangle$ if $\|U-U'\|<\epsilon$?Body: So I am currently working on an assignment, which is about the induced Euclidian norm
$$
||A||:= \max_{v\in\mathbb{C}^d\text{ s.t. }||v||_2=1} ||Av||_2
$$
for some $A\in\mathbb{C}^{d\times d}$.
For given unitaries $U,U'\in\mathbb{C}^{d\times d}$ s.t. $||U-U'||<\epsilon$ for some small $\epsilon$ and an arbitrary state $|\psi\rangle\in\mathbb{C}^d$, my task is to explain, why it is not that easy to distinguish via any measurement the output of $U|\psi\rangle$ and $U'|\psi\rangle$.
I don't have any idea how to explain this statement because I don't get the intuition behind it. Maybe someone can help me/at least give me a form of intuition, why this statement holds.
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'pauli-gates']"," Title: In what sense are Pauli matrices measurement operators?Body: Neilson and Chuang's textbook shows a nice example of measuring in the $Z$ basis on page 89 in section 2.2.5. The Hermitians for measuring in the $Z$ basis, $|0\rangle\langle 0|$ and $|1\rangle\langle 1|$, satisfy the definition of being a projective measurement. However, if we measure in the $X$ basis (i.e. using the $X$ Pauli operator), by the same logic we get the Hermitians $|+\rangle\langle +|$ and $|-\rangle\langle -|$ which do not satisfy one of the properties of projectors. As in, $|+\rangle\langle +| \neq (|+\rangle\langle +|)^2$. In the textbook, it says the Hermitians $P_m$ making up the projective measurement operator $M$ must be projectors, but in the $X$ basis they are not projectors.
Am I doing something wrong here?...
EDIT: I was wrong with my calculations!!!
$|+\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}}
\end{bmatrix}$
$|+\rangle\langle +| = \begin{bmatrix} \frac{1}{2} & \frac{1}{2}\\ \frac{1}{2} & \frac{1}{2}
\end{bmatrix}$
$(|+\rangle\langle +|)^2 = \begin{bmatrix} \frac{1}{2} & \frac{1}{2}\\ \frac{1}{2} & \frac{1}{2}
\end{bmatrix}$
"
"['resource-request', 'nielsen-and-chuang']"," Title: How to start reading quantum computing papers?Body: What's the best way to get to a state where you can read quantum computing papers? I find them too dense and full of notation to approach.
I am currently working my way through Nielsen and Chuang's book. How much time should I give myself to get through the book? Is there anything I can be doing or some papers that are more easily accessible right away?
"
"['quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Equivalent statement of the unitary freedom of Kraus operator?Body: There is a well-known form of the unitary freedom of Kraus operators, which can be found in Nielsen's book, stating that two sets of Kraus operators describe the same physical process of the system(consider the whole space consist of the system and the environment) iff $\Pi_l=\sum_k u_{lk}F_k$, where $u_{lk}$ is the entry of the corresponding unitary matrix.
In the deduction of Kraus operator in Nielsen's book:
$$\newcommand{\Tr}{{\operatorname{Tr}}}
\begin{align}
\Tr_{\rm env} \left[
U|\psi\rangle\otimes|0\rangle\langle\psi|\otimes\langle0|U^\dagger
\right],\tag{1}
\end{align}
$$
the single $\Pi_l$ can be stated as $(I\otimes\langle l|)U(I\otimes|0\rangle)$. Refer to this question, we can write $U|\psi\rangle\otimes|0\rangle$ into $\sum_l\Pi_l|\psi\rangle\otimes|l\rangle$, so eq.(1) can be written into
$$
\begin{align}
\Tr_{\rm env} \left[
\left(\sum_l\Pi_l|\psi\rangle\otimes|l\rangle \right)
\left(\sum_\tilde{l}\langle\psi|\Pi_\tilde{l}^\dagger\otimes\langle \tilde{l}| \right)
\right],\tag{2}
\end{align}
$$
which have another form of unitary freedom:
$$\Tr_{\rm env} \left[
(I\otimes U_{\rm env})
\left(\sum_l\Pi_l|\psi\rangle\otimes|l\rangle\right)
\left(\sum_\tilde{l}\langle\psi|\Pi_\tilde{l}^\dagger\otimes\langle \tilde{l}|\right)
(I\otimes U_{\rm env}^\dagger)
\right],
$$
from the perspective of eq.(1), this unitary freedom can be written as $F_l=(I\otimes\langle l|U_{\rm env})U|\psi\rangle\otimes|0\rangle$, while this one cannot be transformed into the form of $\Pi_l=\sum_k u_{lk}F_k$ easily.
To sum up, the question is that how to transform the 'new form' of unitary freedom $ F_l=(I\otimes\langle l|U_{\rm env})U|\psi\rangle\otimes|0\rangle$ into $\Pi_l=\sum_k u_{lk}F_k$?
"
"['gate-synthesis', 'quantum-circuit']"," Title: Generalized push for $\land_{ab}(X)$ gateBody: EDIT: In the following I am using the Feynman notation for controlled operations - e.g. $\land_{ab}(X)$ is equivalent to a $CNOT$ with control qubit $q_a$ and target $q_b$. Ultimately, for any single-qubit unitary $U$ applied to some qubit $q_a$, it has the compact notation $U_a$.
Consider a circuit scenario $\land_{ab}(X)U_b$. Is there any generalized "push" rule such that $\land_{ab}(X)U_b\equiv (U'_a\otimes U''_b)\land_{ab}(U''')$?
"
"['programming', 'qiskit', 'measurement']"," Title: Get the inverse of a Hermitian operator for measurement in qiskitBody: I am using Qiskit to measure the Hamiltonian H, which isbasically sum of Pauli strings, say something like 2*X^X+0.5*Z^Y. For one variable, I need to get the analytically form of the inverse of H. It seems that there is no easy way to directly get the inverse observable. So, I am wondering that how can I get this done by using qiskit?
"
"['foundations', 'contextuality', 'peres-mermin-square']"," Title: Can the Peres-Mermin square be reframed as a statement on the associated conditional outcome probabilities?Body: As mentioned in this answer, and links therein (assuming I'm understanding correctly), (non)contextuality can be defined as a property of a given set of conditional probability distributions, that is, as a property of a behaviour $\{p(a|x)\}_{a,x}$.
On the other hand, a classic example of "quantum contextuality", the Peres-Mermin square, is usually presented in a distinctly quantum flavour: we get two pairs of commuting observables, $\{X\otimes I,I\otimes X\}$ and $\{Z\otimes I,I\otimes Z\}$ which cannot be assigned simultaneous expectation values. More precisely, this is saying that there cannot be a map
$$\nu:\operatorname{Herm}(\mathcal H)\to\mathbb R$$
that is linear and homomorphic on commuting observables. In fact, in the case at hand, if such a $\nu$ existed, we would have
$$
\nu(Y_1 Y_2) = \nu(X_1Z_1 Z_2X_2) = \nu(X_1 Z_2) \nu(Z_1 X_2)
= \nu(X_1)\nu(Z_2)\nu(Z_1)\nu(X_2), \\
\nu(Y_1 Y_2) = -\nu(X_1Z_1X_2Z_2) = -\nu(X_1 X_2) \nu(Z_1 Z_2)
= -\nu(X_1)\nu(Z_2)\nu(Z_1)\nu(X_2).
$$
It would then follow that $\nu(Y_1)\nu(Y_2)=\nu(Y_1 Y_2)=-\nu(Y_1 Y_2)=0$, which we know is not necessarily the case.
Can the Peres-Mermin square contextuality proof be reframed as a statement directly on the conditional outcome probabilities of the underlying measurement? I don't find the translation between this argument with observables and a purely probabilistic approach immediate.
"
"['quantum-gate', 'quantum-fourier-transform', 'quantum-circuit', 'nonclassicality']"," Title: Quantum fourier transform with classical vibrationsBody: Is there any difference in effect between a quantum circuit and a carefully constructed analogue one relying on interference? For example, why couldn't I take a series of $N$ carefully shaped pipes, split a sound source between them, and build, say, a quantum Fourier transform circuit with classical versions of Hadamard and phase shift gates? For example, it would be easy to shift phase by extending the length of a pipe with a sufficiently smooth spiral. I recall that you can invert the phase with a reflection or a phase shift set to 1/2 the wavelength of the sound in the pipe. You could split and combine outputs by splitting and combining pipes. Then, instead of tallying up clicks on different channels (as in a quantum computer), you could just measure the power coming through each of the output channels.
I'm not saying this is necessarily practical--if nothing else you'd obviously have better bandwidth at higher frequencies than sound could propagate through most media. I got the sense there had to be some difference in effect between this hypothetical scenario and a real quantum computer. Could anyone help identify it or else confirm the effect is, in fact, the same?
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'resource-request', 'bloch-sphere']"," Title: Is every single-qubit unitary just a rotation around some unit vector on the Bloch sphere?Body: I remember reading this somewhere... Is there an elegant proof for this?
"
['gate-synthesis']," Title: Is it possible to decompose $\land(UXU^\dagger)$ in one-qubit operations and only a single $\land(X)$?Body: Let $U,V$ being any unitary.
Is it possible to decompose $\land(UXU^\dagger)$ in one-qubit operations and only a single $\land(X)$?
Something like the following: $\land(UXU^\dagger) \equiv (\mathbb{I}\otimes V)\land(X)(\mathbb{I}\otimes V^\dagger)$
I assumed that $\land(\cdot)$ operation controls over first qubit and operates over second.
"
"['architecture', 'quantum-control']"," Title: Usefulness of having a cryogenic controller at 4K for transmons/spin qubitsBody: There have been plenty of papers on the design of cryogenic control chips working at ~4K for qubit control and readout. These papers talk about how running coaxial cables from room temperature control electronics to the qubits inside the dilution refrigerator is not scalable and hence a cryogenic chip will be able to scale much better. However, after reading these papers, I'm still not convinced that such cryogenic chips could absolutely be needed as the number of qubits are scaled up. This is because the cable constraint could be alleviated (partially if not entirely) by using schemes like a cryogenic switch matrix.
Are there other, more subtle reasons for using cryogenic CMOS based controllers other than the decrease in cables running from room temperature to the dilution refrigerator? From my understanding, the number of cables needed to control the qubits from 4K would still remain the same and with lower cooling powers at the colder stages of the dilution refrigerator, the chip might not be able to control a lot of qubits anyway!
Some of the papers I'm referring to are listed here-
- Horseridge II
- Cryo CMOS controller I
- Cryo CMOS controller II
"
"['error-correction', 'bell-basis']"," Title: How to do error correction after encoded Bell measurement?Body: Need some help with the concepts of encoded/logical bell measurement.
Please visualize the picture in your mind. Suppose I have a node with 7+7 qubits side by side, left 7 is $|0_{L}\rangle$ and right 7 is $|+_{L}\rangle$. Suppose $|0_{L}\rangle$ = $|1001011\rangle$ and $|+_{L}\rangle$ = $|0011011\rangle$. Now I apply $CNOT$ between each pair of left and right qubits and after that $H$ gate on the all left side 7 qubits.
Now the problem how do I error correction. This part I am having confusion. I have an idea but I am having doubt.
Do I need to take additional 7 qubits for the left side and apply $CZ$ on each one and similarly additional 7 qubits for the right side and apply $CX$? This idea came after seeing the bell measurement from teleportation. This part is bothering, since those are logical qubits.
"
"['programming', 'qiskit']"," Title: Error when computing the self-designed gradient in qiskitBody: I had question with the way to define a new kind of gradient to improve the performance of VQE. The gradient formula I used consists of multiply energy (measurement result of the Hamiltonian) with the gradient of the energy. I follow the instruction of the qiskit gradient framework page, and take the following code as an example
#General imports
import numpy as np
#Operator Imports
from qiskit.opflow import Z, X, I, Y, StateFn, CircuitStateFn, SummedOp
from qiskit.opflow.gradients import Gradient, NaturalGradient, QFI, Hessian
#Circuit imports
from qiskit.circuit import QuantumCircuit, QuantumRegister, Parameter, ParameterVector, ParameterExpression
from qiskit.circuit.library import EfficientSU2
a = Parameter('a')
b = Parameter('b')
q = QuantumRegister(1)
qc = QuantumCircuit(q)
qc.h(q)
qc.rz(a, q[0])
qc.rx(b, q[0])
# Instantiate the Hamiltonian observable
H1 = (2 * X) + Z
H2 = X+Y+Z
# Combine the Hamiltonian observable and the state
op1 = ~StateFn(H1) @ CircuitStateFn(primitive=qc, coeff=1.)
op2 = ~StateFn(H2) @ CircuitStateFn(primitive=qc, coeff=1.)
op = op1 @ op2
print('op is', op)
params = [a, b]
# Define the values to be assigned to the parameters
value_dict = {a: np.pi / 4, b: np.pi}
# Convert the operator and the gradient target params into the respective operator
grad = Gradient().convert(operator = op1, params = params)
# Print the operator corresponding to the Gradient
grad = op1 @ grad
The last line of the code pops an exception:
Exception has occurred: ValueError
Composition with a Statefunctions in the first operand is not defined.
How to get rid of the exception in this case? Also, I need to get the result for the multiplication of two measured operator in the process (op1 and op2), does the code above op=op1@op2 can achieve this?
"
"['quantum-gate', 'quantum-state', 'entanglement', 'quantum-circuit']"," Title: Restrictions on Quantum Gates and Pure Partially Traced Output StatesBody: Suppose we have a quantum circuit that contains an arbitrary number of quantum gates and takes as an input more than a single qubit, say three. What are the restrictions on the quantum gates and the way that they are composed (in parallel or in sequence) so that when we partially trace out for all the wires except one, we get a pure state? This is an example of the set-up I have in mind.
- Input State: Pure
- Apply Quantum Circuit Operation
- Output State: Pure
- Partially trace out qubits 2 and 3.
- Induced State 1: Pure
Cross-posted on physics.SE
"
"['quantum-gate', 'unitarity', 'notation']"," Title: What is a bipartite unitary?Body: What is a 'bipartite unitary'? I saw it appearing in a paper "Efficient verification of quantum gates with local operations" (https://arxiv.org/pdf/1910.14032.pdf)
A reference to the definition is very much appreciated.
"
"['quantum-gate', 'circuit-construction', 'textbook-and-exercises', 'hadamard']"," Title: How do you represent a Hadamard gate as a product of $R_x$ and $R_y$ gates?Body: I'm looking for a representation of Hadamard gate that uses only $R_x(x)$ and $R_y(y)$ gates. The values $x$ and $y$ may be the same, but they don't necessarily need to be.
"
"['programming', 'qiskit', 'measurement', 'error-mitigation']"," Title: Manual measurement error mitigation returning a negative number of countsBody: I have a simple 2 qubit circuit which I am trying to protect from errors using the measurement error mitigation technique laid out here:
https://qiskit.org/textbook/ch-quantum-hardware/measurement-error-mitigation.html. My circuit is
qr=QuantumRegister(2)
circuit2 = QuantumCircuit();
circuit2.add_register(qr)
cr=ClassicalRegister(2)
circuit2.add_register(cr)
circuit2.measure(0,0);
circuit2.measure(1,1);
noise_model = NoiseModel()
noise_model.add_all_qubit_readout_error([[1 - Er0,Er0], [Er1, 1 - Er1]])
result = execute(circuit2,backend=Aer.get_backend('qasm_simulator'),shots=maxShot,noise_model=noise_model).result()
counts = result.get_counts(0)
I then get the counts for each outcome and store it in a vector
n00=counts.get('00')
etc..
n2qvec=np.array([n00,n01,n10,n11])
As is laid out in the tutorial I obtain the calibration matrix and filter
aer_sim = Aer.get_backend('aer_simulator')
qr2q = QuantumRegister(2)
my_layout2q={qr2q[0]:0,qr2q[1]:1}
meas_calibs2q, state_labels2q = complete_meas_cal(qr=qr2q, circlabel='mcal2q')
t_qc = transpile(meas_calibs2q, aer_sim)
qobj = assemble(t_qc, shots=10000)
noise_model = NoiseModel()
noise_model.add_all_qubit_readout_error([[1 - Er0,Er0], [Er1, 1 - Er1]])
cal_results2q = aer_sim.run(qobj, shots=10000,noise_model=noise_model).result()
meas_fitter2q = CompleteMeasFitter(cal_results2q, state_labels2q, circlabel='mcal2q')
meas_filter2q = meas_fitter2q.filter
calmat2q=meas_fitter2q.cal_matrix
import scipy.linalg as la
calmatinv2q = la.inv(calmat2q)
I then apply this to the earlier results to account for the noise
mitigated_results2q = meas_filter2q.apply(res2q[1])
mitigated_counts2q = mitigated_results2q.get_counts()
print(mitigated_counts2q)
This works sensibly. However I thought that this is equivalent to applying the inverse of the calibration matrix to the vector of results that I have:
print(np.dot(calmatinv2q,n2qvec))
print(min(np.dot(calmatinv2q,n2qvec)))
However sometimes this returns a negative counts. Obviously this isn't sensible so I assume that the measurement filter takes care of this somehow. Does anyone know how this is done? I wish to be able to do this manually because ideally I will run multiple two qubit circuits in parallel on the same quantum computer. So rather than running $2^n$ calibration circuits I will run 4 calibration circuits for each pair of qubits in isolation.
"
"['algorithm', 'complexity-theory', 'quantum-advantage', 'applications']"," Title: Would quantum computers be more efficient at solving circular reference problems than classical computers?Body: A circular reference is when a certain value either refers to itself or a value refers to a value that refers to it. An example of a circular reference problem would be $x=f(x)$. One way to solve such a circular reference problem would be to start with a random guess for x, find the value of f(x), and then have $x_{n+1}=f(x_n)$ until a certain numerical condition is met. Using this method it's possible that the first guess for x would satisfy the given numerical condition and going onto another iteration would be unnecessary.
I understand that quantum computers could solve some problems more efficiently than classical computers as they can perform multiple calculations at the same time, but in order for that to be useful the wrong answers need to destructively interfere with each other.
Would circular reference problems be something that quantum computers could solve more efficiently than classical computers?
"
['entanglement']," Title: How can I observe the effects of the entanglement?Body: A possibly to ignorant question. Here I read:
For example, if she measures a $|0\rangle$,Bob must measure the same, as $|00\rangle$
is the only state where Alice's qubit is a $|0\rangle$
In the Quantum composer, with the "Bell State ZZ-Measurement" code, q0 and q1 are entagled but, changing the visualization seed (now at 6162), they have distinct measures.
Is this because 'higher correlation' doesn't mean 'identical values' or am I misinterpreting the basic elements?
Many thanks.
"
"['programming', 'qiskit', 'ibm-q-experience', 'machine-learning']"," Title: how can we save a model using qiskit_machine_learning?Body: How can we save a trained model using Qiskit Machine Learning library?
I've built a VQC classification model and once finished, I'd like to save the different models to be loaded later.
There is a save_model method in Qiskit Aqua (from qiskit.aqua.algorithms import VQC) but for Qiskit Machine Learning (from qiskit_machine_learning.algorithms.classifiers import VQC) I havent found it yet.
Thanks!
"
"['qiskit', 'quantum-operation', 'density-matrix', 'quantum-process-tomography']"," Title: How to describe the evolution of a density matrix using the Choi matrix?Body: How do I apply the Choi matrix on a Density matrix.
Say my process is a Hadamard gate, and my input state is the ground state on 1 qubit (qubit id 0).
$U = H = \dfrac{1}{\sqrt{2}} \begin{bmatrix}1&1\\1&-1\end{bmatrix}$
Thus, to do ancilla assisted QPT, I need 1 ancilla qubit (I took it as the MSB, qubit id 1).
So,:
$\rho_{in} = |0\rangle \langle 0| = \begin{bmatrix}1&0\\0&0\end{bmatrix}$
Considering the full system (along with ancilla), the:
$\rho_{in}^{sys} = |00\rangle \langle 00| = \begin{bmatrix}1&0&0&0\\0&0&0&0\\0&0&0&0\\0&0&0&0\end{bmatrix}$
The (normalized) Choi matrix for the quantum circuit with Hadamard of Qubit 0, is:
$\rho_{choi}^{sys} = \begin{bmatrix}0.25&0.25&0.25&-0.25\\0.25&0.25&0.25&-0.25\\0.25&0.25&0.25&-0.25\\-0.25&-0.25&-0.25&0.25\end{bmatrix}$
This can be found either using Qiskit, or solving $(I \otimes H)(|\Omega \rangle \langle \Omega |)(I \otimes H)^\dagger$, where $|\Omega \rangle$ is the Bell pair $\dfrac{1}{\sqrt{2}} (|00\rangle +|11\rangle )$
Considering I am applying a Hadamard on the $\rho_{in}$, the output density matrix:
$\rho_{out} = H|0\rangle \langle 0|H^{\dagger} = \begin{bmatrix}0.5&0.5\\0.5&0.5\end{bmatrix}$
How exactly do I recover this back from the $\rho_{choi}^{sys}, \rho_{in}^{sys}$ and partial trace as given in the Qiskit link https://qiskit.org/documentation/stubs/qiskit.quantum_info.Choi.html?
"
['hamiltonian-simulation']," Title: Hamiltonian simulation for 2 qubit gatesBody: I have been reading this paper, and at the end they have given exact decomposition of Hamiltonian simulation step, where they have decomposed a matrix $A$ into pauli matrices and done the operation $e^{iAt}$.
The decomposition of A is as follows: $A=\frac{1}{4}(I\otimes I +9Z\otimes X+5X\otimes Z+3 Y\otimes Y)$, where I, X, Y and Z are Pauli matrices.
The hamiltonian simulation is $e^{iAt}$ and it's circuit is:
They have given the following description of the circuit:
Another observation is that the commuting terms are the stabilizers of the 2-qubit cluster state [5]. So we attempt to use controlled phase gates to get the correct terms. We can rotate the first qubit about the x -axis by an angle $5\theta$ and the second qubit about the x-axis by angle $9\theta$. The structure of $e^{3i\theta X\otimes X} $ is a x-rotation on the computational basis
states {$|00\rangle$, $|11\rangle$} and another on {$|01\rangle$, $|10\rangle$}. A CNOT gate converts these bases into single qubit bases, controlled off the target qubit. Since both implement the same rotation but controlled off opposite values, we can remove the control. The overall circuit is shown in figure 3a, which can be further simplified by combining the two controlled gates at the end as in figure 3b.
Can anyone explain the logic behind this?
"
"['quantum-gate', 'oracles', 'bernstein-vazirani-algorithm', 'reversible-computation']"," Title: Can there be different gate implementations of same oracle implementation?Body: I have been reading about Bernstein-Vazirani Algorithm, and it uses what is known as a phase oracle. Basically, it is CNOT gate with several controls attached to the ancilla qubit $|-\rangle$ (it is discussed in detail over here link) in the circuit what the Oracle $O$ does is that
$$O |+\rangle^{\otimes N}|-\rangle\text{ }=\text{ }|+-+--\dots\rangle|-\rangle$$
by the first ket on the R.H.S I mean that whichever ket from the input acts as a control, it flips the state from $|+\rangle$ to $|-\rangle$ when it comes out as output from the oracle. Note: Ancilla plays no role in computation.
However, I do not understand why do we need CNOT gates and ancilla (I am aware of the reversibility criterion of quantum circuits). My point is that why can't this oracle be implemented by $Z$ and $I$ (Identity) gates. $Z$ gates placed at those indices of the input ket which acted as a control for the previous version of the oracle and $I$ gates placed at the ones which did not act as a control. We then have for a new implementation of the same oracle
$$O'|+\rangle^{\otimes N}=|+-+--\dots\rangle$$
This new oracle implementation is also reversible as it is made of $Z$ and $I$ gates. Moreover, it does not need ancilla. Then why is it not discussed in standard textbooks? Am I wrong somewhere?
"
"['quantum-gate', 'measurement', 'quantum-circuit']"," Title: How does a quantum circuit calculating the inverse of a non-injective function act?Body: Lets say I have a non-injective function $f()$, adding image for reference. Now lets say I build a quantum circuit to calculate $f^{-1}()$. If the input register has the value $i$, does the output register have all the values $j$ in superpostion, such that $f(j)=i$ ?
"
['shors-algorithm']," Title: Question about the Result Analysis of Ekera's Method in Short DLPBody: In section 4.4 of the paper "Quantum algorithms for computing short discrete logarithms and factoring RSA integers", for an arbitrary set $\left\{ (j_i, k_i):1\le i\le s \right\}$ chosen from measured results $\left\{ (j_i, k_i):1\le i\le t \right\}$ ($t$ is the number of times the circuit is excecuted), the algorithm searches all possible $d$ that saitisfies
$$\sqrt{d^2+\sum_{t\,=\,1}^{s}({\left\{ dj_i+2^mk_i \right\}_{2^{l+m}}\,)^2}} < \sqrt{s/4+1}\cdot 2^m$$
Note that $d$ is strictly bounded by $\sqrt{s/4+1}\cdot 2^m$. To do this the algorithm should go as follows:
- Prepare an array $D:=\left\{ 0,\,...,\, B - 1 \right\}$, where $B$ is the ceiling of $\sqrt{s/4+1}\cdot 2^m$. Denote $d$ as the first element of $D$.
- Choose an arbiyary set $S\subset\left\{ (j_i, k_i):1\le i\le t \right\}$ of size $s$.
- Test whether $d$ and $S$ satisfy the above inequality. If test fails, then return to step 2 (this time choose a different $S$).
- Test whether $d$ is the desired answer (i.e. whether $x\equiv g^{d}$). If test fails, then remove $d$ from $D$ and return to step 3.
- Output $d$.
Here step 2 and 3 are meaningless and can be removed from these steps. In my understanding, if the integer can be factored into two primes, then there is no difference compared with an exhaustive search of $d$ from $0$ to $\sqrt{s/4+1}\cdot 2^m$ (where one exhaustive search of $d$ from $0$ to $2^m$ suffices to find an answer). In what part do I understand wrong in this section?
"
"['measurement', 'quantum-operation', 'notation']"," Title: What is the correct notation to denote operations conditional on a measurement outcome?Body: What is the correct mathematical notation to describe the following setup? I have classical state in register $A$ which I can think of as $\sum_i p_i \vert i\rangle\langle i \vert_A$. I measure this to obtain outcome $i$ and then perform operation $N_i$ on a different register $A'$.
How does one denote this type of conditional channel? The channel has to have input system $AA'$ and output $B$ (which is the output of $N_i$ for any $i$). I currently say
$$\sum_i N_i \otimes \langle i\vert \cdot \vert i\rangle $$
but this looks awkward.
"
"['programming', 'qiskit']"," Title: Qiskit: rounding with get_statevector does not work?Body: I am trying to follow some tutorials for Qiskit and came to the point where I wanted to get some statevector containing $1/\sqrt{2}$ with the following line of code:
outputstate = result.get_statevector(circ, decimals=3)
By specifying the option decimals=3, it should round the numerical value in the statevector to 0.707. However, it does not do that. Instead, what is displayed is 0.70710678+0.jas it apparently fails to round.
What could be the problem causing this? Or how else could I resolve this issue to get nicer looking results when displayed?
"
"['quantum-gate', 'optical-quantum-computing']"," Title: Can such a transformation be implemented by using just polarizers?Body: Consider a transformation $U_a=\sigma_z^{a_1}\otimes...\sigma_z^{a_N}$, here $\sigma_z$ is the Pauli Z operator. $a_i$ is either 0 or 1. Hence, $\sigma_z^{0}=I$ where $I$ is identity matrix.
If I use polarization of light as a qubit, can I implement this transformation using just polarizers? Please help me justify it.
"
"['programming', 'qiskit']"," Title: Custom labelling of randomly generated unitaries in QiskitBody: I'm writing a program in Qiskit involving the generation of Haar-random unitaries. Is there a way to label each unitary such that the label appears instead of 'unitary' when I draw the circuit?
qc = qiskit.QuantumCircuit(2,1)
randUnitary = qiskit.quantum_info.random_unitary(4)
qc.append(randUnitary,[0,1])
qc.draw()
"
"['programming', 'qiskit']"," Title: How to convert the output column vector or matrix into bra ket notation using python?Body: When using qiskit, we normally get the output inform of column vectors or matrix. But is it possible to convert then into bra ket notation using some python code?
Can someone help me with this?
"
"['programming', 'ibm-q-experience']"," Title: How to download from IBM Quantum lab folder of data .txt files all at once?Body: I have a script in the IBM Quantum lab which runs several jobs and stores the result of each job as a .txt file in a results folder. All I want to do is to download the folder of files. I cannot figure out how to do this and so at the moment I have to open the folder in the Quantum Lab and then select each file and individually download it. This is getting very tiresome.
I feel like I must be missing something really simple that would enable me to just download the folder, but when I click on the dropdown menu for the folder, all it allows me to do is to rename or delete it.
Sorry for the stupid question!
"
"['mathematics', 'measurement', 'textbook-and-exercises']"," Title: Finding the measurement basis for single qubit with given probability of outcome $0$Body: I have the general state of a single qubit $|\psi \rangle = \alpha|0\rangle + \beta|1\rangle $. Assume I am given a probability $p$ such that $0 < p <1$. Now I need to find the basis in which the measurement of the qubit $|\psi \rangle $ gives outcome $0$ with probability $p$.
I understand that the required basis $B$ will have $2$ states, so assume the basis is $B =\{|a\rangle, |b\rangle \}$. Also that, probability of outcome $0$, when measured in basis $B$, is $|\langle a |\psi\rangle|^2 $ which should equal $p$. At the same time, probability of outcome $1$ in basis $B$ is $|\langle b |\psi\rangle|^2 $ and should equal $1-p$.
I do not understand how to solve the above two inner-product equations to obtain states $|a\rangle$ and $|b\rangle$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Random accuracy using VQC and Iris datasetBody: Using the same seed (seed_simulator and seed_transpiler) I get different accuracy when running it several times.
In Aqua library (from qiskit.aqua.algorithms import VQC) I solved it adding aqua_globals.random_seed. In machine learning (from qiskit_machine_learning.algorithms import VQC) we have the equivalent: algorithm_globals.random_seed. But the problem continues.
Someone else has found this issue?
"
"['vqe', 'qaoa', 'quantum-advantage', 'fault-tolerance']"," Title: Why exactly are variational algorithms considered promising?Body: There is obviously a great deal of work happening at the moment on variational quantum algorithms. However, I'm struggling to understand why exactly are they considered promising? Looking through some papers and review articles (such as this one https://arxiv.org/abs/2012.09265) I still do not get a clear idea.
As far as I understand there aren't much rigorous results on performance of these algorithms, similarly to many classic machine learning approaches. It is often argued that variational algorithms are great for NISQ as they require much less resources than a typical fault tolerant algorithm. However, without performance guarantees this looks a bit like searching under a lamppost to me. Why do we expect to actually find anything (=quantum advantage) there?
I also expect that some of the frequently mentioned applications of variational algorithms are more speculative than others. So, what are the most solid reasons to believe that variational algorithms can outperform classical? Are there any estimations for the amount of resources (number of qubits, gate fidelities etc) needed to achieve them?
"
"['physical-qubit', 'superconducting-quantum-computing']"," Title: Is there an intuitive way to conceptualize the ground and excited states of a transmon qubit?Body: I understand how a transmon qubit is analogous to an LC circuit, but has an anharmonic energy spectrum due to the nonlinearity of the Josephson junction. I also understand how to write out the Hamiltonian and the significance of the contributing terms and find the energy eigenstates.
However, I am wondering if there is a good way to conceptualize what is happening in the circuit in a more physical sense, i.e., in the ground ($|0\rangle$) state, what are the cooper pairs doing versus what are the cooper pairs doing in the excited ($|1\rangle$) state? I am basically trying to understand what physically differentiates the ground and excited states.
"
"['quantum-state', 'measurement', 'textbook-and-exercises', 'tomography']"," Title: What are the conditions under which an unknown quantum state is learnable with arbitrary precision?Body: Assume that we have an unknown quantum state and we need to learn that unknown state with arbitrary precision.
Under what conditions can we learn the unknown state with arbitrary precision?
One condition that I understand is if I can get an arbitrary number of copies of the unknown states, I can estimate the probabilities and consequently conclude about the amplitudes.
Another condition is the ability to measure in the standard basis. But do we need the ability to measure in all bases other than the standard basis? Put another way, if I restrict myself to measurements in the standard basis only, would I fail to learn the unknown quantum state with arbitrary precision?
"
"['quantum-gate', 'error-correction']"," Title: Circuit for fault tolerant syndrome measurements Steane CodeBody:
I was exploring this paper: https://arxiv.org/pdf/1505.07390.pdf The paper describes the syndrome measurement for the [7,1,3] code. I was looking a fault-tolerant syndrome measurement and found this Figure. I was wondering what is $\psi_{L}$ and what is its function to the circuit, and I am thinking if I can remove $\psi_{L}$ and apply CNOT gate from $|0\rangle _{L}$ to $|+\rangle_{L}$ directly? Will it change the property of the circuit especially the fault-tolerant property.
It will be great to share the similar kind of circuit for [7,1,3] steane code for QEC.
"
"['programming', 'qiskit']"," Title: Which Qiskit Aer ideal quantum circuit simulator to use when aer_simulator is no longer available?Body: Some Qiskit tutorials have aer_simulator in the code and I have noticed that this simulator is no longer available.
from qiskit import QuantumCircuit
from qiskit import Aer
Aer.backends()
Which of the existing simulators should I use to replace aer_simulator?
The example tutorial is here.
"
"['programming', 'qiskit']"," Title: How do you map an X gate to a constant pulse?Body: I was wondering how to map an X gate to a constant pulse shape. This https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html is the link that I am working off. It shows an example of a Hadamard on a Gaussian pulse and how to do custom gates. I cannot figure out what changes I should make to the code in the Custom gates section of the link that would result in an X gate on a constant pulse shape.
"
"['physical-realization', 'hamiltonian-simulation', 'optimization', 'annealing', 'models']"," Title: What type of tasks it is possible to solve on a quantum simulator?Body: In this article, the author claimed that researches from Harvard and MIT created 256 qubits quantum simulator. However, we are not talking about piece of software on a classical computer but actual quantum system:
In 2017, they created a 51 qubit quantum simulator using rubidium atoms lined up in a 1D array. And now, they have created a larger 256 qubit system using atoms that can be arranged in a 2D array.
According to the article, such simulator is almost based on cold atom technology.
In another article it is stated that
“If you make systems larger and larger, very quickly you will run out of memory and computing power to simulate it on a classical computer,” he added. “The way around that is to actually build the problem with particles that follow the same rules as the system you’re simulating. That’s why we call this a quantum simulator."
So, this means that the researches created a model of a quantum system with help of another quantum system. They claimed that these quantum simulators can be also used for solving optimization problems. At the same time, quantum simulators are not universal quantum computers as gate-based ones.
Based on the description of the simulators, they seems to be similar to quantum annealers. So, my question is what kind of tasks we can solve on the simulators? Are they suitable only for Hamiltonian simulation?
"
"['ibm-q-experience', 'vqe', 'chemistry']"," Title: Why the last IBMQ job of my VQE have just one circuit?Body: I am running a VQE over the H2 molecule on ibmq_quito and I set a callback function to save all jobs id's of all iterations. When I check the penultimate job (and the previous ones), I have 2 circuits or experiments (one for Z basis and one for X basis). But when I check the last job, I just obtain one circuit. Does anyone know why on the last job of the VQE I have one circuit while I still have to measure in different basis to get the expectation value of the energy?
Thank you very much in advance!
"
"['quantum-operation', 'quantum-circuit']"," Title: How do successive operators act in the Heisenberg picture?Body: In the Schrodinger picture, it is clear how write a single gate for two operators. For example if operators $A$ then $B$ act on a state $\vert \psi \rangle$, this gives $BA\vert \psi \rangle$, (noting that the operator that acted last is written first). This could of course be written as a single operator $BA$.
In a circuit diagram we would have:
However in the Heisenberg picture (for the same circuit), the state would remain unchanged and the operators would evolve:
Now in order for these two operators to product into the same operator as in the Schrodinger case, we now need to write the operator that acted first acting first so that the $A^{\dagger}$ and $A$ cancel out.
- Is this the correct interpretation of each picture and the way of translating between the two pictures?
- Why does the order in which we write the operators change/appear to change in each picture?
"
"['textbook-and-exercises', 'density-matrix', 'nielsen-and-chuang']"," Title: Write the difference of 2 density operators in terms of a spectral decompositionBody: An exercise question (9.7) from Quantum computation and Quantum Information by Michael E. Nielson and Isaac L. Chuang says that I can write the difference of any 2 arbitrary density operators $\rho,\sigma$ as a spectral decomposition:
$$
\rho - \sigma = U D U^\dagger
$$
But for this to be true, isn't it necessary that the density matrices must commute?
From what I understand, I will need an orthonormal basis in which both will be diagonalizable. Based on the Simultaneous diagonalizable theorem this is only the case when $\rho$ and $\sigma$ commute.
What am I missing?
"
"['programming', 'qiskit', 'quantum-gate', 'ibm-q-experience']"," Title: Measuring the accuracy of a circuit output?Body: I have created a circuit and got the output which matches the truth table but, I'm not understanding the measuring the circuit output in terms of the probabilities, power or error.
This is the circuit I tried to create. It is the uppg gate.
from qiskit import *
def uppg(inp1, inp2, inp3, inp4):
qc = QuantumCircuit(4, 4)
#conditions
if(inp1 == '1'):
qc.x(0)
if(inp2 == '1'):
qc.x(1)
if(inp3 == '1'):
qc.x(2)
if(inp4 == '1'):
qc.x(3)
qc.barrier()
#circuit
qc.cx(3, 1)
qc.cx(1, 0)
qc.cx(0, 1)
qc.ccx(3, 2, 1)
qc.cx(1, 2)
qc.cx(3, 2)
#measure
qc.measure(0, 3)
qc.measure(1, 2)
qc.measure(2, 1)
qc.measure(3, 0)
qc.draw()
#backend
backend = Aer.get_backend('qasm_simulator')
job = execute(qc, backend, memory= True)
output = job.result().get_memory()[0]
return qc, output
for inp1 in ['0', '1']:
for inp2 in ['0', '1']:
for inp3 in ['0', '1']:
for inp4 in ['0', '1']:
qc_new, output = uppg(inp1, inp2, inp3, inp4)
print('{} {} {} {}'.format(inp1, inp2, inp3, inp4), '=', output)
display(qc_new.draw())
The above is the output I got, but I want the output to show in terms of probability or the accuracy of circuit output. How to achieve this in Qiskit?
"
"['programming', 'qiskit', 'qaoa']"," Title: How to build a QAOA AnsatzBody: I saw there is a qiskit package called "QAOAAnsatz" https://qiskit.org/documentation/stubs/qiskit.circuit.library.QAOAAnsatz.html.
But I didn't find out any tutorial related, so I have no idea how to use it.
Can anyone help me please? e.g. how to build parameter "cost_operator" etc. .
"
['ibm-q-experience']," Title: Does dedicated mode provide better results than fairshare in mid-circuit measurement?Body: I'm using a research account and I have a question about running circuits with (dedicated/priority mode) and without reservation (fair-share mode). From the documentation of dedicated mode,
This (The dedicated mode) allows users to implement algorithms where input circuits are conditioned on previous results, such as iterative and near-time compute methods, without having to wait for other users’ results to process.
My quantum circuits involve mid-circuit measurements without resetting the qubit after it is measured each time, so each measurement is (kind of) dependent on the previous results. I wonder if I run them using the fair-share mode (without reservation), will that still give me the results I'm supposed to have from the dedicated mode? I have run some experiments and it looks like there aren't too many differences, but I'm not sure if there should or should not be. Thanks!
"
['algorithm']," Title: What is the ""no fast-forwarding theorem""?Body: As a newbie to Quantum, I was reading some of the articles and ran into a no-fast-forwarding theorem, which is described "Simulating the dynamics of a quantum system for time T typically requires Ω(T) gates so that a generic Hamiltonian evolution cannot be achieved in sublinear time. This result is known as the “no fast-forwarding theorem”, and holds both for a typical unknown Hamiltonian and for the query model setting"
Does this mean that "there won't be any shorter-time algorithm than the required T? I don't think I fully appreciate the implication or practical meaning of this.
Any help would be appreciated
"
"['vqe', 'qaoa', 'quantum-advantage']"," Title: If a hybrid classical+quantum algorithm can achieve quantum advantage, does this mean that the quantum part alone can?Body: Take for example a variational algorithm which has a classical optimization part and a quantum sampling part. In principle, the quantum part can be simulated by another classical computer given sufficient amount of resources ("exponential" in general). Now, if the hybrid algorithm performs better than any known classical algorithm, does this imply that the quantum part of the algorithm that performs sampling from a quantum distribution can show this "quantum advantage" on its own (In the same sense as, say, the boson sampling)?
If this is so, should not the efforts in the variational algorithms than be focused entirely on the quantum sampling part? Or the whole point is to use the classical optimization to drive the quantum circuit in a regime where its sampling can not be efficiently reproduced classicaly?
"
"['programming', 'qiskit', 'vqe']"," Title: Trouble when implement a self designed gradient in qiskitBody: everyone! I have trouble when implement a self-designed gradient to the VQE algorithm. The following code will pop the 'ListOp' object is not callable exception to the last line of the code when executed. Can anybody tell me how to fix this?
H2 = (-1.052373245772859 * I ^ I) + \
(0.39793742484318045 * I ^ Z) + \
(-0.39793742484318045 * Z ^ I) + \
(-0.01128010425623538 * Z ^ Z) + \
(0.18093119978423156 * X ^ X)
optimizer = AQGD(maxiter=10)
var_form = EfficientSU2(2, su2_gates=['ry', 'rz'], entanglement='linear', reps=2)
op1 = ~StateFn(H2) @ CircuitStateFn(primitive=var_form, coeff=1.)
op2 = ~StateFn((H2 @ H2).reduce()) @ CircuitStateFn(primitive=var_form, coeff=1.)
op = 3 * op1 - 4 * op2
grad = Gradient().convert(operator = op, params = list(var_form.parameters))
vqe = VQE(var_form, optimizer, gradient=grad,
quantum_instance=Aer.get_backend('aer_simulator_statevector'))
result = vqe.compute_minimum_eigenvalue(operator=H2)
"
"['quantum-state', 'entanglement', 'density-matrix']"," Title: On existence of orthonormal basis for each subsystem in Separable stateBody: A separable state in $\mathcal{H}_{a}\otimes\mathcal{H}_{b}$ is given by
$$\rho_{s}=\sum_{\alpha,\beta}p(\alpha,\beta)|\alpha\rangle\!\langle\alpha|\otimes|\beta\rangle\!\langle\beta|.$$
Now, my question is, is there a suitable choice of $\{|\alpha \rangle\}$ and $\{|\beta \rangle\}$ such that all of them are elements from a complete basis (possibly non-unique) in individual subsystem?
A reason I think the bases $\{|\alpha \rangle\}$ and $\{|\beta \rangle\}$ will form a complete basis is because separable state space is the convex hull of tesnor products of symmetric rank-$1$ projectors $|\alpha\rangle\!\langle \alpha|\otimes|\beta\rangle\!\langle \beta|$. The extreme points are orthonormal sets $\{|\alpha\rangle\!\langle \alpha|\}$ and $\{|\beta \rangle\!\langle \beta|\}$. Is it true? Any help is appreciated.
"
"['quantum-gate', 'quantum-circuit', 'clifford-group', 'stabilizer-state']"," Title: Getting exponential sequence of coefficients with not so many $T$-gatesBody: Let $\Psi \in (\mathbb{C}^2)^{\otimes n}$ be a $n$-qubit quantum state. In the computational basis, we can write $\Psi$ as
$$\Psi = \sum_{(i_1, \dots, i_n) \in \mathbb{F}_2^n} \Psi_{i_1, \dots, i_n} |i_1 \dots i_n \rangle $$
where $\mathbb{F}_2 = \lbrace 0,1 \rbrace$ is the field with two elements.
For a natural number $p$, we say that $\Psi$ has a length-$p$ exponentially increasing coefficient sequence if there are $x_1, \dots , x_p \in \mathbb{F}_2^n$ such that $\Psi_{x_1} \neq 0$ and for all $i = 1, \dots , p-1$, $$2\cdot|\Psi_{x_i}| \leq |\Psi_{x_{i+1}}|$$
Write $l(\Psi)$ for the largest $p$ such that $\Psi$ has a length-$p$ exponentially increasing coefficient sequence.
For example, the unnormalised state $\psi = |000\rangle + |001\rangle + 3\cdot |010\rangle + 9 \cdot |100 \rangle$ has $l(\psi) = 3$.
Recall that the $T$-count, denoted $\tau(\Psi)$, of a state $\Psi$ is the minimum number of $T$-gates needed in a circuit that creates $\Psi$ from $|0\rangle$ using Clifford $+T$ gates, arbitrarily many ancilla qubits, and post-selective Pauli measurements on those ancillas. I want to construct a set of states with small $T$-count and a large exponentially-increasing sequence.
It is not difficult to construct a set of states $\Psi_n \in (\mathbb{C}^2)^{\otimes n}$ with $\frac{l(\Psi_n)}{\tau(\Psi_n)}=\Omega(1)$. For example, the state $|H\rangle ^{\otimes n}$, where $|H \rangle= |0\rangle+ (\sqrt{2}-1)|1\rangle$, has $\tau(|H \rangle)=n$ and $l(|H\rangle)=\Omega(n)$.
Question: Can we find a sequence of states $\Psi_n \in (\mathbb{C}^2)^{\otimes n}$ such that the quotient $\frac{l(\Psi_n)}{\tau(\Psi_n)}$ grows with $n$? Ideally, we would like it to grow superlogarithmically in $n$.
Ideas
Note that a circuit composed only of Clifford gates will output a state whose non-zero coordinates all have the same absolute value, so the $T$ gates are somehow "responsible" for creating the exponentially increasing sequence.
Here is another example of a sequence of states for which the quotient is constant in $n$. Recall that we can implement the multi-controlled $X$ gate $C^nNOT$ using $\mathcal{O}(n)$ many $T$ gates (and actually also $\Omega(n)$ many, see proposition 4.1 of this paper). Note that we can do the following trick (which I took from this paper): Start with the three qubit state $|000\rangle^{\otimes 3}$ and apply $H \otimes H \otimes \text{id}$. Then, apply a multi-controlled NOT gate where the first two qubits are the controls. This will leave our whole system (up to normalisation) in state $$\sum_{x_1, x_2, x_3 \in \mathbb{F}_2} |x_1 x_2 \rangle |x_1 \cdot x_2 \rangle$$
If we now measure the first two qubits in $|+\rangle, |-\rangle$ basis and apply $X$ on the last qubit, we get $|0\rangle + 3 \cdot |1 \rangle $ up to normalisation.
With that, we can build quantum circuits $\mathcal{C}_n$ with $2n$ ancilla qubits which look like this here for $n = 3$:
The measurements stand for measurements in $|+\rangle, |-\rangle$ basis post selecting outcome $|+\rangle$. Ignoring the ancillas, the following will happen on the three qubits in the three steps applying the multi controlled NOT gates:
$$ |000\rangle \mapsto |000\rangle + 3 |100\rangle \mapsto |000\rangle + 3 |100\rangle + 9 |110\rangle \mapsto |000\rangle + 3 |100\rangle + 9 |110\rangle + 27 |111\rangle$$
It's clear that this construction generalises: On $n$ qubits we can create a state $\Psi_n$ with an exponentially increasing coefficient sequence of size $ n + 1$ using $2n$ ancilla qubits and $n$ multi controlled NOT gates with 3 controls, giving a $T$-count $\mathcal{O}(n)$, that is, we again have $\frac{l(\Psi_n)}{\tau(n)} = \Omega(1)$.
I would be happy to hear if someone has an idea of other tricks which are similar to the multi controlled NOT gate which I can use to build up circuits creating these exponentially increasing sequences as output.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: ""503: Server Unavailable. Your server appears to be down. Try restarting it from the hub"". HelpBody: This message is popping continuously for 2 days in my IBM Quantum lab. I have tried logging out and in again, restarting the browser, changing the internet connection, and changing the device but this keeps showing.
"
['entanglement']," Title: Test for Entanglement of UnitaryBody: Define a quantum gate(or unitary) $U$ as entangling if there is a product state that $U$ produce entangling state when applied on.
I've referred previous answer that notion of 'entangling power' can be criterion for entanglement testing for any unitary, which is defined as
$$
K_E(U) = max_{|\phi\rangle, |\psi\rangle } E(U|\phi\rangle, |\psi\rangle).
$$
(here E denotes von Neumann entropy)
However, I think it is unsatisfactory to be used, since it seems that it cannot be computed with method other than brute force method in general (enumerating on every product states).
Is there another criterion of entangling gate or maybe no general (fancier then brute-force) method exist?
"
"['entropy', 'classical-quantum']"," Title: Prove that for a pure tripartite state $\rho_{ABE}$, $H(RB) = H(RE)$Body: Let's say we have a pure tripartite state $\rho_{ABE}$ and a completely positive map $\mathcal{R}$, which is defined as:
$$
\mathcal{R} : \rho \rightarrow \sum_j \langle\psi_j|\rho |\psi_j \rangle |\psi_j\rangle\langle\psi_j|,
$$
for some density operator $\rho$. Now we apply this map $\mathcal{R}$ to the subsystem $A$ only. So the resulting state is:
$$
\rho'_{ABE} = (\mathcal{R} \otimes \mathcal{I} \otimes \mathcal{I}) (\rho_{ABE}),
$$
where $\mathcal{I}$ is the identity map. Now, in this state $\rho'_{ABE}$, how do I prove that:
\begin{equation}
H(RB) = H(RE) \tag{1}
\end{equation}
where, $R$ is the classical state that we get when we apply map $\mathcal{R}$ on subsystem $A$. I know that for pure state $\rho_{ABE}$, any bipartite cut would produce the same entropy, i.e. :
$$
H(AB) = H(E),
H(AE) = H(B),
H(A) = H(BE).
$$
However, I don't think it is the case that, $H(AB) = H(AE)$, isn't it? If so, then how come equation ($1$) is true?
"
['quantum-state']," Title: What is the best way to extend a state $\rho_S$ to a tensor product of spaces ${\cal H}_S\otimes{\cal H}_A?$Body: Let $\Phi_S$ be an operator acting on a space $\mathcal H_S$. If we introduce an ancilla $A$, the total space becomes $\mathcal H_S\otimes \mathcal H_A$ and I can naturally extend the operator $\Phi_S$ to act on the whole space by defining $\Phi_{SA}=\Phi_S\otimes \mathbb{I}_A$, where $\mathbb{I}_A$ is the identity on $A$.
What is the correct way of extending a state or more generally a density operator $\rho_S$ to the space $\mathcal H_S\otimes \mathcal H_A$? Since $\rho_S$ is also an operator, I would write again $\rho_{SA}=\rho_S\otimes \mathbb I_A$. Is this correct?
"
"['programming', 'qiskit']"," Title: How do you verify the output of an X Gate within the Pulse gates framework?Body: I have found out how to create an X gate for a constant pulse within the Pulse gates framework found on this link: https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html
My question is how would I verify the output of the X gate and see a 0 input state mapped to a 1 output state? I attached a picture of the code I have so far.
from qiskit import QuantumCircuit, pulse, transpile
from qiskit.test.mock import FakeValencia
from qiskit.pulse.library import Constant
backend = FakeValencia()
build circuit that only contains one x gate and one measurement
circ = QuantumCircuit(1, 1)
circ.x(0)
circ.measure(0, 0)
with pulse.build(backend) as my_schedule:
d0 = pulse.drive_channel(0)
a0 = pulse.acquire_channel(0)
pulse.play(Constant(duration=10, amp=0.1), pulse.drive_channel(0)) #
build the constant pulse
pulse.delay(20, d0)
pulse.play(pulse.library.Constant(5, 1.0), d0)
pulse.delay(20, d0)
pulse.play(pulse.library.Constant(5, 1.0), d0)
pulse.delay(20, d0)
pulse.play(pulse.library.Constant(5, 1.0), d0)
pulse.delay(20, d0)
pulse.play(pulse.library.Constant(5, 1.0), d0)
pulse.delay(20, d0)
pulse.play(pulse.library.Constant(5, 1.0), d0)
my_schedule.draw()
circ.add_calibration('x', [0], my_schedule) # map x gate in qubit 0 to my_schedule
circ = transpile(circ, backend)
print(backend.configuration().basis_gates)
circ.draw('mpl', idle_wires=False)
"
"['shors-algorithm', 'hhl-algorithm', 'phase-estimation']"," Title: ""Classical"" phase estimation versus iterative phase estimationBody: In the article Arbitrary accuracy iterative phase estimation algorithm as a two qubit benchmark, the authors introduced implementation of phase estimation with two qubits only. The trick that bits representing a phase are found piece by piece. Although, this is at the cost of repeated calculations, in the end the number of qubits saved is material. Moreover, the circuit is much less complex. Both these features seems to me crucial in NISQ era.
I realized that such approach to the phase estimation was exploited in hybrid HHL algorithm (Large-scale quantum hybrid solution for linear systems of equations) and something similar in implementation of QFT in Shor's algorithm (Experimental Study of Shor's Factoring Algorithm on IBM Q).
Although the iterative phase estimation was introduced more than 14 years ago, I did not notice their significant exploitation. Therefore, my question is why this approach is not widely used? Is there any factor that hinders its application?
"
"['qiskit', 'circuit-construction', 'amplitude-amplification']"," Title: Managing memory while running a high depth circuit simulation (amplitude amplification) using QiskitBody: I am running an instance of amplitude amplification using Qiskit (v 26) on Google Colab.
The circuit is approximately 17 qubits in space and $O(ck)$ in depth where $k \in \left \{1,2,3....,22 \right \}$ and $c\approx120$.
k is related to the number of amplifications in Amplitude Amplification
I've already gotten results when $k < 15$, but for any other case I seem to get an "out of memory" problem (i've got approximately 27 RAM on my colab notebook)
Are there any good options on simulating such circuit on qiskit while keeping the limit on memory at bay?
I am working towards simply running each amplification separately, save the statevector on memory, and recycle the circuit over and over until I get the k amplifications. Are there any other options (maybe possibly within Qiskit)?
"
"['cryptography', 'nisq']"," Title: Mahadev's classical homomorphic encryption for quantum circuits and NISQ computingBody: I'm currently reading Mahadev's paper Classical Homomorphic Encryption for Quantum Circuits: https://arxiv.org/abs/1708.02130
I was told that Mahadev's scheme is not something that can be implemented in the NISQ era, but I couldn't find anything in her paper specifying why this is the case.
My question: can anyone point at some specific ingredients in Mahadev's construction that are problematic for NISQ era computing?
"
"['programming', 'qiskit', 'quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How to perform a plot histogram for a circuit?Body: I have created a circuit and I don't know how to plot a histogram. I tried to plot a histogram but it gives me output for 0000 case only, how to get to know the probability for all of the cases. The below is the plot I got,
qc = QuantumCircuit(4, 4)
qc.cx(3, 1)
qc.cx(1, 0)
qc.cx(0, 1)
qc.ccx(3, 2, 1)
qc.cx(1, 2)
qc.cx(3, 2)
qc.measure(0, 0)
qc.measure(1, 1)
qc.measure(2, 2)
qc.measure(3, 3)
job = execute(qc, backend = Aer.get_backend('qasm_simulator'), shots=1024)
result = job.result()
count = result.get_counts()
plot_histogram(count)
How to get the plot histogram not only for 0000 case but also all of the other cases?
"
"['qiskit', 'textbook-and-exercises']"," Title: How to Report an error in the Qiskit Textbook?Body: In the Qiskit Textbook in Chapter "Introduction to Quantum Computing -> Entangled states -> The CX gate revisited" the following sentence might be wrong:
If we do the CX now, we will see an effect. It flips the target qubit to as well.
I think it should say that the control qubit is the one flipping.
"
"['programming', 'qiskit', 'error-mitigation']"," Title: About qiskit's error mitigationBody: In qiskit, the error correction using least squares is apparently in qiskit-ignis/qiskit/ignis/mitigation/measurement/filters.py, source code from github and reads:
# Apply the correction
for data_idx, _ in enumerate(raw_data2):
if method == 'pseudo_inverse':
raw_data2[data_idx] = np.dot(
pinv_cal_mat, raw_data2[data_idx])
elif method == 'least_squares':
nshots = sum(raw_data2[data_idx])
def fun(x):
return sum(
(raw_data2[data_idx] - np.dot(self._cal_matrix, x))**2)
x0 = np.random.rand(len(self._state_labels)) # ********
x0 = x0 / sum(x0) # ********
cons = ({'type': 'eq', 'fun': lambda x: nshots - sum(x)})
bnds = tuple((0, nshots) for x in x0)
res = minimize(fun, x0, method='SLSQP',
constraints=cons, bounds=bnds, tol=1e-6)
raw_data2[data_idx] = res.x
else:
raise QiskitError("Unrecognized method.")
I'm not too skilled in python and I would not like to change my qiskit's base installation. I have marked with * the two lines that seems to me strange.
My question is: in this error correction, one does least squares to minimize the function $F=|c_{\rm exp} - Mc_{\rm corr}|^2$, where $c_{\rm exp}, c_{\rm corr}$ are the experimental and corrected counts, respectively and $M$ is the "correction matrix".
As it is common, minimize requires a fair guess x0 in order to find the answer of $F$. I don't understand why the built-in function sets x0 as a random vector. Ok, I can buy that the method "does not know which previous circuit was ran", but in theory if one knows the circuit, one should choose x0 based on this information, right?
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: What are min and max numbers of inputs needed to know whether the 4-bit classical Deutsch-Jozsa algorithm is balanced?Body: What are the minimum and maximum number of inputs you would need to check to know whether this 4-bit classical Deutsch-Jozsa oracle is balanced or constant?
"
"['performance', 'quantum-parallelism']"," Title: Is it currently more cost effective/efficient to run a general purpose parallel algorithm on an accelerated quantum simulator or on CPUs?Body: Quantum simulation is advancing and I'm wondering if now or in the future there is a point where its more cost effective and efficient to run general purpose parallel algorithms (e.g. with a mix of operations, loops, conditional flows and highly parallel tasks etc) on an hardware/GPU/analogue accelerated quantum simulator, or will it be always better on CPUs?
"
"['d-wave', 'adiabatic-model']"," Title: The Adiabatic Theorem - How to derive Schrödinger equation in the ""s"" variableBody: I'm studying Adiabatic Quantum computing from the book
"Adiabatic Quantum Computation and Quantum Annealing: Theory and Practice" by Catherine C. McGeoch at D-Wave.
The section THE ADIABATIC THEOREM in the book is based on the paper
"How Powerful is Adiabatic Quantum Computation? (Wim van Dam et al., 2001)" - section 2.
In both sources above, Schrödinger equation in variable $t$ is introduced first:
$$i \hbar \frac{d }{dt}|\Phi_t\rangle = \mathcal{H}(t) |\Phi_t\rangle.$$
Then, in the book the authors said this before arriving at Schrödinger equation in $s$.
$$\frac{d }{ds}|\Phi_s\rangle = -i \tau(s) \widetilde{\mathcal{H}}(s) |\Phi_s\rangle.$$
I have difficulty understanding this derivation. Honestly, I don't even know the formula of $\tau(s)$. The only clue about it is the sentence
Let $\tau(s)$ determine the rate at which the Hamiltonian changes as a function of $s$,
which I'm not sure what it means. I've also looked in the paper (section 2) and just found that this $\tau$ got a name.
a delay factor $\tau(s)$
But no extra information can be found there.
Can someone please help explain what $\tau$ is and/or, if possible, explain to me about the whole derivation of the second Schrödinger equation (in variable $s$) ?
"
"['quantum-state', 'error-correction']"," Title: Error correction on $n$ qubits all in same state except for a fewBody: This might be a straightforward problem for you guys; it would be helpful if you can explain it in simple language.
I have $n$-qubits given as
$$\frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\theta_{1}}|1\rangle \right) \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\theta_{2}}|1\rangle \right) \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\theta_{3}}|1\rangle \right) \otimes \cdots \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+e^{\iota\theta_{n}}|1\rangle \right)$$
where $\theta_i$'s are same except for only a few $\theta$s which are diffferent from rest.
How to apply an error correction on these states to correct those tiny fractions of $\theta$ to get all qubits in the same state?
For simplest case if I have
$$\frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\theta}|1\rangle \right) \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\theta}|1\rangle \right) \otimes \cdots \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+ e^{\iota\beta}|1\rangle \right) \otimes \cdots \otimes \frac{1}{\sqrt{2}} \left(|0\rangle+e^{\iota\theta}|1\rangle \right)$$
all same but the $i$th $\theta$ is different, then how to correct that qubit?
Any help or suggestions would be greatly appreciated!
"
"['qiskit', 'initialization']"," Title: How is the state preparation Unitary in initialize selected?Body:
![]()
Normally, in order to prepare the Bell state $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$, we can simply make a circuit with a Hadamard gate on $|0\rangle$ followed by a CNOT gate on $|1\rangle$. However, initializing the Bell state and then using Decompose() will give a different circuit. We can also check the unitaries of the 2 different scenarios and realize that they are different. Thus, how does Qiskit select the state preparation unitary when the initialize function is used?
"
['classical-computing']," Title: Are there problems that a classical computer can solve and a quantum computer can never solve?Body: Apologies if this is a silly question. But I've heard quantum computers can solve problems that classical computers can't. What about the converse, are there any problems that a classical computer can solve and a quantum computer can never solve?
"
"['universal-gates', 'deutsch-jozsa-algorithm', 'oracles']"," Title: How is the oracle physically implemented in Deutsch algorithm?Body: In the Deutsch algorithm, the oracle implementation for the function f is taken as a black box, but physically, how is the oracle implemented? Why can we assume such a black box exists for the computer?
The algorithm itself makes sense but how do we intuitively understand the existence of such an oracle for any function f. Is the correct analogy that in a computer, the implementation of a function is some sequence of gates. In a quantum computer, the abstraction of a function is that idea that it is also underneath just a sequence of gates.
"
"['quantum-gate', 'entanglement']"," Title: How does one interpret intuitively the CNOT gate?Body: How does one interpret the CNOT gate? The CNOT gate takes a separable state and turns into an entangled state. The oracle in the Deutsch algorithm does the same thing. But how does one understand this intuitively?
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: How to understand combination states vs pure/mixed states?Body: I've learned that representing a combination of two states, I simply need to take the tensor product of the states. For example:
$$\left|\Psi\right>=\alpha_0\left|0\right>+\beta_0\left|1\right>$$
$$\left|\Phi\right>=\alpha_1\left|0\right>+\beta_1\left|1\right>$$
The combination state is given by: $$ \left|\Psi\right>\otimes\left|\Phi\right>=\alpha_0\alpha_1\left|00\right>+\alpha_0\beta_1\left|01\right>+\beta_0\alpha_1\left|10\right>+\beta_0\beta_1\left|11\right> $$
"Mixing" them in a classical sense can be done by simply finding their density matrices, and adding them together weighed by their probabilities respectively:
$$\rho=p_1|\Psi\rangle\langle\Psi|+p_2|\Phi\rangle\langle\Phi|$$
Which gives us a mixed state.
Can I understand it as the combination state is EITHER $\left|\Psi\right>$ OR $\left|\Phi\right>$ and the mixed state is BOTH $\left|\Psi\right>$ AND $\left|\Phi\right>$?
If so, is it possible to calculate the probability of finding $\left|\Psi\right>$ in $(\left|\Psi\right>\otimes\left|\Phi\right>)$? (By my intuition, if the combination state is OR, then the probability should be just $1$?)
"
"['entanglement', 'teleportation', 'bell-basis']"," Title: What happens to the Bell state qubits after the Quantum Teleportation?Body: I'm reading on the Quantum Teleportation and I couldn't find anywhere what happens to the bell state qubits after the Quantum Teleportation.
"
"['quantum-state', 'textbook-and-exercises', 'unitarity']"," Title: Unitary Transformations for Schmidt DecompositionBody: $\newcommand{\ket}[1]{|#1\rangle}$
Suppose a pure state $\ket{\psi}$ has a Schmidt decomposition given by $\ket{\psi^{SD}}$, which can be obtained via the diagonalization of the reduced density matrix of $\ket{\psi}$. Is there a unitary transform one can construct from the diagonalization process that will directly convert $\ket{\psi}$ to $\ket{\psi^{SD}}$? That is, $\ket{\psi^{SD}} = U\ket{\psi}$ for some unitary transform $U$. If so, how would one construct such a unitary transform?
"
"['qiskit', 'vqe']"," Title: Active space chosen for VQE in qiskitBody: I encountered a problem when learning from the qiskit tutorial about solving electronic structure problem with VQE. Under the "Running VQE on a Statevector Simulator" part, the code provided for leveraging active space of LiH to reduce the qubit requirement seems quite confusing. The freeze_list in the code is interpreted as the core space in my opinion. However, what confuse me is that why to choose the [-3, -2] orbitals as virtual space to be removed (remove_list). Or the problem can be stated as why to choose [-3, -2] as the virtual space of the LiH molecule? The corresponding code of the tutorial is provide as below:
def get_qubit_op(dist):
driver = PySCFDriver(atom="Li .0 .0 .0; H .0 .0 " + str(dist), unit=UnitsType.ANGSTROM,
charge=0, spin=0, basis='sto3g')
molecule = driver.run()
freeze_list = [0]
remove_list = [-3, -2]
repulsion_energy = molecule.nuclear_repulsion_energy
num_particles = molecule.num_alpha + molecule.num_beta
num_spin_orbitals = molecule.num_orbitals * 2
remove_list = [x % molecule.num_orbitals for x in remove_list]
freeze_list = [x % molecule.num_orbitals for x in freeze_list]
remove_list = [x - len(freeze_list) for x in remove_list]
remove_list += [x + molecule.num_orbitals - len(freeze_list) for x in remove_list]
freeze_list += [x + molecule.num_orbitals for x in freeze_list]
ferOp = FermionicOperator(h1=molecule.one_body_integrals, h2=molecule.two_body_integrals)
ferOp, energy_shift = ferOp.fermion_mode_freezing(freeze_list)
num_spin_orbitals -= len(freeze_list)
num_particles -= len(freeze_list)
ferOp = ferOp.fermion_mode_elimination(remove_list)
num_spin_orbitals -= len(remove_list)
qubitOp = ferOp.mapping(map_type='parity', threshold=0.00000001)
qubitOp = Z2Symmetries.two_qubit_reduction(qubitOp, num_particles)
shift = energy_shift + repulsion_energy
return qubitOp, num_particles, num_spin_orbitals, shift
"
"['algorithm', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Quantum Boltzmann Machine and Gibbs stateBody: I was looking into Quantum Boltzmann Machine and ran into Gibbs State as a part of training.
Since new to this field, it would be good to have good intuitions why Gibbs state is related. Is Gibbs state simple the same as the ground state in this context?
Any pointer would be highly appreciated
"
"['programming', 'qiskit']"," Title: Thoughts in coding large and repetitive/non-repetitive quantum circuits?Body: Just out of curiosity, are there advances or directions on how to write a program (e.g. in qiskit) for a large number of qubits? Assuming that the number of gates that can be applied can be "arbitrary" long along with the coherences, how would one code a circuit for maybe $2^{50}$ spins?*
Obviously if the circuit is a bit "repetitive", one can store the "base" circuit only once and applied as many times as needed. But right now does it exist already a tool for such cases? What will happen in the future if the code is fairly complex with few repetitions?
*There are considerable more information in a circuit code that in just the lists of 1 and 0's of binary data...
"
"['quantum-state', 'notation']"," Title: What is the ""quantum phase"" of a quantum state?Body: On this page IMBQ docs, until the sentence '..and since the global phase of a quantum state is not detectable..' I follow everything. However 'quantum phase' is introduced without any explaination? What is this?
"
['qiskit']," Title: I have a questions about the represented values in the chapter “Advanced single bit gates”Body: I don't understand what are the values of this table at the very end is representing.
My question:
Does decimal values in the table represent Frequency divided by shots?
"
"['mathematics', 'error-correction']"," Title: Simplifying equation for two qubit syndrome extraction codeBody: In the paper Quantum Error Correction: An Introductory Guide, the author gives the following formula for a simple two qubit code (eq. 19 on the paper).
$$
E|\psi\rangle_L|0\rangle_A \xrightarrow{\text{syndrome extraction}} \frac{1}{2}(\mathbb{I}_1\mathbb{I}_2 + Z_1Z_2) E|\psi\rangle_L|0\rangle_A + \frac{1}{2}(\mathbb{I}_1\mathbb{I}_2 - Z_1Z_2) E|\psi\rangle_L|1\rangle_A
$$
For reference, the circuit corresponding to this code is:
Where $E \in \{\mathbb{I}, X_1, X_2, X_1X_2\}$ is an error gate. Now, after giving that equation, the paper says
Now, consider the case where $E = X_1$ so that the logical state occupies the error space $E|\psi\rangle_L \in \mathcal{F}$. In this scenario, it can be seen that the first term in equation (19) goes to zero. [...] Considering the other error patterns, we see that if the logical state is in the codespace (i.e., if $E = \{\mathbb{I}, X_1X_2\}$) then the ancilla is measured as ‘0’.
$\mathcal{F}$ is the error space, which contains the states $|01\rangle$ and $|10\rangle$. By making $|\psi\rangle_L = \alpha|0\rangle_L + \beta|1\rangle_L$ and working out the equation with $E = X_1$ and $E = X_2$ I can see how the first term cancels and we are left with $|1\rangle_A$ in the ancilla qubit. Similarly with $E = X_1X_2$ and $E = \mathbb{I}$ I can see how we are left with $|0\rangle_A$ in the ancilla qubit.
As you can see, I needed to expand the logical qubit to see how the code is able to measure the error. However, I feel like it is implied in the paper that you can figure this out by just substituting $E$ and leaving $|\psi\rangle_L$ as it is. How can I show this? For example, in the case that $E=X_1$, how does the expression
$$
\frac{1}{2}(\mathbb{I}_1\mathbb{I}_2 + Z_1Z_2) X_1|\psi\rangle_L|0\rangle_A + \frac{1}{2}(\mathbb{I}_1\mathbb{I}_2 - Z_1Z_2) X_1|\psi\rangle_L|1\rangle_A
$$
simplify such that the first term disappears, without making $|\psi\rangle_L = \alpha|0\rangle_L + \beta|1\rangle_L$? I tried doing it with matrix multiplication but the term didn't disappear.
"
"['qiskit', 'ibm-q-experience', 'ibm', 'quantum-control']"," Title: What are the runtimes of the different modes of qiskit's mcx?Body: Qiskit's mcx has four different modes:
- 'noancilla': Requires 0 ancilla qubits.
- 'recursion': Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0.
- 'v-chain': Requires 2 less ancillas than the number of control qubits.
- 'v-chain-dirty': Same as for the clean ancillas (but the circuit will be longer).
The default is 'noancilla', so I was wondering what's their runtime like? Are they any better than the one proposed here? Is either one of them using this method? Can someone provide sources for the methods used in each?
"
"['quantum-state', 'mathematics', 'density-matrix']"," Title: What are the conditions ensuring a two-qubit density matrix is positive semidefinite?Body: I've seen some papers writing
$$\rho=\frac{1}{4}\left(\mathbb{I} \otimes \mathbb{I}+\sum_{k=1}^{3} a_{k} \sigma_{k} \otimes \mathbb{I}+\sum_{l=1}^{3} b_{l} \mathbb{I} \otimes \sigma_{l}+\sum_{k, l=1}^{3} E_{k l} \sigma_{k} \otimes \sigma_{l}\right).$$
I wonder what condition should the matrix $E$ obey?
For a one-qubit state, the density matrix satisfies $\newcommand{\tr}{{\operatorname{tr}}} \tr(\rho)=1$ and is positive semidefinite. And the general form is
$$1/2\begin{pmatrix}1+z & x-iy\\x+iy & 1-z\end{pmatrix},$$
satisfying trace condition. As for positive semidefinite conditions, there's a theorem stated that a hermitian matrix is positive semidefinite iff its eigenvalue is not negative. So I calculate the eigenvalues of it and get the restriction that $x^2+y^2+z^2 \le 1$, which can be seen as exactly the Bloch sphere.
Then I want to see the same thing happens in two qubits case. But I can only mimic the same reasoning and get the general form
$$\rho=\frac{1}{4}\left(\mathbb{I} \otimes \mathbb{I}+\sum_{k=1}^{3} a_{k} \sigma_{k} \otimes \mathbb{I}+\sum_{l=1}^{3} b_{l} \mathbb{I} \otimes \sigma_{l}+\sum_{k, l=1}^{3} E_{k l} \sigma_{k} \otimes \sigma_{l}\right).$$
And when I try to calculate the eigenvalues of this matrix, even Mathematica showed a complex result. But if we think the separable case, easy to see that the vector $a$ and vector $b$ should have length less than 1. But I can't find the restriction on matrix $E$.
To summarize, in general, the two qubits state can be stated as: $$\rho=\frac{1}{4}\left(\mathbb{I} \otimes \mathbb{I}+\sum_{k=1}^{3} a_{k} \sigma_{k} \otimes \mathbb{I}+\sum_{l=1}^{3} b_{l} \mathbb{I} \otimes \sigma_{l}+\sum_{k, l=1}^{3} E_{k l} \sigma_{k} \otimes \sigma_{l}\right).$$
What's the restriction on its parameters to make it a legal density matrix, i.e., trace condition and positive semidefinite condition?
"
"['hamiltonian-simulation', 'adiabatic-model']"," Title: Standard to select base hamiltonaian for Adiabatic quantum computingBody: I'm learning about connection between QUBO and The Ising Model.
It says
Take the base Hamiltonian of an adiabatic process as $\sum_i \big(\frac{1-\sigma_i^x}{2}\big)$
to implement Hamiltonian for Ising Model.
Is there any specific reason or standard for selecting this hamiltonian?
Or what material will help me?
Thank you.
"
"['resource-request', 'complexity-theory', 'machine-learning']"," Title: Are all computational resources reducible to the time resource?Body: It's well known that in most (if not all?) computations you can trade time and space resources. An extreme example might be creating an infinitely large lookup table of all composites produced from the multiplication of two primes. Using this table, you could simply lookup the primes for a composite in constant time rather than factoring the composite, which would require superpolynomial time (this of course ignores the initial computation of the lookup table).
But, can all computational resources be traded for time? And, more specifically, can we trade the number of samples required to learn a function for time? Any resources providing a discussion of this (or just a great explanation) would be fantastic. See the background to this question for some more (and important!) context.
Background
In a recent discussion I held that sample complexity (i.e. the data resource) is different from communication, circuit, space, or other time reducible complexity resources. In particular, if some superpolynomial quantum advantage in sample complexity exists for some learning problem (e.g. see this classic paper or this more recent one), then it may imply that there is a difference in the ability of the classical and quantum learners to "see" the information contained in the sample distribution being used to learn some target function. In such a situation, the term "quantum speedup" may not be appropriate – from the classical perspective, more time cannot make up for the lack of data, implying that sample complexity is (or can be) time irreducible.
More recently, I think I've begun to see how the term "quantum speedup" may still be appropriate in describing advantages in sample complexity. As mentioned, my past view was that the data resource is not time reducible, however, I suspect that this may not be correct. In particular, given superpolynomial time resources, a target function may be classically learnable with a polynomial number of samples by their repeated analysis – assuming the polynomial number of samples contains the necessary information for some learner to learn the target function (e.g. a quantum learner, which in this case could be used to prove that the polynomial samples contain sufficient information by some interactive proof with the classical verifier). Were this to be the case, then it is clear that the information to learn the target function does exist in the polynomial number of samples and that the classical learner simply requires (say) superpolynomial time to learn the target function from the polynomial number of samples. This would imply that sample complexity is (at least for some learning problems) time reducible.
Thus the question: Can the classical learner take that polynomial number of samples and, with superpolynomial time, learn the target function at all? That is to say, is it the case that the information is simply not accessible to a classical learner, irrespective of how long you let it compute on those polynomial number of samples (i.e. is the data resource in this context time irreducible)?
I think my initial intuition around the time irreducibility of sample complexity can be summed up by this crude analogy: Where someone with 20/20 vision looking into the distance may see mountains and certain fine details (houses, trees, a radio antenna), someone with 20/80 vision may be unable to see those fine details and only make out the shapes of the mountains – no matter how long they stare at them; they need more data, which in this scenario would mean getting a closer look by physically moving closer (more data) or interrogating their friend with 20/20 vision (interactive proof).
All said, my intuition tells me that the reducibility of sample complexity to time varies by some inherent structure of the learning problem and its interaction with the properties of the type of information one is working with (e.g. classical, quantum), though this is very much a half-baked intuition. Is there a paper where this question has already been answered?
"
"['quantum-fourier-transform', 'shors-algorithm']"," Title: Where is the extra qubit after QFT$^{-1}$ coming from in Shor’s algorithm?Body: Hello sorry if this is a stupid question arising from my ignorance but I have been looking at the modular adder for Shor's algorithm according to this website. Here is what the gate looks like:
The adding gate has a band on the right and the subtraction gate has a band on the left. My confusion comes from the CNOT gate between the ancillary bit and an extra qubit coming from the inverse QFT. This happens again later, although with a NOT gate on either side, presumably to reset the state of the ancillary bit so that it can be used again. As far as I know, there isn't an extra qubit output from inverse QFT, or even an ancillary bit, so where does this qubit come from?
"
"['quantum-state', 'algorithm']"," Title: What is the complexity of loading $n$ inputs using a qRAM?Body: I am interested in reading data from a real database and I find qRAM has the effect of loading data:
$\sum\phi\left|i\right>\left|0\right>\rightarrow\sum\phi\left|i\right>\left|d_i\right>$, where $\left|i\right>$ is the index of address and $\left|d_i\right>$ is the corresponding data at address i. I am wondering what the complexity of loading n input using qRAM is. I find some materials say the qRAM locates one memory cell in $\log n$ time, which means it takes $O(n\log n)$ time to access n memory cells. Also, some other materials say loading n data can be done in $O(\log n)$ time. I am confused about it. Besides, all materials I find only discuss the loading problem. Storing problem is not mentioned, so I am also wondering if we can modify a data in qRAM.
"
"['quantum-state', 'algorithm', 'density-matrix']"," Title: Is there an algorithm that can decide if a state is a mixed state or a pure state?Body: Given we are using the computational basis,is there a quantum algorithm that can decide if an arbitrary input state $\vert A\rangle$ ( using $N$ qubits) is a pure state or a mixed state? $\vert A\rangle$ is defined below. If such an algorithm exists what is its space complexity and time complexity?
Where the arbitrary state $\vert A\rangle$ is the state
$$\vert A\rangle=a(0)|0\rangle+a(1)|1\rangle+a(2)|2\rangle+\ldots+ a(-1+(2^N))|(-1+(2^N))\rangle$$
and, of course, the sum of squares of the amplitudes $a(0),a(1),a(2),...,a(-1+(2^N))$ is equal to $1$.
For the mixed or the pure state it is unknown which of the amplitudes are non zero; it is only known that $1$ non zero amplitude exists if $\vert A\rangle$ is a pure state; it is only known that more than $1$ non zero amplitude exists if $\vert A\rangle$ is a pure state. So if it is a pure state it means for some unknown $i$, $ a (i) =1$ and all the other amplitudes in the state $\vert A\rangle$ have amplitude zero. A mixed state is any other state which is not a pure state. Note that we only have one state $\vert A\rangle$ and we are not given any copies of this state $\vert A\rangle$.
After reading Narip's comment I have added the update below.
Update:Another very closely related question is, does an algorithm exist using the standard definition of a pure state (with the computational basis) in above question? (i.e. instead of $ a (i) =1$ we have $ a (i) =c$ where c is a complex number with magnitude 1)
"
"['notation', 'terminology']"," Title: What does it mean that 1 qubit can do the job of 1 ebit (entanglement bit)? (second Bennett's law)Body: I just came across Bennett's laws and I wonder what the second law mean. It states that 1 qubit "can do the job" of 1 ebit. However, the definition of ebit (entanglement bit, wiki just refers it to the Bell state) and the notion of "can do the job" are unclear. Can you clarify more rigorously what the second Bennett's law says?
"
"['quantum-state', 'bloch-sphere']"," Title: Meaning of a pound sign (#) on a Bloch sphereBody: For the following Bloch sphere representation of a qubit, what does the highlighted symbol mean? I'm not sure if it means anything or it's just for showing that it's a sphere, not a circle.
"
"['measurement', 'textbook-and-exercises', 'hadamard']"," Title: Doing $|0\rangle$ then Hadamard gate then measurementBody: I am starting to use quantum experience and following exactly first example from lecture. After initializing the qubit to $|0\rangle$, then applying a Hadamard gate, the probability for measuring $|1\rangle$ is 50%. When I apply measurement, the probability for 1 becomes 100%. It should be 50% as in the lecture.
"
"['textbook-and-exercises', 'ibm']"," Title: Why probabilites are not 50-50 in this simple circuit?Body: I am "brand new" to IBM quantum computing. Just created an account and tried my first circuit with a Hadamard applied to $|0 \rangle$ which should lead to $(|0\rangle + | 1 \rangle)/\sqrt{2}$ and hence $50$ percent probability for $|0\rangle$ and $|1\rangle$ each. However, as shown in the screenshot of my screen, I am getting probabilities for $``00""$. Is it possible to talk in terms of probabilities of $|0\rangle$ and $|1\rangle$?
"
"['quantum-state', 'density-matrix']"," Title: How do get $\rho_{BA}$ if I have $\rho_{AB}$Body: If Alice and Bob share the state:
$$\left| {{\psi _{AB}}} \right\rangle = \sin \theta \left| {10} \right\rangle + \cos \theta \left| {01} \right\rangle $$
then $\rho_{AB}$ can be obtained as:
$${\rho _{AB}} = \left| {{\psi _{AB}}} \right\rangle \left\langle {{\psi _{AB}}} \right|.$$
Is there a way to get $\rho_{BA}$ instead?
"
"['algorithm', 'swap-test', 'state-discrimination']"," Title: How do you test a pair of unknown qubits for orthogonality with certainty?Body: If you want to check if a pair of unknown qubits are the same, a standard test is the controlled SWAP test. This gives a result of 0 with certainty if the states are the same and 1 with a 50% chance if the states are orthogonal. The resulting probability distribution can also be used to approximate fidelity, etc.
Is there a/what is the equivalent test to determine orthogonality with certainty, i.e. giving a result of 0 with certainty if the states are orthogonal and 1 with some probability if the states are identical?
Alternatively, is there a more balanced test, which gives the same (lower than 50%) error in detecting either orthogonality or similarity?
Obviously, one opton is to carry out state tomography on each qubit to get their mathematical descriptions and calculate the orthogonality/fidelity accordingly, but this may not be the best solution in terms of copies required for a given accuracy.
"
"['quantum-state', 'entanglement', 'density-matrix', 'partial-trace']"," Title: Can one always find purifications which preserve equality of statistical mixtures?Body: When pure states $|\psi_1⟩$, $|\psi_2⟩$ and $|\phi_1⟩$, $|\phi_2⟩$ in $\mathcal{H}_A \otimes \mathcal{H}_B$ have identical statistical mixtures
$$\frac{1}{2}(|\psi_1⟩⟨\psi_1| + |\psi_2⟩⟨\psi_2|) = \frac{1}{2}(|\phi_1⟩⟨\phi_1| + |\phi_2⟩⟨\phi_2|) ,$$
then we know (by linearity of the partial trace) that the reduced states $\rho_i = \text{tr}_B |\psi_i⟩⟨\psi_i|$ and $\sigma_i = \text{tr}_B |\phi_i⟩⟨\phi_i|$ on the space $\mathcal{H}_A$ also have identical mixtures $\frac{1}{2}(\rho_1 + \rho_2) = \frac{1}{2}(\sigma_1 + \sigma_2)$.
My question concerns the converse of this statement.
Let $\rho_1$, $\rho_2$ and $\sigma_1$, $\sigma_2$ be density operators on a finite-dimensional space $\mathcal{H}$ which satisfy
$$\rho_1 + \rho_2 = \sigma_1 + \sigma_2 .$$
Do there always exist corresponding purifications $|\psi_1⟩$, $|\psi_2⟩$ and $|\phi_1⟩$, $|\phi_2⟩$ in $\mathcal{H} \otimes \mathcal{P}$ (for some purifying space $\mathcal{P}$) of the $\rho_1$, $\rho_2$ and $\sigma_1$, $\sigma_2$ which satisfy
$$|\psi_1⟩⟨\psi_1| + |\psi_2⟩⟨\psi_2| = |\phi_1⟩⟨\phi_1| + |\phi_2⟩⟨\phi_2| ?$$
More generally, I would like to know about when (if at all) identical mixtures of the form $\sum_i p_i \rho_i = \sum_i q_i \sigma_i$ imply the existence of purifications such that $\sum_i p_i |\psi_i⟩⟨\psi_i| = \sum_i q_i |\phi_i⟩⟨\phi_i|$.
"
"['programming', 'qiskit', 'optimization', 'qaoa']"," Title: Pack Header Error when using QAOAProgramBody: I want to use QAOAProgram from Qiskit in the following way:
from qiskit_optimization.runtime import QAOAProgram
from qiskit_optimization.converters import QuadraticProgramToQubo
from qiskit_optimization.applications.max_cut import Maxcut
max_cut_quadr_program = Maxcut(graph).to_quadratic_program()
pauli, f = max_cut_quadr_program.to_ising()
optimizer = {'name': 'SPSA',
'maxiter': 50}
backend = provider.get_backend('ibmq_qasm_simulator')
runtime_qaoa = QAOAProgram(
callback=None,
optimizer=optimizer,
initial_point=None,
provider=provider,
backend=backend,
shots=8192,
measurement_error_mitigation=True)
runtime_result = runtime_qaoa.compute_minimum_eigenvalue(pauli)
But I got this error:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-40-1f2a3143b054> in <module>()
19 measurement_error_mitigation=True)
20
---> 21 runtime_result = runtime_qaoa.compute_minimum_eigenvalue(pauli)
10 frames
/usr/local/lib/python3.7/dist-packages/qiskit_optimization/runtime/qaoa_program.py in compute_minimum_eigenvalue(self, operator, aux_operators)
158 mixer_operator=self.mixer,
159 )
--> 160 return super().compute_minimum_eigenvalue(operator, aux_operators)
/usr/local/lib/python3.7/dist-packages/qiskit_optimization/runtime/vqe_program.py in compute_minimum_eigenvalue(self, operator, aux_operators)
272 inputs=inputs,
273 options=options,
--> 274 callback=self._wrap_vqe_callback(),
275 )
276 # print job ID if something goes wrong
/usr/local/lib/python3.7/dist-packages/qiskit/providers/ibmq/runtime/ibm_runtime_service.py in run(self, program_id, options, inputs, callback, result_decoder)
233
234 backend_name = options['backend_name']
--> 235 params_str = json.dumps(inputs, cls=RuntimeEncoder)
236 result_decoder = result_decoder or ResultDecoder
237 response = self._api_client.program_run(program_id=program_id,
/usr/lib/python3.7/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
236 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
237 separators=separators, default=default, sort_keys=sort_keys,
--> 238 **kw).encode(obj)
239
240
/usr/lib/python3.7/json/encoder.py in encode(self, o)
197 # exceptions aren't as detailed. The list call should be roughly
198 # equivalent to the PySequence_Fast that ''.join() would do.
--> 199 chunks = self.iterencode(o, _one_shot=True)
200 if not isinstance(chunks, (list, tuple)):
201 chunks = list(chunks)
/usr/lib/python3.7/json/encoder.py in iterencode(self, o, _one_shot)
255 self.key_separator, self.item_separator, self.sort_keys,
256 self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)
258
259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
/usr/local/lib/python3.7/dist-packages/qiskit/providers/ibmq/runtime/utils.py in default(self, obj)
127 value = _serialize_and_encode(
128 data=obj,
--> 129 serializer=lambda buff, data: qpy_serialization.dump(data, buff)
130 )
131 return {'__type__': 'QuantumCircuit', '__value__': value}
/usr/local/lib/python3.7/dist-packages/qiskit/providers/ibmq/runtime/utils.py in _serialize_and_encode(data, serializer, compress, **kwargs)
54 """
55 buff = io.BytesIO()
---> 56 serializer(buff, data, **kwargs)
57 buff.seek(0)
58 serialized_data = buff.read()
/usr/local/lib/python3.7/dist-packages/qiskit/providers/ibmq/runtime/utils.py in <lambda>(buff, data)
127 value = _serialize_and_encode(
128 data=obj,
--> 129 serializer=lambda buff, data: qpy_serialization.dump(data, buff)
130 )
131 return {'__type__': 'QuantumCircuit', '__value__': value}
/usr/local/lib/python3.7/dist-packages/qiskit/circuit/qpy_serialization.py in dump(circuits, file_obj)
853 file_obj.write(header)
854 for circuit in circuits:
--> 855 _write_circuit(file_obj, circuit)
856
857
/usr/local/lib/python3.7/dist-packages/qiskit/circuit/qpy_serialization.py in _write_circuit(file_obj, circuit)
871 num_instructions=num_instructions,
872 )
--> 873 header = struct.pack(HEADER_PACK, *header_raw)
874 file_obj.write(header)
875 file_obj.write(circuit_name)
error: required argument is not a float
Qiskit verison: 0.28
What am I doing wrong?
My idea is that there is some issue with my ansatz or PauliSumOp is not correct, but maybe someone has a better explanation.
"
"['entanglement', 'density-matrix', 'partial-trace', 'correlations']"," Title: Classical versus quantum correlations and partial tracesBody: Given a bipartite state $\rho_{AB}$ living in the Hilbert space $\mathcal H(A\otimes B)$ we can always define two local states on $A$ and $B$ respectively by taking the appropriate partial traces: $$\rho_A=\mathrm{tr}_B[\rho_{AB}], \quad \rho_B=\mathrm{tr}_A[\rho_{AB}]. $$
If the state $\rho_{AB}$ is separable, then $\rho_{AB}=\rho_A\otimes \rho_B$. In the more general case of an entangled state, since taking the partial trace corresponds to discarding part of the system any correlations between such a subsystem and its complement are lost, so $\rho_{AB}\ne \rho_A\otimes \rho_B$ and more generally there can be no pair of local states $\sigma_A,\tau_B$ such that $\rho_{AB}=\sigma_A\otimes \tau_B$.
But what about states that have classical correlations? I give an example below.
Example: Given an ensemble $\mathcal E=\{p_j,\rho_Q(j)\}$ consider the state $$\rho_{QX}=\sum_j p_j\rho_Q(j)\otimes |j\rangle\langle j|_X $$ where $\{|j\rangle_X\}$ is an orthonormal basis of $\mathcal H(Y)$. This state is correlated as the index $j$ connects the states on $Q$ and on $X$, but it is not entangled since it can be written as $$\rho_{QX}=\sum_j p_j\rho_Q(j)\otimes \rho_X(j) . $$
The partial traces give $$\rho_Q=\sum_j p_j\rho_Q(j), \quad \rho_X=\sum_j p_j|j\rangle\langle j|_X $$ and so $\rho_Q\otimes \rho_X=\sum_j p_j^2\rho_Q(j)\otimes |j\rangle\langle j|_X$. This looks almost like $\rho_{QX}$ apart from that coefficient $p_j^2$ that seems to reflect the fact that when we separate $\rho_{QX}$ we can choose to 'put' $p_j$ either in local state on $Q$ or on the on $X$.
"
"['mathematics', 'textbook-and-exercises']"," Title: Steps to apply Hadamard gate to $n$ qubitsBody:
Can someone shows me, step by step, how to apply Hadamard and output the result?
"
"['circuit-construction', 'physical-realization']"," Title: Why do we have to measure the circuit before sending it to the real quantum computer?Body: If I want to run a circuit on a real quantum computer, I have to measure it before running it. For example:
qc=QuantumCircuit(2)
qc.x(0)
qc.x(1)
qc.cx(0,1)
**qc.measure_all()**
To run on a quantum computer:
#Import IBMQ
from qiskit import IBMQ #different companies(IBM ic)'s quantum provider
from qiskit.providers.ibmq import least_busy
#ask for the least busy quantum computer
provider = IBMQ.get_provider(hub='ibm-q')
backend = least_busy(provider.backends(filters=lambda x: x.configuration().n_qubits >= 2
and not x.configuration().simulator #dont want a simulator, want a actual machine
and x.status().operational==True)) #want an operational machine
#tell us what the least busy one is
print("least busy backend: ", backend)
# send the job to a quantum computer
job = execute(qc, backend=backend, shots=100)
result = job.result()
#then we plot our histogram as usual
counts = result.get_counts(qc)
plot_histogram(counts)
I am wondering why do we have to measure the circuit before sending it to the real quantum computer? I know that we shouldn't measure the circuit if we send it to a statevector simulator.
"
"['simulation', 'classical-quantum', 'postselection']"," Title: Efficient simulation of linearly assembled Quantum StatesBody: In this paper section 4.2 the author describes how to efficiently simulate linearly assembled quantum states. When describing the procedure to do so the author shows the following circuit:
The procedure for classic simulation is outlined is as follows
It is easy to use a classical computer to simulate such a circuit. First, we consider the result of applying $U_{12}$ to $|00\rangle$, and compute the probabilities for the measurement on qubit 1. We then sample from this distribution to produce a posterior state for qubit 2, which is used as an input for $U_{23}$. We then repeat this cycle of computing probabilities, sampling, and computing posterior states.
I was wondering if someone could further elaborate on this and fill in some blanks for me, for instance how is the posterior state produced? What exactly happens to that posterior state? Is there any way to prove that this simulation infact accurately describes the probabilities of our quantum circuit?
"
"['annealing', 'adiabatic-model']"," Title: Question about the counter diabatic(CD) term in Digitized Adiabatic Quantum ComputingBody: Recently I have read two articles about the Digitized Adiabatic Quantum Computing(DAQC), and tried to factorize $35=5\times7$ and $2479=67\times37$.
But some problems came when trying to solve the coefficient of the CD term.
problems for 35
In section IV of the paper "Shortcuts to Adiabaticity in Digitized Adiabatic Quantum Computing", there is a result about the variational coefficient $\alpha_1$, which is
$$\alpha_1=\frac{1}{4}\frac{h^2_z+J^2_0}{\lambda^2(h_z^4J_0^4+3h_z^2J^2_0)+(1-\lambda)^2h_x^2(h_z^2+4J_0^2)},$$
with $H_{init}=\sum h_x^j\sigma_x^j, H_{final}=\sum (h_z^j\sigma_z^j+J_0\sigma_z^j\sigma_z^{j+1}), \sigma^{N+1}=\sigma^{0}$.
However, for the simplest example with $N=2, H_{final}=\frac{1}{4}(\sigma_z^0\sigma_z^1+\sigma_z^1\sigma_z^0), h_z=0,J_0=\frac{1}{4}$, I get $$\alpha_1=-\frac{1}{\lambda^2+16(1-\lambda)^2h_x^2}.$$It works for my code to factorize $35$, but it doesn't fit the expression above.
problems for 2479
Moreover, in the paragrah after equation (10) of the paper "Digitized-Adiabatic Quantum Factorization", it provides $$\alpha_1=\frac{0.0830}{h_x^2(1-\lambda)^2+5.0112\lambda^2},$$while $H_{final}$ defined in equation (8).
With $$H_0=(1-\lambda)H_{init}+\lambda H_{final}, A\approx i\alpha_1[H_0,\partial_\lambda H_0]=i\alpha_1[H_{init},H_{final}],\\G=\partial_\lambda H_0+i[A,H_0],\alpha_1=\text{argmin}\text{Tr}(G^2)$$ I get a similar but different $\alpha_1^*\approx -\alpha_1$
$$\alpha^*_1=-\frac{185/2228}{h_x^2(\lambda-1)+5.0112\lambda^2}\approx -\alpha_1.$$
question
It looks like that there are some terrible mistakes about $\alpha_1$, I tried checking my results of $\alpha_1$ with the symbolic operation of Octave but got nothing.
Maybe I did something wrong before I solve the equations $\alpha_1=\text{argmin}\text{Tr}(G^2)$?
Or is there any general expressions of $\alpha_1$ so that I can easily find my mistake?
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: How to normalise when the probability of measurement is zero?Body: In one of the answers to this question on measuring one qubit it is explained
that given a general two-qubit state
$$
|\psi\rangle = \begin{bmatrix} \alpha_{00} \\ \alpha_{01} \\ \alpha_{10} \\ \alpha_{11} \end{bmatrix} = \alpha_{00}|00\rangle + \alpha_{01}|01\rangle + \alpha_{10}|10\rangle + \alpha_{11}|11\rangle
$$
one measures the most-significant (leftmost) qubit in the computational basis as
follows:
- the probability that the measured qubit collapses to $|0\rangle$ is
$$
P\left[|0\rangle\right] = |\alpha_{00}|^2 + |\alpha_{01}|^2
$$
- the normalized state after the measurement is
$$
|\psi\rangle = \frac{\alpha_{00}|00\rangle + \alpha_{01}|01\rangle}{\sqrt{|\alpha_{00}|^2 + |\alpha_{01}|^2}}.
$$
My question is: How does one normalize in the case the probability $|\alpha_{00}|^2 + |\alpha_{01}|^2$ is zero? (This happens, of course, if $\alpha_{00} = \alpha_{01} = 0$.)
"
"['mathematics', 'textbook-and-exercises']"," Title: Is ($|+⟩$$⟨0|$ + $|-⟩$$⟨1|$ ) similar to ($|0⟩$$⟨+|$ + $|1⟩$$⟨-|$ )?Body: Is ($|+⟩$$⟨0|$ + $|-⟩$$⟨1|$ ) similar to ($|0⟩$$⟨+|$ + $|1⟩$$⟨-|$ ) ?
Can we just reversed it this way when doing Dirac manipulation? I try to calculate HZH = X and i need to reverse the second H
"
"['mathematics', 'tensor-product']"," Title: Tensor product and Dirac notationBody: Can someone shows me how to proof this equality:
$\frac{1}{\sqrt2}(\alpha|000⟩+\alpha|011⟩ + \beta|100⟩ + \beta|111⟩ )$ =
$ \frac{1}{2\sqrt2}[(|00⟩+|11⟩) \otimes (\alpha|0⟩+\beta|1⟩) + (|01⟩+|10⟩) \otimes (\alpha|1⟩+\beta|0⟩) $
$+ (|00⟩-|11⟩) \otimes (\alpha|0⟩-\beta|1⟩) + (|01⟩-|10⟩) \otimes (\alpha|1⟩-\beta|0⟩) ]$
It is from this video .
"
"['programming', 'ibm-q-experience']"," Title: Job ids retrieval from ID. Big set of jobsBody: I'm in the need of running a lot of jobs in the IBM backends. If one likes to run in parallel two jobs (say, with two different parameters), I have seen in the Jobs webpage that sometimes the jobs are mixed. What I mean with this is that e.g. in the downloadable cvs file, row 3 belongs to job 1 and row 4 to job 2. To filter out every single cell in the cvs does not appear feasible.
Now, in qiskit, if I send a big job, this is partitioned into several chunks, something that job_set_foo.report(detailed=True) returns is:
Job set name: 2021-07-22T14:09:01.003237
ID: XXXX-YYYY
tags: []
...
Detail report:
experiments: 0-74
job index: 0
job ID: ZZZ1
...
So suppose that my ID XXX-YYY contains 20 jobs ids ZZZx. Is there a way to, from directly the ID, retrieve as a list all the ZZZx's jobs ids?
*job_set_foo = job_manager.run(circuits, backend=backend, shots=2**13)
"
['programming']," Title: How does one even get started in Quantum Computing, specifically building qApps?Body: I want to build a quantum application, qApp if you will; how does one go about figuring out the right use-case and best framework to turn to, to start building these things?
Quantum REPL? How do I learn how to program qBits? Polarity? Spin? Quantum entanglement? How do you even program that? What are we even talking about; do I even own a dead cat or not?
Unlocking Satoshi Nakamoto's BTC PrivateKey seems like a great place to start no?? Did he even exist to begin with? Anyone have any clues?
Quantum Backend anyone? Maybe like a QuantumNode.js of sorts?
Bueller? Bueller? Anyone?
"
"['measurement', 'quantum-operation', 'povm']"," Title: How does the extremality of a POVM reflect on its Naimark dilation isometry?Body: Let $\mu:\Sigma\to\mathrm{Pos}(\mathcal X)$ be some POVM, with $\Sigma$ the finite set of possible outcomes, and $\mathrm{Pos}(\mathcal X)$ the set of positive semidefinite operators on a finite-dimensional space $\mathcal X$. Write the components of the measurement with $\mu(b), b\in\Sigma$.
From Naimark's dilation theorem, we know that $\mu$ can be understood as a projective measurement on an isometrically enlarged space. More precisely, that there is an isometry $U_\mu:\mathcal X\to\mathcal X\otimes\mathcal Y$, for some $\mathcal Y$, such that $\mu(a)=U_\mu^\dagger (I\otimes P_a) U_\mu$ for all $a\in\Sigma$, with $P_a\equiv |a\rangle\!\langle a|$. Explicitly, we can write this isometry as
$$U_\mu =\sum_{a\in\Sigma}\sqrt{\mu(a)}\otimes |a\rangle
=\begin{pmatrix}\sqrt{\mu(1)}\\ \vdots \\ \sqrt{\mu(|\Sigma|)}\end{pmatrix}.$$
Consider now the notion of extremality of a POVM $\mu$. We say that $\mu$ is extremal if it cannot be written as a (nontrivial) convex combination of other POVMs. Physically, this is interesting because a non-extremal POVM amounts to some degree of "classical uncertainty" added on top of whatever is being measured about the state.
How does the extremality of a POVM $\mu$ reflect on its "Naimark isometry" $U_\mu$? If $\mu$ is extremal, that would mean that $U_\mu$ is an isometry such that each of its $\dim(\mathcal X)\times \dim(\mathcal X)$ blocks, call these $U_\mu(a)\equiv\sqrt{\mu(a)}$, cannot be written as $$U_\mu(a)^2=\frac12(U_{\mu_1}(a)^2+U_{\mu_2}(a)^2).$$
In other words, convex combinations of measurements, in terms of the associated isometries, translate into these weird sums taken after squaring the different blocks building the individual isometries.
What kind of structure is this? Is there some known notion for isometries/unitaries corresponding to the impossibility of performing such a type of decomposition?
"
"['programming', 'qiskit']"," Title: Matplotlib graphs are being duplicated each timeBody: Simple UI question. I have installed qiskit according to the instruction and try to implement some basic operations. I have the issue that anything I plot appears twice. I am not sure why this is happening, so I am looking for some suggestions.
See the attached image:
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to Implement a noisy identity gate on qiskit?Body: I can successfully implement the U gate (single qubit) on qiskit, but when I am trying for the identity operation it is not showing any differences with the ideal one .
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: What are the constraints for the coefficents of the basis states in quantum computing?Body: $\newcommand{\ket}[1]{\left|#1\right>}$
It's known that the Kolmogorov axioms characterise a probability distribution:
- Probability of an event is a non-negative real number.
- The sum of all probabilities is 1.
- The probability of disjoint events is the sum of their probabilities.
But when dealing with a quantum system, as far as I know:
the first axiom is relaxed to allow negative & complex numbers;
The second axiom is changed to "The sum of the squares of the coefficients is 1".
But if that was all, wouldn't this allow for the following 1-qubit system:
$$\ket{\phi}=i\ket{0}+\sqrt{2}\ket{1}$$
The probabilities do sum to 1: \begin{align*}
i^2+\sqrt{2}^2 &= -1 + 2\\
&= 1
\end{align*}
But interpreting the 'probabilities' as probabilities separately seems to be nonsensical: \begin{align*}
P(\ket{0}) &= -100\%\quad(?)\\
P(\ket{1}) &= \phantom{-}200\%\quad(?)
\end{align*}
So can this system exist in actuality, or is merely a mathematical curiosity?
Assuming the latter, and assuming we disallow such a system by positing "The magnitude of the squares of the coefficients must lie in the $[0,1]$ interval."
But also consider the following 2-qubit system:
$$\ket{\psi}=\frac{1+\sqrt{3}i}{2}\ket{00}+\frac{1-\sqrt{3}i}{2}\ket{01}+\ket{10}+\ket{11}$$
Again the probabilities do sum to 1: \begin{align*}
\Big(\frac{1+\sqrt{3}i}{2}\Big)^2 + \Big(\frac{1-\sqrt{3}i}{2}\Big)^2 + 1^2 + 1^2 &=
\frac{1+2\sqrt{3}i-3}{4} + \frac{1-2\sqrt{3}i-3}{4} + 1 + 1\\
&= \frac{1-3+1-3}{4} + 2\\
&= \frac{-4}{4} + 2\\
&= 1
\end{align*}
And again, we have two states with probability of $100\%$.
Did I miss something?
"
"['error-correction', 'quantum-volume']"," Title: Why is the quantum volume vastly greater than the number of qubits squared?Body: According to Wikipedia, the Honeywell computer has quantum volume ("QV") equal to 1024 and has 10 qubits. QV should not be more than $n^2$ squared, i.e. 100.
Is this any math error? Are the publicly given QV useless?
So it appears they are using the new (depth) definition, which to me seems to allow simulation and other rooms to inflate performance.
"
"['algorithm', 'complexity-theory', 'quantum-circuit']"," Title: Is there an efficient quantum circuit that create a random permuntation matrix?Body: Suppose we want to generate a random, random according to some probability distribution, unitary permutation matrix that is applied to an input of $n$ qubits. So is there an efficient polynomial time and polynomial space circuit that can generate a random unitary permutation matrix (which is of course dimension a positive power of $2$ or $2^n$)? If there is no polynomial algorithm (in the above question) then what is the most efficient algorithm instead?
"
"['circuit-construction', 'projection-operator']"," Title: Implement a projection operator as a quantum circuitBody: Let the state $|\Psi\rangle\equiv a|0\rangle\otimes|\psi_0\rangle + b|1\rangle\otimes|\psi_1\rangle$, where $|\psi_0\rangle$ and $\psi_1\rangle$ belong to a multi-qubit register $R$ and the coefficients $a,b$ are not known a priori. I would like to extract the state $|\psi_0\rangle$. Essentially, I would like to apply the projector $\hat P_0\equiv|0\rangle\langle0|$ on $|\Psi\rangle$.
The standard approach seems to be to measure the solitary qubit to collapse $R$ into either $|\psi_0\rangle$ if you measured $0$ or $|\psi_1\rangle$ if you measured $1$. In the latter case, simply discard the state and try again from scratch. This is a probabilistic method and obviously undesirable if preparing $\Psi$ is difficult or if $|a|$ is very small.
Is there some quantum circuit to implement $\hat P_0$ and deterministically extract $|\psi_0\rangle$? It is clearly not unitary, so such a circuit clearly is not simple. But my intuition tells me that there ought to be a strategy involving an ancilla register and/or a second copy of $|\Psi\rangle$. I am however self-taught and my intuition is not terribly reliable; I would happily accept a proof that it can't be done. ^_^
The closest I've gotten so far is recognizing that it's easy to do with two entangled copies of $|\Psi\rangle$: let $|\Phi\rangle\equiv \frac{a+b}{\sqrt{2}}|01\rangle\otimes|\psi_0\rangle\otimes|\psi_1\rangle + \frac{a-b}{\sqrt{2}}|10\rangle\otimes|\psi_1\rangle\otimes|\psi_0\rangle$, where the two solitary qubits are lumped into one register. Then measure either solitary qubit. If it's $0/1$, $|\psi_0\rangle$ is the state in the first register $R_1$. If it's $1/0$, take the second register $R_2$. But I don't know how to generate the entangled state $|\Phi\rangle$, or whether it is possible to do so from two initially independent copies of $|\Psi\rangle$.
Bonus points if the procedure extends naturally to arbitrary multi-qubit projection operators without a tedious basis transformation!
"
"['programming', 'physical-qubit', 'qubit-mapping']"," Title: How to re-ordering physical qubit location into desired one?Body: Suppose original quantum circuit have 4 qubits and some quantum operation. Also suppose the result of original quantum circuit state is '1100'. Then apply qubit mapping then mapping state is like below
1 -> 0
3 -> 1
0 -> 2
2 -> 3
Then the result of quantum circuit after qubit mapping will be '1010'.
But I want to know how to change these physical qubit state location.
So ultimately, I want to see the result after qubit mapping like '1100' which is the same result of original quantum circuit.
How can I do that?
"
"['quantum-state', 'circuit-construction', 'textbook-and-exercises']"," Title: How to generate a quantum circuit from the quantum state $|1000\rangle+|0100\rangle+|0010\rangle+|0001\rangle$?Body: I am trying to understand the steps of how make a state preparation circuit from a quantum state.
For making my question more clearer, for example, for the state is $\frac{|00\rangle+|11\rangle}{\sqrt{2}}$, the state preparation circuit is :
I want to draw the state preparation circuit for the quantum state $\frac{1}{2}( |1000\rangle + |0100\rangle + |0010\rangle + |0001\rangle)$.
I was following this lecture.
I am not able to completely understand the steps used to draw circuits. It would be great if someone can help me with this question.
"
"['textbook-and-exercises', 'information-theory', 'entropy', 'probability', 'mutual-information']"," Title: How to prove that the mutual information is subadditive?Body: Let $\mathbf x=(x_1,...,x_n)$ and $\mathbf y=(y_1,...,y_n)$ be two vectors of random variables. To make things concrete, assume that Alice sends each component $x_j$ through a noisy channel to Bob, who then receives the output $y_j$. The conditional probability to obtain $\mathbf x$ given $\mathbf y$ is $$p(\mathbf y|\mathbf x)=\prod_{j=1}^np_j(y_j|x_j), $$ and for each probability $p_j(y_j|x_j)$ we may define the mutual information $I_j(x_j:y_j)$. I should prove that $$I(\mathbf x:\mathbf y)\le \sum_{j=1}^n I_j(x_j:y_j), $$ that is, the mutual information is subadditive. What is the simplest way to go about this?
"
"['programming', 'qiskit']"," Title: Transform Fermionic operators to quantum circuit in qiskitBody: I am trying to realize a modified version of the UCCSD algorithm, which consists of combining multiple fermionic opeators to form a unitary tranformation U to act on a reference state that in most case is the Hartree-Fock state. I already got the U defined by the 'FermionicOperator' object. However, it seems that there is no straight way to complie the unitary 'U' to a quantum circuit. Can anybody help me to realize the corresponding circuit?
"
"['qiskit', 'openpulse']"," Title: Faster pulse generation in QiskitBody: I need to be able to generate very quickly pulse schedules to submit them on quantum chips.
For the moment I am generating instances of QuantumCircuit:
import typing as ty
from copy import deepcopy
from math import pi
from time import time as now
import numpy.random
from qiskit import IBMQ, QuantumCircuit, pulse, schedule, transpile
from qiskit.providers.ibmq.ibmqbackend import IBMQBackend
from qiskit.pulse import InstructionScheduleMap, Schedule
start = now()
n = 100
m = 20
# Random circuit generation with only sqrt(X) or sqrt(Y) gates.
rng = numpy.random.default_rng()
is_sx_all: numpy.ndarray = rng.integers(low=0, high=2, dtype=bool, size=(m, n))
circuits: ty.List[QuantumCircuit] = list()
for is_sx_list in is_sx_all:
circuit = QuantumCircuit(1, 1)
for is_sx in is_sx_list:
if is_sx:
circuit.sx(0)
else:
circuit.rz(-pi / 2, 0)
circuit.sx(0)
circuit.rz(pi / 2, 0)
circuits.append(circuit)
end_random_circ_gen = now()
print(f"Generated random circuits in {end_random_circ_gen - start:.2f} seconds")
# Recovering backend information from the cloud
IBMQ.load_account()
provider = IBMQ.get_provider(hub="ibm-q", group="open", project="main")
ibmq_bogota = provider.get_backend("ibmq_bogota")
and I schedule them using qiskit.pulse.schedule:
start_pulse = now()
# Create a dummy implementation of the sqrt(X) gate
with pulse.build(ibmq_bogota) as sx_impl:
pulse.play(pulse.library.Waveform(rng.random(160) / 10), pulse.DriveChannel(0))
# Replace the default sqrt(X) implementation by our dummy implementation.
# Here we only need 1 qubit because all our circuits are on 1 qubit.
backend_instruction_map: InstructionScheduleMap = deepcopy(
ibmq_bogota.defaults().instruction_schedule_map
)
backend_instruction_map.add("sx", [0], sx_impl)
end_instr_map = now()
print(f"Generated the instruction map in {end_instr_map - start_pulse:.2f} seconds")
# Create the actual schedules.
schedules = schedule(circuits, backend=ibmq_bogota, inst_map=backend_instruction_map)
end_schedule = now()
print(f"Generated the schedules in {end_schedule - end_instr_map:.2f} seconds")
My actual application allow me to keep the initially generated circuits in memory (so I only need to execute the first portion of code once), but I will need to re-generate the schedules for different pulses shape a lot of times. In other words, the second code portion will be executed several time.
My issue is the following: on my computer, the previous code outputs the following:
Generated random circuits in 0.05 seconds
Generated the instruction map in 0.86 seconds
Generated the schedules in 2.50 seconds
which is... a lot! In fact, my "time budget" to create this is more or less $200$ms, with some pre-processing (in the first code block) allowed.
My question is the following: do you have any idea / trick to improve the execution time of the second code block, i.e. pulse schedule generation ?
Here are several constraints (or non-constraints) I have:
- The setup phase that is only executed once can have a greater runtime. One way I tried to solve this problem is by doing (possibly costly) pre-processing at the beginning to speed-up the repeated part, but I did not find any idea.
- The circuits are all $1$-qubit, hardware-compliant, circuits. So there is no need to transpile them, they can directly be translated to pulses.
- The only hardware gate used is $\sqrt{X}$, and it is the only gate whose implementation will change in the different iterations of the second code block.
- My final goal is to copy/paste the $1$-qubit circuit constructed above on all the qubits of the chip in parallel, with different pulse implementation for each qubit (same length, but different amplitudes). This is not depicted in the code above for simplification purpose, but it basically multiply the runtime of the previous code by the number of qubits considered (see results below).
With $5$ qubits in parallel, I have the following results:
Generated random circuits in 0.32 seconds
Generated the instruction map in 0.87 seconds
Generated the schedules in 13.08 seconds
EDIT: I experimented and successfully lowered down the runtime by directly generating the schedules without constructing the QuantumCircuit intermediate representation. The new code:
# Create dummy implementations of the sqrt(X) gate
sx_implementations: ty.List[pulse.library.Waveform] = list()
for qubit_index in range(qubit_number):
sx_implementations.append(pulse.library.Waveform(rng.random(160) / 10))
start_direct_schedule_construction = now()
direct_schedules: ty.List[Schedule] = list()
for is_sx_list in is_sx_all:
start = now()
with pulse.build(backend) as direct_schedule:
drive_channels = [pulse.drive_channel(qi) for qi in range(qubit_number)]
for is_sx in is_sx_list:
for qi in range(qubit_number):
if is_sx:
pulse.play(sx_implementations[qi], drive_channels[qi])
else:
pulse.shift_phase(-pi / 2, drive_channels[qi])
pulse.play(sx_implementations[qi], drive_channels[qi])
pulse.shift_phase(pi / 2, drive_channels[qi])
pulse.measure_all()
# print(f"Done in {(now()-start)*1000:.0f} ms.")
direct_schedules.append(direct_schedule)
end_direct_schedule_construction = now()
dir_schd_construction_time = (
end_direct_schedule_construction - start_direct_schedule_construction
)
print(f"Generated Schedules directly in {dir_schd_construction_time:.2f} seconds")
Executing this code, the output on my machine is:
Generated Schedules directly in 0.41 seconds
One issue being that it is not consistent and sometimes goes up to 0.90 seconds. This is still above my threshold, but it is a huge improvement.
"
"['entanglement', 'information-theory', 'entropy']"," Title: Prove the subadditivity for the von Neumann entropy of a bipartite stateBody: I want to prove the subadditivity relation $S(\rho_{AB})\le S(\rho_A)+S(\rho_B)$ for the Von Neumann entropy. The tip is to use the Klein inequality $S(\rho_{AB}\Vert \rho_A\otimes \rho_B)\ge 0$: $$S(\rho_{AB}\Vert \rho_A\otimes \rho_B)=\text{tr}[\rho_{AB}\log \rho_{AB}]-\text{tr}[\rho_{AB}\log(\rho_A\otimes\rho_B)]\ge 0$$ implies that $$ S(\rho_{AB})\le -\text{tr}[\rho_{AB}\log(\rho_A\otimes \rho_B)].$$
(the trace is intended on $AB$). Introducing the spectral decompositions $\rho_A=\sum_l \lambda_l|l\rangle\langle l|_A$ and $\rho_B=\sum_k \chi_k|k\rangle\langle k|_B$ I calculated
\begin{align} \log(\rho_A\otimes\rho_B)&=\sum_{lk}\log(\lambda_l \chi_k)|l\rangle\langle l|_A\otimes |k\rangle\langle k|_B \\ &=\sum_{lk}\log\lambda_l|l\rangle\langle l|_A\otimes |k\rangle\langle k|_B+\sum_{lk}\log\chi_k|l\rangle\langle l|_A\otimes |k\rangle\langle k|_B \\ &= \log\rho_A\otimes 1_B+1_A\otimes\log\rho_B \end{align}
where I've made use of the completeness relations on $A$ and $B$. Now, if $\rho_{AB}=\rho_A\otimes\rho_B$ then we have simply $$ S(\rho_{AB})\le -\text{tr}(\rho_A\log\rho_A\otimes\rho_B)-\text{tr}(\rho_A\otimes\rho_B\log\rho_B)=S(\rho_A)+S(\rho_B).$$ But what if $\rho_{AB}$ is not separable?
"
"['resource-request', 'superconducting-quantum-computing', 'optical-quantum-computing', 'quantum-optics', 'ion-trap-quantum-computing']"," Title: Comparing technical limitations of major quantum computing approachesBody: As far as I know, major quantum computing approaches include superconducting qubits, trapped ions, nuclear magnetic resonance qubits, and free space quantum optics. I guess two main technical difficulties in this field are creating entanglement and maintaining entanglement.
Are there any introductory review articles address the state-of-the-art status of various quantum computing approaches as well as the major challenges that each of them faces.
Additionally, I am curious why the free-space quantum optics approach hasn't yet been "upgraded" to on-chip nanophotonic devices.
- I am a newbie to quantum computing research/industry. So, if there are any other promising approaches or other important technical difficulties, please add them.
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises', 'matrix-representation', 'bloch-sphere']"," Title: Vector math of applying an X-gate on an $|i\rangle$ basis stateBody: It is well known that the X-gate will apply a rotation about the x-axis on the bloch sphere.
Knowing this, the $|i\rangle$ state should be converted to the $|-i\rangle$ state on the application of this gate.
To be clear I define these states as: $|i\rangle$ = ${1 \over \sqrt{2}}(|0\rangle + i|1\rangle)$ and $|-i\rangle$ = ${1 \over \sqrt{2}}(|0\rangle - i|1\rangle)$
When trying to do the vector math with $X|i\rangle$ I get:
$\begin{bmatrix}0&1\\1&0\end{bmatrix}$$1 \over \sqrt{2}$$\begin{bmatrix}1\\i\end{bmatrix}$ = $1 \over \sqrt{2}$$\begin{bmatrix}i\\1\end{bmatrix}$
But I expect to be getting the $|-i\rangle$ state: $1 \over \sqrt{2}$$\begin{bmatrix}1\\-i\end{bmatrix}$
What am I doing wrong, am I missing some intrinsic property of quantum theory?
"
"['quantum-operation', 'density-matrix', 'information-theory', 'entropy', 'projection-operator']"," Title: Increasing entropy for projective LCPT mappingBody: Given a set of projectors $\{P_i\}$ acting on a space $\mathcal H_S$, let $\Phi$ be the LCPT map defined by $$\Phi(\rho)=\sum_i P_i\rho P_i.$$ The goal is to show that $S(\Phi(\rho))\ge S(\rho)$. The Klein inequality $$S(\rho\Vert\Phi(\rho))=\text{tr}[\rho\log\rho]-\text{tr}[\rho\log\Phi(\rho)]\ge 0 $$ already implies $-\text{tr}[\rho\log\Phi(\rho)]\ge S(\rho)$, so all that is left is to show that $$S(\Phi(\rho))\ge-\text{tr}[\rho\log\Phi(\rho)].$$
So, using the spectral decomposition of $\rho$ I obtained
$$\rho\log\Phi(\rho)=\rho\sum_{ij}\log(p_j)P_i|j\rangle\langle j|P_i=\sum_i\rho P_i\sum_j\log(p_j)|j\rangle\langle j|P_i $$ and by applying the cyclic property of the trace $$-\text{tr}[\rho\log\Phi(\rho)]=-\text{tr}\left[\sum_iP_i\rho P_i\sum_j\log(p_j)|j\rangle\langle j|\right]=-\text{tr}[\Phi(\rho)\log\rho].$$ However I realized something disquieting: the Klein inequality should also hold for $S(\Phi(\rho)\Vert \rho)$, implying $$S(\Phi(\rho))\le -\text{tr}[\Phi(\rho)\log\rho]=-\text{tr}[\rho\log\Phi(\rho)] $$ so either something has gone wrong with my calculations and the proof is done in a completely different way, or $S(\Phi(\rho))=-\text{tr}[\rho\log\Phi(\rho)]$ and I'm not seeing why. Either way, I'd appreciate some clarifying help!
"
"['programming', 'qiskit', 'shors-algorithm']"," Title: Integer factorization using Shor's AlorithmBody: I have question about Shor's algorithm, from I know it's for factorize an integer and can factorize big number with ease. I using Qiskit to try make a simple factorization program (with local simulator and I have planning to make it run to real device soon), but I confuse in these part of the code: ![]()
Did the a are must in range [2,7,8,11,13] ? can I use another number ? or it just best practice ? and what purpose of a ?
Number I want try to factorize roughly 10 digit random number.
Thanks
PS: Noob here please nice :)
"
"['optimization', 'qaoa']"," Title: Initial state for QAOABody: I'm learning about QAOA and I got curious about how they choose initial state. They somehow decided to choose initial state as equal superposition of all possible state and I wonder that there is any particular reason for that.
In 5.3 quantum circuit
" We first implement 5 Hadamard H gates to generate the uniform superposition. "
"
"['qiskit', 'quantum-circuit']"," Title: Applying a projector or a general nonunitary gate in the middle of a circuit using qiskitBody: Is there a way to implement a projector gate in a middle of a circuit?. For instance, assuming I have a Bell state $|00\rangle+|11\rangle$, I'd like to apply a projector on the first qubit onto state $|1\rangle$ (operator $|1\rangle\langle 1|$). Meaning that I will be left with $|1\rangle|1\rangle$.Is it possible to do such thing in the middle, and then apply the rest circuit? Also, is there a way to apply a general nonunitary gate without performing real measurements or qasm, only statevector.
"
"['quantum-circuit', 'hadamard']"," Title: Initial state preparation for Hadamard testBody: I thought I understood Hadamard test but it seems to be shaky.
I understand that to get the expectation value $\langle\psi\ | V^\dagger|{\bf Q}|V|\psi\rangle$ we need to have gate $V$ (in blue) below but NOT orange $V^\dagger$ circuit block as my initial state is $|V|\psi\rangle$.
Why don't we include the orange block?
"
"['hamiltonian-simulation', 'inner-product']"," Title: Relation between Jordan-Wigner transformation and Hilbert-Schmidt inner productBody: Given a fermionic Hamiltonian in a matrix form, we can write it as a sum over Kronecker products of Pauli matrices using the Hilbert-Schmidt inner product. However if the same Hamiltonian is given in a operator form, we can use the Jordan-Wigner transformation to write it as a sum over Kronecker products of Pauli operators.
How can one show that both the methods will give the same result, or if that is not the case then how does one show that the two results are related in some way?
Any material that discusses this is also appreciated.
"
"['entanglement', 'quantum-operation', 'entanglement-breaking-channels']"," Title: A way to check if entanglement is increased or decreasedBody: I was wondering if there is a way to check if the amount of entanglement is increased or decreased after a quantum operation without calculating the actual value.
That is, it does not concern with the amount of entanglement (i.e., no need for knowing the value) but it only cares about whether the entanglement is increased or not, comparing to the initial state.
"
"['programming', 'algorithm', 'qubit-mapping']"," Title: How to re-order logical qubit location into desired state?Body: Now, I'm studying about qubit mapping. When the mapping is done, the logical qubit will be randomly mapped to physical qubit. But I want to move the logical qubit location into desired state.
For example, if the mapping state is like below. Left side is logical and right side is physical
1 -> 0
3 -> 1
2 -> 2
0 -> 3
So, after executing all quantum gates, I want the logical qubit's location would be like below
0
1
2
3
It means change the qubit state into desired state. (0, 1, 2, 3)
Or Is there any way(qiskit function) that I can extract the circuit's qubit location and change them?
"
"['programming', 'qiskit']"," Title: How to use backend.run() with a constant pulse shape in order to get the results of a measurement?Body: I have formed a constant pulse and then I ran a measurement on the pulse. Now, I want to run a job to access the results of the measurement. Attached is a picture of the pulse and measurement.
Now, at the end of the post I have code from Chapter 6.1 of the qiskit textbook(subsection 3.2 Determining 0 vs 1, which shows a job being run in regards to a pulse shape and measurement. How would you change the first line of the backend.run() command, the schedules parameter, in order to use it for measurement for a constant pulse shape in the code that I have? The schedules parameter from the given code represents a frequency sweep that was defined earlier in the qiskit textbook. I want to keep the other parameters of backend.run the same and change the schedules partly to something else and use this command on the constant pulse shape. I don't know exactly how to modify the schedules part of the command properly.
num_shots_per_frequency = 1024
job = backend.run(schedules, meas_level=1, meas_return='avg', shots=num_shots_per_frequency)
"
"['quantum-state', 'density-matrix', 'notation']"," Title: How is a classical bipartite state written in quantum notation?Body: As in the title, is a classical bipartite state on $AA'$ given by
$$\sum_{ij} p_{ij} \vert i\rangle\langle i\vert_A \otimes \vert j\rangle\langle j\vert_{A'}$$
with $\sum_{ij}p_{ij} = 1$.
In particular, is the second index $j$ even necessary or can this be replaced by
$$\sum_{i} p_{i} \vert i\rangle\langle i\vert_A \otimes \vert i\rangle\langle i\vert_{A'}$$
with $\sum_i p_i = 1$ instead? If yes, how does one show this and if not, what exactly does the second state represent (some kind of special classical-classical state)?
"
"['qiskit', 'quantum-gate', 'entanglement', 'pauli-gates']"," Title: Qiskit CNOT-gate matrix mixup?Body: In the qiskit textbook chapter 1.3.1 "The CNOT-Gate" it says that the matrix representation on the right is the own corresponding to the circuit shown above, with q_0 being the control and q_1 the target, but shouldn't this matrix representation be for the case of q_1 being the control and q_0 the target? This seems to be presented the other way round...or there seems to be something I am not quite getting yet.
Thanks so much :)
Quick edit: By "right" I am referring to this:
"
['photonics']," Title: Understanding polarizing beam splittersBody: I have been trying to understand this heralded CNOT gate on photons but I have some questions regarding polarizing beam splitters:
The way I understand it, a PBS lets the photon through if the photon is polarized a certain direction, but as I understand it this would squeeze the photon back into a distinct polarization (H/V in the case of the top PBS and D/A in the case of the bottom PBS). This of course is wrong, but I don't understand how the photon passes through without destroying the superposition. This part is the most confusing part of the circuit but even if the PBS doesn't destroy the superposition how does the PBS2 create the superposition from the target. What does the operation matrix for a PBS filter look like? What is a good way to understand them?
"
"['programming', 'algorithm']"," Title: Is it true that the way we must program Quantum Computers is through Total functions only, if so why?Body: I have read that the way we must program Quantum Computers is through Total functions only.
Why is this the case?
Is it because quantum circuits are less forgiving in terms of logical errors?
Could you provide an academic reference?
"
"['ibm-q-experience', 'entanglement', 'ibm']"," Title: This is a question about IBM quantum circuit used to generate the quantum cheque stateBody: I'm learning about quantum cheque. And I read "Experimental realization of quantum cheque using a five-qubit quantum computer" which is written by Bikash K. Behera ,Anindita Banerjee and Prasanta K. Panigrahi.
Then I have a question about FIG.5 in this paper. FIG.5 shows IBM quantum circuit used to generate the quantum cheque state.
Is this a quantum circuit where the bank is passing one entangled qubit in a GHZ triplet state to the account holder?
The mentioned FIG.5:
"
"['algorithm', 'resource-request', 'notation']"," Title: What are QHT, QWT and QFT?Body: I am new to quantum computing. I am not able to understand QHT, QWT and QFT. I tried searching for a suitable material but still could not find them. It would be great if someone can explain and also a suggest a book to read these topics.
"
"['programming', 'quantum-computing-for-finance']"," Title: Print runtime of an optimizerBody: I want to find the runtime of my program, i.e. the time it is in the quantum computer without queue time. However, I am using an optimizer so the code is a little different.
from qiskit.utils import algorithm_globals
algorithm_globals.random_seed = 1234
backend = provider.get_backend('ibmq_belem')
#backend = Aer.get_backend('statevector_simulator')
cobyla = COBYLA()
cobyla.set_options(maxiter=1)
ry = TwoLocal(num_assets, 'ry', 'cz', reps=3, entanglement='full')
quantum_instance = QuantumInstance(backend=backend, seed_simulator=seed, seed_transpiler=seed)
vqe_mes = VQE(ry, optimizer=cobyla, quantum_instance=quantum_instance)
vqe = MinimumEigenOptimizer(vqe_mes)
result = vqe.solve(qp)
print(result)
#print_result(result)
How do I figure out the runtime? Printing result only shows
optimal function value: -0.01488461311339271
optimal value: [1. 0. 0. 1.]
status: SUCCESS
"
"['quantum-state', 'physical-realization']"," Title: Does QRNG generates True Random numbers?Body: I read an article that claims, QRNG can produce a true random number. So I wonder, how could they prove that this is a true random numbers generator? In fact, imagine I look at my memory state and took a bit of that and claims that I generate a true random number. If we want to prove this, we need a perfect theoretical model of the generator. But as far as I know, our knowledge of quantom behavior is not that perfect. I want to know, as a student, is my intuation correct?
"
"['complexity-theory', 'adiabatic-model']"," Title: Comparing complexity of digital and analog quantum computationBody: The complexity of an algorithm run on a digital quantum computer is quantified, roughly, by the number of elementary gates in the corresponding circuit. Can one similarly quantify the complexity of an analog algorithm?
Take for example adiabatic computation. There, the driving to the target Hamiltonian must be sufficiently slow so that the adiabaticity criterion is satisfied. This bounds the minimal time for successful completion of the algorithm. However, on the surface, the two notions of complexity or time, required for computation, seem very different.
Is there a way to compare the digital and the analog computation complexities? Do we believe that asymptotically they must have the same complexities, or perhaps analog computations can sometimes be faster?
"
"['d-wave', 'annealing', 'adiabatic-model']"," Title: How is eigendecomposition of a Hamiltonian equivalent to finding the minimum of an energy function?Body: This question is in regards to Dwave's quantum computer which is tailored to solve QUBO problems using quantum annealing.
QM tells us that the ground state of a quantum system is given by the eigenvector corresponding to lowest eigenvalue of the associated Hamiltonian $H$.
I would like to understand how does finding the minimum of $x^T Q x$ equate to finding (the lowest eigenvalued) eigenvector of a matrix $H$ and if so what is the relation between $Q$ and $H$?
"
"['quantum-state', 'textbook-and-exercises', 'superposition']"," Title: How to derive $|0\rangle=\frac{1}{\sqrt{2}}(|+\rangle+|-\rangle)$?Body: When learning measurement basis, my teacher told us $|0\rangle=\frac{1}{\sqrt{2}}(|+\rangle+|-\rangle)$ and said that we can derive it ourselves. Along this, he also mentioned $|+\rangle=\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$.
I understand that when we visualize those vectors on a bloch sphere, $|0\rangle$ lies in between $|+\rangle$ and $|-\rangle$, and if we normalize the coefficient, we would get $\frac{1}{\sqrt{2}}$. However, I'm confused how we know that the phase is + ($|+\rangle+|-\rangle$) instead of -? Is this just a definition for $|0\rangle$ or is it backed by a deeper reason?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: How does the amplitude amplification in Grover's algorithm work?Body: As the question says - how does the amplitude amplification in Grover's algorithm work?
I am fine with adding the negative phase on the winning state, but how does one generate the diffuser to increase the probability for some specific problem (that uses Grover's algorithm)? Is the diffuser always the same and, if it is, how does it look like?
"
"['quantum-operation', 'classical-quantum', 'channel-capacity', 'diamond-norm']"," Title: Bounding diamond norm distance using probability of error in transmission of classical informationBody: Let us consider an encode, noisy channel and a decoder such that classical messages $m\in\mathcal{M}$ can be transmitted with some small error. That is, for a message $m$ that is sent by Alice, Bob guesses $\hat{m}$ and the average error satisfies $\frac{1}{|\mathcal{M}|}\sum_{m}Pr[m\neq \hat{m}] \leq \varepsilon$. One could also consider the worst case error that is, $\max_m Pr[m\neq\hat{m}] \leq \varepsilon'$.
Are either of these quantities related to a channel distance measure and if yes, how? The idea is that the composite channel where we encode, use a noisy channel and decode $\mathcal{D}\circ\mathcal{N}\circ\mathcal{E}$ must be effectively an identity channel. The most commonly used distance measure is the diamond distance so can we bound
$$\|\mathcal{D}\circ\mathcal{N}\circ\mathcal{E} - \mathcal{I}\|_\diamond$$
using either $\varepsilon$ or $\varepsilon'$?
Note that while $\mathcal{N}$ may be quantum, the composite channel $\mathcal{D}\circ\mathcal{N}\circ\mathcal{E}$ is in fact classical. Also note that if we know an upper bound for $\|\mathcal{D}\circ\mathcal{N}\circ\mathcal{E} - \mathcal{I}\|_\diamond$, then we can easily bound the worst case error $\max_m Pr[m\neq\hat{m}]$ and hence also the average error $\frac{1}{|\mathcal{M}|}\sum_{m}Pr[m\neq \hat{m}]$. The other way around seems far less obvious.
"
"['qiskit', 'vqe', 'd-wave', 'chemistry']"," Title: From general Hamiltonian to Ising HamiltonianBody: I would like to convert my qubit hamiltonian fom the HeH+ system that I have obtained using Qiskit to an Ising or QUBO model. I have seen multiples examples from QUBO to Qubit Hamiltonian but on the other direction no. Does anyone know how I can do it? Attached my Qubit Hamiltonian.
"
"['programming', 'cirq', 'qaoa']"," Title: Cirq QAOA Tasks returns ""iteration over a 0-d array"" errorBody: I'm trying to understand how to use Recirq for QAOA, and I tried to run the notebook for tasks: https://quantumai.google/cirq/experiments/qaoa/tasks. But it gives a "iteration over a 0-d array" error when I run
for task in precompute_tasks:
precompute_angles(task)
I don't know how to fix this. I want to get their code to run for 5 qubits and get an understanding of how to use and maybe modify it.
"
"['quantum-gate', 'quantum-state']"," Title: For any two quantum states does there exist a gate that takes you from one to the otherBody: For any two states $|\phi\rangle$ and $|\psi\rangle$
Does there exist a gate $U$ such that $U|\phi\rangle = |\psi\rangle$ ?
I suppose that we know for a vector space $V$ then $\forall \quad a, b \quad \exists M$ such that $Ma = b$. Therefore the original question becomes, does the set of quantum states form a vector space?
The space of quantum states does not form a vector space. Consider a quantum state $|\phi\rangle$. If the space of quantum states is a vector space then $2|\phi\rangle$ is also a quantum state.
But $\langle2\phi,2\phi \rangle = 4\langle\phi,\phi \rangle$ by multilinearity of the inner product. And
$4\langle\phi,\phi \rangle = 4$ as $|\phi\rangle$is a quantum state so $\langle\phi,\phi \rangle$ = 1.
Therefore the space of quantum gates is not a vector space.
Then given that, could there still be a $U$ as posed?
"
"['programming', 'qiskit', 'quantum-gate']"," Title: Apply a custom gate to qubits in separate quantum registersBody: Let there be a custom gate (simply called gate that takes $N$ qubits as input. Also, let $A$ of those qubits be in first_register and $B$ of those qubits be in second_register ($B = N-A$, obviously).
Both registers are QuantumRegisters.
How to append this custom gate to circuit, like what to write in circuit.append(gate, HERE).
"
"['textbook-and-exercises', 'complexity-theory', 'deutsch-jozsa-algorithm']"," Title: How come classical Deutsch-Jozsa is $O(1)$ when allowing ""a small error rate""?Body: I'm reading Quantum Computing: An Applied Approach, by Hidary. Chapter 8.2 (p104) says:
While it is true that Deutsch-Jozsa demonstrates an advantage of quantum over classical computing, if we allow for a small error rate, then the advantage disappears: both classical and quantum approaches are in the order of $O(1)$ time complexity.
How is it possible that classical DJ can work with a single oracle query? I am probably missing something deep about the meaning of "a small error rate". An intuitive explanation would be preferred over a heavy-math one, if possible.
"
"['qiskit', 'cirq']"," Title: Is Qiskit more popular than cirq? Why?Body: It seems like most people are using Qiskit, what's the difference?
"
"['programming', 'ibm-q-experience', 'measurement']"," Title: Measure $\langle \hat{X}\rangle$ and $\langle \hat{Y}\rangle$ from countsBody: I'm confused about how I can measure $\langle \hat{X}\rangle$ and $\langle \hat{Y}\rangle$ using counts. Here's my code for X:
x-basis:
# Measurement in x-basis.
quanc_x = QuantumCircuit(1)
quanc_x.u(1,2,3,0) # prepare some random state
quanc_x.h(0)
quanc_x.measure_all()
quanc_x.draw(output='mpl')
# number of repetitions
N = 10000
backend = Aer.get_backend( 'qasm_simulator' )
job = execute( quanc_x, backend, shots=N )
result = job.result()
measurement_result = result.get_counts( quanc_x )
print( measurement_result )
plot_histogram( measurement_result )
cos_phi_est = ( measurement_result['0'] - measurement_result['1'] ) / N #<--Question
print( "cos(phi) estimated: ", cos_phi_est )
My question of this code is marked above. I'm not pretty sure if that looks correct. For Pauli X, we have
$$
\langle \hat{X}\rangle=\langle\psi|0\rangle\langle1|\psi\rangle+\langle\psi|1\rangle\langle0|\psi\rangle
$$
Can I simplify that further? Should that correspond to my code with the question mark? How can I apply that to $\langle \hat{Y}\rangle$? Thanks for the help!
"
"['quantum-operation', 'linear-algebra', 'depolarizing-channel', 'shadow-tomography']"," Title: Inverting the depolarizing channelBody: I have a depolarizing channel acting on $2^n \times 2^n$ Hermitian matrices, defined as
$$\tag{1}
\mathcal{D}_p (X) = p X + (1-p) \frac{\text{Tr}(X)}{2^n} \mathbb{I}_{2^n}
$$
where $\mathbb{I}_{d}$ is the identity operator on $d$ dimensions. I am wondering how to derive the inverse of this map, $\mathcal{D}_p^{-1}$. I found the following formula in (Huang, 2020, eqn S37) which is easily verifiable:
$$\tag{2}
\mathcal{D}_{1/(2^n+1)} (X) = (2^n + 1) X - \text{Tr}(X)\mathbb{I}_{2^n}
$$
but the authors never explicitly required $\text{Tr}(X)=1$ (nor is it implied from their notation). In this case, how does one derive the inverse to $(1)$?
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'unitarity']"," Title: How to construct local unitary transformations mapping a pure state to another with the same entanglement?Body: $\newcommand{\Ket}[1]{\left|#1\right>}$In Nielsen's seminal paper on entanglement transformations (https://arxiv.org/abs/quant-ph/9811053), he gives a converse proof for the entanglement transformation theorem presented (starting at eq.10).
In the protocol presented as part of the converse proof, he states, for example, that if $\Ket{\psi'} \sim \Ket{\psi''}$, then $\Ket{\psi''} = (U_A\otimes U_B) \Ket{\psi'}$ for some local unitary transformations $U_A$ and $U_B$. Here, $\Ket{x} \sim \Ket{y}$ iff $\rho_x$ and $\rho_y$ have the same spectrum of eigenvalues. My question is, how does one construct such local unitary transformations? For instance, what would the explicit form of these unitary transformations be for transforming the state in eq.10 to that of eq.12?
$$
\Ket{\psi'} = \sqrt{\alpha_+} \Ket{00} + \sqrt{\alpha_-} \Ket{11} \\
\Ket{\psi''} = \frac{1}{\sqrt{2}} \Big( \Ket{00} + \Ket{1} \big[ \cos(\gamma)\Ket{0} + \sin(\gamma)\Ket{1} \big] \Big )
$$
Note that $\alpha_{\pm} = (1\pm\cos(\gamma))/2$. Basically, I am trying to work through the protocol for the 2D case as presented in the converse proof, but am getting stuck at the explicit form of the unitary transformations. Any help would be much appreciated!
"
"['qiskit', 'quantum-gate', 'measurement', 'pauli-gates']"," Title: Measuring tensor products of Pauli operatorsBody: Is there a neat way to derive and efficiently implement a measurement circuit for tensor products of arbitrary Pauli operators like $XZZXZ$ in Qiskit ?
I tried using the pauli_measurement function, where I used a PauliOperator object initialized from a corresponding label, but this function seems to perform single-qubit post-rotations for each part of the label and I am not sure if this is what I actually want to measure. I assume, that a generalization of what is described here https://github.com/MicrosoftDocs/quantum-docs/blob/main/articles/concepts-pauli-measurements.md would fit this measurement scenario.
"
"['complexity-theory', 'oracles']"," Title: Proving that with probability 1 $NP \nsubseteq BQP$ with respect to random oraclesBody: In the paper Strength and Weakneses of Quantum Computers (https://arxiv.org/abs/quant-ph/9701001) by Bennet, Bernstein, Brassard and Vazirani, it is shown the statement in the title (Theorem 3.5 in the Arxiv version). I'm confused on the logic of the proof in Theorem 3.5
Given an oracle $A$, define the language $L_A = \{y: \exists x, A(x)=y\}$. It is clear that the language is in $NP^A$. Now, given $T(n)=o(2^{n/2})$, the authors show that a poly time quantum Turing machine gives the wrong answer for $1^n$ with probability at least $\frac{1}{8}$ where the probability is taken over random oracles with fixed answers over bitstrings of length distinct from $n$. I don't understand why proving this is enough for proving the result. In the previous paragraph they mention that they want to show that with probability $1$, $M^A$ running in time $T(n)$ does not accept $L_A$, but I cannot see how the this is implied by the previously mentioned result.
"
"['noise', 'amplitude-amplification']"," Title: Noise-induced amplitude amplification?Body: I wanted to share some results from an experiment which I find thought were deeply surprising.
The basic idea is to prepare a superposition in a main register then conditionally apply lots of random gates to a "messy" register, undo them, and then measure the main register. The idea is to see whether noise can amplify certain outcomes.
Results
The circuit diagram for the simplest case of this is:
circuit-56544 is created using qiskit's random_circuit and turning it into a controlled gate. Note that the middle auxilliary qubit is especially important when there are multiple qubits in the top register to reduce number of controlled-ops.
My prediction was that either nothing would happen or that applying messy gates would "accidentally measure" the messy register because of noise, and collapse the top qubit into the 1 state. The qasm_simulator predicts that nothing will happen (which makes sense since the circuit is just the $H_0$ + identity):
However, when we run on a real device (ibmq_bogota), thus introducing noise, interesting things start to happen:
This is the opposite of what I expected to happen, so I was quite shocked. However, as we increase the depth of the random circuits and the size of the messy register, this effect (and my surprise) are greatly amplified, until we're basically measuring only zeros:
(Of course, I would love to see what happens for more qubits but I only have access to small hardware and obviously we can't trust simulators anymore.)
For now, I'm just hoping someone can explain what is actually going on here. To be clear, we can eliminate the possibility that the messy circuit is somehow inadvertedly doing Grovers-like amplification because the simulator predicts random uniform output for all of these circuits. Therefore, it is physical noise which is driving these effects. One possible metaphor is that qubits dislike interacting with the environment and so "prefer" to take the path of least resistance through the circuit. I am keen to hear what an Everettian (or indeed any interpretation) would say about this.
Search
To add some motivation for understanding what's going on here, I just wanted to point out you can easily use this technique to create a search algorithm. So the circuit to find '101' is
For which we get:
To understand how well this algorithm scales in terms of search space, mess depth or mess width, we of course need to understand the basic effect here.
Questions
Sorry this post has been a bit of a mess (if you pardon the pun). I'll end with some questions:
- Is this due to a quantum effect not considered in the simulator or a physical effect not considered in QM? If former, which one?
- Which interpretation of QM is this most consistent with?
- How well does this scale?
- Are some random circuits messier than others?
- Is it the noiser the device, the better? Or does some other trade-off kick in at some point?
Please feel free to ask any of your own!
p.s. if anyone who has access to larger devices wants to investigate how this scales, I'm happy to share my code.
EDIT: as pointed out by LinLin, this can all be explained by the fact that decoherence means states tend towards |0...0>. As such, the following two circuits produce basically the same output, even though the latter has no entanglement between the main register and the mess.
There's nothing surprising here, I just got a little overexcited.
"
"['programming', 'qiskit', 'measurement', 'projection-operator']"," Title: Applying projectors with mid-circuit measurementsBody: I am trying to apply a non-unitary projector (see image) to my two-qubit quantum circuit using mid-circuit measurements.
$$
\begin{pmatrix}
0 & 0 & 0 & 0 \
0 & 1 & 0 & 0 \
0 & 0 & 1 & 0 \
0 & 0 & 0 & 0 \
\end{pmatrix}
$$
Since I am a bit stumped on whether I can apply this projector to qubits in the middle of the circuit, I am using conditional resets in the following way:
for i in range(1, t):
#print ('Measuring ' + str(i) + ' times')
#do not apply unitary if the outcome is |00> (1000) or |11> (0001)
qRandWalk.measure(qlist,creg)
qRandWalk.x(qlist[1]).c_if(creg,5) #resets 1001 (|01>) to (1010) |00>
qRandWalk.x(qlist[1]).c_if(creg,10) #resets 0110 (|10>) to (0101) |11>
qRandWalk.append(unitary_operator, qlist).c_if(creg,6) # 6 in binary is 0110, |10>
qRandWalk.append(unitary_operator, qlist).c_if(creg,9) #9 in binary is 1001, |01>
I want to project the measured state onto a subspace, then append the unitary operator to the circuit depending on the measurement outcome. I am not sure whether that is what my current code is doing. Are there any other approaches I can take at the moment, running on QASM simulator?
"
"['quantum-gate', 'unitarity']"," Title: Why do quantum gates have to be unitary?Body: In my textbook, it's said
the unitarity constraint is the only constraint on quantum gates. Any unitary matrix specifies a valid quantum gate!
Why do quantum gates have to have to be unitary? How do we know that the unitarity constraint is the only constraint?
"
"['quantum-gate', 'nielsen-and-chuang', 'hadamard']"," Title: Why is H gate called a ‘square-root of NOT’ gate?Body: In Nielsen and Chuang, there's the following paragraph:
I understand that
\begin{align*} \sqrt{NOT} =
\frac{1}{2}\left( {\begin{array}{*{20}{c}}
\sqrt 2 e^{i\pi / 4}&\sqrt 2 e^{-i\pi / 4}\\
\sqrt 2 e^{-i\pi / 4}&\sqrt 2 e^{i\pi / 4}
\end{array}} \right) \\
\end{align*}
But, I'm still confused how the H gate is related to the ‘square-root of NOT’ gate.
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang', 'bloch-sphere', 'hadamard']"," Title: How to derive the rotations caused by the H gate?Body: In Nielsen and Chuang, there's the following paragraph:
The Hadamard operation is just a rotation of the sphere about the ˆy axis by 90◦, followed by a rotation about the ˆx axis by 180◦.
I am wondering how we were able to know that this is the transformation that the H gate creates? Is it implied from the matrix representation of the H gate? If so, how?
"
['qiskit']," Title: How to know positive or negative phrase from qshere diagram?Body: How to find out whether it is a positive or negative $\pi$ phrase between 00 and 11 from q-Sphere diagram?
"
"['programming', 'cirq', 'tfq']"," Title: Encoding Numeric data as a quantum circuit in TFQBody: I am working on a dataset where I have 6 input features that are numbers in the range of 1 - 1000 that need to be encoded as a quantum circuit. I am using TensorFlow Quantum for my research.
While I have come across papers that explain angle encoding and amplitude encoding quite well, I have not quite been able to understand how to express the math in TFQ.
I went through the Quantum MNIST tutorial on the TFQ pages but the way the images are encoded there is vastly different from how how numeric data rows would be encoded.
Any help guiding me to encode this data would be appreciated!
"
"['quantum-state', 'nielsen-and-chuang']"," Title: Why can every Bell state be written as $|\beta_{xy}\rangle=\frac1{\sqrt2}(|0,y\rangle + (-1)^x|1,\bar y\rangle)$?Body: In Nielsen and Chuang, there's the following paragraph:
The mnemonic notation $|\beta_{00}\rangle, |\beta_{01}\rangle, |\beta_{10}\rangle, |\beta_{11}\rangle$ may be understood via the equations
$$ |\beta_{xy}\rangle \equiv \frac{|0,y\rangle + (-1)^x|1,\bar y\rangle}{\sqrt{2}}, $$
where $\bar y$ is the negation of $y$.
I can tell that this is true by substituting the value of x and y into the equation, however, I am wondering if there's any intuition for why this equation holds true for all bell states?
"
"['quantum-state', 'quantum-operation', 'nielsen-and-chuang']"," Title: Can quantum circuits/operations have truth tables?Body: In the caption for the following figure, the word "truth table" is put inside a quotation. I am wondering if this means that the truth table the caption refers to isn't exactly a real truth table? If so, why?
"
"['quantum-state', 'entropy', 'communication', 'trace-distance', 'min-entropy']"," Title: How to prove that $\frac{| x_0 \rangle + | x_1 \rangle}{\sqrt{2}}$ hides one of $x_0$ or $x_1$?Body: I create a quantum state $| \psi \rangle = \frac{| x_0 \rangle + | x_1 \rangle}{\sqrt{2}}$ for a randomly chosen $x_0,x_1$ of 50 bits. I give this quantum state $|\psi \rangle$ to you and you return me back $x_0$. How do I prove that conditioned on you returning me the correct $x_0$, the string $x_1$ is totally hidden from you? i.e. if I now give you either $x_1$ or a uniformly random string of same number of bits, you can't distinguish between them with probability better than $0.5$.
This certainly seems true, because if you can return me back the correct/same $x_0$, it must be the case that the system collapsed to $|x_0 \rangle$ and hence $x_1$ is hidden from your point of view.
But how would I go about proving this using information theoretic tools? Perhaps we can somehow show that there is entropy in $x_1$ from the receiver's point of view. But I am not sure on how to do this.
"
"['programming', 'qiskit', 'machine-learning', 'compiling']"," Title: Software tools to train quantum circuits with parametersBody: I want to play with the following problem. Given a unitary $U$ with parameters $\theta$ I want to optimize these parameters to make $U$ match some target unitary $V$, i.e. to find $\operatorname{argmin}_{\theta}||U(\theta)-V||$. This is in spirit of the quantum compiling problem, but here I want to build the parametrized circuit on my own.
Ideally I want to
- Build unitary $U(\theta)$ as a parametrized quantum circuit. This means that I do not want to explicitly construct matrix representations of gates etc.
- Use some well-developed framework for machine learning to minimize the loss function.
I am most familiar with qiskit and I can do (1) there rather easily using parmetrized circuits. However, I do not know if it is possible to convert a parametrized circuit into a matrix form so that it could be fed to automatic differentiation software.
If the problem is not easily solvable in qiskit I am willing to consider any other software stack with the main requirement being the ease of use.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises', 'unitarity']"," Title: Unitary Transformations for States with Same EntanglementBody: $\newcommand{\Ket}[1]{\left|#1\right>}$
I know this has been asked before in another context (How to construct local unitary transformations mapping a pure state to another with the same entanglement?), but a similar issue dealing with the same paper (https://arxiv.org/pdf/quant-ph/9811053.pdf) caused me to ask this question.
If $\Ket{\psi'} \sim \Ket{\psi''}$, then $\Ket{\psi''} = (U_A\otimes U_B) \Ket{\psi'}$ for some local unitary transformations $U_A$ and $U_B$. Here, $\Ket{x} \sim \Ket{y}$ iff $\rho_x$ and $\rho_y$ have the same spectrum of eigenvalues.
The question is: How does one construct local unitary transforms to map the states $\Ket{\psi'''_2} \rightarrow \Ket{\psi'''_1}$, and $\Ket{\psi'''_1} \rightarrow \Ket{\psi^4}$, where:
$$
\Ket{\psi'''_1} = \cos(\delta)\Ket{00} + \sin(\delta)\Ket{1} \big[ \cos(\gamma)\Ket{0} + \sin(\gamma)\Ket{1} \big] \\
\Ket{\psi'''_2} = \sin(\delta)\Ket{00} + \cos(\delta)\Ket{1} \big[ \cos(\gamma)\Ket{0} + \sin(\gamma)\Ket{1} \big] \\
\Ket{\psi^4} = \sqrt{\lambda_+} \Ket{00} + \sqrt{\lambda_-} \Ket{11} \\
$$
Note that $\lambda_{\pm} = \big(1\pm \sqrt{1-\sin^2(2\delta)\sin^2(\gamma)}\big)/2$, and the Schmidt coefficients of all states are the same. I have tried solving this problem using both Mathematica and by hand (following the method of this answer), but both were yet unfruitful. Any help would be much appreciated.
EDIT: Answer can be found here
"
"['programming', 'quantum-gate', 'randomised-benchmarking']"," Title: Defining native gate dictionary in pyGSTiBody: In pyGSTi in order to construct Randomized Benchmarking circuits, we first need to define a pspec object that contains information about the number of qubits, basis gates and gate availability.*
In the tutorial notebooks (https://github.com/pyGSTio/pyGSTi/blob/master/jupyter_notebooks/Tutorials/algorithms/RB-DirectRB.ipynb), they use a predefined gate dictionary for this, where each gate is called by a certain key (string) and it's value corresponds to the numpy array for the matrix representation of the gate. This does not seem to allow parametrized gates but if we want to characterize for example an ibmq device, then we would need a dictionary for continuously parametrized gates.
I would be really happy, if someone knows how to define a pspec object so that it corresponds to the device, I want run the experiments later on.
*(Interestingly the qubit topology doesn't play a role here, but the sampling algorithms for direct and mirror randomized benchmarking need to work with the topology of the device in order to achieve the desired sampling process of single- and two-qubit gate layers...)
"
"['programming', 'qiskit', 'error-correction']"," Title: Keep receiving Error - AttributeError: 'QuantumCircuit' object has no attribute 'save_statevector'Body: I am attempting to code a feed-forward simulation of a QECC in Qiskit. Qiskit (to my knowledge) does not directly support feed-forward simulation, so I attempted a work-around. I call the simulator firstly:
#c/q register
self.qubits = QuantumRegister(9)
self.round1 = ClassicalRegister(2)
self.round2 = ClassicalRegister(3)
self.decoded = ClassicalRegister(7)
self.circuit = QuantumCircuit(self.qubits,self.round1,self.round2,self.decoded,name="circuit")
#noise model
self.noisy = NoiseModel()
self.error_rate = self.error_rates
self.error_two_qubit = errors.depolarizing_error(self.error_rate/15, 2)
self.noisy.add_all_qubit_quantum_error(self.error_two_qubit, ['cx','cz','cy']
#simulator backend
self.simulator = Aer.get_backend('qasm_simulator',noise_model=self.noisy)
Next, I attempt to save the statevector after calling the first stabilizer operator:
self.circuit.reset(self.qubits[7])
self.circuit.reset(self.qubits[8])
self.circuit.h(self.qubits[8])
self.circuit.cx(self.qubits[8],self.qubits[7])
self.circuit.cx(self.qubits[target1],self.qubits[7])
self.circuit.cx(self.qubits[target2],self.qubits[8])
self.circuit.cx(self.qubits[target3],self.qubits[7])
self.circuit.cx(self.qubits[target4],self.qubits[8])
self.circuit.cx(self.qubits[8],self.qubits[7])
self.circuit.h(self.qubits[8])
self.circuit.measure(self.qubits[7],self.round1[0])
self.circuit.measure(self.qubits[8],self.round1[1])
self.circuit.save_statevector()
I lastly then attempt to execute the code up to the save-point:
self.result = execute(self.circuit,self.simulator,shots=1).result()
self.statevector = self.result.get_statevector(self.circuit)
I am not entirely sure why the error I get is of the following form:
Traceback (most recent call last):
self.circuit.save_statevector()
AttributeError: 'QuantumCircuit' object has no attribute 'save_statevector'
I have looked at the answers from the following URLs:
- https://stackoverflow.com/questions/67362847/attributeerror-quantumcircuit-object-has-no-attribute-config
- https://githubmemory.com/repo/Qiskit/qiskit-terra/issues/6346?page=2 .
I still am not able to fix the issue. Help would be much appreciated.
"
['d-wave']," Title: Sampling from a given Boltzmann distribution using D-Wave systemsBody: For a project I'm working on, I want to use D-Wave systems to estimate the probabilities of a Boltzmann distribution given a QUBO (Hamiltonian), this being performed through sampling and the use of the law of large numbers. Yet, I have some problems.
- There is a difference between the mathematical QUBO I have, that I define in Python, and the physical QUBO that is actually implemented. Such a difference must exist for multiple reasons:
- A priori, the QUBO I define can have arbitrary big coefficients, while a physical system cannot have arbitrary big energies. Thus, my QUBO must be scaled at some point.
- The QUBO written in Python is physically dimensionless, while an actual energy has a physical dimension (ML^2T^-2). Thus, an energy scale must be involved.
- The physical Boltzmann distribution depends on temperature through a factor
1/(kB*T).
This can be summarized by saying that denoting by H the QUBO defined in Python, what the machine implements and samples from is some \beta_eff*H. While having a positive \beta_eff ensures that the ground states remain the same and therefore allows for the discovery of the ground state of my mathematical QUBO, the Boltzmann distribution is changed by this factor.
- Getting an estimation of a probability distribution through a statistical sampling implies having enough samples to reach convergence in the law of large numbers. As a first approximation, if N is the amount of qubits involved in my QUBO, then there are 2^N possible states and thus 100*2^N is a decent estimation of the amount of samples required to reach the aforementioned convergence. Now, when trying to sample from a distribution, I encountered an error stating that
num_reads is at maximum 10 000, which (according to the previous estimation) allows for no more than 6 qubits, so not enough for me. I thought of simply make multiple batches of 10 000 reads and concatenate them together with Python ; however, this forum thread implies that it won't be a solution.
Hence the question :
Is it possible to sample from a given Boltzmann distribution using a D-Wave computer, and if yes, how to do so ?
Thanks in advance for your help
"
"['quantum-state', 'nielsen-and-chuang', 'information-theory']"," Title: How to describe a known quantum state using classical information?Body: In Nielsen and Chuang, it's said that to describe a known quantum state precisely takes an infinite amount of classical information since $|\psi\rangle$ takes values in a continuous space (from the 3rd paragraph in chapter 1.37 "Example: quantum teleportation").
I'm confused about how classical information will be used to describe quantum states in the first place. Is it that we find the strings of 0's and 1's that are equal to the numerical value of the amplitudes of our quantum state ($\alpha$ and $\beta$) and these 2 strings of 0's and 1's are what describe this known quantum state?
"
['bloch-sphere']," Title: Can I draw platonic solid inside a Bloch sphere?Body: I wonder if there's a tool available to draw platonic solids or other 3-D shapes inside a Bloch sphere. Here's an example I found on a research paper:
In my previous visualizations, I used the kaleidoscope package in Python to simulate time-evolution inside the Bloch sphere. I wonder if there's a tool I could draw 3-D shapes also. Thanks!
"
"['quantum-gate', 'quantum-state', 'nielsen-and-chuang', 'quantum-circuit']"," Title: The use of modulo 2 in state representation after CNOTBody: The following circuit with a CNOT gate has the following effect on a computational basis state $|a, b\rangle$, where all additions are done modulo 2.
Why is the state of the second qubit changed to $a\oplus b$ after CNOT is applied?
"
['nielsen-and-chuang']," Title: Is where measurement is done the requirement for what gets to be called the computational basis?Body: In Nielsen and Chuang, chapter 1.3.3 is named as "Measurements in bases other than the computational basis". This name confuses me - after the measurement is done on a new base, doesn't this new base become the computational basis?
"
"['quantum-state', 'nielsen-and-chuang']"," Title: Why does $a ⊕ (a ⊕ b) = b$ and $(a ⊕ b) ⊕ b = a$?Body: For the following circuit that swap two qubits
The sequence of gates is said to have the following sequence of effects on a computational basis state |a, b>
where all additions are done modulo 2.
On the 2nd and 3rd line, it's shown that $a ⊕ (a ⊕ b) = b$ and $(a ⊕ b) ⊕ b = a$, however, I have trouble understanding why this holds true.
"
"['quantum-state', 'nielsen-and-chuang']"," Title: Copying quantum stateBody: I'm confused about the last complete sentence in the following paragraphs. If ab=0, that means either a or b equals to 0. As a result, doesn't $|\psi\rangle|\psi\rangle$ equal to either $b^2|11\rangle$ or $a^2|00\rangle$? If so, how is this related to $a|00\rangle + b|11\rangle$? Also, how do $|\psi\rangle|\psi\rangle = b^2|11\rangle$ or $=a^2|00\rangle$ show that the quantum state input is copied?
"
"['algorithm', 'machine-learning', 'quantum-enhanced-machine-learning']"," Title: Objective function of Quantum GAN in the paper ""Quantum generative adversarial networks""Body: In this paper about Quantum GANs, the authors do not explain clearly how do they have the equation
$$\newcommand{\tr}{\operatorname{Tr}}\newcommand{\Pr}{\operatorname{Pr}}
V(\vec{\theta}_D, \vec{\theta}_G)=
\frac{1}{2}+\frac{1}{2\Lambda}
\sum_{\lambda=1}^{\Lambda}
\left[
\cos^2(\phi)\tr(Z\rho_\lambda^{DR}(\vec{\theta_R}))-\sin^2(\phi)\tr(Z\rho_\lambda^{DG}(\vec{\theta_R},\vec{\theta_D,z}))
\right],$$
from
$$V(\vec{\theta}_D, \vec{\theta}_D)=
\frac{1}{\Lambda} \sum_{\lambda=1}^{\Lambda}
\Pr\Big[
(
D(\vec{\theta}_D,|\lambda\rangle, R(|\lambda\rangle))
= |\operatorname{real}\rangle
)
\\\cap
(
D(\vec{\theta}_D,|\lambda\rangle, G(\vec{\theta}_G,|\lambda,z\rangle))
=|\operatorname{fake}\rangle
)
\Big]
.$$
They suggested that it relate to classical case, but I still don't know the key point.
Hope to see some ideas from you. Thanks!
"
"['programming', 'qiskit']"," Title: Define customized excitation for the unitary coupled-cluster (UCC) algorithm in qiskitBody: I encountered the issue that when defining my customized excitation list in the UCC algorithm, there was only one parameter. How to fix this so that the algorithm assign one parameter for each excitation defined? The code is as follow:
from qiskit import *
import numpy as np
#Operator Imports
from qiskit.opflow import Z, X, I
#Circuit imports
from qiskit_nature.drivers import PySCFDriver, UnitsType, QMolecule, FermionicDriver
from qiskit_nature.problems.second_quantization.electronic import ElectronicStructureProblem
from qiskit_nature.circuit.library import HartreeFock, UCCSD, UCC
from qiskit_nature.transformers import FreezeCoreTransformer, ActiveSpaceTransformer
from qiskit_nature.algorithms import GroundStateEigensolver
from qiskit_nature.results import EigenstateResult
from qiskit import Aer
from qiskit_nature.mappers.second_quantization import ParityMapper, JordanWignerMapper
from qiskit_nature.converters.second_quantization import QubitConverter
from qiskit.algorithms.optimizers import L_BFGS_B, SPSA, AQGD, CG, ADAM, P_BFGS, SLSQP, NELDER_MEAD
from qiskit.algorithms import VQE, NumPyMinimumEigensolver
from qiskit.circuit.library import TwoLocal, EfficientSU2
import matplotlib.pyplot as plt
import matplotlib
from qiskit.tools.visualization import circuit_drawer
matplotlib.use('Agg')
driver = PySCFDriver(atom='H -1.9767, .0, 1.53054; \
O .0, .0, .0; \
H 1.9767, .0, 1.53054;',
unit=UnitsType.ANGSTROM,
basis='sto3g')
at = ActiveSpaceTransformer(8, 5)
ft = FreezeCoreTransformer()
problem = ElectronicStructureProblem(driver, q_molecule_transformers=[ft, at])
# generate the second-quantized operators
second_q_ops = problem.second_q_ops()
main_op = second_q_ops[0]
num_particles = (problem.molecule_data_transformed.num_alpha,
problem.molecule_data_transformed.num_beta)
num_spin_orbitals = 2 * problem.molecule_data.num_molecular_orbitals
mapper = JordanWignerMapper()
converter = QubitConverter(mapper=mapper, two_qubit_reduction=True)
qubit_op = converter.convert(main_op, num_particles=num_particles)
init_state = HartreeFock(num_spin_orbitals, num_particles, converter)
# print(main_op)
def custom_excitation_list(num_spin_orbitals, num_particles):
my_excitation_list = [((0, 2, 4, 6), (0 ,2, 4, 7), (0,2,5,6))]
return my_excitation_list
circ = UCC(qubit_converter=converter, num_particles=num_particles, num_spin_orbitals=num_spin_orbitals, excitations=custom_excitation_list, reps=1, initial_state=init_state)
print(circ.parameters)
```
"
"['qiskit', 'ibm-q-experience', 'measurement']"," Title: Do I need to use classical bits in measurement?Body: I wonder if I have to add classical bits while performing measurement for a single-qubit quantum circuit. The difference to initialize the circuit is QuantumCircuit(1) and QuantumCircuit(1,1). I noticed if I do not add the classical bit while drawing the circuit, I'm automatically assigned with a meas bit:
Is that the same as a classical bit? Will there be any difference when I run the two versions of the circuit on the simulator and quantum device? Thanks!
"
"['programming', 'qiskit', 'openpulse']"," Title: What is the proper area for a Gaussian Pulse so it will be able to perform a rotation of pi on a qubit?Body: with pulse.build(backend, name='hadamard') as h_q0:
pulse.play(Gaussian(duration=1289, amp=0.99, sigma=32), pulse.drive_channel(0))
reg = pulse.measure(qubit)
h_q0.draw()
Above is code that I have for a Gaussian Pulse. How would you change the duration, amp, and sigma parameters, so that the Gaussian Pulse would have the proper area for conducting an X gate on a qubit?
"
"['quantum-operation', 'kraus-representation', 'open-quantum-systems']"," Title: What properties do Kraus operators of Markovian processes have?Body: It is well-known that the Kraus operator can describe more kinds of processes than master equations. For example, the master equation cannot describe non-markovian processes while the Kraus operator can, and all master equations can be translated into the Kraus operator frame.
Since all the master equations can only describe the markovian process, so my question is: does this kind of Kraus operator which describes the markovian process have some property that we can classify them from the Kraus operator that describes the non-Markovian process?
"
['qiskit']," Title: Open pulse, simple schedule meaningBody: I'm going through the tutorials qiskit and quantum lab 06_building_pulse_sched for qubit calibration. The first pulse is as in the image. There's a couple of things that I still don't understand in it.
(a) The curl arrow is an offset, as described in the quantum lab notebook. In the code of qiskit (first reference), does not seem to be an offset added, why it is present?
(b) Somehow I got lost with the parameters. Why the pulse is centered at around 300ns?
"
"['quantum-state', 'notation']"," Title: What is a term for a basis state along with its corresponding complex amplitude?Body: For some arbitrary state $|\psi\rangle = c_0|x_0\rangle + c_1|x_1\rangle + c_2|x_2\rangle ... + c_{2^n}|x_{2^n}\rangle$, where each of $|x_i\rangle$ is a basis state, and each of $c_i$ is the corresponding complex amplitude, what term would someone use to describe one of the $c_i|x_i\rangle$ terms? It is not just a basis state, and it is not just a complex amplitude. It is both of them combined. What is this called? How would it be denoted? Would it be denoted as something like $|\psi^i\rangle$, or $|\psi\rangle_i$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: IBM Quantum: Are ibmq_5_yorktown and ibmqx2 different devices?Body: When I run provider.backends(), ibmqx2 is listed as an available backend, but is not listed on the IBMQ systems page. This file from the archived repository ibmq-device-information associates backend name ibmqx2 with display name IBM Q 5 Yorktown. The IBMQ systems page does list a 5 qubit Yorktown device, but under the name ibmq_5_yorktown. This backend is also available via ibmq/open/main, but is not listed by provider.backends(). Are ibmqx2 and ibmq_5_yorktown respectively versions 1 and 2 of backend software providing access to a single Yorktown device? Or do these names refer to two distinct Yorktown devices?
"
"['programming', 'tensor-product', 'qutip']"," Title: Python shorthand for tensor product (Kronecker product)Body: When using numpy or tensorflow in Python, we can simply write
C = A @ B
for matrix multiplication C = np.matmul(A,B). I wonder if there is a shorthand for tensor product (Kronecker product), $C=A\otimes B$ . Now I can only do this by using np.kron(A, B) or using qutip qutip.tensor(A, B)
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'information-theory', 'entropy']"," Title: How to understand intuitively the concavity of the binary entropy?Body: In Nielsen and Chuang's Quantum Computation and Quantum Information book, introducing the binary entropy, they gave an intuitive example about why binary entropy is concave:
Alice has in her possession two coins, one a quarter from the US, the other a dollar
coin from Australia. Both coins have been altered to exhibit bias, with the probability
of heads on the US coin being $p_U$, and the probability of heads on the Australian coin
being $p_A$. Suppose Alice flips the US coin with probability $q$ and the Australian coin
with probability $1 − q$, telling Bob whether the result was heads or tails. How much
information does Bob gain on average? Intuitively it is clear that Bob should gain at least
as much information as the average of the information he would have gained from a US
coin flip or an Australian coin flip. As an equation this intuition may be expressed as:
$$
H\left(q p_{\mathrm{U}}+(1-q) p_{\mathrm{A}}\right) \geq q H\left(p_{\mathrm{U}}\right)+(1-q) H\left(p_{\mathrm{A}}\right)
$$
My main question is that I understand how to prove the concavity by math, but I don't get the intuition they mentioned here. I guess does it mean that $H\left(q p_{\mathrm{U}}+(1-q) p_{\mathrm{A}}\right)$ shows we have the information that we have two different coins while $q H\left(p_{\mathrm{U}}\right)+(1-q) H\left(p_{\mathrm{A}}\right)$ doesn't show the information that we have two different coins, so the information is less than the left term in the formula?
"
"['qiskit', 'boson-sampling']"," Title: How many qubits would be needed to do boson sampling in Qiskit?Body: In December 2020, there was this claim of quantum advantage/supremacy by a team of UST China using Gaussian boson sampling. Here is the paper and here is an explanatory news article in Nature. To get an idea of how that works, I wanted to try to replicate a reduced version in Qiskit. Is this possible? Are there predefined functions I can exploit for doing photon-like circuits (if not how I can implement the boson-to-qubit mapping)?
The original paper on the theory of boson sampling by Scott Aaronson and Alex Arkhipov can be found here.
I looked in Qiskit documentation and I did not find any boson-qubit mapping (Holstein-Primakoff, Dyson-Maleev or Schwinger bosons). I just found out that there is a BosonicOperator in Qiskit Chemistry module but I do not know what is its purpose without mappings.
I would also like to have an estimation of the minimum number of qubits I will be needing. I am not trying to test quantum advantage. The paper reported a 76 photons coincidence which is a lot for even the best of supercomputers. The calculation involves permanents which are in practice exponentially difficult to calculate with ordinary computers. My goal is to simulate boson sampling to calculate the result of a very small permanent (if possible the smallest one) that I can verify later on my PC.
Note: according to Is it possible to "calculate" the absolute value of a permanent using Boson Sampling? you cannot calculate permanents directly using boson sampling.
"
"['qiskit', 'quantum-gate', 'textbook-and-exercises', 'quantum-circuit']"," Title: Can someone explain using H and T gates repeatedly?Body: The Qiskit textbook says it is used because $R_x$, $R_y$, and $R_z$ are not accurate single qubit rotations.
Can someone elaborate what the repeated $H$ and $T$ gates actually do?
In what scenario should we use this in our circuit design?
"
"['programming', 'qiskit']"," Title: Initialization time for StatevectorSimulator QiskitBody: I have a question about initializing a quantum circuit to a custom state using Qiskit's StatevectorSimulator(). My naive understanding is that eventually, the simulator would be doing matrix multiplications on the backend (I might be wrong here, if so please correct me). And thus it seems to me that there should be a way of setting a custom initial state with no extra time cost each time you run the circuit. Here is an example. The following code compares the run time of two circuits: qc_1 has initialization to some custom state using qc_1.initialize(state_vec, q_args), and qc_2 which doesn't has such initialization.
import time
from numpy import pi
from numpy.random import random
from qiskit import QuantumCircuit, transpile
from qiskit.providers.aer import StatevectorSimulator
qc = QuantumCircuit(16)
# This for loop is irrelevant. Just used to get some nontrivial statevector
for i in range(num_terms):
rz_pos = (i//2) % 14 + 1
for j in range(rz_pos):
qc.cx(j, j+1)
qc.rz(pi*random(1)[0], rz_pos)
for j in range(rz_pos)[::-1]:
qc.cx(j, j+1)
qc.h([*range(rz_pos)])
qc = transpile(qc)
simulator = StatevectorSimulator()
result = simulator.run(qc).result()
state_vec = result.get_statevector()
qc_1 = QuantumCircuit(16)
qc_1.initialize(state_vec, [*range(16)]) # pylint: disable=no-member
qc_2 = QuantumCircuit(16)
start = time.time()
for i in range(1000):
result = simulator.run(qc_1).result()
time_1 = time.time() - start
print(f'time took to run circuit w initialization {1000} times: {round(time_1,3)}s')
start = time.time()
for i in range(1000):
result = simulator.run(qc_2).result()
time_2 = time.time() - start
print(f'time took to run circuit w/o initialization {1000} times: {round(time_2,3)}s')
This gives the following output:
time took to run circuit w initialization 1000 times: 5.93s
time took to run circuit w/o initialization 1000 times: 0.62s
My assumption is that, using StatevectorSimulator(), there should be a way to set up qc_1 such that the initialization process takes virtually no extra time. This way would be just like saying, instead of using the '0' vector to start multiplying the gates to, use the cutom statevector. This way there should be no extra time cost, correct? Again I understand that this way of thinking only applies to StatevectorSimulator().
"
"['quantum-fourier-transform', 'hadamard']"," Title: Represent the $n$-qubit $2^n\times2^n$ size Hadamard/quantum Fourier transform unitary square matrix as product of $k$ two-level unitary matricesBody: I wish to know if it is possible to express the n-qubit Hadamard unitary square matrix of size $2^n * 2^n$ as a product of 'k' two-level unitary square matrices where 'k' is of the order of polynomial in 'n'. By order is meant the Big-O notation of computational complexity theory. By the 2-level matrix, I mean the definition in the book "Quantum Computation and quantum information" by Nielsen and Chuang, section 4.5.1 "Two level unitary gates are universal", pp. 189. A two-level unitary matrix is a unitary matrix which acts non-trivially only on two-or-fewer vector components.
I also wish to know if the same decomposition into 'k' two-level unitary square matrices can be done to a Quantum Fourier Transform (QFT) unitary square matrix of n-qubits of size $2^n * 2^n$ where 'k' is of the order of polynomial in 'n'.
I have read that the two-level unitary gates/square matrices are universal.
Any help in this regard is highly appreciated.
"
"['matrix-representation', 'unitarity']"," Title: How is outer product an operator?Body: I was going through Qiskit online text book and came across this part. The relevant (slightly modified) paragraph is -
Suppose we have two states $|\psi_0\rangle$ and $|\psi_2\rangle$. Their inner product would be $\langle\psi_0|\psi_1\rangle$. If we apply the same $U$ to both, the inner product of the resulting states would still be the same -
The Hermitian conjugate of first state, after applying $U$ would be $\langle\psi_0|U^\dagger$. So inner product would be
$$(\langle\psi_0|U^\dagger)\ (|\psi_1\rangle U)= \langle\psi_0|UU^\dagger|\psi_1\rangle =\langle\psi_0|\psi_1\rangle $$
This property provides us with a useful way of thinking about these gates. It means that for any set of states $\{|\psi_j\rangle\}$, that provide an orthonormal basis for our system, the set of states$\{|\phi_j\rangle=U|\psi_j\rangle\}$ will also be an orthonormal basis. The unitary can then be thought of as a rotation between these bases, and can be written accordingly as
$$U = \sum_j{\lvert\phi_j\rangle\langle\psi_j\rvert}$$
I didn't really get the last part. How is $U = \sum_j{\lvert\phi_j\rangle\langle\psi_j\rvert}$ is connected to preceding discussion? How does this follow from previous discussion?
My second question is how $U = \sum_j{\lvert\phi_j\rangle\langle\psi_j\rvert}$ is mapping operator as described in this post? How is this derived?
"
"['algorithm', 'vqe']"," Title: What's the importance of a relationship with Gibbs state in the context of VarQITE or variational algorithms?Body: Trying to figure out VarQITE or variational algorithm, I ran into the Gibbs state.
What's the importance of a relationship with Gibbs state in this context. Why can we just use the arbitrary state and evolve it trusting the nature of variational nature?
Thanks
"
"['quantum-state', 'entanglement', 'simulation', 'speedup', 'superposition']"," Title: What is the role of entanglement in quantum-computational speed-up?Body: The way I see it, there are three main quantum properties utilized in quantum computing - superposition, quantum interference, and quantum entanglement. I'm looking to understand which one is responsible for the exponential speed-up that quantum computing provides over classical computing.
- superposition is easily simulatable classically - it takes just 2 complex numbers to represent each qubit in a quantum system (assuming the qubits are not entangled), ergo, it's can't be what's allowing for an exponential speed-up since if it was it'd be achievable classically.
- interference - I don't see or know of any particular difficulty in simulating quantum interference classically as well, therefore, it also disqualifies.
- entanglement is where things get confusing. Surely, it gets exponentially more difficult to simulate a fully entangled quantum system as the number of qubits increases. However, I can't see how the increase in potential states of the system can provide a speed-up of the algorithm operating on top. What seems like a more reasonable explanation is that acting on one qubit in a fully entangled quantum system is the same as acting on all qubits simultaneously. Classically, one would have to modify each bit separately which would of course prove slower.
Having said that, I have two questions:
- First of all, is my understanding correct?
- Is there an example of a quantum algorithm that provides any sort of speed-up over its classical alternative without the use of quantum entanglement?
"
"['qiskit', 'chemistry']"," Title: Molecular orbitals in QiskitBody: During the same minute as asking this question, I also asked this at Matter Modeling SE.
In Qiskit, each qubit corrrespond to one spin orbital. For example, the $\text{N}_2$ molecule have 10 molecular orbitals, which correspond to 20 spin orbitals for $\alpha$ and $\beta$ spins in sto-3g basis set. In my opinion, this is the case because the for each atom contained in the molecule, we need to account for the orbitals included, which are 1s, 2s, 2p for the nitrogen atom. However, in this case, how could one deal with the molecular orbitals when one is in the situation as choosing the active space for the molecule?
Take the H2O molecule as an excample, according to the MO diagram here, I would like to choose the 3a1 & 1b1 orbital to be not in the active space. In this case, is the qiskit pakage (more specifically the PySCF driver) arrange the orbitals according to the MO orbitals so that I can just specify a list like [0,1,4,5] to be the active MO space assume that the organization is from down to up in this case?
"
"['qiskit', 'quantum-operation', 'noise', 'models']"," Title: unexpected effect of coherent unitary error in qiskitBody: I'm trying to simulate the effect of a coherent unitary Z rotation at an arbitrary angle of a single qubit on the fidelity of a quantum circuit. I am using the qiskit Aer noisy simulator. More specifically, my goal is to quantify the loss of fidelity associated with the fact that when attempting to apply any gate with a unitary $U$, I apply instead the gate
$$
V = R_{i,z}^\dagger(\epsilon)UR_{i,z}(\epsilon)
$$
where $i$ is an index of a single qubit.
As a sanity check, I am trying the single qubit case first, where I expect this error to not have any effect, since the initial state of the qubit is $|0\rangle$ and the measurement is in the Z basis. Thus, assuming that the coherent unitary channel acts on the state as $\mathcal{E}(\rho) = U\rho U^\dagger$, this error should get absorbed into the preperation and measurement and not have any effect on the fidelity.
When I simulate this circuit however, I find that the fidelity does go below 1 as I increase the error. It seems like the qiskit method coherent_unitary_error function from qiskit does not return a QuantumError object which has the effect of applying $\mathcal{E}(\rho)$ as defined above. Does that make sense?
I am including here a self-contained code sample which shows this behavior. One easy way to trigger this effect on and off is to change the optimization_level parameter in line 21 of the attached code. If it is 0, then the two Hadamards don't get merged into one and we see an error. If it is 1 or larger, they get merged and no error appears. Of course, manually adding the Z rotations to the circuit does not lead to an error.
Any ideas? Did I misunderstand how the noise model works, or is there a more fundamental issue here?
Thanks a lot in advance!!
import qiskit
from qiskit import QuantumCircuit, transpile
from qiskit.providers.aer import AerSimulator
from qiskit.providers.aer.noise import NoiseModel, coherent_unitary_error
epsilon = 0.1
z_rot = qiskit.circuit.library.U1Gate(epsilon)
z_rot_dg = qiskit.circuit.library.U1Gate(-epsilon)
noise_model = NoiseModel()
noise_model.add_all_qubit_quantum_error(coherent_unitary_error(z_rot), 'u2')
noise_model.add_all_qubit_quantum_error(coherent_unitary_error(z_rot), 'u3')
print(noise_model)
noise_sim = AerSimulator(noise_model=noise_model)
circ = QuantumCircuit(1, 1)
circ.h(0)
circ.h(0)
circ.measure(0, 0)
# change optimization level to 1 to turn off effect of channel
ct = transpile(circ, noise_sim, optimization_level=0)
print(ct.draw())
nshots=10000
job = noise_sim.run(ct, shots=nshots)
print(job.result().get_counts()['0']/nshots)
```
"
"['qiskit', 'google-sycamore']"," Title: Can Google Sycamore's benchmark for quantum supremacy be simulated on Qiskit?Body: In 2019, Google claimed that they have achieved quantum supremacy/advantage with their 53 qubit quantum processor Sycamore. The paper is here. But I have not even been able to find what their algorithm is called. I know that is just a sampling problem. How would I go to create a similar sampling for a smaller circuit (say 5 qubits) using Qiskit?
I have checked this good 3-part series of questions Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate set. Yet I am still unable to understand from where to start. Does Qiskit have predetermined functions for this purpose? Especially on how would I go to confirm it out later? My key issue here is that I do not know the name of the algorithm so I only have Google experiment related sources.
I am not concerned with the issue that they may have achieved quantum supremacy or not.
"
"['programming', 'qaoa']"," Title: QAOA OptimizationBody: I want to use historical data for 5 stocks from YahooFinance and then calculate mean vector and covariance matrice, so I can optimize them with QAOA. Anyone know what is wrong with this code:
"
['quantum-gate']," Title: About projective measurement and eigenspaceBody: I have read an article Unified derivations of measurement-based schemes for quantum computation.
In page 3, Section A it says that The classical outcome j corresponds to the measurement of $(U^\dagger X U)\otimes (V^\dagger ZV)$, because $(H \otimes I)\Lambda(Z)(U \otimes V)$ maps the $\pm 1$ eigenspace of $(U^\dagger X U)\otimes (V^\dagger ZV)$ onto the $\pm 1$ eigenspace of $Z \otimes I$. (where $\Lambda(Z)$ denote contolled-Z gate)
My question is:
I think I know that eigenspace of Z is $\{|+ \rangle ,|-\rangle\}$ , but what is eigenspace of $I$?
Why use the controlled-Z gate in the measurement of $(U^\dagger X U)\otimes (V^\dagger ZV)$? What does it do?
"
"['programming', 'ibm-q-experience', 'simulation']"," Title: Can I extract information from a single shot efficiently?Body: I'm running a quantum simulation and want to obtain some information from a single shot of an experiment. Here's part of the code I'm working on:
for i in range(Nshot):
Expeb = []
for measure_circuit in [circ_1, circ_2, circ_3, circ_4]:
measure_circuit = transpile(measure_circuit,backend=backend,optimization_level=2,initial_layout = [1])
counts = execute(measure_circuit, backend = backend, shots=1).result().get_counts()
for output in ['0','1']:
if output not in counts:
counts[output] = 0
expe = (counts['0'] - counts['1'])
Expeb.append(expe)
Est = sum(x*y for x,y in zip(Expeb,[a,b,c,d]))
The code works on simulators, but it might take a very long time if Nshot gets large (Like 5000, I think that's because I generated a lot of circuits) and I submit the jobs to a quantum device. I wonder is there a way I can extract information (like making calculations for) a single shot but in a more efficient way? Thanks for the help!
"
"['hamiltonian-simulation', 'optimization', 'qaoa']"," Title: QAOA for Binary OptimizationBody: I have reduced an optimization problem to a Binary Integer Linear Programming model as follows:
$$\sum_{j=1}^{2^n-1} f(C_j)x_j \rightarrow \max$$
$$\text{subject to} \sum_{j=1}^{2^n-1} S_{i,j}x_j=1\,\, \text{for}\,\, i=1,2,....,n\\\\$$
$$x_j \in \{0,1\}\ \ \ \text{for}\ j=1,2,.....,(2^n-1).$$
By referring the Ising Hamiltonian for different NP-Hard Problems
: I have computed the Hamiltonian for the above problem as follows:
$$H_A = \alpha \sum_{j=1}^{n}\left [ 1 - \sum_{i=1}^{2^n-1}S_{ji}x_i \right ]^2 \text{where}\ \alpha>0\ \text{is a constant}$$
$$H_B = -\beta \sum_{i=1}^{2^n-1}f(C_i)x_i\ \text{with}\ \beta\ll\alpha.$$
Here we have to replace the binary values $x_i$ by the eigenstates of Pauli $Z$ operator applied on the i th qubit:
$x_i = 0$ implies $z_i = 1$
$x_i = 1$ implies $z_i = -1$
Basis $|0\rangle$ is an eigenstate of Pauli $Z$ with respective eigenvalue +1 and basis $|1\rangle$ is an eigenstate of Pauli $Z$ with an eigenvalue -1.
Therefore, we replace $x_i$ by $(1-z_i)/2$ .
I have this setup, and I find it difficult to implement the QAOA circuit to solve this problem. Also explain the way QAOA would work in this setting. Can somebody help me with this ?
I even studied QAOA to come up with the following circuit formulation:
$$H(t) = tbH_A + (1-t)H_B\\
U(t_0) = U(H_A,\beta_0)U(H_B,\gamma_0).$$
Iteratively we have;
$$U = U(H_A,\beta_0)U(H_B,\gamma_0)\dots U(H_B,\beta_p)U(H_B,\gamma_p).$$
Please correct me if I am wrong.
"
"['quantum-operation', 'information-theory', 'communication']"," Title: Tradeoff between error and rates of quantum communicationBody: Suppose Alice and Bob share $n$ copies of a noiseless quantum channel $I_{A\rightarrow B}$ which can be used to send quantum states and $H_A\cong H_B$ i.e. the input and output Hilbert spaces are the same dimension, $d$. For simplicity, we can assume that $d=2$ so we are dealing with transmitting qubits.
Suppose there exists a protocol that uses $I^{\otimes n}_{A\rightarrow B}$ (and possibly other no-signaling resources such as shared entanglement) to simulate $I_{A\rightarrow B}^{\otimes m}$, where $m>n$ but this simulation occurs with some error $\varepsilon\in (0,1)$.
What theorem in quantum information, if any, bounds achievable $\varepsilon$? It seems natural that the case of $\varepsilon = 0$ is definitely out of the question since otherwise, we could simply repeat the process and communicate arbitrary amounts of information starting with just a few perfect channels. I am not sure about the case where we allow $\varepsilon\in (0,1)$.
"
"['quantum-state', 'tomography']"," Title: $\mu$ matrix construction for quantum state tomographyBody: In the paper Maximum Likelihood, Minimum Effort, given an orthonormal Hermitian operator basis $\{\sigma_i\}_{i=1}^{d^2}$ of $d \times d$ matrices and a set of measured values $m_{ij}$ corresponding to the $j$th measurement of the expectation value $\sigma_i$ applied to the true state $\rho_0$, the authors give the definition of a matrix $\mu$ as
$$
\mu = \frac{1}{d}\sum_i m_i\sigma_i,
$$
where $m_i = \sum_{j=1}^n \frac{m_{ij}}{n}$ and $n$ is the number of measurements. After defining this matrix, further optimization is done to approximate the density matrix of the true state.
I'm trying to implement this procedure for a single qubit as follows.
- To get $m_i$, I am first measuring the true state in the $X$, $Y$, $Z$ bases. With the counts for each circuit, I'm running the following code:
m = 0
try:
m += count['0'] # measurement of |0> has eigenvalue of +1
except:
pass
try:
m -= count['1'] # measurement of |1> has eigenvalue of -1
except:
pass
m /= shots
- Using the respective $m_i$, I'm calculating the matrix $\mu$ according to the formula as (where
ms is a list with the three values calculated in step 1):
mu = (ms[0] * Z + ms[1] * X + ms[2] * Y) / 3.
However, after inputing the resulting matrix through the Fast algorithm for Subproblem 1 described later on in the paper, I'm not getting the expected results as I always get all the eigenvalues $\lambda_i$ set to $0$. I don't think there is any problem in my implementation of the Fast algorithm for Subproblem 1 as I tested it with the values given in Figure 1 of the same paper and I got the expected results.
Therefore, I suspect there is something wrong in my calculation of the matrix $\mu$. Is there something I'm missing or interpreted incorrectly?
"
['notation']," Title: Elementary question: is $\langle a|b \rangle$ the same as $\langle a||b\rangle$?Body: In trying to learn more about quantum computing, one of the first things encountered is a definition of the inner product $\langle a|b\rangle$. If I interpret it correctly, and looking near the bottom of page 15 of the 2011 book by Rieffel and Polak, this notation is shorthand for writing $\langle a||b\rangle$. Is that correct, or is my understanding flawed?
It may seem as though it is obvious (or obviously wrong), but so far I have found it strangely rare to see this explicitly stated. I would welcome some confirmation or correction.
"
"['quantum-gate', 'algorithm', 'oracles']"," Title: Can we use reversible computation to construct oracle circuits?Body: One of the question while I discussed with my colleague in the math department was the construction of oracle circuit.
In computer science, specifically in algorithm, we take oracle as granted and treat it as a black box to analyze our problem.
However, he raised the question that given the oracle function, can the circuit be constructed in a reversible way; namely, unitary oracle common in well-known algorithm. He thought that the input may be subjected to phase kickback.
My question is given the oracle function. Can’t we use the reversible computation defined in classical computer to construct this oracle circuit?
"
"['algorithm', 'circuit-construction', 'quantum-circuit', 'cirq', 'tfq']"," Title: Quantum Circuits for Time-Series DataBody: I am currently working with a dataset with autocorrelated features, i.e, x(t) affects the value of x(t+1) which affects the value of x(t+2).
Suppose this is the circuit representing x(t):
Does stacking x(t), x(t+1), x(t+2) in parallel make more sense or should they be stacked in series, or perhaps something entirely different might make more sense?
My intuition tells me that stacking them in series to have each time-step of a feature on the same wire is the best approach, but I would love to hear thoughts on this.
"
"['programming', 'quantum-gate', 'algorithm', 'cirq']"," Title: Does anyone have some references on EigenGate used in Google's cirq framework?Body: I am trying to understand the code below but can not find any references other than the code itself.
https://github.com/quantumlib/Cirq/blob/v0.11.1/cirq-core/cirq/ops/eigen_gate.py
I am not clear about the physics pictures behind the eigengate. Any suggestions are appreciated!
"
"['quantum-gate', 'simulation']"," Title: Accuracy of rotational gates on IBM QuantumBody: As a computer memory is finite, it seems reasonable to assume that a rotational angle of gates $Rx$, $Ry$ and $Rz$ (and $U1$, $U2$ and $U3$ gates as well) has some smallest step which can be distinguished (e.g. in change of an outcome probability distribution). I would also expect that on a simulator, the step is smaller than on a real quantum processor because the processors are still far from an ideal.
So, my question is what is the minimum step in the rotational angle which can be distinguished on IBM Quantum processors? Is the step on simulator smaller than on a real quantum processor?
Any reference do paper or link is appreciated.
"
"['programming', 'qiskit', 'amazon-braket']"," Title: AWS Braket Backend for Qiskit?Body: Is there a working AWS Braket backend provider for Qiskit 0.29 that can be used with the MinimumEigenOptimizer interface? The qiskit-aws-braket-provider package is unfortunately not working.
"
"['measurement', 'tomography', 'shadow-tomography']"," Title: Why is the complexity of $n$-qubit state tomography not upper bounded as $O(3^n)$?Body: Consider the task of fully determining an $n$-qubit state $\rho$ which can be written as
\begin{equation}\tag{1}
\rho = \sum_{p \in \{I, X, Y, Z\}^n} \text{Tr}(\rho P_{p}) P_{p}
\end{equation}
and each $P_{p} = P_{p_1} \otimes \dots \otimes P_{p_n}$ is a tensor product of Pauli matrices. This suggests that I could perform state tomography evaluate each expectation value $\langle P_p \rangle = \text{Tr}(\rho P_p)$. I would plan on having $3^n$ distinct experimental configurations, one for each combination of local measurement bases $\{X, Y, Z\}^n$.
I thought that the discrepancy between $3^n$ measurement configurations and $4^n-1$ coefficients needed to specify $(1)$ would be resolved because an expectation value of the form $\langle X \otimes I \otimes X \rangle$ could be computed using a marginal distribution over the bitstrings results from the experiment that measures $\langle X \otimes X \otimes X\rangle$ (or the experiments used to compute $\langle X \otimes Y \otimes X\rangle$ or $\langle X \otimes Z \otimes X\rangle$). So any experiment to determine a term $\text{Tr}(\rho P_p)$ Equation $(1)$ where $P_p$ contained an $I$ would be redundant with some other experiment. This is one of the features motivating the method of (Huang, 2021): If you instantiate Theorem 1 therein with $L=4^n$ and $w=n$, it asserts that $4^n$ many $\epsilon$-accurate estimators for Pauli expectation values can be computed in $M = O(n3^n / \epsilon^2)$ total experiments.
But when I look elsewhere in the literature (e.g. Franca, 2017) it suggests that for an arbitrary full-rank, $2^n$-dimensional state $\rho$ you do indeed need $\Omega(4^n)$ measurement configurations for quantum state tomography.
How do I resolve the discrepancy between these two scaling behaviors?
"
['qiskit']," Title: How can I prepare and measure spins in arbitrary directions in qiskit?Body: I'm just starting with Qiskit and I would like to reproduce basic results about spin measurements. For that I want to prepare multiple spins each in arbitrary directions and measure them in arbitrary directions to get the probabilities.
What is the suggested way to do that in Qiskit?
"
"['quantum-operation', 'kraus-representation', 'mutual-information']"," Title: How is $I(\rho^{QC})=I_{CC}(\rho^{QC})$Body: On page 3 of this paper, for the proof of theorem 1, it states that, using Lemma 2 from the previous page, that if $$I(\Lambda_{A}\otimes\Gamma_{B})[\rho]=I(\rho))$$ then there exists $\Lambda_{A}^{*}$ and $\Gamma_{B}^{*}$ s.t $$(\Lambda_{A}^{*}\otimes\Gamma_{B}^{*})\circ(\Lambda_{A}\otimes\Gamma_{B})[\rho]=\rho$$Using this, they show that $$\rho^{QC}=(M^{*}\otimes I)[\rho^{CC}]$$
where $$\rho^{CC}=(M\otimes N)[\rho]$$ with the assumption that $I(\rho^{CC})=I(\rho)$, so $M^{*}$ and $N^{*}$ exist.
However, they state that $I(\rho^{QC})=I_{CC}(\rho^{QC})=I_{CC}(\rho)=I(\rho)$
I understand the last equality fine. But how are they getting the second equality. $$(M\otimes N)\rho^{QC}=(M\otimes N) \circ (M^{*}\otimes I)[\rho^{CC}]=\sum_{ij}p_{ij}|i\rangle\langle i|\otimes N(|j\rangle\langle j|)$$ and so
$$\rho_{CC}^{QC}=\sum_{ij}p_{ij}|i\rangle\langle i|\otimes N(|j\rangle\langle j|)=(M\otimes N)\rho^{QC}$$ so $$(M^{*}\otimes N^{*}) \circ (M\otimes N)[\rho^{QC}]=\rho^{QC}$$ and so $$I_{CC}(\rho^{QC})=I(\rho^{QC})$$ But how do they get $I_{CC}(\rho^{QC})=I_{CC}(\rho)$
The only thing I can think of is $$(I \otimes N^{*}) \circ (I \otimes N)[\rho_{CC}]=\rho_{CC}$$ which should mean that $I(\rho_{CC}^{QC})=I_{CC}(\rho)$, but I am not sure if this reasoning is correct.
Edit: $\Lambda$, $\Gamma$, $M$, $M^{*}$, $N$ and $N^{*}$ are all quantum maps. $M$ and $N$ are local quantum-to-classical measurement maps. CC and QC, per the paper, mean the classical-classical and quantum-classical states resulting from the application of the maps.
"
"['qiskit', 'optimization', 'quantum-computing-for-finance']"," Title: Qiskit Portfolio OptimizationBody: After running this code:
I have an error:
KeyError Traceback (most recent call last) ~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance) 3079 try: -> 3080 return self._engine.get_loc(casted_key) 3081 except KeyError as err:
pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: (0, 0)
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last) in 3 penalty = num_assets # set parameter to scale the budget penalty term 4 ----> 5 qubitOp, offset = portfolio.get_operator(mu, sigma, q, budget, penalty) 6 print (qubitOp, offset)
~\anaconda3\lib\site-packages\qiskit\finance\applications\ising\portfolio.py in get_operator(mu, sigma, q, budget, penalty) 80 zp[j_] = True 81 pauli_list.append([2 * sigma_z[i_, j_], Pauli((zp, xp))]) ---> 82 offset += sigma_z[i_, i_] 83 84 return WeightedPauliOperator(paulis=pauli_list), offset
~\anaconda3\lib\site-packages\pandas\core\frame.py in getitem(self, key) 3022 if self.columns.nlevels > 1: 3023 return self._getitem_multilevel(key) -> 3024 indexer = self.columns.get_loc(key) 3025 if is_integer(indexer): 3026 indexer = [indexer]
~\anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance) 3080 return self._engine.get_loc(casted_key) 3081 except KeyError as err: -> 3082 raise KeyError(key) from err 3083 3084 if tolerance is not None:
KeyError: (0, 0)
Anyone know how to fix it?
"
"['algorithm', 'mathematics', 'physical-realization']"," Title: What is the justification for the use of this arbitrary post-processing vector?Body: I am reading through this paper which describes the use of a post-processing vector $\vec{c}$ with elements having values of $(-1,0,1)$. In equation 3 they give their solution as a linear combination of the measurement probabilities $\vec{p}$ with the post-processing vector $\vec{c}$. They justify this with the following:
"The measurement results give rise to an outcome probability vector $\vec{p} = (p_1,...,p_l,...)$. The desired output might be one of these probabilities $p_l$, or it might be some simple function of these probabilities. Hence, we allow for some simple classical post-processing of $\vec{p}$ in order to reveal the desired output."
It seems to me that they justify the use of $\vec{c}$ because it corrects the sign of the outcome probabilities. However, I am not satisfied with this explanation. I do believe that it is correct, but can someone provide a better justification for the use of this seemingly arbitrary post-processing method? Additionally, do you think there exists a derivation for how they arrive at the specific post-processing vector? Or, have they arrived at it empirically?
"
['error-correction']," Title: How can surface codes perform splitting and merging at the same time when they implement logical CNOT operationBody: Using lattice surgery technique, CNOT operation can be implemented as follows.
- step 1. smooth merging between the control qubit and intermediate qubit
- step 2. smooth splitting the merged qubit above
- step 3. rough merging between the intermediate qubit and target qubit.
Steps 2 and 3 can be performed at the same time. Therefore, we can implement CNOT in $2d$ ($d$ is a distance) QEC cycles($d$ for smooth merging and $d$ for smooth splitting and rough merging at the same time).
I understood the bold sentence as follows: whether smooth operation on step 2 and merging operation on step 3 is performed first, the CNOT can be performed.
But when we assume rough merging is performed first and smooth splitting after then, the result is $a_1(a_2|00\rangle+b_2|11\rangle)+b_1(a_2|11\rangle+b_2|00\rangle)$ which is not CNOT operation. Note that control qubit state is $a_1|0\rangle+b_1|0\rangle$ and target qubit state is $a_2|0\rangle+b_2|0\rangle$.
So I think we should first perform smooth splitting and after $d$ cycle error correction, and then perform rough merging.
How CNOT can be performed in $2d$ error correction cycle and how can merging and splitting be performed at the same time?
"
"['correlations', 'quantum-discord']"," Title: Quantum discord of a tripartite system A:BCBody: I know that the quantum discord of a bipartite system can be determined as:
$${D_A}({\rho _{AB}}) = I({\rho _{AB}}) - {J_A}({\rho _{AB}}),$$
The subscript of $A$ denotes that the measurement has been performed on the subsystem $A$. The quantum mutual information is defined by:
$$I({\rho _{AB}}) = S({\rho _A}) + S({\rho _B}) - S({\rho _{AB}}),$$
and the classical correlation:
$${J_A}({\rho _{AB}}) = S({\rho _B}) - \mathop {\min }\limits_{\{ \Pi _I^A\} } \sum\limits_i {{p_i}S({\rho _{\left. B \right|i}})} ,$$
$$S({\rho _{\left. B \right|i}}) = {1 \over {{p_i}}}t{r_A}\left( {\Pi _i^A \otimes {I_B}} \right){\rho _{AB}}\left( {\Pi _i^A \otimes {I_B}} \right)$$
The question is, in the case of a tripartite state, how can someone compute the quantum discord between $A$ and $BC$ as a whole? i.e., ${D_A}({\rho _{A:BC}})$ when the measurement is performed on the subsystem $A$? What will ${D_A}({\rho _{A:BC}})$ and ${J_A}({\rho _{A:BC}})$ look like??
"
"['ibm-q-experience', 'google-sycamore']"," Title: What is the basic hardware gate library in the IBM & google?Body: I need to know what is the basic hardware gate library in hardware IBM and Google? I mean, which one of the gates can be implemented directly in the hardware. I would be very grateful if everyone helps me.
"
['terminology']," Title: Terminology - ""Multi-controlled gate"": ""multiply"" or ""multiple""Body: I have a slight notation question on what the "multi" in "multi-controlled" actually stands for. These two published papers are conflicting on whether it means "mutiply" or "multiple". This is a seemingly current issue with two papers posted on arxiv in July of 2021 having different expansions: "mutiply" current paper and "multiple" current paper.
Does anyone know if there is a correct way to write this? I feel as if "multiple controlled" makes more sense, but after seeing many of the conflicting papers, I am not too sure.
"
"['physical-qubit', 'architecture', 'superconducting-quantum-computing', 'optical-quantum-computing']"," Title: What are the pros and cons of the most popular QC architectures?Body: I notice numerous companies and research groups around the world trying to build QC's with wildly different approaches. Intuitively, this suggests to me that QC is still very early in its maturation - we are far from certain as to how to actually build one. I see groups using ultracold gases, solid state qubits, etc etc.
Could someone offer a high level overview of the pros and cons of the following approaches:
- Superconducting qubits
- Solid-State qubits (using Quantum Dots)
- Ion trapping
- Neutral atom trapping
Why is say, Google or Amazon, so intent on investing in superconducting based QCs while Mikhail Lukin or ColdQuanta spend millions on neutral rydberg atoms while Silicon Quantum Computing in Australia is using Quantum Dots? If I've missed important "paradigms" or architectures, don't hesitate to include them in your answer.
"
"['error-correction', 'information-theory', 'stabilizer-code']"," Title: How to translate performance of two classical codes to a quantum CSS code?Body: I have a database of classical codes with simulation results in binary symmetric channel (BSC).
The codes are defined by their parity check matrices $H$. I can pick pairs of codes and call them $H_x$ and $H_z$; if $H_x H_z^T=0$ then these two classical codes define a quantum CSS code.
I already have the simulation results in this form : for every BSC crossover probability $p_{\text{BSC}}$ I have the probability that the decoded codeword is in the classical codespace or not; this is just checking the decoded word syndrome : if $r$=decoded(codeword + BSC noise) then I have the probability of $P_x = P(r H_x^T \neq 0)$ and $P_z=P(r H_z^T \neq 0)$.
So now I have two functions $P_x(p_{BSC})$ and $P_z(p_{BSC})$. I should be able to translate these two curves to the performance of the quantum CSS code but I'm finding it much harder than it should be. A lot of papers are not precise enough about what they mean by "physical failure rate" $p_{fail}$ or "logical error rate" $p_L$; so it's hard to compare against published results. We can pick the depolarizing channel for the quantum code to make things more concrete. If I can translate $p_{BSC}, P_x, P_z$ to $p_{fail}, p_L$ then I can calculate the quantum code threshold by solving for $p_{fail}=p_L$.
"
"['fidelity', 'no-cloning-theorem', 'cloning']"," Title: Approximate CloningBody: Question
Consider two single qubit states $\left\{|\alpha_0\rangle,|\alpha_1\rangle\right\}$ which are not orthogonal or parallel, i.e. $\left|\langle\alpha_0|\alpha_1\rangle\right|\ne0,1$. Additionally, consider the unitary operation: $U|\alpha_i\rangle|0\rangle=|c_{ii}\rangle\forall i\in\left\{0,1\right\}$; where we want $|c_{ii}\rangle$ to approximate $|\alpha_i\rangle|\alpha_i\rangle$, i.e. approximate cloning - note that $|c_{ii}\rangle\ne|\alpha_i\rangle|\alpha_i\rangle\forall i$ due to the no-cloning theorem. We can define the fidelity $F_i\equiv\left|\langle\alpha_i|\langle\alpha_i|c_{ii}\rangle\right|^2$ as a measure of the quality of the approximation such that the best approximation is given by maximising $F_i$ with respect to $|c_{ii}\rangle$ subject to the following constraints:
- $|c_{ii}\rangle\in\operatorname{span}\left\{|\alpha_j\rangle|\alpha_j\rangle\right\}$
- $|\alpha_i\rangle|0\rangle\to|c_{ii}\rangle\forall i$ is unitary $\iff\langle\alpha_i|\alpha_j\rangle=\langle c_{ii}|c_{jj}\rangle\forall i,j$
- $F=F_0=F_1$
Contraint 1 allows us to express:
$$|c_{ii}\rangle\equiv\sum_ja_{ji}|\alpha_j\rangle|\alpha_j\rangle$$
Now if we let $A_{ij}=\langle\alpha_i|\alpha_j\rangle$ then constraint 2 can be expressed as:
$$\boldsymbol A=\boldsymbol a^\dagger\boldsymbol A^{\circ 2}\boldsymbol a$$
where $\boldsymbol A^{\circ 2}$ is the Hadamard power i.e. $\left[\boldsymbol A^{\circ 2}\right]_{ij}\equiv A_{ij}^2$. In this notation we can also express $F_i=\left|\left[\boldsymbol A\boldsymbol a\right]_{ii}\right|^2$.
We have already applied constraint 1 in the notation used leaving both constraints 2 and 3 to be applied.
As far as I see the problem of finding the values of $|c_{ii}\rangle$ that maximise $F$ from here can then be solved in one of three ways - each of which I have tried with no luck. I would be very grateful if someone was able to outline a solution for complex $\boldsymbol a\in\mathbb C^{2\times2}$. However, if no elegant solution for $\boldsymbol a\in\mathbb C^{2\times2}$ then a solution for $\boldsymbol a\in\mathbb R^{2\times2}$ where $|\alpha_i\rangle$ can be expressed in terms of $|0\rangle$ and $|1\rangle$ with only real coefficients would suffice to be accepted as the correct answer. I know there should be an elegant solution for $\boldsymbol a\in\mathbb R^{2\times2}$ as this was what was asked on a problem sheet I have been using for some self-learning, but I am interested in the more general solution $\boldsymbol a\in\mathbb C^{2\times2}$ if possible.
Finally, while I am an avid StackExchange user, this is my first post on Quantum Computing StackExchange and so I apologise if I have broken any site-specific rules and please do let me know. Additionally, if the moderators feel this is more appropriate for either Physics or Maths SE do migrate.
Attempts
Below I will outline three of my attempted methods in case these are of any help.
$\boldsymbol a\in\mathbb C^{2\times2}$ has 8 degrees of freedom, but as $F_i$ is independent of an overall phase factor the degrees of freedom reduce to 7 and we can express:
$$\boldsymbol a\equiv a\begin{bmatrix}1&be^{i\beta}\\ce^{i\gamma}&de^{i\delta}\end{bmatrix}$$
Using the method of Lagrange multipliers with a matrix constraint we must maximise:
$$L_i\equiv\left|\left[\boldsymbol A\boldsymbol a\right]_{ii}\right|^2+\operatorname{Tr}\left(\boldsymbol \mu\left[\boldsymbol A-\boldsymbol a^\dagger\boldsymbol A^{\circ 2}\boldsymbol a\right]\right)+\lambda\left(\left|\left[\boldsymbol A\boldsymbol a\right]_{ii}\right|^2-\left|\left[\boldsymbol A\boldsymbol a\right]_{\overline{ii}}\right|^2\right)\quad\forall i$$
where $\boldsymbol\mu\in\mathbb C^{2\times2}$ and $\lambda\in\mathbb C$ are the lagrange multipliers; and $\overline i\equiv\begin{cases}0,&i=1\\1,&i=0\end{cases}$. Thus,
$$\text{d}L_i=\left(1+\lambda\right)\left(\vec\pi_i^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{A\text{d}a}\vec\pi_i+\vec\pi_i^\dagger\text{d}\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{Aa}\vec\pi_i\right)-\operatorname{Tr}\left(\boldsymbol{\mu a}^\dagger\boldsymbol A^{\circ2}\text{d}\boldsymbol a\right)-\operatorname{Tr}\left(\text{d}\boldsymbol a^\dagger\boldsymbol A^{\circ2}\boldsymbol{a\mu}\right)-\lambda\left(\vec\pi_\overline{i}^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_\overline{i}\vec\pi_\overline{i}^\dagger\boldsymbol{A\text{d}a}\vec\pi_\overline{i}+\vec\pi_\overline{i}^\dagger\text{d}\boldsymbol a^\dagger\boldsymbol A\vec\pi_\overline{i}\vec\pi_\overline{i}^\dagger\boldsymbol{Aa}\vec\pi_\overline{i}\right)$$
As $\left\{\text{d}\boldsymbol a\vec\pi_i,\vec\pi_i^\dagger\text{d}\boldsymbol a^\dagger\middle|\forall i\right\}$ are independent variables and $\operatorname{Tr}\left(\boldsymbol M\right)\equiv\sum_i\vec\pi_i^\dagger\boldsymbol M\vec\pi_i$ then for $\text{d}L_i=0$ the simultaneous equations are:
$$\begin{cases}\left(\delta_{ij}\left(1+2\lambda\right)-\lambda\right)\vec\pi_i^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol A-\pi_i^\dagger\boldsymbol{\mu a}^\dagger\boldsymbol A^{\circ2}=0&\forall i,j\\\left(\delta_{ij}\left(1+2\lambda\right)-\lambda\right)\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{Aa}\vec\pi_i-\boldsymbol A^{\circ2}\boldsymbol{a\mu}\vec\pi_i=0&\forall i,j\\\vec\pi_i^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{A\text{d}a}\vec\pi_i=F&\forall i\\\boldsymbol A=\boldsymbol a^\dagger\boldsymbol A^{\circ 2}\boldsymbol a\end{cases}$$
This gives $\lambda=-\frac{1}{2}$ and so:
$$\begin{cases}\frac{1}{2}\vec\pi_i^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol A-\pi_i^\dagger\boldsymbol{\mu a}^\dagger\boldsymbol A^{\circ2}=0&\forall i\\\frac{1}{2}\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{Aa}\vec\pi_i-\boldsymbol A^{\circ2}\boldsymbol{a\mu}\vec\pi_i=0&\forall i\\\vec\pi_i^\dagger\boldsymbol a^\dagger\boldsymbol A\vec\pi_i\vec\pi_i^\dagger\boldsymbol{A\text{d}a}\vec\pi_i=F&\forall i\\\boldsymbol A=\boldsymbol a^\dagger\boldsymbol A^{\circ 2}\boldsymbol a\end{cases}$$
Then we can easily see that $F=\vec\pi_i^\dagger\boldsymbol{A\mu}\vec\pi_i=\vec\pi_i^\dagger\boldsymbol{\mu A}\vec\pi_i$ for all $i$. However, I do not know how I would proceed further than this.
Another approach would be to use constraint 3 to reduce the degrees of freedom to 6 by showing:
$$de^{i\delta}=-\alpha^*be^{i\beta}+\left|1+\alpha ce^{i\gamma}\right|e^{i\epsilon}$$
where $\alpha\equiv\langle\alpha_0|\alpha_1\rangle$. Now our remaining degrees of freedom are $\left\{a,b,c,\beta,\gamma,\epsilon\right\}$ and we need only maximise:
$$L_i'\equiv\left|\left[\boldsymbol A\boldsymbol a\right]_{ii}\right|^2+\operatorname{Tr}\left(\boldsymbol \mu\left[\boldsymbol A-\boldsymbol a^\dagger\boldsymbol A^{\circ 2}\boldsymbol a\right]\right)\quad\forall i$$
I won't write out the resulting simultaneous equations again as this time they are more involved as the reduction in degrees of freedom means $\left\{\text{d}\boldsymbol a\vec\pi_i,\vec\pi_i^\dagger\text{d}\boldsymbol a^\dagger\middle|\forall i\right\}$ are not all independent degrees of freedom.
Or finally, we could apply both constraints 2 and 3 before maximising; however, I have not managed to navigate my way through the swamp of simultaneous equations for this but in this case, we now only need to maximise $F$ with respect to the remaining degrees of freedom.
Now I have in all three cases managed to find the conditions under which these are maximised; however, I then have been struggling to solve the resulting simultaneous equations.
"
"['physical-realization', 'google-sycamore', 'quantum-memory']"," Title: How can time crystals be useful in qRAM design?Body: A time crystal is a phase of a matter which is ordered in time, similar to classical crystals which are ordered spatially. In other words, the structure of a time crystal is ever-changing but with some period. In fact, time crystals are quantum systems whose ground states are characterized by periodic motion (so-called non-equilibrium matter), e.g. periodically changing spins in a chain of ions. See more for example here and on Wiki.
Time crystals were proposed in 2012 by Frank Wilczek as a theoretical concept, however, later their existence was proved (see e.g. references on Wiki page). In July 2021, Google claimed that its team prepared the time crystal on Sycamore processor, see the paper Observation of Time-Crystalline Eigenstate Order on a Quantum Processor.
In many articles on time crystals, I see a statement that time crystals can help to design quantum memories (qRAM). I can imagine that the periodic time change can help somehow increase decoherence times which are low in current qRAMs. However, I was not able to find any details on how time crystals can actually help in qRAM design. Could anybody shed more light on this?
Additional question to Google's claim - did they really prepare the time crystal or rather did they simulate a quantum system behaving like the time crystal?
Cross-posted on Physics.SE
EDIT: Just one idea, how time crystals can be used in qRAM. A ground state of a time crystal is characterized by a periodic oscillations. Such oscillations have an amplitude $A$, frequency $f$ and phase $\varphi$. A general qubit state is $\cos(\theta/2)|0\rangle + \sin(\theta/2)\mathrm{e}^{i\varphi}|1\rangle$. If we were able to set amplitude $A = \cos(\theta/2)$ and phase $\varphi$ of the time crystal ground state, we would be able to represent the qubit with the crystal. Since the crystal is in its ground state, it should stay so for very long time. As a result, decoherence time would be elongated significantly. Of course, the crystal is still prone to noise as for example radioactive background can change the crystal state. Hope this is not non-sense.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'tensor-product']"," Title: Confusion regarding the tensor product usage in bookBody: I have recently started with quantum computing, and I've found great book about it - Learn Quantum Computing with IBM Quantum Experience, which explains a lot of things in quite a simple language. There is a section on multi-qubit systems that explains a tensor product and gives few examples.
The book states that:
$$|\Psi\rangle= |\psi\rangle \otimes|\phi\rangle = (\alpha_0 |0\rangle+\alpha_1 |1\rangle)\otimes(\beta_0 |0\rangle+\beta_1 |1\rangle) $$
This operation results in the vector:
$$\begin{pmatrix}\alpha_0\beta_0\\ \alpha_0\beta_1\\ \alpha_1\beta_0\\ \alpha_1\beta_1\\\end{pmatrix}$$
Finally, another way to state multi-qubits by their tensor product is by representing them
with their product state. We'll use the same
two-vector example described previously. The first is the $|00\rangle$ state:
$$|00\rangle = \begin{pmatrix}1\\0\end{pmatrix}\otimes\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\\0\\0\end{pmatrix}$$
Now it is the last equation I've a problem with. When I looked up tensor product on the Internet, everywhere it is showed that if we "tensor-multiply" 2 vectors of length $m$ and $n$, then we get a matrix of size $m \times n$, but I am getting a vector of size $4\times1$ . Am I interpreting the result wrongly, in the sense that it is not the tensor product, or that the tensor product can have different meanings or definitions?
"
"['programming', 'qiskit', 'ibm-q-experience', 'qasm']"," Title: Simulating OpenQASM 2.0 in Qiskit?Body: I'm just getting started with OpenQASM, but I'm feeling a bit confused. Is there a way to run the .qasm file I've written in Qiskit (i.e. in Python), or is OpenQasm only meant to be used within the IBM Quantum experience?
"
"['textbook-and-exercises', 'quantum-operation', 'kraus-representation']"," Title: Is a quantum channel reversible if all Kraus operators are proportional to unitaries?Body: In preskill's online lecture p.13, he stated that if a channel is reversible, i.e., $\varepsilon^{-1}\circ\varepsilon(\rho)=\rho$ for any $\rho$, then the kraus operator of the quantum channel must be proportional to unitary operator. I know the reverse might not be true, but take dephasing channel as an example, the kraus operators of the dephasing channel are:
$$
E_1=\sqrt{p}I \\
E_2=\sqrt{1-p}Z,
$$
where $Z$ stands for pauli operator. So, does this quantum channel reversible, since both $I$ and $Z$ are unitary?
"
"['information-theory', 'teleportation', 'communication', 'channel-capacity']"," Title: Optimality of teleportation for entanglement-assisted quantum channel codingBody: Setting:
Consider a quantum channel $N_{A\rightarrow B}$ between Alice and Bob. Let Alice and Bob also share arbitrary amounts of entanglement assistance through the state $\phi_{A_EB_E}$ (these can be many copies of maximally entangled states or more generally, whatever state Alice and Bob want). We will examine channel coding in the one-shot regime.
The goal is to transfer the $A'$ register of some pure quantum state $\psi_{RA'}$ through this channel. Here $R$ is an inaccessible purifying register. Let there be an encoder $E_{A_EA'\rightarrow A}$ and decoder $D_{B_EB\rightarrow B'}$. Let
$$(I_{R}\otimes D\circ N\circ E)(\psi_{RA'} \otimes \phi_{A_EB_E}) = \rho_{RB'}$$
Our criterion for success is $\inf_{\psi_{RA'}}F(\rho_{RB'}, \psi_{RA'})$ where we optimize over all encoder decoder pairs and then find the "worst-case" state $\psi_{RA'}$.
One possible protocol:
One way to transmit a quantum state given arbitrary entanglement assistance is through teleportation. Hence, Alice and Bob should try and teleport the state $\psi_{RA'}$ and only use the channel to send the classical information that is part of the teleportation protocol. If the worst-case error caused by the channel in transmitting $2|A'|$ bits of classical information is $\varepsilon$, then we can apply the teleportation protocol for $\psi_{RA'}$ and the teleported state is
$$(1-\varepsilon)\vert\psi_{RA'}\rangle\langle\psi_{RA'}\vert + \varepsilon\vert\psi_{RA'}^\perp\rangle\langle\psi_{RA'}^\perp\vert$$
The worst case fidelity is then $\sqrt{1-\varepsilon}$.
Question:
Is this teleportation-based protocol optimal and if yes, why? Or is there a better encoder decoder pair that could achieve a better fidelity given the assumption that using entanglement assistance and the channel, one can transmit at most $2|A'|$ bits with error $\varepsilon$?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Cannot get a provider from IBMQBody: My code is:
from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')
qcomp = provider.get_backend('ibmq_16_melbourne')
but I run it in Jupyter I get the following message
QiskitBackendNotFoundError Traceback
(most recent call last)
<ipython-input-6-f874d37829a9> in <module>
2 IBMQ.load_account()
3 provider = IBMQ.get_provider('ibm-q')
----> 4 qcomp =
provider.get_backend('ibmq_16_melbourne')
~\anaconda3\lib\sitepackages\qiskit\providers
\providers\provider.py in get_backend(self, name,
**kwargs)
53 raise
QiskitBackendNotFoundError("More than one backend
matches the criteria")
54 if not backends:
---> 55 raise
QiskitBackendNotFoundError("No backend matches the
criteria")
56
57 return backends[0]
QiskitBackendNotFoundError: 'No backend matches the
criteria'
I have already made an account at IBM, and have already seen the post (Trying to get a provider from IBMQ but get 'No provider matches the criteria.'), but the problem still exists.
"
"['optimization', 'qaoa']"," Title: How can a Mixer Hamiltonian restrict the search within a subspace of the statespace in QAOA?Body: I understand that the role of the Mixer Hamiltonian prevents the creation of a constant function where there is nothing to be minimized.
I would like to understand from a mathematical perspective how the Mixer Hamiltonian controls the evolution in the statespace to include other states, as well as how with a particular choice of Mixer Hamiltonian, the search in the statespace is restricted to a chosen subspace.
Thanks!
"
"['programming', 'qiskit', 'ibm-q-experience', 'hhl-algorithm']"," Title: HHL - the result is correct for one matrix but wrong for another oneBody: I tried to run HHL algorithm in new version of Qiskit (0.29). Firstly I tried to solve a diagonal system 4x4 with matrix [[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]] and right side [1,4,0.5,3]. Clearly, the solution is [1, 2, 0.1667, 0.75]. In this case, everything was according to the expectation. Then I switched to matrix [[-1,2,0,0],[2,-1,2,0],[0,2,-1,2],[0,0,2,-1]] with right side [1,1,1,1]. Expected solution is [0.2, 0.6, 0.6, 0.2], however [0.0988, 0.1083, 0.119, 0.0884] is returned.
There is no error during a code execution.
Here is my code:
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit, Aer, execute, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.quantum_info import Statevector
from qiskit.algorithms.linear_solvers.hhl import HHL
import numpy as np
import math as m
def dec2bin(decimal, bits): #auxiliary function for conversion dec to bin
b = bin(decimal)
b = b[2:len(b)]
while len(b) < bits:
b = '0' + b
return b
processor = Aer.backends(name='qasm_simulator')[0]
#1st linear system
matrix_A = np.array([[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]])
vector_b = np.array([1,4,0.5,3]) #x = [1, 2, 0.1667, 0.75]
#2nd linear system
#matrix_A = np.array([[-1,2,0,0],[2,-1,2,0],[0,2,-1,2],[0,0,2,-1]])
#vector_b = np.array([1,1,1,1]) #x = [0.2, 0.6, 0.6, 0.2]
n = len(matrix_A[2,:]) #number of variables (assuming n=2^k)
qubitsForResults = m.ceil(m.log(n,2)) #number of necessary qubits
bNorm = np.linalg.norm(vector_b) #norm of right-side
hhlSolver = HHL(quantum_instance = processor)
hhlCircuit = hhlSolver.construct_circuit(matrix_A, vector_b) #preparing circuit in general form
circuitToRun = transpile(hhlCircuit,basis_gates=['id', 'rz', 'sx', 'x', 'cx']) #adapt circuit to real quantum processor
circuitToRun.measure_all() #add measurement
#execute the circuit
Shots = 8192
M = execute(circuitToRun, processor, shots = Shots).result().get_counts(circuitToRun)
usedQubits = circuitToRun.width()/2 #width - num of qubits and classical bit summed
zeros = dec2bin(0,usedQubits - qubitsForResults - 1) #working qubits
for i in range(0,n):
#ancilla qubit has to be |1>, working qubits |0>, results are in last "qubitsForResults" qubits
#e.g. if qubitsForResults and total qubits is 6, then 3 are working qubits
#results are stored in |1 000 00>, |1 000 01>, |1 000 10>, |1 000 11>
indx = '1' + zeros + dec2bin(i,qubitsForResults)
#bNorm*m.sqrt(M[indx]/Shots) - we need probability amplitudes => sqrt
#and adjust them by norm of vector b to get "unnormalized" solution x
print('x_' + str(i) + ': ' + str(round(bNorm*m.sqrt(M[indx]/Shots),4)))
Note that my code works only in case the solution of the system is real and non-negative.
Could anybody help me to understand where is a mistake?
EDIT:
I also tried to use matrix [[1,0,0,0],[0,2,0,0],[0,0,3.5,-0.5],[0,0,-0.5,3.5]] with right side [1 1 1 1], expected solution is [1 0.5 0.333 0.333]. In this case the code works fine. I prepared this matrix by a unitary transformation of $\text{diag}(1,2,3,4)$. As a result, eigenvalues of the matrix are 1, 2, 3 and 4. So, it seems that the code works correctly if the matrix of the linear system has interger eigenvalues. I observed similar behavior also for 2x2 matrices.
Is it possible that the errors are caused by lack of qubits used for eigenvalue approximation? In case of integer eigenvalues, there is no loss of accuracy if we have enough qubits. In this case the max. eigenvalue is 4 (100b), so three working qubits are sufficient.
EDIT 2:
I experimented further with 2x2 matrices and directly with state vector instead of probabilities. I found out that (note that right side is [1, 1.2]):
- if matrix is
[[1.5, 0.5],[0.5, 1.5]] then HHL returns correct result, note that eigenvalues of the matrix are 1 and 2
- for matrix
[[2.5, 1.5],[1.5, 2.5]] everything is also fine, eigenvalues are 4 and 1
- for matrix
[[2/3, -1/3],[-1/3, 2/3]] the results are wrong, eigenvalues are 1/3 and 1
- finally, for matrix
[[-0.5, -1.5],[-1.5, -0.5]] the result is (0.45, 0.65) but expected is (-0.65, -0.45), eigenvalues of the matrix are -2 and 1. Result (0.45, 0.65) is same as in case of matrix from the first bullet point with eigenvalues 1 and 2
To conclude, it seems that HHL works well only for matrices with positive integer eigenvalues.
I also had a look at the circuits prepared with HHL method and realized that number of working qubits is equivalent to $\log_2(\max\{|\lambda_i|\})$. There is no qubit for sign or additional qubits to represent fractional eigenvalues.
So, am I right that current HHL implementation in Qiskit is intended only for matrices with positive integer eigenvalues?
"
"['quantum-gate', 'unitarity']"," Title: Are anti-unitary gates possible?Body: According to Wigner’s theorem, every symmetry operation must be represented in quantum mechanics by an unitary or an anti-unitary operator. To see this, we can see that given any two states $|\psi\rangle$ and $|\psi'\rangle$, you would like to preserve
$$|\langle\psi|\psi\rangle'|^2=|\langle O\psi|O\psi \rangle'|^2 \tag{1}$$
under some transformation $O$. If $O$ is unitary, that works. Yet, we can verify that an anti-unitary $A$ operator such that
$$\langle A\psi| A\psi'\rangle= \langle\psi|\psi'\rangle^* ,\tag{2}$$
works too; where ${}^*$ is the complex conjugate. Note that I cannot write it as $\color{red}{\langle \psi| A^\dagger A|\psi\rangle'}$ as $A$ does not behave as usual unitary operators, it is only defined on kets $|A\psi\rangle=A|\psi\rangle$ not bras.
I was wondering if one could make an anti-unitary gate? Would that have any influence on what can be achieved with a quantum computer?
Example
I was thinking on some kind of time reversal gate $T$. The time reversal operator is the standard example of anti-unitarity.
As a qubit is a spin-1/2 like system, for a single qubit we need to perform
$$T=iYK\tag{3}$$
where $K$ is the complex conjugate. If you have an state
$$|\psi\rangle=a|0\rangle+b|1\rangle\tag{4}$$
then
$$K|\psi\rangle=a^*|0\rangle+b^*|1\rangle.\tag{5}$$
I do not think you can build the operator $K$ from the usual quantum gates without knowing the state of the qubit beforehand. The gate has to be tailored to the state of the qubit.
Experiments
I know now of one preprint Arrow of Time and its Reversal on IBM Quantum Computer (2018) where the authors claim to have achieved this on a IBM backend. But I do not know if their time reversal algorithm is the same as making an anti-unitary gate.
"
"['quantum-state', 'algorithm', 'probability']"," Title: How to prepare a quantum state of the form $\frac1{2^{n/2}}\sum_{x \in \{0, 1\}^{n}} |x\rangle |y_x\rangle$ with $y_x$ random variables?Body: Let's say I am given an efficiently samplable probability distribution $D$, over $n$ bit strings.
I want to efficiently prepare the following state
\begin{equation}
|\psi\rangle = \frac{1}{\sqrt{2^{n}}}\sum_{x \in \{0, 1\}^{n}} |x\rangle |y_x\rangle,
\end{equation}
where each $y_x$ is sampled from $D$ and the random variables $\{y_x : x \in \{0, 1\}^{n} \}$ are independent.
For simplicity, you can just take $D$ to be the uniform distribution.
Is this possible to do with a quantum computer?
"
"['programming', 'qiskit', 'openpulse']"," Title: How do I find the qubit trajectory on the Bloch sphere when implementing an RY rotation on an IBM backend?Body: Suppose I use Qiskit to prepare the $| + \rangle$ state using a RY rotation,
import numpy as np
from qiskit import QuantumCircuit
circ = QuantumCircuit(1)
circ.ry(np.pi / 2, 0)
I would like to know the Bloch sphere trajectory of the qubit on the physical level when I do this. Naively, I would expect that this is implemented as a rotation $\pi / 2$ rotation about the $Y$ axis which is the minimal distance path. But as I know, this circuit can be introspected in various ways.
For example, when I transpile the ciruit to the ibmq_armonk backend, I get the following circuit level description
which suggests that actually the qubit goes from $| 0 \rangle$ to the xy-plane at some angle $\pi / 4$ away from $+x$ and is then corrected with the final $RZ(\pi / 2)$.
I can then introspect even further at the pulse-level using the build_schedule utility obtained via from qiskit import schedule as build_schedule to obtain the description of the circuit as
Schedule((0, ShiftPhase(-1.5707963267948966, DriveChannel(0))), (0, Play(Drag(duration=320, amp=(0.3705139948561776-0.07637772314715083j), sigma=80, beta=-1.0562934233232557), DriveChannel(0))), (320, ShiftPhase(-4.71238898038469, DriveChannel(0))), name="circuit32")
Is there a way--from the pulse level description--to infer the time-dynamics of the state as I apply the RY rotation? It seems like I could possibly apply the DRAG pulse with half the amplitude, but
- I'm not sure how to simulate pulse schedules to get the output state
- I'm not sure that is sound since the DRAG pulse has a complicated definition.
In regards to (1), I tried the following code
backend_sim = qiskit.providers.aer.PulseSimulator()
backend_sim.set_options(system_model=backend.backend)
pulse_qobj = assemble(sched.sched, backend=backend_sim)
results = backend_sim.run(pulse_qobj)
by attempting to guess what system_model meant in this guide, but this didn't work. Note that backend.backend is just the armonk backend wrapped into a custom class and sched.sched is just a Schedule object with the DRAG pulse and measurement also wrapped into a custom class.
"
"['algorithm', 'trace']"," Title: Trace calculation from the basis to |+> and |-> statesBody: I was reading the paper; https://arxiv.org/abs/2002.00055
and going through some of the formulas below and I am a bit stuck between (1) and (2).
How the equation (1) turns into (2) is not clear to me.. Any point or help would be appreciated.
"
"['open-quantum-systems', 'master-equation']"," Title: What does ""generator"" mean in the master equation?Body: I seem to read a lot of times that some materials called this $\mathcal{L}$ in the equation(Lindblad master equation) below as the generator:
$$
\mathcal{L} \rho=-i[H, \rho]+\sum_{\alpha}\left(V_{\alpha} \rho V_{\alpha}^{\dagger}-\frac{1}{2}\left\{V_{\alpha}^{\dagger} V_{\alpha}, \rho\right\}\right).
$$
I only know the generator in group theory means the minimum component that can span the whole group by the multiplication action, but I can't see what does the generator there means?
"
"['quantum-operation', 'kraus-representation']"," Title: How does the invertibility of a quantum map reflect on its Kraus operators?Body: Consider a quantum map $\Phi\in\mathrm T(\mathcal X)$, that is, a linear operator $\Phi:\mathrm{Lin}(\mathcal X)\to\mathrm{Lin}(\mathcal X)$ for some finite-dimensional complex vector spaces $\mathcal X$.
In the specific case in which $\Phi$ is also completely positive and trace-preserving, we call it a quantum channel. One can show that a quantum channel is reversible, in the sense of there being another quantum channel $\Psi\in\mathrm T(\mathcal X)$ such that $\Phi\circ\Psi=\Psi\circ\Phi=\mathrm{Id}_{\cal X}$, iff it is a unitary/isometric channel, meaning $\Phi(X)=UXU^\dagger$ for some isometry $U:\mathcal X\to\mathcal X$.
More generally, I'll call a quantum map invertible if there is some other map $\Psi$ such that $\Phi\circ\Psi=\Psi\circ\Phi=\mathrm{Id}_{\cal X}$. The difference compared to the previous definition is that we don't impose further constraints on the inverse. In particular, $\Phi$ might be invertible, but its inverse not be a channel.
Consider for example channels of the form
$$\Phi_p(X)=p X + (1-p) \operatorname{Tr}(X)\frac{I_{\cal X}}{\dim\mathcal X}.$$
These can be written, with respect to an arbitrary orthogonal basis $\{\sigma_j\}_j\subset\mathrm{Herm}(\mathcal X)$ with $\operatorname{Tr}(\sigma_i\sigma_j)=\dim(\mathcal X)\delta_{ij}$,
$$\langle\sigma_i,\Phi_p(\sigma_j)\rangle = p \delta_{ij} + (1-p).$$
One can thus see that $\Phi_p$, as a linear map, has $\det(\Phi_p)=p^{d-1}(d-(d-1)p)$, with $d\equiv \dim(\mathcal X)$, and is thus invertible for all $p\neq0,\frac{d}{d-1}$ (although it is obviously not a channel unless $0\le p\le 1$).
Its inverse is
$$\Phi_p^{-1}(Y) = \left(\frac{p-1}{p}\right)\operatorname{Tr}(Y) \frac{I_{\mathcal X}}{\dim(\mathcal X)} + \frac{Y}{p}.$$
However, $\Phi_p^{-1}$ is not a channel for $p\in(0,1]$.
Is there a general way to predict the invertibility of a quantum map, for example based on its Kraus or Choi representations? Clearly, a naive way is to just write the linear map as a matrix in some basis and compute its determinant, but does this somehow translate nicely into some property in Choi or Kraus (or other) representations?
For a general (not CPTP) map, by "Kraus representation" I mean a decomposition of the form $\Phi(X)=\sum_a A_a X B_a^\dagger$ for some linear operators $A_a:\mathcal X\to\mathcal X$ and $B_a:\mathcal X\to\mathcal X$.
I suppose the question thus boils down to the following: given $\Phi(X)=\sum_a A_a X B_a^\dagger$, is there a nice enough way to write $\det(K(\Phi))$? Here $K(\Phi):\mathcal X\otimes\mathcal X\to\mathcal X\otimes\mathcal X$ is the natural representation of the channel, which can be seen to be writable as
$$K(\Phi) = \sum_a A_a\otimes \bar B_a.$$
"
"['programming', 'qiskit', 'quantum-gate']"," Title: How to design Multi qubit Controlled Z rotationsBody: I need some help in multi-qubit controlled -Z rotation.
Below is the qiskit code of triple controlled z rotation
def cccZ():
qc = QuantumCircuit(4)
qc.cp(pi/4, 0, 3)
qc.cx(0, 1)
qc.cp(-pi/4, 1, 3)
qc.cx(0, 1)
qc.cp(pi/4, 1, 3)
qc.cx(1, 2)
qc.cp(-pi/4, 2, 3)
qc.cx(0, 2)
qc.cp(pi/4, 2, 3)
qc.cx(1, 2)
qc.cp(-pi/4, 2, 3)
qc.cx(0, 2)
qc.cp(pi/4, 2, 3)
gate = qc.to_gate(label=' cccZ')
return gate
Please help me in modifying this code to hexa qubit z rotation? It would be really great if someone can explain its theory also. I am really struggling with random nature of quantum computing with no fixed pattern at all.
"
"['superposition', 'classical-quantum']"," Title: Understanding the association rule between classical to quantum data $|x\rangle=\frac{1}{|\vec x|_2}\sum_{i=1}^d x_i|i\rangle$Body: I've been reading the paper on Quantum Hopfield Networks by Rebentrost et al. and I'm not sure to quite understand the association rule they mention on page 2.
Here's what they say :
Consider any $d$-dimensional vector $\vec{x} = [x_1,x_2,...,x_d]^T$. We associate it to the pure state $|x\rangle$ of a $d$-level quantum system according to $\vec{x} \rightarrow |\vec{x}|_2 \phantom{a}|x\rangle$ where $|\vec{x}|_2$ is the $l_2$-notm of $\vec{x}$ and $|x\rangle$ is given by $$|x\rangle = \frac{1}{|\vec{x}|_2} \sum_{i=1}^d{x_i|i\rangle}$$
Usually, when I don't understand a rule like this one, I try an example I try to build my understanding from it.
So let $\vec{x} = [1,0,1]^T$. We have that $|\vec{x}_2| = \sqrt{2}$ and therefore $|x\rangle = \frac{1}{\sqrt{2}} \big( 1*|1\rangle + 0*|2\rangle + 1*|3\rangle \big)$ which doesn't make a lot of sense to me (in fact, usually when it comes to Quantum Computing, anything that deviates from the computational basis is confusing for me). From the way I see it, this is a quantum superposition. What I don't understand however, what kind of basis is this ?
Another way of phrasing this would be : How do I chose my initial vector such that the resulting vector from this association rule is in the computational basis?
"
"['textbook-and-exercises', 'notation']"," Title: What is the best notation to write pairs of one-qubit ket states?Body: I am working on coming up with practice problems for a QC course. I have a problem that considers two qubits as so:
$$|\psi_a\rangle = \alpha_a |0\rangle + \beta_a |1\rangle$$
$$|\psi_b\rangle = \alpha_b |0\rangle + \beta_b |1\rangle$$
But I found the alphas and betas combined with a's and b's very confusing. I was just wondering if there was a standard notation for this type of thing or any notation others have found easier to understand.
"
"['qiskit', 'quantum-gate', 'error-mitigation']"," Title: How to measure the error rate (or fidelity) of a particular gate (such a H, T) by QiskitBody: We know the calibration data of IBM's quantum devices can be retrieved through the randomized benchmarking method, which is included in Qiskit. However, the calibaration data about gates just gives the average error rate of all the single-qubit gates or two-qubit gates. If I want to get the error rate of a specific single qubit gate, such as H gate, what should I do? The randomized benchmarking method doesn't seem to work.
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: How to use the output state $\frac1{\sqrt2}(|0,f(0)\rangle+|1,f(1)\rangle)$ given by this quantum circuit?Body: In Nielsen and Chuang, for the following circuit that demonstrates quantum parallelism, I have the following question:
since the output state of the circuit is
$$\frac1{\sqrt2}(|0,f(0)\rangle+|1,f(1)\rangle).$$
How would we isolate the state of f(0) and f(1) from the state of 0 and 1 to get information that we want (state of f(0) and f(1))?
"
"['quantum-state', 'hadamard', 'superposition']"," Title: Derivation for the result of performing the Hadamard transform on $|0\rangle^{\otimes n}$ being $2^{-n/2}\sum_x|x\rangle$Body: It's said that the result of performing the Hadamard transform on n qubits initially in the all |0> state is
$$
\frac{1}{\sqrt{2^n}}\sum_x|x\rangle
$$
where the sum is over all possible values of x.
I'm confused about what is meant by "the sum is over all possible values of x", what is x? I also wonder why the normalization can be generalized to $\frac{1}{\sqrt{2^n}}$? What's the proof and intuition for this?
"
"['algorithm', 'deutsch-jozsa-algorithm']"," Title: Why would matter if $f(0)$ equals to $f(1)$ in Deutsch’s algorithm?Body: I have a question on the following quantum circuit implementing Deutsch’s algorithm
Why would matter if $f(0)$ equals to $f(1)$? Are they what changes the phase of the first qubit state from + to -? If so, how does it happen?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How can I add custom pulse gate to the Qiskit circuit?Body: I tried to make my pulse and get the pulse into the circuit. But it seems not working properly.
The code and the result are below.
Just change the 'x' to the 'h' (hadamard) with the same piecewise pulse, I get the result below.
I used same pulse but just the label of gate made different results. I think the pulse I made didn't link to the circuit.
How can I link the self-calibrated pulse to the circuit?
"
"['cryptography', 'oracles']"," Title: Is it possible to convert classical oracle to quantum ones?Body: If an attacker possesses a classical oracle, so she could apply chosen plain text attacks. Is there an easy way to reduce this oracle to quantum ones allowing her to make quantum chosen plain text attacks?
"
"['measurement', 'state-discrimination']"," Title: Are almost perfectly distinguishable ensembles almost orthogonal?Body: Let $\varepsilon>0$ and consider an ensemble of states $\{p_x\rho_x\}_{x\in X}$ and suppose there exists a measurement with POVM representation $\{M_x\}_{x\in X}$ such that
$$ \sum_{x\in X} p_x\operatorname{Tr} M_x\rho_x \geq 1-\varepsilon. $$
Does this imply the existence of another ensemble $\{q_x\sigma_x\}_{X\in X}$ of orthogonal states, that is $\sigma_x \perp \sigma_{x'}$ for all distinct $x,x'\in X$, such that
$$ \sum_{x\in X} \lVert p_x\rho_x - q_x\sigma_x\rVert_1 = \sum_{x\in X} \operatorname{Tr}\lvert p_x\rho_x - q_x\sigma_x\rvert_1 \leq O(\varepsilon).
$$
Intuitively, I like to think states are almost perfectly distinguishable, when they are almost orthogonal. Hence the conjecture.
Any help is appreciated!
"
"['programming', 'qiskit', 'quantum-state', 'ibm-q-experience']"," Title: Saving statevector on more than one location in a quantum circuit in QiskitBody: So, I'm fairly new to Qiskit, and I've been playing around and following the tutorials from the Qiskit textbook. However, there is one thing I fail to understand/implement: for a quantum circuit with multiple gates (e.g. 2-qubit circle, with a simple Hadamard acting on qubit 0 and, let's say, CNOT acting on qubit 1 (controlled by qubit 0)) is it possible somehow to save statevectors more than once, in order to see intermediate state of the system?
Below you can see the code idea:
q1 = QuantumCircuit(2)
q1.save_statevector() # Save initial state
q1.h(0)
q1.save_statevector() # Save state after Hadamard
q1.cx(0, 1)
q1.save_statevector() # Save state after CNOT (also a final state)
job = execute(q1, backend=Aer.get_backend('aer_simulator'), shots=1024)
statevectors = job.result().get_statevector()
However, if I were to try and run this, an error occurs upon reaching execute command.
If anyone can provide any insight on this, I would be very grateful.
"
['qudit']," Title: Uniformly distributed state in the Weyl basisBody: The Weyl basis (also known as Weyl-Heisenberg) is an orthonormal, unitary, and non-Hermitian basis for the Hilbert space of dimension $d$. The basis elements are given by
$$ U_{ab} = \sqrt{\omega^{ab}}X^aZ^b, $$
where $X,Z$ are the shift and clock matrices and $\omega = e^{i2\pi/d}$. I'm wondering whether for all $d$ there exists a pure state $|\psi\rangle$ such that $|\langle\psi| U_{ab}|\psi\rangle|$ is constant (except of course for $U_{00}$).
Expanding the hypothetical state in this basis,
$$|\psi\rangle\langle\psi| = \frac1d \sum_{ab} \alpha_{a,b} U_{ab},$$
we see that demanding it to be Hermitian translates to $\alpha_{a,b}\alpha_{-a,-b} = 1$ (note that these coefficients are in general complex), have trace one results in $\alpha_{0,0} = 1$, and have trace squared equal one results in $|\alpha_{a,b}| = 1/\sqrt{d+1}$ for all other $a,b$.
Simply setting $\alpha_{a,b} = 1/\sqrt{d+1}$ does give me the desired state for $d=2$ and $d=3$, but doesn't work for higher dimensions, negative eigenvalues show up. It's easy enough to find the state numerically for higher $d$, so I guess it always exists, but I can't find a good method to calculate the coefficients analytically. Also, it seems a natural question to ask, but I couldn't find anything about it in the literature.
"
"['quantum-state', 'mathematics', 'textbook-and-exercises', 'bell-basis']"," Title: What happens if a Pauli $X$ gate is applied to part of a Bell state?Body: I have started to learn about the mathematics behind ebits and I have a question. Assume $\color{red}{\text{Alice}}$ and $\color{blue}{\text{Bob}}$ share the following ebit:
$\begin{align}\vert\Phi^+ \rangle= \dfrac{\vert\color{red}{0}\color{blue}{0}\rangle^{\color{red}{A}\color{blue}{B}} + \vert\color{red}{1}\color{blue}{1}\rangle^{\color{red}{A}\color{blue}{B}}}{\sqrt{2}} .\end{align}$
What would happen if $\color{red}{\text{Alice}}$ performs Pauli-$X$
gate on their portion of the ebit?
Here is my answer but I am not sure if it is correct:
The $\color{red}{0}$ and $\color{red}{1}$ will swap and end up with:
$\color{red}{\text{Alice}}$ and $\color{blue}{\text{Bob}}$ share the following ebit:
$\begin{align}\vert\Phi^+ \rangle= \dfrac{\vert\color{red}{1}\color{blue}{0}\rangle^{\color{red}{A}\color{blue}{B}} + \vert\color{red}{0}\color{blue}{1}\rangle^{\color{red}{A}\color{blue}{B}}}{\sqrt{2}} .\end{align}$
Any help is appreciated!
"
"['qiskit', 'quantum-gate', 'physical-realization', 'decoherence']"," Title: How to formulate Dynamical Decoupling passes in Qiskit to improve result upon circuit executionBody: First, let me say that I am not familiar with the idea of Dynamical Decoupling. The goal of this question is to understand how to set up a circuit with dynamical decoupling to improve my hardware result.
Due to the interaction with the environment, the dynamics of an open quantum system is not unitary. Thus, dynamical decoupling is about an open loop control technique for cancellation of the environment noise.
In the Dynamical coupling technique, a series if strong fast pulses are applied on the system which on average neutralizes the system-bath coupling, decouple system from bath (environment).
For instance, given the original circuit as:
you instead perform the following:
This can be done as shown in this Qiskit's documentation:
import numpy as np
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.library import XGate
from qiskit.transpiler import PassManager, InstructionDurations
from qiskit.transpiler.passes import ALAPSchedule, DynamicalDecoupling
from qiskit.visualization import timeline_drawer
circ = QuantumCircuit(4)
circ.h(0)
circ.cx(0, 1)
circ.cx(1, 2)
circ.cx(2, 3)
circ.measure_all()
durations = InstructionDurations(
[("h", 0, 50), ("cx", [0, 1], 700), ("reset", None, 10),
("cx", [1, 2], 200), ("cx", [2, 3], 300),
("x", None, 50), ("measure", None, 1000)]
)
# balanced X-X sequence on all qubits
dd_sequence = [XGate(), XGate()]
pm = PassManager([ALAPSchedule(durations),
DynamicalDecoupling(durations, dd_sequence)])
circ_dd = pm.run(circ)
timeline_drawer(circ_dd)
Now you can varies the durations parameters to change the length of the gate, and also you can change the number of $X$ gates in the sequence you can apply to each qubit in the circuit (the above circuit has the same number of $X$ gates on both qubits $q_0$ and $q_1$ but this doesn't have to be the case).
As you can see, with the example given above, the first $CX$ was set at $700 \ dt$ , the second $CX$ was set at $200 \ dt$, and then the last $CX$ was set at $300 \ dt$. How were these specific numbers picked?
I also want to mention something else. The Dynamical_Decoupling circuit (the bottom circuit) upon execution didn't give me an improved results!
I have tried different combinations as well, by setting longer or shorter $dt$ for different $CX$ gates, add more number of $X$ gates to the qubits that need to be idle longer, etc. But similarly, when I compare such circuit results to the original circuit (the circuit without performing Dynamical Decoupling) results, they were not better.
"
"['circuit-construction', 'grovers-algorithm', 'complexity-theory', 'oracles', 'amplitude-amplification']"," Title: BHT algorithm implementationBody: Summary of Method
Amplitude Amplification Summary
The BHT algorithm uses amplitude amplification, a nice generalisation of Grover's algorithm, where there is a subset $G\subset X$ of good elements in the orthonormal basis $X$. Below is a brief summary of the results to define notation and give the background for the question.
Let:
$$\begin{align}&|S\rangle\equiv\frac{1}{\sqrt{\left|S\right|}}\sum_{|x\rangle\in S}|x\rangle,&I_S|x\rangle\equiv\begin{cases}-|x\rangle,&|x\rangle\in S\\\phantom{-}|x\rangle,&|x\rangle\not\in S\end{cases}&\end{align}$$
where $S$ is a set of orthonormal kets. It is easy enough to show using the modified Grover operator $Q\equiv-I_{\left\{|X\rangle\right\}}I_G$ that:
$$\left|\langle G|Q^m|X\rangle\right|^2\ge P_0\equiv\cos^2\left(2\sin^{-1}\sqrt{\frac{\left|G\right|}{\left|X\right|}}\right)=1-\mathcal O\left(\frac{\left|G\right|}{\left|X\right|}\right)$$
where $m$ is the nearest integer to $\dfrac{\pi}{4}\sqrt{\frac{\left|X\right|}{\left|G\right|}}$ and so a good element can be found from $G$ with probability of at least $P_0$ using only $m=\mathcal O\left(\sqrt{\frac{\left|X\right|}{\left|G\right|}}\right)$ applications of $Q$. Finally, substituting in $\left|G\right|=1$ yields the standard results of Grover's algorithm.
BHT algorithm
For Grover's algorithm, we can construct the operator $I_G$ by using an oracle $U_H$ for the function $H:X\to\mathcal B_1$ such that $H\left(x\right)=1$ if and only if $|x\rangle\in G$; where $\mathcal B_n$ is the set of all $n$-bit strings. Thus, using one ancilla line $U_H|x\rangle|-\rangle=I_G|x\rangle|-\rangle$. However, in the case of the BHT algorithm there is an oracle $U_F$ that implements the two-to-one function $F:X\to Y$ and we wish to find two values of $x_0,x_1\in X$ such that $F\left(x_0\right)=F\left(x_1\right)$ - a collision. The algorithm is as follows:
Collision$\left(F,k\right)$
- Pick an arbitrary subset $K\subseteq X$ of cardinality $k$. Construct a table $L$ of size $k$ where each item in $L$ holds a distinct pair $\left(x,F\left(x\right)\right)$ with $x\in K$.
- Sort $L$ according to the second entry in each item of $L$.
- Check if $L$ contains a collision, that is, check if there exist distinct elements $\left(x_0, F\left(x_0\right)\right),\left(x_1, F\left(x_1\right)\right)\in L$ for which $F\left(x_0\right)=F\left(x_1\right)$. If so, goto step 6.
- Compute $x_1=\operatorname{Grover}\left(H, 1\right)$ where $H:X\to\left\{0, 1\right\}$ denotes the function defined by $H\left(x\right)=1$ if and only if there exists $x_0\in K$ so that
$\left(x_0, F\left(x\right)\right)\in L$ but $x\ne x_0$. (Note that $x_0$ is unique if it exists since we
already checked that there are no collisions in $L$.)
- Find $\left(x_0, F\left(x_1\right)\right)\in L$.
- Output the collision $\left\{x_0, x_1\right\}$.
page 4 - Quantum Algorithm for the Collision Problem (the BHT algorithm)
My implementation of $H$
The paper doesn't mention the implementation of $H$ apart from stating that $H$ can be implemented with only one query to $F$. However, implementing a general $H$ seems like it would give rise to a large complexity cost. Below is the best implementation of general $H$ I could think of:
where $h_{ij}$ denotes the $j^\text{th}$ bit of the $n$-bit string $h_i$
If we denote the action of the above circuit by $U_H|F\left(x\right)\rangle|y\rangle=|F\left(x\right)\rangle|y\oplus H\left(x\right)\rangle$ then:
As a Toffoli gate can be implemented with 15 1,2-qubit gates and an $n$-bit controlled $X$ gate requires $2n$ Toffoli gates and an $X$ gate then $U_H$ is implemented by $\left(32n+1\right)k$ 1,2-qubit gates. Clearly not all the $X$ gates in $U_H$ are required as if $h_{ij}=0$ then the corresponding two $X$ gates can be removed. In addition, $X^2=I$ so the $\left\{h_i\right\}$ could be ordered to take advantage of this. But still, we can upper bound the complexity of $U_H$ as $\mathcal O\left(nk\right)$.
Thus, it takes $k$ initial evaluations of $U_F$ to generate $L$. Next with this definition of $H$ we can skip the sorting. Then both $U_F$ and $U_H$ are evaluated $\mathcal O\left(\sqrt{\frac{N-k}{k}}\right)=\mathcal O\left(\sqrt{\frac{N}{k}}\right)$ times before measuring and checking the answer with one more evaluation of $U_F$. Hence, the complexity is:
$$\mathcal O\left(\left(k+\sqrt{\frac{N}{k}}\right)T+\sqrt{Nk}\log N\right)$$
which is not the complexity given in the paper of:
$$\mathcal O\left(\left(k+\sqrt{\frac{N}{k}}\right)\left(T+\log k\right)\right)$$
Question
So presumably there is a better implementation of $U_H$ than I have given as the paper has better time complexity. My question is what is this implementation of $U_H$?
Edit
I managed to lower bound the complexity of $U_H$ in my answer below. Any answer from now on will be accepted and gain the bounty if it explains the remaining discrepancy in my complexity and explains why sorting is helpful. Any more elegant proofs than my own will also be considered for the bounty and being accepted. I shall not accept my own answer. Thank you for your interest.
"
"['programming', 'q#']"," Title: Q# install issueBody: I have followed the instructions to install Q# using conda as recommended, and given by MS. When I try to import qsharp from my virtual env within a Python program, I get the following error:
Microsoft.Quantum.IQSharp.Workspace[0] QS5022: No identifier with the name “v” exists.
Does any one have experience of this issue please? I have googled it but to no avail.
I use .NET run perfectly with example.qs and example.csproj files, but I would like to work within VSCode.
(Ubuntu v. 20.04, .NET SDK v. 3.1, Python v. 3.7 + latest Miniconda)
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: How to execute a qiskit circuit from strangeworks hub?Body: I would like to execute a circuit in the strangeworks hub on IBM's "ibm_nairobi" system.
Could someone just please send me a general layout of execute and provide a command for stangeworks hub?
"
"['programming', 'qiskit', 'resource-request', 'sabre']"," Title: How to get information about 'qubit location' or 'variable of qubit location' in qiskit docs?Body: I have something problem with using qiskit.
I searched several qiskit docs to get 'qubit location' or 'variables' that represent qubit.
I searched three documents below.
qiskit.transpiler.passes.layout.sabre_layout
qiskit.transpiler.passes.routing.sabre_swap
qiskit.dagcircuit.DAGCircuit
However, I couldn't get the information about qubit location in these docs.
SABRE algorithm use qubit location to switch qubit's location to execute on the real quantum hardware with satisfying its coupling graph. That's why I'm sure that these docs will contain information about qubit location to use them. But I can't find it. Could you help me?
If I need to find out some other docs, please let me know.
Thank you.
"
"['programming', 'entanglement-swapping']"," Title: What would be the procedure if I wish to code entanglement swapping?Body: Most of the methods that I have seen in various papers all take single examples and then proceed to manually perform swapping by re-writing the states on a different basis and then performing a measurement to swap entanglement.
Examples: https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Supplemental_Modules_(Physical_and_Theoretical_Chemistry)/Quantum_Tutorials_(Rioux)/Quantum_Teleportation/357%3A_An_Entanglement_Swapping_Protocol
Or entanglement is spoken about very briefly, such as in:
Horodecki, R., Horodecki, P., Horodecki, M., & Horodecki, K. (2009). Quantum entanglement. Reviews of Modern Physics, 81(2), 865–942. - Page 12
I wish to code entanglement swapping for some arbitrary state of 4 qubits, of which A-B and C-D are entangled. I wish to perform the swapping leaving A-D entangled. How would I go about doing the same? I was unable to find any detailed resources on swapping or a generalized entanglement swapping procedure anywhere.
"
"['quantum-state', 'entanglement', 'measurement']"," Title: What does ""measurement destroys information"" mean?Body: I am reading a paper on quantum cryptography. The author used two facts:
quantum-
information cannot be copied
and
Furthermore, measurements destroy information...
For the first statement, I came to know that due to no-cloning theorem quantum-information can not be copied. What is the rationale behind second statement.
I would be thankful if you can cite some references to read? Is there some kind of theorem for statement two as well?
Thanks
Cross-posted on physics.SE
"
"['qiskit', 'ibm']"," Title: Why can two target superconducting processors with the same layout get different transpilation results?Body: I compile and run the same small Grover circuit for 6 different processors.
ibmq_santago, manila and bogota all have a linear layout, while quito, belem and lima have qubits arranged in a T-shape.
I get transpiled circuits using transpile(circuit, backend=target_backend, seed_transpiler=10, optimization_level=3). I expected the resulting circuits to have the same structure for processors with the same layout. However, they do differ. For ex. circuit for Santiago has depth of 73 and includes 38 cX gates, while one for Manila has depth of 70 but with 41 cX gates. There are similar differences between other processors.
I thought it could be due to some randomness inside of the code, but the results always return the same. Does the Qiskit transpiler take into account average errors or other parameters that could affect this?
"
['vqe']," Title: Generally, could VQE be used to prepare the highest energy state?Body: When I learned about the variational method in quantum mechanics and the variational quantum eigensolver (VQE), I was told that this method is used to prepare the ground state of a quantum system. I wonder if we could also use this method to estimate/prepare the highest energy state? Can we make an ansatz and then turn the question into a maximization problem? Thanks!
"
"['quantum-state', 'entanglement', 'measurement', 'bell-basis']"," Title: Intuition for why $\frac{|00\rangle+|11\rangle}{\sqrt{2}}$ can be written as $\frac{|++\rangle+|--\rangle}{\sqrt{2}}$Body: In analyzing measurement of $\frac{|00\rangle+|11\rangle}{\sqrt{2}}$ in the local $|+\rangle$, $|−\rangle$ basis, through algebra manipulation, the initial state is first written as $\frac{|++\rangle+|--\rangle}{\sqrt{2}}$.
I understand how to get to this result algebraically. However, I'm surprised by how similar this state is compared to the state of $\frac{|00\rangle+|11\rangle}{\sqrt{2}}$ - you literally substitude the 0 with +, 1 with -. Thus, I am wondering if there's any intuition for why the two states look so similar?
"
['terminology']," Title: Terminology: quantum state vs. quantum system vs. qubitBody: What are the difference between quantum state, quantum system and qubit(s)?
"
"['quantum-state', 'entanglement', 'fidelity']"," Title: What are min and max overlaps of a maximally entangled state with a separable state?Body: Let $A,B$ be Hilbert spaces of dimension $d$. Let $\rho$ be some separable quantum state of the composite system $AB$. Given a maximally entangled state:
$$\vert\phi\rangle = \frac{1}{\sqrt{d}}\sum_{i=1}^d \vert i\rangle_A\vert i\rangle_B.\tag{1}$$
Can one say anything about the maximum and minimum possible value of the overlap:
$$\langle\phi\vert\rho\vert\phi\rangle,\tag{2}$$
where we maximize or minimize over all separable $\rho$?
"
"['algorithm', 'nielsen-and-chuang', 'deutsch-jozsa-algorithm']"," Title: Reason for sending numbers from 0 to $2^n − 1$ in Deutsch–Jozsa algorithmBody: In Nielsen and Chuang, when talking about the Deutsch–Jozsa algorithm. The Deutsch’s problem is described as the following game.
Alice, in Amsterdam, selects a number x from 0 to $2^n − 1$, and mails it in a letter to Bob, in Boston...
Is there an underlying reason why we use numbers from 0 to $2^n − 1$ or it's just a random choice?
"
"['resource-request', 'optimization', 'annealing', 'adiabatic-model']"," Title: Example of lower bound on spectral gap for adiabatic quantum computingBody: is there a list of reference for which the authors prove a lower bound of the spectral gap for an adiabatic quantum algorithm? I.e. I am searching for examples where the authors solve a problem with QUBO, but are also able to offer a runtime analysis based on the spectral gap. A list of 2-3 papers would be great already.
Thanks.
"
"['qiskit', 'quantum-gate', 'quantum-state']"," Title: Different statevectors with different quantity of complex numbers for same single-qubit states in QiskitBody: I have several questions, but before ask, I want to write some theoretical.
As we know, we can represent any single-qubit quantum state by the next representation:
$$
|\psi\rangle=c_0|0\rangle+c_1|1\rangle,
$$
using two numbers, $c_0$ and $c_1$, called probability amlitudes.
We can put these probability amplitudes to vector-column:
$$
\begin{bmatrix}
c_0 \\
c_1 \\
\end{bmatrix}
$$
In other side, we can represent any single-qubit quantum state next:
$\theta$ and $\phi$ represents next angles in Bloch sphere:
As we can see, enough only one complex number to represent single-qubit quantum state, using $|0\rangle$ and $|1\rangle$ base.
In this case $c_0 = \cos{\frac{\theta}{2}}$ and $c_1 = e^{i\phi}\sin{\frac{\theta}{2}}$.
By watching Bloch Sphere and using probability amplitudes we can write 6 the most usual quantum states:
$|0\rangle = \cos{\frac{0}{2}}|0\rangle + e^{i0}\sin{\frac{0}{2}}|1\rangle = 1|0\rangle+0|1\rangle=\begin{bmatrix}
1 \\
0 \\
\end{bmatrix}$
$|1\rangle = \cos{\frac{\pi}{2}}|0\rangle + e^{i0}\sin{\frac{\pi}{2}}|1\rangle = 0|0\rangle+1|1\rangle=\begin{bmatrix}
0 \\
1 \\
\end{bmatrix}$
$|+\rangle = \cos{\frac{\pi}{4}}|0\rangle + e^{i0}\sin{\frac{\pi}{4}}|1\rangle = \frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle=\begin{bmatrix}
\frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} \\
\end{bmatrix}$
$|-\rangle = \cos{\frac{\pi}{4}}|0\rangle + e^{i\pi}\sin{\frac{\pi}{4}}|1\rangle = \frac{1}{\sqrt{2}}|0\rangle+(-1)*\frac{1}{\sqrt{2}}|1\rangle=\frac{1}{\sqrt{2}}|0\rangle-\frac{1}{\sqrt{2}}|1\rangle=\begin{bmatrix}
\frac{1}{\sqrt{2}} \\
-\frac{1}{\sqrt{2}} \\
\end{bmatrix}$
$|+i\rangle = \cos{\frac{\pi}{4}}|0\rangle + e^{i\frac{\pi}{2}}\sin{\frac{\pi}{4}}|1\rangle = \frac{1}{\sqrt{2}}|0\rangle+i*\frac{1}{\sqrt{2}}|1\rangle=\begin{bmatrix}
\frac{1}{\sqrt{2}} \\
\frac{i}{\sqrt{2}} \\
\end{bmatrix}$
$|-i\rangle = \cos{\frac{\pi}{4}}|0\rangle + e^{i\frac{3\pi}{2}}\sin{\frac{\pi}{4}}|1\rangle = \frac{1}{\sqrt{2}}|0\rangle+(-i)*\frac{1}{\sqrt{2}}|1\rangle=\frac{1}{\sqrt{2}}|0\rangle-i*\frac{1}{\sqrt{2}}|1\rangle=\begin{bmatrix}
\frac{1}{\sqrt{2}} \\
-\frac{i}{\sqrt{2}} \\
\end{bmatrix}$
Let me now use Qiskit. We can use U3 universal matrix to create any single-qubit quantum state. For example, if I use
qc = QuantumCircuit(1)
qc.u3(pi/2,pi/2,0,0)
we will have $|+i\rangle$ state with next statevector:
(1)
However, if we do next code:
qc = QuantumCircuit(1)
qc.h(0)
qc.rz(pi/2,0)
we will have next statevector:
(2)
As I understand, here is used global phase. But how can I connect these two statevectors with each other? And why it's difference between each other?
Honestly, I had experience only with single-qubit representation, when we use only one complex number, and $i$ can be only in second coefficient of Jones vector. But when I see two complex numbers - I am little bit confused.
Additionally, if we start from $|+\rangle$ state and rotate state around Z for $\frac{\pi}{4}$ angle, we can do it by using "rc" gate:
qc = QuantumCircuit(1)
qc.h(0)
qc.rz(pi/4,0)
and we will have next result:
Or we will use next gate:
qc = QuantumCircuit(1)
qc.h(0)
qc.u1(pi/4,0)
and we will have next result:
Again, in first case we will have two complecs numbers, in second case only one, but states are same.
Could you, please, explain these differences?
Thank you!
"
"['quantum-gate', 'quantum-circuit']"," Title: Why isn't FANIN required to be able to simulate all other elements in a classical circuitBody: In Nielsen and Chuang, there's the following paragraph:
The Toffoli gate can be used to simulate NAND gates and can also be used to do FANOUT. With these two operations, it becomes possible to simulate all other elements in a classical circuit, and thus an arbitrary classical circuit can be simulated by an equivalent reversible circuit.
I'm confused about why FANIN isn't required to be able to simulate all other elements in a classical circuit, while FANOUT is required?
Also, a side note/question, I originally posted this question on the Electrical Engineering SE, but it was suggested to be migrated to this SE as it seems to them that "fan-in" and "fan-out" from a EE perspective is very different from FANOUT and FANIN in the context of Toffoli Gates. I learned "fan-in" and "fan-out" from EE perspective and just assumed the FANOUT discussed in Nielsen and Chuang is the exact same thing. Am I mistaken and "fan-in" and "fan-out" in QC is different from that in EE?
"
"['programming', 'qiskit', 'measurement']"," Title: Pad get_counts() with zeros for unmeasured states? (Qiskit)Body: After executing a job on qiskit, the typically procedure to get the measurement data from the quantum computer is to call get_counts() like so...
job = execute(qc, backend, shots=100)
result = job.result()
counts = result.get_counts()
If the final state is, for example, $|01\rangle$ then '01' would be the only key in counts. Does Qiskit currently have a way to pad the returned counts dictionary with 0s for all other states? So, it'd return something like
counts = results.get_counts(pad=True), and counts would then be counts = {'00':0, '01':100, '10':0, '11':0}?
It'd be great if this was a native option.
"
"['qiskit', 'physical-realization', 'quantum-control']"," Title: How to obtain control and drift Hamiltonians for device in Qiskit?Body: I would like to play around with Qiskit OpenPulse and the publicly available IBMQ quantum computer that supports OpenPulse. My humble goal is to use Qutip's optimal control libraries to get a pulse and feed that into OpenPulse. However, even through reading the Qiskit/OpenPulse specification on arxiv I am a little confused on the exact units and the underlying hardware details.
For starters, I tried the following:
- Obtain a matrix representation (tri-diagonal) of the charge Hamiltonian for Transmons (equation 2.30 from Bishop's thesis) by using the frequency transitions between 0->1 and 1->2
- Obtain the drift and control matrices by following section 2.8 of Bishop's thesis
- Fit a pulse using Qutip's GRAPE implementation with my derived drift and control
However, when I fed this pulse as a OpenPulse object to the quantum computer, I got back a completely different measured results. I believe the issue is somewhere in the units that OpenPulse is using (I noticed the pulse can not have a greater than 1 magnitude), but perhaps my issue lies somewhere in misunderstanding the transom described in Bishop's thesis and the IBMQ hardware.
"
"['quantum-gate', 'quantum-circuit']"," Title: Implementation of FANOUT using Toffoli gatesBody: Consider the following implementation of FANOUT using Toffoli gates:
I'm confused about the following statement: "the second bit being the input to the FANOUT and the other two bits standard ancilla states". Does it mean that the second bit is also the input to the other two ancilla states? Why do ancilla states require any inputs, aren't they pre-determined?
"
"['density-matrix', 'linear-algebra', 'quantum-money']"," Title: How to calculate the spectral norm of the density operator used in Molina et al. 2012 paper?Body: In Molina et al (2012)'s article on quantum money, the proof of security of Wiesner's quantum money scheme depends on the fact that the density operator
$$Q = \frac{1}{4}\sum_{k \in \{0, 1, +, -\}}\left|kkk\right>\left<kkk\right|$$
has spectral norm $\|Q\|_{spectral}=3/8$.
The article presents this without proof, but I was able to show it by noticing that
$$\left|v_0 \right>=2 \left|000\right> + \sqrt{2}\left(\left|+++\right> + \left|---\right>\right)$$
$$\left|v_1 \right>=2 \left|111\right> + \sqrt{2}\left(\left|+++\right> - \left|---\right>\right)$$
are both eigenvectors of $Q$ with eigenvalues $3/8$, so since $Q$ is a density operator its eigenvalues must all be in $[0, 1]$ and add to one and therefore this is its maximum eigenvalue.
However, I only found these eigenvectors using a tedious numerical search, and since $\|Q\|_{spectral}=3/8$ was presented without proof I wonder - is there a more obvious way to show that this is true?
"
"['quantum-gate', 'quantum-state', 'entanglement', 'key-distribution']"," Title: Can we do error correction for entangled particles?Body: There are several quantum error correction techniques, such as 3-qubit bit-flip code, and Shor’s 9-qubit code. 3-qubit bit-flip code is a straightforward technique for correcting a single error (either bit-flip or phase-flip but not both). Shor’s 9-qubit code can correct both bit-flip and/or phase-flip errors.
Working with qubits is easy as we can encode and decode, but working with entangled particles has puzzled me.
Let us assume Alice and Bob share an entangled Bell state, $|00 \big \rangle _{AB}$, where $|00 \big \rangle _{AB} = \frac{1}{\sqrt{2}} (|00 \big \rangle + |11 \big \rangle) $. Assume this state is prepared by Charlie and distributed to Alice and Bob. Alice recieves the first particle ($|0 \big \rangle_A$) and Bob recieves the second one ($|0 \big \rangle_B$).
How can Alice and Bob make sure to some extent that their particle is error-free?
I am thinking about applying the principle of the repetition code (3-qubit bit-flip) to the
basis states and obtains the following code:
$|00 \big \rangle _{AB}$ - > $|000000 \big \rangle _{AB}$, where $|000000 \big \rangle _{AB} = \frac{1}{\sqrt{2}} (|000000 \big \rangle + |111111 \big \rangle) $.
Alice receives the first three particles ($|000 \big \rangle_A$) and Bob recieves the other three particles($|000 \big \rangle_B$).
After that, Alice and Bob apply the same principle of the 3-qubit bit-flip; however, he/she can only fix the bit-flip error by following the majority(Ex, 101 means 111, 110 also means 111 ).
How can they fix both bit-flip and phase-flip errors?
Alice (Bob) ends up with a a GHZ entangled state ($\frac{1}{\sqrt{2}}((|0 \big \rangle^n + |1 \big \rangle^n)$) where n is the number of particles.
How can Alice(Bob) utilize the n particle to get a single but correct particle?
Let say n equals 9, can they apply Shor's code? Who will do the encoding? Is it Charlie?
Any suggested solutions or references?
Implementation of @Craig Gidney answer
I have made random errors in the initial entangled state (0 and 10) and some random errors in the coding states. The results of measurement of the initial states (0 and 10) are always correct as in the following figure
Am I doing it right? Any comments?
"
"['programming', 'qiskit', 'quantum-gate', 'ibm-q-experience', 'hamiltonian-simulation']"," Title: Are these two circuits equivalent in performing controlled time-evolution?Body: I want to perform the controlled time-evolution of some 2 or 3-qubit Hamiltonian. Say we have this example:
$$
H= Z_0\otimes Z_1 + Z_1\otimes Z_2
$$
The circuit performing the time-evolution controlled by qubit 3 could be generated as (the arguments of R_Z gate are randomly chosen to be pi):
qrz = QuantumRegister(4,'q')
crz = ClassicalRegister(1,'c')
qcz = QuantumCircuit(qrz,crz)
qcz.cx(0,1)
qcz.crz(np.pi,3,1)
qcz.cx(0,1)
qcz.cx(1,2)
qcz.crz(np.pi,3,2)
qcz.cx(1,2)
qcz.draw(output = 'mpl')
However, I wonder is it possible that we can turn the circuit responsible for time-evolution directly into a quantum gate, and then the gate is controlled by qubit 3? Here's what I tried:
my_circ = QuantumCircuit(3)
my_circ.cx(0,1)
my_circ.rz(np.pi,1)
my_circ.cx(0,1)
my_circ.cx(1,2)
my_circ.rz(np.pi,2)
my_circ.cx(1,2)
my_circ.draw(output = 'mpl')
Then I have
new_circ = QuantumCircuit(4)
new_circ.append(custom,[3,2,1,0])
new_circ.draw(output = 'mpl')
Are the two circuits qcz and new_circ equivalent? Generally, if I know how to construct the quantum circuit for the time evolution of some Hamiltonian but don't know exactly how to perform controlled time-evolution, can I just transform the time-evolution circuit into a gate, and then do something similar to this example? Thanks for the help!
"
"['qiskit', 'ibm-q-experience']"," Title: Quantum state inconsistency between book and IBM quantum composerBody: $
\newcommand{\ket}[1]{|#1\rangle}
\newcommand{\tens}[1]{%
\mathbin{\mathop{\otimes}\limits_{#1}}
}$I'm trying to self-learn quantum information basics by reading Dancing with Qubits by Robert Sutor.
On page 334 for the state of $U_f$ (which flips the sign of the desired state) at different steps.
Just to include the details: $U_f$ applies $S, H, CX, H$, and $S$ to the second qubit, $q_1$.
Starting from the initial state, we have two qubits, and we apply to each of them a Hadamard gate and the state is now:
$\frac{1}{2}(\ket{00} + \ket{01} + \ket{10} + \ket{11}$.
Then we apply to the second qubit the $S$ gate (the first step in $U_f$), which I think is $(\frac{\sqrt{2}}{2}(\ket{0} + \ket{1})) \tens{} S(\frac{\sqrt{2}}{2}(\ket{0} + \ket{1})) = (\frac{1}{2}(\ket{0} + \ket{1})\tens{} (\ket{0} + i\ket{1}) = 1/2(\ket{00}+ i\ket{01} + \ket{10}+ i\ket{11})$ this is consistent with the result in the textbook.
And then I put the $H^{\tens{}^2}$ and $S$ for the second qubit in the IBM quantum composer, the result on the Q-sphere for $\ket{00}, \ket{01}$ is at a phase angle of $0$, while for $\ket{10}, \ket{11}$ is at a phase angle of $\frac{\pi}{2}$. and the output state is [ 0.5+0j, 0.5+0j, 0+0.5j, 0+0.5j ].
I was wondering what is the reason for this inconsistency in the textbook and the IBM quantum composer.
Thank you in advance!
"
"['quantum-gate', 'quantum-state', 'linear-algebra', 'qutrit']"," Title: Cliffordness of the qutrit Hadamard gateBody: Consider a simple generalization of the Hadamard gate to qutrits, defined as follows.
\begin{equation}
\begin{pmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0\\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} &0 \\
0 &0&1
\end{pmatrix}
\end{equation}
It is well known that the two qubit Hadamard gate is a Clifford gate. Is the above gate also a Clifford gate? I could not verify if so.
"
"['programming', 'cirq', 'quantum-enhanced-machine-learning', 'tfq']"," Title: Does anyone know how to use TF Quantum with real hardware data?Body: I'm currently trying to embed a tensorflow model for denoising measurements as a tensorflow quantum model, and at some point I'd like for this to be able to run on hardware. After reading through all the tutorials and relevant portions of the source code such as sampled_expectation.py and sample.py. The only available backends for these functions are 'noiseless' and 'noisy'. But in reading the tensorflow release paper, they say that these models can be deployed on real hardware. So how do I define a tensorflow-quantum layer that includes a result from a hardware, or simulated hardware execution?
"
"['qudit', 'continuous-variable']"," Title: What is the relation between a Fock state and a qudit?Body: What is the relation between a Fock state and a qudit? Is the Fock state $|n\rangle, n=0, 1, 2, ...$ a qudit having $d=\infty$?
"
"['qiskit', 'algorithm', 'textbook-and-exercises', 'linear-algebra']"," Title: Normalization question in VQLSBody: I was studying VQLS in https://qiskit.org/textbook/ch-paper-implementations/vqls.html and run into the following normalization during the cost calculation. It says if $ |\Phi\rangle$ has a small norm. but, how come? I thought all vectors are unit vectors. Could you explain why we need the normalization factor? I think I missed something. Thanks
"
['entanglement-breaking-channels']," Title: Are entanglement breaking channels of any use?Body: As the name suggests, an entanglement breaking channel $\Phi$ is such that $(Id \otimes \Phi)[\rho]$ is always separable, even when $\rho$ is entangled. Won't such channels be useless, as they destroy entanglement? Does it make sense to say a channel that is more "entanglement breaking" is more useless?
"
"['density-matrix', 'information-theory', 'entropy']"," Title: Concavity of Conditional Quantum EntropyBody: Let's say I have a bipartite density operator $\gamma_{12} = (1 - \epsilon) \rho_{12} + \epsilon\sigma_{12}$, for $0 \le \epsilon \le 1$, i.e., a convex combination of $\rho_{12}$ and $\sigma_{12}$. I want to show that ($S$ represents Von Neumann entropy):
$$
S(\gamma_{12} | \gamma_2) \ge (1 - \epsilon) S(\rho_{12} | \rho_2) + \epsilon S( \sigma_{12} | \sigma_2).
$$
The note that I am following says that this is due to the concavity of conditional entropy, which is not immediately obvious to me. I tried to derive it in the following way:
$$
\begin{align}
S(\gamma_{12} | \gamma_2) &= S(\gamma_{12}) - S(\gamma_2) \\
&= S((1 - \epsilon) \rho_{12} + \epsilon\sigma_{12}) - S((1 - \epsilon)\rho_2 + \epsilon\sigma_2) \;\; \text{[definition of $\gamma_{12}$ and using partial trace] } \\
&\ge (1 - \epsilon) S(\rho_{12}) + \epsilon S(\sigma_{12}) - S((1 - \epsilon)\rho_2 + \epsilon\sigma_2) \;\; \text{[using concavity in the first S] } \\
&\stackrel{?}{\ge} (1 - \epsilon) S(\rho_{12}) + \epsilon S(\sigma_{12}) - (1 - \epsilon)S(\rho_2) - \epsilon S(\sigma_2).
\end{align}
$$
This of course, gives me the desired inequality. But how come the last inequality is true? Isn't $S((1 - \epsilon)\rho_2 + \epsilon\sigma_2) \ge (1 - \epsilon)S(\rho_2) - \epsilon S(\sigma_2)$ due to concavity? Thanks!
"
"['quantum-state', 'entanglement', 'quantum-circuit', 'oracles']"," Title: How to efficiently construct quantum circuits of oracles in multi-target quantum search?Body: In standard Grover's quantum search with only one target or its extension of multi-target quantum search, one of the two key parts is to quantize the boolean function
$$f(x):\{0,1,\cdots,N-1\}\rightarrow \{0,1\}$$, where $0,1,\cdots,N-1$ are indices of all $N$ candidate elements and the elements with $f(x)=1$ are targets we desire to search. The corresponding quantized quantum oracle can be described by
$$U_O|x\rangle=(-1)^{f(x)}|x\rangle$$, that is, the phases of target states are flipped but the others are kept unchanged. For simplicity, we assume $N=2^n$, so all the $N$ indices $0,1,\cdots,N-1$ can be represented by $n$ bits. For an example with $N=8$ and targets being with odd indices 1,3,5,7, $U_O$ would act as
$$U_O|000\rangle=|000\rangle\\
U_O|001\rangle=-|001\rangle\\
U_O|010\rangle=|010\rangle\\
U_O|011\rangle=-|011\rangle\\
U_O|100\rangle=|100\rangle\\
U_O|101\rangle=-|101\rangle\\
U_O|110\rangle=|110\rangle\\
U_O|111\rangle=-|111\rangle.$$
It is easy to see, without complicated multi-controlled operation, implementing the pauli $Z$ operation on the last qubit is sufficient to implement $U_O$. However, if targets are with general indices not composing an odd, even, or other special sequence, $U_O$ must not be as simple as that involving only one pauli $Z$ operation.
So my question is: Is there any efficient quantum circuit to implement $U_O$ where the target indices are general and provided beforehand? It would be appreciated as well if someone can provide some clues.
"
['hamiltonian-simulation']," Title: Simulating $e^{iX_1\otimes X_2t}$Body: I'm trying to figure out the quantum circuit to simulate the time-evolution of a 2-qubit Hamiltonian $e^{iX_1\otimes X_2t}$, where $X$ is a Pauli gate. From this answer, the quantum circuit performs $e^{iZ_1\otimes Z_2t}$ could be constructed as an $R_z$ gate sandwiched by 2 controlled x gates. Can I replace $R_z$ by $R_x$ (and same goes for $R_y$) to simulate $e^{iX_1\otimes X_2t}$ and $e^{iY_1\otimes Y_2t}$? Thanks!
"
"['programming', 'qiskit', 'measurement']"," Title: Return only the measurements of a circuitBody: I have written the following program in jupyter:
from qiskit import *
from qiskit import plot_histogram, matplotlib
circuit = QuantumCircuit(16,16) #Making a circuit with 16 qubits
qr = QuantumRegister(16)
cr = ClassicalRegister(16)
for i in range(16):
circuit.h(i)
circuit.measure(i,i)
simulator = Aer.get_backend('qasm_simulator')
result = execute(circuit, backend = simulator, shots = 200).result()
counts = result.get_counts()
print(counts)
and the output is of the form :
{'0111001100011110': 1, '0101000101101001': 1, '1100010111000100': 1,
'0111111110101110': 1,..., '0110110010010110': 1}
Is there any way that what I get as an output is the measurement only (e.g. '0111001100011110') without getting the times the measurement has appeared (: 1)?
"
"['programming', 'qiskit', 'quantum-state']"," Title: Get the probability amplitudes of the 0 and 1 states of a single qubit in Qiskit considering a system of multiple qubitsBody: I am looking for a method to get the values of $\alpha$ and $\beta$ probability amplitudes of each single qubit in a multiple qubit system. Is that possible?
As you can see in the image, I have a 4-qubit quantum circuit. I want to read the values of the amplidues in each qubit individually.
Here I used the Aer simulation for getting the statevector, but this for the states of the whole quantum system, i.e. 0000, 0001, 0010, ..., 1111, if I get this right.
"
"['algorithm', 'hamiltonian-simulation', 'vqe', 'qaoa']"," Title: Do VQE and QAOA use the same Hamiltonian?Body: In this paper, it talks about the 2-local Hamiltonian in the form:
$H = \sum_{(u,v)\in E} H_{uv} + \sum_{k \in v} H_k $
It also says the Ising model, Heisenberg model, XY model and QAOA are in the same form.
In my understanding, 2-local Hamiltonian is a kind of Hamiltonian that interaction is realized only between 2 neighbor qubits (please correct me if I am wrong). I was wondering if VQE has the same form. I remembered that I saw somewhere that says QAOA can be seen as a special case of VQE. My question is, does VQE and QAOA use the same Hamiltonian or there are some differences depending on the specific problems? If they have the same Hamiltonian, the 2-local Hamiltonian case can also be applied to a VQE problem?
"
"['quantum-state', 'pauli-gates', 'notation']"," Title: Is there a convention for denoting $Y$ eigenstates?Body: Two common shorthands for eigenstates of the $Z$ operator are $\{|0\rangle,|1\rangle\}$ and $\{|1\rangle,|-1\rangle\}$, where in the first case we have $Z|z\rangle=(-1)^z|z\rangle$ and in the second case we have $Z|z\rangle=z|z\rangle$. The common shorthand for eigenstates of the $X$ operator is $\{|+\rangle,|-\rangle\}$, where $X|\pm\rangle=\pm|\pm\rangle$.
Is there any commonly used shorthand for eigenstates of the $Y$ operator?
"
"['quantum-state', 'quantum-operation', 'information-theory', 'entropy', 'relative-entropy']"," Title: What can be said about the non-negativity of the relative entropy of $S(\rho_{AB}||\rho_{B})$?Body: Taking $\rho_{AB}=\rho_{A}\otimes \rho_{B}$, where $S(\rho_{A})$ and $S(\rho_{B})$ aren't 0, it's easy to see that
$$S(\rho_{AB}||I \otimes \rho_{B})=-S(\rho_{A})-S(\rho_{B})+S(\rho_{B})=-S(\rho_{A}).$$
Now clearly this is less than 0 due to the non-negativtiy of the von-neumann entropy. However, the non-negativty of the relative entropy is given in every textbook, with the caveat that for $S(\rho||\sigma) \ge0$ provided the support of $\rho\subseteq \sigma$, which by the violation of the inequality, can't be the case in this example. Although I don't see how, as if I take each marginal to be maximally mixed, the above still holds, yet in that case the support of $\rho \subseteq \sigma$. Perhaps I am missing something here?
However, if $\rho_{AB}$ were a maximally entangled state, it would be non-negative. So given cases like this, wherein the support isn't a subset of the second argument, are there other ways to show it will hold? Possibly something to do with $S(\rho_{AB}||N(\rho_{AB}))$ wherein $N$ is some CPTP channel?
"
"['programming', 'qiskit', 'openpulse']"," Title: What is an example of numbers that when used for a Gaussian pulse, would result in a rotation about the x axis?Body: For the playing of a Gaussian pulse, what is an example of numbers that could be plugged in for duration, amp, and sigma that would result in the pulse rotating something about the x axis?
Here is the code that I have so far:
with pulse.build(backend, name='hadamard') as h_q0:
pulse.play(Gaussian(duration=1200, amp=0.1409018732350299, sigma=32), pulse.drive_channel(0))
"
"['quantum-operation', 'density-matrix', 'kraus-representation']"," Title: Finding Kraus operators from the output density matrixBody: I have a question regarding Kraus operators. Any quantum channel can be written in terms of Kraus operators as $E(\rho)= \sum_{i=0}^n K_i \rho K_i^{\dagger}$ where $\rho$ is the initial density matrix. So you can propagate any initial density matrix through this quantum channel with Kraus operators.
Does this mean that if we have the output density matrix, we can decompose it in terms of Kraus operators and find the exact Kraus operators of the channel? In related questions, Choi representation is transformed to Kraus operators but that approach is not clear to me. Does anyone have a simple example to understand it or a simple way to obtain the Kraus operators?
"
"['qiskit', 'quantum-state', 'chemistry']"," Title: How to calculate the Hartree-Fock energy in Qiskit?Body: I am wondering how to calculate the Hartree-Fock energy efficiently using Qiskit. For one can get the Hartree-Fock state efficiently in Qiskit, however, it seems that it is not so obvious to get the energy efficiently using the state.
"
"['programming', 'q#']"," Title: Passing arrays to operations/functions in Q# Jupyter NotebooksBody: In order to pass inputs to Q# operations/functions with Jupyter Notebooks, one uses the magic command, %simulate, and writes out the inputs as key-value pairs, key=value.
For example, if I had some operation, operation HelloHardy (number : Int) : Unit {...}, then I would run the following %simulate HelloHardy number=1729.
I am currently working with the operation, EvaluatePolynomial, which is part of the numerics library and takes in integers, arrays of doubles, and booleans. Below is what I am running and the error message that is generated.
%simulate EvaluatePolynomial coefficients=[1.0,1.0] evaluationPoints=[0.0,1.0] numBits=3 pointPos=3 odd=true even=false.
Received invalid parameters. Please fix and try again:
coefficients: Error converting value "[1.0,1.0]" to type 'System.Collections.Generic.List`1[System.Double]'. Path '', line 1, position 11.
evaluationPoints: Error converting value "[0.0,1.0]" to type 'System.Collections.Generic.List`1[System.Double]'. Path '', line 1, position 11.
"
['universal-gates']," Title: Is there any universal gate set with an efficient word problem?Body: On N qubits, take a set of operators that form a universal gate set. Further, assume this gate set is given with a finite presentation of the group it generates and this group has a decideable and efficient word problem. The word problem is taken as the problem of deciding if two words written in the gate set generators are equal. Given this word problem is efficient, we can always find the set of smallest words equal to any given word. Any word is a program and so we have an efficient way to turn any program into its least, or shortest algorithm.
Is any of this possible? What do I mean by this? I am asking the following question: given $N$, the number of qubits, is there any universal gate set with an efficient word problem?
If so, doesn't this mean that finding the least version of any algorithm is an efficient problem?
"
"['mathematics', 'vqe']"," Title: How to know state corresponding to -1 or 1 for multi qubits VQE?Body: Can help to explain how to get -1 and 1 for 2 qubits VQE with $\langle XY\rangle$ since we have 4 states $|00\rangle,|01\rangle,|10\rangle,|11\rangle$? For the case of 1 qubit, it is straight forward $|0\rangle$ is 1 , $|1\rangle$ is -1.
"
"['qiskit', 'circuit-construction', 'teleportation']"," Title: What is the right way to teleport qubits on a real quantum computer?Body: I've been using the teleportation protocol to teleport qubits and then using Qiskit state tomography for reconstructing my qubits.
Using this circuit using open qasm I regularly obtain fidelity 0.9.
But using the same on a quantum computer returns fidelity 0.5-0.8. Is that normal? I mean, doing tomography implies using more shots and that gives more noise after every measurement.
I also tried doing the measurements at the end but the fidelity didn't improved.
"
"['qiskit', 'vqe', 'optimization', 'chemistry']"," Title: Save output, wavefunction file and orbital information in QiskitBody: I am going through LiH ground state energy calculation. I would like to know how to save the output file in Qiskit as one would do in classical computing using software like Gaussian or Psi4.
Also, how to save wave function file after the quantum optimization is completed? I would like to get the details of the orbitals after the quantum optimization is complete.
Can someone please help?
"
"['quantum-state', 'algorithm', 'grovers-algorithm', 'superposition']"," Title: How can we keep Schrödinger's cat alive?Body: We know, Schrödinger's cat inside the box is in the equal superposition state of both alive and dead. We can express its state as $$|\text{cat}_\phi\rangle= \frac{|\text{alive}\rangle+e^{i\phi}|\text{dead}\rangle}{\sqrt{2}} \hspace{10mm} \text{where }\phi\text{ is relative phase}$$
If $\phi$ were $0$ or $\pi$ we could use Grover's algorithm to keep the cat alive.
But since we don't know $\phi$ and we don't want to measure the cat without being $100\%$ sure that the cat is now in $|\text{alive}⟩$ state, how can we proceed? Can we develop a more general version of Grover's algorithm?
"
"['decoherence', 'randomised-benchmarking']"," Title: Does Randomized Benchmarking characterize decoherence error?Body: In my understanding, Randomized Benchmarking (RB) generates a sequence of Clifford gates with different lengths and then characterizes the average error. Since RB is not sensitive to SPAM error, it doesn't characterize it.
My question is, does the error rate obtained by RB include decoherence error (I know it includes gate error)? When the length of the gate sequence increase, I understand that the gate error will accumulate. Does the decoherence error influence the final result due to the T1/T2 of each qubit? Also, in RB result, there is a constant when fitting the curve. Is the decoherence effect too small to be accounted for in the computed error per Clifford?
"
"['quantum-gate', 'pauli-gates', 'qutrit']"," Title: Qutrit analogues of controlled Z and cc-Z gatesBody: I am trying to look for the qutrit analogues of a controlled-Z, and a cc-Z (Z gate with two controls) for qubits.
There is a previous answer that gives a qutrit analogue of a CNOT gate, but does not talk about the gates I mentioned.
Note that controlled-Z is a Clifford gate. So, it is expected any qutrit analogue should also be a Clifford gate.
"
"['textbook-and-exercises', 'resource-request']"," Title: Resources for QML hackathon/textbook types of questionsBody: I'm looking for a list of resources (links, videos, lectures, etc.) that contains quantum machine learning problems. These could be of the style of problem sets, hackathon questions, questions from a textbook, or anything similar.
The difficulty could be any level, but problems that would take a bit more than just searching up a theorem, definition or Qiskit/Cirq function are preffered. This without going to the other extreme of having to go down a rabbit hole to answer a super-niche question.
Any links to pages with such problems or to any specific problem of this type are appreciated.
"
['algorithm']," Title: How is Grover's algorithm used in reducing duration of time taken to brute-force a hash?Body: I read somewhere on internet that brute-forcing a hash on classical computer will take time proportional to the length of data. But somehow if one have possible inputs used, using Grover's algorithm, one can reduce time significantly. So, is this statement true ? If yes how Grover's algorithm do that and it reduces the brute-force time by how much.
"
['annealing']," Title: Understand final Hamiltonian in Quantum AnnealingBody: Currently, I’m studying quantum annealing in which the system evolves according to the Hamiltonian:
$$
H(t) = H_F + \Gamma(t) H_D,\tag{1}
$$
where $H_F$ is a final (classical) Hamiltonian, $H_D$ is a transverse field Hamiltonian and $\Gamma$ is a transverse field coefficient.
My question is about how to imagine what it is like when the transverse field term is not included. Then, we are back to the system evolving according to the classical Hamiltonian alone: $H(t) = H_F.$
For this Hamiltonian how is the potential energy landscape defined? In the case of simulated annealing, in order to define the cost landscape we first need two elements which are (1) the neighborhood rule used to determine neighbors of the states (2) the objective function. Although for (2) we have the energy of eigenstates, what is the rule for determining the connection between eigenstates of the Hamiltonian?
"
"['quantum-state', 'entanglement', 'bell-basis']"," Title: Why are Bell states the maximally entangled ones?Body: I just want to know why actually Bell states are examples of maximally entangled states and significance of that "maximal" term. Is there anything for proving that?
"
['quantum-operation']," Title: Why are quantum channels described by linear maps?Body: Why should the quantum channels be described by linear maps?
"
"['programming', 'qiskit']"," Title: Generate certain depth Clifford random circuit by qiskitBody: To obtain knowledge about the pattern of errors occur in quantum circuits, random Clifford circuits are a good paradigm to use in that these kind of circuits can be efficiently simulated by a classical computer. In this case, we can get both ideal and noisy data (measured form a real quantum device) at the same time. Then, we can take the two set of data for further use, like what have been done by Patrick Coles etc. In qiskit, random Clifford circuits are generated by the random_clifford method. One drawback of the method is that the circuit depth cannot be specified, which limit the usage of the method if one just want like a shallow-depth circuit, like in the case of measurement error mitigation proposed the IBM team, where they used depth-4 random Clifford circuits. In a nutshell, how can one generate certain depth random Clifford circuits using qiskit?
"
"['programming', 'qiskit', 'ibm-q-experience', 'simulation']"," Title: What is difference between qasm_simulator and ibmq_qasm_simulator?Body: There are many ways how to simulate a quantum circuit on IBM Q. However, in partiuclar I am interested in a difference between qasm_simulator and ibmq_qasm_simulator.
In Qiskit, the former can be called with statement
processor = Aer.backends(name = 'qasm_simulator')[0]
while the latter with
provider = IBMQ.load_account()
processor = provider.backends(name='ibmq_qasm_simulator')[0]
I realized that ibmq_qasm_simulator sends jobs similarly to a real quantum processor, i.e. I see the job in Job pane in IBM Q environment. But this is not the case for qasm_simulator.
In list of services on IBM Q page I found out only one qasm_simulator. So, my question is how these two simulators differ?
"
"['algorithm', 'grovers-algorithm', 'superposition']"," Title: Does the input of the quantum counting algorithm have to be a uniform superposition state?Body: Will the quantum counting algorithm work if the input is not a uniform superposition (even not a superposition of all basis states)?
For example, if I use a state such as :
$$\frac{1}{4}(2\vert 0000\rangle+\sqrt 3\vert 1000\rangle+\sqrt 6\vert 0011\rangle+\sqrt 3\vert 1111\rangle)$$
as the input of the quantum counting algorithm and I set the oracle of Grover iteration subject to state $\vert 1000\rangle$.
Would the algorithm work with my state?
"
"['mathematics', 'hamiltonian-simulation']"," Title: Can we simulate the Hamiltonian for the Rubik's Cube with ""nth-root of SWAP"" gates?Body: I'm interested in, but confused about, local Hamiltonian simulation. I don't yet have enough intuition regarding even the approach set forth by Lloyd in 1997. I think Lloyd's recipe is to repeatedly run a "small" circuit of unitary gates to simulate a larger unitary, relying on the bounds of the Baker-Campbell-Hausdorff formula to deal with nonabelian properties of the Hamiltonian.
To motivate my question, consider initially the adjacency matrix of the Cayley graph of the subgroup of the Rubik's Cube group generated by the six half-turn twists $\langle F^2, B^2, L^2, R^2, U^2, D^2\rangle$.
The adjacency matrix of the Cayley graph can be seen to be a local Hermitian matrix:
$$H = \sum_{j \mathop =1}^6 H_j$$
where each $H_j$ is the permutation matrix for the respective face.
There are $48$ cells on the Rubik's cube (excluding the fixed center cells), and each cell can be in one of $6$ colors. Indeed, we can represent the cube with $48$ registers of $3$ qubits each; we might have a simple mapping such as $\vert 001\rangle\mapsto\text{RED},\vert 010\rangle\mapsto\text{BLUE},\ldots$.
Shown above is the front face before and after a half-twist $F^2$ - for simplicity I'm not showing the other cells adjacent to the corners/edges. Half-twists of each face appear to be a simple sequence of SWAP gates.
There are also "square-root of SWAP" gates, and even generalized "$n^{th}$ root of SWAP gates". Also shown above is an "$n^{th}$ root" of the $F^2$ operator, that I call $f^2$. Repeating such gates $n$ times may realize the full SWAP/the full $F^2$ operator.
With this setup, does it make sense to consider Hamiltonian simulation of the adjacency matrix of the Cayley graph of the group, with a repeated application of such "$n^{th}$-root-of-swap" gates, for each different face of the cube?
For example, letting lower-case $f^2$ be the $n^{th}$ root of $F^2$ (and $u^2$ be the $n^{th}$ root of $U^2$, etc.), for large enough $n$ can we simulate:
$$e^{-iHt}\approx (f^2b^2l^2r^2u^2d^2)^n?$$
Are such generalized SWAP gates/$n^{th}$ root of SWAP gates useful for Hamiltonian simulation?
ADDED
The two-squares subgroup of the Rubik's cube group may be decomposed as a sum of 2-local Hamiltonians I think; the full Rubik's cube group is generated by the quarter-turn moves $\langle F,B,L,R,U,D,F',B',L’,R',U',D'\rangle$, which I think may be decomposed as a sum of 4-local Hamiltonians.
But is this the right recipe for certain local Hamiltonian simulation of permutation groups - for large enough $n$ do we take the $n^{th}$ root of general SWAP gates for each generator, and repeatedly apply such gates?
I'm starting to kind of envision local Hamiltonian simulation as a bit akin to "Lie-algebrafication" of a Lie group.
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'information-theory']"," Title: Why do we want the no error limit to be 1?Body: In a textbook by Nielsen and Chuang, there's the following paragraph:
The idea of quantum data compression is that the compressed data should be recovered with very good fidelity. Think of the fidelity as being analogous to the probability of doing the decompression correctly – in the limit of large block lengths, it should tend towards the no error limit of 1.
If there isn't/very minimum error, shouldn't the no error limit be 0 instead of 1?
"
"['quantum-gate', 'quantum-circuit']"," Title: Why does the output from FANOUT appear on the second and third bits?Body:
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
Why does the output from FANOUT appear on the second and third bits? How do we extract and use this output? I learned FANOUT with the following definition and diagram.
Thus, is the value of $a$ output from our circuit with Toffoli gate the value of $N$ in the above diagram? Isn't $a$ either 0 or 1? Then does it mean the value for fan-out can only be 0 and 1? I didn't think so as it's there are clearly more than 1 gate from fan-out in the above diagram.
"
"['programming', 'qiskit']"," Title: Qiskit: How did they use Haar measure in random_statevector?Body: I have read this article to understand sampling state vectors from Haar measure:
Understanding the Haar Measure. Qiskit uses Haar measure to sample state vectors, but when I looked at the source code I couldn't see how did they use Haar measure.
Source
[docs]def random_statevector(dims, seed=None):
"""Generator a random Statevector.
The statevector is sampled from the uniform (Haar) measure.
Args:
dims (int or tuple): the dimensions of the state.
seed (int or np.random.Generator): Optional. Set a fixed seed or
generator for RNG.
Returns:
Statevector: the random statevector.
"""
if seed is None:
rng = np.random.default_rng()
elif isinstance(seed, np.random.Generator):
rng = seed
else:
rng = default_rng(seed)
dim = np.product(dims)
# Random array over interval (0, 1]
x = rng.random(dim)
x += x == 0
x = -np.log(x)
sumx = sum(x)
phases = rng.random(dim) * 2.0 * np.pi
return Statevector(np.sqrt(x / sumx) * np.exp(1j * phases), dims=dims)
As far as I understood, they applied a unitary matrix to a zero state $|0\rangle$, but where did this factor come from np.sqrt(x / sumx)?
"
"['programming', 'qiskit', 'vqe', 'quantum-neural-network']"," Title: What is the input for the interpret of Quantum Variational Regressors?Body: I'm trying to implement my first variational regressor using qiskit. I would like to understand how the interpret of a CircuitQNN works.
I need to define an interpret that works on the amplitudes of a certain set of measured basis states. Considering this I'm trying to get the counts obtained by executing the circuit for S shots and then perform some operations using these values to finally obtain the output of my regressor.
I saw the Qiskit's tutorial example (https://qiskit.org/documentation/machine-learning/tutorials/02_neural_network_classifier_and_regressor.html#Regression) in which they use the parity to get the class of an instance. But, I think they compute the parity for the bitstring measured at each shot, here I would like to execute all the S shots and then on the counts perform some operations.
Any suggestions?
"
"['quantum-state', 'quantum-parallelism']"," Title: Intuition for why the normalization for states in quantum parallelism is the sameBody: On page 31 of Quantum Computation and Quantum information by Nielsen and Chuang, it is said that:
Consider the circuit shown in Figure 1.17, which applies $U_f$ to an input not in the computational basis. Instead, the data register is prepared in the superposition $\frac1{\sqrt2}(|0\rangle+|1\rangle)$, which can be created with a Hadamard gate acting on $|0\rangle$. Then we apply $U_f$, resulting in the state: $\frac1{\sqrt2}(|0,f(0)\rangle+|1,f(1)\rangle)$.
I'm curious why the normalization for the second state, $\frac1{\sqrt2}(|0,f(0)\rangle+|1,f(1)\rangle)$, is also $\frac1{\sqrt2}$. And what's the intuition behind this?
"
"['programming', 'qiskit', 'ibm-q-experience']"," Title: Can I use `job_manager` to get memories for 3 parts of the experiment?Body: Here's part of the code I'm working on:
all_circuits = []
for _ in range(100):
all_circuits.extend([quanc_z,quanc_x,quanc_y])
all_circuits = transpile(all_circuits, backend=backend)
MExperiments = job_manager.run(all_circuits, backend=backend, shots = 1024)
results = meas_filter.apply(MExperiments.results())
memory_z = results.get_memory()
memory_x = results.get_memory()
memory_y = results.get_memory() # Question
I have a list of quantum circuits all_circuits composed of the repeating circuit sequence quanc_z(,x,y) and I'm trying to run them using qiskit job_manager. I applied the readout error mitigation to the results and I want to get the memories of each quantum circuit in all_circuits, and combine the memories with the same label z,x,y on their associated circuits. I wonder is there a way I can get the memory for each circuit that I submitted in a bundle using job manager? Thanks for the help!!
"
"['complexity-theory', 'quantum-advantage', 'clifford-group', 'bqp', 'gottesman-knill']"," Title: How powerful are boundedly many $T$-gates?Body: For a natural number $k$ (0 is a natural number), let $T_k$ be the collection of all languages that can be efficiently decided by quantum circuits consisting of Clifford gates and at most $k$ $T$-gates (that is, we modify the definition of $BQP$ so all circuits consist only of Clifford gates and at most $k$ $T$-gates).
Is it possible to show that $T_k \subsetneq T_{k+1}$ for each $k$? In particular, can we show that $T_0 \subsetneq T_1$?
"
"['programming', 'qiskit', 'quantum-circuit', 'transpile']"," Title: How is quantum transpilation scaled?Body: While thinking about a quantum transpiler's working I had a pretty basic doubt. Say that we are trying to transpile an $n$ qubit circuit where $n > 100$. What transpiler does is that it first tries to find a mapping, decompose the gates into basis set of the quantum computer and then tries to optimize the circuit for a reduced depth. My question is that since transpilation is done classically, isn't there going to be a limit to the circuits that we can optimize?
My understanding is that if we want to optimize the running of a quantum circuit and try to reduce its gate count or depth, won't we need to have $2^n \times 2^n$ size tensors in memory for that to be carried out? We would try to see if a particular computation is redundant or a better gate sequence can carry out the same with a lesser number of gates.
Or is it carried out through pure textual formats eg. optimizations based on a sequence of gate names instead of matrices? Sorry if I'm missing something fundamental here.
Thanks!
"
"['qiskit', 'quantum-state']"," Title: How to access/ read $\alpha$ and $\beta$ values of a certain qubit in a multi-qubit system in a for loop?Body: In order to rotate the qubit state I need first to be able to read the values of $\alpha$ and $\beta$ and based on their values I will apply the Q-Gate for rotating the states of the single Qubits in the multi-qubit system I have.
Does anyone have an idea how to read these values?.
Using an Aer simulator reads the angles but only once, while I need to read and manipulate the states in a for loop so the simulator gives me the following error in the second run of the loop:
QiskitError: 'You have to select a circuit or schedule when there is more than one available'
"
['zx-calculus']," Title: ZX-calculus: pi-copy rule not required for completeness?Body: In ZX-calculus, the $\pi$-copy rule is quite famous, and is used for instance here:
However, this paper never introduces this rule, and says that this set is enough to prove the Clifford completeness of the ZX calculus:
Is it just that they forgot it, or is this rule derivable from others?
"
"['mathematics', 'universal-gates', 'reversible-computation']"," Title: How universal is the Toffoli gate for classical reversible computing?Body: It is easy to see that no finite set of classical reversible gates can be strictly universal (without ancilla) for classical reversible computation: for any reversible gate on $n$ bits, in its action on $n+1$ bits it induces an even permutation, and so cannot achieve an arbitrary permutation of the set $\{0,1\}^{n+1}$ in any combination.
With sufficiently many ancillary bits, the Toffoli gate can achieve arbitrary permutations; this is described many places, starting with Toffoli's original paper. (The standard construction as he describes it uses $n-3$ ancillary bits for computations on $n$ bits.)
But how close can you get? Specifically, for, say, the Toffoli gate plus NOT gates (or equivalently arbitrary 3-bit gates), can you achieve an arbitrary even permutation of $\{0,1\}^n$ for any $n > 3$?
Related, I've seen claims that a single ancillary bit suffices to make the Toffoli gate universal; is there a good reference for that? (That is a weaker result, of course.)
(I'm asking about classical reversibility, so maybe the question should be redirected. This sign-of-permutation argument explains why any proof of strict quantum universality needs to use a non-permutation matrix in bootstrapping from operations on a finite set of qubits to general circuits.)
"
"['programming', 'qiskit']"," Title: Callback in VQC does not return correct float value for objective function evaluationBody: The callback for the VQC class is defined as:
callback (Optional[Callable[[ndarray, float], None]]) – a reference to a user’s callback function that has two parameters and returns None. The callback can access intermediate data during training. On each iteration, an optimizer invokes the callback and passes current weights as an array and a computed value as a float of the objective function being optimized. This allows to track how well the optimization / training process is going on.
The function that I am passing to that argument is:
weights = []
loss = []
def store_intermediate_result(current_weights, current_loss):
print(current_loss)
weights.append(np.copy(current_weights))
loss.append(current_loss)
However, the loss value passed back is always the same. I had this issue before with the weights, however, when I printed the weights they were different. So it was a problem of just copying the array as you can see in the code sample. But with the loss values, they are always the same no matter what I do.
The vqc code is as follows:
vqc = VQC(feature_map=feature_map,
ansatz=ansatz,
loss='cross_entropy',
optimizer=AQGD(maxiter=5),
quantum_instance=QuantumInstance(Aer.get_backend('aer_simulator_statevector')),
callback=store_intermediate_result)
EDIT: The problem seemed to be the optimiser used. COBYLA works but AQGD does not. The issue has been raised on GitHub.
"
"['grovers-algorithm', 'tensor-product', 'probability']"," Title: Negative Probability — Reality vs DescriptionBody:
I understand that quantum physics supports the concept that the probability of a qubit collapsing into (say) 1, can be negative or positive… and that quantum computing uses this as a feature, adding opposing probabilities together to cancel them out. [If that is wrong, please say so; I understand that to be fundamental.]
I have been trying to understand Grover’s Algorithm. Apparently, it is all about an “unknown” diagonal matrix — “U” — with only 1 of $-1$, and every other (diagonal) position being $1$.
Broadly, I can see how the algorithm works to amplify the (“unknown”) negative value, relative to the other values. (I have not yet strained by brain to figure out the “second Grover step”, that takes the negative and makes it large and positive.)
What is bothering me is thinking about what would actually happen, in an actual quantum computer, if one performed the operation that was represented by the above “U” matrix.
The thing is… I am pretty confident that matrices and tensor products are strictly confined to the representation of what goes on inside a quantum computer. One can not find tensor products (nor matrices) by looking inside a quantum computer, so to speak. (Of course, that is not to deny that the former do represent the latter.) [Again, if that is wrong, please say so.]
Suppose we perform the first couple of steps in the Grover Algorithm. (Stipulatively) the correct answer is {11}, and that would be represented by the tensor product {0001} — the 4th item is marked as the value represented by those q-bits. Thus, our diagonal matrix has {1,1,1,-1}.
We set our q-bits to 0, and put them into superposition [which of course changes all the items in the tensor product], and perform U. This marks the 4th item in the tensor product with a “-” sign.
Again, quantum physics supports quantum computing having probabilities with a negative sign associated with them… but the concept of the tensor product having a negative sign exists only within the descriptive system of matrices and tensor products [as I understand it]. (That is… it might represent something, but it does not represent a negative probability in a q-bit.) Thus, the tensor product tells us that there is an equal probability of the four possible outcomes — {00}, {01}, {10} and {11}. It is not possible to say that the tensor product marks the {11} as having negative probability — as a statement about the pertinent q-bits — as that would violate factorisation [I think]. (How would it be if we had 8 q-bits, and we marked “10011011” as negative? If we make all the pertinent q-bit probabilities negative, this must surely affect the other product items that include them… not to mention that they would cancel themselves out. If we mark only 1 value for 1 q-bit as negative, that would make half of the tensor product negative, not just 1 item… not to mention the fact that the negative item in the tensor product is picking out (something about) every q-bit.)
The tensor product supports negative probabilities, and quantum computing supports negative probabilities… but the negative probability in the tensor product does not directly represent a negative probability in one q-bit… because each and every item in the tensor product represents every q-bit. If, conversely, it does affect one of the two probabilities in every q-bit, that would make negative every product with an odd number of those marked probabilities.
The point is that applying the described function (U) in an actual quantum computer appears to me to lose the negative sign.
What gives, please?
"
"['grovers-algorithm', 'hadamard', 'superposition', 'probability']"," Title: Applying Hadamard gate to $\sqrt{3/4}|0\rangle + \sqrt{1/4}|1\rangle$Body: [I am just transferring this from Stack Overflow. It might need editing.]
————
[The reader can skip to “It all sounds fine…”, before the spreadsheet representation.]
I am trying to figure out quantum computing from YouTube videos, and pdf’s from universities, and odd bits here and there.
I have been confident that the two values in any q-bit must add to 1 — that is, their squares must.
Pertinent (or related) to Grover’s Algorithm, I have been trying to figure out the procedure for multiplying [i.e. increasing] the amplitude of the one q-bit, relative to the others. (I mostly follow the trigonometry; it is the matrix side I am having trouble with… mostly because I am having trouble getting a handle on the syntax of the algebra.)
(I have been working from the following page.)
https://drive.google.com/file/d/14G_0TwdxBFpI_Ylj5lb_imVtcnunrQcB/view
I think I understand the “reflection around |0〉” part — just flip the sign on the p[robability]|1〉 part.
(Incidentally, I take it that the pertinent q-bits still add to 1, through ignoring their signs?)
That leaves the “reflection around |ψ〉” part. I have just found an account that is meaningful to me (rightly or wrongly!), on this page (straddling pp5 and 6).
https://theory.epfl.ch/courses/topicstcs/Lecture112016.pdf
If I understand correctly, it says that one • applies a Hadamard Gate, • reflects around |0〉 (as above), and • applies a Hadamard Gate (again). (I have not mentally conceptualised this yet.)
It all sounds fine. The issue is that, when I try applying a Hadamard Gate to a biased superposition — {3/4,1/4} as opposed to {1/2,1/2} — the resulting probabilities (i.e. their squares) do not add to 1.
EDIT_01
- My spreadsheet is as follows.
Columns A, B… D… F.
A ----------- B ----------… D -----------… F
= sqrt(0.5), = sqrt(0.5)… = sqrt(3/4)… =(A1*D1)+(B1*D2)
= sqrt(0.5), =-sqrt(0.5)… = sqrt(1/4)… =(A2*D1)+(B2*D2)
. Clmn(F) =SUM(F1,F2)
Respectively, for • all SQRT (as above), • SQRT(X/4), • SQRT(0.5) and • no SQRT…
I get 1.225…, 0.866…, 1.06… and 0.75. (Of course, only one of those is “correct” — the first one, I believe — the point here is that this is not my/the error.)
Is my spreadsheet wrong, or is my rendition of matrix multiplication wrong, or is it in fact true that applying a Hadamard Gate to anything other than 0, 1, or 50/50 results in mayhem… or is it okay for a q-bit to have a total probability < 1… please?
"
"['error-correction', 'resource-request', 'fault-tolerance', 'state-distillation', 'magic-states']"," Title: Good references to learn magic state distillation for fault toleranceBody: I need to learn magic state distillation procedure and their application to fault-tolerance.
One of the original paper on this subject is the following: https://arxiv.org/pdf/quant-ph/0403025.pdf
I am wondering if there are more recent and pedagogic resource to learn this concept in an efficient manner (I know fault-tolerance with concatenated codes, but I need to learn how to do the non-clifford through magic states procedures).
"
"['quantum-state', 'density-matrix', 'quantum-advantage', 'probability', 'haar-distribution']"," Title: Average output state of random quantum circuitsBody: Let $|\psi\rangle = C_1 |0^{n}\rangle$ be a quantum state, such that $C_1$ is a Haar random unitary circuit. Consider a density matrix $\rho$ as follows
\begin{equation}
\rho_1 = \mathbb{E}[|\psi\rangle\langle \psi|],
\end{equation}
where the expectation is taken over the circuits.
Now, consider another family of states $|\phi\rangle = C_2 |0^{n}\rangle$, where $|\phi\rangle$ is a sufficiently deep random quantum circuit, comprising of layers of local one and two qubit random unitaries drawn from the Haar measure, such that the output distribution of $C_2$ when measured in the standard basis is a Porter-Thomas distribution. In other words, it is a type of circuit used in the Google quantum supremacy experiment. Let
\begin{equation}
\rho_2 = \mathbb{E}[|\phi\rangle\langle \phi|],
\end{equation}
where the expectation is taken over all circuits of type $C_2$.
I am trying to show that
\begin{equation}
\rho_1 = \frac{\mathbb{I}}{{2^{n}}},
\end{equation}
and that the trace distance of $\rho_1$ and $\rho_2$ is very small.
That $\rho_1$ is the maximally mixed state is qualitatively easy to see --- $\rho_1$ is essentially a uniform distribution over all possible quantum states. But I could not do this mathematically.
"
['qiskit']," Title: Hi My Dears, I was working on the Quadratic Equation Solution Technique Using Quantum?Body: I was working on the Quadratic Equation Solution Technique Using Quantum ? But it seems to me that there might be no Quantum Benefit for it.
If anyone can kindly code this in a cleaver way , Please do kindly do it.Please do kindly read this file to understand
"
"['architecture', 'terminology', 'technologies']"," Title: What constitutes a quantum database?Body: Newb question, I know it's broad. I'm coming here for validated pointers, so I can know what to read. I have QT for CS (Yanofsky, Mannucci) and am reading about Shannon and Von Neumann entropy, but I'm still not sure what we mean when we say a quantum database. My understanding that all models are Turing reducible, so does it matter what medium a quantum database is in?
- What do we mean by quantum database?
Search for tags here shows no database tag, which gives me a little information, but google still feels not reliable for a beginner.
"
"['quantum-circuit', 'quantum-advantage', 'contextuality', 'peres-mermin-square']"," Title: How can one define contextuality within the circuit model?Body: It is in general believed that contextuality is one of the quantum resource that provides the quantum advantage. A context is usually defined in terms of a set of commuting observables. The quantum algorithms are usually describe employing the circuit model. I am curious how can one define contextuality in the within the circuit model?
To be concrete, we may consider Peres-Mermin Square and define a circuit representing each observable at each spot. I think the above definition of contextuality require some upgrading while combining all the gates to implement quantum contextuality for Peres-Mermin square. Please share any suggestion or any reference that can be help as a starting point.
Spekken (2005) generalizes the above definition of contextuality. Could we apply Spekken definition for a circuit model too?
"
"['quantum-operation', 'information-theory', 'unitarity', 'kraus-representation']"," Title: How does the Kraus decomposition imply the Stinespring representation?Body: To show that the Kraus decomposition $\Phi(\rho)=\sum_{k=1}^D M_k\rho_S M_k^\dagger$ implies the Stinespring form $$\Phi(\rho)=\text{tr}_E[U_{SE}(\rho_S\otimes|0\rangle\langle 0|_E)U_{SE}^\dagger]$$ we first introduce an orthonormal basis $\{|k\rangle_E\}$ for $\mathcal H_E$ and choose a ket $|0\rangle_E$ (for simplicity, this can be done by increasing the dimension of $\mathcal H_E$ to $D+1$ in such a way that $|0\rangle_E$ is actually orthogonal to all $|k\rangle_E$), then we define the operator $U_{SE}$ by the action $$U_{SE}(|\psi\rangle_S\otimes |0\rangle_E)=\sum_{k=1}^D M_k|\psi\rangle_S\otimes |k\rangle_E.$$ Two things are not very clear to me: first, how to go from Kraus to Stinespring using this definition, and secondly how to show that $U_{SE}$ is unitary on all kets in $\mathcal H_{SE}$ when only the action on the hyperplane $|\psi\rangle_S\otimes |0\rangle_E$ is defined. I'd appreciate some pointers as to how to do both.
"
['quantum-optics']," Title: How to connect the idea of inner product, outer product, matrix element in 3 level composite system?Body: I was solving steady state solution given by Lindblad equation, and I got stuck on the calculation part like what will be the value of $\langle e, 0|b, 0\rangle$?
And how should I rewrite $|d, 0\rangle\langle e, 0| \rho |e, 0\rangle\langle d, 0|$,
where, $\rho$ is a density matrix.
The possible transition is given in the attached image
Also, you can look into this article I am referring to.
"
"['quantum-operation', 'kraus-representation', 'foundations']"," Title: What is the rank of a quantum channel?Body: I read the following sentence in a paper:
We consider a quantum channel $\mathcal{E}_{\omega}(\rho)=\sum_{i=1}^{r} K_{i} \rho K_{i}^{\dagger}$ where $r$ is the rank of the channel.
I didn't find the definition of the rank of the quantum channel online. So I guess the meaning is that the rank of the quantum channel is the number of Kraus operators we used to describe the quantum channel? If it is right, is there the maximum number of the Kraus operators to describe a quantum channel?
"
"['textbook-and-exercises', 'nielsen-and-chuang']"," Title: In Nielsen & Chuang, shouldn't $P=\sum_{i=1}^k|i\rangle\!\langle i|$ in (2.35) equal the identity?Body: Nielsen and Chuang define Projectors as:
An operator $A$ whose adjoint is $A$ is known as a Hermitian or self-adjoint operator. An important class of Hermitian operators is the projectors. Suppose $W$ is a $k$-dimensional vector subspace of the $d$-dimensional vector space $V$. Using the Gram-Schmidt procedure it is possible to construct an orthonormal basis $\vert 1\rangle,\ldots ,\vert d\rangle$ for $V$ such that $\vert 1\rangle,\ldots ,\vert k\rangle$ is an orthonormal basis for $W$. By definition, $$P=\sum_{i=1}^k \vert i\rangle\langle i\vert\tag{2.35}$$
I have a basic doubt - (I think I am missing something simple, so please excuse my limited understanding): Since it is a sum over all orthonormal basis for $W$, should this not be the Identity, $\mathbb I$, according to the Completeness Relation?
"
"['quantum-operation', 'information-theory']"," Title: Prove that autocompatible LCPT maps are antidegradableBody:
A LCPT map $\Phi$ is antidegradable if and only if it is compatible with itself.
The proof that an antidegradable map (satisfying $\Phi=\Lambda_E\circ \tilde\Phi$ where $\tilde\Phi$ is the complementary map and $\Lambda:\mathscr S(\mathcal H_E)\to \mathscr S(\mathcal H_S)$ is an LCPT map) is autocompatible is pretty easy: just consider the operator $$ \Psi=(\mathbb I_S\otimes\Lambda_E)\circ(U_{SE}(\rho_S\otimes\tau_E)U_{SE}^\dagger)$$ and notice that $\Phi=\text{tr}_S[\Psi]=\text{tr}_E[\Psi]$. Is there a simple proof for the reverse implication?
"
"['unitarity', 'qutrit']"," Title: Can a triplet be a qutrit?Body: Original question
A triplet is a space that consist of three states that have the same total angular momentum (spin 1). If we restrict ourselves to a set of quantum gates that keep triplet states in that space, what are the limitations for doing computation?
As I understand it, a triplet is not enough for a qutrit. Qutrit operations would be in U(3) which is larger than the triplet-preserving space(?). Apparently, some unitary gates in U(3) would send a triplet state outside the triplet basis. So implicitly my question is what is that triplet space and whether any meaningful computation can be done with just triplet-preserving gates?
The generators of rotations (angular momenta $L_x,L_y,L_z$) for spin 1 are already not-unitary see the matrices here Confusion about rotations of quantum states: 𝑆𝑂(3) versus 𝑆𝑈(2) - PSE. But I guess that’s not important as the generators of SU(3) are not unitary either.
Revised question
After more research I am wondering triplet$=$qutrit. I thought of that not being the case because I thought angular momentum algebra on triplets was not unitary, suggesting I could generalize the $L_x,L_y,L_z$ as gates, the same way that is done with 2-level systems. Yet to generate SU(3), the generators cannot work as gates either.
Also any unitary operation in this space would just create a linear combination of triplets, that conserve total spin 1. So can I use the states of a triplet as a qutrit or am I missing something?
"
"['error-correction', 'noise']"," Title: If there is quantum noise, can a time interval be short enough that only one-qubit errors (eg. as in the Shor code) occur?Body: The Shor code can be used to protect against an arbitrary one-qubit error. If the time interval over which quantum noise acts is short enough, can it be assumed only one-qubit errors occur, so one does not have to deal with two-qubit errors, etc.
"
"['textbook-and-exercises', 'density-matrix', 'information-theory', 'probability']"," Title: Can all mixed states be written as a convex combination $\rho=\sum_j p_j |\psi_j\rangle\langle \psi_j|$?Body: States belonging to some space $\mathcal H$ can be described by density operators $\rho\in L(\mathcal H)$ that are positive and have trace one. Pure states are the ones that can be written as $\rho=|\psi\rangle\langle \psi|$ for some $|\psi\rangle\in\mathcal H$, all others are said to be mixed.
My question is twofold:
- can all mixed states be written as a convex combination $\rho=\sum_j p_j |\psi_j\rangle\langle \psi_j|$ given an ensemble of pure states $\{|\psi_j\rangle\langle\psi_j|\}$ and a probability distribution $p_j$? To elaborate: given $\rho=\sum_j p_j \rho_j$ where $\rho_j$ is not necessarily pure, can it always be written in the form above?
- if all $\rho$ admit a spectral decomposition $\rho=\sum_k \lambda_k|k\rangle\langle k|$ in an orthonormal basis $\{|k\rangle\}$ of $\mathcal H$, how do I distinguish between pure and mixed states in this form?
"
"['quantum-gate', 'matrix-representation', 'clifford-group', 'qutrit']"," Title: What is the set of generators for the qutrit Clifford group?Body: According to this article, any Clifford gate, acting on $n$ qubits, can be generated by Hadamard, CNOT, and S gates.
What are the set of generators for qutrit Cliffords?
"
"['quantum-gate', 'information-theory', 'fidelity', 'gate-fidelity']"," Title: What are the ""higher moments"" of the gate fidelity?Body: Reading the paper Gate fidelity fluctuations and quantum process invariants I came across the concept of higher moments of the gate fidelity, for example in the following excerpt from the introduction:
In this paper, we calculate the variance of the gate fidelity analytically and discuss how it might be measured in experiments (as well as challenges to doing so!). Moreover, we develop a general method for calculating higher moments of the gate fidelity, which can be applied to other purposes.
However, I couldn't find this concept defined anywhere. From some questions on this site, I found out that Cirq uses the concept of moments to define its circuits which are collections of operations that act during the same "abstract time slice". Do moments of the gate fidelity have something to do with this notion of moments? If not, then what are the moments of gate fidelity mentioned in the paper?
Note that in section IV of the same this concept is discussed using what is derived in the earlier parts of the paper. However, I'm looking for a more conceptual definition of higher order moments before going into the mathematical details of them and the paper in general.
Any kind of reference that talks about this concept also helps.
"
"['cryptography', 'blind-quantum-computing']"," Title: What is the computational complexity limitation of classical client delegated quantum computing CCDQC protocols?Body: The number of T-gates in quantum search reaches $O(2^{m/2} \cdot\text{poly}(m))$, which is beyond the capability of CHE-based QHE schemes.
But is it the same case for other bilnd QC protocols? and What is the computational complexity limitation of the remote state preparation protocols that enable a fully classical client to delegate a computation to an untrusted quantum server securely?
"
"['algorithm', 'deutsch-jozsa-algorithm', 'oracles']"," Title: Is this a valid implementation of the balanced Deutsch-Jozsa oracleBody: Is it correct to implement a balanced Deutsch-Jozsa oracle by CNOTing the first qubit with the last one (the ancilla qubit), it would get you a balanced output.
And if it's valid why is it not commonly implemented like this in examples and books.
"
"['quantum-gate', 'hadamard', 'superconducting-quantum-computing']"," Title: Are composite gates within superconducting hardware implemented as a single pulse or as a series of pulses?Body: If we have for example a gate $U^{\otimes2}$, then within superconducting hardware, is the $U$ applied onto the first qubit and then the second or is a pulse corresponding to a composite gate (tensor product matrix) created which is applied onto both?
"
['no-cloning-theorem']," Title: Can all kinds of pure non-entangled states be cloned?Body: Is it correct to say that for an $n$-qubit system, we can clone all kinds of pure non-entangled states, without violating the no-cloning theorem?
That is, is the correct interpretation for the proof of cloning theorem shown here, to be that if such a cloning operator $U$ exists, such an operator $U$ would not be a linear operator, but nonetheless $U$ can still act on only non-entangled, mutually orthogonal states?
Entangled linear superpositions of those states in the set are not included instead, because then $U$ would not be a linear operator.
Thank you for your help!
"
['magic-states']," Title: Why are there eight $T$ magic state and twelve $H$ magic states?Body: I am learning magic state distillation.
We can define the following two states:
$$ |T\rangle \langle T | = \frac{1}{2}(I+\frac{1}{\sqrt{3}}(\sigma_x+\sigma_y+\sigma_z))$$
$$ |H\rangle \langle H | = \frac{1}{2}(I+\frac{1}{\sqrt{2}}(\sigma_x+\sigma_z))$$
From those states, we can define the $T$ and $H$-type magic states as respectively the set of states $\{ U |T \rangle\langle T| U^{\dagger}| U \in C_1\}$ and $\{ U |H \rangle\langle H| U^{\dagger}| U \in C_1\}$, where $C_1$ is the Clifford group.
In this paper, it is claimed that there are eight magic states of the $T$ type, and twelve of the $H$ type.
I could do some "brute force" calculation to check that with mathematica. But I wondered if there is a way to understand it easily ?
Initially I tried the following: if I act with Clifford element, each the Pauli matrices entering for instance for $|H\rangle \langle H | $ would be changed in another single qubit Pauli matrix (up to $\pm 1$ or $\pm i$) and I then simply have to count for all the possibilities. But it seems more complicated than that. Indeed, for instance $\sigma_x + \sigma_y$ cannot be changed to $\sigma_z + \sigma_z$ by acting with a Clifford element (the $|H\rangle \langle H|$ wouldn't be pure anymore which is absurd). Thus the counting seems more complicated because some combination are actually impossible to occur and it does not seem easy at first view to find which one. This is probably not doable without brute-force but as I am not sure (there is probably some smart way to show it), I am asking here.
"
"['error-correction', 'stabilizer-code']"," Title: Do stabilizers of Shor's 9-qubit code all have eigenvalue 1?Body: I am watching a recorded seminar on Youtube given by Prof.Daniel Gottesman.
At 38:39 he claims that $$M_{1}=Z_1 Z_2,\\ M_{2}=Z_2 Z_3,\\ M_{3}=Z_4 Z_5,\\ M_{4}=Z_5 Z_6,\\ M_{5}=Z_7 Z_8,\\ M_{6}=Z_8 Z_9,\\ M_{7}=X_1 X_2 X_3 X_4 X_5 X_6,\\ M_{8}=X_4 X_5 X_6 X_7 X_8 X_9$$ all have eigenvalue 1. So that they can generate the group, which is the stabilizers of the 9-qubit code.
I think for all $M_j$ for $j=1,...,9$ can have eigenvalues 1 and -1, not only 1.
Do I miss something here?
"
['error-correction']," Title: Definition of distance d of the QECC $T(S)$Body: Definition of distance $d$:
$d$ of $T(S)$ is the weight of the smallest Pauli operator $N$ in $N(S)$ \ $S$.
$S$ is the stabilizer, $T(S)$ is the corresponding QECC, and $N(S)$ are all errors commute with elements in S.
I am confused about this definition, especially about the "weight".
I'd really appreciate it if someone could help clarify it!
"
"['mathematics', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Prove that rank one projectors have the same partial trace iff they differ by a local unitary operationBody: In nielsen and chuang's QCQI book, there is a theorem called Unitary freedom in the ensemble for density matrices, which states that the sets $|\psi_i\rangle$ and $|\phi_i\rangle$ generate the same density matrix iff
$$
|\psi_i\rangle=\sum_iu_{ij}|\phi_j\rangle.
$$
And I also found something interesting with respect to the reduced density matrix, which I stated as a theorem while I only prove a part of it and leave another part of it as the problem of the pose:
Theorem $Tr_B|\Psi\rangle_{AB}\langle\Psi|=Tr_B|\Phi\rangle_{AB}\langle\Phi|$ iff $|\Psi\rangle_{AB}=I\otimes U|\Phi\rangle$.
It's easy to see if $|\Psi\rangle_{AB}=I\otimes U|\Phi\rangle$, then the first part of the theorem is right, while I don't know how to prove the reverse of the theorem is true. (P.S. The theorem is inspired by the unitary freedom in the ensemble of density matrices, so it might not be true.)
"
['stabilizer-code']," Title: What is the projective measurement operator for a stabilizer?Body: I am learning about the stabilizer. And for a stabilizer $A$, its eigenspace with $\lambda=1$ corresponds to no-error condition while the eigenspace with $\lambda=-1$ corresponds to errored condition.
And I read it that we can define the projective operators regarding $A$ as follows:
$P_+^A=\frac{I+A}{2}$
$P_-^A=\frac{I-A}{2}$
For an arbitrary state $|\Psi>$, there is $|\Psi> = P_+^A|\Psi>+P_-^A|\Psi>$
I think the completeness $|\Psi> = P_+^A|\Psi>+P_-^A|\Psi>$ is clear based on the definition of $P_+^A$ and $P_-^A$.
But I don't know why $P_+^A$ and $P_-^A$ project $|\Psi>$ into states with eigenvalue 1 and -1. For example, from the definition of $P_+^A$, the eigenvalue of the projected state could be either 1 or 0, and so does $P_-^A$.
Some explanation about how to define the projectors regarding a stabilizer and how projected states relate to no-error and error conditions would really help!
"
['density-matrix']," Title: How to combine/calculate for interference using density matrices?Body: Let's assume following two density matrices are corresponding to the A and B in the Stern-Gerlach apparatus bellow (I know Stern-Gerlach is a more of a physics experiment but I think it can equally be considered a quantum computing problem):
$\rho_A=\frac{1}{2}\begin{pmatrix}1&1\\1&1\end{pmatrix}$
$\rho_{B}=\frac{1}{2}\begin{pmatrix}1&-1\\-1&1\end{pmatrix}$
We also have the following two projection operators:
$p_{z+}=\begin{pmatrix}1&0\\0&0\end{pmatrix}$
$p_{z-}=\begin{pmatrix}0&0\\0&1\end{pmatrix}$
In such case how should we calculate and combine the density matrices to find out the very last Z device output?
It seems to me that the result has to be $\begin{pmatrix}1&0\\0&0\end{pmatrix}$, but I don't know how this calculation has to be done so that it takes into account the interference, in a coherent way!
"
"['qiskit', 'quantum-gate', 'teleportation']"," Title: Applying $R^{'\dagger}_{xz}$ in gate teleportationBody: In figure 4 of the paper Quantum Teleportation is a Universal Computational Primitive, the authors show a circuit for applying a unitary $U$ fault-tolerantly via teleportation. I'll paste the figure below for easier reference:
However, our teleportation construction provides a straightforward way to produce any gate in $C_3$, as shown in Fig. 4. For $U \in C_3$, first construct the state $$|\Psi^n_U\rangle = (I \otimes U)|\Psi^n\rangle.$$
Next, take the input state $|\psi\rangle$ and do Bell basis measurements on this and the $n$ upper qubits of $|\Psi^n_U\rangle$, leaving us with $n$ qubits in the state $$|\psi_{out}\rangle=UR_{xz}|\psi\rangle = R^{'}_{xz}U|\psi\rangle.$$
where $R_{xz}$ is an operator in $C_1$ which depends on the (random) Bell basis measurement outcomes $xz$, and $R^{'}_{xz}$ is an operator in $C_2$: the image of $R_{xz}$ under conjugation by $U$. Since $R^{'}_{xz}$ is in the Clifford group, it can be performed fault-tolerantly. As long as $|\Psi_U^n\rangle$ can be prepared fault-tolerantly, this construction allows $U$ to be
performed fault-tolerantly.
$C_1$ is the Pauli group, $C_2$ the Clifford group, and $C_3$ is defined as $C_3 \equiv \{U|UC_1U^\dagger \subseteq C_2\}$.
I was trying to implement the circuit in Qiskit and couldn't make it work. I think the problem I'm having is about $R_{xz}$ and $R^{'}_{xz}$. First of all, they are not giving a concrete definition of these gates, so I just assumed they were the same as the gates applied on the normal state teleportation circuit. That is, an $X$ gate controlled on the measurement result of the top qubit followed by a $Z$ gate controlled on the result of measuring the second qubit. In this case, $R_{xz}=Z^{z}X^{x}$ which in turn means that $R^{'}_{xz}=UZ^{z}X^{x}U^{-1}$.
However, this would defeat the purpose of the teleportation protocol since it'd involve applying $U$ and $U^{-1}$ which is exactly what we are looking a workaround for. (Note that applying $U$ is allowed before the dotted line in the circuit since it is part of state preparation which can be performed fault-tolerantly as described on the appendix of the linked paper.) Therefore, I think I might have two things wrong: 1) the definition of $R_{xz}$ and 2) how is the gate $R^{'\dagger}_{xz}$ actually applied and controlled.
It'd be great if anyone can point me in the right direction regarding these two concerns. Any links to more recent literature regarding these protocols or a variant of it are also very welcome. Or if you already have a working implementation of this protocl on Qiskit, I'd be happy to look at it.
"
"['quantum-gate', 'hamiltonian-simulation']"," Title: Is the square-root-of-SWAP for a pair of 4-dimensional qudits isomorphic to two square-root-of-SWAPS for two pairs of qubits?Body: This may be a very naïve question indicative of a lot of confusion, but I am trying to understand more about Hamiltonian simulation. I'm starting to intuit that the $n^{th}$-root-of-SWAP acting on a single pair of qubits somehow corresponds to what's meant by Hamiltonian simulation of a SWAP gate (much as a Lie algebra is to a Lie group). But what about the $n^{th}$-root-of-SWAP qutrits or qudits, with $d=4?$
For example consider a pair of SWAP gates acting on four qubits; the first SWAP gate swaps the first two qubits, and the second SWAP gate swaps the second two qubits. That is, consider a two-qubit gate such as $\mathsf{SWAP}\otimes\mathsf{SWAP}$.
The $16\times 16$ matrix $\mathsf{SWAP}\otimes\mathsf{SWAP}$ of such a gate may be as below:
$$\mathsf{SWAP}\otimes\mathsf{SWAP}=\begin{pmatrix}
1 & & & & & & & & & & & & & & & &\\
& & 1 & & & & & & & & & & & & & &\\
& 1 & & & & & & & & & & & & & & &\\
& & & 1 & & & & & & & & & & & & &\\
& & & & & & & & 1 & & & & & & & &\\
& & & & & & & & & & 1 & & & & & &\\
& & & & & & & & & 1 & & & & & & &\\
& & & & & & & & & & & 1 & & & & &\\
& & & & 1 & & & & & & & & & & & &\\
& & & & & & 1 & & & & & & & & & &\\
& & & & & 1 & & & & & & & & & & &\\
& & & & & & & 1 & & & & & & & & &\\
& & & & & & & & & & & & 1 & & & &\\
& & & & & & & & & & & & & & 1 & &\\
& & & & & & & & & & & & & 1 & & &\\
& & & & & & & & & & & & & & & 1 &\\
\end{pmatrix}.$$
Notice that $\mathsf{SWAP}\otimes\mathsf{SWAP}$ is unitary (by virtue of it being a permutation matrix) and also hermitian (by virtue of it being symmetric around the diagonal). This I believe is isomorphic to a SWAP gate acting to swap a pair of qudits ($d=4$).
I'd like to see if I can somehow do a local Hamiltonian simulation to simulate such a gate, which may be part of a larger simulation. For example, I'd like to act locally on one of the pairs of qubits, and also act locally on the other of the pair of qubits; but I'm not sure if I'm missing something. The matrix $\mathsf{SWAP}\otimes\mathsf{SWAP}$ does not seem to be composed of a sum of two separate hermitian matrices.
Nonetheless, it might make sense to simulate such a matrix with repeated applications of an "$n^{th}$-root-of-SWAP" on the first pair of qubits and an "$n^{th}$-root-of-SWAP" on the second pair of qubits?
Is $\sqrt {\mathsf{SWAP}}$ acting on a pair of 4-dimensional qudits isomorphic to $\sqrt {\mathsf{SWAP}}\otimes\sqrt{\mathsf{SWAP}}$ acting on two pairs of qubits?
"
"['programming', 'qiskit', 'circuit-construction', 'quantum-fourier-transform']"," Title: Qiskit's QFT not returning the expected stateBody: I'm currently going through the lab problems for the Qiskit course here. I'm trying to finish lab set number 3 on QPE but I can't seem to get the desired output, even from the solution notebook. I'm trying to estimate the phase of the following unitary:
$$ U_{\theta} = \left(\begin{matrix} 1&0\\ 0&e^{2\pi i \theta} \end{matrix}\right)$$
Specifically I want to implement a circuit for the case $\theta=0.5$ and I am using a 5 qubit estimation. Here is the code for the circuit:
import numpy as np
from qiskit.circuit.library import QFT
from qiskit import QuantumCircuit
pi = np.pi
def initialize_qubits(given_circuit, measurement_qubits, target_qubit):
given_circuit.h(measurement_qubits)
given_circuit.x(target_qubit)
def unitary_operator_exponent(given_circuit, control_qubit, target_qubit, theta, exponent):
given_circuit.cp(2*pi*theta*exponent, control_qubit, target_qubit)
def apply_iqft(given_circuit, measurement_qubits, n):
given_circuit.append(QFT(n).inverse(), measurement_qubits)
def qpe_program(n, theta):
qc = QuantumCircuit(n+1, n)
# Initialize the qubits
initialize_qubits(qc, range(n), n)
qc.barrier()
# Apply the controlled unitary operators in sequence
for x in range(n):
exponent = 2**(n-x-1)
unitary_operator_exponent(qc, x, n, theta, exponent)
qc.barrier()
# Apply the inverse quantum Fourier transform
apply_iqft(qc, range(n), n)
# Measure all qubits
qc.measure(range(n), range(n))
return qc
n = 5; theta = 0.5
mycircuit = qpe_program(n, theta)
mycircuit.draw(output='mpl')
This is a fairly standard phase estimation circuit and I don't see why it's not working (especially since it's in the solution manual).
The problem is when I run a simulator on this and get counts, the state $|{11111}\rangle$ shows up in half the instances and I can't for the life of me find out why (it should just be $|{00001}\rangle$ plus some small error). Here is the simulation code:
from qiskit import Aer, execute
simulator = Aer.get_backend('qasm_simulator')
counts = execute(mycircuit, backend=simulator, shots=1000).result().get_counts(mycircuit)
from qiskit.visualization import plot_histogram
plot_histogram(counts)
Here's a screenshot of the circuit and then the simulation results:
Notes: Running on Python v3.9.7 and Qiskit v0.29
"
"['projection-operator', 'eigenvalue']"," Title: What are the eigenvectors of the superoperator $[H,\cdot]$ with $H$ the Hamiltonian?Body: Let $\{A_\alpha\}$ be a set of hermitian operators and $\{\Pi(\varepsilon)\}$ a set of projectors on the (finite-dimensional) $\varepsilon$ subspace. Define $$A_\alpha(\Delta\varepsilon)=\sum_{\varepsilon\varepsilon'\atop{\varepsilon-\varepsilon'=\Delta\varepsilon}}\Pi(\varepsilon)A_\alpha\Pi(\varepsilon') $$
(notice how the sum is on every $\varepsilon$ and $\varepsilon'$ such that the difference of the two is $\Delta\varepsilon$). Given $H=\sum_\varepsilon\varepsilon\Pi(\varepsilon)$, I should prove that the $A_\alpha(\Delta\varepsilon)$ are eigenvectors of the superoperator $[H,\cdot]$.
My own calculations don't quite give the correct result... could anyone give a quick proof?
"
"['algorithm', 'mathematics', 'hamiltonian-simulation']"," Title: Wick rotation of the Schrödinger equationBody: Studying the following paper: https://www.nature.com/articles/s41534-019-0187-2.pdf
Trying to figure out how $ E_T$ shows up from (1) and (2).
Any suggestion or guidance would be appreciated.
We focus on many-body systems that are described by Hamiltonians $H=\sum_{i} \lambda_{j} h_{i}$, with real coefficients, $\lambda_{i}$, and observables, $h_{i}$, that are tensor products of Pauli matrices. We assume that the number of terms in this Hamiltonian scales polynomially with the system size, which is true for many physical systems, such as molecules or the Fermi-Hubbard model. Given an initial state $|\psi\rangle$, the normalised imaginary time evolution is defined by
$$
|\psi(\tau)\rangle=A(\tau) e^{-H \tau}|\psi(0)\rangle\tag1
$$
where $A(\tau)=1 / \sqrt{\left\langle\psi(0)\left|e^{-2 H \tau}\right| \psi(0)\right\rangle}$ is a normalisation factor. In the instance that the initial state is a maximally mixed state, the state at time $\tau$ is a thermal or Gibbs state $\rho_{T=1 / t}=e^{-H \tau} / \operatorname{Tr}\left[e^{-H t}\right]$, with temperature $T=1 / \tau$. When the initial state has a non-zero overlap with the ground state, the state at $\tau \rightarrow \infty$ is the ground state of $H$. Equivalently, the Wick rotated Schrödinger equation is,
$$\frac{\partial|\psi(\tau)\rangle}{\partial \tau}=-\left(H-E_{\tau}\right)|\psi(\tau)\rangle,\tag2$$
where the term $E_{\tau}=\langle\psi(\tau)|H| \psi(\tau)\rangle$ results from enforcing normalisation. Even if $|\psi(\tau)\rangle$ can be represented by a quantum computer, the non-unitary imaginary time evolution cannot be naively mapped to a quantum circuit.
"
"['qiskit', 'programming']"," Title: qiskit transpile initial_layout determinationBody: So, I am fairly new to Qiskit, and I've been following Qiskit textbook recently. In the chapter 7, where the QC lab exercises are located, in the first lab when working on the real hardware it is required to select the optimal initial_layout setting during the transpile function call based on the error map consideration.
Now, I understand that the initial layout governs how computational qubits map onto the physical qubits.
For instance, if we select hardware option with 5 qubits (e.g. ibmq_quito) and we designe a circuit with e.g. 4 qubits, with initial_layout we can specify any 4-element combination out of 5 possible elements. However, what I fail to understand is what exactly is the error map specified in the lab exercise. Does it mean to sweep all possible qubit configurations (c1 = [0, 1, 2, 3], c2 = [0, 1, 2, 4], c3 = [1, 2, 3, 4], ...) and pick the one with lowest noise impact, or a different approach must be taken?
I would appreciate any input on this.
"
"['quantum-circuit', 'quantum-advantage', 'probability', 'random-quantum-circuit', 'haar-distribution']"," Title: Random quantum circuits and general efficient POVM measurementBody: Let's consider a random quantum circuit $C$, applied to the $n$ qubit initial state $|0^{n}\rangle$, producing the state $|\psi\rangle$.
Consider a general efficiently implementable $m$-outcome POVM measurement $\{M_i : i = 0, 1, \ldots, m-1\}$. Let
\begin{equation}
p_i = \text{Tr}\big(M_i |\psi\rangle \langle \psi|\big).
\end{equation}
Is anything known, in general, about
\begin{equation}
\mathbb{E}[p_i] ~~\text{and}~~\mathbb{E}[p_i^{2}]
\end{equation}
where the expectation is taken over the choices of the random circuit?
I am especially interested in the case when the POVM elements $M_i$ describe an entangled multi-qubit measurement (which is efficiently implementable).
Note that for the special case of when the POVM corresponds to an $2^{n}$-outcome standard basis measurement, we know that
\begin{equation}
\mathbb{E}[p_i] = \frac{1}{2^{n}}, ~~~ \mathbb{E}[p_i^{2}] = \frac{2}{2^{n}(2^{n} + 1)}.
\end{equation}
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: What happens measuring the first qubit of a $GHZ$ state in the basis $\{|+\rangle, |-\rangle\}$?Body: This exercise ask me to explain what happens when the first qubit is measured in the diagonal base ($|+\rangle,|-\rangle$), considering this state:
$|GHZ\rangle=\dfrac{1}{\sqrt{2}} (|000\rangle+|111\rangle)$
How can I proceed?
"
"['entanglement', 'foundations']"," Title: How to deal with entanglement using quantum relativistic equations?Body: When discussing relativistic quantum mechanics, the single particle picture is dropped completely which makes the description of just two entangled particles difficult. However when discussing locality and causality, relativistic quantum mechanics should provide some insight.
However can some description be built from Dirac's equation or some relativistic formulation?
"
"['quantum-state', 'measurement', 'textbook-and-exercises']"," Title: Find expectation value of the observable $X_1\otimes Z_2$ for a maximally entangled two-qubit systemBody: In this exercise I need to find the expectation value of the observable $M=X_1 \otimes Z_2$ for two qubit system measured in the state $\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}$.
I know that $E[M]=\langle\psi|M|\psi\rangle$ = $\left(\dfrac{\langle00| + \langle11|}{\sqrt{2}}\right) M \left(\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}\right)$
But I'm having trouble finding the correct result (which is 0).
Thank you!
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation', 'foundations']"," Title: How does the spectral decomposition of the Choi operator relate to Kraus operators?Body: In Nielsen and Chuang's QCQI, there is a proof states that
Theorem 8.1: The map $\mathcal{E}$ satisfies axioms A1, A2 and A3 if and only if
$$
\mathcal{E}(\rho)=\sum_{i} E_{i} \rho E_{i}^{\dagger}
$$
for some set of operators $\left\{E_{i}\right\}$ which map the input Hilbert space to the output Hilbert space, and $\sum_{i} E_{i}^{\dagger} E_{i} \leq I$
To figure out the proof of it, I find in this paper that what Nielsen wants to do is the so called Choi-Jamiołkowski isomorphism. But I just don't understand why Choi operator in the paper I mentioned (eq.8) can be written as $M=\sum_{j}|K_{j}\rangle\rangle\langle\langle K_{j}|.$, where $|K_j\rangle\rangle\equiv I\otimes K_j^T|\Omega\rangle$, and $|\Omega\rangle$ is the unnormalized maximally entangled states, i.e., $\sum_n|n\rangle|n\rangle$.
The aim of eq.(8) is that we don't know if $\varepsilon$ is CP, i.e., we only know the correspoinding choi operator is positive semidefinite, and we want to prove the channel $\varepsilon$ is CP. And there comes eq.(8) which states that any positive semidefinite choi operator can be written as the form $\sum_j|K_j\rangle\rangle\langle\langle K_j|$.
Edit: Three axioms are(I originally thought they are not very related to the main question, so I didn't show it in the main post.):
A1: First, $\operatorname{tr}[\mathcal{E}(\rho)]$ is the probability that the process represented by $\mathcal{E}$ occurs, when $\rho$ is the initial state. Thus, $0 \leq \operatorname{tr}[\mathcal{E}(\rho)\rfloor \leq 1$ for any state $\rho$
A2: Second, $\mathcal{E}$ is a convex-linear $m a p$ on the set of density matrices, that is, for probabilities $\left\{p_{i}\right\}$,
$$
\mathcal{E}\left(\sum_{i} p_{i} \rho_{i}\right)=\sum_{i} p_{i} \mathcal{E}\left(\rho_{i}\right)
$$
A3: Third, $\mathcal{E}$ is a completely positive map. That is, if $\mathcal{E}$ maps density operators of system $Q_{1}$ to density operators of system $Q_{2}$, then $\mathcal{E}(A)$ must be positive for any positive operator $A$. Furthermore, if we introduce an extra system $R$ of arbitrary dimensionality, it must be true that $(\mathcal{I} \otimes \mathcal{E})(A)$ is positive for any positive operator $A$ on the combined system $R Q_{1}$, where $\mathcal{I}$ denotes the identity map on system $R$.
And the $M$ in the main post is the positive semidefinite choi operator.
"
"['qiskit', 'ibm-q-experience', 'error-mitigation']"," Title: Is there a faster way to do real-time error mitigation in qiskit?Body: I'm working on the readout error mitigation on a set of results obtained from different quantum circuits. The method I want to apply is to generate the confusion matrix for each quantum circuit (as the noise might change with time), and then use a filter to reduce readout errors. However, this might cost a long time since for each circuit in my experiment, I need to generate a set of calibration circuits to obtain the confusion matrix. I wonder is there a way I can import real-time error data of quantum devices in qiskit, so I don't need to repeat the standard error mitigation procedure many times?
Update: I found one plausible option would be using qiskit runtime program:
# Set the "circuit-runner" program parameters
params = provider.runtime.program(program_id="circuit-runner").parameters()
params.circuits = qc
params.measurement_error_mitigation = True
Where I could also specify the physical qubit on the quantum device that I want to use. I don't know if this will automatically mitigate the readout error for that specific physical qubit(s). Also, if I have 100 quantum circuits with 1 qubit, should I consider running them separately (since the error rate might change), or submitting them all at once? Thanks!
"
"['qiskit', 'quantum-gate', 'quantum-circuit', 'clifford-group', 'transpile']"," Title: Writing circuits in Qiskit using only Clifford and T gatesBody: Is there a way in Qiskit to write my circuit using only Clifford and T gates (CX, S, H, T and I think also $S^\dagger$ and $T^\dagger$)? With the function compile (with aer simulator) it gives me some errors using that one as a basis. I found the function SolovayKitaevDecomposition that seems to work only if there is a compile with u1, u2, u3, and CX beforehand. However, I can't find any documentation about it so I'm not sure how to use it, and compile and SKD take a lot of time.
"
"['quantum-state', 'density-matrix', 'linear-algebra', 'projection-operator']"," Title: Relation between symmetric subspaces and $n$-exchangeable density matricesBody: Let us consider $n$ elements, each taken from the set $\{1, 2, \ldots, d\}$ and let $S_n$ be the set of all permutations on these $n$ elements.
Define a permutation operator on the set of $n$ qudits as
$$
P_d(\pi) = \sum_{i_1, i_2, \ldots, i_n \in [d]} |i_{\pi(1)}, \ldots, i_{\pi(n)}\rangle \langle i_1, \ldots i_n|.
$$
Define the symmetric subspace on $n$ qudits as
\begin{equation}
V^{n}(\mathbb{C}^{d}) = \text{span}\{|\phi\rangle \in (\mathbb{C}^{d})^{\otimes n} : P_d(\pi)|\phi\rangle = |\phi\rangle~~\text{for all}~~\pi \in S_n \}.
\end{equation}
Define an $n$ exchangeable density matrix $\rho \in \text{Density}\bigg(\big(\mathbb{C}^{d}\big)^{\otimes n}\bigg)$ as
$$
P_d(\pi) \rho P_d(\pi) = \rho, ~\text{for all} ~\pi \in S_n.
$$
The notations are borrowed from here.
It is easy to see that any linear combination like
$$
\rho = \sum_i \alpha_i |\phi_i\rangle\langle \phi_i|,
$$
where each $|\phi_i\rangle \in V^{n}(\mathbb{C}^{d})$ and the $\alpha_i$s are arbitrary complex numbers is an $n$ exchangeable state.
I could not prove the converse, however. Is it true that any $n$ exchangeable state is a linear combination of density matrices of states in the symmetric subspace? If not, what is an example to the contrary?
"
"['qiskit', 'quantum-circuit', 'physical-qubit', 'superconducting-quantum-computing']"," Title: How to design a RF-SQUID qubit by Qiskit Metal?Body: I am now learning how to use Qiskit Metal to design superconducting circuits. I found that there are only several transmon qubits in the library. Can I design an RF-SQUID qubit by using Qiskit metal?
I am a new user here. Hope you can give me some suggestions on that.
"
"['algorithm', 'quantum-fourier-transform', 'phase-estimation', 'deutsch-jozsa-algorithm', 'bernstein-vazirani-algorithm']"," Title: What are quantum algorithms with only one possible outcome with probability equal to one?Body: I would like to study circuits with only one possible outcome. Quantum phase estimation, Bernstein-Vazirani, and in part Deutsch-Jozsa (for constant functions) come to mind - do you know any other important algorithms with only one possible outcome? Or, even better, do you know any criteria to build a circuit in such a way such that it can have only one possible outcome?
"
"['quantum-circuit', 'communication', 'communication-complexity']"," Title: Complexity of quantum circuits in a specific protocolBody: Consider the following simultaneous communication problem. Alice and Bob do not share any
entanglement or any common randomness, and cannot communicate directly with each other. As
inputs, $x$ is given to Alice, and $y$ is given to Bob, where $x, y ∈ \{0, 1\}^n$. Based on their inputs Alice and Bob can each send a single message to a referee R that has to decide whether $x = y$ or not.
I suggested the following protocol:
Associate each $x ∈ \{0, 1\}^n$ with a short quantum state $|φ_x\rangle$, called the quantum fingerprint of $x$. We can choose an error-correcting code $C: \{0, 1\}^n → \{0, 1\}^N$ where $m = log(N) ≈ log(n)$. There exist codes where $N = O(n)$ and any two codewords $C(x)$ and $C(y)$ have Hamming distance close to $N/2$, say $d(C(x), C(y)) ∈ [0.5N-\epsilon, 0.5N+\epsilon]$ (for instance, a random linear code
will work). Define the quantum fingerprint of $x$ as follows:
$|φ_x\rangle = \frac{1}{\sqrt{N}}\sum_{j=1}^{N}(-1)^{C(x)_j}|j\rangle$
This is a unit vector in an $N$-dimensional space, so it corresponds to only $\lceil{log(N)}\rceil = log n + O(1)$ qubits. For distinct $x$ and $y$, the corresponding fingerprints will have a small inner product:
$\langle\varphi_x|φ_y\rangle=\frac{1}{N}\sum_{j=1}^{N}(-1)^{C(x)_j+C(y)_j}=\frac{N-2d(C(x),C(y))}{N}\in[-\epsilon,\epsilon]$
The quantum protocol will be as follows: Alice and Bob send quantum fingerprints of $x$ and $y$ to the Referee, respectively. The referee now has to determine whether $x = y$ (which corresponds to $\langle\varphi_x|φ_y\rangle=1$) or $x=y$ (which corresponds to $\langle\varphi_x|φ_y\rangle\in[-\epsilon,\epsilon]$). The SWAP-test accomplishes this with a small error probability. This circuit first applies a Hadamard transform to a qubit that is initially $|0\rangle$, then SWAPs the other two registers conditioned on the value of the first qubit being $|1\rangle$, then applies another Hadamard transform to the first qubit and measures it. SWAP is the operation that swaps the two registers: $|φ_x\rangle|φ_y\rangle→|φ_y\rangle|φ_x\rangle$. The Referee receives $|φ_x\rangle$ from Alice and $|φ_y\rangle$ from Bob and applies the test to these two states. An easy calculation reveals that the outcome of the measurement is $1$ with probability $\frac{1-|\langle\varphi_x|φ_y\rangle|^2}{2}$. Hence if $|φ_x\rangle=|φ_y\rangle$ then we observe a $1$ with probability $0$, but if $|\langle\varphi_x|φ_y\rangle|$ is close to $0$ then we observe a $1$ with probability close to $1/2$. Repeating this procedure with several individual fingerprints can make the error probability arbitrarily close to $0$.
Now, my question is what is the complexity of the quantum circuits that are needed for Alice, Bob, and referee R, to implement this protocol?
Thanks so much for helping!
"
"['qiskit', 'machine-learning', 'noise', 'quantum-enhanced-machine-learning']"," Title: Is noise the only reason that makes the results of Quantum Support Vector Machine (QSVM) and Classical SVM differ, when we use a large dataset?Body: When I used and tested out the Quantum Support Vector Machine for just 120 samples of a large dataset (Training - 100 and Testing - 20). Its kernel classification results were quite close to the Classical Support Vector Machine. But, when I tested the whole dataset on the Quantum Support Vector Machine the kernel classification results differed a lot from the Classical Support Vector Machine.
So, I wanted to ask if this difference in result is only due to quantum noise? Or are there any other factors contributing to this difference?
"
"['fault-tolerance', 'magic-states']"," Title: Definition of magic $T$ and $H$ states: are there different definitions for them?Body: I am a bit confused by the definition of magic $T$ and $H$ states and I would like to check if their name is actually not uniformously spread in the litterature (or if I am not understanding something).
In the original paper about them, they are defined as:
$$ |T\rangle \langle T | = \frac{1}{2}(I+\frac{1}{\sqrt{3}}(\sigma_x+\sigma_y+\sigma_z))$$
$$ |H\rangle \langle H | = \frac{1}{2}(I+\frac{1}{\sqrt{2}}(\sigma_x+\sigma_z))$$
With the $H$ magic state we can implement the so called $T$ gate:
$$T \equiv diag(1,e^{i \pi/4})$$
From my current basic understanding, we cannot implement this same gate "directly" with the $T$ magic state.
However in various refs, such as this one, they say that they implement this gate with the $T$ magic state. Furthermore, their definition of $T$ magic state doesn't match the one of the original ref.
My question is thus: is there in the end a confusion of definition between different sources? Or I am not getting something.
[edit]: To clarify my misunderstanding. I know that there are many $T$ type magic states and many $H$ type magic states. The set of $T$ type magic states is deduced from one $T$ magic state on which we apply any single qubit Clifford operation (same for $H$).
I would be fine with a paper that calls a $T$ magic state any state in the class of the $T$ magic states. What confuses me is that it seems from my understanding that what is called $T$ magic state in one ref correspond to an $H$ magic state in another ref. And I find this much more weird, which is why I am wondering if I am not missing a point. To make an analogy it is like if one paper a Hadamard and a Pauli gate was called "Hadamard" and "Pauli" and in another one they would invert the definitions by calling Pauli what is Hadamard and Hadamard what is Pauli...
To answer one of the comment, the state being $T|+\rangle$ appears to be an $H$ type magic state according to this paper (rotation of the $|+\rangle$ by an angle $\pi/4$ gives a blue dot corresponding to $H$ type magic).
In conclusion: is it that even the full sets of $H$ and $T$ magic state are exchanged in litterature?
"
"['mathematics', 'density-matrix']"," Title: Is there a way to write down the eigenstates of this two-qubit density matrix?Body: I am considering the density matrix which represents an arbitrary state for a pair of qubits. When written out in terms of the Pauli operators, this is as follows (certain terms vanish for another reason so there are fewer than $16$ terms):
$$\rho = \frac{1}{4} \bigg( I \otimes I + t_{01}I \otimes \sigma_x + t_{10} \sigma_x \otimes I + t_{02} I \otimes \sigma_y + t_{20} \sigma_y \otimes I + t_{11} \sigma_x \otimes \sigma_x + t_{22}\sigma_y \otimes \sigma_y + t_{33} \sigma_z \otimes \sigma_z + t_{12} \sigma_x \otimes \sigma_y + t_{21}\sigma_y \otimes \sigma_x \bigg),$$
where the coefficients take values between $-1$ and $1$.
It is possible to have eigenstates for a density matrix but this is quite a long and complicated expression, so I am just curious to how would one would write down the possible eigenvectors for this matrix? Do the eigenvectors here relate to the usual eigenvectors for the Pauli matrices themselves?
"
['compiling']," Title: Compilation with ScaffCC compared to Qiskit's TranspilerBody: I am new to ScaffCC and wanted to ask if ScaffCC has the ability to compile a program to a limited connectivity machine? Similar to Qiskit's Transpiler ability?
"
"['error-correction', 'resource-request', 'fault-tolerance', 'magic-states']"," Title: Pros/cons of the different schemes to have complete fault-tolerant gatesetsBody: I am interested to have references and comment about pro/cons of the various methods that are used to implement complete gateset in a fault tolerant manner.
Usually the Clifford operations have a standard way to be implemented fault-tolerantly, at least in concatenated code (which I know best), by implementing them transversally. But it has been shown that it is not possible to have a complete gateset only based on transversal gates implementation. For this reason, for the non-clifford operations, other techniques are usually required. There is for what I know:
- Magic state distillation (ref)
- Gate teleportation (ref)
I have heard about other techniques like
- Code switching techniques (two codes $A$ and $B$ are able to implement different transversal gate such that the union of those gates form a complete gateset. You then decode the state from $A$ to encode it to $B$ when you need to perform a transversal gate allowed by $B$)
- Some codes admit a nice construction for a complete fault-tolerant gateset.
In the answer, I would be interested to know why magic state distillation is so popular those days, given the number of publications in this topic (because there are many other techniques). There is probably some clear advantage over other techniques that I don't see.
"
"['quantum-state', 'entanglement']"," Title: Is there any possibility to draw graphs for a maximally entangled state?Body: I am working on quantum entanglement swapping and I have derived that:
$|\psi\rangle=\frac{1}{2}(|0001\rangle+|0010\rangle+|0100\rangle+|1000\rangle)$
Is there any possibility that I can make a graphical review of my result for this state? In other words, is there any procedure to prove that the state is entangled graphically?
"
"['algorithm', 'qaoa']"," Title: How to calculate the approximation ratio of QAOA?Body: In order to evaluate the QAOA circuit, we need to compute the approximation ratio, which is the expectation value of QAOA circuit divided by the best solution.
My question is, how to find the best solution? Should we use a purely classical approach to find it (if so, which function?) or we use a hybrid classical-quantum approach with the help of a classical solver? I found in Qiskit tutorial, it uses NumPyMinimumEigensolver to obtain the result. Should we just use this result and compute its expectation value as the best solution to obtain the approximation ratio?
"
"['qiskit', 'programming', 'optimization']"," Title: Enforcing a particular layout mapping in QiskitBody: I would like to ask how to set a particular layout during transpiling. I guess that the layout can be set by the initial_layout parameter in the transpiler. However, there are several options that may conflict, namely: layout_method, and optimisation optimization_level. I do not know which one suppress the other. I guess that optimization_level setting to 0 can enforce it. But on the other hand I still want to a bit of optimising anything else apart from the layout. I search out for the documentation but there seems to be not much talking about this. Any help is very appreciated.
"
"['mathematics', 'qaoa']"," Title: RZZ calculation: Why does the equation and the circuit correspond?Body: i found this tutorial about MaxCut and QAOA from pennylane and i do not understand how the equation and the circuit should be equal.
When i do the math i come to this conclusion:
(result of CNOT - RZ - CNOT)
and this
(result of e^{...} - equation)
When i change the equation to
So if I remove the identity matrix and the minus sign, I get the result of the circuit, but is that correct? And if so, why?
Thanks for your help!
"
"['algorithm', 'nielsen-and-chuang', 'hadamard', 'deutsch-jozsa-algorithm']"," Title: Derivation of the effect of the Hadamard transform on a state |x⟩ in the Deutsch–Jozsa algorithmBody: On pg. 35 of Nielsen and Chuang, there's the following paragraph:
By checking the cases $x=0$ and $x=1$ separately we see that for a single qubit $H|x\rangle=\sum_x (-1)^{xz}|z\rangle/\sqrt{2}$.
I'm especially confused about its parts that involve $z$, such as why the power is $xz$ and what's the difference between $x$ and $z$. I can understand that the reason the denominator is $\sqrt{2}$ is due to $n=1$ in the summation part of the following formula:
$$
|\psi_2\rangle=\sum_x \frac{(-1)^{f(x)}|x\rangle}{\sqrt{2^n}}\left[\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right]
$$
"
['algorithm']," Title: In block encoding, how to determine the dimension of the elements from $\alpha(⟨0|^{\otimes a}\otimes I)U(|0〉^{\otimes a}\otimes|\psi〉)=A|\psi〉$?Body: The block-encoding framework shows the following statement in general, as discussed in the paper https://arxiv.org/abs/1804.01973.
A block-encoding of a matrix $A \in \mathbb{C}^{N \times N}$ is a unitary $U$ such that the top left block of $U$ is equal to $A / \alpha$ for some normalizing constant $\alpha \geq\|A\|$:
$$
U=\left(\begin{array}{cc}
A / \alpha & \\
\cdot & \cdot
\end{array}\right)
$$
In other words, for some $a$, for any state $|\psi\rangle$ of appropriate dimension,
$$\alpha\left(\left\langle\left. 0\right|^{\otimes a} \otimes I\right) U\left(|0\rangle^{\otimes a} \otimes\right.\right |\psi\rangle)=A|\psi\rangle.$$
My question is to find out the dimension of the elements from $$\alpha\left(\left\langle\left. 0\right|^{\otimes a} \otimes I\right) U\left(|0\rangle^{\otimes a} \otimes\right.\right.|\psi\rangle)=A|\psi\rangle.$$
I am not sure where $a$ came from in $|0\rangle^{\otimes a}$, and not sure what the dimension of $I$ is in this expression.
Any help could be highly appreciatedted!
"
"['quantum-state', 'entanglement', 'mathematics']"," Title: Are nearly all pure two-qubit state entangled?Body: I am using the code below, utilizing QETLAB's RandomStateVector(4) and IsPPT, to generate a random state and to judge whether the state is entangled or separable:
clear all; clc;
for i = 1:30000
psi = RandomStateVector(4);
rho = psi*psi';
if IsPPT(rho)
'yes'
end
end
But why does the program nearly never get inside the if block? I didn't see one single yes output. But the program works well, and if I use RandomDensityMatrix(4) instead, it's easy to see the output yes.
So, does it mean that for pure two qubits state, nearly all state are entangled?
"
"['qiskit', 'programming', 'transpile']"," Title: Does Qiskit transpiler execute multiple circuits in parallel?Body: I have something to ask about Qiskit's transpiler.
Before that, please check this document.
qiskit.compiler.transpile
https://qiskit.org/documentation/stubs/qiskit.compiler.transpile.html
In here, transpile function can get input as multiple quantum circuit as list and can transpile them in parallel.
I want to know how they can do in parallel.
"
"['tensor-product', 'hadamard']"," Title: why is $H^{⊗2}$ used to denote the parallel action of two Hadamard gates?Body: Why is the tensor product used here, what's its meaning? I learned tensor products as an operation between 2 matrices, and have an effect such as the follows:
How does the tensor product above relate to the tensor product in $H^{⊗2}$?
"
"['ibm-q-experience', 'resource-request', 'physical-realization', 'quantum-control']"," Title: Do individual qubits on IBM quantum processors share the same control unit?Body: I want to investigate the maximum possible parallelism of quantum operations on a specific IBM device (such as the latest heavy-hex architecture), which requires a basic knowledge of their control electronics. I want to know whether individual qubits have their independent control units or share the same control unit, and how the related control constraints restrict the concurrency of quantum gates. I found some control related knowledges about flux-tuable transmon qubits. However, IBM devices are based on fixed-frequency qubits. Are there any relevant reference papers. Thanks a lot!
"
['quantum-parallelism']," Title: Why does the output for $y$ have to be $y ⊕ f(x)$ in Quantum parallelism?Body: For the following Quantum parallelism algorithm:
Why does the output for $y$ have to be $y ⊕ f(x)$ for the algorithm to work? Why can't it be anything else, such as $f(x)$ only or $f(y)$ etc?
"
"['nielsen-and-chuang', 'quantum-parallelism']"," Title: Generalizing quantum parallelism to bits or qubitsBody: On pg. 31 in Nielsen and Chuang, it's said that:
This procedure can easily be generalized to functions on an arbitrary number of bits, by
using a general operation known as the Hadamard transform, or sometimes the Walsh–
Hadamard transform
Aren't we trying to generalize to an arbitrary number of qubits? If it's bits, why isn't it qubits?
"
"['quantum-operation', 'information-theory', 'purification']"," Title: Uhlmann's theorem analogue for channelsBody: Let the stabilized channel fidelity between two channels $M_{A\rightarrow B}$ and $N_{A\rightarrow B}$ be defined as
$$F(M,N) = \min\limits_{\vert\psi\rangle_{AR}} F\left((M\otimes I_R)\vert\psi\rangle\langle\psi\vert, (N\otimes I_R)\vert\psi\rangle\langle\psi\vert\right)$$
Let $U_{A\rightarrow BE}$ and $V_{A\rightarrow BE}$ be some Stinespring isometries for $M$ and $N$ respectively. Then we have
$$\begin{align}
F(M,N) &= \min\limits_{\vert\psi\rangle_{AR}} F\left((M\otimes I_R)\vert\psi\rangle\langle\psi\vert, (N\otimes I_R)\vert\psi\rangle\langle\psi\vert\right) \\
&=\min\limits_{\vert\psi\rangle_{AR}} \max_{V} F\left((U\otimes I_R)\vert\psi\rangle\langle\psi\vert(U^\dagger\otimes I_R), (V\otimes I_R)\vert\psi\rangle\langle\psi\vert(V^\dagger\otimes I_R)\right)\\
&\geq \max_{V} \min\limits_{\vert\psi\rangle_{AR}} F\left((U\otimes I_R) \vert\psi\rangle\langle\psi\vert(U^\dagger\otimes I_R), (V\otimes I_R)\vert\psi\rangle\langle\psi\vert(V^\dagger\otimes I_R)\right) \\
&= \max\limits_{V} F(U(\cdot)U^\dagger, V(\cdot)V^\dagger),
\end{align}$$
where the second line uses Uhlmann's theorem to pick a specific $U$ and we maximize over all $V$, the third line is the maxmin inequality and the last line uses the definition of channel fidelity.
I would like the reverse bound as well. That is, can we show that the channel fidelity $F(M,N)$ is upper bounded by the channel fidelity of the channel corresponding to some Stinespring isometries of $M$ and $N$? Equivalently, can we swap the min and the max with equality somehow in the above argument?
The analogous result for states is $F(\rho, \sigma) = \max_{\phi} F(\psi,\phi)$, where $\psi$ is a specific purification of $\rho$ and we maximize over all $\phi$ which are purifications of $\sigma$. That is, of course, Uhlmann's theorem.
"
"['qiskit', 'programming']"," Title: Expected outcome of adding two PauliOpBody: first of all, I would probably report this as a bug if I was confident enough in my QC abilities. As it stands, I've just started out, so I'm phrasing it as a question.
From what I can tell, adding two PauliOps in this specific case does not result in the expected operator matrix:
import qiskit as qk
from qiskit.opflow.primitive_ops import PauliOp
(PauliOp(qk.quantum_info.Pauli("X")) + PauliOp(qk.quantum_info.Pauli("iY"))).to_matrix()
results in
array([[0.+0.j, 1.-1.j],
[1.+1.j, 0.+0.j]])
whereas the result that I would expect is the one i get when I run the following code:
PauliOp(qk.quantum_info.Pauli("X")).to_matrix() + PauliOp(qk.quantum_info.Pauli("iY")).to_matrix()
Result:
array([[0.+0.j, 2.+0.j],
[0.+0.j, 0.+0.j]])
What further confuses me is that the deprecated version of PauliOp actually results in the expected operator. Running this code:
import qiskit as qk
from qiskit.aqua.operators.primitive_ops import PauliOp
(PauliOp(qk.quantum_info.Pauli("X")) + PauliOp(qk.quantum_info.Pauli("iY"))).to_matrix()
gives a deprecation warning and the [[0,2],[0,0]]-array that I want.
Has the behaviour of the addition changed or is this a bug? In any case, how can I construct the operator that I want (in a non-deprecated way)?
I'm running qiskit version 0.29.0
Thanks in advance!
"
"['algorithm', 'nielsen-and-chuang', 'terminology']"," Title: Why is the first register of $|x,y\oplus f(x)\rangle$ called ""data"" register?Body: When talking about quantum parallelism, in Nielsen and Chuang, it's said that:
it is possible to transform this state into $|x, y \oplus f(x)\rangle$, where $\oplus$ indicates addition modulo 2; the first register is called the ‘data’ register, and the second register the ‘target’ register.
I'm confused about why the first register is called the ‘data’ register and not the ‘control’ register. Is there a difference between a data register and a control register? Is ‘data’ register a standard name in EE or just in QC?
"
"['quantum-state', 'density-matrix', 'eigenvalue']"," Title: Interpretation of the unitaries involved in the eigenvalue decomposition of a density operatorBody: If $\rho=\sum_{i}p_{i}|\psi_{i}\rangle\langle \psi_{i}|$, this ensemble doesn't require $\langle \psi_{i}|\psi_{j}\rangle$=0. Given that $\rho$ is positive semi-definite, by the spectral theorem it can be expressed in diagonal form $$\rho=UDU^{\dagger}, D=\sum_{i}\lambda_{i}|i\rangle\langle i|$$
However, despite having used this notation for a while now, I still find myself confused by the notation of the spectral theorem. Specifically the role the unitaries play. The above states that, $$U^{\dagger}\rho U=U^{\dagger}UDU^{\dagger}U=D$$ which then given $\rho$ in it's diagonal form. However, it can also easily be diagonalised just by calculation of its eigenvalues and eigenvectors, and then re-expression in that basis. Moreover, this just looks like the unitary transformation of $\rho$, which obviosuly isn't going to be the same state. So what are these unitaries then, just the identity operators expanded in the eigenbasis? Or am I meant to interpret them as unitaries whose columns are composed of the states of current basis of $\rho$ expanded in the eigenbasis, ie, not mapping them to their image in another basis, but to themselves expressed in another basis, essentially achieving the same action as the identity?
Edit: It has been pointed out to me that the paragraph wherein I ask my questions is too vague or confusing. So let me try and rephrase. I have a density operator. I have it expressed in matrix form in some basis. I want to change said basis so that it achieves its diagonal form. How would I actually express this as the action of operations on said density operator, given that any such action would just lead to another density operator that is unitarily related, but with a different spectrum? The only way I can see is to rewrite it's entries $|\psi_{i}\rangle = U|\phi_{i}\rangle$ which, to my mind anyway, isn't really the same thing as the action of a unitary operator on $\rho$. To clarify, I am not confused about the action of basis change, but only its representation outside just using the identiy to acieve it, ie $|\psi\rangle=\sum_{i}\langle \phi_{i}|\psi_{i}\rangle |\phi_{i}\rangle$
"
"['quantum-state', 'entanglement']"," Title: How to make sense of phases of individual qubits in the context of multiple entangled qubits?Body: I hear that phase information of qubits is important and you can clearly see the phase of a qubit when represented on the Bloch sphere.
But, I am not sure what to think of the phase of individual qubits in the context of an entangled state of multiple qubits.
For example, when talking about the GHZ state,one could have a relative phase relation between $|000\rangle$ and $|111\rangle $ in the form of $\frac{1}{\sqrt{2}}|000\rangle+e^{i\phi}|111\rangle $
But, that's just one phase as opposed to multiple phases which come from the phases of individual qubits.
Is there a simple way to make sense of the fact that there is only one relative phase despite the fact that there are 3 individual qubits?
"
"['quantum-gate', 'universal-gates']"," Title: Definition of Deutsch gate and meaning of $\theta$Body: I'm trying to understand the definition of a Deutsch gate.
In particular what does $\theta$ mean in its presentation? Is it derived from the coefficients of the input state or a free parameter or something else?
A Deutsch gate is given below.
$$ |a, b, c \rangle \mapsto i \cos(\theta) |a, b, c\rangle + \sin(\theta) |a, b, 1-c\rangle \;\; \text{when a = b = 1} \\
|a, b, c \rangle \mapsto |a, b, c\rangle \;\; \text{otherwise} $$
I think that $a, b, c$ range over $\{0, 1\}$, so this thing could theoretically be expanded into an 8 by 8 matrix and presented that way.
I am totally mystified about the meaning of $\theta$ though. What does $\theta$ mean? Does it have a closed form in terms of the coefficients of the basis elements or is it something else?
"
"['textbook-and-exercises', 'quantum-operation', 'terminology']"," Title: If density matrices are linear operators, what vectors do they operate on?Body: 1. On page 73 of John Watrous' famous book, a quantum channel is defined as a linear map
$$\Phi: L(\mathcal{X})\rightarrow L(\mathcal{Y})$$
Now $L(\mathcal{X})$ stands for $L(\mathcal{X},\mathcal{X})$, which is itself a collection of all linear mappings $\mathcal{A}: \mathcal{X}\rightarrow \mathcal{X}$ (page-8).
2. As a physics student, when I look at some simple examples of a quantum channel, say a phase damping channel $\Phi_{PD}$, the way I look at it is that it takes my initial state $\rho_i$ at time $t_i$ to a final state $\rho_f$ at time $t_f$.
$$\Phi_{PD} [\rho_i] \rightarrow \rho_f$$
Trying to compare these two scenarios, it seems $\rho_i \in L(\mathcal{X})$ and $\rho_f \in L(\mathcal{Y})$. What happens to $\mathcal{A}$ here? What is exactly the one-to-one correspondence between 1 and 2?
Edit: I have tried to convey my query by a diagram in which the job of $\Phi$ is illustrated. I want to understand what is $\mathcal{A}$ in the following diagram:
"
"['quantum-gate', 'terminology']"," Title: What is ""gate length"" in quantum computing?Body: I am working on adding a new provider to Qiskit, and I have to specify the properties of the backend.
What is "gate length" (in ns) referring to?
"
['teleportation']," Title: Is there some nice physical intuition to get for quantum teleportationBody: I know the quantum teleportation protocol: using an EPR pair you can "teleport" the data of one qubit on one of the qubit composing the EPR pair by doing appropriate measurement in the Bell basis between one of the EPR pair qubit and the qubit you want to transfer (and you have to do some "feedback" operation depending on the measurement outcome).
I agree with the calculation but the way I understand the protocol is just from a "shut up and calculate" point of view. I have no intuition about why it works outside of pure brute force calculation and I wondered if there is some physical intuition to get there.
For instance how people had this idea initially?
"
"['error-correction', 'vqe']"," Title: Does the formula $\sum_k f_k{\rm Tr}(O_k U\rho_k U^\dagger)$ have any physical meaning, in the context of variational quantum algorithms?Body: I am reading a review about the variational quantum algorithm. And there is a definition of the cost function:
$C(\theta)=\sum_k f_k (Tr[O_k U(\theta)\rho_kU^\dagger(\theta)])$
Where $U(\theta)$ is a parametrized unitary with $\theta$ as the parameters. $\rho_k$ are density matrices, and ${O_k}$ are a set of observables, $f_k$ are functions which encode the task at hand.
I am confused about these two things:
(1) Is there any general physical meaning of $Tr[O_k U(\theta)\rho_kU^\dagger(\theta)]$? It feels like I have seen it sometime before but I can't really find it now.
(2) Why the cost function is defined this way?
Thank you for your help!
"
"['algorithm', 'complexity-theory']"," Title: Is quantum query complexity equivalent to the total number of calls to the quantum computer for any given algorithm?Body: In other words, if an algorithm requires N total calls to the quantum computer to find the solution (of any given problem), would N be equivalent to its query complexity?
"
"['algorithm', 'textbook-and-exercises', 'nielsen-and-chuang', 'deutsch-jozsa-algorithm']"," Title: Derivation of the state after applying $U_f$ in the Deutsch–Jozsa algorithmBody: On page 35 in Nielsen and Chuang, it's said that for the following quantum circuit implementing the general Deutsch–Jozsa algorithm:
Next, the function $f$ is evaluated (by Bob) using $U_f$, giving
$$\left|\psi_2\right\rangle=\sum_x\frac{(-1)^{f(x)}|x\rangle}{\sqrt{2}^n}\left[\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right]$$
I'm confused about where the $(−1)^{f(x)}$ come from.
"
['teleportation']," Title: What it means that the quantum teleportation involves projection onto a maximally entangled state?Body: I am familiar with the quantum teleportation protocol to some extent. However, I do not understand what it means when we say that "the teleportation
relies on the projection of two qubits onto maximally entangled Bell states."
"
"['textbook-and-exercises', 'nielsen-and-chuang']"," Title: Why can the state $\sum_x|x, f(x)\rangle$ be written without normalization factor?Body: It is stated on page 32 of Nielsen and Chuang that:
In our single qubit example:
,
measurement of the state gives only either |0, f(0)> or |1, f(1)>!
Similarly, in the general case, measurement of the state $\sum_x|x, f(x)\rangle$ would give only f(x) for a single value of x.
Why is it that the state $\sum_x|x, f(x)\rangle$ doesn't contain normalization?
"
"['entanglement', 'information-theory', 'teleportation', 'communication']"," Title: What is the difference between having a single-qubit state and knowing a result of a measurement you want to perform on it?Body: In the quantum teleportation protocol Alice can send Bob an unknown quantum state $|\psi\rangle$. If the only thing Bob does with $|\psi\rangle$ is to measure it in some basis, I guess it would be simpler for Alice to just do the measurement herself and send the result to Bob. That would not require a shared entangled pair but Alice would need to know Bob's favorite basis. Is there something Bob can do with an actual state $|\psi\rangle$ which can not be done with information that Alice sends to Bob?
More generally, due to Holevo bound only a single bit of information can be encoded in a qubit. What is then the difference between teleporting an actual quantum state $|\psi\rangle$ and sending the result of some measurement of this state?
"
['stabilizer-code']," Title: Is it necessary to define logical Pauli in the centralizer of the stabilizer groupBody: By definition, we define the logical Pauli operator as element of the centralizer of the stabilizer group $S$ in $G_n$ (the $n$-Pauli group).
It is a definition so why not.
My question is: mathematically speaking, is it really necessary ? Is this definition taken for mathematical simplicity (but we could imagine being less restrictive).
Indeed, what we need in the end is (i) to define a family of logical operator (ii) that verify the appropriate Pauli algebra.
Calling $U$ a logical operator, the minimal mathematical requirements we need are that it keeps any state $|\psi\rangle$ that is in the code space $C(S)$ inside of this code space. Thus, formally that:
$$\forall |\psi\rangle \in C(S): U |\psi\rangle \in C(S)$$
And this is all what we need conceptually. I guess that in the end we could find such operators $U$ not in the Pauli group that will respect the Pauli algebra. Are there hidden conditions I am not seing that would actually show that the logical Pauli operator must be elements of $G_n$ ?
"
"['error-correction', 'stabilizer-code']"," Title: General conditions to define a logical operator: is there some general characterization of those elements (from group theory for instance)Body: I assume working with stabilizer codes where the stabilizer group is denoted $S$ and the code space is $C(S)$.
The minimal requirement for a logical operation $M$ is to have:
$$\forall |\psi\rangle \in C(S), M |\psi \rangle \in C(S)$$
Indeed, in such case I apply a unitary operation that will make sure that any state in the code space remain in it. I am wondering if there is a nice general characterization of such operations.
I take an example. The normalizer of $S$ in $U(2^n)$ (the unitary matrices acting on $n$ qubits) is composed of valid logical operations because any matrix $M$ in it will verify:
$$\forall g \in S, \exists g' \in S | M g = g' M$$
It implies:
$$\forall |\psi \rangle \in C(S), \forall g \in S \ \exists g' | \ g(M | \psi \rangle) = g M |\psi \rangle = M g'|\psi \rangle=M |\psi \rangle$$
This last equation shows that $M |\psi \rangle$ will be stabilized by any $g \in S$ and will thus remain in the code space. So, any element in the normalizer of $S$ in $U(2^n)$ is a valid logical operation, but there might exist logical operation outside of this set (this is not an equivalence, I did not characterized the logical operations)
In conclusion: is there a general characterization of logical operations ? Like they live in some well defined group ?
"
"['qiskit', 'ibm-q-experience']"," Title: How to apply gates based on a random decision on the IBM quantum computer?Body: I want to run a circuit on an IBM quantum computer, and this circuit involves gates that are either applied or not based on a (classical) random decision.
As a minimal example, imagine a circuit with one qubit initialized in the state $|0\rangle$. In each shot we generate a random bit (0 or 1 with equal probability); apply a Hadamard if the bit is 1; and then measure in the $Z$ basis. One would expect an outcome 0 (1) 75% (25%) of the time.
One way to do this would be to make the classical random decisions locally, construct many deterministic circuits, and for each of them send a job with 1 shot each to the IBM computer. Unfortunately, the circuit I want to run involves a large number of random decisions, and the allowance on the IBM platforms is based on number of jobs rather than total number of shots, so I'll run out very quickly.
I hoped that it would be possible to use the conditional operation feature of qiskit to do this, but I can't work out how to randomize the values of the classical register. Does anyone know how I can do this?
"
"['quantum-operation', 'physical-realization', 'open-quantum-systems']"," Title: What does it mean for a channel to be independent of the input state?Body: A 2007 paper shows how to construct quantum channels on finite-dimensional Hilbert spaces
$$\sigma=\Phi(\rho)=\sum_i K_i \rho K_i^\dagger,\qquad \sum_i K_i^\dagger K_i=\mathbb{I}$$ for which $\Phi(\rho)=\sigma$ is independent of $\rho$. This seems to be useful for preparing desired final states $\sigma$ without having to worry about the input state, acting as some sort of better-than-possible quantum filter (there is 100% probability of success even when the input state is orthogonal to the output state). The construction is as follows:
- Suppose the output is always some fiducial pure state $\Phi(\rho)=|0\rangle\langle 0|$ and we can, without loss of generality, span the Hilbert space with the orthonormal basis $\{|0\rangle,|1\rangle,\cdots|N\rangle\}$. Then the set of Kraus operators $$K_i=|0\rangle\langle i|,\qquad i\in\left(0,N\right)$$ does the intended task, even for mixed input states. This is seen by defining $\rho=\sum_{j,k=0}^N\rho_{j,k}|j\rangle\langle k|$ such that
\begin{align}
\Phi(\rho)&=\sum_{i=0}^N |0\rangle\langle i| \left(\sum_{j,k=0}^N\rho_{j,k}|j\rangle\langle k|\right) |i\rangle\langle 0|\\
&= |0\rangle\mathrm{Tr}(\rho)\langle 0|=|0\rangle\langle 0|.
\end{align} We seem to have a perfect purification channel!
- Supposed the output is now some fiducial mixed state $\Phi(\rho)=\sigma\equiv\sum_{i=0}^N p_i|\phi_i\rangle\langle \phi_i|$, where some of the $p_i$ may be zero. Then the set of Kraus operators $$K_{i,j}=\sqrt{p_j}|\phi_j\rangle\langle i|,\qquad i,j\in\left(0,N\right)$$ does the intended task, regardless of input state. This is similarly seen through
\begin{align}
\Phi(\rho)&=\sum_{i,j=0}^N \sqrt{p_j}|\phi_j\rangle\langle i| \left(\sum_{k,l=0}^N\rho_{k,l}|k\rangle\langle l|\right) |i\rangle\langle \phi_j|\sqrt{p_j}\\
&= \sum_{j=0}^N p_j|\phi_j\rangle(\sum_{i=0}^N\rho_{i,i})\langle \phi_j|=\sigma.
\end{align}
What does this channel imply physically? It is clearly different from unitary channels, which are reversible, because there is no way of determining the input state from the output state. Are such channels feasible in practice, or are they only theoretical constructs?
"
"['algorithm', 'qaoa', 'annealing']"," Title: What is the relationship between the mixing operators and initial states found in QAOA and Quantum Annealing?Body: In many papers, the QAOA is shown to be intimately related to Quantum Annealing/Quantum Adiabatic Algorithm/Adiabatic Quantum Optimization.
The mixing operator in the QAOA is described by Hadfield as one that transfers probability amplitudes between states. Another post shows it also helps change the probability distribution, as evolving only under the cost Hamiltonian has no effect on the probabilities. It also prevents the possibility of being stuck in an eigenstate of the problem Hamiltonian. In Quantum Annealing, the driver is chosen such that it doesn't commute with the problem Hamiltonian and that it has an easy to construct ground state, after which the system is evolved adiabatically to find the ground state of the problem Hamiltonian. I also see how the QAOA is a discrete trotterization of Quantum Annealing.
I used Qiskit to implement the QAOA and tested them on a simple 3 node graph with 2 edges, a 4-regular 6 node graph and an 8 node 4-regular graph. In each case, I tried a variety of depths (p=3,6,12,24), the standard equal superposition initial state as well as random states.
In all initial states I tried, I was able to find the MAXCUT solution. This to me seems strange, since the initial state is crucial to Quantum Annealing. In which case, how is the driver and the mixer related?
I also inspected the relationships between the optimized $\beta$s and $\gamma$s. Given that the QAOA is a trotterization of Quantum Annealing, and that we can think of these angles as the length of time the system is evolving under the operator, I expected to find an inverse relationship such that the values of the angles used for the Mixer unitary decrease in magnitude and the values of the angles used for the Phase unitary increase in magnitude as we move from the leftmost part of the circuit to the right. But this was not the case and no discernible pattern could be seen. Shouldn't there be a correlation to a progression in time? Or perhaps the progression is not linear?
"
"['algorithm', 'resource-request', 'complexity-theory']"," Title: References about deriving the complexity of a given algorithmBody: Trying to learn about how to derive (& intuition) the complexity for a given algorithm as shown below.
If there is any good reference or starting point that anyone can suggest that will be highly appreciated!
"
"['qiskit', 'quantum-circuit', 'noise', 'teleportation', 'error-mitigation']"," Title: Is it possible to use the mitigation process on a teleportation circuit?Body: Is it possible to use the mitigation process on a teleportation circuit? Sorry, i'm still starting, if someone can get me out of this doubt, I would appreciate it. The circuit I'm trying to make this process is similar to the image below:
"
['d-wave']," Title: What should be the lowest energy of this graph isomorphism QUBO?Body: I am trying to study QUBO formulations of the graph isomorphism problem. I tried implementing the QUBO matrices given by the algorithms described in here. For the two input graphs therein, I am getting the matrix $Q$ given by:
$Q = \begin{pmatrix}
-1 & 1 & 1 & 0 & 0\\
0 & -1 & 0 & 1 & 0\\
0 & 0& -1& 1 & 0\\
0 & 0& 0& -1& 0\\
0 & 0& 0& 0& -1
\end{pmatrix}$
This turns out to be the same matrix as given in the paper. From here, I applied the following lines of code:
bqm = dimod.BinaryQuadraticModel.from_numpy_matrix(QUBO_Matrix)
qubo, offset = bqm.to_qubo()
sampler = LeapHybridSampler()
results = sampler.sample_qubo(qubo, label='Graph Isomorphism')
print(results)
______________________________________________
Output:
0 1 2 3 4 energy num_oc.
0 0 1 1 0 1 -3.0 1
['BINARY', 1 rows, 1 samples, 5 variables]
I think I am doing something fundamentally wrong here as the graphs are isomorphic and as per my understanding, these isomorphic graphs would return a ground state energy of 0 where I am getting a ground state energy of -3.
Even when I am taking non-isomorphic graphs i.e. one of the graphs from the paper and the other, a square graph, I am getting a ground state energy (by the same method) of -1.
I think I am missing something very fundamental here. I would really appreciate it if someone pointed me in the right direction. Thanks in advance!
"
"['mathematics', 'hamiltonian-simulation', 'phase-estimation']"," Title: Can I use the Lie product formula to simulate the Hamiltonian of an adjacency matrix by using the QPE to take Nth roots of permutation matrices?Body: I have gotten some great help recently on Hamiltonian simulation, and am interested in using Hamiltonian simulation to explore (classical) random walks on large graphs, but I'm running up against limitations on my knowledge of linear algebra and matrix exponentials.
To get started suppose I have a large, undirected graph, whose adjacency matrix $W$ I can write as a sum of a number of permutation matrices of varying order, i.e.:
$$W=A+B+C+D,$$
where $W$ is a (Hermitian) symmetric $(0,1)$ matrix and each of $A,B,C,D$ are (unitary) permutation matrices. Incidentally in my particular example I have $AC=BD=\mathbb{I}$, but otherwise none of $A,B$ or $C,D$ commute with each other. Further I can express each of $A,B,C,D$ as a simple sequence of $\mathsf{SWAP}$ gates, each acting on a small number of (some overlapping set of) qubits.
I also have that, e.g., $A^3=C^3=B^4=D^4=\mathbb I;$ that is, I know the eigenvalues of each of $A,B,C,D$ are cube roots and 4th roots of unity. I think I can use my knowledge of the eigenvalues of $A,B,C,D$ in a quantum phase estimation algorithm to create circuits for the $N^{th}$ roots of each of $A,B,C,D$ for large enough $N$; e.g. I have gates for $A^{1/N},B^{1/N},$ etc.
But then can I use what I know to simulate $e^{W}$ as
$$e^{W}=e^{A+B+C+D}= \lim_{N \rightarrow \infty} (e^{A/N}e^{B/N}e^{C/N}e^{D/N})^N\approx(A^{1/N}B^{1/N}C^{1/N}D^{1/N})^N?$$
Can I repeatedly use quantum phase estimation on the permutation matrices $A,B,C,D$ to loop through the $N^{th}$ roots of each of $A,B,C,D?$
Is $(A^{1/N}B^{1/N}C^{1/N}D^{1/N})^N$ the right approximation for $e^{A+B+C+D}?$
"
"['qiskit', 'quantum-state', 'textbook-and-exercises', 'physical-qubit']"," Title: Why in quantum coin toss, when starting from state $|1\rangle$, we get $|-\rangle$?Body: I was reading qiskit's text book, there I found that for a Double quantum coin toss, we have negative probability amplitude for $|1\rangle$ state when we starts from $|1\rangle$ state.
Link : https://qiskit.org/textbook/what-is-quantum.html
My question is why it is so?, Why when starting from state 1 we get negative?, For $|0\rangle$ , it is positive and as $|0\rangle$ and $|1\rangle$ are almost similar. Why is it different?
"
['quantum-operation']," Title: What is a covariant quantum channel?Body: A novice to this topic, I am trying to understand the notion of (irreducible) Covariant Quantum Channels. This article provides a definition that is not very "physical".
My question:
- What is the intuition behind the notion of covariant quantum channels?
- Is the Generalized Amplitude Damping channel an example of (irreducible) Covariant Quantum Channel?
"
"['circuit-construction', 'pauli-gates']"," Title: Controlled Z gate using Pauli rotation operators and Z tensor product ZBody: I am trying to construct a controlled Z gate using elementary gates. This is what I have so far: \begin{pmatrix}
-i & 0 & 0 & 0\\
0 & -1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & -i
\end{pmatrix}
can someone help me figure out how to get rid of the unwanted phase shift?
I can use combinations of a single-qubit Hamiltonian $\hat{H}=\frac{1}{2}\Omega_x\hat{X}+\frac{1}{2}\Omega_y\hat{Y}+\frac{1}{2}\Omega_z\hat{Z}$ and $\hat{H}=\frac{1}{2}\Omega_{zz}\hat{Z}\otimes\hat{Z}$. I can construct the $\hat{I}\otimes\hat{H}$ matrix above but I cannot construct the CNOT gate so far.
"
"['mathematics', 'information-theory', 'relative-entropy', 'renyi-entropies']"," Title: How to take the limits of the sandwiched Renyi divergences?Body: The sandwiched Renyi divergence is defined as
$$\begin{equation}
\tilde{D}_{\alpha}(\rho \| \sigma):=\frac{1}{\alpha-1} \log \operatorname{tr}\left[\left(\sigma^{\frac{1-\alpha}{2 \alpha}} \rho \sigma^{\frac{1-\alpha}{2 \alpha}}\right)^{\alpha}\right].
\end{equation} $$
One can define the limiting cases as $\alpha\rightarrow 1$ and $\alpha\rightarrow\infty$ to obtain the relative entropy and max-relative entropy respectively. I am not sure how to take these limits - does one apply L'Hôpital's rule and if yes, how should one deal with the terms inside the trace? The goal is to show
$$\lim_{\alpha\rightarrow 1}\tilde{D}_{\alpha}(\rho \| \sigma) = \text{tr}(\rho\log\rho - \rho\log\sigma)$$ and
$$\lim_{\alpha\rightarrow \infty}\tilde{D}_{\alpha}(\rho \| \sigma) = \inf \{\lambda: 2^\lambda\sigma\geq \rho \}$$
"
"['grovers-algorithm', 'phase-estimation']"," Title: Can quantum search be performed without phase estimation?Body: In the quantum search algorithm with a known number of answers $M$ out of a search space of size $N$, it seems that the algorithm works pretty well (though not with pinpoint accuracy) for a fairly wide range of possible known answers. For instance, if the actual number of answers is $M' \in [4/9,4]M$ (for $M$ not too large compared to $N$, then Grover's algorithm optimized for $M$ will give an answer for $M'$ with probability around $1/2$ or better. Since this is a multiplicative interval, it follows that you can find a hit in time $O(\sqrt{N}\cdot \log N)$, which is not bad. In fact, you can get rid of the $\log N$ factor by looking more closely at the $O(\sqrt{N/M})$ running time of standard search.
This is dramatically simpler than the standard method of achieving $O(\sqrt{N})$ run time, which involves phase estimation. (Of course phase estimation is useful in its own right, and the method above only gives one satisfying solution and does not give the number of solutions, which is an interesting problem by itself.) I'm sure I'm not the first to notice this; does it appear somewhere?
I also know I've omitted many details, like what to do when $M$ is not very small compared to $N$. It's also worth noting that there are many examples (like hash collisions) where you have a good idea what $M$ will be without knowing its exact value.
"
"['mathematics', 'pauli-gates']"," Title: Showing that $e^{i \sigma_z \otimes \sigma_z t} = \text{CNOT}(I \otimes e^{i \sigma_zt})\text{CNOT}$Body: While working on circuit construction for Hamiltonian simulation using this answer as reference, I'm unable to see how the following equation is true:
$$
e^{i \sigma_z \otimes \sigma_z t} = \text{CNOT}(I \otimes e^{i \sigma_zt})\text{CNOT}
$$
I tried doing the following to the right side:
$$
\begin{align}
\text{CNOT}(I \otimes e^{i \sigma_zt})\text{CNOT} &= \text{CNOT}\big[ \cos(t) I\otimes I + i \sin(t) I \otimes \sigma_z \big]\big[|0\rangle \langle 0 | \otimes I + |1\rangle \langle 1 | \otimes \sigma_x \big] \\
&=\text{CNOT}\big[ \cos(t)|0\rangle\langle0|\otimes I+\cos(t)|1\rangle\langle1| \otimes \sigma_x + i\sin(t)|0\rangle\langle0|\otimes\sigma_z+ i\sin(t)|1\rangle\langle1|\otimes\sigma_z\sigma_x \big] \\
&= \cos(t)|0\rangle\langle0|\otimes I + \cos(t)|1\rangle\langle1|\otimes I + i\sin(t)|0\rangle\langle0|\otimes\sigma_z+i\sin(t)|1\rangle\langle1|\otimes\sigma_x\sigma_z\sigma_x \\
&= \cos(t) I+i \sin(t)\big[|0\rangle\langle0|\otimes\sigma_z-|1\rangle\langle1|\otimes\sigma_z\big] \qquad (\text{since }\sigma_x\sigma_z\sigma_x=-\sigma_z)
\end{align}
$$
And we already know that the left hand side is:
$$
e^{i \sigma_z \otimes \sigma_z t}=\cos(t) I + i \sin(t) \sigma_z \otimes \sigma_z
$$
So the only thing I'm missing is showing that $|0\rangle\langle0|\otimes\sigma_z-|1\rangle\langle1|\otimes\sigma_z = \sigma_z\otimes\sigma_z$. Using NumPy I was able to see that effectively both are equal to $\text{diag}\{1, -1, -1, 1\}$.
However, I was wondering if anyone knows a nicer way of showing these two are equal without actually calculating their matrix?
"
"['qaoa', 'clifford-group', 'error-mitigation']"," Title: How to use Clifford Data Regression for the MaxCut ProblemBody: i read about Clifford Data Regression in https://arxiv.org/pdf/2005.10189.pdf.
If I have understood this correctly, then one receives the mitigated expected value of an observable from CDR.
For the MaxCut problem this could be the expected cut. But how do I then get the real result in the form of a bit string so that one can split the nodes into two subsets?
The implementation of CDR in mitiq, for example, only returns the mitigated expected value of the observable, but how can I then determine the actual solution from this?
Thanks!
"
"['quantum-state', 'unitarity', 'fidelity']"," Title: How large can we make the fidelity between mixed states by allowing unitaries?Body: For pure states, it is known that one can always find a unitary that relates the two i.e. for any choice of states $\vert\psi\rangle$ and $\vert\phi\rangle$, there exists a unitary $U$ such that $U\vert\psi\rangle = \vert\phi\rangle$. Hence, we have that
$$\max_U F(\vert\phi\rangle,U\vert\psi\rangle) = 1.$$
What about mixed states? Given an arbitrary pair of states $\rho,\sigma$ such that $F(\rho,\sigma) \leq \varepsilon$ for some $\varepsilon$ much smaller than $\frac{1}{d}$ where $d$ is the dimension of the Hilbert space, can we achieve a lower bound on the following?
$$\max_U F(\rho,U\sigma U^\dagger) \geq \ ?$$
"
"['quantum-state', 'physical-realization', 'communication']"," Title: Quantum communications and ""knowledge"" of receiving a qubitBody: Question from a computer scientist (not a physicist).
Imagine two nodes on a quantum network.
Alice sends Bob a qubit in some state of superposition over a quantum channel.
Is Bob able to sense that he's received a qubit without measuring it?
If so, how?
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix']"," Title: Compute ${\rm tr}(a_k a_{k'}\rho)$ with $\rho=e^{-\beta H}/Z(\beta)$ Gibbs state and $a_k$ ladder operatorsBody: Consider a harmonic oscillator with hamiltonian $H=\sum_k\omega_k a_k^\dagger a_k$ and a state $\rho=\frac{e^{-\beta H}}{Z(\beta)}$ where $Z(\beta)=\text{tr}[{e^{-\beta H}}]$.
The quantity $$A:=\sum_{kk'}\text{tr}[a_ka_{k'}\rho] $$ should be zero; how can I see it?
"
"['algorithm', 'complexity-theory', 'deutsch-jozsa-algorithm']"," Title: What is quantum advantage truly?Body: Let's consider the Deutsch Jozsa algorithm, I understand that the superposition principle in quantum mechanics, helps us design circuits which would give answers in one single query. But then I would expect the query complexity to be $O(1)$, but it is told to be $O(n)$ which I don't understand?
The next question I have is, although the quantum circuits ideally give answers in a single query, the probabilistic nature of QM, dictates us to perform measurements multiple times for a more accurate picture, so why do we not consider that in query complexity?
"
"['teleportation', 'superconducting-quantum-computing']"," Title: Can we actually do quantum teleportation in IBM quantum computers?Body: I am going through a course in Quantum computation by NPTEL-IBM, which is designed to introduce Qiskit. In one lecture they describe the concept of quantum teleportation, and point out that since IBMQ doesn't allow two measurements on two different qubits, one needs to modify the quantum circuit.
While doing so, they force interaction between Bob's qubit with Alice's qubit, which in a way is cheating. So can someone explain to me what is happening?
"
"['resource-request', 'physical-realization']"," Title: What are introductory resources to learn about quantum computing hardware?Body: I am interested in learning some details of quantum computers inner working, what are the limitation etc. in order to understand quantum computation more. Can some one refer me to some good materials in this regard? I have a PhD in theoretical physics, so technical documents won't be an issue.
"
"['programming', 'quantum-gate', 'cirq', 'tfq']"," Title: Decomposition of the multi-controlled gate in tensorflow quantumBody: In TensorFlow Quantum 0.5.0, the support for Cirq gates that have arbitrary control via the gate.controlled_by function is added.
I would like to know which kind of decomposition method is used for this operation? The current decomposition seems to be efficient and any information related to that is very welcomed.
"
"['entropy', 'classical-quantum', 'relative-entropy']"," Title: Showing that $S(\rho_{XB}||\sigma_{XB})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$ for classical-quantum statesBody: Having some trouble showing that $S(\rho_{XB}||\sigma_{XB})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$ for $\rho_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}$ and $\sigma_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}$
I know that $$S(\rho_{XB}||\sigma_{XB})=\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))$$ and $$\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))=-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})$$ due to its classical-quantum nature. However, this implies that $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=S(X)+\sum_{x}p(x)S(\rho_{B}^{x})+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$.
Taking $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x} \log(\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}))=$$
$$-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}(\sum_{x}|x\rangle\langle x|\otimes \log(p(x)\sigma_{B}^{x})))=\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=$$
$$-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}(\log(p(x))+\log(\sigma_{B}^{x})))=$$
$$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$
As can be seen, this is not enough to cancel the other terms, which can be seen when putting these two together, you get $$-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})+S(X)+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})-\sum_{x}p(x)S(\rho_{B}^{x})$$ This could only equal the desired exprerssion if $\rho_{B}^{x}$ were pure states, which is specified nowhere in the text I am reading.
Where have I gone wrong?
Edit: As Rammus stated in his answer, I went wrong with $$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$ Instead, it should be
$$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))-\sum_{x}p(x)Tr(\rho_{B}^{x}log(\sigma_{B}^{x}))$$ Putting this back into the original equation gives the desired equality.
"
"['entanglement', 'information-theory', 'terminology']"," Title: What is a maximal entangled multipartite state?Body: We know the four Bell states are the maximal entangled states for two-qubit states, and we know if a state cannot be written as the tensor product by its subsets, then it is a entangled state, so is there a definition of maximal entangled state?
"
"['quantum-state', 'algorithm']"," Title: How do we ensure that the states input to a quantum algorithm are what we want them to be?Body: In various quantum algorithms like quantum Fourier transform we see that our input states are forced to be specified states. But we know that the main property of quantum computers is that the state of a specified qubit is not recognizable unless we measure it and this process is completely random.
My question is: Can we force a qubit in a quantum computer to get our specific states? If yes, how...
"
"['qiskit', 'fidelity', 'swap-test']"," Title: Amplitude encoding: distinction between negative and positive real valuesBody: I want to encode two vectors into qubits and compute a distance between them that corresponds/is proportional to the euclidian distance of the real vectors.
The encoding I use is
- A) qiskit
initialize method
def get_encoding_circuit(*vv):
sz = int(np.log2(len(vv[0])))
qc = QuantumCircuit(len(vv)*sz)
for i, v in enumerate(vv):
qc.initialize(v, range(i*sz, (i+1)*sz))
return qc
and
- B) amplitude encoding as shown here
The distance metric I use is given by the overlap from
- I) qiskit's
state_fidelity method and
- II) a Swap Test circuit.
For example in $\mathbb{R^2}$, $u$ and $v$ given as
$$
u = \begin{bmatrix} 1 \\ 1 \end{bmatrix} \quad
v = \begin{bmatrix} -1 \\ -1 \end{bmatrix}
$$
are encoded as
$$
|u\rangle = \begin{bmatrix} 0.70711 \\ 0.70711 \end{bmatrix} \quad
|v\rangle = \begin{bmatrix} - 0.70711 \\ - 0.70711 \end{bmatrix}
$$
The problem I have (with any combination of A), B) I), II)) is that $|u\rangle$ and $|v\rangle$ have an overlap of 1, so are equivalent. The reason is that the encoding of $v$ is equal to the encoding of $u$, just with a global phase added,
s.t. the fidelity (as computed by qiskit) for example is
$$
| \langle u|v\rangle |^2 = 1.0
$$
but
$\text{dist_eucl}(u,v)$ is far from 0.
What encoding can I use that will produce distinct qubits for positive and negative real inputs?
Edit/Followup:
I finally used the statepreparation described here
For real vectors in the range $[-1,1]$ I obtain quantum distances corresponding to euclidian distances:
"
"['qiskit', 'quantum-gate']"," Title: How to apply Euler's formula to $Z$ rotations such as $e^{i\pi/8 Z}$?Body: I was following the Qiskit textbook and wanted to show that $R_z (\pi/4) = e^{i \pi/8 Z}$.
Plugging $\pi/4$ in for $\theta$ in the matrix from this page $ \begin{bmatrix}
e^{-i \pi/8} & 0 \\
0 & e^{i \pi/8}
\end{bmatrix}$, I end up with $\begin{bmatrix} \frac{1}{\sqrt{2}}-\frac{i}{\sqrt{2}} & 0 \\
0 & \frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}}
\end{bmatrix} $.
However, when I use the Euler's formula to go from $R_z (\pi/4) = e^{i \pi/8 Z}$ to $\cos(\pi/8)+i\sin(\pi/8)$, the matrix I end up with is $\begin{bmatrix} \frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}} & 0 \\
0 & \frac{1}{\sqrt{2}}-\frac{i}{\sqrt{2}}
\end{bmatrix} $.
It appears that one rotation is the opposite of the other. The way the Euler's formula is defined, is the rotational direction opposite of the other?
"
"['algorithm', 'unitarity', 'eigenvalue']"," Title: Why are all the eigenvalues of a ""Hermitian block-encoding"" equal to $\pm1$?Body: I was looking at the paper : https://arxiv.org/abs/2002.11649 and the eigenvalue discussion is not clear to me.
Block-encoding is a general technique to encode a nonunitary matrix on a quantum computer. Let $A \in \mathbb{C}^{N \times N}$ be an $n$-qubit Hermitian matrix. If we can find an $(m+$ $n)$-qubit unitary matrix $U \in \mathbb{C}^{M N \times M N}$ such that
$$
U_{A}=\left(\begin{array}{cc}
A & \cdot \\
\cdot & \cdot
\end{array}\right)
$$
holds, i.e., $A$ is the upper-left matrix block of $U_{A}$, then we may get access to $A$ via the unitary matrix $U_{A}$. In particular,
$$
A=\left(\left\langle 0^{m}\right| \otimes I_{n}\right) U_{A}\left(\left|0^{m}\right\rangle \otimes I_{n}\right)
$$
If $U_{A}$ is Hermitian, it is called a Hermitian block-encoding. In particular, all the eigenvalues of a Hermitian block-encoding $U_{A}$ are $\pm 1$.
It is not clear why all the eigenvalues are $\pm 1$? any guidance?
Thanks
"
"['superconducting-quantum-computing', 'experiment', 'optical-quantum-computing', 'ion-trap-quantum-computing', 'linear-optics']"," Title: Why is it important to perform optical quantum computing with ONLY linear components?Body: The main achievement of the KLM protocol is demonstrating that quantum computing can be done with only linear optical elements, i.e., beam splitters, phase shifters, single-photon sources, and photo-detectors. I wonder why it is important to restrict to linear optics.
The KLM protocol paper mentions an early implementation of a quantum phase gate, which uses a Kerr nonlinearity. I think the reason we are restricted to linear optics is that the Kerr nonlinearity is too weak. Since those papers are outdated, I wonder whether there is any stronger optical nonlinearity implemented at present.
Moreover, regarding other quantum computing platforms, Josephson junctions are very strong nonlinear elements. However, if a small amount of nonlinearity can satisfy all (or most) requirements, then having no strong nonlinearity may not be that bad. In other words, if quantum computing can be conveniently done with most linear components + some weak nonlinearity, then it seems not that important to develop an ALL linear platform.
"
"['qiskit', 'programming', 'algorithm', 'tomography', 'shadow-tomography']"," Title: Implement the classical shadow coding error?Body: I'm trying to reproduce the basic method of classical shadow, which is based on the tutorial of pennylane. However, I've met some realization problems here when I finish reading the tutorial of pennylane, and trying to finish the method myself, just to check if my understanding is correct, because I'm not sure if my understanding about the inverse of the map $M$ mentioned in the paper is correct.
I will describe the method shortly first, and then showing my code with qiskit, pennylane, and matlab. But all of them failed to have the same effect as the tutorial of pennylane does(increasing the number of measurements, the distance between the state I want to reconstruct and the original state should be more and more close).
The idea of classical shadow(or the process of the algorithm) is kind of simple while the math behind it might be complicated. The process states that for any density matrix $\rho$, we act some unitary matrix $U$ which are chosen randomly from a specific set of the unitary matrix $\mathcal{U}$ on it, i.e., $U\rho U^\dagger$. Then we do one-shot measurement based on the computational basis on $U\rho U^\dagger$. Then the state will collapse into some state $|\hat{b}\rangle$. And then we do the rest of the work in classical data analysis style. First we undo the unitary matrix, i.e., $U^\dagger |\hat{b}\rangle\langle \hat{b}| U$ . Then we do the inverse of the map $\hat{\rho}\equiv M^{-1}(U^\dagger |\hat{b}\rangle\langle \hat{b}| U)$ which can be defined as $M(\rho)\equiv E(U^\dagger |\hat{b}\rangle\langle \hat{b}| U)$, where the $E$ stands for expectation over both unitary matrix and measurement result $|\hat{b}\rangle$. And for a specific choice of unitary set(seems Clifford group, not very clear here), we have a form of the inverse of $M$ states as
$$
\hat{\rho} = \bigotimes_{j=1}^n(3U^{\dagger}_j|\hat{b}_j\rangle\langle\hat{b}_j|U_j-\mathbb{I})\tag{1}
$$
Then I will introduce my code first. We specify the unitary group into Hadamard gate, phase gate, and identity. Then we do the computational basis measurement and rebuild the classical shadow $\hat{\rho}$ with the help of eq.(1), and then calculate the expectation value of $\hat{\rho}$ by directly divide measurement times.
Following the codes(pennylane, qiskit, Matlab), aiming at construct the classical shadow of bell state:
from networkx.algorithms.centrality import harmonic
from networkx.exception import HasACycle
from networkx.readwrite.sparse6 import write_sparse6
from numpy import dtype
from numpy.random.mtrand import rand
import pennylane as qml
from pennylane import wires
import pennylane.numpy as np
import matplotlib.pyplot as plt
import time
def distance(rho):
return np.sqrt(np.trace(rho.conjugate().transpose() @ rho))
def my_quantum_function(x, y):
unitary = [qml.Hadamard, qml.S, qml.Identity]
qml.Hadamard(wires=0)
qml.CNOT(wires=[0,1])
unitary[y[0]](wires=0)
unitary[y[1]](wires=1)
# all measure in computational basis, i.e., mean value of pauliz, one-shot case
return [qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))]
# one-shot case shots = 1 to simulate the measure in computational basis requirement
dev = qml.device('default.qubit', wires=2, shots=1)
circuit = qml.QNode(my_quantum_function, dev)
# generate random number seed for easy replicate the experiment
np.random.seed(666)
# init
phase_z = np.array([[1, 0], [0, 1j]], dtype=complex)
hadamard = qml.Hadamard(0).matrix
identity = qml.Identity(0).matrix
unitary = [hadamard, phase_z, identity]
snapshot = 1000
state0 = np.array([[1,0],[0,0]])
state1 = np.array([[0,0],[0,1]])
record_rho = np.zeros([4,4])
for i in range(snapshot):
randnum = np.random.randint(0,3,size=2)
[res0, res1] = circuit(0,randnum)
# print(circuit.draw())
if res0 == 1:
rho1 = 3*(unitary[randnum[0]].conj().T @ state0 @ unitary[randnum[0]]) - identity
else:
rho1 = 3*(unitary[randnum[0]].conj().T @ state1 @ unitary[randnum[0]]) - identity
if res0 == 1:
rho2 = 3*(unitary[randnum[1]].conj().T @ state0 @ unitary[randnum[1]]) - identity
else:
rho2 = 3*(unitary[randnum[1]].conj().T @ state1 @ unitary[randnum[1]]) - identity
record_rho = record_rho + np.kron(rho1,rho2)
record_rho = record_rho/snapshot
bell_state = np.array([[0.5, 0, 0, 0.5], [0, 0, 0, 0], [0, 0, 0, 0], [0.5, 0, 0, 0.5]])
print(record_rho)
print(distance(record_rho - bell_state))
from math import exp
from qiskit import *
from qiskit import Aer
import numpy as np
import matplotlib.pyplot as plt
from random import randrange
np.random.seed(222)
def one_shot(operator):
sim = Aer.get_backend('aer_simulator')
qc = QuantumCircuit(2)
unitary = [qc.h, qc.sdg, qc.id]
qc.h(0)
qc.cx(0,1)
unitary[operator[0]](0)
unitary[operator[1]](1)
qc.measure_all()
qobj = assemble(qc,shots=1)
result = sim.run(qobj).result().get_counts()
return result
def distance(rho):
'''
calculate distance of two density matrix
'''
return np.sqrt(np.trace(rho.conjugate().transpose().dot(rho)))
hadamard = 1/np.sqrt(2)*np.array([[1,1],[1,-1]])
s_gate = np.array([[1,0],[0,-1j]],dtype=complex)
id = np.identity(2)
unitary = [hadamard,np.dot(hadamard,s_gate),id]
snapshot_num = 1000
state0 = np.array([[1,0],[0,0]])
state1 = np.array([[0,0],[0,1]])
record_rho = np.zeros([4,4])
for i in range(snapshot_num):
randnum = np.random.randint(0,3,size=2)
result = one_shot(randnum)
if result.get('00') == 1:
rho = np.kron(3*np.dot(unitary[randnum[0]].conj().T,state0).dot(unitary[randnum[0]] - id),3*np.dot(unitary[randnum[1]].conj().T,state0).dot(unitary[randnum[1]]) - id)
elif result.get('01') == 1:
rho = np.kron(3*np.dot(unitary[randnum[0]].conj().T,state0).dot(unitary[randnum[0]] - id),3*np.dot(unitary[randnum[1]].conj().T,state1).dot(unitary[randnum[1]]) - id)
elif result.get('10') == 1:
rho = np.kron(3*np.dot(unitary[randnum[0]].conj().T,state1).dot(unitary[randnum[0]] - id),3*np.dot(unitary[randnum[1]].conj().T,state0).dot(unitary[randnum[1]]) - id)
else:
rho = np.kron(3*np.dot(unitary[randnum[0]].conj().T,state1).dot(unitary[randnum[0]] - id),3*np.dot(unitary[randnum[1]].conj().T,state1).dot(unitary[randnum[1]]) - id)
record_rho = record_rho + rho
record_rho = record_rho/snapshot_num
bell_state = np.array([[0.5, 0, 0, 0.5], [0, 0, 0, 0], [0, 0, 0, 0], [0.5, 0, 0, 0.5]])
print(record_rho)
print(distance(record_rho - bell_state))
% Pauli matrix as random unitary
pauli = eye(2);
pauli(:,:,2) = [1 0;0 -1j]; pauli(:,:,3) = 1/sqrt(2)*pauli(:,:,2)'*[1 1;1 -1];
% two computational basis |0) and |1)
state = eye(4);
state0 = [1;0];
state1 = [0;1];
psi = 1/sqrt(2)*[1;0;0;1];
rho = psi*psi';
record_rho = zeros(4);
n = 6000;
for i = 1:n
randnum = randi([1 3],[1 2]);
rhot = kron(pauli(:,:,randnum(1)),pauli(:,:,randnum(2)))*rho*kron(pauli(:,:,randnum(1)),pauli(:,:,randnum(2)))';
prob1 = state(:,1)'*rhot*state(:,1);
prob2 = state(:,2)'*rhot*state(:,2);
prob3 = state(:,3)'*rhot*state(:,3);
prob4 = state(:,4)'*rhot*state(:,4);
% Utilizing if to simulate the quantum measurement
% The inverse process is using the formula of eq(S44) in supplemental
% material of the original paper
if rand < prob1
rhot = 3*pauli(:,:,randnum(1))'*(state0*state0')*pauli(:,:,randnum(1)) - eye(2);
rhot = kron(rhot,3*pauli(:,:,randnum(2))'*(state0*state0')*pauli(:,:,randnum(2)) - eye(2));
elseif rand < prob1 + prob2
rhot = 3*pauli(:,:,randnum(1))'*(state0*state0')*pauli(:,:,randnum(1)) - eye(2);
rhot = kron(rhot,3*pauli(:,:,randnum(2))'*(state1*state1')*pauli(:,:,randnum(2)) - eye(2));
elseif rand < prob1 + prob2 + prob3
rhot = 3*pauli(:,:,randnum(1))'*(state1*state1')*pauli(:,:,randnum(1)) - eye(2);
rhot = kron(rhot,3*pauli(:,:,randnum(2))'*(state0*state0')*pauli(:,:,randnum(2)) - eye(2));
else
rhot = 3*pauli(:,:,randnum(1))'*(state1*state1')*pauli(:,:,randnum(1)) - eye(2);
rhot = kron(rhot,3*pauli(:,:,randnum(2))'*(state1*state1')*pauli(:,:,randnum(2)) - eye(2));
end
record_rho = record_rho + rhot;
end
record_rho = record_rho/n;
sqrt(trace((rho - record_rho)'*(rho - record_rho)))
Fidelity(rho,record_rho)
"
"['circuit-construction', 'gate-synthesis', 'clifford-group']"," Title: How is a Toffoli gate built without using T gates?Body: Can someone tell me how to make a Toffoli gate without using T gates? Can we use $R_x$ and $R_y$. If yes, then how?
I tried many circuits but I was unable to create the CCNOT gate out of $R_x$, $R_y$ and $R_z$.
"
"['entropy', 'decoherence', 'dynamics']"," Title: Coherence measurement for density matrixBody: I have a density matrix of the form:
$$\rho(t)=\left[
\begin{array}{ccc}
\frac{1}{4}+\frac{1}{12} e^{-\frac{2 \tau ^{2 H+2}}{2 H+2}} & \frac{1}{3} & \frac{1}{4}+\frac{1}{12} e^{-\frac{2 \tau ^{2 H+2}}{2 H+2}} \\
\frac{1}{3} & \frac{1}{2}-\frac{1}{6} e^{-\frac{2 \tau ^{2 H+2}}{2 H+2}} & \frac{1}{3} \\
\frac{1}{4}+\frac{1}{12} e^{-\frac{2 \tau ^{2 H+2}}{2 H+2}} & \frac{1}{3} & \frac{1}{4}+\frac{1}{12} e^{-\frac{2 \tau ^{2 H+2}}{2 H+2}} \\
\end{array}
\right].$$
I want to quantify/observe the time evolution of coherence for this matrix showing dynamics of a quantum system between any two times $\tau_o$ and $\tau$ except using entropies. I will be thankful for your time and kind help.
"
"['complexity-theory', 'simulation', 'speedup']"," Title: Could quantum computers answer the question of whether QCD predicts quark gluon confinement?Body: As I understand it, it is not known whether or not QCD actually predicts quark gluon confinement.
As I understand it answering questions in quantum field theories is generally harder in terms of computation than answering questions in quantum mechanics. I understand that in Quantum Mechanics there is one wavefunction for a system of particles, which is a function of the possible position of each particle, which makes it sound like the computational time needed to simulate a wavefunction of multiple particles would in general go up exponentially with the number of particles. From this I might suspect that the question on whether or not QCD predicts quark gluon confinement is at least at the difficulty of being an EXPTime problem, if not harder, and I understand that the types of problems that quantum computers tend to be able to solve are ones that are NP problems.
So my question is could a quantum computer answer the question on whether or not QCD predicts quark gluon confinement, or is this question too hard even for a quantum computer?
"
"['algorithm', 'circuit-construction', 'grovers-algorithm']"," Title: What is the circuit for grover's algorithm if N is not a power of 2?Body: From the literature it seems that grover's algorithm works if $N$ is not a power of $2$. For instance, https://en.wikipedia.org/wiki/Grover%27s_algorithm
and
https://arxiv.org/abs/quant-ph/0005055
I can definitely see that how this algorithm is represented by using unitary matrices. But, when discussing the circuit, all textbooks I found assume $N=2^n$.
May I ask that how the circuit is designed if $N$ is not a power of $2$? Any reference is appreciated!
"
"['entanglement', 'ibm']"," Title: How much information is stored in entangled states (IBM report Quantum Decade)?Body: In its report Quantum Decade, IBM claims that we need 512 classical bits to represent two-qubits entangled state (see graphic on pg. 2 in the report). This seems a little bit odd to me.
Lets have a general two-qubits quantum state $|\psi\rangle = \alpha|00\rangle + \beta|01\rangle + \gamma|10\rangle + \delta|11\rangle$ where probability amplitudes are complex numbers. Assume that the amplitudes are expressed with two real values each, i.e. 8 real numbers in total. The only way how to come to 512 bits is using 64 bits real numbers (double precission) on a classical computer.
I understand that the report is intended for managers rather than experts in computers sciences and quantum computing but still this seems a little bit misleading as the number of classical bits required depends on a precission of a quantum computer simulation (for single precission we would need only 256 bits), moreover, the memory requirements hold for any two-qubits state, not only entangled ones.
On top of that, IBM also claims in the report that
Entanglement means the combined state of the qubits contains more information than the qubits do independently.
If we have for example Bell state and measure both qubits, we are left with two classical bits. So, there is the same amount of information as in two classical bits. Only difference is that in entangled state we can infer state of other qubits from measuring only few in the state but in the end we have same amount of information.
Is my understanding right and the report is more marketing material or am I missing something important?
"
"['circuit-construction', 'mathematics', 'quantum-circuit', 'universal-gates']"," Title: Minimum number of 2 qubit gates to build any unitaryBody: Any unitary $U$ acting on $N$ qubits can be decomposed in a finite product $U=U_1U_2...U_n$ where every $U_i$ acts on only 2 qubits, for example through decomposition in CNOT, phase shifts and 1 qubit rotations.
Is there a theorem that gives $n_{min}$ the minimum number of 2 qubit gates to build any fixed size unitary ?
(Given that every qubit need to be used at least once $n_{min}\geq N$)
"
"['quantum-state', 'measurement', 'povm', 'state-discrimination']"," Title: Are projective measurements the only optimal measurements to discriminate between two states?Body: Consider two density matrices $\rho$ and $\sigma$. The task is to distinguish between these two states, given one of them --- you do not know beforehand which one.
There is an optimal measurement to distinguish between these two states --- the Helstrom measurement. Note that it is an orthogonal projector.
Are orthonormal/orthogonal projectors the only optimal measurement possible?
In other words, can we say that if we had chosen any non-orthogonal POVM as our measurement, we would not have achieved the optimal distinguishing probability?
"
"['quantum-gate', 'quantum-state', 'entanglement', 'hadamard', 'state-preparation']"," Title: Is the CNOT in the standard three-qubit circuit for the GHZ state necessary?Body: This is a very basic question about the GHZ state. I know the standard construction:
A Hadamard on one qubit, and then CNOT gates with targets on all the other ones.
However, why can't I just have $n$ Hadamard gates for $n$ qubits? Why would this not be equivalent--what am I missing?
"
"['resource-request', 'simulation']"," Title: What are the evidences that quantum simulation have a future?Body: Here future means orders of improvement which can solve rather different problems e.g. emergent phenomenon.
For example, the first integrated logic only have several transistors, now it have billions of them, which is $10^9$ better thats a future.
If quantum simulation system can only scale from several bits to 1000 bits, it doesn't make big difference since you can only improve from hydrogen to benzene.
The goal is to simulate a whole cell or any small piece of material and predict its properties with high precision.
IMO there are several difference between the scalability of quantum simulation and CMOS logic:
- It's not 1+1=2, there seems to be noises to overcome, and it's possible that the mothed to overcome noises cannot scale much at all.
- The complexity is not linear too, but poylmonial like the bits required scale with $n^4$ ($n$ is the number of particles in the system). For CMOS circuits you get double performance with double gates (not considering interconnect bottleneck).
Could anybody provide link to an article discussing future possibilities of quantum systems simulation and possible bottlenecks?
"
"['quantum-state', 'textbook-and-exercises', 'bloch-sphere']"," Title: How does Equation (9) follows from these definitions?Body: How does Equation (9) follows from these definitions?
This is my working out for the first identity. It appears that the identity is not true.
For the second identity, I used sympy to check. The identity also appears to not hold. This is the final simplification.
"
"['entanglement', 'measurement', 'quantum-circuit', 'matrix-representation']"," Title: How to analyze the following quantum circuit?Body: I'm trying to analyze the following quantum circuit
The goal here is to analyze the final outputs at q3 & q4.
For inputs, at q0 & q1, one of the Bell state
$$|\psi\rangle = \frac{|01\rangle + |10\rangle}{\sqrt{2}}$$
is fed, and at q2, q3, and q4, the GHZ state
$$|\text{GHZ}\rangle = \frac{|000\rangle + |111\rangle}{\sqrt{2}}$$
is fed.
I am able to construct the matrix representations for the previous 7 operations; for example, passing the first Hadamard gate, we have
$$M_1 = I\otimes H\otimes I\otimes I\otimes I$$
and passing the first CNOT gate, we have
$$M_2 = I\otimes\text{CNOT}\otimes I\otimes I$$
so the first two operations are simply $M_2M_1$, hence I think I can compute the state after these two operations by
$$M_2M_1(|\psi\rangle\otimes|\text{GHZ}\rangle)$$
(hope I didn't make a mistake up to this point).
However, I fail to see how to construct the matrix for, e.g., the 8th operation, i.e., the "reversed" CNOT gate for q4 & q3 (and the last one for q4 & q0). And since the output might be entangled, I don't see how to calculate the possible outcomes at q3 and q4.
Any suggestions? Thanks.
"
"['algorithm', 'vqe', 'qaoa']"," Title: What does the paper ""Training Variational Quantum Algorithms Is NP-Hard (Phys. Rev. Lett. 127, 120502)"" mean?Body: I have seen the recent paper "Training Variational Quantum Algorithms Is NP-Hard (Phys. Rev. Lett. 127, 120502)" and the authors stated that training the classical optimization in variational quantum algorithms is NP-Hard.
Does it mean we cannot achieve a significant quantum computational advantage over classical computing in solving certain problems via variational quantum algorithms?
I am fresh in the quantum computing field and cannot fully understand its meaning. It would be really appreciated if someone can show what the results really imply.
"
"['quantum-state', 'entanglement', 'measurement', 'probability', 'state-discrimination']"," Title: Do entangled measurements across multiple copies help in state distinguishability?Body: Consider two density matrices $\rho$ and $\sigma$. The task is to distinguish between these two states, given one of them --- you do not know beforehand which one.
There is an optimal measurement to distinguish between these two states --- the Helstrom measurement. Note that it is an orthogonal projector.
Now, if we have $k$ copies of the states, do we get any advantage from an entangled measurement across $k$ copies?
The optimal measurement, in this case, is a Helstorm measurement once again, of $\rho'$ and $\sigma'$, with $\rho' = \rho^{\otimes k}$ and $\sigma' = \sigma^{\otimes k}$. In general, this is an entangled measurement across the $k$ copies.
If we measure each copy separately and do some quantum or classical post-processing afterwards, how close can we go to the optimal distinguishing probability?
"
"['quantum-state', 'density-matrix', 'unitarity', 'pauli-gates', 'clifford-group']"," Title: Proof for Cardinality of the Clifford GroupBody: In this article: (http://home.lu.lv/~sd20008/papers/essays/Clifford%20group%20[paper].pdf) a proof is given for the cardinality of the Clifford group. I understand all the parts of it except for how the recursion is given. The part above equation (4) which states that:
"The elements of $C_n$ that leave both $X_n$ and $Z_n$ fixed form a group isomorphic
to $C_{n−1}$ with the number of cosets equal to $2(4^n − 1)4^n$
. Hence $|C_n| = 2(4^n − 1)4^n|C_{n−1}|$.
Therefore,
$$\left|\mathcal{C}_{n}\right|=\prod_{j=1}^{n} 2\left(4^{j}-1\right) 4^{j}=2^{n^{2}+2 n} \prod_{j=1}^{n}\left(4^{j}-1\right) .\textrm{""}$$
Can someone explain how the isomorphism and cosets are defined, and how this leads to a recursion which correctly counts the right amount of elements of $C_n$?
"
"['quantum-operation', 'vqe']"," Title: Why the partial derivative of cost function is written in this form?Body: I am reading a paper about QCNN and BP problem. And in the paper there is a part illustrating the relation between the trainability and variance of the cost. The cost function is written as,
$C(\theta)=Tr[V(\theta)\sigma V^\dagger (\theta)\tilde O]$
$\theta$ is the vector of the trainable parameters, $V(\theta)$ is the unitary that contains the gates in the convolutional and pooling layers plus the fully connected layer, $\tilde O$ is defined on the input Hilbert space such that its expectation value represents the measured value.
And we want to evaluate the partial derivative of $C(\theta)$ with respect to $\theta_\mu$, and the explicit form is
$\partial_\mu C = Tr[W_A V_L \sigma V_L^{\dagger} W_A^{\dagger} [H_\mu, W_B^\dagger V_R^\dagger\tilde O V_R W_B]]\space (*)$
where $V=V_RWV_L$, where $V_R$ and $V_L$ contain all gates in the QCNN except for W. And $W=W_BW_A, W_A=\prod_{\eta \leq \mu}e^{-i\theta_\eta H_\eta},W_A=\prod_{\eta > \mu}e^{-i\theta_\eta H_\eta}$.
I am quite confused about (*), since based on the direct derivation of $C(\theta)$, I get,
$\partial_\mu C = Tr[V_R W_B (\partial_\mu W_A) V_L \sigma V_L^\dagger W_A^\dagger W_B^\dagger V_R^\dagger \tilde O] + Tr[V_R W_B W_A V_L \sigma V_L^\dagger (\partial_\mu W_A^\dagger ) W_B^\dagger V_R^\dagger \tilde O]$
Why the relative positions of each operators are different from what I got above, and what is the specific definition of $H_\mu$ (to be more specific, how does $H_\mu$ relates to $\partial_\mu$) ?
For your reference, the the arxiv link of the original paper is https://arxiv.org/abs/2011.02966.
Any help would be appreciated!!
"
"['programming', 'optical-quantum-computing', 'qutip', 'master-equation']"," Title: How to solve non-""cross-damping off"" Linblad equation in QuTiP?Body: As I understand from the official QuTiP guidlines, it is only capable of solving "cross-damping off" Master Equation in form:
$\dot{\rho(t)} = -\dfrac{i}{\hbar}[H(t),\rho(t)] + \sum\limits_n\dfrac{1}{2}\left[ C_n\rho(t)C_n^{\dagger} - \rho(t)C_n^{\dagger}C_n - C_n^{\dagger}C_n\rho(t) \right].$
Where $C_n$ are collapse operators. However when we need to consider cross-damping, the ME takes the form like:
$\dot{\rho(t)} = -\dfrac{i}{\hbar}[H(t),\rho(t)] + \sum\limits_{i,j}\dfrac{1}{2}\left[ C_i\rho(t)C_j^{\dagger} - \rho(t)C_i^{\dagger}C_j - C_i^{\dagger}C_j\rho(t) \right].$
Is QuTiP capable of solving this? And how one can manage to code this if it is?
"
['algorithm']," Title: Oblivious Amplitude Amplification & Eigenstate decompositionBody: Looking at the oblivious AA (OAA) : https://docs.microsoft.com/en-us/azure/quantum/user-guide/libraries/standard/algorithms
I am trying to figure out the eigendecomposition of Q, which leads to below. Any help or suggestion on how to derive these would be highly appreciated!
$$
|\psi\rangle=\frac{-i}{\sqrt{2}}\left(e^{i \theta}\left|\psi_{+}\right\rangle+e^{-i \theta}\left|\psi_{-}\right\rangle\right)
$$
where $\left|\psi_{\pm}\right\rangle$are eigenvectors of $Q$ with eigenvalues $e^{\pm 2 i \theta}$ and only have support on the $+1$ eigenvectors of $P_{0}$ and $P_{1}$.
Here are the key sentences from the website
Each iteration of Amplitude amplification requires that two reflection operators be specified. Specifically, if $Q$ is the amplitude amplification iterate and $P_{0}$ is a projector operator onto the initial subspace and $P_{1}$ is the projector onto the marked subspace then $Q=-\left(\mathbf{1}-2 P_{0}\right)\left(\mathbf{1}-2 P_{1}\right)$. Recall that a projector is a Hermitian operator that has eigenvalues $+1$ and 0 and as a result $\left(\mathbf{1}-2 P_{0}\right)$ is unitary because it has eigenvalues that are roots of unity (in this case $\pm 1$ ). As an example, consider the case of Grover's search with initial state $H^{\otimes n}|0\rangle$ and marked state $|m\rangle, P_{0}=H^{\otimes n}|0\rangle\langle 0| H^{\otimes n}$ and $P_{1}=|m\rangle\langle m| .$ In most applications of amplitude amplification $P_{0}$ will be a projector onto an initial state meaning that $P_{0}=\mathbf{1}-2|\psi\rangle\langle\psi|$ for some vector $|\psi\rangle ;$ however, for oblivious amplitude amplification $P_{0}$ will typically project onto many quantum states (for example, the multiplicity of the $+1$ eigenvalue of $P_{0}$ is greater than 1 ).
The logic behind amplitude amplification follows directly from the eigen-decomposition of $Q .$ Specifically, the eigenvectors of $Q$ that the initial state has non-zero support over can be shown to be linear combinations of the $+1$ eigenvectors of $P_{0}$ and $P_{1}$. Specifically, the initial state for amplitude amplification (assuming it is a $+1$ eigenvector of $P_{0}$ ) can be written as
$$
|\psi\rangle=\frac{-i}{\sqrt{2}}\left(e^{i \theta}\left|\psi_{+}\right\rangle+e^{-i \theta}\left|\psi_{-}\right\rangle\right)
$$
where $\left|\psi_{\pm}\right\rangle$are eigenvectors of $Q$ with eigenvalues $e^{\pm 2 i \theta}$ and only have support on the $+1$ eigenvectors of $P_{0}$ and $P_{1}$. The fact that the eigenvalues are $e^{\pm i \theta}$ implies that the operator $Q$ performs a rotation in a two-dimensional subspace specified by the two projectors and the initial state where the rotation angle is $2 \theta$. This is why after $m$ iterations of $Q$ the success probability is $\sin ^{2}([2 m+1] \theta)$
"
"['qiskit', 'programming', 'projectq']"," Title: The difference between the unitary matrix in ProjectQ and QiskitBody: Why are not the same unitary matrices in ProjectQ and Qiskit in the following codes:
ProjectQ:
drawing_engine = CircuitDrawerMatplotlib()
eng = MainEngine(backend = UnitarySimulator(), engine_list = [drawing_engine]+get_engine_list())
qreg = eng.allocate_qureg(3)
theta1 = pi/4
theta2 = pi/5
X | qreg[2]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta2) | qreg[0]
X | qreg[1]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta1) | qreg[0]
X | qreg[2]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta2) | qreg[0]
X | qreg[1]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta1) | qreg[0]
X | qreg[2]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta2) | qreg[0]
X | qreg[1]
with Control(eng, [qreg[2],qreg[1]]):
Ry(2*theta1) | qreg[0]
eng.flush()
print(eng.backend.unitary.real)
Qiskit:
qreg = QuantumRegister(3)
creg = ClassicalRegister(3)
circuit = QuantumCircuit(qreg,creg)
theta1 = pi/4
theta2 = pi/5
circuit.x(qreg[2])
circuit.mcry(2*theta2,[ qreg[2], qreg[1] ],qreg[0],None)
circuit.x(qreg[1])
circuit.mcry(2*theta1,[ qreg[2], qreg[1] ],qreg[0],None)
circuit.x(qreg[2])
circuit.mcry(2*theta2,[ qreg[2], qreg[1] ],qreg[0],None)
circuit.x(qreg[1])
circuit.mcry(2*theta1,[ qreg[2], qreg[1] ],qreg[0],None)
circuit.x(qreg[2])
circuit.mcry(2*theta2,[ qreg[2], qreg[1] ],qreg[0],None)
circuit.x(qreg[1])
circuit.mcry(2*theta1,[ qreg[2], qreg[1] ],qreg[0],None)
job = execute(circuit,Aer.get_backend('unitary_simulator'),optimization_level=0)
unitary_matrix=job.result().get_unitary(circuit,decimals=8)
unitary_matrix.real
"
"['vqe', 'linear-algebra']"," Title: How to express real matrices as linear combinations of unitaries?Body: I am working on using Variational Quantum Linear Solver (VQLS) for some tasks. Here, we need to represent matrix A as a linear combination of unitaries.
$$ {\bf A} = \Sigma^n_{i=1} c_iA_i $$
My questions are:
- Is there any general decomposition method of finding such $A_i$ unitaries? Please note that data is real-valued and not only binary.
- Should matrix A be broken based on its basis? (Basis can be eigenbasis of the matrix
A or it can be general basis like Pauli matrices)
- How do we find the value of
n i.e., the number of such unitaries?
"
"['hamiltonian-simulation', 'phase-estimation', 'applications']"," Title: Can we use quantum phase estimation to learn anything about the dynamics of puzzles like the Rubik's cube?Body: Introduction
Consider a state $\vert\psi\rangle$ such as below, which is in a superposition of a difference between a Rubik's cube in a solved state and a Rubik's cube in the "superflip" state.
Here, with eight cells on each face (apart from the fixed center cell), six faces, and three qubits (or one qubit and one qutrit) to record the color of each cell, $\vert\psi\rangle$ can be encoded with $8\times 6\times 3=144$ qubits.
A circuit to simulate the cube
Letting:
$$\langle F_1,B_1,L_1,R_1,U_1,D_1,F_2,B_2,L_2,R_2,U_2,D_2,F_3,B_3,L_3,R_3,U_3,D_3\rangle$$
be a generating set of $\mathsf{SWAP}$ circuits for the quarter-turn, half-turn, and three-quarter turn twists of each of the front, back, left, right, up, and down face, and choosing a Trotter factor of four, we can simulate $\mathcal H_{\text{Rubik's}}$ as:
$$e^{-i\mathcal H_{\text{Rubik's}}}\approx\big(\sqrt[4]{F_1}\sqrt[4]{B_1}\sqrt[4]{L_1}\sqrt[4]{R_1}\sqrt[4]{U_1}\sqrt[4]{D_1}\sqrt[4]{F_2}\cdots \sqrt[4]{D_2}\sqrt[4]{F_3}\cdots\sqrt[4]{D_3}\big)^4=:W;$$
that is, $W$ is a circuit that iterates each of the fourth roots of each of the generators four times.
Some other ideas help to clarify how to take such roots for each such generator. For example, the half-turn moves $F_2,B_2$, etc. all have order two (e.g. $F_2^2=F_2 F_2=\mathbb I$), and we can use a single ancilla to corresponding to the respective $\pm 1$ eigenspace. An example of $\sqrt[4]{F_2}$ is illustrated below, with the ancilla at the top (I'm only showing eight cells for brevity).
Each of $\vert A\rangle,\vert B\rangle,$ etc. are three-qubit registers (or as mentioned, one-qutrit, one-qubit registers) that can be in a superposition of the six possible colors.
The circuits for the roots for the quarter-turn generators $F_1,F_3$, etc. are only slightly more complicated, as there the order is four (e.g. $F_1^4=F_3^4=\mathbb I$ with eigenvalues $\pm1, \pm i$), and they would require two ancillae instead of just the one.
Quantum phase estimation of the cube
Nonetheless performing a von Neumann measurement of a Hamiltonian $\mathcal H_{\text{Rubik's}}$ acting on $\vert\psi\rangle$ gives a natural probability distribution supported by the eigendecomposition of $\vert\psi\rangle$. Indeed, with a quantum phase estimation circuit as below, we can sample from such a distribution, with $5$ qubits of precision.
If we were able to execute and sample such a circuit acting on various superpositions of the cube, could we learn anything about how difficult it is to walk from various states to each other?
For example, my intuition is that if $\vert\psi\rangle$ is in a superposition $\frac{1}{\sqrt 2}|J\rangle-\frac{1}{\sqrt 2}|K\rangle$ of the Rubik's cube with $J$ and $K$ two configurations of the cube that are close to each other under the appropriate word metric, then most of the eigenvalues sampled will be close to zero, whereas the superposition of the solved state minus the superflip state likely has a decomposition with most eigenvalues far away from zero.
This is based on some ideas from Janzing and Wocjan (1, 2, 3) on some (promise) BQP-complete problems with large matrices. Also, I use five qubits with $W$ being applied up to thirty-one times, because that's more than the twenty twists associated with the diameter of the cube, and hence I intuit that thirty-one steps would be classically infeasible, but of course it might be interesting even if a controlled-$W$ were applied only once. Lastly I take it for granted that we can prepare a state such as $\vert\psi\rangle$ by optimizing a clever sequence of Hadamards and CNOT's/CZ's with a mapping of qubits to colors; this state-preparation question was noted and assumed straightforward in Janzing and Wocjan (and also HHL).
"
"['resource-request', 'quantum-memory']"," Title: Resources for QRAM implemented as a subroutine for quantum algorithmBody: I am currently working on a project on a higher version of amplitude amplification and for that we want to store the initial state (which will be some sort of superposition) into a QRAM. Now we want to simulate the working of the algorithm and I am supposed to make a QRAM, but most of the papers which use QRAM as a subroutine have not shown implementation, furthermore the bucket brigade Quantum RAM is actually not able to give out a superposition of Quantum States which have been stored into a QRAM.
Ideally we want the QRAM to work something like this,
$$
\sum_{j=0}^{2^q-1} \alpha_j | \text{adr}_j \rangle|0\rangle \xrightarrow{\text{QRAM}} \sum_{j=0}^{2^q-1}\alpha_j |\text{adr}_j\rangle|m_j\rangle
$$
Anyone who has any idea which QRAM will be able to query out a superposition of states stored in memory cells, please provide some reference. Any help is greatly appreciated!!
"
"['qiskit', 'measurement', 'error-correction']"," Title: Can someone please explain how the syndrome bit still ends up being 0 in this quantum error correction circuit using repetition code?Body:
I'm not too great at dealing with superpositions and applying the CNOT gate when superpositions are involved. Can you go through it in detail each gate using math/matrices etc. It's based on the quantum error correction (using repetition codes) part of the Qiskit textbook.
Link to the specific page in the textbook: https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html
"
"['resource-request', 'cryptography', 'key-distribution', 'qkd']"," Title: Major Security proofs available for Device-Independent QKDBody: I've lately started working on a DI-QKD project. I've started looking into Vazirani and Vidick's PRL paper on Device-Independent QKD security proof. It's proving to be quite time-consuming for me to go through all of the proofs.
I'm curious if there are any other well-known security proofs for DI-QKD that go in a different way from Vazirani and Vidick's. So that I can get a general estimate of how many more proofs I'll need to read in order to cover all of DI-security QKD's proofs. In order for me to be able to allocate my time properly.
Or is this the main paper, and only minor changes have been made to it since then?
If you have any familiarity with DI-QKD, it would be helpful if you could give me some insight or point me to some of the important security proofs available. Alternatively, find an article or review paper that addresses these DI-QKD-related subjects.
It would also be beneficial for future students who would like to understand DI-QKD.
"
['error-correction']," Title: What is the process of error correction if I want to apply one $X$ gate to my logical qubit?Body: I am trying to understand the general process of error correction.
E.g. I have a few physical qubits encoded as a logical qubit $\vert0\rangle_L = \vert 0 0 0...0\rangle$. What is the process of error correction if I want to apply, say, one $X$ gate to my logical qubit?
- Apply $X$ gate on logical qubit $\vert0\rangle_L$.
$\Rightarrow$ $X$ gate is applied on the underlying physical qubits $ \vert 0 0 0...0\rangle$.
- Error correction algorithm is applied and corrects errors (if any).
Is this process repeated until every gate of the quantum circuit has been applied? Or how often is the error correction algorithm applied?
"
"['algorithm', 'error-correction', 'quantum-operation', 'stabilizer-code']"," Title: What is the algorithm for the optimal decoder in a quantum erasure channel?Body: I'm reading this paper : Holographic Quantum Error Correcting Codes and on page 3 they describe an optimal decoder for erasure channel.
The
description is for CSS codes but they claim that "it is straightforwardly adapted to any stabiliser
code". I couldn't figure out how to do that.
Is anyone familiar with or has a reference for the algorithm for the optimal decoder in quantum erasure channel? Also is there any software/package that has it implemented?
"
"['qiskit', 'programming', 'textbook-and-exercises', 'error-correction', 'depolarizing-channel']"," Title: Qiskit noise model question (from textbook)Body: I'm reading the chapter Introduction to Quantum Error Correction using Repetition Codes and a code example demonstrates how to add depolarizing and pauli error. I have several questions.
Is it not necessary to have an error_gate for the Pauli-I operator as defined in pauli_error?
Does using .tensor on error_gate1 to create error_gate2 replicate the error_gate1 line for error_gate2? Why can't you simply use error_gate1 instead of a creating a second equivalent error_gate2?
Is it necessary to have an error_gate for cx, or is that an arbitrary choice for this particular example? Code-wise, is it acceptable to have a noise_model with just an error_gate1 applied to the x_gate, or is there something impractical about that?
def get_noise(p_meas,p_gate):
error_meas = pauli_error([('X',p_meas), ('I', 1 - p_meas)])
error_gate1 = depolarizing_error(p_gate, 1)
error_gate2 = error_gate1.tensor(error_gate1)
noise_model = NoiseModel()
noise_model.add_all_qubit_quantum_error(error_meas, "measure") # measurement error is applied to measurements
noise_model.add_all_qubit_quantum_error(error_gate1, ["x"]) # single qubit gate error is applied to x gates
noise_model.add_all_qubit_quantum_error(error_gate2, ["cx"]) # two qubit gate error is applied to cx gates
return noise_model
"
"['qiskit', 'quantum-state', 'mathematics', 'linear-algebra']"," Title: Find a unitary to prepare state $|0\rangle$ to a specific vectorBody: I am working with Variational Quantum Linear Solver (VQLS) algorithm, where it needs to prepare a control_b circuit.
Assume b is 1d with $ 2^n $ elements in it.
$$ {\bf Ax = b} \tag{1}$$
I need to find a unitary U which can prepare state $ \vert0\rangle $ to $ {\bf b} $, i.e., $$ U\vert0\rangle = {\bf b} \tag{2}$$
Any proper method or Qiskit implementation would be helpful.
"
"['qiskit', 'programming', 'quantum-gate', 'circuit-construction']"," Title: Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations?Body: Is it possible to perform $z$ rotation in Qiskit with just $x$ and $y$ rotations?
I tried the following:
from qiskit import *
qc = QuantumCircuit(1)
theta = 0.5*np.pi
qc.ry(np.pi/2,0)
qc.rx(-np.pi/2,0)
qc.ry(theta,0)
qc.rx(np.pi/2,0)
qc.ry(-np.pi/2,0)
The code is based on (Realization of High-Fidelity CZ and ZZ-Free iSWAP Gates with a Tunable Coupler) (page 26), but it seems that I do something wrong.
"
"['quantum-operation', 'information-theory', 'decoherence', 'channel-capacity']"," Title: What is the quantum capacity of the combined amplitude and phase damping channel?Body: Quantum capacity for the amplitude damping channel and the pure dephasing channel have closed-form formulas as it can be seen in section 24.7.2 of From Classical to Quantum Shannon Theory. However, I am unsure if there exist such a result for the more complete decoherence model that combines both actions into the combined amplitude and phase damping channel. This is a Kraus rank $3$ quantum channels with the following error operators
\begin{equation}\label{eq:ampphaseKraus}
\begin{aligned} E_0 &= \begin{pmatrix}
1 & 0 \\
0 & \sqrt{1-\gamma-(1-\gamma)\lambda}
\end{pmatrix} \\
\\E_1 &= \begin{pmatrix}
0 & \sqrt{\gamma} \\
0 & 0
\end{pmatrix}
\\E_2 &= \begin{pmatrix}
0 & 0 \\
0 & \sqrt{(1-\gamma)\lambda}
\end{pmatrix}
\end{aligned}
\end{equation}
where $\gamma$ is the damping parameter and $\lambda$ is the scattering parameter. This channel can be seen as the serial composition of the composing ampitude damping channel and dephasing channel as $\mathcal{N}_{\mathrm{APD}}=\mathcal{N}_{\mathrm{PD}}\circ \mathcal{N}_{\mathrm{AD}}$. I am wondering if there is some known result on the capacity of this channel, as it happens for its constituting channels.
"
"['error-correction', 'quantum-operation', 'depolarizing-channel']"," Title: What is an algorithm to generate random error in depolarizing channelBody: The Qunatum Depolarizing Channel is parametrized by a single real variable $\lambda, 0 \leq \lambda \leq 1$.
I have a system of $n$ qubits. I'd like to generate random errors from that channel. These would be strings of length $n$ with entries from $(0,1,2,3)$ with the right distribution. $(0,1,2,3)$ correspond to $(I,X,Z,Y)$ errors; $I$ error actually means no error applied to that qubit; the others mean $X,Z$ or $Y$ operators applied. For example $n=7$, error $e=(0,1,0,0,3,0,2)$ means $X$ is applied to qubit 2, $Y$ to qubit 5, $Z$ to qubit 7.
Does anyone know of a tried and tested method for doing that. Python or any other language (or even pseudo-code) are fine.
"
"['quantum-state', 'measurement']"," Title: How can we measure a quantum system when the sum of amplitudes-squared does not equal one?Body: How can we measure a quantum system if the sum of amplitudes-squared does not equal one?
For example, if we want to measure $|a\rangle = 0.25|0\rangle + 0.25|1\rangle$, how can we measure it?
"
"['textbook-and-exercises', 'no-cloning-theorem']"," Title: Using distinguishability of non-orthogonal states to create a cloning deviceBody: Consider the following problem from Nielsen and Chuang's Quantum Computation and Quantum Information:
Explain how a device which, upon input of one of two non-orthogonal quantum states $\left|\psi\right>$ or $\left|\phi\right>$ correctly identified the state, could be used to build a device which cloned the states $\left|\psi\right>$ and $\left|\phi\right>$, in violation of the no-cloning theorem. Conversely, explain how a device for cloning could be used to distinguish non-orthogonal quantum states.
I know that this problem has already been posted at least two times here and here, but I am not satisfied with the answers to the first part given there. As you can see, all answers to the first part basically tell you to use the device to distinguish between $\left|\psi\right>$ and $\left|\phi\right>$ and then just prepare an identical state. However, nowhere does this exercise say that we know how to prepare states $\left|\psi\right>$ and $\left|\phi\right>$. Moreover, preparing an identical state is not the same as cloning. A cloning device has to be able to replicate a state without having any prior knowledge about its "internal" structure. With this in mind, I am posting this problem once again.
Here is my attempt to address this problem. Let us say that we have two non-orthogonal states $\left|\psi\right>$ and $\left|\phi\right>$. We can measure $\left|\phi\right>$ in the basis of $\left|\psi\right>$, and feed the result to our magical device. Since $\left|\phi\right>$ is non-orthogonal to $\left|\psi\right>$, there is non-zero probability that measurement will give us another $\left|\psi\right>$. In this case the device will identify it as $\left|\psi\right>$, which means we have created a clone. If the measurement projects $\left|\phi\right>$ to some other state $\left|\psi'\right>$, orthogonal to $\left|\psi\right>$, then the device will not identify it as $\left|\psi\right>$, and we can repeat the process by measuring $\left|\psi'\right>$ again in the basis of $\left|\phi\right>$, which will create another state non-orthogonal to $\left|\psi\right>$.
This solution is also quite flimsy for the following reasons. First, I am not sure if an arbitrary unknown state can be used as a basis for measurement. Second, this solution never actually used the device to distinguish between $\left|\phi\right>$ and $\left|\psi\right>$. It only used it to distinguish between $\left|\psi\right>$ and not $\left|\psi\right>$, but it is unclear what happens if we try to feed a state other than $\left|\phi\right>$ and $\left|\psi\right>$ to the device, so this way was probably not implied by the authors of the exercise.
Any ideas?
"
"['algorithm', 'entanglement', 'circuit-construction', 'oracles']"," Title: How to implement a quantum arrayBody: I'm trying to implement a quantum array. That is one that stores qubits and can be indexed via qubits.
I can create one that handles setting values fairly easy. Have two registers, one for the position and one for the values in the array. Then use entanglement to set values. The hard part seems to be retrieving values, any idea on how to do this?
"
['quantum-circuit']," Title: What is the relationship between cX gate and measurment?Body: I'm currently working with the cX gate but I have the question: This gate is a projection to sigmax axis on the bloch sphere if y partially trace the target qubit?
Or i mean, what is the relationship between this gate and the measurement?
"
"['photonics', 'optical-quantum-computing', 'continuous-variable', 'quantum-optics', 'linear-optics']"," Title: How are two photons entangled in the Xanadu computer?Body: I was recently reading about how Xanadu made a scalable, room-temperature-operating quantum computer using photons as qubits (see this link). It said that in the logic gates, it entangles two photons at some point, and in the video it just looks like two fiber-optic cables brought really close together with photons going through them. Could somebody please go more in-depth about how that works? I'm also having trouble understanding quantum logic gates (I understand classical ones though) so if somebody here would explain those that would be great.
Thanks in advance!
"
"['quantum-gate', 'quantum-state', 'unitarity']"," Title: When can pairs of states be transformed into other pairs of states via unitary mapping?Body: The states $|+\rangle, |-\rangle$ can be mapped to $|0\rangle, |1\rangle$ by a simple rotation.
But if I now have other states ($|\psi_0\rangle, |\psi_1\rangle$) which are not orthogonal, does a unitary transformation of these states to two other states ($|\phi_0\rangle, |\phi_1\rangle$) exist?
And how can I find this unitary transformation?
"
"['qiskit', 'programming', 'q#', 'cirq']"," Title: Which quantum computing frame is suitable for optimization problems?Body: As in the computer world, not all programming languages are suitable for everything.
Php = Backend
Javascript = Frontend
Data Analsys/ML = Python
embedded systems = C
Mobilphone/apps = Android / Swift
As far as I know not all quantum languages solve the same problems. I would like to know which framework(qiskit, cirq..) would be suitable for optimisation problems (for example Travel Salesman Problem).
"
"['measurement', 'tomography', 'povm', 'quantum-metrology', 'mub']"," Title: Are SIC-POVMs optimal for quantum state reconstruction?Body: Mutually unbiased bases (MUBs) are pairs of orthonormal bases $\{u_j\}_j,\{v_j\}_j\in\mathbb C^N$ such that
$$|\langle u_j,v_k\rangle|= \frac{1}{\sqrt N},$$
for all $j,k=1,...,N$.
These are useful for a variety of reasons, e.g. because they provide "optimally independent information", in the sense that if we want to reconstruct a state from a set of projective measurements, choosing MUBs maximises the amount of gained information. A standard reference here is Wooters and Fields (1998).
On the other hand, SIC-POVMs are informationally complete POVMs $\{\mu_b\}_{b=1}^{N^2}$ such that $\mu_b=\Pi_b/N$, with $\Pi_b$ rank-1 projections such that
$$\langle \Pi_a,\Pi_b\rangle = \frac{N\delta_{ab}+1}{N+1}.$$
Two relevant references are here (Rastegin 2014) and (Appleby et al. 2017).
It seems intuitive that such SIC-POVMs should be, similarly to MUBs, optimal for state reconstruction, in the sense of them being the optimal - with respect to the number of required samples - choice of POVM to reconstruct an arbitrary given quantum state.
However, I haven't seen this stated explicitly.
Are SIC-POVMs optimal in this sense? More precisely, given a state $\rho$ that we want to reconstruct via a POVM $\mu$, and some target degree of reconstruction accuracy, is it true that the expected number of required samples is minimal if $\mu$ is a SIC-POVM?
"
"['qiskit', 'programming', 'quantum-gate', 'circuit-construction']"," Title: Equivalent matrix for operators in qiskitBody: What is eqivalent matrix to qc.rx(np.pi, 0):
import numpy as np
from qiskit import QuantumCircuit, Aer, execute
from qiskit.quantum_info import Operator
qc = QuantumCircuit(1)
qc.rx(np.pi, 0)
print('Final matrix:', np.round(Operator(qc).data, 3))
I thought it is the following:
$$X = \begin{pmatrix}
0 & 1 \\
1 & 0 \\
\end{pmatrix}
\begin{pmatrix}
1 \\
0 \\
\end{pmatrix}
=\begin{pmatrix}
0 & 1 \\
0 & 0 \\
\end{pmatrix}
$$
but it is not, because of different result. And what would be equivalent matrices in case:
qc.rx(np.pi, 0)
qc.ry(np.pi, 0)
"
"['programming', 'quantum-state', 'hamiltonian-simulation', 'unitarity', 'qutip']"," Title: How can extract reduced dynamics of a bipartite system from unitary evolution in quiteBody: Let us assume that I have a bipartite system $A\otimes B$ and an initial product state undergoing some evolution $H^{AB} = H^A+H^B+V^{AB}$, which is time independent. I want to simulate the reduced dynamics of $A$ only in qutip, and to do so I first generate the unitary dynamics of the full system as
result = sesolve(H, psi0, times)
where psi0 is the initial state and times is the discrete vector of times.
From that I can extract the state at each time $t_i \in$times like result.states[i] and then do the partial trace like result.states[i].ptrace(0) and obtain the reduced state of $A$ at the corresponding time.
Anyway, I would like to do that for all the time $t_i$ and having a vector of results like result.states[i] is. There is a nice and quick way to do that from the result object? Or I need to define a new function that takes the result.states object and that for me? I'm new to quit so I do not know if this exists by default.
Then,
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang', 'matrix-representation', 'pauli-gates']"," Title: Why can the Hamiltonian $H=P_x(t)X+P_y(t)Y$ make an arbitrary unitary $U=R_x(b)R_y(c)R_x(d)$?Body: p.281 of Nielsen and Chuang's book says that
A single spin might evolve under the Hamiltonian $H = P_x(t)X + P_y(t)Y$, where $P_{\{xy\}}$ are classically controllable parameters. From Exercise 4.10, we know that by manipulating $P_x$ and $P_y$ are appropriately, one can perform arbitrary single spin rotations.
And Exercise 4.10 is that an arbitrary 2X2 unitary operator can be decomposed into $e^{ia}R_x(b)R_y(c)R_x(d)$.
I can't understand why the Hamiltonian $H = P_x(t)X + P_y(t)Y$ can make an arbitrary unitary $U = R_x(b)R_y(c)R_x(d)$.
$H = P_x(t)X + P_y(t)Y$ makes an unitary $U^{-i(P_x(t)X + P_y(t)Y)/\hbar}$.
And it can be $U^{-i(P_{x1}(t)X + P_y(t)Y+P_{x2}(t)X)/\hbar}$.
But I think it cannot be decomposed into $U = R_x(P_{x1})R_y(P_y)R_x(P_{x2})$, since X and Y don't commute.
Can you tell me how the proposition above in Nielsen and Chuang's book is correct?
Thanks in advance.
"
"['qiskit', 'programming', 'quantum-circuit', 'stabilizer-code']"," Title: How to create a quantum circuit to implement the same operations but acting on different qubits?Body: I want the draw the quantum circuit of the following Hamiltonian:
$$H = - 4 \times X\otimes X\otimes X\otimes X - 4\times Z\otimes Z\otimes Z \otimes Z$$.
I have been able to draw the circuits of $ - X\otimes X\otimes X\otimes X$ and $- Z\otimes Z\otimes Z \otimes Z$. But adding them up using qiskit functions like compose, and combine did not give me the matrix I am looking for.
I would like to recall that when looking at $ 4 \times X\otimes X\otimes X\otimes X$ for instance, the operator $ X\otimes X\otimes X\otimes X$ will be applied $4$ times but not on the same set of qubits and the matrix should $16\times 16$.
Using compose and combine function, I still obtain the $16\times 16$ matrix by its components do not add up. Instead, the gates acted on the same set of qubits.
It will be very helpful if someone can help me. Thanks
"
"['resource-request', 'tomography']"," Title: What are the problems of linear inversion quantum state tomography?Body: Consider the following general formulation of the standard quantum state tomography problem: given an unknown state $\rho$, a set of (known) observables $\{\mathcal O_k\}_k$ (generally the elements of some POVM), and a corresponding vector of measured probabilities (or more realistically, frequencies) $\mathbf Y$, we want to retrieve a description of $\rho$, that is, the coefficients of the decomposition of $\rho$ with respect to some "canonical" operatorial basis $\{\sigma_k\}$ (the typical example being the basis built with Pauli matrices).
This amounts to solving the linear problem
$\mathbf Y = \mathbf X\boldsymbol \theta$ for $\boldsymbol\theta$.
Here, $\mathbf Y$ vector of measured frequencies, $\mathbf X$ the matrix whose elements are the coefficients of the decomposition of the observables $\mathcal O_k$ in terms of $\sigma_j$, and $\boldsymbol\theta$ the vector of coefficients obtained decomposing $\rho$ with respect to $\{\sigma_j\}$ (this notation is from (Granade et al. 2017)).
The naive solution to this linear problem is $\boldsymbol\theta=\mathbf X^+\mathbf Y$, with $\mathbf X^+$ the pseudoinverse of $\mathbf X$.
However, this method is known to be problematic. For one thing, it is not guaranteed to produce a positive semidefinite estimate for the state. As mentioned by (Granade et al. 2017), possible workarounds include performing constrained least squares, or using a "two-step approach that outputs the closest physical state to a given matrix".
I'm aware of the plethora of alternative approaches to state tomography. However, I'm specifically looking for references discussing the issues with this "naive" linear reconstruction method, and in particular the related problems of numerical (in)stability and lack of positive semidefiniteness of the estimate.
The only thing I found was the brief mention in the paper above, the discussion in (Qi et al. 2013), and some discussion of the numerical stability problems in Appendix A of (Opatrný et al. 1997).
"
"['qiskit', 'programming', 'quantum-gate', 'circuit-construction', 'clifford-group']"," Title: Getting non-Clifford after performing several Clifford gates in qiskitBody: I'm trying to test Clifford gates in qiskit according to the table in Fault-tolerant SQ, page 101. I tried 4 Cliffords in the test $$-X/2 - X -X/2,Y/2,X/2 - -X/2,Y/2,-X/2$$
using the following code
import numpy as np
from qiskit import QuantumCircuit, Aer, execute
from qiskit.quantum_info import Operator
qc = QuantumCircuit(1)
qc.rx(-np.pi/2, 0)
qc.rx(np.pi, 0)
qc.rx(-np.pi/2, 0)
qc.ry(np.pi/2, 0)
qc.rx(np.pi/2, 0)
# 4th
qc.rx(-np.pi/2, 0)
qc.ry(np.pi/2, 0)
qc.rx(-np.pi/2, 0)
print('Final matrix:', Operator(qc).data)
qc.draw('mpl')
which gives me the output:
Final matrix: [[ 0. +0.707j -0.707+0.j ]
[ 0.707+0.j 0. -0.707j]]
next, I found the inverse of this:
np.linalg.inv(Operator(qc).data)
which gives me:
[[ 0. -0.707j 0.707+0.j ]
[-0.707+0.j -0. +0.707j]]
and didn't find the corresponding Clifford in the table as I was expeccting.
What do I do wrong in my calculations in qiskit?
"
['stabilizer-code']," Title: Why do stabilizer codes in Nielsen and Chuang have Pauli X and Z matrices?Body: While reading about quantum stabilizer codes I have noticed that almost all codes I have seen have Pauli X and Z matrices. Is there any specific reason for this?
I have been teaching myself about Quantum stabilizer codes through the 10th chapter of Nielsen and Chuang. I should warn (and you should be able to guess from my question) beforehand that my knowledge is superficial at the best.
"
"['qiskit', 'programming', 'quantum-gate', 'ibm-q-experience', 'error-correction']"," Title: Where does the ""correction"" in quantum error correction occur, specifically when using repetition codes?Body: I'm reading the part of the qiskit textbook that deals with this (https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html) and so far it seems as though they're just protecting from errors using repetitions.
In the article they spoke a bit about detecting the errors using syndrome measurements, so I thought the next step would be correcting them....but then they went on to speak about lookup table decoder and majority voting to understand the output
So where exactly does the correcting of the errors (identified using syndrome measurements) occur? Can someone clear this up for me please
"
"['entanglement', 'textbook-and-exercises']"," Title: Why can no pair of single qubits look like $\frac{1}{\sqrt2}(|00\rangle+|11\rangle$)?Body: I've just started to learn Quantum Computing and, to do it, I'm reading the course "Introduction from Quantum Computing" by IBM.
Now, I'm reading the chapter "Entangled states", section "Entangled states" where I have found the formula:
$$|\Phi\rangle=\frac{1}{\sqrt 2}\begin{bmatrix}
1 \\
0 \\
0 \\
1
\end{bmatrix}=\frac{1}{\sqrt 2}(|00\rangle+|11\rangle).$$
They say about this state vector:
There are no pairs of single qubit states $|a\rangle$ and $|b\rangle$
whose product state would look like this.
But I don't understand it. Why there are no pairs of single qubits? It is because both qubits are on state 0 and 1 at the same time, isn't it?
"
"['programming', 'randomised-benchmarking', 'shadow-tomography', 'stim']"," Title: How do I pick a random Clifford operation in Stim?Body: I want to sample random n-qubit Clifford operations. How do I do that in Stim?
(Self-answering because this was requested when the feature already existed)
"
"['quantum-gate', 'teleportation', 'terminology']"," Title: What is the name of this ""ancilla based"" process to implement gatesBody: I just want to know if there is a specific name for the implementation of a gate on the top qubit with the help of the bottom qubit, represented on this image:
It looks like gate teleportation but it is not as you do not need Bell states. The ancilla state is: $|A_{\theta}\rangle \equiv U_z(\theta) |+ \rangle$
You can find such circuit in this paper (page 28).
"
"['quantum-gate', 'measurement', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: Measurement of single qubit operator $U$ which is both Hermitian and unitary with eigenvalues $±1$Body:
Suppose we have a single qubit operator $U$ with eigenvalues $±1$, so that $U$ is both Hermitian and unitary, so it can be regarded both as an observable and a quantum gate. Suppose we wish to measure the observable $U$. That is, we desire to obtain a measurement result indicating one of the two eigenvalues, and leaving a post-measurement state which is the corresponding eigenvector. How can this be implemented by a quantum circuit? Show that the following circuit implements a measurement of $U$:
Ref. to Exercise 4.34 in QC and QI by Nelsen and Chuang
$$
|\psi_0\rangle =|0\rangle\otimes|\psi_{in}\rangle\\
|\psi_1\rangle =\frac{|0\rangle+|1\rangle}{\sqrt{2}}\otimes|\psi_{in}\rangle\\
|\psi_2\rangle=\frac{1}{\sqrt{2}}[|0\rangle\otimes |\psi_{in}\rangle+|1\rangle\otimes U|\psi_{in}\rangle]\\
|\psi_3\rangle=\frac{1}{2}[|0\rangle\otimes(I+U)|\psi_{in}\rangle+|1\rangle\otimes(I-U)|\psi_{in}\rangle]
$$
Note that,
$U(I+U)|\psi_{in}\rangle=(U+U^2)|\psi_{in}\rangle=(U+I)|\psi_{in}\rangle=1(I+U)|\psi_{in}\rangle$ and $U(I-U)|\psi_{in}\rangle=-1(I-U)|\psi_{in}\rangle$
$\implies (I+U)|\psi_{in}\rangle$ and $(I-U)|\psi_{in}\rangle$ are eigenvectors of the operator $U$ with corresponding eigenvalues $+1$ and $-1$, respectively.
And by projecting the first qubit the second qubit is projected to either $(I+U)|\psi_{in}\rangle$ or $(I-U)|\psi_{in}\rangle$, therefore this circuit implements a measurement of $U$.
It is proved that projective measurements together with unitary dynamics are sufficient to implement a general measurement, by introducing an ancilla system having an orthonormal basis $|m\rangle$ in one-to-one correspondence with the possible outcomes of the measurement we wish to implement.
Please check Page 94, QC and QI by Nelsen and Chuang for the proof of this statement.
Are we using this statement to implement the circuit above ?
Can't we have a circuit like :
with $U'=\sum |m \rangle\langle\psi_m |=|0\rangle\langle \psi|(I+U)+|1\rangle\langle \psi|(I-U)$ where $|\psi_i\rangle$ are the eigenvectors of the operator $U$ ?
"
"['qiskit', 'programming', 'textbook-and-exercises']"," Title: from hello_qiskit import run_puzzle results in errorBody: I am working my way through the beta version of the Qiskit textbook.
Everything was going fine until I got to the Visualizing Entanglement section and had some exercises to complete.
All of the exercises rely on the hello_qiskit package which doesn't seem available.
I have also tried running the exercises in the IBM Quantum Lab but it resulted in similar issues.
Traceback (most recent call last):
File "/tmp/ipykernel_426/3330317747.py", line 1, in <module>
from hello_qiskit import run_puzzle
ModuleNotFoundError: No module named 'hello_qiskit'
Use %tb to get the full traceback.
"
"['entanglement', 'measurement']"," Title: Is there any simple mathematical proof that measurement destroys entanglement?Body: Is there a simple mathematical way to prove that measurement destroys entanglement?
I can see that this is indeed true if I just take a specific measurement on an entangled state. What I am looking for is a mathematical proof that this is true in general.
"
['measurement']," Title: As regards measurement how would a quantum-full-adder perform multiple additions simultaneously?Body: Here in this video from 15:14 Arvin Ash demonstrates a quantum-full-adder circuit, he goes on further to illustrate how it can perform multiple operations simultaneously via superposition. I took some screenshots asper:
$a)$![]()
$b)$
![]()
I have no issues with the concept of multiple operations being performed simultaneously but how would measurement make sense here (since we have a superposition of all states of the simultaneously performed additions).
Here's what I mean, for example with Grover's search algorithm we are interested in isolating a single state from a superposition of multiple states, from the video it seems to me we are interested in isolating multiple states from a superposition of multiple states. Since qubits collapse only to a single state after measurement, How would measurement here yield multiple states or is there a work around?
"
"['algorithm', 'quantum-advantage', 'speedup']"," Title: How does a quantum computer execute a process by leveraging superposition?Body: I understand in plain terms superposition and entanglement, but I'm very unclear how either of these could work as a means to increase computation power.
A helpful metaphor is that of the maze. A normal computer must work through every path of the maze to find the exit. If it takes a wrong turn, it must start over. This is time-consuming. On the other hand, a quantum computer can work through every path simultaneously. Obviously, this is more efficient.
But that metaphor doesn't explain how superposition makes this possible because it doesn't describe how a quantum computer would execute the calculation/process.
So what I'm looking for is an explanation of that, how does a quantum computer execute a process by leveraging superposition?
That qubits collapse under observation seems to make the whole thing useless.
Let's say I have a dictionary of possible passwords. One password is correct. I can create a function that loops through every word in the dictionary and attempts to use it as the password.
The password is stored in a variable called "temp". In a quantum world, if "temp" was made of qubits, it could have a multitude of values at once, drastically reducing the number of times we would need to run the password test.
But in order for the test to execute, wouldn't we need to observe the value of "temp" and therefore collapse the potential states?
"
['textbook-and-exercises']," Title: How can I compute $P_{|b\rangle}(|0\rangle)$?Body: I've just started to learn Quantum Computing and, to do it, I'm reading the course "Introduction from Quantum Computing" by IBM.
Now, I'm reading the chapter "Entangled states", section "Product states" where they show how to compute the probability of measuring the state $|a\rangle$ as $|0\rangle$:
$$P_{|a\rangle}(|0\rangle) = (b_0a_0)^2+(b_1a_0)^2 \\
\begin{gather}
= b_0^2a_0^2+b_1^2a_0^2 \\
= (b_0^2+b_1^2)a_0^2 \\
= a_0^2
\end{gather}$$
And they say that I can compute $P_{|b\rangle}(|0\rangle)$ but, how? Changing the order of the amplitudes like this:
$$P_{|b\rangle}(|0\rangle) = (a_0b_0)^2+(a_1b_0)^2 ...$$
But, if so, I don't understand why. I think that, in both cases, we are working on the same state vector $|ba\rangle$, and if I change the amplitude order, I change the state vector to $|ab\rangle$.
How can I compute $P_{|b\rangle}(|0\rangle)$?
"
['qiskit']," Title: have to process 512×512 pixel image will it be possible in Qiskit. what hardware requirement will be?Body: I'm working on Quantum image processing of satellite images. I'm completely a beginner also I'm learning it by my own that's why I need help. Can you please help me out I want to process the image of crop fields taken by satellite in Qiskit? I have done basic Edge detection by QHED. Now how I should proceed for it? Please help me.
"
"['resource-request', 'gate-synthesis', 'quantum-circuit', 'transpile']"," Title: Optimal decompositions of some standard multi-qubit gatesBody: To have a concrete example in mind: 3-qubit Toffoli gate can be decomposed into 6 $CNOT$s as shown here
I believe this is the most economic decomposition in terms of the number of $CNOT$s used. My questions are:
- Is it proven that it is not possible to do better than with 6 $CNOT$s?
- Could the decomposition be improved if ancilla qubits are allowed?
OK, and a 3-qubit Toffoli is really just an example, I would be interested in any results along these lines concerning some standard multi-qubits gates, say $n-$Toffoli, other multi-controlled gates etc.
"
"['simulation', 'cirq', 'random-quantum-circuit']"," Title: Random circuits with google cirqBody: For my dissertation I need to simulate random circuits and I have been trying to use google Cirq for that. Looking at the documentation I have seen how to create my own circuit and simulate it, but it becomes exhausting and prone to error the fact of creating a circuit for a larger number of quits and to produce as much entanglement as possible.
I thought that Cirq would have any method for generating a random circuit for a given number of qubits, but unfortunately have not found anything like this. Therefore, I was wondering whether there is any tool or anyone who has generated circuits that I could import to use.
"
"['qiskit', 'error-correction', 'error-mitigation']"," Title: Confusion about Mitiq folding for zero noise extrapolationBody: I'm reading the mitiq zero noise extrapolation documentation and I just can't make sense of how the scale_factor for folding work.
"The minimum scale factor is one (which corresponds to folding no gates). A scale factor of three corresponds to folding all gates locally. Scale factors beyond three begin to fold gates more than once."
Doc: https://mitiq.readthedocs.io/en/stable/guide/guide-zne.html
I made a quick qiskit example for convenience:
import qiskit as q
from mitiq.zne.scaling import fold_gates_from_left
n_qubits = 4
circ = QuantumCircuit(n_qubits)
circ.h(0)
for qubit in range(n_qubits - 1):
circ.cx(qubit, qubit + 1)
circ.measure_all()
print(circ)
folded = fold_gates_from_left(circ, scale_factor=2.)
print("Folded circuit:", folded, sep="\n")
"
"['qiskit', 'quantum-state', 'complexity-theory']"," Title: What is the computational complexity in initializing a quantum register?Body: I'm trying to figure out what is the computational complexity of initializing a quantum register of N qubits.
For my research, I have used the initialize method of qiskit, in which you set the amplitudes of the 2^N basis states to get the desired quantum state. The point is that I can't find a reference that discusses the cost of such an operation. Moreover, if we consider a standard Grover's algorithm, why the initialization of a uniform superposition of basis states is not counted in the complexity?
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang']"," Title: What does the $I$ mean when measuring ${\rm Tr}(\rho (I\otimes\sigma\otimes\cdots))$ in quantum tomography?Body: In Nielsen and Chuang's QCQI, I learned that the quantum tomography for n qubit can be described easily in math as we need to measure $Tr(\rho W_k),\forall k$ where $W_k\in\{I,\sigma_x,\sigma_y,\sigma_z\}^{\otimes n}$.
But what my understanding toward $Tr(\rho \hat{o})$ for some observable $\hat{o}$ is that, we measure with $\rho$ with measurement set from the spectrum decomposition of $\hat{o}$. E.g., the term $Tr(\rho\sigma_x)$ means we measure in this set of projective measurement: $|+\rangle\langle+|,|-\rangle\langle-|$ . But since $I$ have infinite spectrum decomposition(not unique because the multiplicity of the eigenvalues), so what does $Tr(\rho I)$ mean in the language of measurement?
"
"['quantum-gate', 'quantum-state', 'algorithm', 'error-correction', 'stabilizer-state']"," Title: Conditional lower bound on approximate stabilizer rank of magic statesBody: I am currently reading about the approximate stabilizer rank and properties of the same.
I will quote the definitions from this paper.
The stabilizer rank of a quantum state $|\psi\rangle$ is the minimal
$r$ such that \begin{equation} |{\psi}\rangle = \sum_{j=1}^{r} c_j
|φ_{j}\rangle. \end{equation} for $c_j \in \mathbb{C}$ and stabilizer
states $|φ_j\rangle$.
The $\delta$-approximate stabilizer rank of $|ψ\rangle$, denoted
$\chi_{\delta}(ψ)$, is defined as the minimum of $\chi(\psi)$ over all
states $|φ\rangle$ such that \begin{equation} |||ψ\rangle −
|φ\rangle||_{2} \leq \delta.
\end{equation}
The paper I quoted gives a loose unconditional lower bound on approximate stabilizer rank. But, is there a known stronger conditional lower bound for the approximate stabiliser rank of an $n$-fold tensor product of any single qubit magic state?
There is such a conditional lower bound for the exact stabilizer rank, given by
Much stronger hardness assumptions than $\text{P}=\text{NP}$, such as
the exponential time hypothesis, imply that $\chi(H^{\otimes n}) =
2^{Ω(n)}.$ [MT19, HNS20]
$H$ is a single qubit magic state, as defined in the paper. But I could not find anything for approximate stabilizer rank.
"
['machine-learning']," Title: How does the formula for the parameter shift rule change if we measure in the $X$ basis?Body: I'm studying the parameter shift rule and got stuck when improving an example with Pauli operators in https://arxiv.org/abs/1803.00745.
This paper shows up $\partial_\mu f=\frac{1}{2}(f(\mu+\frac{\pi}{2})-f(\mu-\frac{\pi}{2}))
$ when measuring in z-basis. But how this formula change with x-basis?
"
"['programming', 'error-correction', 'simulation', 'stabilizer-code', 'stim']"," Title: How to import a generic stabilizer code in stimBody: I just started using stim to simulate the performance of quantum error correcting codes. I hope this is the right place to ask questions about the subject. The
example code
with the repetition code and depolarizing channel worked fine. Now I want to try one of my codes and the same channel. How would I import my code into stim? I can write the stabilizers as an $m \times n$ array ($m$ stabilizers, $n$ qubits) with entries from $(0,1,2,3)$; this seems like the most straight forward way. $(0=I,1=X,2=Z,3=Y)$.
For example, for the $[[5,1,3]]$ code $S:=[[1,2,2,1,0],[0,1,2,2,1],[1,0,1,2,2],[2,1,0,1,2]];$
Is this the preferred way? Do I also need to specify the logicals or destabilizers (I have these for some codes but maybe stim calculates them from the stabilizer...)
"
"['quantum-state', 'entanglement']"," Title: Can changing reference frames generate entanglement in identical particles?Body: Suppose we have a pair of qubits, physically realised as two spin-half particles in some separable pure state $|\psi\rangle$, separated by a distance '$l$', large enough to be regarded as distinguishable particles in some reference frame $\mathsf{S}$.
Let $\mathsf{S'}$ be another reference frame moving with some velocity(relativistic) '$v$'. From $\mathsf{S'}$ the separation between the two qubits is Lorentz contracted to $$l' = l \sqrt{\left(1 - \frac{v^2}{c^2}\right)}$$.
My question is:
- At what value of $l'$ do the particles become indistinguishable, if at all?
- If the particles become indistinguishable at some point, the joint state has to be entangled from symmetry considerations. Where does this entanglement come from?
PS: I tried to make sense of the indistinguishability by thinking of De Broglie wavelengths but couldn't completely wrap my head around it
"
"['algorithm', 'complexity-theory', 'quantum-advantage', 'stabilizer-state']"," Title: Quantum advantage with only Clifford gates (Gottesman Knill theorem)Body: Let's say I want to solve a computational task which input can be encoded in $n$ bits of information.
The look for a quantum advantage is (usually) asking to find a quantum algorithm in which there are exponentially fewer gates and qubits required in order to implement this algorithm compared to the best known classical algorithm.
Gottesman Knill theorem shows that it is possible to simulate in polynomial time a quantum algorithm composed of Clifford gates only. For this reason, it removes the ability to find a quantum advantage with circuits only composed of such gates (the non-Clifford are very "costly" in term of physical resources).
However, if a classical algorithm requires (for instance) $O(n^{800})$ gates while the quantum $O(n)$, the gain with the quantum algorithm would still be phenomenal.
My question is thus:
Are there examples of quantum algorithms only composed of Clifford operations that show "for all practical purpose" a clear advantage in computational speed over the best known classical algorithm? A reduction in the "same spirit" of the $n^{800} \to n$ for instance. Such result would be interesting because fault tolerant quantum computing can be efficiently implemented with only Clifford gates.
Also, my formulation of the quantum advantage is probably a bit "handwavy" so if you believe it is not entirely correct I would be interested in providing me a better way to phrase it.
"
"['quantum-gate', 'density-matrix']"," Title: how to know the appropriate time to know the SWAP gate operation in dipole interactionBody: Consider dipole-dipole interaction between two qubits,$H_{int} = g \boldsymbol\sigma_{1}\cdot\boldsymbol\sigma_{2}=g(X_1X_2+Y_1Y_2+Z_1Z_2)$. How can I show that by turning on this interaction for an appropriate time, $U = \exp(−iH_{int}t_s)$, obtains a SWAP gate. And how we can find the value of $t_s$ in terms of $g$.
"
"['tomography', 'shadow-tomography']"," Title: Using Classical Shadow to predict quantum state's fidelity has nothing to do with the dimension of the density matrix?Body: Using classical shadow(or refer to this post for basic things about classical shadow), we can predict linear functions like $Tr(O\hat{\rho})$ with number of copies(referred paper):
$$
2\log(2M/\delta)*\frac{34}{\epsilon^2}||O-tr(O)/2^n||^2_{shadow}\tag{1}
$$
If I want to measure the fidelity of quantum states, that is, if $\rho$ is pure state, and $\hat{\rho}$ is the actual state, and I want to predict the fidelity between $\rho$ and $\hat{\rho}$. The formula for this fidelity is $Tr(\rho\hat{\rho})$ which can easily be deduced from the definition of fidelity $F(\rho,\sigma)=Tr\sqrt{\rho^{1/2}\sigma\rho^{1/2}}$. And we can replace the $O$ in linear function $Tr(O\hat{\rho})$ with $\rho$, so we change the fidelity function into $Tr(\rho\hat{\rho})$, i.e., the quantum state fidelity.
And there is a result in this paper(referred paper), with eq. (S16) said that with some cased, we can realize $||O-tr(O)/2^n||^2_{shadow}\le3Tr(O)^2$, which should be $3Tr(\rho)^2=3$ in my case of predicting the fidelity. So now eq.(1) becomes:
$$
2\log(2M/\delta)*\frac{34}{\epsilon^2}*3
$$
which has nothing to do with the dimension of quantum states? It seems really strange to me, so do I make some mistakes?
References
Predicting Many Properties of a Quantum System from Very Few Measurements Eq.(S13)
"
"['error-correction', 'classical-computing', 'classical-quantum']"," Title: Can error correction for a classical algorithm with bit flips be easier than for a general quantum circuit?Body: Assume one runs a purely classical algorithm on $n$ logical qubits on a physical device with some bit flip probability.
Can implementing error correction in this case be any easier than in the case of a general quantum circuit?
I guess, given that the hardware is "quantum", to answer this question we also need to make assumptions on probabilities of hardware errors other than bit flips.
Basically I'm trying to understand whether quantum error correction has anything to offer to classical computation, at a cost less then the "full" quantum error correction.
"
"['qiskit', 'programming', 'quantum-state', 'quantum-circuit', 'experiment']"," Title: Working with higher energy states in Qiskit ExperimentsBody: I'm looking at the source code for the Qiskit Experiments module and see that the EFRabi class subclasses the Rabi class with the intent of calibrating rotations between the 1 and 2 states instead of between 0 and 1. The only change I see in the circuit is the addition of an X gate at the beginning. How could this be done for other calibration experiments, e.g. one of the FineAmplitude experiments? Why does the X gate allow us to calibrate on higher energy states?
"
"['error-correction', 'stabilizer-code', 'surface-code']"," Title: What is the motivation for using dual lattice in the surface code?Body: I'm learning surface codes from a theoretical perspective. In all the literature I read, they just introduced the dual lattice for working with $Z$ strings without many words addressing why we need to do this. And it seems to me that all the stuff they did on the dual lattice can be done in the original lattice.
I can think of two needs for using dual lattice. One is that we only have measure qubits on the facets so need to switch to dual lattice to measure the other set of stabilizers. The other is to make the drawing more clear to the readers.
Are there any deeper mathematical or theoretical motivations?
Literature I have read: An Introduction to Topological Quantum Codes by Bombin; Quantum Error Correction for Beginners by Devitt et al.; Surface codes: Towards practical large-scale quantum computation by Fowler et al.
"
"['programming', 'circuit-construction', 'stabilizer-code', 'stim']"," Title: What is the syntax for general control gate in stimBody: For a stabilizer code with the stabilizers in canonical form, an encoding circuit has the form
that's a product of hadamard gates and general control gates : $H_i C_i(U_i)$. For example for
the $[[5,1,3]]$ code, the circuit would be :
$H_{2}C_{2}(Y_{1})$
$H_{3}C_{3}(X_{1})$
$H_{4}C_{4}(X_{1}Z_{2}Z_{3})$
$H_{5}C_{5}(Y_{1}Z_{2}Z_{4})$
$C_i(U_i)$ means apply $U_i$ depending on qubit $i$. The normal $CNOT_{ij}$ would be $C_i(X_j)$.
$CZ_{ij}$ gate would be $C_i(Z_j)$; $U_i$ usually needs to be applied to multiple qubits.
How would a circuit like this be entered into stim?
"
"['measurement', 'textbook-and-exercises', 'notation', 'linear-algebra']"," Title: How to compute the measurement probabilities of $|\phi\rangle=\sum_k c_k |k\rangle$ in a rotated basis $V|k\rangle$?Body: I came across the following question and have some conceptual questions.
Consider a general quantum state $|\phi\rangle$ of dimension $N$ spanned by some standard basis $\{|k\rangle,k=0,1,...N-1\}$. Suppose we wish to measure it in a different basis $\{|\bar{0},|\bar{1},...|\overline{N-1}\rangle\}$ such that $|\bar{k}\rangle=V|k\rangle$ for some unitary $V$ for each $k=0,1,...N-1$. Write down the probability of getting outcome $|\bar{k}\rangle$ in terms of $|\phi\rangle$ and $V$.
For a question like this,I would think of it as that we need to first apply V onto the state, and then do a measurement in the new basis, which would result in something like $ MV|\phi\rangle $ where $ M=\sum^{N-1}_i|\bar i\rangle \langle \bar i|$ and is the measurement operator, but how do we go on to find the probability? Do I simply insert $ \langle \bar k| $ in front and turn it into $ |\langle \bar k|MV|\phi\rangle|^2 $?
"
['amplitude-amplification']," Title: How to understand picking a random subcube in the Aaronson/Ambainis spatial search algorithm?Body: I am referring to the Quantum Search of Spatial Regions paper.
I must confess that the paper itself is a bit heavy for my level of mathematical fluency. Trying to understand it nevertheless and having some background in QC, I have stumbled upon the following presentation from Scott Aaronson himself.
Slide 19 outlines the subdivision algorithm for $d\ge3$ making use of recurrent subdivision and random picking of subcubes, wrapped in an amplitude amplification scheme.
My question would be - what is meant by picking a random subcube? A classical RNG? A measurement? And if so, how could that possibly fit into the amplitude amplification scheme, as the latter relies on keeping the entangled state?
Would somebody be so kind to shed light on this? Thank you in advance.
Kind regards, -- Stanislaw
"
"['programming', 'q#']"," Title: Q#/VS: No namespace with the name ""Microsoft.Quantum.Canon"" existsBody: I am trying to run a simple "Hello World" project in Q#, following this tutorial. I have completed the following steps (Step #s from tutorial link):
- Step 1: Installed the latest version of Visual Studio 2019 (16.11.4 Preview 1.0)
- Step 2: Installed Microsoft Quantum Development Kit
- Step 3: Created a Q# Project using the Q# Application Template
The resulting Program.qs file appears in vs:
namespace Quantum.QSharpHelloWorld {
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
@EntryPoint()
operation HelloQ () : Unit {
Message("Hello quantum world!");
}
}
The two namespaces I am trying to open show the red squiggly line, with the errors
QS6104: No namespace with the name "Microsoft.Quantum.Canon" exists.
QS6104: No namespace with the name "Microsoft.Quantum.Intrinsic" exists.
Additionally and likely the same root cause, the @EntryPoint annotation and Message() call fail:
QS6005: No type with the name "EntryPoint" exists in any of the open namespaces.
QS5022: No identifier with the name "Message" exists.
In the solution explorer for my projet QSharpHelloWorld, the Dependencies, Packages, and each of five packages (Microsoft.Quantum.CSharpGeneration, .EntryPointDriver, .QSharp.Core, .Runtime.Core, and .Standard) all have the yellow triangle warning indicating a problem.
The error is similar to the one in this question, except I'm not using Python so the accepted answer is irrelevant. I attempted to use the command suggested in another answer:
dotnet add QSharpHelloWorld.csproj package Microsoft.Quantum.CSharpGeneration
However, this failed with the following error, suggesting this is the wrong solution:
error: Error while performing Update for package 'Microsoft.Quantum.CSharpGeneration'. Cannot edit items in imported files -
error: Item 'PackageReference' for 'Microsoft.Quantum.CSharpGeneration' in Imported file 'C:\[...]\.nuget\packages\microsoft.quantum.sdk\0.19.2109165653\Sdk\Sdk.props'.
I can't find any other obvious/easy menu options or fixes for this. Other questions I've found here on SE all seem to be related to Python integration, not using Visual Studio. I have the feeling I'm missing something trivial and obvious. Can anyone suggest additional steps I can take?
"
"['quantum-gate', 'textbook-and-exercises', 'gate-synthesis']"," Title: Decomposition of U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gateBody: Can we express U1 gate $U_1(\lambda)$ , Phase Shift gate $\phi(\delta) $, and Swap gate
$$ U_1(\lambda) = \begin{pmatrix}1 & 0 \\ 0 & e^{i\lambda}\end{pmatrix}$$
$$ \phi(\delta) = \begin{pmatrix}e^{i\delta} & 0 \\ 0 & e^{i\delta}\end{pmatrix}$$
$$ SWAP = \begin{pmatrix}1 & 0 &0& 0 \\ 0& 0 & 1 & 0\\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 &1 \end{pmatrix}$$
in terms of the following gates
$$ R(\theta, \phi) = \begin{pmatrix}\cos\frac{\theta}{2} & -ie^{-i\phi}\sin\frac{\theta}{2} \\ -ie^{i\phi}\sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix}$$
$$ R_x(\theta) = \begin{pmatrix}\cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix}$$
$$ R_y(\theta) = \begin{pmatrix}\cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix}$$
$$ R_z(\theta) = \begin{pmatrix}e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}}\end{pmatrix}$$
$$ H = \frac{1}{\sqrt{2}}\begin{pmatrix}1 & 1 \\ 1 & -1\end{pmatrix}$$
$$ Z = \begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}$$
$$ XX = \begin{pmatrix}\cos\chi & 0 & 0 & -i\sin\chi \\ 0 & \cos\chi & -i\sin\chi & 0 \\ 0 & -i\sin\chi & \cos\chi & 0 \\ -i\sin\chi & 0 & 0 & \cos\chi \end{pmatrix}$$
$$ CNOT = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}$$
$$ CZ = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}$$
$$ \alpha-Swap = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta & 0 \\ 0 & \sin\theta & \cos\theta & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}$$
If yes, then please give the decomposition.
"
['openfermion']," Title: Compute expectation value of an operator in openfermionBody: I am trying to compute the 2-electron reduced-density matrix (2-RDM) for a given quantum state with openfermion. The code is as follow
two_rdm = np.zeros((n_qubits,) * 4, dtype=complex)
psi = = openfermion.haar_random_vector(2 ** n_qubits, random_seed).astype(numpy.complex64)
for i, j, k, l in itertools.product(range(n_qubits), repeat=4):
transformed_operator = jordan_wigner(
FermionOperator(((i, 1), (j, 1), (k, 0), (l, 0))))
two_rdm[i, j, k, l] = openfermion.linalg.expectation(transformed_operator, psi)
The problem is with the last line, which gives the following exception
TypeError: can only concatenate str (not "ABCMeta") to str
After examning the source code, I figured out that the problem is with the [operator * state][1]. Can anybody help to fix this?
"
"['algorithm', 'resource-request', 'clifford-group']"," Title: Review paper on depth, qubits and $T$ gates number on Clifford+T decomposition for various ""typical"" algorithmsBody: My question
I am looking for some review paper, or a list of different papers providing concrete numbers about the depth, number of qubits and number of $T$ gates required on the Clifford+T basis for usefull quantum algorithms (quantum Fourier transform, Grover, HHL, any other you can think of).
I am not looking for asymptotic behaviors as I would like to have an idea of the concrete numbers for typical problem sizes. This question is "simple" but I haven't found any paper summarizing it nicely so far, and there are some papers providing only half of the numbers required (for instance the number of qubits but not the depth).
I am in particular interested to find "powerfull algorithms" in the regime where: $Q_L N_L \leq 10^{11}$, where $Q_L$ and $D_L$ are the number of logical qubits, and the logical depth of the algorithm. Typically Shor algorithm applied for RSA 2048 is often given as an example of powerful quantum algorithm. But it requires quite a lot of resources, I am looking for usefull algorithms requiring less than Shor (more precisely in the regime I just provided).
Further information
As suggested in the comment, it may happen that for some algo, the answer will depend on some extra characteristics describing the problem. In such case, one specific example would be fine for me as long as it outperforms the best known classical algo dedicated to solve the same task. Again I just would like to have some rough idea of the number of $T$ gates, qubits and depth required for a quantum algorithm clearly outperforming the best known classical algorithm solving the same task.
The reason why I am looking for Clifford+T decomposition is because I want to know the values for fault-tolerant quantum computing. However ideally, I don't want the paper to already assume which scheme of fault-tolerance I use to implement those gates. I already know how I implement them on my side, I really just need to know the (logical) depth, number of qubits and $T$ gates strictly required by the algorithm assuming I know how to implement $T$ and Clifford. I don't need any restriction in connectivity neither (like nearest neighbor interactions).
As last comment: I know that some of the answer will say "it depends", for instance it depends on how accurate we want the decomposition of the algorithm on the gateset (we can only approximate unitaries with Clifford+T). But anyway in practice to solve a concrete task we can find a reasonably good approximation. I am looking for a kind of source that thought about all this already.
Some references I already found
This paper provides concrete numbers for everything but the algorithm depth that is lacking.
This paper given in the comments provides good numbers, but it is not really outperforming what is doable on classical computers (see comments).
- Computing electromagnetic scattering cross section
This paper provides everything, but the depth is extremly high (typically $10^{20}$ way beyond the regime I am interested in).
"
"['resource-request', 'quantum-metrology']"," Title: How is quantum metrology realized in experiment?Body: Are there some lists of the method to realize quantum metrology, or rather, utilizing quantum resources to enhance the precision of parameter estimation. The experimental method I've know is listed as follows:
"
"['qiskit', 'programming']"," Title: How to write a code to made envelope function equal to $\pi$ to result in an X gate?Body: $$
\hat U_d = \exp\Big( -i\underbrace{\frac{Q}{2}\int_0^T A(t^\prime)\mathop{dt^\prime}}_{\Theta(t)} \hat\sigma_x \Big)
$$
This equation is a Unitary transformation applied to a qubit from time $t = 0$ to time $t=T$. I want the underlined envelope function $\Theta(t)$ to equal $\pi$ to result in an $X$ gate. What code should I write to accomplish this? Should I do frequency sweeps of multiple parameters? I know that a Gaussian pulse should be involved.
"
"['entanglement', 'non-locality', 'ppt-criterion', 'werner-states']"," Title: How to show that Werner states produce correlations explainable via local hidden variable models?Body: Werner states can be written as
$$\rho_W=
p\frac{\Pi_+}{\binom{n+1}{2}}
+(1-p)\frac{\Pi_-}{\binom{n}{2}},
$$
with $\Pi_\pm\equiv\frac12(I\pm\mathrm{SWAP})$ projectors onto the $\pm1$ eigenspaces of the swap operator, defined as the one acting on basis states as $\mathrm{SWAP}(e_a\otimes e_b)=e_b\otimes e_a$, and $n$ the dimension of the underlying spaces.
These are known to be separable for $p\ge 1/2$, as seen e.g. via PPT criterion.
However, as shown in Werner's 1989 paper, these states admit local hidden variable (LHV) models also for $p<1/2$ corresponding to nonseparable states.
In this context, by "admits LHV model" I mean that the correlation it produces can be explained by such a model, i.e.
$$p(a,b|x,y)\equiv{\rm Tr}[(\Pi^x_a\otimes \Pi^y_b)W_{p}]
= \sum_\lambda p_\lambda p_\lambda(a|x)p_\lambda(b|y),$$
for some probability distribution $p_\lambda$ (which can be continuous, in which case the sum above becomes an integral over some measure), and conditional probability distributions $p_\lambda(a|x)$ and $p_\lambda(b|y)$. The collections $\{\Pi^x_a\}_a,\{\Pi^b_b\}$ are spanning sets of orthogonal unit-trace projections, so that $x,y$ denote the "measurement choice" made by Alice and Bob when measuring, while $a,b$ are the corresponding measurement outcomes.
More explicitly, we are thus calling $\rho_W$ "local" if
$$\operatorname{Tr}[(\Pi_a\otimes\Pi'_b)\rho_W ]
= \sum_\lambda p_\lambda p_\lambda(a|\{\Pi_a\}_a) p_\lambda(b|\{\Pi'_b\}_b),$$
for any pair of projective measurements $\{\Pi_a\}_a,\{\Pi'_b\}_b$, and (some) conditional probability distributions $p_\lambda(a|\{\Pi_a\}_a),p_\lambda(b|\{\Pi'_b\}_b)$.
Werner's paper shows this by explicitly building such a model, but the construction is not the easiest to follow.
Is there an easier/alternative/"better" way to construct such LHV models?
"
"['fidelity', 'clifford-group', 'randomised-benchmarking', 'gate-fidelity']"," Title: How can I get fidelity of a gate from randomized benchmarking?Body: I found (page 33) the method of finding fidelity from fit by "interleaved and reference decay" according to the sequence fidelity formula: $$F_{ref}=Ap_{ref}^{m}+B,$$
where $p_{ref}^{m}$ is sequence decay.
But if we look at the following datasets:
we can find that the reference sequence fidelity curve is close to $1$ and the other curves corresponding to the gates - around $0.998-0.999$ (which corresponds to decay $p_{gate}$).
How could it be that the difference between interleaved and reference decays is around $0.999$?
"
"['textbook-and-exercises', 'quantum-operation', 'nielsen-and-chuang', 'information-theory']"," Title: In Schumacher’s noiseless channel coding theorem, how do we get the exponents in $|0\rangle ^{\otimes n(1−p)/2}|1\rangle ^{\otimes n(1−p)/2}$?Body: On pg. 55 in Nielsen and Chuang, it's said that:
the $|0\rangle + |1\rangle$ product can be well approximated by a superposition of states of the form $|0\rangle ^{\otimes n(1−p)/2}|1\rangle ^{\otimes n(1−p)/2}$.
I'm confused about how we get the exponents for $|0\rangle$ and $|1\rangle$, namely, $\otimes n(1−p)/2$.
"
"['mathematics', 'unitarity', 'pauli-gates', 'linear-algebra']"," Title: What is the structure of coefficients of $2^N\times 2^N$ unitary matrices decomposed in terms of the Pauli basis?Body: Any square $2^N\times 2^N$ matrix can be written as a sum of tensor products of pauli matrices. Eg a $8\times 8$ matrix can be written as
$$U=\sum_{i_1,i_2,i_3}u_{i_1,i_2,i_3}\sigma_{i_1}\otimes\sigma_{i_2}\otimes\sigma_{i_3}.$$
If U is unitary, what does it imply about $u_{i_1,i_2,i_3}$ ?
We can write $U^\dagger U=1 \implies Tr[U^\dagger U\cdot(\sigma_{i_1}\otimes\sigma_{i_2}\otimes\sigma_{i_3})]=0$ for $\{i_1,i_2,i_3\}\neq \{0,0,0\}$ and $Tr(U^\dagger U)=2^N$. The second equality gives:
\begin{align}Tr(U^\dagger U)&=Tr\sum_{i_1,i_2,i_3,j_1,j_2,j_3}u^*_{i_1,i_2,i_3}u_{j_1,j_2,j_3}\sigma_{i_1}\sigma_{j_1}\otimes\sigma_{i_2}\sigma_{j_2}\otimes\sigma_{i_3}\sigma_{j_3}\\&=\sum_{i_1,i_2,i_3,j_1,j_2,j_3}u^*_{i_1,i_2,i_3}u_{j_1,j_2,j_3}\delta_{i_1,j_1}\delta_{i_2,j_2}\delta_{i_3,j_3}\\
&=\sum_{i_1,i_2,i_3}|u_{i_1,i_2,i_3}|^2=8
\end{align}
But I have hard time using the first equality to derive a useful constraint on $u_{i_1,i_2,i_3}$.
"
['quantum-state']," Title: Why is there there an infinite number of possible bases but only a finite number of measurement outcomesBody: The statement in the question comes from the answer to the following question on Reddit, if more context is needed:
And how does a perfect quantum computer ensure that we know for sure that the state is |0> in one measurement?
There is no way to ensure this. Strictly speaking, quantum states cannot be measured. You are only allowed to project the state onto some measurement basis. If the state belongs to this basis (|0> and |1> in your case) then you "measure" it. Otherwise your measurement is as good as your basis choice. Moreover, there is an infinite number of possible bases but only a finite number of measurement outcomes. So preparing your measurement is kinda more informative than actually doing it.
But if you can prepare many copies of the same quantum state you kinda can measure it by sampling your measurements. For a two-sized state you just imagine the Bloch sphere and perform many measurement along all 3 axes to sample the projections. For entangled states you need (exponentially) many more measurements.
"
"['quantum-state', 'measurement', 'nielsen-and-chuang', 'faster-than-light']"," Title: Why does quantum distinguishability ensure no faster-than-light communication?Body: On page 56-57 in Nielsen and Chuang, for a proposed scenario, it's said that:
if Bob had access to a device that could distinguish the four states $|0\rangle$, $|1\rangle$, $|+\rangle$, $|−\rangle$ from one another, then he could tell whether Alice had measured in the computational basis, or in the $|+\rangle$, $|−\rangle$ basis.
I'm confused about why this is the case.
"
"['programming', 'error-correction', 'stabilizer-code', 'stim']"," Title: How to perform encoding and syndrome measurement in stimBody: I can generate the encoding circuit of a stabilizer code and can read it into
stim. For example for the $[[5,1,3]]$ code :
circuit=stim.Circuit()
circuit.append_operation("H",[1])
circuit.append_operation("CY",[0,4])
circuit.append_operation("H",[2])
circuit.append_operation("CX",[1,4])
circuit.append_operation("H",[3])
circuit.append_operation("CZ",[2,0])
circuit.append_operation("CZ",[2,1])
circuit.append_operation("CX",[2,4])
circuit.append_operation("H",[4])
circuit.append_operation("CZ",[3,0])
circuit.append_operation("CZ",[3,2])
circuit.append_operation("CY",[3,4])
To check this I'd like to encode a random qubit then measure the syndrome for the 4 stabilizers; if everything is correct the syndrome should always be $(0,0,0,0)$.
First step : the "data" qubit is placed on qubit 4 (numbering starts from 0). So the input to
the encoder is $(q0=0,q1=0,q2=0,q3=0,q4=d0)$. $k=1$ for this code so there's only one data qubit.
How would I initialize the input to be of that form?
Second step : I have 4 stabilizers which are just Pauli strings of length 5. I'd like to measure the syndromes and place the result on 4 ancilla qubits. How would I do that and then check that the syndromes are 0?
"
"['textbook-and-exercises', 'error-correction', 'optical-quantum-computing']"," Title: Knill Laflamme conditonBody: In Preskill's notes on quantum error correcting codes in Section 7.2, there seems to be no condition on the environment part of the state, i.e. $|0\rangle_E$ in $|\psi\rangle \otimes |0\rangle_E$.
Does it have to belong in a certain Hilbert space of $n$-dimension for the whole discussion to go through, i.e. the Knill-Laflamme condition being necessary and sufficient to perform quantum error correction?
"
"['error-correction', 'surface-code']"," Title: Why we need real-time feedback of Surface Code Decoding results?Body: When we use surface code to detect and correct errors, we can track the errors in software and change the computation results accordingly. So why do we need real-time feedback on decoding results? Are there any logical operations that demand real-time feedback of the previous decoding results to implement correctly? If it is, what are they?
"
"['error-correction', 'surface-code']"," Title: How to take 3-point or more correlators into edge probability computation in surface code decoding?Body: In Google's work of repetition code (Exponential suppression of bit or phase errors with cyclic error correction), they use the method of Correlation Matrix to characterize the error events and decode. But they only describe the calculation of the correlators up to 2-point correlation.
How can we take 3-point and more calculations into account? And how can we decide the maximum size of correlators we need to calculate while it seems difficult to compute all the correlators when the code becomes larger.
"
"['programming', 'stabilizer-state', 'stim']"," Title: Computing expectation value of a Pauli string on stabilizer statesBody: I need some help on stim, where I'm trying to compute expectation values of Pauli strings. Hopefully I did not overlook on the documentation an implementation of this method.
Problem Statement
Given a generic Pauli string $O$ acting on $N$ qubits and a stabilizer state $\rho$ on $N$ qubits, compute within stim the expectation value
\begin{equation}
\langle O\rangle \equiv \mathrm{Tr}(O \rho).
\end{equation}
Since $O$ is a Pauli string, $\langle O\rangle \in \{0,+1,-1\}$.
Tentative Solution
To be concrete, within this question I fix $N=4$, and I want to compute $\mathrm{Tr}(X_1 Z_3 \rho)$. Furthermore, I specify I work on the c++ library, within which my state is contained in an instance of TableauSimulator:
...
using namespace stim;
using namespace std;
mt19937_64 rng(1); // Random generator with SEED=1
MeasureRecord record; // Measurement records
TableauSimulator Psi(ref(rng),4,0,record);
// 0 is the unbiased-condition of the output sign for non-deterministic measurements
...
Now, I know I can apply a measurement gate MPP X1Z3. If this measurement is deterministic (equivalently, if $X1Z3$ commute with $\rho$), the measurement readout gives $\langle O\rangle$, which is either $+1$ or $-1$.
If, instead, the measurement is non-deterministic (equivalently, if $X1Z3$ anticommute with $\rho$), $\langle O\rangle=0$.
Given the above, I tried the following. I initialize two new TableauSimulator
TableauSimulator PsiPlus = Psi;
TableauSimulator PsiMinus = Psi;
and applied to them PsiPlus the gate MPP X1Z3, whereas in PsiMinus the gate MPP !X1Z3. Then, since in general
\begin{equation}
\langle O\rangle = \mathrm{Tr}(O\rho) = \mathrm{Tr}\left(\frac{1+O}{2}\rho\right) -\mathrm{Tr}\left(\frac{1-O}{2}\rho\right) = p(+1) - p(-1),
\end{equation}
I expect the difference:
int aveO = PsiPlus.measurement_record.storage[last_entry]-PsiMinus.measurement_record.storage[last_entry];
where last_entry is the index of the last measurement (respectively of MPP X1Z3 for PsiPlus and MPP !X1Z3 for PsiMinus) should be the required value $\langle O\rangle$.
Problems There are problems with the above approach/ideas/implementation. It works if the measurement is deterministic, but it in general it doesn't for non-deterministic measurements (which is the main issue to solve). I think the reason is, since both states refer to the same random generator, the randomness in PsiPlus and PsiMinus are inequivalent, leading to different results (e.g. different internally drawn random numbers).
Furthermore, the operations required can be probably reduced.
Lastly, I conclude with a remark.
For single site measurements, the above issue do not figure in the present release of stim, as there is a method TableauSimulator.is_deterministic_x (and similarly for y,z) which should exactly check if the outcome of MX (MY,MZ) is deterministic or not. If a similar method would be present for generic MPP, probably a solution would still be easily implementable. In pseudo-code:
int aveO;
if (Psi.is_deterministic_mpp(`X1Z3`,{1,3}) {
TableauSimulator PsiM = Psi;
PsiM.apply_mpp(`X1Z3`,{1,3});
aveO = PsiM.measurement_record.storage[last_item];
}
Still, I'm not an expect in HPC, but probably there are smarter way to implement the computation of expectation values.
"
"['nielsen-and-chuang', 'unitarity', 'universal-gates']"," Title: $E(U_j,V_j)\leq\Delta/(2m)$ if probabilities of outcomes obtained from the approximate circuit is within a tolerance $Δ>0$Body:
Suppose we wish to perform a quantum circuit containing $m$ gates, $U_1$ through $U_m$. Unfortunately, we are only able to approximate the gate $U_j$ by the gate $V_j$ . In order that the probabilities of different measurement outcomes obtained from the approximate circuit be within a tolerance $Δ>0$ of the correct probabilities, it suffices that $E(U_j,V_j)\leq\Delta/(2m)$
How do I make sense of this statement which is given in the section "Approximating unitary operators" in Page 194 of QC and QI by Nelsen and Chuang.
It is proved in the same section that,
The probability of obtaining an outcome if $U$ (or $V$) is performed with a starting state $|\psi\rangle$ then $|P_U-P_V|\leq 2E(U,V)$, where $E(U,V)=\max_{|\psi\rangle}||(U-V)|\psi\rangle||=||U-V||$ is the error when $V$ is implemented instead of $U$.
And if we perform a sequence of gates $V_1,\cdots,V_m$ intended to approximate some other sequence of gates $U_1,\cdots,U_m$, then the errors add at most linearly, i.e., $E(U_m\cdots U_1,V_m\cdots V_1)\leq \sum_{j=1}^m E(U_j,V_j)$
How do I make use of these equations to validate the given statement ?
My Try
The statement, the probabilities of different measurement outcomes obtained from the approximate circuit be within a tolerance $Δ>0$ of the correct probabilities implies, $0\leq |P_{U_1\cdots U_m}-P_{V_1\cdots V_m}|\leq \Delta$
"
"['quantum-state', 'continuous-variable', 'quantum-optics', 'gaussian-states']"," Title: How to write the covariance matrix of a quantum gaussian state as a function of photon numbers?Body: Assume having a one-mode quantum Gaussian state with quadrature observable vector $\hat r = [\hat q , \hat p ] $ and covariance matrix $\sigma$. According to definition [1]:
\begin{equation}
\sigma = \text{tr}\left(\begin{bmatrix} \hat q^2 & \frac{1}{2}\{\hat q, \hat p\}\\
\frac{1}{2}\{\hat p, \hat q\} & \hat p^2 \end{bmatrix} \rho \right)
\end{equation}
My question is how can we show the covariance matrix as a function of the average photon number $N = \text{tr}(\hat a^\dagger \hat a \rho)$? I have found an answer in [2] section III.B. (gauge-invariant states) which states the covariance matrix as:
\begin{equation}
\alpha = \begin{bmatrix} \text{Re}N + I/2 & -\text{Im}N \\ \text{Im}N & \text{Re}N + I/2 \end{bmatrix}
\end{equation}
But it is confusing to me as these two cannot be equal to each other as the off-diagonal elements in the second one have opposite signs while the off-diagonal elements of the first one are the same.
EDIT: Would you please also explain about the feasibility and meaning of $\text{Im}N$? I thought $N$ is physical observable thus it can just have real values representing the average number of photons.
Any help or reference is highly appreciated. Thanks.
[1]
C. Weedbrook et al., “Gaussian quantum information,” Rev. Mod. Phys., vol. 84, no. 2, pp. 621–669, May 2012, doi: 10.1103/RevModPhys.84.621.
[2] A. Holevo and R. Werner, “Evaluating capacities of bosonic Gaussian channels,” Phys. Rev. A, vol. 63, no. 3, p. 032312, Feb. 2001, doi: 10.1103/PhysRevA.63.032312.
"
"['qiskit', 'quantum-gate', 'quantum-state', 'measurement']"," Title: How is transformation for measurement in an arbitrary basis derived?Body: I started with Qiskit today and find it very exciting.
As a first question I want to understand how to measure an arbitrary state $|\Psi\rangle$ not in the basis of Z ($|1\rangle$, $|0\rangle$) but in the basis of Y ($|R\rangle$, $|L\rangle$).
Since measurements on qubits in Qiskit are carried out in the Z-basis (I would understand it in that way), I have to transform the state by a transformation
$|\Psi'\rangle = U |\Psi\rangle$
into a new state, on which the measurement is done in the Z-basis. U is to be determined.
So I want a "mapping" from $|R\rangle \rightarrow |0\rangle$ and $|L\rangle \rightarrow |1\rangle$
The requirement on U is, therefore:
- the amplitude of $|R\rangle$ in $|\Psi\rangle$ equals to the amplitude of $|0\rangle$ in $U|\Psi\rangle$
- the amplitude of $|L\rangle$ in $|\Psi\rangle$ equals to the amplitude of $|1\rangle$ in $U|\Psi\rangle$
So I have
- $\langle 0|U|\Psi\rangle = \langle R|\Psi\rangle$
- $\langle 1|U|\Psi\rangle = \langle L|\Psi\rangle$
or
- $U^\dagger|0\rangle = |R\rangle$
- $U^\dagger|1\rangle = |L\rangle$
Therefore, the Z-base matrix-representation is
$U^\dagger = \begin{pmatrix}1 & 1& \\ i &-i\end{pmatrix} $
$U = \begin{pmatrix} 1 & -i& \\ 1 &i\end{pmatrix} $
This is a well known result: Actually, it can be written as
$U = H S^\dagger$
The circuit in Qiskit is as follows
and works as expected:
I think that's all right so far, but I dislike the my clumsy way of bringing up U. Is there a better, more direct approach? It has nothing to with Qiskit, but the way in general.
"
"['entanglement', 'superposition']"," Title: Is it possible to collapse a superposition into a preset state such that all entangled qubits collapse to the same state?Body: Ideally, I'd be able to apply an operation to qubit 0 that would collapse the superposition to a set state (say 1) on qubit 0 & 1.
The operation applied to qubit 0 would be a one qubit operation (number of gates doesn't matter), and in this case qubit 1 cannot have any gates applied to it.
By 'collapse' I mean turning the superposition on both qubits into a binary number.
I'm not sure if this is even possible?
Apologies if this comes off as a newbie question.
"
"['resource-request', 'applications', 'quantum-computing-for-finance']"," Title: What are the getting-started-resources for quantum finance?Body: What are suitable books, websites or learning material you can advice to get started with quantum finance?
"
['hamiltonian-simulation']," Title: Question on Aharanov and Ta-Shma (ATS)'s Sparse Hamiltonian Simulation notationBody: In the equations in section 3.4.2 of Aharonov and Ta-Shma's paper (pdf, arxiv abstract), they define the operator: $$T_1:|k,0\rangle\rightarrow|b_k,m_k,M_k,\tilde{A_k},\tilde{U_k},k\rangle,$$ where $b_k,m_k,M_k,$ and $k$ are all integers and $\tilde{A_k}$ and $\tilde{U_k}$ are $2\times2$ matrices. The state $|b_k\rangle$ can then be taken to be a computational basis state by writing the bit-string representation of $b_k$, and similarly for $m_k,M_k,$ and $k$.
My question is what is the meaning of $|\tilde{A_k}\rangle$ and $|\tilde{U_k}\rangle$? These are matrices with entries which are not integers, so how are they represented in terms of the computational basis?
"
"['error-correction', 'stabilizer-code', 'surface-code', 'stim', 'toric-code']"," Title: how to simulate toric and surface codes with stim + PyMatchingBody: According to PyMatching's github page the package can be decode toric and surface codes. Stim's example
uses stim + PyMatching combination to get logical error rate vs physical error rate curves for the repetition code. An encoding circuit is needed for this and it looks like stim has one built in for the repetition code. Is there an equivalent circuit for toric and surface codes somewhere already? It would be nice to generate similar curves for these codes and compare to published results.
"
"['quantum-state', 'algorithm', 'quantum-operation', 'density-matrix']"," Title: SWAP test and density matrix distinguishabilityBody: Let us either be given the density matrix
\begin{equation}
|\psi\rangle\langle \psi| \otimes |\psi\rangle\langle \psi| ,
\end{equation}
for an $n$ qubit pure state $|\psi \rangle$ or the maximally mixed density matrix
\begin{equation}
\frac{\mathbb{I}}{{2^{2n}}}.
\end{equation}
I am trying to analyze the following algorithm to distinguish between these two cases.
We plug the $2n$ qubit state we are given into the circuit of a SWAP test. Then, following the recipe given in the link provided, if the first qubit is is $0$, I say that we were given two copies of $|\psi \rangle$, and if it is $1$, we say we were given the maximally mixed state over $2n$ qubits.
What is the success probability of this algorithm? Is it the optimal distinguisher for these two states? The optimal measurement ought to be an orthogonal one (as the optimal Helstorm measurement is an orthogonal measurement). How do I see that the SWAP test implements an orthogonal measurement?
"
"['physical-qubit', 'd-wave', 'superconducting-quantum-computing']"," Title: What is the role of Josephson junctions and biases in the D-Wave qubit structure?Body: On the D-Wave 2000Q there are up to 2048 qubits and 5600 coupler. A commonly used picture of one of such qubits is attached below.
Each qubit is realized by a loop of niobium controlled by Josephson junctions and biases represented by $\Phi$’s. As far as I know couplers are also realized by simpler niobium loops.
Clear to me is: That the direction of current in the loop corresponds to the state of the qubit. And that the qubit can be placed in superposition (current running in both directions) when supercooled.
Now I've gathered some questions all regarding the structure and function of such qubit and/or coupler.
- What exactly is the role of the Josephson junction in the qubit? They don't seem to be attached to something.
- Why is a double loop used instead of a single loop (and a single Josephson junction)?
- How are the $\Phi$'s build? And more importantly what is their role in the qubit structure?
- How is a qubit read out after the annealing process? (Is there some connection to the $\Phi$'s?)
"
"['algorithm', 'terminology']"," Title: How is the ""space time volume"" defined?Body: In some papers such as this one the "space time volume" of an algorithm implementation is provided. However I am struggling to find a precise definition of that.
How is such quantity defined ?
"
"['vqe', 'optimization', 'qaoa', 'spin-glasses']"," Title: How to show mathematically the equivalency between Ising Model and QUBO?Body: It is said that the Ising Model using spin variables $s ∈ \{−1, 1\}$
$$H(s)=\sum_{i}h_is_i+\sum_{i<j}J_{ij}s_is_j,$$
and a Quadratic Unconstrained Binary Optimization (QUBO) problem with binary variables $x ∈ \{0, 1\}$
$$Obj(x,Q)=x^{T} ·Q·x,$$
are equivalent under a simple change of basis. How one could mathematically show this?
"
"['qiskit', 'optimization', 'quantum-enhanced-machine-learning']"," Title: Qiskit's classifier is not optimising the weightsBody: I am using qiskit's VQC to build a classifier. Dimensionality of the data is 2 and number of classes are 4. The feature map I used is ZZFeatureMap and ansatz is the RealAplitudes. Then entanglement and reps are "full" and 2 respectively for both feature map and ansatz. Optimizer used is 'COBYLA'. Please find below the respective code.
When I try to fit the classifier, it is not optimising the weights and the loss is always "nan". It is stopping after 7 iterations.
What am I doing wrong and how can I train a classifier using qiskit's VQC ? Thank you!
"
"['qiskit', 'programming', 'quantum-enhanced-machine-learning']"," Title: How to set hyper parameters for a Variational Quantum Classifier (qiskit)?Body: I am trying to implement a Variational Quantum Classifier using qiskit's VQC. I have set the feature map to ZZFeatureMap and am using the RealAmplitudes ansatz. I am using cross_entropy loss function and ADAM optimiser. One more parameter that VQC requires is a QuantumInstance object and this I have set to aer_simulator with 1024 shots.
The code and instructions I followed is in this qiskit's tutorial.
When I try to train the classifier, it running for a different number of iterations each time. Is there a way to set minimum number of iterations ? and how are iterations different from shots ?
Also, how can I set the learning rate for the algorithm ? Thank you !
"
"['quantum-gate', 'quantum-state', 'measurement']"," Title: Do we need ancillary qubits to implement orthogonal measurements?Body: Consider an $n$ qubit state $|\psi\rangle$. Let's say I want to implement an $m$ outcome orthogonal measurement on $|\psi\rangle$, where $m \neq n$. Denote the set of $m$ orthogonal measurement operators as
\begin{equation}
\mathcal{M} = \{M_1, M_2, \ldots, M_m \}.
\end{equation}
From the properties of orthogonal measurements, we know that:
- Each $M_i$ can be written as
\begin{equation}
M_i = \sum_{j = 1}^{k_i} |\lambda_j\rangle \langle \lambda_j|,
\end{equation}
for a certain choice of $k_i$, with each $|\lambda_j\rangle$ being a normalized pure state, and $\{|\lambda_j\rangle : j = \{1, 2, \ldots, k_i\}\}$ being an orthogonal set. It is also true that
\begin{equation}
\sum_{i = 1}^{m} k_i = 2^{n}.
\end{equation}
- Additionally, $m \leq 2^{n}$.
Let us say we can only measure in the standard basis and we want to implement the measurement $\mathcal{M}$. Is it true that there always exists an $n$ unitary $U$ such that we can implement the measurement, without using any ancillary qubits, using the following recipe:
- Apply $U$ to the state $|\psi\rangle$.
- Measure $\log m$ qubits in the standard basis.
I do not have much intuition on whether or not ancillary qubits are necessary to implement general orthogonal measurements of the type I mentioned. If we consider an example of a famous orthogonal measurement --- the SWAP test (which projects onto either the $2$ dimensional symmetric or the $2$ dimensional antisymmetric subspace, which are orthogonal and span the whole space for $2$ dimensional systems) --- it seems to require ancillary qubits, in its most standard implementation.
Can we get rid of these ancillas?
"
"['qiskit', 'oracles', 'initialization']"," Title: How to separate initializing qubits from runing algorithm several timesBody: I have read several papers about quantum computing. It looks like any algorithm consists of several phases. For example in Grover algorithm initially qubits must be initialized from reset state $|0\rangle$ and sent through Hadamard gate. After that computer must do several runs (shots?) via oracle and amplifier.
Question: schemas of Grover algorithm contain single diagram schema from left to right.How does a quantum computer knows where is initialization phase and where is oracle with amplifier? I mean if I run multiple times same schema then it starts from schema most left gates from initialization phase which I guess must be skipped during oracle-amplifier repetitions?
I guess initialization must be executed once only and after that repeat runs/shots as many times as needed, is this correct or not?
How to declare this in schema? Or how to separate initialization phase from repetitive steps in Qiskit language? I looked at many Qiskit programs and do not see any algorithm separator from init steps to algorithm steps.
What did I miss? Are my assumptions incorrect?
"
['qiskit']," Title: unsymmetric observable estimation by QiskitBody: Assume $|i\rangle,i\in[1,m]$ is a set of states, like the Fock states for Fermions. The question is how to compute the quantity,$\langle i |H|j\rangle,i,j\in[1,m]$, in qiskit. The $H$ here is the qubit form Hamiltonian of some molecule obtained by the Jordan-Wigner transformation.
"
"['circuit-construction', 'quantum-circuit', 'clifford-group']"," Title: Why do we care about the number of $T$ gates in a quantum circuit?Body: When reading this question and quickly reading some of the linked papers, I wondered why was the number of $T$ gates specified along the number of controlled-$X$ gates.
I've often read that implementing a controlled-$X$ gate was more costly than implementing single-qubit gates, though I never got the explanation as to why this is true. Assuming this however, I can understand why this number is of importance.
Concerning the number of $T$ gates however, what's the motive behind it? My intuition is that it gives an idea of how deep the circuit is, since $T$ is required to precisely approximate the desired gates, but if it is the case, why bother with the number of $T$ gates rather than with the circuit depth directly?
"
['algorithm']," Title: Are there direct usefull applications of the quantum Fourier transform not requiring heavy other subroutineBody: I know that the quantum Fourier transform has many applications such as order finding (which is used in Shor algorithm), phase estimation, etc.
However those algorithms require extra subroutines which are often much "heavier" in term of gates and qubits required.
My question is:
Are there applications of the quantum Fourier transform in which the typical number of gates required (decomposed on Clifford+T) is about the same that there are in the quantum Fourier transform itself.
If so, for which size of the quantum Fourier transform can we expect a quantum advantage compared to today supercomputers.
"
"['error-correction', 'stabilizer-code', 'toric-code']"," Title: is the minimum weight perfect matching decoder optimalBody: The toric code and other popular codes can be decoded using minimum weight perfect matching.
Is this an optimal decoder? Here by optimal, I mean it gives the best logical error rate
vs physical error rate performance in depolarizing channel. "Threshold" is often used to characterize toric codes, does that assume optimal decoding or a particular type?
"
"['qiskit', 'programming', 'ibm-q-experience', 'qasm']"," Title: Are we using the real-time error information in simulating noise on qasm?Body: I'm trying to run some quantum circuits on qasm simulator using the noise information from IBM Q quantum device:
provider = IBMQ.load_account()
backend = provider.get_backend('ibmq_casablanca')
noise_model = NoiseModel.from_backend(backend)
coupling_map = backend.configuration().coupling_map
basis_gates = noise_model.basis_gates
As I print(noise_model), I got
NoiseModel:
Basis gates: ['cx', 'id', 'reset', 'rz', 'sx', 'x']
Instructions with noise: ['reset', 'measure', 'x', 'sx', 'id', 'cx']
Qubits with noise: [0, 1, 2, 3, 4, 5, 6]
Specific qubit errors: [('id', [0]), ('id', [1]), ('id', [2]), ('id', [3]), ('id', [4]), ('id', [5]), ('id', [6]), ('sx', [0]), ('sx', [1]), ('sx', [2]), ('sx', [3]), ('sx', [4]), ('sx', [5]), ('sx', [6]), ('x', [0]), ('x', [1]), ('x', [2]), ('x', [3]), ('x', [4]), ('x', [5]), ('x', [6]), ('cx', [6, 5]), ('cx', [5, 6]), ('cx', [5, 4]), ('cx', [4, 5]), ('cx', [5, 3]), ('cx', [3, 5]), ('cx', [3, 1]), ('cx', [1, 3]), ('cx', [1, 2]), ('cx', [2, 1]), ('cx', [1, 0]), ('cx', [0, 1]), ('reset', [0]), ('reset', [1]), ('reset', [2]), ('reset', [3]), ('reset', [4]), ('reset', [5]), ('reset', [6]), ('measure', [0]), ('measure', [1]), ('measure', [2]), ('measure', [3]), ('measure', [4]), ('measure', [5]), ('measure', [6])]
So I could see the source of errors as well as qubit connections. However, I wonder as I give this information to qasm simulator and run the experiments, am I using the real-time error rate as the noise model?
result = execute(circ, Aer.get_backend('qasm_simulator'),
coupling_map=coupling_map,
basis_gates=basis_gates,
noise_model=noise_model).result()
If so, should we expect to see any difference between the qasm results and the results from real quantum devices? (I could not print out the noise information, so I'm a bit confused which error values we are using.) Thanks!
"
"['programming', 'openfermion']"," Title: Questions about OpenFermionBody: I have some questions about OpenFermion.
I'm exploring the code, does anybody knows how to implement triatomic molecules like Li-H2?
How should I set the number of orbitals?
Last but not least, once the molecular problem is mapped to the spinless Fermi Hubbard, how OpenFermion sets the number of sites and the number of particles (I suppose it depends on the number of orbitals..)?
Thank you so much!
Piero
"
"['quantum-state', 'error-correction', 'hamiltonian-simulation', 'error-mitigation']"," Title: Nyquist–Shannon sampling theorem for Quantum EvolutionBody: In classical digital signal processing one can try to identify the dynamics of a system by sampling its evolution from an initial time $t_0$ to a final time $t_1$. Sampling $N$ times results in a discrete recreation of its evolution and one can try to reconstruct with various methods the actual continuous time evolution later.
By the Nyquist–Shannon sampling theorem if $N$ is sufficiently large then the discrete dynamics error should not be conceivable (e.g. if we are sampling the sound waves from a piano). Thus, to the observer non-observable.
Question
Is there some analog theorem or application of the Nyquist–Shannon sampling theorem when one wants to sample the evolution of a quantum state evolving under some Hamiltonian $\hat H$? (e.g. a qubit within some superconducting processor.)
One would record a time-series $\{|\psi_0\rangle, \ldots,|\psi_N\rangle \}$ where,
$$
|\psi_i\rangle = e^{-i\hat H (t_i-t_0)}|\psi_0\rangle.
$$
Could one prepare a state at least as many times as the state is supposed to be sample, say $N$ and allow evolution each time measuring with frequency $1/N$? I think the answer here is yes.
What can be said then about the state evolution and where could "quantum noise" ruin the reconstruction of the dynamics compared to a classical system?
Some errors would originate from the error reconstruction, but what other sources of error one would have to tackle?
"
"['quantum-gate', 'textbook-and-exercises', 'nielsen-and-chuang', 'universal-gates']"," Title: Prove $E(R_n(\alpha),R_n(\theta)^n)<\epsilon/3$ from $E\big(R_n(\alpha),R_n(\alpha+\beta)\big)=|1-\exp(i\beta/2)|$Body:
where $E(U,V)=\max_{|\psi\rangle}||(U-V)|\psi\rangle ||=||U-V||$ is the error when $V$ is implemented instead of $U$. See page 196, Quantum Computation and Quantum Information by Nielsen and Chuang.
I have performed calculations for the exercise
$$
E\big(R_n(\alpha),R_n(\alpha+\beta)\big)=|(R_n(\alpha)-R_n(\alpha+\beta))|\phi\rangle|=|(R_n(\alpha)-(R_n(\alpha)R_n(\beta))|\phi\rangle|=\Big|R_n(\alpha)\big[1-R_n(\beta)\big]|\phi\rangle\Big|=\sqrt{\langle\phi|\big[1-R_n(\beta)\big]^\dagger R_n^\dagger(\alpha)R_n(\alpha)\big[1-R_n(\beta)\big]|\phi\rangle}\\
=\sqrt{\langle\phi|\big[1-R_n^\dagger(\beta)\big] \big[1-R_n(\beta)\big]|\phi\rangle}=\sqrt{\langle\phi|\big[1-R_n(-\beta)\big] \big[1-R_n(\beta)\big]|\phi\rangle}=\sqrt{\langle\phi|\big[1-R_n(-\beta)-R_n(\beta)+1\big]|\phi\rangle}=\sqrt{2-2\cos(\beta/2)}=|1-\exp(i\beta/2)|.
$$
Now, how do we prove that for any $\epsilon>0$ there exists an $n$ such that $E(R_n(\alpha),R_n(\theta)^n)<\epsilon/3$ from Eq. $(4.77)$?
"
"['qiskit', 'programming', 'quantum-neural-network']"," Title: Adding trainable weights to feature inputs for a CircuitQNN?Body: Currently I'm trying to get together a QNN that can be trained to classify the normalized (-1, 1) IRIS Dataset on all 3 classes. For this I am using Qiskit's NeuralNetworkClassifier, and have a specific question regarding the circuit setup.
My current idea for the circuit is that the weights influence the features, which in turn rotate the qubit a certain direction. With the CircuitQNN class, I have to use a feature map as well as an ansatz. Now, this is per se OK, but it doesn't allow me to specifically multiply the weights with the features themselfs - I can only do so by applying the weights in the ansatz.
Is there a possibility for this or am I missing something? Code that currently works and is trainable (albeit results in an accuracy of ~0.5) would be as follows:
feature_map = QuantumCircuit(1)
ansatz = QuantumCircuit(1)
for i in range(len(normalized_features[1])):
feature_map.ry(Parameter('i_' + str(i)),0)
ansatz.ry(Parameter('w_' + str(i)),0)
qc = QuantumCircuit(1)
qc.append(feature_map, range(1))
qc.append(ansatz, range(1))
display(qc.draw('mpl'))
circuit_qnn = CircuitQNN(circuit=qc,
input_params=feature_map.parameters,
weight_params=ansatz.parameters,
interpret=parity,
output_shape=output_shape,
quantum_instance=quantum_instance)
Yes, I know this is only limited to one qubit, and I am currently only trying to figure out the different ways to construct the circuit. After figuring out the weight problem, I'd measure multiple vs single qubit circuits using it and compare the results.
"
"['programming', 'quantum-enhanced-machine-learning', 'quantum-neural-network']"," Title: How to train a Quantum Neural network for regression model in supervised learningBody: We want to train a parameterised circuit(which is our neural network - from this paper. Now our final circuit looks a little like
Let's say there are n training cases. So I have n |gt> vectors along with n (alpha,beta and gamma). Currently I am trying to use minimize function from scipy to find these parameters, the objective function that has been passed makes n circuits(each for one training case) and then uses SWAP test to see how close the final state generated from our circuit is to the |gt> state for particular case, this would be the cost for one case. Now the final cost is the root of sum of all the costs squared. This is mainly motivated from - https://qiskit.org/textbook/ch-demos/variational-quantum-regression.html
Here is the main problem - it is not getting optimised, now I know this is not an efficient approach and might not work but it is not working at all. Does any one know how we can do this more efficiently such that the training actually works. Thanks any help is greatly appreciated
"
"['algorithm', 'entanglement', 'teleportation']"," Title: Generalizing the circuit for quantum teleportation for $n$-qubit states?Body: So the usual quantum circuit I know for quantum teleportation allows for the teleportation of the state on a single qubit, in the following way:
How easy is to generalize this algorithm to allow for the teleportation of the state of 2 or $n$-qubits?
Note that I am not considering qudits.
"
"['error-correction', 'quantum-operation', 'nielsen-and-chuang', 'kraus-representation']"," Title: Why does a quantum operation being trace-preserving imply that $\sum_k E_k^\dagger E_k=I$?Body: I am reading Nielsen Chuang Chapter 8. They say that if a quantum operation is trace-preserving, then
\begin{equation}
Tr\left(\sum_k E_k^{\dagger}E_k \rho\right) = 1
\end{equation}
which I understand. They however then claim that as this is true for all $\rho$, then
\begin{equation}
\sum_k E_k^{\dagger}E_k = I.
\end{equation}
This seems reasonable, but I cannot clearly write down the proof. Further, they say if it is non-trace preserving then $\sum_k E_k^{\dagger}E_k \leq I$, which is something I do not understand. How are we saying one matrix is smaller than the other. Do they mean that $\sum_k E_k^{\dagger}E_k = cI$, where $c \leq 1$ ?
However then can someone please sketch the proof?
"
"['quantum-state', 'measurement', 'probability']"," Title: Schur transform and the outcome probabilities for a particular type of stateBody: I was reading about the Schur transform and its applications in knowing about an unknown quantum state.
Consider $\rho^{\otimes k}$, which means $k$ copies of an unknown $n$ qubit quantum density matrix $\rho$.
Let's say I measure $\rho^{\otimes k}$ in the Schur basis --- that is, I apply the Schur transform to this state and measure in the standard basis. An example of this can be found in equations $13$, $14$, and $15$ of this paper.
Can we (non trivially and as tightly as possible) upper bound the probability of getting each of the $2^{nk}$ outcomes after our measurement is done? I am looking for an upper bound that depends on the specific properties of the Schur transform (and not just the fact that it is a unitary transform.)
I have seen it remarked in different papers that knowing the spectrum of $\rho$ is sufficient to put bounds on the probability of getting each outcome after measuring $\rho^{\otimes k}$ in the Schur basis --- but it wasn't too clear how.
For simplicity, let us say we are given a guarantee on the spectrum of $\rho$ --- each eigenvalue $\lambda_i$ of $\rho$ satisfies
\begin{equation}
\lambda_i \leq \frac{1}{2^{n}} + \frac{1}{2^{\text{poly}(n)}}.
\end{equation}
Note that if $\rho$ is maximally mixed, then by a trivial argument, each outcome is equally likely.
"
"['qiskit', 'programming']"," Title: How does one get the right counts for the measurement of a single qubit in the presence of noise with qiskit?Body: I am using a single qubit in the IBM quantum lab running on ibm_armonk and it is simulated with real noise, however when I try to measure out a state where the coefficient of the 0 state is less than 0.1 I get the wrong counts. I always get the result that there were roughly 1/10 of the counts in the 0 state and 9/10 in the 1 state (for example, if I try to initialize the state so that the probability of 0 is 0.01). I used 8192 shots but when I try to repeat the experiment I get the same results. This doesn't make sense to me because I would expect the effect of noise to lead to a more Gaussian type of distribution around the average, so after enough measurements the counts should lead to the average value. My code involves the following:
initial_state = [0.1,math.sqrt(0.9)] # my code is a little different here, but this
# should give an idea of the numbers I am
# using
circuit.initialize(initial_state,0)
circuit.measure(0,0)
job = execute(circuit,device,shots=8192)
result = job.result()
result = result.get_counts(circuit)
print(counts)
"
"['error-correction', 'quantum-operation', 'quantum-circuit']"," Title: How to detect and correct swap errors in a quantum circuit?Body: Let's assume that I have a density matrix $\rho$ that consists of $N$ qubits.
If this density matrix undergoes an error-channel that swaps any two qubits with an equal probability, i.e.
$$
\mathcal{E}(\rho)=(1-p)\rho + \frac{2p}{N(N-1)}\sum_{i=1}^{N-1}\sum_{j>i}^N \mathrm{SWAP}_{ij}\rho \mathrm{SWAP}_{ij}
$$
where $p$ is the probability of an error.
Does there exist a quantum circuit/protocol that can detect and correct if a swap error has occurred?
"
"['quantum-operation', 'information-theory', 'trace-distance', 'projection-operator']"," Title: Does ${\rm tr}(\Pi_z\rho\Pi_z)\le p$ imply $\cal E(\rho)$ and $\cal E(\Pi_{-z}\rho\Pi_{-z})$ are close in trace distance?Body: Suppose I have a quantum operation $\mathcal{E}$ and a state $\rho$ such that:
$$ \operatorname{tr}(\Pi_z \rho \Pi_z) \le p $$
for some probability $p$ and some projection $\Pi_z$ onto some subspace of the Hilbert space. Let $\Pi_{-z} = \mathbb{1} - \Pi_z$.
I would like to prove (or disprove) that $\mathcal{E}(\rho)$ and $\mathcal{E}(\Pi_{-z} \rho \Pi_{-z})$ are close to each other, i.e. finding a bound for:
$$ || \mathcal{E}(\rho) - \mathcal{E}(\Pi_{-z} \rho \Pi_{-z}) ||_1 $$
The first thing it comes natural to do is to apply contractivity of quantum channels:
$$ || \mathcal{E}(\rho) - \mathcal{E}(\Pi_{-z} \rho \Pi_{-z}) ||_1 \le || \rho - \Pi_{-z} \rho \Pi_{-z} ||_1 $$
But now I can't go ahead. Can you help me?
"
"['quantum-fourier-transform', 'notation']"," Title: Question regarding the notation of QFTBody: I have a question about the notation of QFT. I would like to present briefly what my problem is. So given is the QFT as a mapping with:
$$|j_1,...,j_n\rangle \rightarrow \frac{(|0\rangle + e^{2\pi i 0.j_n}|1\rangle)(|0\rangle + e^{2\pi i0.j_{n-1}j_n}|1\rangle)...(|0\rangle + e^{2\pi i 0.j_1j_2 ... j_n}|1\rangle)}{\sqrt{2^n}} \quad\quad\text{eq.1}$$
Based on this notation, I would number the individual qubits as follows:
$$|j_1,...,j_n\rangle = \overbrace{|j_1\rangle}^{\text{Qubit 1}}\overbrace{|j_2\rangle}^{\text{Qubit 2}}...\overbrace{|j_n\rangle}^{\text{Qubit $n$}} \rightarrow \frac{\overbrace{(|0\rangle + e^{2\pi i0.j_n}|1\rangle)}^{\text{Qubit 1}}\overbrace{(|0\rangle + e^{2\pi i0.j_{n-1}j_n}|1\rangle)}^{\text{Qubit 2}}...\overbrace{(|0\rangle + e^{2\pi i0.j_1j_2 ... j_n}|1\rangle)}^{\text{Qubit $n$}}}{\sqrt{2^n}}$$
If what I said before is correct, I am a bit confused about the following statement I read in "Physics 191 Lecture, Fall 14", there it says:
Lets take the $l$th qubit, $|j_l\rangle$. According to eq. (2) above. this needs to be transformed from $|j_l\rangle$ into the state $$\frac{1}{\sqrt{2}}(|0\rangle + e^{2\pi i0.j_l ... j_n}|1\rangle)$$
A few words regarding the quote:
- What is described in the quote as equation 2 corresponds to my first equation here eq.1 (the mapping).
Let's assume a very simple setup, say we have two qubits $|1_{1}0_{2}\rangle$ (Indices explicitly added) that we want to transform with QFT. According to the quote, however, I would get the following result:
Let's just look at the first qubit $l = 1$ then (QFT on first Qubit):
$$|1\rangle \rightarrow \frac{1}{\sqrt{2}}(|0\rangle + e^{2\pi i0.j_1 ... j_2}|1\rangle) = \frac{1}{\sqrt{2}}(|0\rangle + e^{2\pi i0.10}|1\rangle)$$
Second qubit $l = 2$ then (QFT on second Qubit):
$$|0\rangle \rightarrow \frac{1}{\sqrt{2}}(|0\rangle + e^{2\pi i0.j_2}|1\rangle) = \frac{1}{\sqrt{2}}(|0\rangle + e^{2\pi i0.0}|1\rangle)$$
But then this does not correspond to what I marked/interpreted above as qubit 1 and 2.
In my opinion, however, the first and second qubit should be displayed like this:
$$|10\rangle = \overbrace{|1\rangle}^{\text{Qubit 1}}\overbrace{|0\rangle}^{\text{Qubit 2}} \rightarrow \frac{\overbrace{(|0\rangle + e^{2\pi i0.0}|1\rangle)}^{\text{Qubit 1}}\overbrace{(|0\rangle + e^{2\pi i0.10}|1\rangle)}^{\text{Qubit 2}}}{\sqrt{2^2}}$$
My question now is, what is correct here? It may also be that my interpretation and numbering of the qubits is wrong?
I know that the question may go into great detail, but hope to have expressed myself understandably here :)
"
"['quantum-gate', 'quantum-state', 'circuit-construction']"," Title: How many single and double qubit gates are required to create a uniform superposition of vertices of a Johnson Graph J(n,r)?Body: Can I in $\tilde{O}(r)$ number of gates (single and double qubit) create a uniform superposition of vertices of Johnson Graph $J(n,r)$? I would like to create a state $|\psi\rangle = \frac{1}{\sqrt{n \choose r}} \sum_{|S|=r, S \subset [n]}|S\rangle$ where $S$ denotes an $r$-sized tuple of indices in ascending order of their value.
"
"['programming', 'error-correction', 'stim']"," Title: What is the meaning of ""shots"" and ""rounds"" in Stim?Body: I'm running simulations using Stim to get logical error rate vs. physical error rates of some quantum error correcting codes (QECC).
I looked into the documentation, but I'm confused about the meaning of "shots" and "rounds". I think I understand the meaning of "shots": repeat the state generation, add random noise at physical error rate, measure, decode, count logical errors. How would the "rounds" parameter enter the picture? Why would I need more than one round of measurement? (Assuming each round measures all stabilizers.)
Here a code sniplet of an example:
def Test():
num_shots = 1000
xs = []
ys = []
for noise in [0.1, 0.2, 0.3, 0.4, 0.5]:
circuit = stim.Circuit.generated("surface_code:rotated_memory_z",distance=3,rounds=1,before_round_data_depolarization=noise)
xs.append(noise)
ys.append(count_logical_errors(circuit, num_shots) / num_shots)
plt.plot(xs, ys)
plt.semilogy()
plt.xlabel("physical error rate")
plt.ylabel("logical error rate")
plt.show()
"
"['quantum-gate', 'quantum-advantage', 'random-quantum-circuit', 'haar-distribution', 't-designs']"," Title: At what depth and for what architecture are random quantum circuits $1$-designs?Body: I was confused about something related to quantum $1$ designs.
Let us recap two facts we know about random circuit ensembles that form a $1$ design.
- $1$ design, for a quantum circuit over $n$ qubits, means that the density matrix of the ensemble is equal to the maximally mixed state over $n$ qubits.
- If for depth $d$, a random circuit ensemble is a $1$ design, then it is also a $1$ design at depth $d+1$ and beyond.
Now, consider the following random circuit ensemble, taken from Figure 1 (a) here.
As mentioned in the paper, each violet box is drawn independently from the Haar measure on $\mathbb{U}(4)$.
Now, consider a circuit constructed like this, whose depth is exactly $1$. That is, we start with the all zeros state, apply a random gate to each of the $n/2$ pairs of qubits, and then measure in the standard basis.
It is not hard to work out that the ensemble is a $1$ design.
However, I am not sure how to prove that the ensemble remains a $1$ design (or even an approximate $1$ design) when we increase the depth to $2$ and beyond. The calculations for the depth $1$ case do not immediately generalize.
What is going on here?
Note that it is known that such architectures become $2$ designs (and hence, $1$ designs too) after linear depth. However, I am interested in the behaviour in constant or $\log n$ depths.
Additionally, the fact that the depth $1$ case is a $1$ design seemed to rely heavily on the type of gate set chosen. What if we change the gate set to another universal gate set --- like all single qubit gates and the CNOT gate?
Does it still remain a $1$ design (or an approximate $1$ design) or is the gate set in question very special?
"
"['quantum-state', 'textbook-and-exercises', 'majorization']"," Title: Why can we write $\rho=\sum_\mu q_\mu|\varphi_\mu\rangle\!\langle\varphi_\mu|$ iff $q\preceq \mathrm{spec}(\rho)$?Body: Exercise 2.6 in Preskill's notes (chapter 2, around page 48, pdf available here) asks to prove that an arbitrary state $\rho=\sum_i p_i |\alpha_i\rangle\!\langle\alpha_i|$, where $p_i$ and $|\alpha_i\rangle$ are obtained from the spectral decomposition of $\rho$, can be also decomposed as
$$\rho = \sum_\mu q_\mu |\varphi_\mu\rangle\!\langle \varphi_\mu|,$$
for some ensemble of pure states $|\varphi_\mu\rangle$, if and only if $q\preceq p$, that is, if and only if there is some doubly stochastic matrix $D$ such that $q_\mu=\sum_i D_{\mu i}p_i$.
As a hint, he remembers that the two decompositions above are simultaneously possible if and only if
$$\sqrt{q_\mu}|\varphi_\mu\rangle = \sum_i \sqrt{p_i} V_{\mu i}|\alpha_i\rangle,$$
for some unitary $V$. He also says we can use Horn's lemma: if $q\preceq p$ then $q=Dp$ with $D_{\mu i}=|U_{\mu i}|^2$ for some unitary $U$.
I understand why the statements in the hints hold, but I'm not sure how to apply them to the given exercise. I tried using the above relation to isolate $q_\mu$, but then I get
$$\sqrt{q_\mu} = \sum_i \sqrt{p_i} V_{\mu i}\langle \varphi_\mu|\alpha_i\rangle
\implies q_\mu = \sum_{ij} \sqrt{p_i p_j} V_{\mu i}\bar V_{\mu j} \langle \varphi_\mu|\alpha_i\rangle \langle\alpha_j|\varphi_\mu\rangle,$$
which I'm not sure how to reframe as $q=Dp$.
On the other hand, taking the expectation value over $|\alpha_i\rangle$, I get the relation
$$p_i = \sum_\mu q_\mu |\langle\alpha_i|\varphi_\mu\rangle|^2,$$
but again, this amounts to $p=A q$ for some $A$ about which we only know the columns sum to one. Besides, even if $A$ was doubly stochastic, the relation would be in the wrong direction.
Shur-Horn's theorem (if $\rho$ is Hermitian then $\operatorname{diag}(\rho)\preceq \operatorname{spec}(\rho)$) seems to be also relevant, but the diagonal of $\rho$ in the above notation would have elements $q'_i = \sum_\mu q_\mu |\langle i|\varphi_\mu\rangle|^2$, so we'd get $q'\preceq p$, which is not quite the same as $q\preceq p$ as far as I can tell.
With $\operatorname{spec}(\rho)$ I mean the vector whose elements are the eivanvalues of $\rho$.
"
"['qiskit', 'programming']"," Title: How to add label to custom operator (from matrix) controlled gate?Body: So here is what I'm trying to accomplish:
I have made a gate out of a matrix, with a control:
cG_p = Operator([[np.sqrt(p[j]), -np.sqrt(1-p[j])], [np.sqrt(1-p[j]), np.sqrt(p[j])]]).to_instruction().control(1)
I then append it to a circuit in a loop:
circ.append(cG_p, [j, j+1])
When I draw the circuit it by default labels the gate "Unitary". I want to put a custom label on the gate instead
I could put the custom label on when it wasn't a control (just a gate). That worked fine. Now that I've added the necessary control I can find no way to change the label.
"
"['error-correction', 'fidelity']"," Title: How to calculate the threshold for gate fidelity?Body: I've been interested in gate fidelity lately.
In the meantime, I came up with a specific example. Let's think about the encoding of situation $\alpha_0 |0\rangle + \alpha_1 |1\rangle \rightarrow \alpha_0 |000\rangle + \alpha_1 |111\rangle$, and implement a circuit that can correct the case where there is an error in one bit out of three qubits.
That is, consider a quantum error correction.
In that time, what is the threshold for gate fidelity at which error correction stops (or becomes meaningless)?
I think fidelity is simply a connection between the ideal and the realistic, but when I try to think of it as a concrete example, it is difficult to figure out how to calculate it.
(I know the formula for calculating fidelity.)
Thanks!
"
"['qaoa', 'd-wave']"," Title: How do we calculate the offset in a QUBO formulation?Body: I am aware that for a quadratic optimization problem, we are required to minimize $y$ where $y = x^t Q x$ where $x$ is a column vector of binary variables and $Q$ is a QUBO matrix. I have the following two questions in this regard:
- How do we calculate the offset value or the constant terms associated with the quadratic optimization problem?
- What is the relationship between the offset value obtained from the algorithm for the QUBO with its corresponding QAOA formulation?
Any help in this regard would be really appreciated! Thanks in advance!
"
"['error-correction', 'cryptography', 'key-distribution', 'bb84', 'qkd']"," Title: Doubt in Simple proof of Security of the BB84 QKDBody: I am not able to understand an argument from Simple proof of Security of the BB84 QKD; I need your help. In page 2 it is mentioned that "Alice can measure her half of the encoded EPR pairs before or after transmission. If she measures them first, this is the same as choosing a random key $k$ and encoding $k$ using $Q_{x,z}$."
I am not getting how sharing maximally entangled EPR states is the same as sending non-entangled encoded (CSS) quantum states.
Basically, it is proved that protocol is secure when the entangled pair is secure, but now they are replacing maximally entangled states with just encoded quantum states.
In the recently published book named "Quantum Key Distribution" by Dr. Ramona Wolf (and also in her lectures), she mentioned the same thing "... instead of preparing maximally entangled states, Alice can equivalently choose bit string $x,z,$ and $k$ at random, encode $| k \rangle$ in the code $Q_{x,z}$ and send the corresponding $n$-qubit codeword to Bob.
It's still unclear why they're the same.
If you could provide me with some understanding or a proper explanation for this equivalency, that would be extremely useful.
(I have studied CSS error-correcting codes)
"
"['fidelity', 'clifford-group', 'randomised-benchmarking']"," Title: What scheme should be used in case of applying non-Cliffords to estimate probability of success?Body: For Clifford gates (when performing randomized benchmarking and starting from ground state) the final state is always ground. It is acquired by applying at the end recovery gate, which transfers the state of Clifford gates sequence to the gound state. But how does it work in case we apply non-Clifford gates?
"
"['qiskit', 'programming', 'algorithm', 'ibm-q-experience', 'vqe']"," Title: How can I run a VQE on one of IBMQ's Quantum ComputersBody: I have implemented a VQE based on Qiskit's VQE function and want to run that on an actual quantum computer. My understanding was, that an IBMQ backend can be passed into the function as a Quantum Instance. But this doesn't seem to work.
Here is the code that I am using:
from qiskit.algorithms import VQE
from qiskit.algorithms.optimizers import COBYLA
from qiskit.opflow import Z, X, I
from qiskit.circuit.library import TwoLocal
from qiskit import IBMQ
IBMQ.save_account('token') # Insert token here
IBMQ.load_account()
# Define hamiltonian
H = -(Z ^ Z) - 0.2 * ((X ^ I) + (I ^ X))
# Define backend
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('ibmq_bogota')
# Define optimizer
optimizer = COBYLA(maxiter=200)
# Define ansatz
ansatz = TwoLocal(2, 'ry','cz', reps=1)
# Set up VQE and run on backend
vqe = VQE(ansatz=ansatz, optimizer=optimizer, quantum_instance=backend)
result = vqe.compute_minimum_eigenvalue(operator=H)
# print the result
print(result)
The Hamiltonian used in this code is just a dummy, not my actual one. I just want to figure out how to properly run the code on IBMQ, before I try it out with my actual one.
I have already tried several approaches, including this one: How to run VQE experiments on IBMQ Backends?
But they all did not work either.
Can someone please help me out?
"
['machine-learning']," Title: Quantum machine learning: only a boost to computation or something more?Body: I'm new in the area and I'm quite curious.
- What are the main advantages of quantum machine learning over "classical" machine learning (from sklearn library, for example)?
- Is just only a boost to the computational process or it could be a way for building better models (in term of bias/variance trade-off - more generalized model)?
- Are the super-positions (and other quantum characteristics) a way for capturing better statistical properties (so, maybe, quantum computation can be used in a sort of "features engineering" step)?
thanks everyone!
"
"['quantum-state', 'hamiltonian-simulation']"," Title: How to find minimum time needed for Hamiltonian evolution?Body: Database search can be looked upon as Hamiltonian evolution, with kinetic and
potential energy operators. Let the evolution follow the Schrodinger equation:
$$i\frac{d}{dt}|\psi⟩= H|ψ⟩$$
with $H = E|s⟩⟨s| + E|t⟩⟨t|$ and some constant $E$.
How can we find the minimum time $T$ required for the initial state $|s⟩ = \frac{1}{\sqrt{N}}\sum_{i=1}^N |i⟩ $ to evolve $N$ to the final state $|t⟩$.
"
"['measurement', 'textbook-and-exercises', 'nielsen-and-chuang', 'povm']"," Title: Show that there are unitaries $U_m$ such that $M_m=U_m \sqrt{E_m}$, for any measurement $M_m$ and associated POVM $E_m$Body: Nielsen and Chuang's QCQI, section 2.2.6, page 92, asks
Suppose a measurement is described by measurement operators $M_m$. Show that there exist unitary operators $U_m$ such that $M_m=U_m\sqrt{E_m}$, where $E_m$ is the POVM associated to the measurement.
I can argue:
$$\langle \Phi |M_m^\dagger M_m|\Psi\rangle=\langle\Phi|E_m|\Psi\rangle\quad\text{for all}\quad|\Phi\rangle, |\Psi\rangle\tag1$$
$$\langle\Phi|M_m^\dagger M_M|\Psi\rangle=\langle\Phi|\sqrt{E_m}\sqrt{E_m}|\Psi\rangle.$$
This can only be true if there is a unitary transformation $U_m$, such that
$$M_m|\Psi\rangle=U_m\sqrt{E_m}\quad\text{for all}\quad|\Psi\rangle$$
$$M_m=U_m\sqrt{E_m}$$
Why is $(1)$ true?
"
"['mathematics', 'hamiltonian-simulation', 'universal-gates', 'exponentiation']"," Title: How to exactly implement Trotter-Suzuki formula on quantum computerBody: Recently, I am studying some topics related to product formula, and I am curious about how to implement such formula on real quantum devices. The $(2k)$-th order product formula can be witten as
\begin{equation}
S_{2}(\lambda):=\prod_{j=1}^L \exp\left(\frac{\lambda}{2}H_j\right)\prod_{j=L}^1 \exp\left(\frac{\lambda}{2}H_{j}\right)
\\
S_{2k}(\lambda):=S_{2k-2}(p_k \lambda)^2\,S_{2k-2}\left((1-4p_k)\lambda\right)\,S_{2k-2}(p_k\lambda)^2 \end{equation}
with $p_k:=1/(4-4^{1/(2k-1)})$. Within this product formula, there is a $p_k$ term, which is an irrational number when we use the higher-order product formula.
My question is: can quantum computers exactly implement irrational numbers in reality? If yes, how to control the quantum gate with the degree in the value of irrational numbers? If not, does it means that we cannot exactly implement the higher-order product formula on the current real quantum device?
"
"['algorithm', 'grovers-algorithm']"," Title: Can Grover's algorithm be used to search in a real database?Body: I'd like to start with saying sorry if my question makes no sense as I'm a physics student, but only in third year.
I've discovered Grover's algorithm, but what I'm not sure of is if it could be used as a real database or if it's for searching something like an array? For example if you had a database column of strings 8-chars long could you use Grover's algorithm to search for a match (let's say x='quantumc')?
Then my follow up question is would you need 64 logical qubits to make this calculation? (8 binary bits x 8 characters)
Thanks in advance!
"
"['qiskit', 'measurement', 'hadamard']"," Title: How does measurement change the effective transformation matrix?Body: I have simulated three cases in Qiskit and tried doing some manual calculations to verify the simulated results.
Case 1:
The initial state is $\psi_i = |00\rangle = \begin{Bmatrix}1 \\0 \\ 0 \\ 0\end{Bmatrix}$ and the transformation is $H_2 = H_1 \otimes H_1 = \frac{1}{2}\begin{bmatrix}1 & 1 &1 &1 \\1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1\end{bmatrix}$.
Therefore, the final state would be $\psi_f = \frac{1}{2} \begin{Bmatrix}1 \\1 \\ 1 \\ 1\end{Bmatrix}$.
This is matching with the simulation results.
Case 2:
Since the first qubit is being measured, the state of first cubit collapses to $|0\rangle$, and the second qubit undergoes Hadamard transformation, the effective transformation could be $H_1\otimes \begin{bmatrix}1 & 1 \\ 0 & 0\end{bmatrix}=\frac{1}{\sqrt{2}} \begin{bmatrix}1 & 1 & 1 & 1 \\0 & 0 & 0 & 0 \\ 1 & 1 & -1 & -1 \\ 0 & 0 & 0 & 0\end{bmatrix}$. Therefore, the final state could be $\psi_f = \frac{1}{\sqrt{2}} \begin{Bmatrix}1 \\0 \\ 1 \\ 0\end{Bmatrix}$.
This also is matching with the simulation results.
Case 3:
Since the first qubit is being measured, the state of first cubit collapses to $|0\rangle$, and the second qubit undergoes Hadamard transformation, the effective transformation could be $\begin{bmatrix}1 & 1 \\ 0 & 0\end{bmatrix}\otimes \begin{bmatrix}1 & 1 \\ 0 & 0\end{bmatrix}=\begin{bmatrix}1 & 1 & 1 & 1 \\0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0\end{bmatrix}$. Therefore, by following the same method, the final state should be $\psi_f = \begin{Bmatrix}1 \\0 \\ 0 \\ 0\end{Bmatrix}$. This is differing from the simulation results. The simulation is giving the final state to be $\psi_f = \begin{Bmatrix}0 \\0 \\ 1 \\ 0\end{Bmatrix}$. And the effective transformation matrix from the simulation seems to be $\begin{bmatrix}0 & 0 & 0 & 0 \\0 & 0 & 0 & 0 \\ 1 & 1 & -1 & -1 \\ 0 & 0 & 0 & 0\end{bmatrix}$, which is diffrent from the transformation matrix that I calculated.
Exactly where am I doing mistake in my calculations? And what is the correct method to find the effective transformation matrix of a system that involves post-measurement? Thanks.
"
"['quantum-gate', 'quantum-state', 'machine-learning']"," Title: Silicon and Germanium semiconductors mixture in quantum computingBody: Can Silicon and Germanium semiconductors mixture (chemical reaction) with some other chemical elements (if required) assist in creating new and existing robust electronic components?
Si + Ge + ? + ? =
Can this mixture assist in quantum computing?
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'universal-gates']"," Title: Circuit to show that Hadamard, phase, controlled- and Toffoli gates are universalBody: Part 1
The final output state is,
$|\psi_{out}\rangle=\frac{1}{4}[|00\rangle(3S+XSX)|\psi\rangle+|01\rangle(S-XSX)|\psi\rangle+|10\rangle(S-XSX)|\psi\rangle+|11\rangle(-S+XSX)|\psi\rangle]$
When the measurement outcomes are both 0 then the circuit applies $R_z(\theta)$ to the 3rd qubit where $\theta$ is such that $\cos\theta=3/5$, and otherwise applies $Z$ to the 3rd qubit, i.e.,
$$
(3S+XSX)|\psi\rangle=\sqrt{10}\begin{bmatrix}\frac{3+i}{\sqrt{10}}&0\\0&\frac{1+3i}{\sqrt{10}}\end{bmatrix}|\psi\rangle=\sqrt{10}e^{i\pi/4}R_z(\theta)|\psi\rangle
$$
$$
(S-XSX)|\psi\rangle=(\begin{bmatrix}1&0\\0&i\end{bmatrix}-\begin{bmatrix}i&0\\0&1\end{bmatrix})|\psi\rangle=\begin{bmatrix}1-i&0\\0&-1+i\end{bmatrix}|\psi\rangle=e^{-i\pi/4}\begin{bmatrix}1&0\\0&-1\end{bmatrix}|\psi\rangle=e^{-i\pi/4}Z|\psi\rangle
$$
The final output state can be rewritten as,
$|\psi_{out}\rangle=|00\rangle\frac{\sqrt{10}e^{i\pi/4}}{4}R_z(\theta)|\psi\rangle+(|01\rangle+|10\rangle-|11\rangle)\frac{e^{-i\pi/4}}{4}Z|\psi\rangle$
where $\theta$ is such that $\cos\theta=3/5$ and it is an irrational jultiple of $2\pi$
The probability that both measurement outcomes being 0 is $5/8$, i.e., $P(00)=\Big|\dfrac{\sqrt{10}e^{i\pi/4}}{4}\Big|^2=\dfrac{5}{8}$
Part 2
If you get any of the measurement results $01, 10$ or $11$, the output state is $Z|\psi\rangle$, then $Z$ is applied and the state is back to the initial state $|\psi\rangle$ and the circuit is repeated. If the measurement outcome is $00$ the output is $R_z(\theta)|\psi\rangle$ and the circuit is terminated.
After $k$ repetitions of the circuit the probability of success is, i.e., probability of obtaining $R_z(\theta)|\psi\rangle$,
$$
\frac{5}{8}+\frac{5}{8}.\frac{3}{8}+\frac{5}{8}.(\frac{3}{8})^2+\frac{5}{8}.(\frac{3}{8})^3+\cdots=\frac{5/8(1-(3/8)^k)}{1-3/8}=1-(3/8)^k
$$
which tends to $1$ as $k$ becomes large, i.e., we have a circuit which may be used to apply $R_z(\theta)$ gate with probability approaching $1$.
Using the above construction how do we show that the Hadamard, phase, controlled-NOT and Toffoli gates are universal for quantum computation ?
My thinking : Any single qubit unitary can be written as $R_z(\alpha)R_x(\beta)R_z(\gamma)$ upt an unimportant global phase factor, so if we can construct $R_x(\theta)$ from $R_z(\theta)$ then we can construct any unitary gate.
Refer to Exercise 4.43, Page 198, Quantum Computation and Quantum Information by Nielsen and Chuang
"
"['qiskit', 'circuit-construction', 'pauli-gates', 'hadamard']"," Title: Why isn't $Ry(\pi/2)$ gate equivalent to Hadamard gate?Body: I've been experimenting with quantum circuits and can't quite fathom how the difference between states comes together.
Speaking in terms of simulations using qiskit, the following code yelds the same results:
circuit = QuantumCircuit(1)
circuit.h(0)
state = Statevector.from_instruction(circuit)
display(plot_bloch_multivector(state, title="H", reverse_bits=False))
circuit = QuantumCircuit(1)
circuit.ry(0.5*np.pi,0)
state = Statevector.from_instruction(circuit)
display(plot_bloch_multivector(state, title="Y", reverse_bits=False))
According to this page, the H-Gate is equivalent to the following circuit:
The state vector remains the same, which makes sense as it's only rotating around the x-axis.
Even negating the initial qubit state and make it a $|1\rangle$ does not bring any difference to the table.
So, I went deeper and looked at the maths behind it. Applying the H gate to $|0\rangle$ results in:
$$
H|0\rangle =\ \begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} =\ \begin{pmatrix}\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}}\end{pmatrix} =\ \frac{|0\rangle + |1\rangle}{\sqrt{2}} =\ |+\rangle
$$
Now, using the RY-Gate, we can construct a matrix using $\frac{\pi}{2}$. This is where my understanding of the mathematical application stops tho, and I can't quite figure out how to do the rest of the calculation. This is as far as I've come, but I can't quite "translate" the result into a comparable qubit state:
$$
\begin{pmatrix} \cos(\frac{\pi}{4}) & -\sin(\frac{\pi}{4})\\
\sin(\frac{\pi}{4}) & \cos(\frac{\pi}{4})
\end{pmatrix}|0\rangle =\ \begin{pmatrix} 0.707 & -0.707\\
0.707 & 0.707\end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} =\ \begin{pmatrix} 0.707 \\ 0.707 \end{pmatrix}
$$
Reason for this question is that I am trying different circuits to classify IRIS for comparison, and I am seeing much better accuracy when using my basic Y-Rotation based circuit in comparison to qiskits ZZFeature and RealAmplitudes circuit.
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'universal-gates']"," Title: Prove a circuit with controlled $iR_x(\pi \alpha)$ is universal for quantum computation whenever $\alpha$ is irrationalBody:
Show that the three qubit gate $G$ defined by the circuit is universal for quantum computation whenever $\alpha$ is irrational.
My Observations
The unitary gate on the third qubit is activated only when the first two qubits are both in the state $1$.
$$
|\psi_{in}\rangle=|\psi_{1}\rangle\otimes|\psi_{2}\rangle\otimes|\psi\rangle=(a|0\rangle+b|1\rangle)\otimes(c|0\rangle+d|1\rangle)\otimes|\psi\rangle=(ac|00\rangle+ad|01\rangle+bc|10\rangle+bd|11\rangle)\otimes|\psi\rangle\\
=ac|00\rangle\otimes|\psi\rangle+ad|01\rangle\otimes|\psi\rangle+bc|10\rangle\otimes|\psi\rangle+bd|11\rangle\otimes|\psi\rangle
$$
$$
|\psi_{out}\rangle=ac|00\rangle\otimes|\psi\rangle+ad|01\rangle\otimes|\psi\rangle+bc|10\rangle\otimes|\psi\rangle+bd|11\rangle\otimes iR_x(\pi \alpha)|\psi\rangle
$$
We can also prove that arbitrarily fine approximations of all angles can be achieved using a rotation by an irrational multiple of $\pi$.
I have no clue on how this circuit can be used for universal quantum gate construction ?
Refer to Exercise 4.44, Page198, Quantum Computation and Quantum Information by Nielsen and Chuang
Thanks @Egretta.Thula for the link where @DaftWullie's answer says:
Firstly, imagine you start from a two-qubit state $|00⟩$, and apply an $R_x$ rotation with an angle equivalent to half that of a Pauli $X$ to the first qubit (I forget which convention N&C is using for their rotation gates). Then apply a controlled-not controlled off the first qubit and targeting the second qubit. Next, apply the inverse of the first rotation. Finally, measure the first qubit. If you get answer $|1⟩$, the second qubit is in the $|−⟩$ state. If it isn't, discard and repeat. So, we can produce the $|−⟩$ state. If you input this as the target qubit of the controlled-controlled-$R_x$ (of arbitrary rotation angle), and have one of the controls in the $|1⟩$ state, you get an arbitrary $Z$ rotation on the other control qubit.
So, we know we can do arbitrary $X$ and $Z$ rotations, meaning that you can make any single-qubit unitary. Combine that with controlled-not and you know you have universality.
This is not with any diagrams nor any equations and I do not get a clue of what it is suggesting to do ?
My Attempt
Imagine you start from a two-qubit state $|00⟩$, and apply an $R_x$ rotation with an angle equivalent to half that of a Pauli $X$ to the first qubit (I forget which convention N&C is using for their rotation gates). Then apply a controlled-not controlled off the first qubit and targeting the second qubit. Next, apply the inverse of the first rotation. Finally, measure the first qubit. If you get answer $|1⟩$, the second qubit is in the $|−⟩$ state
$$
M|00\rangle=\frac{i}{\sqrt{2}}\begin{bmatrix}1&-i\\-i&1\end{bmatrix}|00\rangle=\frac{1}{\sqrt{2}}[i|0\rangle+|1\rangle]\otimes|0\rangle=\frac{1}{\sqrt{2}}[i|00\rangle+|10\rangle]
$$
$$
M^{-1}[\frac{1}{\sqrt{2}}[i|00\rangle+|10\rangle]]=\frac{1}{2}[i(-i|0\rangle+|1\rangle)\otimes |0\rangle+(|0\rangle-i|1\rangle)\otimes|1\rangle]\\
=\frac{1}{2}[|00\rangle+i|10\rangle+|01\rangle-i|11\rangle]=\frac{1}{\sqrt{2}}[|0\rangle(\frac{|0\rangle+|1\rangle}{\sqrt{2}})+i|1\rangle(\frac{|0\rangle-|1\rangle}{\sqrt{2}})]\\
=\frac{1}{\sqrt{2}}[|0\rangle|+\rangle+i|1\rangle|-\rangle]
$$
"
"['qiskit', 'programming', 'quantum-enhanced-machine-learning']"," Title: How to perform multi-class classification with qiskit's VQC?Body: I am following the tutorial given in qiskit's website Neural Network Classifier and Regressor. In the first part, classification, the third section refers to qiskit's VQC library. Everything works fine with the given X and y where there are only two classes. I modified the X and y slightly to include four classes instead of two using the following lines:
num_inputs = 2
num_samples = 100
X = 2*np.random.rand(num_samples, num_inputs) - 1
y = np.random.choice([0,1,2,3], 100)
y_one_hot = np.zeros(( num_samples, 4 ))
for i in range(len(y)):
y_one_hot[i, y[i]]=1
The rest of the code is untouched. VQC with ZZFeatureMap, RealAmplitudes ansatz, cross_entropy loss function and COBYLA() optimizer.
However, when I try to fit with this new data, the classifier is only running for 5 iterations and the weights are not being changed at all. The loss or objection function's value is always calculated as "nan".
There is a similar question I had posted about weights not being optimized with VQC, but then I thought it was because of my data or VQC's configuration. After trying this example, I realised it is clearly to do something with multiple classes and not just the classifier's configuration.
Please shine light on how to do multi-class classification using the qiskit's VQC library.
"
"['qiskit', 'measurement', 'quantum-circuit']"," Title: Measuring in qiskit collapses onto the Z-Plane. Why do any rotations other than Y matter?Body: We have the situation where a 50/50 split between $|1\rangle$ and $|0\rangle$. This was done using a $H$-Gate. Now, when measuring in qiskit, if my understanding is correct, we collapse onto the Z-plane which then results in either a 0 or a 1.
So my question now would be, what's the practical usage of any rotation that isn't a Y-Rotation? As far as I can see, the Y-Rotation changes the amplitudes/probabilities of the measurement, where as a Z-Rotation does not.
"
"['quantum-gate', 'algorithm', 'simons-algorithm']"," Title: Why is the function operator used in Simon's algorithm unitary?Body: From the Qiskit textbook I read about Simon's algorithm.
There are two n-wide quantum registers, so the general state is given by
$$|x\rangle_n|y\rangle_n$$
where x and y are the $2^n-1$ binary representations.
A function from the n-subspace into n-subspace id defined by
$$f: |x\rangle\mapsto|f(x)\rangle$$
Now, the "query function" is given by the operation
$$|x\rangle|a\rangle \rightarrow |x\rangle |a \oplus f(x)\rangle$$
All building blocks in quantum computation shall be unitary transformations, so this mapping is unitary too - but how can I prove that this is really the case?
Is it enough to show, that norm is conserved like this:
Denoting
$$U|x\rangle|a\rangle = |x\rangle |a \oplus f(x)\rangle$$
I would have
$$\langle x| \langle a|U^\dagger = \langle x| \langle a \oplus f(x)|$$
so
$$\langle x| \langle a|U^\dagger U |x\rangle |a\rangle= \langle x|x\rangle \langle a \oplus f(x)|a \oplus f(x)\rangle = 1 \cdot 1 = 1$$
But this appears a bit too trivial to be a prove...
"
"['qiskit', 'programming', 'simulation', 'ibm']"," Title: Difference between Aer.get_backend('aer_simulator') and AerSimulator()Body: In Qiskit, there are several ways to choose simulator: one is
from qiskit import Aer
backend = Aer.get_backend('aer_simulator')
result = backend.run(circ).result()
another one is
from qiskit.providers.aer import AerSimulator
backend = AerSimulator()
result=backend.run(circ).result()
,where circ is QuantumCircuit(n). Do they always return the same result?
"
"['algorithm', 'shors-algorithm']"," Title: State of the art values for Shor algorithm depth and number of qubits on Clifford+T basis with arbitrary connectivityBody: I am trying to find the state of the art results in term of number of logical qubits and depth for the Shor factoring algorithm on the Clifford+T basis.
I don't want to assume anything about the error correcting code used, let's say I have my "own way" of doing the gates (so I don't want to assume restricted connectivity). I also want concrete numbers and not asymptotic behaviors.
There are many papers discussing it but what is frequent is that they either provide asymptotic behaviors instead of concrete number, either they provide the number of logical qubits and $T$ gates but not the algorithm depth, either they assume a nearest neighbor connectivity for the logical qubits.
For instance, I found out a recent paper on the topic, but it assumes nearest neighbor connectivity and doesn't provide the algorithm depth.
Would it be a fair assumption to consider that the number of Toffoli+T/2 gates provided in this paper (i) is a fair estimation of the total number of logical gates $N_{\text{gates}}$, (ii) can be highly parallelized such that the number of logical qubits $N_{\text{qubits}}$ verifies:
$$N_{\text{qubits}} \times Depth \approx N_{\text{gates}}$$
Because if so I could easily estimate the depth knowing $ N_{\text{gates}}$ and $N_{\text{qubits}}$ from this paper.
"
"['entanglement', 'quantum-operation', 'locc-operation']"," Title: What are examples of ""LOCC linked"" quantum instruments?Body: Define a quantum instrument $\mathfrak J$ as a collection of completely positive (CP) maps $(\mathcal E_j:j\in\Theta)\subset\mathrm{CP}(\mathcal H)$, such that $\sum_j \mathcal E_j$ is also trace-preserving (and thus a channel/CPTP map).
Denote the set of all such quantum instruments with $\mathrm{CP}[\Theta]$.
As explained in (Chitambar et al. 2012), quantum instruments can be used to define the different classes of LOCC instruments. More precisely, they say that an instrument $\mathfrak J'$ is LOCC linked to $\mathfrak J\equiv(\mathcal A_1,\mathcal A_2,...)$ if there exists a collection of one-way local instruments $\{\mathfrak J_j^{(K_j)}=(\mathcal B_{1|j},\mathcal B_{2|j},...): j=1,2,...\}$ such that $\mathfrak I'$ is a coarse-graining of the instrument with CP maps $\mathcal B_{j'|j}\circ\mathcal A_j$.
Here, an instrument $\mathfrak J^{(K)}=(\mathcal F_1,\mathcal F_2,...)$ is called one-way local with respect to a party $K$ if each of its CP maps has the form $\mathcal F_j=(\bigotimes_{J\neq K}\mathcal T_j^{(J)})\otimes \mathcal E_j^{(K)}$ where $\mathcal E^{(K)}$ is a CP map on $\mathcal B(\mathcal H^{A_k})$, and for each $J\neq K$, $\mathcal T_j^{(J)}$ is some trace-preserving CP map.
While formally precise, this definition is quite abstract and a bit hard to parse; some examples would probably make it much easier to digest.
What are some examples of LOCC-linked quantum instruments? Examples of instruments in some $\mathrm{LOCC}_r$ class, and outside of them, would also both be appreciated.
"
"['qiskit', 'programming', 'ibm-q-experience', 'textbook-and-exercises']"," Title: Solving Particle in Box problem using QiskitBody: I am new to quantum computing, I would like to ask how can I solve simple particle in box problem using qiskit which allows to compute the bound states in finite quantum well.
Finite quantum well
"
"['quantum-circuit', 'matrix-representation']"," Title: Understanding Constant Multiplication Circuit for Binary Field - How to Construct Quantum Circuit from Linear MappingBody: I was thinking to ask this on Math Stackexchange, but maybe here would be better since I also hope the answers also explain from quantum computation context.
Problem
So I was reading the paper "Concrete quantum-cryptanalysis of binary elliptic curves", and I got stuck in understanding how to construct a multiplication by constant circuit for binary field. In their CHES presentation and their other paper, the authors describe that it is easy to construct the circuit from a matrix since multiplication by constant is just a linear mapping.
On their other paper, they present this matrix as a representation of multiplication by $1 + x^2$ modulo $1 + x + x^4$:
$\Gamma = \begin{bmatrix}
1 & 0 & 1 & 0 \\
0 & 1 & 1 & 1 \\
1 & 0 & 1 & 1 \\
0 & 1 & 0 & 1
\end{bmatrix} $
which by LUP decomposition, corresponds to this circuit:
Questions
The questions are interrelated. They are:
1. How to construct matrix $\Gamma$?
2. Why the multiplication matrix is a 4x4 matrix for a 4-qubit circuit? I thought it would be 16x16 $(2^n = 16)$?
3. Is that particular matrix ($\Gamma$) really correct for all values?
My Attempts So Far
For Question 1
My guess is by creating two matrices, e.g., $INPUT$ and $OUTPUT$, which includes all possible inputs and the corresponding output after the constant multiplication. Then, the matrix $\Gamma$ can be obtained from $OUTPUT * INPUT^{-1}$.
I have tried from scratch: calculated all the possible 16 input and the corresponding output pairs (derived from SageMath) and make the mapping (i.e., $\left| x0,x,x^2,x^3 \right> = \left| 0010 \right> \rightarrow \left| 1110 \right>, \left| 0100 \right> \rightarrow \left| 0101 \right>$, and so on...
However, then I realized that the resulting matrix is a rectangular 16x4 matrix rather than a square matrix for each $INPUT$ and $OUTPUT$, so the inversion can not be done when I tried that on Matlab.
For Question 3
For each possible input, I applied $\Gamma$ to verify the output result. While 6 of them are correct, the other 10 are wrong. For example, $\left| 1011 \right> \rightarrow \left| 2231 \right>$ rather than $\left| 0011 \right> $.
I am not sure that kind of paper would contain such errors. So my bet is my approach was all wrong.
I would be very grateful if anyone could guide me on this. Any help is appreciated. Thanks!
"
"['machine-learning', 'quantum-enhanced-machine-learning', 'artificial-intelligence']"," Title: Is quantum machine learning faster than classical machine learning (at the moment)?Body: We all know that quantum computing is rapidly developing and somehow being used in the AI field. However, it seems like there's no specific comparison between quantum machine learning (could be deep learning) and classical machine learning.
D-wave has a quantum computer (annealer) and own library as well as pennylane (Xanadu) and IBM, even Google. My question is "are these devices really run hybrid or quantum machine learning?".
"
"['quantum-gate', 'physical-realization']"," Title: How to implement gate which is like Identity but multiplied on ""i""Body: In my program I need a single qubit processing gate which implements logic like this:
|0> ==> i*|0>
|1> ==> i*|1>
This is like Identity gate but multiplied on "i"
I belive that conversion matrix 2x2 should be like this:
i, 0
0, i
But do not know if such gate exists.
How to implement it is qiskit program or in IMB quantum composer?
Can this be possible?
"
"['qiskit', 'programming', 'quantum-state', 'state-preparation']"," Title: How to create known quantum state in Qiskit (or any other platform) comprising of two or more bits?Body: Is there there any way to create a known quantum state in Qiskit (or any other platform) comprising of two or more than two bit?
For example if I want to create $\frac{1}{\sqrt{3}}[|00\rangle+|01\rangle+|11\rangle]$. What I want to do is to know the unitary transformation ( or the quantum circuit) to prepare this (or any valid) quantum state for me.
"
"['entropy', 'semidefinite-programming', 'cvx']"," Title: Linear and Logarithmic Constraint in Semidefinite ProgrammingBody: I am trying to minimize the largest component of a vector $x = [x_1, x_2, x_3, x_4]$, where $x_1 \ge x_2 ... \ge x_4$, such that it satisfies a set of linear inequalities $A, b$ in the following way:
$$
Ax \le b.
$$
Furthermore, I want that, the Shannon entropy of the vector $x$ satisfies the following:
$$
-\sum_i x_i \log_2(x_i) = q,
$$
for some constant $q$.
I can write the following for the first constraint:
cvx_begin sdp
variable x(4, 1)
minimize x(1)
subject to
A * x <= b
cvx_end
However, when I try to include the second constraint, like:
quantum_entr(diag(x)) == q.
I get the following error:
Invalid constraint: {concave} == {real constant}
Is there a way to mix these two types of constraints in a semi-definite program? Thanks!
"
"['algorithm', 'hamiltonian-simulation', 'phase-estimation']"," Title: Why does Hamiltonian simulation seek to find the energy minimum, if eigenvalues of unitaries are always unimodular?Body: I know I am wrong here and trying to find out where I am making a logical mistake. I'd appreciate it if you can help me untangle.
A. We know that the eigenvalues of Unitaries are all unimodular (length = 1)
B. we know that Quantum circuits/operator has to be unitaries ( for the closed system)
C. Also, I believe one of the objectives of Hamiltonian simulation is to find out the energy minimum, which is the eigenvalue of the eigenstate.
So, we do implement the Unitary circuits to represent Hamiltonian (exponentiation of Paulis) to find this eigenvalue but we know it is "1" from the A above.
I know I am wrong but not clear where and how.
"
"['qiskit', 'noise', 'depolarizing-channel']"," Title: How to differientate the noise functions in qiskit?Body: In Qiskit, there are many different Quantum Error Functions.
From my understanding, pauli_error represents the error rate of $X, Y, Z$ independently, and deplolarizing_error is a combination of these Pauli operators. Is it correct? Are the two channels belong to incoherent errors?
Moreover, can phase_damping_error and amplitude_damping_error be regarded as $Z$ and $X$ errors respectively? Are they coherent or incoherent errors?
"
['mathematics']," Title: Why are orthogonal spins $(1,0)$ and $(0,1)$ represented as collinear vectors in the Bloch sphere?Body: I'm reading the book "Quantum Computing 4 real IT people" by Chris Bernhardt and I have a question about the following phrase in chapter 3 which says that
An ordered orthonormal basis corresponds to measuring the spin in the
vertical direction and is specified by a pair of vectors (1; 0) and
(0; 1). The first vector in the basis corresponds to an electron with
spin N (North) in the direction of 0°, and the second vector - to an
electron with spin S (South) in the direction of 0°.
But I don't understand how that could be possible... Because the 1st basis vector (1; 0) has horizontal direction and the 2nd basis vector (0; 1) has a vertical direction (in usual Cartesian coordinate system):
"
['quantum-gate']," Title: How to get half-way gate of a two-qubit quantum gate?Body: If I have a quantum gate, how can I get the gate that represents half-way of that gate? As an example of what I want:
How do I derive $\sqrt {SWAP} $ gate
$$\sqrt {SWAP} = \left( {\matrix{
1 & 0 & 0 & 0 \cr
0 & {{{1 + i} \over 2}} & {{{1 - i} \over 2}} & 0 \cr
0 & {{{1 - i} \over 2}} & {{{1 + i} \over 2}} & 0 \cr
0 & 0 & 0 & 1 \cr
} } \right)$$
from $SWAP$ gate?
$$SWAP = \left( {\matrix{
1 & 0 & 0 & 0 \cr
0 & 0 & 1 & 0 \cr
0 & 1 & 0 & 0 \cr
0 & 0 & 0 & 1 \cr
} } \right)$$
"
"['quantum-operation', 'unitarity', 'trace-distance', 'diamond-norm', 'purification']"," Title: Closeness of unitary dilations of CPTP mapsBody: Let $\Phi_1,\Phi_2 \colon S(\mathcal{H}) \to S(\mathcal{H})$ be CPTP maps on the same Hilbert space $\mathcal{H}$ which are $\varepsilon$-close in diamond norm, and let $U_1,U_2$ be respective unitary dilations on some larger space $\mathcal{H} \otimes \mathcal{K}$ (i.e. so that $\mathrm{Tr}_{\mathcal{K}}(U_i (\rho \otimes |0\rangle\langle0|) U_i^{\dagger}) = \Phi_i(\rho)$).
Now let $A$ be a unitary operating on $\mathcal{H}$, and let $$\rho_i := \mathrm{Tr}_{\mathcal{K}}(U_i^{\dagger} (A \otimes I_{\mathcal{K}}) U_i (\rho \otimes |0\rangle\langle0|) U_i^{\dagger} (A^{\dagger} \otimes I_{\mathcal{K}}) U_i).$$
That is, $\rho_i$ is obtained from $\rho$ by applying $U_i$, then $A$, then $U_i^{\dagger}$, then tracing out $\mathcal{K}$. Since all dilations are equivalent up to a local unitary, $\rho_i$ does not depend on the choice of $U_i$. Can we bound $\| \rho_1 - \rho_2 \|_1$?
I have tried to get a bound from results on the distance between Stinespring isometries, but this seems to not be enough here.
"
"['quantum-gate', 'quantum-state', 'textbook-and-exercises', 'linear-algebra', 'trace']"," Title: Show that $\langle v,O(v)\rangle= \mathrm{tr}(O|v\rangle\langle v|)$ for $v \in V$Body: I have a question regarding this exercise:
Let O be an observable on V. Show that $\langle v,O(v)\rangle= \mathrm{tr}(O|v\rangle\langle v|)$ for $v \in V$.
I thought that this exercise is quite easy because I thought I can use the fact that we define $|v\rangle\langle v|$ as density operator. Any other ideas or is my idea the right one?
"
"['information-theory', 'entropy', 'mutual-information', 'quantum-discord']"," Title: What does a quantum mutual information larger than its classical upper bound represent?Body: Let $\rho$ be a bipartite state. Its quantum mutual information is defined as
$$\newcommand{\tr}{\operatorname{tr}}I(\rho) = S(\tr_B(\rho)) + S(\tr_A(\rho)) - S(\rho),$$
where $S(\sigma)$ is the von Neumann entropy of $\sigma$.
If $\rho$ is pure, then it's easy to see that $I(\rho)=2S(\tr_A(\rho))$.
If $\rho$ is also maximally entangled, then $I(\rho) = 2\log d$, with $d$ the dimension of the underlying space. This can also be written as $I(\rho)=2$, taking base-$d$ logarithms.
Now, let $\mu^A,\mu^B$ be some measurements for the first and second party. These will correspond to a joint probability distribution $p(a,b;\rho)\equiv \langle\mu^A_a\otimes\mu^B_b,\rho\rangle$. Let $p,p^A,p^B$ denote the corresponding probability distribution, and its two marginals, respectively. If $X,Y$ denote the random variables describing the corresponding outcomes, we can define a classical mutual information as
$$I_{\mu}(\rho) \equiv I(X:Y)\equiv
H(p^A) + H(p^B) - H(p),$$
with $H(p)$ the (classical) Shannon entropy of the probability distribution $p$.
Note that the maximum value of the classical mutual information, obtained for fully correlated variables, is $\log d$ (without the factor of $2$).
When $I(\rho)=2\log d$, and thus $\rho$ is maximally entangled, the parties can observe correlations in infinitely many (projective) measurement bases: for any choice of measurement basis for $A$, there is a choice of measurement basis for $B$ which gives fully correlated outcomes.
On the other hand, $I(\rho)=\log d$ can be obtained with the fully correlated mixed state: $\rho=\frac{1}{d}\sum_i |ii\rangle\!\langle ii|$, but said correlation can only be observed with a fixed choice of basis: unless the parties measure both in the computational basis, their outcomes won't be fully correlated.
Is the above intuition of any value in this context? In other words, can one think of the quantum mutual information being larger than its classical upper bound as being linked to the possibility of observing correlations in multiple measurement bases? Or is it just a red herring?
"
"['programming', 'error-correction', 'stim']"," Title: Measurement bitstrings to detection event bitstrings in stimBody: Does Stim have exposed functionality for converting a measurement outcome string into a detection event string?
I.e. I feed stim a string of 0,1's corresponding to measurements in a circuit along with the circuit itself, and it spits out a string of 0,1's corresponding to the detection events in that circuit? Of course this functionality exists under the hood, but just wondering where and how it's accessible.
"
"['qiskit', 'measurement', 'simulation', 'matrix-representation', 'linear-algebra']"," Title: Calculating measurement probabilities from a quantum circuitBody: Currently I'm trying to calculate the circuits I'm building and show that they work as intended. Somehow, my measurments do not, at all, represent my calculated expectancies. This is my circuit in qiskit:
┌───────────┐┌──────────┐
q_0: ┤ Ry(alpha) ├┤ Ry(beta) ├
└───────────┘└────┬─────┘
q_1: ──────────────────■──────
Both qubits start off in the $|0\rangle$ state. So, the first calculation applies only to $q_0$, which looks like this:
$$
RY(\theta) = \begin{pmatrix}
\cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2}
\end{pmatrix}\\
$$
$$
q_0 =\ RY(\theta)|0\rangle =\ \begin{pmatrix}\cos\frac{\theta}{2} \\ \sin\frac{\theta}{2}\end{pmatrix}\\
$$
After this, I have to get the tensor product of both qubits, which results in this:
$$
\begin{pmatrix}\cos\frac{\alpha}{2} \\ \sin\frac{\alpha}{2}\end{pmatrix} \otimes \begin{pmatrix}1 \\ 0\end{pmatrix} =\
\begin{pmatrix} \cos\frac{\alpha}{2} \\ 0 \\ \sin\frac{\alpha}{2} \\ 0\end{pmatrix}\\
$$
So far, so good. Now, I take the CRY-Gate and its matrix (as given here), and multiply it:
$$
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\
0 & 0 & \sin\frac{\theta}{2} & \cos\frac{\theta}{2}
\end{pmatrix} \begin{pmatrix} \cos\frac{\alpha}{2} \\ 0 \\ \sin\frac{\alpha}{2} \\ 0\end{pmatrix} =\ \begin{pmatrix} \cos\frac{\alpha}{2} \\ 0 \\ \cos\frac{\beta}{2}\sin\frac{\alpha}{2} \\ \sin\frac{\beta}{2}\sin\frac{\alpha}{2}\end{pmatrix}\\
$$
This shows that in a simulation, I have a given probability of getting either $|00\rangle$, $|10\rangle$ or $|11\rangle$ . Yet, this is what happens:
#prepare circuit
circuit = QuantumCircuit(2)
circuit.ry(Parameter('alpha'),0)
circuit.cry(Parameter('beta'),1,0)
#add parameters and measure
parameterized_circuit = qc.bind_parameters(parameters)
parameterized_circuit.measure_all()
#prepare simulation
simulator = QasmSimulator()
compiled_circuit = transpile(parameterized_circuit, simulator)
#run, get counts and visualize
job = simulator.run(compiled_circuit, shots=10000)
result = job.result()
counts = result.get_counts(parameterized_circuit)
display(plot_histogram(counts))
No matter the parameters used, I never get a single $|11\rangle$ state. For exmaple, using the parameters
[np.pi/2, 3*np.pi/4]
results in the following histogram:
Somehow I am thinking that my calculations are wrong, but am not sure. Specially considering that I've done the same thing with $CRY(\theta)$ inversed (so, control qubit is $q_0$ and target is $q_1$), and the results are the same.
"
"['quantum-gate', 'gate-synthesis']"," Title: Circuit including phase factor in $XY(\beta, \theta)$ gateBody: In Implementation of the XY interaction family with calibration of a single pulse, the $XY(\beta, \theta)$ gate is defined as
$$
XY(\beta, \theta) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos(\theta/2) & i\sin(\theta/2)e^{i\beta} & 0 \\ 0 & i\sin(\theta/2)e^{-i\beta} & \cos(\theta/2) & 0 \\
0 & 0 & 0 & 1 \end{pmatrix}
$$
Later on, they simplify it so that $\beta$ defaults to $0$ and therefore the following decomposition can be used to build the gate:
from qiskit import QuantumCircuit
import numpy as np
qc = QuantumCircuit(2)
qc.rz(-np.pi/2, 0)
qc.sx(0)
qc.rz(np.pi/2, 0)
qc.s(1)
qc.cx(0, 1)
qc.ry(theta/2, [0, 1])
qc.cx(0, 1)
qc.sdg(1)
qc.rz(-np.pi/2, 0)
qc.sxdg(0)
qc.rz(np.pi/2, 0)
However, I'm interested in also being able to control the phase factor in the two off diagonal center elements. I tried doing controlled-phase gates surrounded with $X$ gates to add phase to $|01\rangle$ and $|10\rangle$ but adds a phase to everything in the central four elements, plus it's costly.
Does anyone have a reference or know a way to implement the two-parameter $XY(\beta, \theta)$ gate that, hopefully, only requires the two $CX$ gates from the $\beta=0$ case or at least doesn't add a lot more $CX$ gates to the original circuit?
"
"['programming', 'ibm-q-experience', 'simulation', 'qasm']"," Title: How can I get the results from simulating noise models?Body: I'm trying to run some simulations of my quantum circuits using qasm simulator. I first tried to import the noise data from a quantum device and then use that information on qasm. Here's part of my code:
provider = IBMQ.load_account()
backend = provider.get_backend('ibmq_casablanca')
noise_model = NoiseModel.from_backend(backend)
coupling_map = backend.configuration().coupling_map
basis_gates = noise_model.basis_gates
result = execute(circ, Aer.get_backend('qasm_simulator'),
coupling_map = coupling_map,
basis_gates = basis_gates,
noise_model = noise_model).result()
When I return type(result), it seems like the code is working, but I could not get any counts from here. It returns me QiskitError: 'No counts for experiment "0"' as I attempted counts = result.get_counts(0). I wonder am I really running the simulation? How can I get the counts? Thanks for the help!
"
['quantum-gate']," Title: How to decompose square root SWAP gate in MathematicaBody: The Quantum Mathematica add-on package is a very good tool to implement quantum gates. It contains gates as shown in this figure.
How to use these gates to decompose square root SWAP gate?
"
"['qiskit', 'programming', 'ibm-q-experience', 'postselection']"," Title: How to select the statevetor of a qubit in a multiqubit circuit in qiskit?Body: I need to use and plot the state of the first qubit in my multiqubit circuit,
but the issue is that I need to use post selection - I want only the results of which the other qubits in the circuit are 0.
for example, for this circuit:
I need to run it a few times, and see the statevector of qubit 0 for the case where qubit 1 is measured 0.
Is there a way to do it?
Thanks!
"
"['quantum-gate', 'ibm', 'teleportation']"," Title: Strange behaviour of IdentityGate IGate in IBM Q ComposerBody: Can anyone explain the strange impact of the IGate in the enclosed quantum teleportation setup in view of the computational basis states? Any help is welcome!
"
"['algorithm', 'nielsen-and-chuang', 'phase-estimation']"," Title: Phase estimation algorithm: Modulo part in Nielsen and ChuangBody: In Nielsen and Chuang the explanation of phase estimation states:
We have the following state:
$$\frac{1}{2^{t/2}} \sum\limits_{k=0}^{2^t-1} e^{2 \pi i \varphi k}|k\rangle$$
Now we apply the inverse Fourier transform to it and get:
$$\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 \quad\text{(5.23)}$$
Now the following assumption is made, or the following is stated: "Let $\alpha_l$ be the amplitude of $|(b+l)(\text{mod }2^t)\rangle$", thus we now obtain:
$$\alpha_l \equiv \frac{1}{2^t} \sum\limits_{k=0}^{2^t-1} \left(e^{2\pi i(\varphi - (b+l)/2^t)}\right)^k \quad\text{(5.24)}$$
My first question is, how does one come to say that "Let $\alpha_l$ be the amplitude of $|(b+l)(\text{mod }2^t)\rangle$" is valid? Specifically, I am interested in how one comes up with the modulo part.
My second question then refers to the last equation, how does the transition from equation 5.23 to equation 5.24 occur?
I hope my question is understandable so far.
"
"['measurement', 'physical-realization']"," Title: What are useful abstraction levels for external quantum input/output of quantum computers?Body: Section "2.2.3 Quantum measurement" in Nielsen&Chuang uses very general measurement axioms:
Postulate 3: Quantum measurements are described by a collection $\{M_m\}$ of measurement operators. These are operators acting on the state space of the system being measured. The index $m$ refers to the measurement outcomes that may occur in the experiment. If the state of the quantum system is $|\psi\rangle$ immediately before the measurement then the probability that result $m$ occurs is given by
$$p(m) = ⟨ψ|M_m^\dagger M_m|ψ⟩ ,\qquad(2.92)$$
and the state of the system after the measurement is ...
In fact, I am not aware of any introductory quantum mechanics textbook using comparably general axioms. So I wondered why they did this, and how this might be related to the fact that it is a book on quantum computers:
Indeed, interaction is central. But what would happen if it were an interaction between a quantum sensor of a quantum computer instead of an interaction with a classical measurement device? The quantum computer might do some processing of the sensor input on the quantum level, and in the end, could output a combination of classical measurement results and special quantum output states. ...
Since here the output of the quantum computer was a combination of classical and quantum information, it makes sense to assume that the input too can be a combination of classical and quantum information. The difference is that quantum information cannot be cloned, while classical information can be copied at will and even be permanently recorded.
Quantum Computation and Quantum Information by Michael Nielsen and Isaac Chuang present axioms for quantum mechanics (and especially measurements) which fit well to the possible outputs of such a combination of quantum sensors with a quantum computer described above. ...
I really liked the idea of a quantum computer directly reading out a quantum sensor without forcing a classical measurement first. But then I started to wonder whether it is really that simple, even on a conceptual level. A quantum computer is still a "digital" device, in a certain sense (also with respect to its time evolution). On the other hand, the raw quantum output of a quantum sensor probably still lives in continuous time, and also might still be "analog". Discretizing the "analog" part should be no problem on a conceptual level, but I struggle to find the right abstraction level for the conversion from continuous time (because I want to avoid forcing a classical measurement). And I also wonder whether there might be even more "non-digital" quantum properties that must be taken into account for conversion before the raw quantum output can be fed into a quantum computer.
Edit A preprint from Dec 1 uses the imagery of this question already in its abstract:
An experimental setup that transduces data from a physical system to a stable quantum memory, and processes that data using a quantum computer, could have significant advantages over conventional experiments in which the physical system is measured and the outcomes are processed using a classical computer.
(The most important difference to the imagery in this question is the stable quantum memory and how it is used, which is central to that preprint and its predecessors.) The preprint itself doesn't answer my question, but some of its references look promising, especially the survey paper "Perspectives on quantum transduction". It reviews quantum transduction between microwave and optical photons. This is the sort of thing I struggle with "for the conversion from continuous time", because the (continuous) time modulation of the phase is so different between microwave and optical frequencies. (In my imagery, a classical computer uses a low pass filter in its analog to digital converter, but I am neither sure whether there is a purely quantum analog to a low pass filter, nor whether it would even help.)
"
"['programming', 'qasm']"," Title: QASM Files on Jupyter NotebookBody: Is it possible to run qasm files on jupyter notebook (like with the qasm_simulator)?
I downloaded one code file and I would like to play around with it on jupyter notebook.
"
"['qiskit', 'quantum-state', 'ibm-q-experience', 'circuit-construction', 'hamiltonian-simulation']"," Title: Eigenvalues and energy levels of 1D Heisenberg model using real Quantum Computers?Body: The 1D Quantum Heisenberg model is
$$H_\textrm{Heisenberg} = -~J \sum_{\langle i\ j\rangle} \hat{S}_{i} \cdot \hat{S}_{j}$$
where each spin is an operator.
For simple cases, for example, a system with only 3 spins or 5 spins, how to get eigenvalues (energy levels) of Hamiltonian of this system using existing real Quantum Computers? (either IBM QC or QC on Amazon brakets, which supports: D-Wave, IonQ, or Rigetti QC.)
I searched online, and some articles talked about how to build quantum circuits for the Hamiltonian, but I did NOT know how to get eigenvalues of those Hamiltonian.
"
"['quantum-gate', 'circuit-construction']"," Title: Implement a square root of Swap gate in using qiskitBody: Does the √SWAP gate have a ready-to-use function on the Qiskit circuit library?
If not, how to implement it?
"
"['quantum-state', 'circuit-construction', 'quantum-circuit']"," Title: How to determine the basis state with maximum amplitude without measurement?Body: Suppose I have two quantum registers described respectively by the quantum states $| \psi_1 \rangle = \sum_i \alpha_i |i \rangle$ and $|\psi_2 \rangle = |0\rangle$. I would like to implement a CNOT gate where the target is $|\psi_2\rangle$ and the control is the basis state $| i \rangle$of $|\psi_1\rangle$ with the higher $|\alpha_i|^2$.
Is there some primitive I can use?
"
"['nielsen-and-chuang', 'quantum-fourier-transform', 'phase-estimation']"," Title: Formulation of quantum phase estimation in Nielsen and Chuang is different then from other sources?Body: In a chapter of Quantum Computation and Quantum Information by Nielsen and Chuang (10th edition) about quantum phase estimation I get a little confused. Namely:
Before applying inverse QFT our quantum state is:
$$
\frac{1}{2^{t/2}}(|0\rangle + e^{2\pi i 2^{t-1} \phi}|1\rangle)(|0\rangle + e^{2\pi i 2^{t-2} \phi}|1\rangle)...(|0\rangle + e^{2\pi i 2^{0} \phi}|1\rangle)
$$
This later is said to be equivalent to
$$
\frac{1}{2^{t/2}}(|0\rangle + e^{2\pi i 0.\phi_t}|1\rangle)(|0\rangle + e^{2\pi i 0.\phi_t\phi_{t-1}}|1\rangle)...(|0\rangle + e^{2\pi i 0.\phi_t\phi_{t-1}...\phi_0}|1\rangle),
$$
where $0.\phi_t\phi_{t-1}...\phi_0 = \phi_t * 2^{-1} + ... + \phi_0 * 2^{-t}$. I don't really get the transition, don't we need some $2^{-t}$ in the exponent to get from $2\pi i 2^{t-1} \phi$ to $2\pi i 0.\phi_t$ etc.
Also, I have read about quantum phase estimation in Qiskit documentation and Wikipedia and there the result after applying inverse QFT is clearly stated to be $2^t \phi$ whereas Nielsen and Chuang seem to imply that we get directly $\phi$.
Is it just a mistake in the book or am I missing something?
"
"['qiskit', 'programming', 'qaoa', 'qubo']"," Title: Correct implementation of Qiskit QAOABody: I've been dealing with a QAOA implementation of a QUBO problem. In order to do this, I converted my QUBO matrix to a QuadraticModel. Once done, I have used Hamiltonian, offset = mdl.to_ising() to generate a Hamiltonian and offset, with mdl being my QuadraticProgram.
Once done, I went on to verify theoretically that the ground state energy of this Hamiltonian tallies with results an annealer. In order to do this, I used:
min_val = NumPyMinimumEigensolver(Hamiltonian)
Sure enough, this matches. The ground state energy when added with the offset value brings the value to 0. Now when I am trying to implement a QAOA, I use the following lines of code. I am aware that I am using deprecated code but I'm not sure this contributes to the problem.
aqua_globals.random_seed = np.random.default_rng(123)
seed = 10598
backend = Aer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, seed_simulator=seed, seed_transpiler=seed)
qaoa = QAOA(quantum_instance=quantum_instance, p = 1)
qaoa_optimizer = MinimumEigenOptimizer(qaoa)
result = qaoa_optimizer.solve(mdl)
This gives me optimal function value: 2.0 which isn't the result I am looking for.
I think I'm going wrong somewhere in the implementation of the QAOA, but I'm not sure where. Any help in this regard would be absolutely stellar!
"
"['quantum-state', 'error-correction', 'bb84', 'key-distribution']"," Title: Doubt in CSS error correction stepBody: At the end of page 3 in Simple proof of security of the BB84 QKD, the following equation (equation 4) is given :
$$
\begin{array}{r}
\frac{1}{2^{n}\left|C_{2}\right|} \sum_{z}\left[\sum_{w_{1}, w_{2} \in C_{2}}(-1)^{\left(w_{1}+w_{2}\right) \cdot z}\right.
\left.\times\left|k^{\prime}+w_{1}+x\right\rangle\left\langle k^{\prime}+w_{2}+x\right|\right] \\
=\frac{1}{\left|C_{2}\right|} \sum_{w \in C_{2}}\left|k^{\prime}+w+x\right\rangle\left\langle k^{\prime}+w+x\right|
\end{array} \tag{4}
$$
where $z$ is used for phase error syndrome measurement and $x$ is for bit error syndrome measurement for the CSS code $Q_{x,z}$.
I am not sure how the equality of the above equation follows by averaging over $z$. Can you provide me with some argument or result that is used for the above equality?
"
"['algorithm', 'grovers-algorithm']"," Title: Grover search with multiple solution implementation strategyBody: I am confused about how to implement a strategy for Grover's search with multiple solutions. My goal is to find all $t$ solutions in $N$ elements. I got this question because I found people used query complexity $O(\sqrt{Nt})$ for analyzing algorithms.
There are two conditions: changed Oracle or constant Oracle. If the Oracle is not modified, the cost of finding each solution is $O(\sqrt{\frac{N}{t}})$. In this case, the total complexity is $O(\sqrt{Nt})$, which makes sense to me. However, if we use a different strategy, that is changing the Oracle so that the Grover's search will not find a found element, the total complexity is $O(\sqrt{\frac{N}{t}})+O(\sqrt{\frac{N}{t-1}})+...+O(\sqrt{N})$. This total complexity cannot be bounded by $O(\sqrt{Nt})$.
However, there is a problem for a constant Oracle: Suppose we have 10 elements, and 0,1,2,3 are solutions. Firstly, Grover's search returns a true solution (assume 0 in the first round). In the second and the third round, let's assume the subroutine returns 1 and 2, respectively. The problem may occur in the fourth step: The algorithm still returns a value in [0,1,2], so the subroutine believes there is no more solution and stops. Finally, this subroutine only finds 3 solutions instead of 4.
Is there any idea to tackle this problem? I want to get an strategy to get all t solutions in $O(\sqrt{Nt})$ time.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: What conditions on the coefficients of a bipartite pure state imply it being entangled?Body: With $\{ |e\rangle_j \}_{j=1}^{dim. \mathcal{H}_A}$ for $\mathcal{H}_A$ and $\{|f\rangle_j \}_{j=1}^{dim. \mathcal{H}_B}$ for $\mathcal{H}_B$, the product state reads
\begin{equation}
|u\rangle \otimes |v\rangle = \left(\sum\limits_{j} a_j |e\rangle_j \right) \otimes \left(\sum\limits_{k} b_k |f_k\rangle \right) = \sum\limits_{j,k} a_j b_k |e_j\rangle \otimes |f_k\rangle,
\end{equation}
where $a_j$, $b_k$ are complex number.
What is the expalaination of the following statement:
If the vectors $|u\rangle$ and $|v\rangle$ do not belong to the respective orthonormal bases then there are at least two coefficients $a_j$ and
similarly at least two coefficients $b_k$. From this, we conclude that the state is entangled.
Edit: Here is the original version from the book The Mathematical Language of Quantum Theory by Mário Ziman and Teiko Heinosaari (Chapter 6).
"
"['algorithm', 'nielsen-and-chuang', 'phase-estimation']"," Title: Phase estimation algorithm: Bounding of probability in Nielsen and ChuangBody: I am currently studying the Quantum Phase Estimation (QPE) algorithm as described in Nielsen and Chuang, pages 223-224. We have the following situation there, we have the state:
$$\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 \quad\text{(5.23)}$$
Then let $\alpha_l$ be the amplitude of $|(b+l)(\text{mod }2^t)\rangle$,
$$\alpha_l \equiv \frac{1}{2^t} \sum\limits_{k=0}^{2^t-1} \left(e^{2\pi i(\varphi - (b+l)/2^t)}\right)^k \quad\text{(5.24)}$$
We aim to bound the probability of obtaining a value of $m$ such that $|m-b|>e$, where $e$ is a positive integer characterizing our desired tolerance to error. The probability of observing such an $m$ is given by:
$$p(|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\quad\text{(5.27)}$$
Here we have reached an interesting point that raises a few questions for me.
From equation 5.23 we can see that the variable $l$ goes from $0$ to $2^t -1$. If I shift the index by subtracting $-2^{t-1}$, I get the following new bounds for $l$ from $-2^{t-1}$ to $2^{t-1}-1$. Now a couple of questions arise.
First, in the left-hand sum in equation 5.27 the index is $-2^{t-1} \color{red}{<} l\leq -(e+1)$, why is it less than and not less than or equal to (highlighted in red)?
Second, let's look at the right-hand sum notice that the index here is as follows $e+1\leq l\leq \color{red}{2^{t-1}}$, I have again marked in red, which is not understandable to me. Why is the upper limit of the sum $2^{t-1}$ here, shouldn't it actually be $2^{t-1}-1$?
I hope my questions are understandable so far.
"
"['communication', 'continuous-variable', 'qkd']"," Title: What is the difference between CV QKD and DV QKD?Body: I know what QKD is, as a concept but I recently found papers mentioning continuous-variable quantum key distribution , and discrete-variable quantum key distribution . So I would like to know what is the difference between them?
Also, when we generally say "QKD" only (without specifying), does it usually refer to DV-QKD?
Thanks
"
"['algorithm', 'vqe', 'optimization', 'qaoa', 'tomography']"," Title: Confusion about the objective function of VQEs and QAOAsBody: I am a bit puzzled on how the objective function of the VQEs and QAOAs. Of course, the parametrised state is constructed differently in these two algorithms but they do share a common objective to be minimised, specifically:
$$
\mathrm{min}_{\phi} ~ \langle \psi_\phi | H |\psi_\phi\rangle
$$
where $H$ is the Hamiltonian and $|\psi_\phi\rangle$ the state that the quantum circuit prepares. One then, usually makes $N$ measurements and obtains a set
$$
\{ h_1, h_2, \ldots,h_N \}
$$
which correspond to the empirical estimates of the expectation value $\langle \psi_\phi | H |\psi_\phi\rangle$. I read in the literarue that one can use these to formulate the sample mean
$$
\frac{1}{N} \sum_{i=1}^N h_i(\phi)
$$
and feed this to the classical minimiser.
Confusion: although I do agree that the sample mean above indeed samples the expectation value of the Hamiltonian, I cannot see how one practically implements this into the classical optimiser!
Specifically, the set of measurements $\{ h_1, h_2, \ldots,h_N \}$ is the output of some quantum process tomography procedure and they must correspond to real numbers and not functions of the parameters $\phi$.
How one can convert the sample mean, which is the average of real numbers $\{ h_1, h_2, \ldots,h_N \}$ to a function of the parameters $\phi$?
"
"['qiskit', 'programming']"," Title: Problems when computing the two-electron reduced density matrix (2-RDM) by qiskitBody: The definition of a 2-RDM is $D_{ijkl}=\langle\psi|a_i^{\dagger}a_j^{\dagger}a_k a_l|\psi\rangle,i,,j,k,l\in[0,N-1]$, where $N$ is the number of qubits/ orbitals in the quantum system.I am trying to use the following code to get the 2-RDM for a given state and the eigenvalue for the 2-RDM,
from qiskit import *
import numpy as np
#Operator Imports
from qiskit.opflow import Z, X, I
#Circuit imports
from qiskit_nature.circuit.library import HartreeFock
from qiskit import Aer
from qiskit_nature.mappers.second_quantization import JordanWignerMapper
from qiskit_nature.converters.second_quantization import QubitConverter
from qiskit.algorithms import VQE, NumPyMinimumEigensolver
import matplotlib.pyplot as plt
import matplotlib
from qiskit.tools.visualization import circuit_drawer
from qiskit_nature.operators.second_quantization import FermionicOp
from qiskit.opflow import Z, X, I, StateFn, CircuitStateFn, SummedOp
from qiskit.opflow.converters import CircuitSampler
from qiskit.utils import QuantumInstance
from qiskit.opflow import expectations
import itertools
matplotlib.use('Agg')
mapper = JordanWignerMapper()
converter = QubitConverter(mapper=mapper, two_qubit_reduction=False)
num_particles = (2, 2)
num_spin_orbitals = 6
init_state = HartreeFock(num_spin_orbitals, num_particles, converter)
init_state1 = QuantumCircuit(num_spin_orbitals)
init_state1.h(0)
init_state1.h(1)
print(init_state1)
def get_rdm(init_state):
two_rdm = np.zeros((num_spin_orbitals,) * 4)
for i, j, k, l in itertools.product(range(num_spin_orbitals), repeat=4):
# if i != j and k != l:
s = "+_{i} +_{j} -_{k} -_{l}".format(i=str(i),j=str(j),k=str(k),l=str(l))
fermi_term = FermionicOp(s, register_length=num_spin_orbitals)
qubit_term = converter.convert(fermi_term, num_particles=num_particles)
# Evaluate the Hamiltonian term w.r.t. the given state
# temp = (~init_state @ qubit_term @ init_state).eval()
temp = ~StateFn(qubit_term) @ CircuitStateFn(primitive=init_state, coeff=1.)
temp = int(temp.eval())
two_rdm[i,j,k,l] = temp
return two_rdm
# rdm1 = rdm(init_state)
# print('--------------')
two_rdm = get_rdm(init_state1)
# Transpose of the 2-RDM
two_rdm = np.transpose(two_rdm, (0, 1, 3, 2))
two_rdm = two_rdm.reshape((num_spin_orbitals ** 2, num_spin_orbitals ** 2))
# SVD of the 2-RDM
a, b = np.linalg.eig(two_rdm)
print(a)
u, s, vh = np.linalg.svd(two_rdm, full_matrices=True)
print(s)
print(s.sum())
For the Hartree Fock state, the eigenvalues of the corresponding 2-RDM output six non-zero elements, which all are $2$. In my opinion, the eigenvalues of the 2-RDM stand for the meaning that probability of two electron residing in the corresponding two orbitals. Therefore, the eigenvalue should be from zero to one.
"
"['quantum-state', 'nielsen-and-chuang', 'information-theory', 'no-cloning-theorem', 'cloning']"," Title: No-cloning theorem and distinguishing between two non-orthogonal quantum states revisitedBody: There are a couple of posts on this question, but I think they are not satisfactory. The question is Nielsen and Chuang's QCQI, Exercise 1.2, page 57, which asks "Explain how a device which, upon input of two non-orthogonal states correctly identified the state, could be used to build a device which cloned the states..." The answer offered here is that if you knew the state you could synthesize a copy of it. That sounds convincing but I notice that they do not use the condition that the states are not orthogonal. Clearly, orthogonal states can be distinguished and yet doing so cannot lead to cloning. So the posted answer seems to be incomplete or incorrect.
If was assume that the hypothetical circuit that distinguishes non-orthogonal states outputs a qubit $|0\rangle$ for the first case and $|1\rangle$ for the second case, then I think it is easy to show that the circuit would not be unitary. So in a sense this is an answer to the exercise, but not exactly since it doesn't mention cloning.
"
"['quantum-state', 'quantum-advantage', 'haar-distribution', 'state-discrimination', 't-designs']"," Title: Optimality of the SWAP test versus weak Schur sampling for testing unitarily invariant propertiesBody: Consider the following setting.
I am either given the density matrix $|\psi\rangle \langle \psi|^{\otimes k}$ or the density matrix $\frac{\mathbb{I}^{\otimes k}}{2^{nk}}$, where $\mathbb{I}$ is the $2^{n} \times 2^{n}$ identity matrix.
It is known that
$$
|\psi\rangle = C|0^{n}\rangle,
$$
for some $C$ which is chosen at random from an ensemble that forms a $k$-design.
$$
\mathbb{E}[|\psi\rangle\langle\psi|^{\otimes k}] = \frac{1}{|C|}\sum_{C}C ^{\otimes k}|0\rangle\langle 0|C^{\dagger \otimes k} = \int_{C \sim \text{Haar}} C^{\otimes k}|0\rangle\langle0|C^{\dagger \otimes k} dC_1.
$$
We could ask: for any choice of $|\psi\rangle \langle \psi|^{\otimes k}$, what is the optimal test that distinguishes between these two density matrices?
Note that there is a simple strategy that distinguishes between these two states with high probability. Trace out $k-2$ copies, and just perform the SWAP test on the first two copies. No matter what $|\psi\rangle$ we are given, since $|\psi\rangle$ is a pure state, our procedure would accept with probability $1$ when we are given (multiple copies of) $|\psi\rangle$, and accept with a low probability when we are given (multiple copies of) the maximally mixed state.
However, according to this paper (Lemma 20), the optimal test, by utilizing the unitary invariance property of $k$ designs, can also be written in a very specific form.
- Perform weak Schur sampling on the state you are given.
- Obtain outcome $\lambda$ (where $\lambda$ is a partition of $k$ --- for example, $(4, 1)$ is a partition of $5$.)
- Accept with probability $\alpha_{\lambda}$ where
$$
\alpha_{\lambda} = d_{\lambda} ~s(x_1, x_2, \ldots, x_{2^{n}}),
$$
where $s$ is called the Schur polynomial; $x_1, x_2, \ldots, x_{2^{n}}$ are the eigenvalues corresponding to the density matrix of a single copy of the state; and $d_{\lambda}$ is the dimension of the square matrix associated with the partition $\lambda$. Everything is elucidated in the paper.
However, the eigenvalues corresponding to a single copy of a maximally mixed state over $n$ qubits is $\left(\frac{1}{2^{n}}, \frac{1}{2^{n}}, \ldots, \frac{1}{2^{n}} \right)$. Since a $k$-design is also a $1$ design, the eigenvalues for a single copy of the other density matrix is also $\left(\frac{1}{2^{n}}, \frac{1}{2^{n}}, \ldots, \frac{1}{2^{n}} \right)$. So, the probability of distinguishing these two density matrices using the supposedly optimal Schur sampling method is exactly $0$ --- which is clearly worse than the SWAP test.
How can the Schur sampling method still be optimal?
"
"['programming', 'simulation', 'annealing', 'adiabatic-model']"," Title: Any simulator packages for quantum annealing/adiabatic quantum computation?Body: Are there any simulator packages for quantum annealing/adiabatic quantum computation, like Qiskit Aer but for quantum annealing?
There seems to be only classical heuristics in D-Wave Ocean package, such as simulated annealing and tabu solvers, but nothing that actually simulates the dynamics or results of a quantum annealer.
"
"['bell-basis', 'state-discrimination', 'locc-operation']"," Title: Are mixtures of pairs of Bell states perfectly distinguishable by local operations?Body: Consider the four Bell states
$$ |\psi^{00}\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle), \hspace{2mm}
|\psi^{01}\rangle = \frac{1}{\sqrt{2}}(|00\rangle - |11\rangle),\hspace{2mm}
|\psi^{10}\rangle = \frac{1}{\sqrt{2}}(|01\rangle + |10\rangle),\hspace{2mm}
|\psi^{11}\rangle = \frac{1}{\sqrt{2}}(|01\rangle - |10\rangle), $$
and denote by $\psi^{ij} = |\psi^{ij}\rangle\langle\psi^{ij}|$ the corresponding density matrix. If we group the Bell states into two mixed states, it is easy to see that
$$ \rho_0 = \frac{1}{2}\psi^{00} + \frac{1}{2}\psi^{01}, \quad
\rho_1 = \frac{1}{2}\psi^{10} + \frac{1}{2}\psi^{11} $$
are perfectly distinguishable by local operations and classical communication (measure in $Z$-basis locally and compare results), and similarly it is easy to see
$$ \sigma_0 = \frac{1}{2}\psi^{00} + \frac{1}{2}\psi^{10}, \quad
\sigma_1 = \frac{1}{2}\psi^{01} + \frac{1}{2}\psi^{11} $$
are perfectly distinguishable by local operations and classical communication (measure in $X$-basis locally and compare results). Is it similarly easy to see
$$ \xi_0 = \frac{1}{2}\psi^{00} + \frac{1}{2}\psi^{11}, \quad
\xi_1 = \frac{1}{2}\psi^{01} + \frac{1}{2}\psi^{10} $$
are perfectly distinguishable by local operations and classical communication? I have tried to come up with a measurement, but without success. I would appreciate any help!
"
"['quantum-gate', 'quantum-state', 'physical-qubit', 'photonics', 'optical-quantum-computing']"," Title: Does a photonic quantum computer control a single photon?Body: Does a photonic quantum computer control a single photon and use it to represent a single qubit?
I think ion trapped quantum computers use a single ion to represent a qubit. I would like to know how a photonic quantum computer represents each qubit.
"
"['quantum-operation', 'nielsen-and-chuang', 'unitarity', 'kraus-representation']"," Title: Can every unitary on $\mathcal{H}\otimes \mathcal{K}$ be modelled by quantum operations on $\mathcal{H}$?Body: In section 8.2.3 of Nielsen and Chuang, they discuss how unitary dynamics of a system and environment arise from quantum operations (i.e. Kraus operators $E_k$ such that $\sum_k E_k^*E_k=I$). Importantly, they mention that
"we are trying to find a model environment giving rise to a dynamics described by the operation elements $\{E_k\}$."
In what follows they let $|e_k\rangle$ be an orthonormal basis for the environment. They then go on to say
"Define an operator $U$ which has the following action on states of the form $|\psi\rangle|e_0\rangle$, $$U|\psi\rangle|e_0\rangle=\sum_k E_k|\psi\rangle|e_k\rangle,\quad\quad\quad\quad\quad (8.37)$$ where $|e_0\rangle$ is just some standard state of the model environment."
Let $\mathcal{H}$ and $\mathcal{K}$ be the Hilbert spaces of the system and environment respectively and suppose we fix the environment $\mathcal{K}$.
My question is whether every unitary on $\mathcal{H}\otimes \mathcal{K}$ has the form of $U$ in equation (8.37)?
I see how defining the action of $U$ in (8.37) leads to these unitary dynamics. This is just the same thing as saying that any isometry on $\mathcal{H}$ extends to a unitary on $\mathcal{H}\otimes \mathcal{K}$. I guess my question is whether the converse is true, does every unitary on the joint system decompose into something of the form in (8.37)? Is there some counterexample, or argument to see that any such unitary has this decomposition?
"
"['qiskit', 'ibm-q-experience']"," Title: Enable qiskit editor in composerBody: For educational purposes I would like to make some circuits in the nice IBM quantum experience circuit composer GUI. The only problem is that the set of gates I can use here is quite limited (I would like to use a "delay" instruction which is included in qiskit). The only problem is that the qiskit editor tab is set to read only mode. I was wondering if there was a way to enable this editor.
Thanks!
"
"['textbook-and-exercises', 'nielsen-and-chuang']"," Title: What is the physical process causing a Bell state to be shared?Body: Nielsen and Chuang, QCQI, page 57, last paragraph, says "suppose Alice and Bob share between them a Bell state." I know how to prepare a Bell state, but what would be the physical process that would cause it to be shared by the two parties. Suppose Alice is in Pasadena and Bob is in Cambridge; one of them prepares the state. How does the other one get access to it?
"
"['quantum-state', 'ibm-q-experience', 'hadamard']"," Title: Hadamard cascadeBody: Anyone of you can explain (with mathematical steps) me this circuit:
I do not understand why the first qubit phase (as show on IBM composer) is influenced by the second.
More precisely:
In circuit with single qubit set to zero, the two Hadamard gates at the end, return a quantum state with prob of $|1\rangle$ equal to 0% and phase 0. On circuit like that in the figure, the first qubit (q[0]), return a quantum state with prob of $|1\rangle$ equal to 0% but phase is $\pi$.
Thanks
![]()
"
"['quantum-state', 'simulation', 'chemistry']"," Title: Roughly speaking, How many qubits will be needed to study (or simulate) a molecule such as: C29H31N7O?Body: It is often said that one of the early applications for Quantum Computers will be drug discovery.
Q: Roughly speaking, How many qubits will be needed to study (or simulate) a molecule such as: $C_{29}H_{31}N_{7}O$ (Imatinib, sold under the brand name Gleevec & Glivec ) ?
Or in general, if a molecule has 100 atoms, how many qubits will be needed to simulate it ?
"
"['quantum-gate', 'entanglement', 'pauli-gates', 'linear-algebra']"," Title: Does the controlled Pauli Z gate cause entanglement?Body: I'm trying to understand the relationship between the factorability of a 2 qubit gate and that gate's ability to cause entanglement.
I've begun by considering the controlled Pauli Z gate. After playing around with the computational basis inputs and the Hadamard gate, it seems like the CZ gate cannot cause entanglement. But I'm not sure if this idea holds in general (i.e. is there some input that would become entangled if run through a CZ gate).
My intuition is that since the CZ matrix is diagonal it is not able to cause entanglement. Meanwhile the CX and CY are not diagonal and therefore can cause entanglement. But I am hoping to find a more formal definition/distinction or counterexample.
If anyone has any thoughts or references in this area, they would be greatly appreciated.
"
"['textbook-and-exercises', 'angular-momentum']"," Title: What is the physical significance of the general rotation operator $R(\hat n,d\theta)=I-id\theta (\hat n\cdot\vec J)$?Body: John Preskills lecture notes (here) contain an equation for a general rotation operator (eqn 2.25, page 11):
$$R(\hat{n},d\theta)=I-id\theta \hat{n}\cdot \vec{J},$$
where $\vec{J}$ is angular momentum, $\hat{n}$ is a unit vector along the axis of rotation and $d\theta$ is the infinitesimal rotation angle.
There is no motivation. This equation looks familiar from quantum mechanics courses but I cannot find it in any of my books. This operator has many interesting properties:
It is antiunitary
$$i\frac{dR}{d\theta}=\hat{n}\cdot \vec{J}R,
\qquad [R,\hat{n}\cdot\vec{J}]=0$$
It is invariant under rotations of $\hat{n}$ and $\vec{J}$.
But I am not sure what the physical significance of this object is. Does it act on the state vector? Under what circumstances?
I can almost see the necessity of this formula except perhaps for the sign of the second term.
"
"['qiskit', 'programming', 'quantum-gate', 'quantum-state']"," Title: How can I initialize a state like, $|00\rangle$ or $|01\rangle$ or $|10\rangle$ or $|11\rangle$ in Qiskit?Body: Many thanks in advance for your help.
I am a beginner in Qiskit. I want to implement a circuit that uses the position of an element/item, of the form (x,y) and I would like to represent it as a state $|\phi\rangle = |xy\rangle$.
How can I initialize a state like, $|00\rangle$ or $|01\rangle$ or $|10\rangle$ or $|11\rangle$? Or how could I apply the tensor product to get it?
"
"['entanglement', 'superdense-coding']"," Title: What is meant by ""double speed"" in dense coding protocol?Body: As mentioned in this article, "This (densecoding) lets you transmit at double speed until the pre-delivered qubits run out." What is meant by double speed here?
"
"['qiskit', 'quantum-state', 'ibm-q-experience', 'error-correction']"," Title: Why aren’t repetition codes used to encode qubits in superposition states?Body: I just finished reading the section of the qiskit textbook on quantum error correction using repetition codes(https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html) and based on the experiments they ran, I’m only seeing repetition codes being used to encode logical bits (i.e. qubits in their independent $|0\rangle$ or $|1\rangle$ basis states).
I thought the whole purpose of developing the syndrome measurement technique was to prevent the breakdown of qubits in superposition. But then the experiments just went on to use it for encoding qubits that are not in superposition (logical bits) instead.
Was this done solely for simplicity or does the RepetitionCode object currently not allow us to do experiments on qubits in superposition?
"
"['error-correction', 'fault-tolerance', 'magic-states']"," Title: Magic state distillation: why is it harder to prepare the encoded $|A_{\pi/4}\rangle$ than $|0 \rangle$Body: My question is the following
Let's assume I am using Steane concatenated code to do error correction. I consider that the stabilizers are extracted fault-tolerantly through the Steane method. The Steane code admits transversal Clifford operations but not the $T$-gate.
In order to implement this gate one method is to prepare an ancilla in a state:
$$|A_{\pi/4}\rangle = T |+ \rangle$$
and to then use quantum teleportation to implement the $T$ gate on the logical data qubit.
The preparation of such a state will usually fail with a high probability and to increase its probability of success we use the so-called magic state distillation procedure.
My question
Taking a step back I am not sure to understand why preparing $|A_{\pi/4}\rangle$ is more complicated than preparing the logical $|0\rangle$ for Steane code (where the stabilizers are measured fault-tolerantly with the Steane method) for instance.
Edit
As suggested in the answers, it might be easier to prepare the logical $|0_L\rangle$ and $|+_L\rangle$ because they can be prepared by measuring the stabilizers. For instance, you initialize all your physical data qubits in $|0\rangle$, you measure your stabilizers, and with that, you created the logical state $|0_L\rangle$.
However, with the Steane method I don't think it can work. Indeed, in order to measure stabilizers, we need additional ancillae qubits to do those measurements. And those ancillae must be prepared in the $|0_L\rangle$ or $|+_L\rangle$. Here you are just "moving" the problem because now you have to prepare fault-tolerantly those ancillae state. So I guess that if we use the Steane method to fault-tolerantly measure the stabilizers, we cannot initialize our data qubit in $|0_L\rangle$ by simply initializing all physical data qubits in $|0\rangle$ and then measuring the stabilizers.
Hence, my guess is that the reason for the hardness of initializing arbitrary logical states might be very dependent on the fault-tolerant construction that is considered.
It might not be much harder to prepare the $|0\rangle$ logical state or the $|A_{\pi/4}\rangle$ logical state for a fault-tolerant implementation based on the Steane method (because we cannot do the trick of measuring the stabilizers for reason given above). However, for surface code, we could do it because to measure stabilizers we only need to initialize physical ancilla in the physical $|0\rangle$ or $|+\rangle$ state. We don't have the issue of "infinite loop" as I just explained for the Steane method. But this trick would not work for an arbitrary state initialization (and then preparing the logical state $|A_{\pi/4}\rangle$ might become much harder than preparing $|0_L\rangle$).
Would you agree with me?
"
"['entanglement', 'partial-trace']"," Title: What does the partial trace of $|W\rangle$ states represent physically?Body: Given the W-state $|W\rangle = |001\rangle + |010\rangle + |100\rangle$, where $|ijk \rangle $implies $|i\rangle_A \otimes |j\rangle_B \otimes |k \rangle_C$, the partial trace over first qubit turns out to be
$$Tr_A\left[|W\rangle \langle W| \right] = {}_A\langle0 |W\rangle \langle W|0\rangle_A + {}_A\langle 1 |W\rangle \langle W|1\rangle_A = |00\rangle \langle 00| + |01\rangle \langle 01| + |01\rangle \langle 10| + |10 \rangle \langle 01| + |10\rangle \langle 10|$$
What physics does this tell us?
"
['quantum-state']," Title: Why are the + and - states for a Qubit represented as |0>+|1> and |0>-|1> respectively and not the other way around?Body: Why are the + and - states for a Qubit represented as |0>+|1> and |0>-|1> respectively and not the other way around?
Is this only a matter of convention or is there a formula to arrive at each vector in Hilbert space only from |0> and |1> states?
"
"['qiskit', 'programming', 'quantum-gate', 'pauli-gates']"," Title: Qiskit's PauliTrotterEvolution yields weird gatesBody: I am trying to work with Qiskit's PauliTrotterEvolution() module, but the resulting circuits contain weird gates that I know nothing about.
Here is a simple example: I want to implement the fermionic creation operator on one of two qubits
from qiskit_nature.mappers.second_quantization import BravyiKitaevMapper
from qiskit_nature.operators.second_quantization import FermionicOp
from qiskit.opflow.evolutions import PauliTrotterEvolution
fermi_op = FermionicOp("+I", display_format="dense")
The fermionic operator is mapped to a sum of Pauli gates using the Bravyi-Kitaev mapper:
mapper = BravyiKitaevMapper()
bosonic_op = mapper.map(fermi_op)
Now we apply the PauliTrotterEvolution to the exponential of the bosonic operator:
pauli_trotter = PauliTrotterEvolution("trotter", reps=1)
conv = pauli_trotter.convert(bosonic_op.exp_i())
circ = conv.to_circuit()
circ.draw("latex")
I have no clue what these "circuit" gates are. Has anyone seen something similar before?
"
"['qiskit', 'programming', 'quantum-circuit', 'cirq', 'amazon-braket']"," Title: Is there a quantum circuit builder package that allows you to import/export a circuit as a JSON?Body: I've done a superficial search in each of the qiskit, cirq, and braket open source repositories for such a feature, but can't find any explicit examples of this functionality. I'm wondering if anyone knows more about how the quantum circuit objects are constructed behind the scenes in one or each of these packages and if any of the above-mentioned packages store circuit information in a data structure accessible to the user that could be translated to a JSON, or conversely, translate an appropriately formatted JSON to said data-structure and construct a circuit object through the "back door" in this way?
"
"['quantum-operation', 'density-matrix', 'information-theory', 'noise', 'kraus-representation']"," Title: Special properties of a channel whose Kraus decomposition contains IdentityBody: I would like to know if there are any special properties of channels that permit a Kraus representation that includes an identity? That is, if I am given a Kraus representation of a CPTP map $\Phi$ for which one Kraus operator is $\sqrt{p} \,\mathbb{I}$ with $p > 0$ and no other Kraus operator is proportional to the identity, then I can express $\Phi$ as
$$
\Phi(\rho) = p \rho + \sum_{a} A_a \rho A_a^* \tag{1}
$$
with $\sum_a A_a^* A_a = (1-p) \,\mathbb{I}$. Then can I make any interesting comments about $\Phi$?
This kind of noise seems interesting because $\Phi (\rho)$ written as a mixture with a term proportional to $\rho$ in its output as in Equation $(1)$ and so we can interpret the effect of the channel as "with probability $p$, nothing happened, otherwise with probability $(1-p)$ something nontrivial happened".
Certainly not all channels have this form, but maybe channels that do have this form share some other properties in common?
"
"['tomography', 'experiment', 'optical-quantum-computing']"," Title: How to quantify trace distance between two matrices representing two quantum optical networks?Body: This is my first post here, so I'm sorry if this question could be ill-formulated. I have performed measurements on a 12x12 optical quantum network, so that I have a stochastic matrix $P^{exp}$ where each element $P^{exp}_{i,j}$ correspond to the probability of measuring an output photon in the $i$ channel if I have injected an input photon in the $j$ channel.
I have a $P^{theo}$ matrix of the expected ideal behaviour, and I want to quantify how much the experimental $P^{exp}$ moves away from the $P^{theo}$.
Referring to p. 400-403 of Nielsen-Chuang, I read about the trace distance between two $\{p_x\}, \{q_x\}$ 1D probability distributions over the same index set $x$, defined as
$$D(p_x, q_x) = \frac{1}{2}\sum_x |p_x-q_x|_1$$
Now, I want to use this metric to treat my stochastic matrices. I thought initially that this can be accomplished by using the $L_1$ norm on matrices:
$$D(P^{theo},P^{exp}) = ||P^{theo}-P^{exp}||_1 = max_{1<j<n}\sum_{i=1}^{12} |P^{theo}_{i,j}-P^{exp}_{i,j}|$$
which performs the sum over all the elements of all the columns, and takes the max among all the sums. However, I am unsure this has some physical insightful meaning, as I would rather do the average between all the $\sum_{i=1}^m |P^{theo}_{i,j}-P^{exp}_{i,j}|$,
$$D(P^{theo},P^{exp}) = \frac{\sum_{j=1}^{12}\sum_{i=1}^{12} |P^{theo}_{i,j}-P^{exp}_{i,j}|}{12}$$
Is this reasoning correct? Do you have other suggestions about how to quantify the "diversity" between an experimental and a theoretical stochastic matrix?
Thank you in advance.
"
"['algorithm', 'chemistry', 'applications']"," Title: Is molecule simulation by quantum computing critical for drug discovery?Body: It is often said that the molecule simulation for drug discovery will be one of the most important applications of Quantum Computing (QC).
As we all know that the entire process of new drug discovery is a long and costly process.
How critical is the molecule simulation in the entire process of new drug discovery?
"
"['quantum-state', 'density-matrix', 'matrix-representation', 'quantum-advantage', 'haar-distribution']"," Title: Random quantum states and Schur-Weyl dualityBody: Consider the following density matrix over $n$ qubits, with $C$ being a single qubit operator:
$$
\rho_{n} = \int_{C \sim \text{Haar}} \big(C|0\rangle\langle0|C^\dagger\big)^{\otimes n} dC.
$$
Let's say I measure the qubit with respect to orthogonal measurement operators $\{M_i : I \in [k] \}$. Then, for each $M_i$:
$$\text{Tr}\big(M_i \rho_n\big) = \int_{C \sim \text{Haar}}\text{Tr}\bigg(M_i \big(C|0\rangle\langle0|C^\dagger\big)^{\otimes n} \bigg) dC $$
$$= \int_{C \sim \text{Haar}} \text{Tr}\bigg(C^{\dagger \otimes n} M_i C^{\otimes n} \left(|0^{\otimes n}\rangle\langle 0^{\otimes n}|\right)\bigg) dC $$
$$= \text{Tr} \bigg(\overline{M}_i |0^{\otimes n}\rangle\langle 0^{\otimes n}| \bigg),$$
where we have
\begin{equation}
\overline{M}_i = \int_{C \sim \text{Haar}} C^{\dagger \otimes n} M C^{\otimes n}.
\end{equation}
Now note that by the left and right invariance of the Haar measure, for any one qubit unitary $U$,
$$U^{\otimes n} \overline{M}_i = \overline{M}_i U^{\otimes n}.$$
Then, by the Schur Weyl duality, with each distinct $\pi$ being a distinct permutation operator acting on the $n$ registers and for some choices of $a_{\pi} \in \mathbb{C}$
$$\overline{M}_i = \sum_{\pi \in S_{n}} a_{\pi} ~\pi.$$
Note that for any choice of $\pi$,
$$\pi |0^{n}\rangle = |0^{n}\rangle. $$
Then,
$$\text{Tr}\big(M_i \rho_{n}\big) = \text{Tr} \bigg(\overline{M}_i |0^{\otimes n}\rangle\langle 0^{\otimes n}| \bigg).$$
What is the relation between $a_{\pi}$ and irreducible representations of symmetric subspaces and weak Schur sampling? For example, on page 42 of this link (https://arxiv.org/pdf/1310.2035.pdf), it is written that we can write an operator like $\overline{M_i}$ as
$$ \overline{M_i} = \sum_{\lambda} a_{\lambda} P_{\lambda},$$
where $\lambda$ is a partition of $n$. How do I see the relation between these two representations?
Additionally, can we exploit symmetry properties, like the fact that
$$ \pi \overline{M_i} = \overline{M_i},$$
for any $\pi$, to say anything more about $a_{\pi}$ and $\overline{M_i}$?
"
"['algorithm', 'superposition']"," Title: Quantum algorithm to construct an arbitrary superposition of N integers?Body: Say for 3 qubits, I want a super position of 0 (000), 2 (010), and 7 (111). Is there a general algorithm for building this superposition? Or for an even super position of N integers?
Part of me feels like I am looking to trisect an angle.
Thanks!
"
"['qiskit', 'grovers-algorithm']"," Title: Why Grover's search return even distribution with half solutionBody: The image below is the result of finding 4 correct answers from 8 candidates using qiskit. The 4 correct answers I set were 000, 001, 010, 011, but the graph shows the probability is incorrect (the result gives even distribution). Then, I tried on cases with more qubits, and they are all confused on half solution condition. I have no idea about why it occurs.
"
['qiskit']," Title: Parallelizing Qiskit not workingBody: I hope this is the right place to ask this kind of question. I'm using the Aer simulator in Qiskit to analyze the state vector of some circuits. My program is very parallelizable, but when I try to run these qiskit calculations in parallel (using the multiprocessing library in python), in certain situations the call to Qiskit to simulate the circuit hangs indefinitely. For instance, I may have something like this:
from multiprocessing import Pool
def parallel(circ2):
simulator2 = Aer.get_backend('aer_simulator')
result2 = simulator.run(circ2).result()
print(result2)
circ1 = ... #some kind of circuit
simulator1 = Aer.get_backend('aer_simulator')
result1 = simulator1.run(circ1).result()
print(result1)
circs_arr = [...] #some list of different circuits
with Pool(5) as p:
p.map(parallel,circs_arr)
The above code does not work. The parallelized call to run the circuit (within the function) hangs indefinitely. However, if I remove the first run of the simulator (that produces result1), then everything is fine and works as expected. Does anyone know how I can fix this? I've read that the problem might have something to do with qiskit Aer utilizing multiprocessing for its own purposes, so using running Aer with multiprocessing can cause a conflict. However, my attempts to turn off qiskit's internal multiprocessing have not worked, or have not fixed my problem.
"
"['qiskit', 'programming', 'qasm']"," Title: How to convert code from QISKIT to QuEST using QASMBody: I have been working on this project which requires a lot of qubits. Originally we have made the whole project in QISKIT as we have been using it for a long time. But the maximum number of qubits that can be simulated in qiskit can not be more than a 100 qubits. Due to which are planning to use QuEST which can simulate a lot more qubits. Now instead of converting the whole code which is taking a lot of time, we were thinking if we could convert the qiskit code for each case into QASM and then use the QASM code to convert to QuEST, this way we will be saving a lot of time. And we found another project which is based on this itself. But as there are not a lot of resources regarding this I am facing a lot of issues with this. I was wondering if you guys had some tips and tricks .
Thanks any help is greatly appreciated!!
"
"['algorithm', 'simulation', 'noise', 'qaoa']"," Title: Does noise model in qiskit impact the optimized parameters for QAOA?Body: I have read this paper about the effects of quantum noise on QAOA.
In the conclusion, it says: QAOA is a noise-tolerant algorithm, quantum noise does not change the QAOA quantum circuit parameter optimization direction, for both noisy and ideal QAOA cost functions, the optimized QAOA parameters being nearly the same.
I use qiskit to perform some experiments. Basically, I add a noise model to the simulator during the parameter training process. I found that, the optimized parameters are different when I use qasm_simulator and COBYLA. However, when I use statevector_simulator and no matter which optimizer, the optimized parameters are exactly the same with and without noise model.
I know that for statevector_simulator, there is no sampling noise. Is the difference of the optimized parameters caused by the sampling noise for qasm_simulator? Will the noise model impact the value of the optimized parameters theoretically?
"
"['quantum-gate', 'tensor-product']"," Title: How to apply 2x2 matrix transformation gates upon 1x4 tensor product columns of two tensored qubits?Body: The tensor product of two qubits yields a 4-row column vector. Once tensored, how are we supposed to apply common gates such as NOT on just one of the qubits, an operation which expects 2x2 or at least 1x2 input?
I understand how classical NOT works (1 qubit), and how CNOT works (2 qubits tensored). But circuit diagrams often show 2x2 gate operations applied onto just one of the qubits in a tensor product. Is it okay to just vertically partition the 4-row into two 2-row column vectors for the purposes of 2x2 matrix gate operations?
"
"['quantum-state', 'algorithm', 'linear-algebra', 'tomography', 'eigenvalue']"," Title: Weak Schur sampling and state distinguishabilityBody: Consider the task of distinguishing between the following two $n$ qubit quantum states.
$$ \rho = \frac{\mathbb{I}}{2^{n}}.$$
$$ \sigma = \frac{1}{2^{n/2}}\sum_{x \in \{0, 1\}^{n/2}} |x\rangle\langle x| \otimes |x\rangle\langle x|.$$
We can see that even when we are given just one copy of $\rho$ or $\sigma$, it is easy to distinguish between these two density matrices with high probability. Just separate out the first and last $n/2$ qubits, and apply the SWAP test on them.
It is also easy to see that the total variation distance between these two states is high, and that
\begin{equation}
d_{\text{TV}}(\sigma,U \rho U^{*})= d_{\text{TV}}(\sigma, \rho),
\end{equation}
for any unitary $U$. Hence, this property is unitarily invariant and we can apply Lemma 20 of this paper (https://arxiv.org/abs/1310.2035) to say that without loss of generality, the optimal distinguisher for these two states does weak Schur sampling followed by classical post-processing.
Note that the eigenvalues of $\rho$ are all $\frac{1}{2^{n}}$ and those of $\sigma$ are $\frac{1}{2^{n/2}}$ and $0$.
However, I am not sure how weak Schur sampling should work here.
Let's say we are given either one copy of $\rho$ or $\sigma$.
If we start with $k$ copies of a state, after weak Schur sampling, according to this paper, what we get is an estimate of the $k$ largest eigenvalues of the state we are given, upto a certain additive accuracy (to argue about the accuracy, see Theorem $1.4$ of this paper.)
So, for our setting, applying the said Theorem $1.4$, when the state given is $\rho$, the estimate $\lambda$ we get satisfies
$$ \frac{1}{2^{n}} -2 \leq \lambda \leq \frac{1}{2^{n}} + 2$$
and when we are given $\sigma$, it satisfies
$$ \frac{1}{2^{n/2}} -2 \leq \lambda \leq \frac{1}{2^{n/2}} + 2$$
With the classical post-processor, how can we expect to distinguish between these two estimates? I could not think of any algorithm.
"
['qaoa']," Title: QAOA calculation expectation valueBody: Given the QAOA circuit $U(\vec\gamma, \vec\beta)$, associated to some cost hamiltonian $H_C$, and evolving the state $|0\rangle^{\otimes n}$ into $|\vec\gamma, \vec\beta\rangle = U(\vec\gamma, \vec\beta)|0\rangle^{\otimes n}$, there is a difference in calculating the expectation value
$$\langle H_C \rangle = \langle \vec\gamma, \vec\beta| H_C | \vec\gamma, \vec\beta \rangle $$
and calculating the value as shown in Qiskit Textbook by measuring observable $\sigma^z$ instead of $H_C$ (repeating the measure $N$ times), obtaining $N$ bitstring and calculating manually, classically, the "mean cost" which is a formula similar to
$$ \text{cost}_{H_C} = \sum_{i=1}^N H_C(i\text{-th bitstring})/N$$
where $H_C(\text{bitstring})$ is an abuse of notation indicating the cost associated to a single bitstring, a single sample measured by this circuit.
For $N$ as large as you want, is $\langle H_C \rangle = \text{cost}_{H_C}$? Is there a proof for this?
"
"['algorithm', 'shors-algorithm', 'fault-tolerance']"," Title: What will be the most useful quantum algorithms in the fault-tolerant quantum computers era?Body: When we'll have fault tolerant quantum computers with a lot of qubits, what will be the most useful algorithms (studied so far)? I know about Shor, Grover and quantum phase estimation but I'm pretty sure there is a lot more (even applications of the algorithms cited above).
I'm interested also in applications in all fields (Machine learning, finance, Physics, etc.).
I know that is a really generic question, but any algorithm that I don't know about can be useful to me.
Thanks!
"
"['qiskit', 'programming', 'quantum-gate']"," Title: Create your own n-qubit quantum gate in QiskitBody: I need to create the 2-qubit gates that are not supported by Qiskit (Ex: Controlled - F gate). Is there any way to create a class/object and use it as other basic gates?
Example:
qc = qiskit.QuantumCircuit(2,2)
qc.h(0)
qc.cf(0, 1)
Thanks!
"
"['information-theory', 'entropy', 'max-entropy', 'relative-entropy']"," Title: Quasi concavity of max-relative entropy?Body: The max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\}.$$
It is known that the max-relative entropy is quasi-convex. That is, for $\rho=\sum_{i \in I} p_{i} \rho_{i}$ and $\sigma=\sum_{i \in I} p_{i} \sigma_{i}$ where $\rho_i, \sigma_i$ are quantum states and $p$ is a probability vector, it holds that
$$D_{\max }(\rho \| \sigma) \leq \max _{i \in I} D_{\max }\left(\rho_{i} \| \sigma_{i}\right).$$
Is there a lower bound for $D_{\max }(\rho \| \sigma)$ in terms of $D_{\max }(\rho_i \| \sigma_i)$?
"
"['optimization', 'annealing', 'qubo']"," Title: Can any binary problem be solved by a QUBO?Body: As far as I know, if a computing problem can be solved by the quantum annealing approach, it also means the solution space should be binary, e.g., a vector that only contains either 0 and 1. Otherwise, there are no further conditions, correct? Since the rest to do is to transform the problem to a QUBO matrix, correct?
That means, if I am sure that the answer to my computing problem can be encoded in binary form and the problem can be presented in a QUBO matrix form, this implies that the problem can always be solved by quantum annealing approach.
Do I understand correctly? Thank you for your answer.
"
['programming']," Title: is there such things as Quantum Operating system?Body: Wikipedia informed me about quite a lot of language that exist for quantum computing, with diverse low or high level language, but I don't know about specific operating system made for specific architecture of quantum computers.
Are we at the same level of development of the (personnal) computer's themselves in the 70/80's where every brand has his own language, instruction set and chipset ? or is there something like a posix for QC ?
"
"['qiskit', 'programming']"," Title: Is it possible to construct a QuantumCircuit object which only shows the 5 qubits and the classical bit where I store the measurement outcome?Body: I have a 5-qubit circuit on Qiskit, which applies some unitary. Then I have a second circuit which basically measures whether all the qubits are 1, and it does so through a 5-CNOT on an ancilla qubit, and then measuring the ancilla.
I would like to use this circuit without having to care about the ancilla subspace everytime. Is it possible to construct a QuantumCircuit object which only shows the 5 qubits and the classical bit where I store the measurement outcome?
"
"['quantum-state', 'bloch-sphere']"," Title: Why can the most general state of a qubit be written as $|\Psi\rangle=\cos(\frac\theta2)|0\rangle+e^{i\phi}\sin(\frac\theta2)|1\rangle$?Body: Why we can express a most general qubit as $|\Psi\rangle = \cos{\left(\frac{\theta}{2}\right)}|0\rangle + e^{i \phi} \sin{\left(\frac{\theta}{2}\right)} |1\rangle$? Is there any formal proof for this?
"
['quantum-state']," Title: Applying CNOT in series to ancilla qubitBody: $\renewcommand{ket}[1]{\left| #1 \right\rangle}$
$\renewcommand{bra}[1]{\left\langle #1 \right|}$Suppose we have to qubits both in the state $\ket{+ }= \frac{1}{\sqrt{2}}(\ket{0}+\ket{1})$, and we have an ancilla qubit in the state $\ket{0}$. What will the final state of the ancilla qubit be if we apply in series first a CNOT gate with qubit 1 as the control qubit and the ancilla qubit as the target, and then another CNOT gate this time with qubit 2 as the control qubit and the ancilla qubit as the target?
I tried computing:
$CNOT\ket{+0} = \frac{1}{\sqrt{2}}(CNOT\ket{00}+CNOT\ket{10}) = \frac{1}{\sqrt{2}}(\ket{00}+\ket{11})$
This was the first CNOT gate, followed by the next one. The ancilla qubit is now also in the state $\ket{+}$:
$CNOT\ket{+}\ket{+} = \frac{1}{2}(CNOT\ket{00}+CNOT\ket{01}+CNOT\ket{10}+CNOT\ket{11}) = \frac{1}{2}(\ket{00}+\ket{01}+\ket{11}+\ket{10})$
It seems to me the ancilla qubit is thus still in the state $\ket{+}$ and when measured in the standard basis, it gives $0$ or $1$ with equal chance. However, applying these gates is used in quantum error correction codes, and apparently you should get the outcome $0$ always when measuring the ancilla qubit. What am i doing wrong?
Cross-posted on physics.SE
"
"['qiskit', 'optimization', 'classical-quantum']"," Title: How does qiskit's CircuitQNN calculate the gradients of circuits?Body: I'm trying to understand how the gradients are calculated for any given circuit using qiskits CircuitQNN and NeuralNetworkClassifier. I've been looking trough the source on github but haven't found any real "definition" per se, and going through the code leaves much to be desired, atleast from my understand. So, how does it work, or where can I read up on it?
"
"['games', 'contextuality', 'peres-mermin-square']"," Title: How can one show that Alice's and Bob's answers agree at the intersection cells of Mermin-Peres' ""magic square""?Body: This question is along the lines of Problems in understanding the solution for "Mermin–Peres Magic Square Game"
How can one show that Alice's and Bob's answers agree at the intersection cells of Magic Square?
Is it reasonable to expect the following to give the right answer?
Could we show that the expected value of the product of measurement outcomes of Alice and Bob is 1? Let the operator applied by both Alice and Bob at location (i,j) be $D_{ij}$. Can this be shown by understanding $Tr[\rho^A D_{ij}]\cdot Tr[\rho^B D_{ij}]$ where $\rho^A,\rho^B$ are density matrices corresponding to Alice's and Bob's entangled quantum state?
"
"['algorithm', 'quantum-circuit']"," Title: What exactly is the ""quantum singular value decomposition""?Body: I know what is singular value decomposition, meaning given a matrix and write it as multiplication three different matrices, and middle matrix being diagonal and entries are singular values. So, what is exactly Quantum Singular Value Decomposition?
This is a research paper:
https://arxiv.org/abs/1607.05404
So, in this paper they have performed Hamiltonian Simulation of non sparse and low rank matrix A. So, is this QSVD? Meaning for some matrix A we need to perform f(A) for some function f?
"
"['density-matrix', 'partial-trace', 'many-body-systems']"," Title: Tripartite quantum marginal problemBody: Consider a tripartite quantum system with the three subsystems labeled $A, B,$ and $C$. Now take two states $\rho_{AB}$ on the joint system $AB$ and $\rho_{BC}$ on the joint system $BC$. Under what conditions are these compatible with the same global state of $ABC.$
In other words when does a state $\tau_{ABC}$ exist such that $Tr_{C}(\tau_{ABC}) = \rho_{AB}$ and $Tr_A(\tau_{ABC}) = \rho_{BC}.$
A necessary condition for the existence of such a state would be $Tr_A(\rho_{AB}) = Tr_C(\rho_{BC}).$
Is this condition sufficient? If not, are sufficient conditions known?
"
"['unitarity', 'quantum-enhanced-machine-learning']"," Title: Understanding the Quantum Hebbian algorithmBody: I've been reading the paper from Lloyd and al. on Quantum Hopfield Networks, but I don't understand the quantum Hebbian algorithm (page 3).
I am trying to understand the mathematical development on page 3 and try to write it out myself in order to gain a better insight into the algorithm.
Most importantly, I don't understand how they compute the trace in equation (5), and how they know that $$tr_2\{U_s(|q\rangle\langle q| \otimes|x^{k}\rangle \langle x^{k}| \otimes \sigma) U_s^\dagger \} = U_k(|q\rangle\langle q|\otimes \sigma)U_k^\dagger+O(\Delta t^2)$$
Whilst I understand equations (3) and (4), I have trouble with this one and would like to know what the mathematical development behind it is (I'm asking because I tried, but I didn't manage to prove the equation starting from the trace).
If you could help me that would be very helpful.
"
"['quantum-gate', 'circuit-construction', 'unitarity']"," Title: Is there a higher dimensional Fredkin gate?Body: The Fredkin gate is CSWAP gate. Given a control register in $0$ or $1$, the gate does nothing or swaps two target registers respectively.
Is there a higher dimensional version of this gate? I have one d-dimensional control register (this takes values from the set $S = \{1, 2, ... , d\}$) and $d$ target registers. If the control register takes on value $i\in S$, then I would like to swap the first target register with the $i^{th}$ target register.
"
"['error-correction', 'superconducting-quantum-computing', 'trapped-ion']"," Title: Are there differences in how quantum error correcting codes are applied on superconducting vs. trapped ion systems?Body: Are there any differences in how quantum error correcting codes are currently applied on superconducting vs. trapped ion systems?
"
"['qiskit', 'quantum-circuit', 'optimization']"," Title: Evaluating the derivative of a Quantum CircuitBody: After this post this weekend which got an excellent response, I've been trying to get into the solution that is given by the paper and applying it to my circuit. My original circuit is far bigger and probably not good to learn and grasp the solution, so I shortened it to this:
$$
CRY_{q_1,q_0}(\omega_{10})(I^{2\times2}\otimes RY(\omega_1))CRY_{q_0,q_1}(\omega_{01})(RY(\omega_0)RY(i_0)|0\rangle \otimes RY(i_1)|0\rangle)
$$
Which translates directly to this circuit in qiskit
┌────────┐┌────────┐ ┌─────────┐
q_0: ┤ Ry(i0) ├┤ Ry(w0) ├─────■───────────────┤ Ry(w10) ├
├────────┤└────────┘┌────┴────┐┌────────┐└────┬────┘
q_1: ┤ Ry(i1) ├──────────┤ Ry(w01) ├┤ Ry(w1) ├─────■─────
└────────┘ └─────────┘└────────┘
According to the Chapter Parameter Shift Gradient, "all standard, parameterized Qiskit gates can be shifted with $\frac{\pi}{2}$".
This led me to only look at III. Gradients of discrete-variable circuits. It states that _the overall unitary $U(\theta)$ can be decomposed into single-parameter gates. So using circuit.decompose(), I get this:
┌───────────┐┌───────────┐ ┌───────────┐┌───┐┌──────────────┐┌───┐
q_0: ┤ R(i0,π/2) ├┤ R(w0,π/2) ├──■────────────────────■──┤ Ry(w10/2) ├┤ X ├┤ Ry(-0.5*w10) ├┤ X ├
├───────────┤├───────────┤┌─┴─┐┌──────────────┐┌─┴─┐├───────────┤└─┬─┘└──────────────┘└─┬─┘
q_1: ┤ R(i1,π/2) ├┤ Ry(w01/2) ├┤ X ├┤ Ry(-0.5*w01) ├┤ X ├┤ R(w1,π/2) ├──■────────────────────■──
└───────────┘└───────────┘└───┘└──────────────┘└───┘└───────────┘
This translate into the following expression
$$
CX_{q_1,q_0}(I^{2\times2}\otimes RY(-0.5*\omega_{10})CX_{q_1,q_0}(I^{2\times2}\otimes RY(\frac{\omega_{10}}{2}))(I^{2\times2}\otimes R(\omega_1, \frac{\pi}{2}))CX_{q_0,q_1}(I^{2\times2}\otimes RY(-0.5*\omega_{01}))CX_{q_0,q_1}(R(\omega_0, \frac{\pi}{2})R(i_0, \frac{\pi}{2})|0\rangle \otimes RY(\frac{\omega_{01}}{2})R(i_1,\frac{\pi}{2})|0\rangle)
$$
- I could further decompose it, but is that needed?
- Is this even correct? From my understanding and my notes, this is the correct way of calculating the final state vector of the circuit
If my understanding is correct, I now take the derivative of each gate. Whilst at first it seemed straightforward, I am relatively clueless as to where to begin. Now, the paper states that for a single gate $G(\mu)$ in the sequence where $U(\theta) =\ V\mathcal{G}(\mu)W$, the partial derivative $\partial_\mu f$ looks like this:
$$
\partial_\mu f =\ \partial_\mu \langle\psi|\mathcal{G}^\dagger\hat{Q}\mathcal{G}|\psi\rangle =\ \langle\psi|\mathcal{G}^\dagger\hat{Q}(\partial_\mu\mathcal{G})|\psi\rangle + \text{h.c.} =\ \frac{1}{2}(\langle\psi|(\mathcal{G}+\partial_\mu\mathcal{G})^\dagger\hat{Q}(\mathcal{G}+\partial\mathcal{G})|\psi\rangle - \langle\psi|(\mathcal{G}-\partial_\mu\mathcal{G})^\dagger\hat{Q}(\mathcal{G}-\partial\mathcal{G})|\psi\rangle)
$$
- Would this be correct? Specially concerning $\text{h.c.}$? How would I even go on to solve the hermitian conjugate of it?
- In $U(\theta) =\ V\mathcal{G}(\mu)W$, what is $V$ and $W$? What in my circuit would correspond to these? I assume that $W$ is everything that happens before $\mathcal{G}(\mu)$ is applied to $|0\rangle$, as it states $ |\psi\rangle=\ W|0\rangle$?
It then tells me that $V$ gets absorbed into an observable Hermitian, $\hat{Q} =\ V^\dagger\hat{B}V$, which I can't quite follow. I assume we need the observable Hermitian to optimize for, but that's more a guess than anything really.
How do I go from here? I tried to put my open questions as bullet points and in cursive for a better overview but can understand if this is the wrong place/too much for one question. My questions probably won't end here, but maybe these give me enough insight to take on the rest by myself :)
"
"['qiskit', 'programming', 'vqe']"," Title: Ground state compute issue by qiskitBody: I use the following code to calculate the ground state for the LiH molecule in an active space. I come across two problems. The first is I found that the Hartree Fock state gave energy that is far from the ground state energy. But the qc state is the true Hartree Fock state. The second problem is using the ground_state, it just outputs 0. Can anybody help me with that?
from qiskit import *
import numpy as np
#Circuit imports
from qiskit_nature.drivers import UnitsType
from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.problems.second_quantization.electronic import ElectronicStructureProblem
from qiskit_nature.circuit.library import HartreeFock
from qiskit_nature.transformers.second_quantization.electronic import FreezeCoreTransformer, ActiveSpaceTransformer
from qiskit_nature.algorithms import GroundStateEigensolver
from qiskit_nature.results import EigenstateResult
from qiskit import Aer
from qiskit_nature.mappers.second_quantization import ParityMapper, JordanWignerMapper
from qiskit_nature.converters.second_quantization import QubitConverter
from qiskit.algorithms import VQE, NumPyMinimumEigensolver
from qiskit.opflow.state_fns import StateFn, CircuitStateFn
import matplotlib
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity, Statevector
matplotlib.use('Agg')
np.set_printoptions(threshold=np.inf)
driver = PySCFDriver(atom='H .0, .0, .0; Li .0, .0, 0.5',
unit=UnitsType.ANGSTROM,
basis='sto3g')
# set parameters
molecule = "LiH"
set_as = True # set the active space or not
as_particle = 2 # number of particles in the active space
as_mol_orbital = 3 # number of molecular orbitals in the active space
at = ActiveSpaceTransformer(as_particle, as_mol_orbital, active_orbitals=[1,2,5])
ft = FreezeCoreTransformer()
as_problem = ElectronicStructureProblem(driver, transformers=[at])
# generate the second-quantized operators for active space
as_second_q_ops = as_problem.second_q_ops()
as_main_op = as_second_q_ops[0]
as_particle_number = as_problem.grouped_property_transformed.get_property("ParticleNumber")
as_num_particles = (as_particle_number.num_alpha, as_particle_number.num_beta)
as_num_spin_orbitals = as_particle_number.num_spin_orbitals
as_qubit_op = converter.convert(main_op, num_particles=num_particles)
as_init_state = HartreeFock(as_num_spin_orbitals, as_num_particles, converter)
qc = QuantumCircuit(as_num_spin_orbitals)
qc.x(1)
qc.x(3)
# calculate the energy
numpy_solver = NumPyMinimumEigensolver()
calc = GroundStateEigensolver(converter, numpy_solver)
calc.returns_groundstate()
as_res_ref = calc.solve(as_problem)
ground_state = as_res_ref.eigenstates[0]
print('G.S. energy is', as_res_ref.eigenenergies.min())
gse = (~ground_state @ as_qubit_op @ ground_state).eval()
print('Second G.S. energy is',gse)
e = ~StateFn(as_qubit_op) @ CircuitStateFn(primitive=as_init_state, coeff=1.)
e = e.eval()
print('HF state energy is',e)
e2 = ~StateFn(as_qubit_op) @ CircuitStateFn(primitive=qc, coeff=1.)
e2 = e2.eval()
print('qc state energy is',e2)
```
"
"['entanglement', 'density-matrix', 'wigner-function']"," Title: Finding Wigner function of four maximal entangled Bell stateBody: How can we find a Wigner function for the four maximally entangled Bell states $(|00\rangle \pm |11\rangle)/\sqrt{2}$, $(|01\rangle \pm |10\rangle)/\sqrt{2}$?
I have used the basis where labels for each qubit are $\sigma_x$ and $\sigma_z$ eigenvalues. The thing is that I have first expressed the two-qubit density matrix in terms of tensor product of Pauli matrices however I am not able to proceed how to proceed further.
"
"['quantum-gate', 'circuit-construction', 'quantum-circuit']"," Title: How to Construct Swap Gates from Permutation Matrix?Body: This is a follow-up question from here.
Let's say after an LUP decomposition, we have an 8x8 permutation matrix:
$ P^{-1} = \begin{bmatrix}
1 & 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 & 0 & 0 & 0 & 0 & 1 & 0\\
0 & 0 & 1 & 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} $
How to construct the corresponding swap gates?
Note: I think this question is different from the other question because the question in that link is in the form of unitary matrix ($2^n$ x $2^n$) while here is a $n$ x $n$.
"
"['algorithm', 'quantum-circuit']"," Title: Are there ''interesting'' examples of circuits where gates can all commute each other?Body: Are there ''interesting'' examples of circuits where gates can all commute each other?
More formally, there may be some group of circuits where gates and, particularly, CNOTs (as the only two-qubit gate in common universal sets), can all commute each other. Such a property is clearly useful because one doesn't have to worry about the order of occurrence.
"
"['circuit-construction', 'hamiltonian-simulation', 'applications', 'nisq']"," Title: Could the Hamiltonian of a 2x2 Rubik's Cube be simulated with a NISQ device?Body: Consider the four cells on each of the six faces of the 2x2x2 Rubik's cube (the pocket cube). We can construct and simulate a quarter-turn Hamiltonian as below. $^*$
Let $\langle F_1,U_1,R_1\rangle$ be the quarter-turn moves that rotate each of the front face, the upper face, and the right face in the clockwise direction. Similarly let $\langle F_3,U_3,R_3\rangle$ be the counter-clockwise generators; let the half-turns be $\langle F_2,U_2,R_2\rangle.$
If we hold the cube such that the face with cells $\mathrm{A},\mathrm{B},\mathrm{C},\mathrm{D}$ is in the front, we have the SWAP circuits for example as above. Each of $F_1,F_2,F_3$ act on twelve qudits, where each of $\vert\mathrm{A}\rangle,\vert\mathrm{B}\rangle,\ldots,\vert\mathrm{V}\rangle$ are registers that can be in a superposition of six different colors; thus the pocket cube has natural $k=12$-local, $d=6$-dimensional Hamiltonian $\mathcal{H}$. Both $F_1$ and $F_3$ use nine SWAPs, while $F_2$ only uses six.
We know that the order of each of the quarter-turn moves is four, and we can use this to construct circuits for the square-root of a quarter-turn move.
Indeed, following the recipe outlined in this question, we can prepare circuits for the roots of each generator; $\sqrt{F_1}$ is an example as above. This uses $9+6+6+9=30$ controlled-SWAP (CSWAP) gates with $H$ and $S$ gates for the quantum phase estimation. The two reusable ancillae store the phases of the eigenspace, while $\vert\psi\rangle$ is a register of $24$ six-dimensional qudits (or $24\times 3=72$ qubits).
From here, we can Trotterize to simulate the quarter-turn Hamiltonian of the 2x2 Rubik's cube, with two iterations of each of the roots:
$$e^{-i \mathcal{H}t}\approx\big (\sqrt{F_1}\sqrt{U_1}\sqrt{R_1}\sqrt{F_3}\sqrt{U_3}\sqrt{R_3}\big )^2=:W.$$
By squaring square roots, our Trotter factor is two; with six generators and thirty CSWAPs per generator, we can simulate the Hamiltonian with only $2\times 6\times 30=360$ six-dimensional CSWAP gates. $^\dagger$
We can simplify further still, and consider a black-and-white 2x2 Rubik's cube. This reduces the number of qubits to $24$ plus a couple of ancillae, and only uses $360$ two-dimensional CSWAP/Fredkin gates and a handful of $H$ and $S$ gates.
With $V$ being a circuit to prepare the initial state $\vert\psi\rangle$ for example to the starting position of the cube, we can do a Hadamard test on $W$ as below.
Here, each Fredkin gate would be upgraded to a CCSWAP gate (as we'd need to control on both the measured, answer qubit as well as on the ancillae qubits for when we take the square roots).
But my specific question is: is it realistic to suppose that a circuit with a couple hundred CCSWAPs is small enough to fit into present or near-future NISQ-era devices?
I suspect that most of the loss in fidelity would come from these CCSWAP gates, and not from the $H$ or $S$ gates, or from the state-preparation circuit $V$. If the overhead to compile/transcribe such a controlled-$W$ circuit to the native gates and topology of a NISQ device is not too bad, the overall fidelity may still be appreciably greater than zero, and a post-classical signal may be observed.
$^*$ Compared to the previous question, here we (1) consider a two-tone, 2x2 pocket cube instead of a six-colored 3x3 cube, (2) reduce our Trotter factor to two instead of four, (3) iterate only over the roots of the quarter-turn generators instead of both the quarter-turn and half-turn generators, (4) prepare our initial state into a fixed basis state as opposed to a superposition of a difference of two states, and (5) ask only about a Hadamard test instead of the full quantum phase estimation. Perhaps these simplifications are enough to squeeze into a NISQ device while still offering some post-classical advantage.
$^\dagger$ Upon reconsideration, it appears to make much more sense to define the Hamiltonian simulation as
$\big (\sqrt{F_1}\sqrt{F_3}\sqrt{R_1}\sqrt{R_3}\sqrt{U_1}\sqrt{U_3}\big )^2$, i.e. have the counterclockwise roots follow the respective clockwise roots, as there is much cancelation and this may reduce the depth by half, to only $180$ CCSWAPs.
"
['notation']," Title: Is there any standard notation for two states being ""equivalent up to a global phase""?Body: Is there any standard notation for two states "equivalent up to a global phase"?
Currently, I use just an equal sign but I'd like to use a different symbol to distinguish between two phases that are exactly the same (equal sign) and two phases which are "equivalent up to a global phase" (some other symbol).
"
"['qiskit', 'programming', 'quantum-state', 'ibm-q-experience', 'circuit-construction']"," Title: How to multiply two vectors (kets) in qiskit?Body: Hi does anyone know how i could write a program to get the product of something like |1>|0>|0>?
"
['ibm-q-experience']," Title: What happened to the processor IBMQ_16_melbourne?Body: I'm a beginner, but in some books and references i use they talk about an ibm processor called IBMQ_16_melbourne, what happened to it? Can it get back up and running? Are there any other free alternatives for processing algorithms with more than 5 qubits?
"
"['teleportation', 'communication']"," Title: Is it possible to have Quantum Teleportation Protocol without using classical channel?Body: I'm still learning Quantum Information right now, especially with Quantum Teleportation (QT). I have found an interesting article suggesting a Simplified Protocol of QT that doesn't need classical channel. Here's the link for the article :
https://www.scirp.org/journal/paperinformation.aspx?paperid=86656
This protocol is more satisfying and make sense for me. However, it makes me wonder, why classical channel should be used in the first place, if this protocol is more simple and efficient?
"
"['quantum-gate', 'algorithm', 'simulation', 'hamiltonian-simulation']"," Title: How is Quantum Phase Estimation useful for simulating dynamics of a many-body system?Body: I am quite aware of the Quantum Fourier Transform (QFT) as well as the very closely related topic of Quantum Phase Estimation (QPE). The latter is usually motivated as follows:
Given a unitary $U$ and a state $|\psi \rangle$ that is promised to be an eigenstate of the unitary, $U|\psi \rangle = \lambda |\psi \rangle$, compute the global phase $\lambda = \mathrm{e}^{i\vartheta}$. The circuit implementation is quite straight forward to me, with the inverse QFT needed in the end so as to obtain $\vartheta$.
Reading this article the authors claim, by quoting papers such as this Lloyd's paper, that QPE can be used for modelling the full time evolution of some quantum systems.
Although I could not really understand Lloyd's paper in detail, I could not find how the QPE is implemented or used.
My question is how one can use QPE for simulating maby-body quantum systems?
"
"['quantum-state', 'entanglement']"," Title: What is the Schmidt number of generalized GHZ and W states?Body: Consider generalizations of the GHZ state and the W state to $n$ qubits.
What is the Schmidt number of these two states for any bipartition $ c n $ and $(1 - c) ~n $, for $c < 1$?
Does it depend on the bipartition chosen?
"
"['algorithm', 'phase-estimation']"," Title: How would Quantum Phase Estimation be solved classically?Body: I would be interested to know how Quantum Phase Estimation (QPE) would be solved classically. So suppose we have a matrix and a vector description of $U$ and $|\psi\rangle$.
I would present here what I myself would understand by a classical solution of this problem. I would be very interested to know if this represents already a "classical QPE".
Approach:
Let $U = \begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{pmatrix}$ and the input vector $|\psi\rangle = \begin{pmatrix} -\sqrt{2}+1 \\ 1 \end{pmatrix}$.
The eigenvalue problem is defined as:
$U|\psi\rangle = \lambda |\psi\rangle$
I now insert the components that are given and thus determine the eigenvalue $\lambda$
$$\begin{pmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{pmatrix}\begin{pmatrix} -\sqrt{2}+1 \\ 1 \end{pmatrix} = \lambda \begin{pmatrix} -\sqrt{2}+1 \\ 1 \end{pmatrix}$$
$$\begin{pmatrix} \sqrt{2}-1 \\ -1 \end{pmatrix}= \lambda \begin{pmatrix} -\sqrt{2}+1 \\ 1 \end{pmatrix}$$
$$\begin{pmatrix} \sqrt{2}-1 \\ -1 \end{pmatrix}= (-1) \begin{pmatrix} -\sqrt{2}+1 \\ 1 \end{pmatrix}$$
Since $-1 = e^{2\pi i (1/2)}$ it follows $\phi = 1/2$
Can this be called a classical solution of the QPE, or are there other methods that are typically called classical here?
"
"['measurement', 'probability']"," Title: Find the Probability for a ""+"" outcome when making a Pauli-x MeasurementBody:
So, we apply Equation 3.28 (above) to our initial vector state, following the equation below, to get $|\psi(t)\rangle$.
What I obtained was the basically the same equation, except now we have a $|up\rangle$ vector on the $\cos$ term (as the unity matrix returns the same vector) and "-" the $\sin$ term with $|down\rangle$, as Pauli-$X$ will "flip" the spin state.
Now for the following part, the equation is as follows:
But I feel I need some clarification. Obviously here our vector state is different (the one calculated above), but we have this superposition in the term (South-west pointing). Just before this exercise is asked, we are given the following relationships:
For Pauli-$X$ and Pauli-$Y$ respectively. Because in the calculated vector term, we have $|up\rangle - |down\rangle$, does this mean we are to use the superposition in the top right $|North-East\rangle$, and this would be the syntax used?
**
- Main Question:
- What is the $|\psi(t)\rangle$ term, just to verify I am calculating properly. In the equation for $P_+$, we are shown the result is a $1/2$[1+term]. This obviously makes sense, as when calculating $P_-$, and adding the two terms, you should result in a "$1$". In my $|\psi(t)\rangle$ I am not getting this $1+$ term, I have a feeling there is something to do with an Euler identity here?.
**
"
"['quantum-operation', 'entanglement-breaking-channels']"," Title: How can one check if a given quantum channel is unitary?Body: A unitary channel is a channel $\mathcal{U}$ of the following form:
$\mathcal{U}(\rho) = U\rho U^{\dagger}$.
A mixed unitary channel is a channel $\mathcal{U}_m$ of the form: $\mathcal{U}_m(\rho) = \sum_{k=1}^n p_kU_k\rho U_k^{\dagger}$, where each $U_k$ is a unitary matrix.
So given a general quantum channel, determining whether or not it is mixed unitary is an NP-hard problem. Is there any easy test to check if it is unitary?
"
"['measurement', 'pauli-gates', 'clifford-group', 'stabilizer-state']"," Title: Can you measure sums of Paulis in the stabilizer formalism?Body: Suppose we wanted to measure the observable $Z_{1} + Z_{2} + \cdots + Z_{N}$ in a stabilizer state. Is it possible to do this using only Clifford operations, and possibly adding some auxiliary qubits?
For $N=1$, this is trivially true. For $N=2$, this is possible using one ancilla, as follows:
- Initializing the ancilla in state $|0\rangle$, perform two CNOTs, one from each system qubit to the ancilla. Measuring the ancilla in the $Z$ basis will then reveal the parity $Z_{1} Z_{2}$.
- a) If the result of the $Z_{1} Z_{2}$ measurement is $-1$, then we know we are in the $Z_{1} + Z_{2} = 0$ sector. b) If the result of the $Z_{1} Z_{2}$ measurement is $+1$, then we are either in the $Z_{1} + Z_{2} = -2$ sector or the $Z_{1} + Z_{2} = +2$ sector. We can then find out which sector by measuring either $Z_{1}$ or $Z_{2}$ (it does not matter which).
However, my suspicion is that these are special cases, and that for $N>2$ it is impossible to measure $Z_{1} + Z_{2} + \cdots + Z_{N}$ using only Clifford operations and auxiliary qubits. I would appreciate it if anyone could either provide a proof of this, or a counterexample.
"
"['qiskit', 'quantum-gate', 'textbook-and-exercises', 'simulation', 'clifford-group']"," Title: Is the SWAP gate a Clifford Gate? How would I express it using the Clifford Gate generators?Body: By my calculations, it looks like the SWAP gate is a Clifford Gate. See the following table:
I follow the same method as in this paper for showing a gate is a Clifford Gate. I got the above table by performing calculations in Qiskit. How would I express the SWAP gate in terms of the generators of the Clifford group? The generators are the $H$ gate, the $S$ gate and the $CNOT$ gate.
"
"['quantum-gate', 'solovay-kitaev-algorithm']"," Title: Solovay-Kitaev Balanced Group Commutators in SU(2) ImplementationBody: I am currently looking into quantum compilation and came across Dawson and Nielsen's paper on the Solovay-Kitaev Algorithm, which seems like a good starting point as it is referenced in a many of the papers on the subject. I have a working (although inefficient) implementation of a Basic Approximation which I plan to improve on using k-d trees.
I am, however, not confident I have properly understood aspects of the implementation of GC-Decompose which aims to decompose a matrix we'll call $U$ into a (balanced) group commutator $VWV^{\dagger}W^{\dagger}$ for some $V$ and $W$ with a distance to $I$ bounded by $c_{cg}\sqrt{\epsilon}$.
My broad understanding of the method so far is:
- Assume $V$ is a rotation by an angle $\phi$ about the $\hat{x}$ axis and $W$ is a rotation by the same angle $\phi$ about the $\hat{y}$ axis.
- The composition of these two rotations is a rotation about another axis $\hat{n}$ on the Bloch sphere by an angle $\theta$ such that $\sin(\theta / 2) = 2 \sin^2(\phi/2) \sqrt{1- \sin^4(\phi/2)}$.
- If $U$ represents a rotation by an angle $\theta$ around some axis $\hat{p}$ then it can be expressed as:
- A rotation from $\hat{p}$ to $\hat{n}$. In the paper the rotation from $\hat{p}$ to $\hat{n}$ is given by a unitary matrix $S$.
- A rotation about $\hat{n}$ by $\theta$ which is equivalent to $VWV^{\dagger}W^{\dagger}$ where $V$ is a rotation about the $\hat{x}$ axis by an angle $\phi$ and $W$ is a rotation about the $\hat{y}$ axis also by $\phi$ where $\phi$ and $\theta$ are related by the above equation.
- A rotation back to $\hat{p}$. As this is simply the inverse of (1.) this is $S^{\dagger}$.
- Therefore $U = S(VWV^{\dagger}W^{\dagger})S^{\dagger}$ which can be expressed as $U = \tilde{V}\tilde{W}\tilde{V}^{\dagger}\tilde{W}^{\dagger}$ where $\tilde{V}\equiv SVS^{\dagger}$ and $\tilde{W}\equiv SWS^{\dagger}$.
According to my understanding above, I would expect the steps for computing a balanced group commutator for $U$ to be:
- Find the angle of rotation $\theta$ corresponding to $U$. (Any pointers on how to do this would be greatly appreciated)
- Find an angle $\phi$ satisfying $\sin(\theta / 2) = 2 \sin^2(\phi/2) \sqrt{1- \sin^4(\phi/2)}$.
- Find $S$ such that $U = S(VWV^{\dagger}W^{\dagger})S^{\dagger}$ where $V$ is a rotation about $\hat{x}$ by $\phi$ and $V$ is a rotation about $\hat{y}$ by $\phi$. Again I am not sure how this would be "easily computed". The introduction to Nagy's paper 'On an implementation of the Solovay-Kitaev algorithm' mentions that the method for SU(d) involves diagonalization, however, I can't convince myself that $VWV^{\dagger}W^{\dagger}$ is diagonal.
- Return $\tilde{V} = SVS^{\dagger}$ and $\tilde{W} = SWS^{\dagger}$.
Is this correct?
Apologies if I have completely misunderstood or missed something obvious. I am relatively new to a lot of the terminology in the paper so it is quite possible that I am on completely the wrong track.
"
"['error-correction', 'surface-code']"," Title: Is it interesting to look at surface codes where the boundary conditions give the shape of a Mobius strip, Klein bottle, or the projective plane?Body: I was reading about the Toric code and how the boundary codes give it a shape of of a torus. Is it interesting to look at other ways to orient the edges of a square lattice? I.e. a mobius strip, Klein bottle, projective plane. Or are these not useful because objects like the Klein Bottle or projective plane don't exist in real life?
"
"['qiskit', 'programming']"," Title: Getting the density matrix of a noisy state in QiskitBody: Currently, it seems that qiskit can only compute the density matrix for a pure state. On the other hand, for noisy state, the known way to deal with it is to do sampling, which can induce great cost. So, I want to know is there a way to get a density matrix for a given circuit with specific nosiy model in qiskit?
"
"['error-correction', 'stabilizer-code']"," Title: Stabilizer codes to Classical codes over GF(4)Body: In the work [1] it was shown that stabilizer codes could be mapped to binary codes (albeit with a symplectic norm) which further can be mapped to additive codes over GF(4). Can someone explain why it is useful to work over GF(4) rather than binary codes ?
[1] : Quantum Error Correction Via Codes Over GF(4), Robert Calderbank, Eric M. Rains, P. W. Shor, and Neil J. A. Sloane https://arxiv.org/pdf/quant-ph/9608006.pdf
"
"['qiskit', 'programming', 'hhl-algorithm']"," Title: Plots of the result for the qiskit HHL tutorialBody: Could anyone make explicit the code which gives the two plots at the end of the HHL tutorial. They show the results of the jobs on a real IBM quantum device.
"
"['quantum-state', 'density-matrix', 'quantum-advantage', 'haar-distribution']"," Title: Reduced density matrix of a Haar random state and its Schmidt decompositionBody: Consider a Haar random quantum state $|\psi\rangle$. Note that
$$\rho =\mathbb{E}[|\psi\rangle\langle \psi|] = \frac{\mathbb{I}_{n}}{2^{n}}.$$
$\mathbb{I}_n$ is the identity operator on $n$ qubits. Now consider what happens when we trace out the last (or the $n^{\text{th}}$) qubit of $|\psi\rangle$. Denote that density matrix by $\rho^{[n-1]}$. Note that the partial trace is a linear operator. Hence,
$$ \rho^{[n-1]} = \mathbb{E}\left[\text{Tr}_n( |\psi\rangle\langle \psi|)\right] = \text{Tr}_n\left(\mathbb{E}\left[ |\psi\rangle\langle \psi|\right]\right) = \frac{\mathbb{I}_{n-1}}{2^{n-1}}$$
Clearly, the rank of this matrix is $2^{n-1}$ and the eigenvalues are each equal to $\frac{1}{2^{n-1}}$.
However, we could also write $|\psi\rangle$ in terms of its Schmidt decomposition:
$$|\psi\rangle = \alpha_1 |\phi_1 \rangle |\chi_1\rangle + \alpha_2 |\phi_2 \rangle |\chi_2\rangle,$$
where $|\phi_1 \rangle$ and $|\phi_2 \rangle$ are orthonormal vectors over $n-1$ qubits and $|\chi_1\rangle$ and $|\chi_2\rangle$ are orthonormal vectors over $1$ qubit. Clearly,
$$\text{Tr}_n( |\psi\rangle\langle \psi|) = |\alpha_1|^{2} |\phi_1 \rangle \langle \phi_1 | + |\alpha_2|^{2} |\phi_2 \rangle \langle \phi_2 |. $$
Clearly, the rank of this density matrix is $2$ and the eigenvalues are exactly $|\alpha_1|^{2} $ and $|\alpha_2|^{2}$. Since they have to sum to $1$, the eigenvalues are certainly large, and at least one of them is much larger than $\frac{1}{2^{n-1}}$.
How can both of these statements be simultaneously true? That is, how can the probabilistic average of a bunch of rank $2$ matrices suddenly give rise to a matrix of rank $2^{n-1}$? Rank of a sum of matrices is sub-additive, so it is certainly mathematically possible, but I am missing the qualitative intuition.
Furthermore, for a typical Haar random quantum state $|\psi\rangle$, is there anything we can say about how large or small $|\alpha_1|^{2} $ and $|\alpha_2|^{2}$ are and what the eigenvectors look like?
"
"['entanglement', 'quantum-operation', 'locc-operation']"," Title: Can LOCC operations take product states to non-product states?Body: Given a product state $\rho^{(1)} \otimes \rho^{(2)}$, can this state become non-product state under LOCC? Can LOCC create correlations between two systems?
"
"['qiskit', 'programming', 'ibm-q-experience', 'simulation']"," Title: Simulating readout errors on aer simulatorBody: I'm trying to simulate quantum experiments using a customized noise model. Here's my code:
probabilities[0] = [0.9, 0.15]
probabilities[1] = [0.1, 0.85]
readout_noise_model = NoiseModel()
readout_noise_model.add_readout_error(probabilities[0], [0])
readout_noise_model.add_readout_error(probabilities[1], [0])
However, as I run the code, it returns me
--> 259 num_outcomes = len(probabilities[0])
260 num_qubits = int(np.log2(num_outcomes))
261 if 2**num_qubits != num_outcomes:
TypeError: object of type 'float' has no len()
I don't know why this happens since I could find len(probabilities[0])=2. How can I set up the noise model for readout errors? Thanks so much for the help!
"
"['textbook-and-exercises', 'density-matrix', 'linear-algebra', 'stoquatic-matrices']"," Title: Is it possible to find a 2x2 Hermitian matrix whose eigenvalues have 1:2 ratio?Body: Is it possible to find 2x2 Hermitian matrix whose eigenvalues have 1:2 ratio and if it is how is it done?
"
"['quantum-state', 'textbook-and-exercises', 'hadamard']"," Title: How to apply the Hadamard gate to a given qubit state?Body: I have this qubit state:
$$ H \left[ \frac{1}{\sqrt{2}} |0\rangle + \left( \sqrt{\frac{2}{7}}+\frac{1}{\sqrt{7}}i \right) |1\rangle \right] $$
How to solve this given Hadamard gate on qubit?
Hadamard matrix should be multiplied with vector 2x1 (1 and 1) but what to do with numbers in front of it?
"
"['quantum-state', 'textbook-and-exercises', 'bloch-sphere']"," Title: How to calculate the coefficients of a qubit from the angles of its Bloch representation?Body: A quantum bit $|\psi\rangle=a|0\rangle+b|1\rangle$ is represented on the Bloch sphere as a point on the spherical surface with $\theta = 40^°$ and $\phi = 245^°$.
Calculate the (complex) coefficients $a$ and $b$.
Here is theory from wikipedia, that I also looked up
It would be nice to have a step-by-step guide based on a concrete example for reverse operation like it was made here: How can I find the $\theta$ and $\phi$ values of a qubit on the Bloch sphere?
"
"['entanglement', 'resource-request', 'experiment']"," Title: Can entangled photons create entanglement in material particles?Body: Is it possible that two entangled photons when absorbed by two material particles, say two atoms, lead to the entanglement of these atoms? Is there any published research on this topic?
"
"['quantum-operation', 'kraus-representation']"," Title: What do commuting quantum channels look like?Body: Consider two channels, $\Phi,\Psi\in\mathrm C(\mathcal X)$ acting on some space $\mathcal X$, and suppose they commute, that is,
$$\Phi(\Psi(\rho))=\Psi(\Phi(\rho))$$
for all states $\rho$. Can anything be said about the structure, e.g. in terms of their Kraus operators, that this implies? For example, does there have to be a specific relation between their Kraus operators?
Suppose $\Phi(X)=\sum_a A_a X A_a^\dagger$ and $\Psi(X)=\sum_b B_b X B_b^\dagger$. Then the question relates to the channels with Kraus operators $\{A_a B_b\}_{ab}$ and $\{B_b A_a\}_{ab}$. There are a few cases in which the solution is obvious, e.g. if the Kraus operators commute with each others, $[A_a,B_b]=0$, but I'm not sure how to proceed in the more general case.
Is there anything general that can be said about the problem?
"
"['algorithm', 'complexity-theory']"," Title: Can a quantum computer tell whether a program is Turing complete?Body: I am very new to quantum computing and would like to know if a quantum computer can decide whether a given program is Turing complete.
"
"['quantum-state', 'entanglement', 'superposition', 'superconducting-quantum-computing']"," Title: What does it mean to be in a superposition of eigenstates in a LC oscillator?Body: In superconducting qubits, we use a circuit with a specific type of inductor and quantize the Hamiltonian. Because it's an anharmonic oscillator, we say that it has states -- $|0\rangle$ and $|1\rangle$.
This is perhaps a very basic question, but I don't understand how the circuit would exist in a superposition of these two states. How would we transform it into a superposition? I thought it exists only in these discrete energy eigenstates.
Any clarification would be appreciated.
"
"['quantum-metrology', 'technologies']"," Title: Period of phase leads the advantage of Heisenberg's Limit disappear?Body: In Quantum Metrology, the aim is to estimate some unknown parameters(I will talk about one parameter estimation in this post, while multiparameter is also available) as precise as possible. Without quantum resources, we can only realize the Standard Quantum Limit(SQL), normally referred to as the form $ var(\hat{\theta})=1/n$, where $\hat{\theta}$ is the estimator(function of random variables to estimate the unknown parameter $\theta$) and $n$ is the number of experiments. While with quantum resources, we may reach the so-called Heisenberg's Limit, normally referred to as the form $var(\hat{\theta})=1/n^2$, a square enhancement in the precision. Here is an frequently used state example, stated that the GHZ state $1/\sqrt{2}(|0\rangle^{\otimes n}+|1\rangle^{\otimes n})$ after the evolution described by the unitary operator $U = e^{-i\theta\sigma_z/2}\otimes e^{-i\theta\sigma_z/2}\otimes...$ will become
$$
1/\sqrt{2}(|0\rangle^{\otimes n}+e^{in\theta}|1\rangle^{\otimes n})\tag{1}
$$
ignoring the global phase. And we can estimate the value of the parameter by measuring this parameterized quantum state.
My question is, the HL will show its advantage only when the scale is $1/n^2$, while from eq.(1), we can easily see that there's a $2\pi$ period in an exponential function, no matter how small $\theta$ is, we cannot always enhance our precision by HL scale when $n$ pass some specific value. So, how to understand this paradox, did I miss something?
"
"['qiskit', 'measurement', 'hhl-algorithm']"," Title: Which observable $M$ provides the Absolute Average of a statevector?Body: My question should be fairly simple, though I did not find an answer to it here or anywhere else.
I have been working on an algorithm which, similarly to the HHL algorithm, provides a state $|x\rangle$ for which I want to extract some global quantity at the end. I now want to build a simple few-qubits implementation of such algorithm and for that I would like to find the $\texttt{Absolute Average}$ given by $\frac{1}{N}\big|\sum_{i=1}^Nx_i\big|$, which is clearly possible according to this tutorial to Qiskit's HHL implementation.
However, I am struggling to understand which observable $M$ I should apply in order to get this quantity from $\langle x|M|x\rangle$.
"
"['quantum-gate', 'quantum-state', 'quantum-circuit']"," Title: How to tranfer given superposition to quantum circuit?Body: Let's say I have a superposition of qubit defined as
$\frac{1}{2} (| 000 \rangle + | 001 \rangle + | 111 \rangle + | 110 \rangle)$
(as given in the answer
here: Explanation of output produced by the following quantum circuit)
I want to know how to perform reverse operation compared to that task, where the circuit was given. How can one looking at superposition create a circuit consisting of 3 qubits, the superposition of which is defined above?
"
"['qiskit', 'programming', 'qaoa', 'pennylane']"," Title: QUBO defined in Qiskit/DOcplex: how to solve it using Pennylane?Body: I have a complex Integer Linear Programming model defined in DOcplex/Qiskit representing a combinatorial optimization problem.
Using the Qiskit utils, it is possible to covert it to either an Ising model or Pauli operators.
For a particular reason, I need to use Pennylane’s QAOA to solve the problem. Is there any easy way to convert the Qiskit’s Ising model/Pauli operators output to something that Pennylane “understands”?
I can neither find something in the Pennylane documentation mor can I a find sth. like DOcplex or any other QUBO-related tools in the Pennylane ecosystem.
"
"['quantum-state', 'entanglement', 'textbook-and-exercises']"," Title: Are the first and second qubits of the state $| 111 \rangle + | 010 \rangle + | 101 \rangle + | 000 \rangle$ entangled with each another?Body: State of qubits:
$\frac{1}{2} (| 111 \rangle + | 010 \rangle + | 101 \rangle + | 000 \rangle)$
Are the first and second qubits of this register entangled with each another?
"
"['cryptography', 'bb84']"," Title: Show That an Intercept and Resend Attack on all qubits reduces mutual informationBody:
Exercise 5.3.3 With no eavesdropping the mutual information $H(A:B)$ between the substring of $\mathcal R$ held by Alice and $\mathcal R'$ held by Bob is $1$ bit. Show that if Eve is performing an intercept and resend attack on all qubits that she reduces this mutual information to $H(A:B)=0.189$ bits.
This is based on the BB84 protocol, where we know that the "1 bit" mutual information comes from the fact that Bob will measure the correct basis and therefore bit 50% of the time. And with the 50% incorrect basis will get the "correct" bit 25% of the time. After relaying his string back to Alice, they will confirm what errors there are and discard the wrong basis bits, even if they are the "correct" bit value. Thus there will be a discrepancy of 25% on average in their results. To detect Eve’s presence Alice and Bob choose some portion n of their shared bit. These revealed bits are useful for finding out whether extra errors are occurring in the protocol
From the equation: $$P_d = 1 -(\frac34)^n $$
If after sacrificing a few hundred of their bits Alice and Bob find no unexplained
errors then they can be confident that Eve is not intercepting and resending the qubits.
The remainder of the key is therefore secure.
Now, I know the equation for Mutual Information is given as: $$H(X:Y)=H(X) +H(Y) -H(X,Y)$$
I'm generally just unsure how to impliment this. The exercise details that the attack is performed on ALL qubits, I assume this is a clue?
"
"['measurement', 'vqe', 'pauli-gates', 'clifford-group']"," Title: Cliffords to Transform into Common EigenbasisBody: Say I have the following Hamiltonian (given in terms of Pauli operators):
\begin{equation}
H=aX_1Z_2+bZ_1X_2.
\end{equation}
Both Pauli terms commute with each other. I want to make a measurement of $\langle H\rangle$ but only want to make one measurement using the Pauli terms' common eigenbasis. How do I find the set of Clifford gates which allows me to do this?
What I've tried:
I've found a unitary $U$ such that $U.X_1Z_2.U^\dagger$ and $U.Z_1X_2.U^\dagger$ are diagonal but not the Clifford gates which create $U$.
If the Hamiltonian were $aX_1+bX_2$ then $U=H_1H_2$ would work.
If the Hamiltonian were $aZ_1+bZ_2$ then no $U$ would be required.
If the Hamiltonian were $aX_1+bZ_2$ then $U=H_1X_2$ would work.
If the Hamiltonian were $aZ_1+bX_2$ then $U=X_1H_2$ would work.
This seems really simple but is somehow eluding me. Any help would be very appreciated!
"
"['grovers-algorithm', 'superposition']"," Title: Synthesize superposition state using generalized Grover algorithmBody: I'm following the paper by Grover (L. K. Grover, Phys. Rev. Lett., 85:2000) and trying to synthesize the following superposition state
$$|\psi\rangle = \frac{2|00\rangle - 3|01\rangle - 4i|10\rangle + 5i|11\rangle}{\sqrt{54}}$$
Following the paper, if I understand correctly, one should expect
$$Q|00\rangle = |\psi\rangle$$
where
$$Q = -I_sU^{-1}I_tU$$
with
$$U = U_2U_1\;,\;\;U_1 = H^{\otimes2}$$
However, I don't understand the part where the author construct $U_2$.
Can anyone gives some tips?
Followups: Suppose the last qubit is the ancilla qubit. Then
$$ccR_Y(00) =
\begin{bmatrix}
I_6 & \\
& \cos(\theta_{00}/2) & -\sin(\theta_{00}/2) \\
& \sin(\theta_{00}/2) & \cos(\theta_{00}/2)
\end{bmatrix}
$$
Then
$$U_2 = ccR_Y(11)\cdot ccR_Y(10)\cdot ccR_Y(01)\cdot ccR_Y(00)$$
and so
$$U = U_2U_1 = U_2\cdot(H^{\otimes2}\otimes I)$$
"
"['quantum-state', 'quantum-advantage', 'haar-distribution']"," Title: Anticoncentration for two independent random quantum circuits in parallelBody: Consider two Haar random $n$ qubit unitaries, $U_1$ and $U_2$. Consider the quantum state
$$|\psi\rangle = (U_1 \otimes U_2) |0^{2n}\rangle. $$
Let $p_x = |\langle x| \psi \rangle|^{2}$, for $x \in \{0, 1\}^{2n}$. Does the probability distribution $p$ anti-concentrate (anticoncentration is as defined in equation $1$ here)?
"
"['quantum-state', 'textbook-and-exercises', 'density-matrix', 'bloch-sphere']"," Title: Show that the trace of squared density matrix gives ${\rm tr}(\rho^2)=\frac12(1+\|\mathbf n\|^2)$Body:
Equation 7.7 is given below:
$$\hat\rho = \frac12(I +n_x(\hat X)+n_y(\hat Y)+n_z(\hat Z)) $$
Where $I$ is the identity matrix and $\hat X,\hat Y,\hat Z$ are Pauli matrices.
Now my attempt of this was to first square every term inside the bracket to get $$\hat\rho^2$$
When doing this, all Pauli matrices then convert into identity matrices. So if you were to add all terms together you would get a 2x2 matrix:
\begin{bmatrix}4&0\\0&4\end{bmatrix}
But I'm unsure of how the matrices will cancel out to give the final result?
"
"['quantum-gate', 'circuit-construction', 'textbook-and-exercises', 'quantum-circuit', 'cloning']"," Title: Compute the output of this Approximate Quantum Cloning three-qubit circuitBody:
Above is a circuit for "Approximate Quantum Cloning"
The preparation state is given by $$|\psi\rangle =\alpha|0\rangle+\beta|1\rangle$$
The gates labelled $\theta_i$ denote single qubit rotations given by $$R_y(-2\theta_i)=\begin{bmatrix}\cos\theta_i&\sin\theta_i\\-\sin\theta_i&\cos\theta_i\end{bmatrix} $$
i.e Counterclockwise rotations of angle $-2\theta_i$ about the y-axis on Bloch Sphere.
Each gate rotation is given by:
$\cos2\theta_1 =\frac{1}{\sqrt5}$
$\cos2\theta_2 =\frac{\sqrt5}{3}$
$\cos2\theta_3 =\frac{2}{\sqrt5}$
Question: Show at the end of the preparation stage the two qubits initially in the state $|00\rangle$ are transformed into the state $$|\phi\rangle =\frac{1}{\sqrt6}(2|00\rangle+|01\rangle+|11\rangle) $$
I'm quite unsure of how to approach this, as it is my first time dealing with a circuit like this. Are the two $|0\rangle$ states said to be entangled, hence the double $|00\rangle$ notation, I thought of applying the rotations to each qubit individually, along with a $\hat C_x $gate operation?
"
"['algorithm', 'cryptography']"," Title: How would you apply quantum computing to break a symmetric key system?Body: How would you apply quantum computing to break a symmetric key system? Do you attack the plaintext password by bruteforcing? Or the mathematical process of the encryption algorithm?
"
"['quantum-state', 'density-matrix', 'quantum-advantage', 'probability']"," Title: Schmidt vectors for random quantum statesBody: Consider a random quantum circuit $U$ over $n$ qubits, drawn from the Haar measure. Consider the quantum state
$$|\psi\rangle = U |0^{n}\rangle.$$
Now, partition $n$ into two and consider the Schmidt decomposition of $|\psi\rangle$ across this bipartition. Let the decomposition be
$$|\psi\rangle = \sum_{i} \alpha_i |\phi_{i} \rangle |\chi_{i} \rangle.$$
The Schmidt coefficients of $|\psi\rangle$ are well studied. For example, according to this link,
$$\sum_{i} \alpha_i^{4} = \frac{|A| + |B|}{|A| \cdot |B| + 1},$$
where $|A| = 2^{a}$, where a is the size of the first part, and $|B| = 2^{b}$, where $b$ is the size of the second part, with $a + b = n.$
I was trying to argue about the Schmidt vectors too. Do we know anything about the nature of the Schmidt vectors? My hunch is that they are very close to standard basis states. Is there any way to see this?
Note that from the same link, from Theorem $16$,
$$ \underset{|\psi\rangle}{\mathbb{E}} \left[ \bigg|\bigg|\rho_A - \frac{\mathbb{I}}{|A|}\bigg|\bigg|_{2} \right] \leq \sqrt{\frac{|A|}{|B|}}.$$
Is this sufficient to indicate that either $\{|\phi_{i} \rangle\}$ or $\{|\chi_{i} \rangle\}$ are close to standard basis states? For a particular $|\psi\rangle$, with high probability, what is the overlap between its Schmidt vectors and standard basis states?
"
"['qiskit', 'programming', 'pennylane']"," Title: Binary classification using a very simple Neural Net with Qiskit and PennylaneBody: I implemented a simple Neural Net with Pennylane and Qiskit for classifying two half moons: notebook for two half moons (GitHub). It works somehow (not overwhelmingly by any means):
I tried running the program on a public quantum device (IBM) and found very quickly that it would take months, not days, to complete the training. For this reason I built a much simpler net (my hope is that one qubit is enough), which is supposed to solve the classification task: notebook for linear classification (GitHub). It should divide the classes using a straight line:
While the full notebook (a very small one) can be found on the above linked GitHub page, the following snipped is relevant:
# Convert quantum layer to keras
n_layers = 4
weight_shapes = {"weights": (n_layers, n_qubits)}
qlayer = qml.qnn.KerasLayer(qnode, weight_shapes, output_dim=n_qubits)
# Define classical layers
clayer_1 = tf.keras.layers.Dense(1)
clayer_2 = tf.keras.layers.Dense(1, activation="sigmoid")
model = tf.keras.models.Sequential([clayer_1, qlayer, clayer_2])
opt = tf.keras.optimizers.Adam(learning_rate=0.1)
model.compile(optimizer=opt, loss="binary_crossentropy", metrics=["accuracy"])
fitting = model.fit(x, y_hot, epochs=4, batch_size=5, validation_split=0.25, verbose=2)
Possibly it is a very simple error, which causes the net is recognizing all input as one and the same class:
I would be very grateful for any hint that pushes me towards the proper direction.
"
"['quantum-state', 'density-matrix', 'trace-distance']"," Title: Closeness of $\rho$ such that $\text{Tr}(|\psi\rangle\langle\psi|\rho)\le1/2^n+{\cal O}(2^{-2n} )$ for all $|\psi\rangle$ to the maximally mixed stateBody: Consider an $n$ qubit density matrix $\rho$ such that
$$\text{Tr}(|\psi\rangle\langle \psi| ~\rho) \leq \frac{1}{2^{n}} + \mathcal{O}\left(\frac{1}{2^{2n}} \right), $$
for every $n$ qubit pure state $|\psi \rangle$.
Is there some way to argue that the density matrix is close to the maximally mixed state, with respect to some distance measure?
Note that the maximally mixed state trivially satisfies this requirement.
"
"['quantum-state', 'error-correction', 'stabilizer-code']"," Title: How to determine the threshold value of the quantum error correction codeBody: How to determine the threshold value of the quantum error correction code, what is the specific method, such as surface code, how to determine the threshold value of the color code with a decoder, I don’t understand it very well, please answer it in detail.
"
"['quantum-operation', 'information-theory', 'kraus-representation']"," Title: What is the root of the non-trace-preserving bit-flip mapBody: I have a quantum channel defined by the Kraus operators:
$$
U_1 =
\begin{bmatrix}
p & 0 \\
0 & p
\end{bmatrix},\quad
U_2 =
\begin{bmatrix}
0 & p \\
p & 0
\end{bmatrix}
$$
i.e.
$$
U_1\rho U_1^* + U_2\rho U_2^*.
$$
Now I want to find the square root of this channel i.e. a channel that applied twice results in the given channel. Of course, this can be solved via a system of equations but is there an easier way to do this?
"
"['qiskit', 'programming']"," Title: Reading a classical register in OPENQASMBody: The IBM OpenQASM program below clones a state selected from an orthogonal pair. It seems to work but there is a mystery. I declare the classical register as an array c[1] but when I try to test its contents, the assembler will not allow me to index it. That is, it rejects "c[0]". I get similar results if there is an array of two registers; I always have to use the array name rather than a reference to an array element. My question is, how do you reference one classical register within an array, for example in an "if" statement.
There is a second question, less pressing but important. I don't know who to make a block of code that is executed when the "if" test passes. I am forced to repeat the test for each line in the block. How do you declare a block of code or, equivalently, use a branch statement to skip a block?
cloner1 = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[1];
x q[2];
x q[4];
x q[0]; //Set up input
measure q[0] -> c[0];
if (c==1) CX q[1],q[2];
if (c==1) CX q[2],q[1];
if (c==1) CX q[1],q[2];
if (c==1) CX q[3],q[4];
if (c==1) CX q[4],q[3];
if (c==1) CX q[3],q[4];
measure q[1]->c[0];
measure q[3]->c[0];
"""
```
"
['spintronics']," Title: Why does measuring the spin of an atom or electron give results that are considered ""peculiar""?Body: When an atoms/electron spin is measured, why do the measurements of spin always align with the direction of the magnets used while measuring it ? (based on my reading of Chris Bernhardt, Quantum Computing For Everyone).
Isn't the reason that when we measure spin using a magnetic field the atom/electron aligns itself parallel to this field. If so why is this behavior observed when measuring spin considered very peculiar?
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'notation', 'projection-operator']"," Title: What is meant by a ""projection operator"" in the book ""Quantum Computation and Quantum Information""?Body: I've started reading the book "Quantum Computation and Quantum Information" by Michael A. Nielsen and Issac L. Chuang, specifically chapter 10 (about quantum error correction), and I'm finding myself a bit confused as to the notations used.
In page 435, above (10.15), I'd like to ask what exactly is meant by a "Projection Operator".
What does it project, and from where? Does it project a $2^n \times 2^n$ Hilbert space onto a $2^m \times 2^m$ Hilbert space (where, in the book example, $n=3$ and $m=1$)?
Thank you very much :)
"
"['programming', 'stim']"," Title: Stim: is it possible to add comments when creating a circuit?Body: I'm trying to create a Stim.Circuit, given a list of qubits and operations on them. Does the API support adding comments to the circuit's string representation? I've tried using circuit.append_from_stim_program_text('# Some comment'), but such comments never appear when I later call print(repr(circuit)), so I presume this method only cares about appending actual circuit instructions. Any help / workarounds appreciated!
"
"['qiskit', 'programming', 'ibm-q-experience', 'quantum-circuit', 'qaoa']"," Title: Tweak the parameter `p` of QAOA in qiskitBody: I am solving a QUBO using QAOA. It works flawlessly with default parameters for smaller instances of the problem, but my RAM is saturated when I try to solve a problem of size 15. I suspect this can be resolved by changing the parameter p. Don't mind if it generates a wrong result as output, at least don't wanna run out of resources and end abruptly. I even checked with different simulators, but it didn't work. Mainly, want to know how to play around with the number of layers p.
Here's the code for reference:
from qiskit import Aer
from qiskit.aqua import aqua_globals, QuantumInstance
from qiskit.aqua.algorithms import QAOA
from qiskit.optimization import QuadraticProgram
qp=QuadraticProgram()
qp.from_ising(op, offset, linear=True)
aqua_globals.random_seed = 123
quantum_instance = QuantumInstance(Aer.get_backend('aer_simulator'),
seed_simulator=aqua_globals.random_seed,
seed_transpiler=aqua_globals.random_seed)
qaoa_mes = QAOA(quantum_instance=quantum_instance, initial_point=[0., 0.])
qaoa = MinimumEigenOptimizer(qaoa_mes)
result = qaoa.solve(qubo)
Also, how to get the circuit?
"
"['notation', 'quantum-fisher-information']"," Title: What does $\langle\partial_i\psi(\theta)|\psi(\theta)\rangle$ mean when implementing the Quantum Fisher information matrix?Body: Following this paper, the quantum Fisher information matrix (QFIM) - $\mathcal{F}$ can be calculated as:
$\mathcal{F}_{i, j}(\theta)=4 \operatorname{Re}\left[\left\langle\partial_{i} \psi(\boldsymbol{\theta}) \mid \partial_{j} \psi(\boldsymbol{\theta})\right\rangle-\left\langle\partial_{i} \psi(\boldsymbol{\theta}) \mid \psi(\boldsymbol{\theta})\right\rangle\left\langle\psi(\boldsymbol{\theta}) \mid \partial_{j} \psi(\boldsymbol{\theta})\right\rangle\right]$
$|\psi(\theta)\rangle$ is the current quantum state and $\theta$ is the $N$-dimensional complex vector, that means $\mathcal{F}$ is the $N\times N$ matrix.
The thing that I confused is $\partial_{k} \psi(\boldsymbol{\theta})$ is a scalar so how to calculate $\langle\partial_{i} \psi(\boldsymbol{\theta}) \mid \psi(\boldsymbol{\theta}) \rangle$ and its dagger?
"
"['resource-request', 'complexity-theory']"," Title: Complexity of a distribution of measurement of output of quantum circuitBody: The Kolmogorov complexity of a string refers to a deterministic object. Here, I refer to the analogous "complexity of a distribution", or better, to the complexity of sampling from a distribution, in the sense defined this paper: the complexity of the distribution $P$ is the size of the smallest circuit that can generate the samples with (an approximate) probability $P$, having random bits as input.
Edited as requested by forky40 and jecado
Consider a family of quantum circuits $C_i$; the $i$-th is composed by $m_i$ one- and two-qubit gates and operates on $n_i$ qubits, respectively. I assume that $m_i < f(n_i)$ for a given polynomial $f$. Apply the circuits to the state $\left|0\right>$, obtaining $C_i\left|0\right>$. Call $P_i(x)$ the probability distribution of getting a classical string of bits $x$ from the measurement of the qubits.
I'm asking to give an upper bound of the complexity of $P(x)$, asymptotically in $n$. Of course, it is easy to find a quantum circuit family which gives a very trivial distribution $P(x)$, with small complexity, but here I'm asking to give an upper bound.
Please notice: the problem is subtly different from simulating a quantum circuit with a classical one. For example, take the quantum circuit used in Shor's algorithm. The outcome of the Shor's algorithm is difficult to calculate by classical computers, so probably it cannot be simulated by a classical circuit polynomial in $n$. However, it is still possible that, once the result of the whole algorithm (the factorization) is known, then a specific circuit (polynomial in $n$) can be built.
I think that a trivial upper bound can be found: it's exponential in $n$, independently on $m$. On the other hand, I found several examples of quantum circuits leading to distributions with complexity polynomial in $n$. Is there an example with larger asymptotic complexity?
"
"['physical-qubit', 'research']"," Title: What are the natural, synthetic, identical, heterogeneous qubits? Can anyone explain with examples?Body: I am reading a paper from 2016, "Quantum computing with atomic qubits and
Rydberg interactions: Progress and challenges",
In section 2.1, a debate on whether identical or heterogeneous qubits work better for large scale systems. I have two questions:
- What is the difference between the identical and the heterogeneous qubits?
- Is there a result for the debate above?
Thanks for any help!
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'quantum-fourier-transform']"," Title: Making sense of the terms Polynomial and Exponential Precision in a Quantum CircuitBody:
The quantum circuit construction of the quantum Fourier transform apparently requires gates of exponential precision in the number of qubits used. However, such precision is never required in any quantum circuit of polynomial size. For example, let $U$ be the ideal quantum Fourier transform on $n$ qubits, and $V$ be the transform which results if the controlled-$R_k$ gates are performed to a precision $Δ=1/p(n)$ for some polynomial $p(n)$. Show that the error $E(U, V )≡\max_{|\psi\rangle}(U−V)|\psi\rangle$ scales as $O(n^2 /p(n))$, and thus polynomial precision in each gate is sufficient to guarantee polynomial accuracy in the output state.
This is Exercise $5.6$ in Quantum Computation and Quantum Information by Nielsen and Chuang
We have a quantum circuit of $n$ qubit QFT which requires $n$ Hadamard gates, $n(n+1)/2$ controlled-$R_k$ gates and at most $n/2$ swap gates.
$$
E(R_2^1R_3^1\cdots R_n^1\cdots R_2^{n-1},\mathcal{R}_2^1\mathcal{R}_3^1\cdots \mathcal{R}_n^1\cdots \mathcal{R}_2^{n-1})\leq E(R_2^1,\mathcal{R}_2^1)+E(R_3^1,\mathcal{R}_3^1)+\cdots+E(R_n^1,\mathcal{R}_n^1)+\cdots+E(R_2^{n-1},\mathcal{R}_2^{n-1})\\
=\Delta+\Delta+\cdots+\Delta+\cdots+\Delta=\frac{n(n+1)}{2}\Delta=\frac{n(n+1)}{2p(n)}=O(n^2/p(n))
$$
This is clear.
What does it mean to say that The quantum circuit construction of the quantum Fourier transform apparently requires gates of exponential precision in the number of qubits used ?
What is a quantum circuit with polynomial size ?
I am also confused by the terms polynomial precision and polynomial accuracy ?
"
"['quantum-gate', 'algorithm', 'phase-estimation', 'quirk']"," Title: Implementation of quantum phase estimation in QuirkBody: after reading the chapter of QPE (Quantum phase estimation) in Nielsen, I wanted to try an implementation in Quirk. My idea was to apply the T-gate, from which I know the following relation $T|1\rangle = e^{\frac{i\pi}{4}}|1\rangle$ so I expect as output of the phase $\theta = 1/8$, because $T|1\rangle = e^{2i\pi\theta}|1\rangle$.
In Nielsen, I followed the following diagram to construct "my approach" later in Quirk, followed by the inverse QFT applied to the first register, which is not shown in this picture:
Using the diagram from Nielsen together with the inverse QFT, I thus constructed the first part in Quirk as follows:
I remembered that a swap gate was needed to get the desired output at the end. In the QFT part in Nielsen, for example, this was the case (It was mentioned but not depicted in the circuit diagram). Thats why I decided to put this in the circuit after applying the controlled gates.
In Quirk I now get the output $|001\rangle$ with 100% probability, if I convert $0.001_2$ to a decimal fraction I get $\frac{1}{8}$. This would fit what I would expect.
I now have this question:
Is the circuit really correct as I have built it? Background: In qiskit the circuit is built "descending" with T-gates and without the swap gate, while I have followed Nielsen and put the T-gates "ascending" in the circuit and then use the swap gate.
I hope my question is understandable so far. Thanks a lot for any upcoming answers/help.
"
"['textbook-and-exercises', 'error-correction', 'nielsen-and-chuang', 'notation', 'projection-operator']"," Title: When discussing error correction, what are the objects in the expression $PE_i^\dagger E_j P=\alpha_{ij} P$?Body: I've started reading the book "Quantum Computation and Quantum Information" by Michael A. Nielsen and Issac L. Chuang, specifically chapter 10 (about quantum error correction), and I'm finding myself a bit confused as to the notations used.
In page 436, theorem 10.1, (10.16), I'd like to ask what is the "type" of each "object"? Is everything a $2^n \times 2^n$ matrix? Or is $E_i$ a vector, and ${E_i}^\dagger E_j$ the outer-product of two vectors?
An example for such $\epsilon$ with $\{E_i\}$ and $\alpha_{ij}$ would be appreciated.
The theorem:
Let $C$ be a quantum code,
and let $P$ be the projector onto $C$. Suppose $\epsilon$ is a quantum operation with
operation elements $\{E_i\}$. A necessary and sufficient condition for the existence
of an error-correction operation $R$ correcting $\epsilon$ on $C$ is that
$ P E_i^\dagger E_j P = \alpha_{ij} P $
for some Hermitian matrix $\alpha$ of complex numbers.
We call the operation elements $\{E_i\}$ for the noise $\epsilon$ errors, and if such an $R$ exists we say that $\{E_i\}$ constitutes a correctable set of errors.
Thank you very much :)
"
"['quantum-gate', 'quantum-state', 'entanglement', 'error-correction', 'physical-realization']"," Title: How many physical qubits are needed to encode a logical qubit on ion trap, superconducting, neutral atom, photonic QC?Body: How many physical qubits are needed to encode a logical qubit on an
-- ion trap,
-- superconducting,
-- neutral atom,
-- photonic,
-- spin
quantum computer based on today's technologies?
"
['channel-capacity']," Title: What is meant by a ""single-letter"" expression for the quantum channel capacity?Body: The quantity $Q_1(\Phi) = max_{\rho} I_C(\rho, \Phi)$, is called one-letter capacity of channel $\Phi$. I want to know, what is meant by the term "single-letter" capacity here, often used in information theory? The term can be found for example in this article (with free access).
"
"['quantum-gate', 'quantum-state', 'entanglement', 'error-correction', 'physical-realization']"," Title: What are the typical gate times for single-qubit and 2-qubit gates for ion trap, superconducting, neutral atom, photonic, spin QC?Body: What are the typical gate times for single-qubit and 2-qubit gates for
-- ion trap,
-- superconducting,
-- neutral atom,
-- photonic,
-- spin
quantum computers based on today's technologies?
"
"['hadamard', 'phase-estimation', 'phase-kickback']"," Title: Can we use Hadamard test to estimate phases?Body: There have been some questions discussing the Hadamard test and quantum phase estimation (QPE), but I did not find the answer to the following question. Suppose we are given $|\psi\rangle$, which is an eigenstate of $U$ such that $U|\psi\rangle = \exp(i\theta)|\psi\rangle$, and we are asked to estimate the phase $\theta$. Surely we can use QPE to estimate it, but can't we do the same with Hadamard test? In particular, my question consists of two parts
- Can we use Hadamard test to measure the real and imaginary part of $\langle\psi |U|\psi\rangle$ separately to find $\theta$? If the answer is yes, what is the advantage of QPE?
- How many measurements do I need in order to make sure the error of estimation is below $\epsilon$?
"
"['non-locality', 'bell-experiment', 'correlations']"," Title: What is the no-signaling set and how can it be related to other types of correlations?Body: The paper Bell nonlocality by Brunner et. al includes a striking diagram on page 7:
This is fascinating to me because it suggests a framework of categorizing correlations that encompasses classical, quantum, "no-signaling", and maybe full signaling. What is the theoretical framework underlying this diagram, the relations of the sets, and the limits of the polytope? Especially, what is the no-signaling set? Is it accurate to say it's a set of correlations that are super-quantum but sub-signaling which have not been found to exist in physical reality?
"
"['qiskit', 'programming', 'vqe']"," Title: Qiskit - Simpler way to create a HamiltonianBody: I am looking for an efficient way to create a Hamiltonian in Qiskit.
Following are my desired input and outputs
input: 'ZZI'
output: Z^Z^I, where Z and I are operators.
Here is how I am doing it right now:
from qiskit.circuit.library import TwoLocal
from qiskit.opflow import X, Y, Z, I
from qiskit.utils import QuantumInstance
from qiskit import *
from qiskit.algorithms.optimizers import COBYLA
from qiskit.algorithms import VQE
weights = [i for i in range(1,4)]
hamiltonian = weights[0]*(Z^Z^I) + weights[1]*(Z^I^Z) + weights[2]*(I^Z^Z)
num_qubits = hamiltonian.num_qubits
ansatz = TwoLocal(num_qubits, ['ry','rz'], 'cx', 'linear', reps=1, insert_barriers=True)
qi = QuantumInstance(Aer.get_backend('statevector_simulator'))
optimizer = COBYLA(maxiter=100)
vqe = VQE(ansatz, optimizer=optimizer, quantum_instance=qi)
result = vqe.compute_minimum_eigenvalue(hamiltonian)
If I have to run the same experiment on a 4 qubit, I need to redo the hamiltonian again. For example it would be:
hamiltonian = weights[0]*(Z^Z^I^I) + weights[1]*(Z^I^Z^I) + weights[2]*(Z^I^I^Z) + weights[3]*(I^Z^Z^I) + weights[4]*(I^Z^I^Z) + + weights[4]*(I^I^Z^Z)
This option is not scalable when I have a 15 qubit circuit. I would really appreciate it if anyone can guide me in a way that I can build a scalable hamiltonian.
I tried the following method and no luck:
from qiskit.quantum_info.operators import Operator, Pauli
hamiltonian = Operator(Pauli(label='ZZI')) + Operator(Pauli(label='ZIZ')) + Operator(Pauli(label='IZZ'))
Any guidance would be really appreciated!
"
"['textbook-and-exercises', 'nielsen-and-chuang', 'quantum-fourier-transform', 'phase-estimation']"," Title: Equating the state of the Phase Estimation algorithm to $\frac{1}{2^{t/2}}\sum_{k=0}^{2^t-1} e^{2\pi i\phi k}|k\rangle$Body: It is stated in the Phase Estimation algorithm in Page 222, Quantum Computation and Quantum Information by Nielsen and Chuang that
It seems to say that taking the inverse Quantum Fourier transform of the state gives
$$
|\phi_1\cdots\phi_t\rangle
$$
That means the state $\frac{1}{2^{t/2}}(|0\rangle+e^{2\pi i0.\phi_t}|1\rangle)(|0\rangle+e^{2\pi i0.\phi_{t-1}\phi_t}|1\rangle)\cdots (|0\rangle+e^{2\pi i0.\phi_{1}\cdots\phi_t}|1\rangle)$ is the Quantum Fourier transform of the state $|\phi_1\cdots\phi_t\rangle$.
But in the section of the derivation of the QFT it is given
As per Eq. 5.5 to 5.10 $$\frac{(|0\rangle+e^{2\pi i0.\phi_t}|1\rangle)(|0\rangle+e^{2\pi i0.\phi_{t-1}\phi_t}|1\rangle)\cdots (|0\rangle+e^{2\pi i0.\phi_{1}\cdots\phi_t}|1\rangle)}{2^{t/2}}=\frac{1}{2^{t/2}}\sum_{k=0}^{2^t-1}e^{2\pi i\phi k/\color{red}{2^t}}|k\rangle$$ But equations 5.20-5.21-5.22 seem to consider it is equal to $\frac{1}{2^{t/2}}\sum_{k=0}^{2^t-1}e^{2\pi i\phi k}|k\rangle$. How do I make sense of this ?
"
"['quantum-gate', 'complexity-theory', 'qaoa']"," Title: How to theoretically compare the complexity of quantum and classical algorithms?Body: I am working on reducing an NP class problem to a QUBO so can be solved with QAOA. I know that there is not a practical way to compare the performance as there is no QPU with enough qubits. I am doing the conceptual analysis of the performance, but not sure how I can theoretically compare the complexity of a Quantum algorithm with the Classical algorithm. Currently, I have considered the depth of the quantum circuit vs the time complexity of the classical algorithm. Are there any other metrics of a quantum algorithm for performance evaluation ?
Also, gate complexity(number of gates required) is also a way to evaluate the computational complexity, but I don't find it logical to use gate complexity as a metric to compare with the time complexity of a classical algorithm as execution of the circuit can happen in parallel. Also, I am not sure of considering the optimization(Transpilation) process. Suggestions are welcome.
"
"['quantum-gate', 'mathematics', 'pauli-gates', 'clifford-group']"," Title: Does conjugation by a Clifford send each non-identity Pauli to every other non-identity Pauli with equal frequency?Body: I see here in Olivia DeMatteo's notes, she states:
When we consider the action of the entire Clifford group on a single non-identity Pauli, it
maps that Pauli to each of the $d^2 − 1$ other possible Paulis an equal number of times. Since we
have $|C_n|/|P_n|$ possible Cliffords, we get mapped to each Pauli $\frac{|Cn|/|Pn|}{d^2−1}$ times.
This is also stated in this paper
[...] conjugation under the Clifford group maps
each nonidentity Pauli element to every other nonidentity
Pauli element with equal frequency.
I don't see a proof for this claim anywhere. Does anyone know of a proof for it? I think the proof for the cardinality of the Clifford group can be used to prove it, but I'm sure there is a simpler way to prove it.
"
"['ibm-q-experience', 'decoherence']"," Title: $T_2>2T_1$ qubits on the ibm_washington quantum processorBody: I have been checking out the parameters of the new ibm_washington processor and I have the following doubt about the calibration data provided by them. Checking out the relaxation and dephasing times I found out that some of their qubits are said to have $T_2>2T_1$. For example, see qubits Q2 or Q21. I understand that the dephasing times they provide are the ones obtained by Ramsey's experiments. However, relaxation and dephasing times are related by the expression
\begin{equation}
\frac{1}{T_2}=\frac{1}{2T_1}+\frac{1}{T_\phi},
\end{equation}
where $T_\phi$ is the pure dephasing time. From this equation, it can be seen that qubits that have $T_2>2T_1$ make no physical sense since that would imply that the pure dephasing time is negative. Therefore, I am wondering what's going on with the decoherence time values that are being provided by IBM for the newest processor. I have thought about measurement error, but qubits Q2 and Q21 are not even close to the Ramsey limit $T_2\approx 2T_1$. Maybe that due to the novelty of the system the data is not still accurate? Or may I be missing something?
"
"['complexity-theory', 'hhl-algorithm', 'speedup']"," Title: Is the exponential speedup and output $\langle x|M|x\rangle$ in contradiction in HHL algorithm?Body: Isn't the exponential speedup and the output $\langle x|M|x\rangle$ in contradiction in HHL algorithm? How can we print the solution vector $|x\rangle$ without losing the exponential speedup?
"
"['grovers-algorithm', 'oracles']"," Title: Using Quantum Bit String Comparision inside Grover's algorithmBody: Intro
I am trying to implement a quantum bit string comparator (QBSC) circuit (based on this paper) into a simple Grover's algorithm but I am unfortunately running into issues. The paper has two circuits: the actual bit string comparator,
and the implementation as a Grover Oracle,
Basically, the concept is that if you take the measurement on the $O_1$ and $O_2$ states, depending on the output you are able to assess if the bit string a is bigger, equal, or smaller than the bit string b (the bit strings are encoded in binary on the qubits a1, b1, a2, etc...). The second circuit is supposed to be an implementation in a Grover iteration, and it is not totally clear from the schematic how it is implemented. In the circuit, the bit string b is made to be into a superposition.
I have tried to create the latter circuit based on my knowledge of Grover's algorithm but cannot make it work.
Question
My first assumption was that the ancillary qubit in the $|-\rangle$ state was simply connected to the $|O_1\rangle$ state with a CNOT gate (which seems to be what the schematic shows). I also did the math on paper, and the gate does make the phase kickback on the wanted state. I also implemented the diffusion operator, but I think this is where my mistake lies.
My first thought, seeing that the formal definition of the operator is to work the reflection on the superposition of states, was to apply the diffusion operation only onto the b qubits and then measure those to get the marked states with a higher probability. So my circuit is such:
where I compare the string a = 010 to b in superposition. This should output me a lower probability of getting the bellow values 000, 001, and 010 (I don't care about the number of iterations at the moment, I just want to see that these are less probable than the other solutions), but I get an equal probability of all the states.
So then I thought that I might have to diffuse on all of the qubits, as they all take part in the phase kickback etc, but it just lead to the same result...
Would anybody have an idea of how to implement this circuit correctly? Or know what are my missteps? I don't have a huge background in QC, but have read the Nielsen book and understand the topic. I think I simply miss actual applications of it and as such may not understand how to really implement the algorithm itself and where to use the diffusion operator etc...
Thank you so much in advance!
"
['optimization']," Title: Is it possible to use a quantum algorithm to optimize quantum chipsBody: I'm really new to QC, so please excuse if this is a dumb question.
I was looking at the different Qubit configurations/arrangments in chips and was wondering if it is possible to create an algorithm to optimize them. On the most basic level, it's just an optimization problem for finding the arrangment with the lowest rate of error.
Wouldn't this be a prime use case for quantum computing?
"
"['quantum-gate', 'circuit-construction', 'quantum-circuit', 'performance', 'quantum-control']"," Title: How should I think about circuit metrics like ""qubit count,"" ""circuit depth,"" and ""gate count"" when dealing with the OpenQASM 3 `ctrl` modifier?Body: It seems like circuit metrics like qubit count, circuit depth, and gate count are pretty useful. Qubit count determines whether a it's even possible to run a program on resource-limited quantum computers, circuit depth determines how long qubits need to last (coherence time), and gate count seems like a reasonable measure of the total amount of work done in a circuit (and has implications for fault-tolerance). It should be obvious from looking at a circuit diagram that the gate count is bounded by the qubit count times the circuit depth. (Are there any other important metrics I should be considering?)
From what I've seen, these metrics tend to be used in contexts where gates in a quantum circuit are limited in size; for example, a gate set that includes only single-qubit gates and CNOT gates. This is the gate set used in OpenQASM 2, and I feel like I understand how these metrics can be automatically calculated for an OpenQASM 2 program.
However, OpenQASM 3 is more complicated. It includes a ctrl modifier that can be applied to arbitrary quantum gates, including ones composed from smaller gates. For example, the CCX (Toffoli) gate is defined like this:
gate ccx a, b, c { ctrl @ ctrl @ x a, b, c; }
I know that there are ways to decompose multi-controlled gates like this into a polynomial number of one- and two-qubit gates, but I'm not sure if that's the right way to think about it. In particular, I have the following questions:
- Are OpenQASM 3 compilers for near-term quantum devices expected to decompose multi-controlled gates into one- and two-qubit gates? If write an OpenQASM 3 program that uses a five-qubit "CCCCX" gate (controlled-controlled-controlled-controlled not) and run it on a near-term quantum computer, should I expect that the compiler will be performing some sort of decomposition into smaller gates? Or is there some clever physical trick that avoids this kind of decomposition?
- If a decomposition is required, is there a particular decomposition that near-term quantum devices are expected to use? There are multiple ways to decompose a CCCCX gate into smaller gates, some of which use ancillae and some of which don't. It seems that OpenQASM 3 doesn't specify a particular decomposition.
- Do metrics like "qubit count," "circuit depth," and "gate count" even make sense in a computational model that includes
ctrl modifiers? Are there other metrics that are more appropriate in this context? More generally, how can I compare the theoretical performance of two OpenQASM 3 programs without actually running them?
- Assuming these metrics are appropriate, how should they be computed? Do I simply decompose the circuit into one- and two-qubit gates and then use the metrics of the decomposition? If so, it seems the answer to this question depends on the answer to question 2.
Answers to any of these questions would be appreciated!
"
"['programming', 'vqe', 'pennylane']"," Title: VQE from scratch, what have I got wrong?Body: I've been working on a code to run VQE with a grouped measurement. For some reason, my expectation values are slightly off from those computed by pennylane, the software I decided to use for this little project. I've been staring at my expectation value function exp_val, and I can't tell why it's wrong.
This is the code:
import pennylane as qml
from pennylane import qchem
import numpy as np
symbols = ["H", "H"]
coordinates = np.array([0.0, 0.0, -0.6614, 0.0, 0.0, 0.6614])
h2_ham, n_qubits = qchem.molecular_hamiltonian(symbols, coordinates)
n_shots = 1000
dev_noisy = qml.device('default.qubit', wires = n_qubits, shots = n_shots)
@qml.qnode(dev_noisy)
def VQE_circuit(params, group = None, n_qubits = None):
qml.StronglyEntanglingLayers(params, wires = range(n_qubits))
rotations = qml.grouping.diagonalize_qwc_pauli_words(group)[0]
return qml.probs(wires=range(n_qubits))
import autograd.numpy as agnp
drawer = qml.draw(VQE_circuit)
def exp_val(results, coeffs, groupings):
E = 0
for i, result in enumerate(results):
#Process each list of counts (probs)
ops = groupings[i]
coeff_list = coeffs[i]
#print(drawer(params, group = groupings[i], n_qubits = n_qubits))
for op_idx, op in enumerate(ops):
##calculate expval for each operator in group
if op.name == 'Identity':
E += coeff_list[op_idx]
else:
exp_val = 0
for c_idx, count in enumerate(result):
#process bitstring in result
idxs = op.wires.toarray()
bits = format(c_idx, "b").zfill(n_qubits)
sub_bits = [bits[i] for i in idxs]
par = sub_bits.count('1')%2
sign = (-1)**par
exp_val += sign*count
exp_val *= coeff_list[op_idx]
E += exp_val
return E
print("\n", h2_ham, "\n")
groupings, coeffs = qml.grouping.group_observables(h2_ham.terms[1], h2_ham.terms[0], grouping_type = 'qwc', method = 'rlf')
param_shape = qml.templates.StronglyEntanglingLayers.shape(n_layers=3, n_wires=n_qubits)
params = np.random.normal(scale=0.1, size=param_shape)
results = [VQE_circuit(params, group = group, n_qubits = n_qubits) for group in groupings]
print(exp_val(results, coeffs, groupings))
##VQE execution:
def naive_cost(params):
results = [VQE_circuit(params, group = group, n_qubits = n_qubits) for group in groupings]
return exp_val(results, coeffs, groupings)
sparse = qml.utils.sparse_hamiltonian(h2_ham).toarray()
gs_E = np.linalg.eigvalsh(sparse)[0]
print("GSE: ", gs_E)
import scipy.optimize as opt
param_shape = qml.templates.StronglyEntanglingLayers.shape(n_layers=5, n_wires=n_qubits)
params = np.random.normal(scale=0.1, size=param_shape)
opt = qml.AdagradOptimizer(0.05)
max_iteration = 100
conv_tol = 1e-6
energy = [naive_cost(params)]
for n in range(max_iteration):
params, prev_E = opt.step_and_cost(naive_cost, params)
energy.append(naive_cost(params))
conv = np.abs(energy[-1]-prev_E)
if n % 2 == 0:
print(f"Step = {n}, Energy = {energy[-1]:.8f} Ha")
if conv <= conv_tol:
break
#print(energy)
print("FOUND GROUND STATE E: ", np.min(energy))
print("FINAL params: ", params)
print("REAL GROUND STATE E: ", gs_E)
Am I doing something obviously wrong? I've checked to ensure the endianness of the bits is correct, I made sure to calculate parities based on the active qubit indices for the desired observable, I made sure not to include a parity calculation when computing expected value of identity operators. I've triple checked that the coefficients are being applied to the correct operators, that the circuits are appended with the correct measurement circuits for the given operator in the group. Amongst these checks, I can't seem to find the flaw in my programming logic. Having an extra pair of eyes on this would be extremely helpful.
All the best,
cuhrazatee
PS:
Here's the code using Pennylane's built in exp_val.
from openfermion.ops.operators.qubit_operator import QubitOperator
import pennylane as qml
from pennylane import qchem
import numpy as np
from functools import partial
from pennylane.measure import state
from pennylane.ops.qubit import observables
from pennylane.templates import UCCSD
import matplotlib.pyplot as plt
symbols = ["H", "H"]
coordinates = np.array([0.0, 0.0, -0.6614, 0.0, 0.0, 0.6614])
h2_ham, n_qubits = qchem.molecular_hamiltonian(symbols, coordinates)
n_electrons = 2
singles, doubles = qchem.excitations(n_electrons, n_qubits)
s_wires, d_wires = qchem.excitations_to_wires(singles, doubles)
ref_state = qchem.hf_state(n_electrons, n_qubits)
ansatz = partial(UCCSD, init_state = ref_state, s_wires = s_wires, d_wires = d_wires)
groupings, coeffs = qml.grouping.group_observables(h2_ham.terms[1], h2_ham.terms[0], grouping_type = 'qwc', method = 'rlf')
n_shots = 10000
dev_noisy = qml.device('default.qubit', wires = n_qubits, shots = n_shots)
sparse = qml.utils.sparse_hamiltonian(h2_ham).toarray()
gs_E = np.linalg.eigvalsh(sparse)[0]
print("GSE: ", gs_E)
param_shape = qml.templates.StronglyEntanglingLayers.shape(n_layers=5, n_wires=n_qubits)
params = np.random.normal(scale=0.1, size=param_shape)
optimal_params = [[[0.15300575748799206, 0.0802866250748122, 0.6612327808749161],
[-0.012197292985330403, 1.0054708209216188, -0.5031298708940922],
[0.4871116388974964, 0.8755791036972337, 0.15300349217856668],
[0.2125674641016197, -0.3988028820299284, -0.5903810690276766]],
[[-0.26227065702483116, 0.7762008921102848, 0.20421958031876591],
[-0.11210374173720475, -0.7158851608015426, -0.945090563307313],
[-0.20041447281024863, -0.43875447105339715, -0.10552844761324888],
[0.017868138476782234, -0.4067704016345291, 0.19911933547123295]],
[[-0.1170885274951583, -0.40203947157121894, -0.44851762637470327],
[-0.2715291337140317, 0.6888494094283752, 0.5389027752311034],
[-0.5191082830999312, 0.4426962606005164, -0.25932474764548114],
[0.8138172470220708, -0.54678942509227, 0.4102491578027457]],
[[0.7676993827422776, -0.47721469081406376, 0.6337393057184456],
[-0.6553402727229024, 0.8955375499127577, 0.5789282160827474],
[0.6570560582613835, -0.8518341967262695, -0.6023881439081624],
[0.040387149769954125, 0.3040045252649316, -0.38193967606295326]],
[[0.42336490227621815, -0.3869902716443922, 0.27822533007353994],
[1.2170710775127433, 0.6959673154584948, -0.11538272838636159],
[0.33436903989516936, -0.7268804688737179, 0.49919014014531526],
[0.818911996077618, -0.6280017753881122, 0.553169606547251]]]
cost = qml.ExpvalCost(qml.StronglyEntanglingLayers, h2_ham, dev_noisy, optimize=True)
opt = qml.AdagradOptimizer(0.06)
max_iteration = 100
conv_tol = 1e-6
energy = [cost(params)]
for n in range(max_iteration):
params, prev_E = opt.step_and_cost(cost, params)
energy.append(cost(params))
conv = np.abs(energy[-1]-prev_E)
if n % 2 == 0:
print(f"Step = {n}, Energy = {energy[-1]:.8f} Ha")
if conv <= conv_tol:
break
#print(energy)
print("FOUND GROUND STATE E: ", np.min(energy))
print("REAL GROUND STATE E: ", gs_E)
```
"
"['quantum-state', 'physical-qubit']"," Title: Why can't we simulate a Qubit using classical computer?Body: I am completely a noob in terms of quantum computing, have watched several videos to understand what Quantum computers are trying to achieve.
I am a programmer of classical computers. We have a concept called Duck typing :
Duck typing in computer programming is an application of the duck test—"If it walks like a duck and it quacks like a duck, then it must be a duck"—to determine whether an object can be used for a particular purpose.
So if we jot down the properties of a qubit, why can't we simulate it with our classical computer, and then array them to create further stronger computers?
"
['amazon-braket']," Title: Expected value of Z operator in GHZ stateBody: I'm following this notebook written using amazon-braket, and there's a statement I don't understand
... To reiterate, the following output is expected:
$$\left|\mathrm{GHZ}\right> = \frac{1}{\sqrt{2}}\left(\left|0,0,0\right> + \left|1,1,1\right>\right) = \left[\frac{1}{\sqrt{2}},0,0,0,0,0,0,\frac{1}{\sqrt{2}}\right],
$$
for which $\color{red}{\left<ZZZ\right>=0}$ and $\left<111|\mathrm{GHZ}\right>=\frac{1}{\sqrt{2}}$.
The highlighted expression is the one I'm having troubles with. Isn't that expectation value $1/2$ instead?
\begin{eqnarray}
\left<\mathrm{GHZ}|ZZZ|\mathrm{GHZ}\right> &=& \frac{1}{2}\left(
\left<000|ZZZ|000\right> +
\left<000|ZZZ|111\right> +
\left<111|ZZZ|000\right> +
\left<111|ZZZ|111\right>
\right) \\
&=& \frac{1}{2}\left(0 + 0 + 0 + 1 \right) \\
&=& \frac{1}{2}
\end{eqnarray}
Thanks!
"
"['qiskit', 'qubit-mapping']"," Title: Coupling maps in quantum computationBody: Perhaps a bit naive question from my side, but I could not find any satisfactory answer elsewhere:
What exactly are the coupling maps in quantum computation and, more particularly, how do those maps translate to CouplingMap objects in qiskit?
Intuitively, I do get that it is a way to express a connections between the qubits, but are then those physical connections between the physical qubits or something else? Any explanation here would be welcome.
If it helps in any way, for instance, the figure below is often used to illustrate coupling map for a particular qiskit hardware setup, which I unfortunately cannot read at this point:
"
"['information-theory', 'entropy', 'max-entropy']"," Title: Max-relative entropy quasi-convexity inequality under partial traceBody: The max-relative entropy between two states is defined as
$$D_{\max }(\rho \| \sigma):=\log \min \{\lambda: \rho \leq \lambda \sigma\}.$$
It is known that the max-relative entropy is quasi-convex. That is, for $\rho=\sum_{i \in I} p_{i} \rho_{i}$ and $\sigma=\sum_{i \in I} p_{i} \sigma_{i}$ where $\rho_i, \sigma_i$ are quantum states and $p$ is a probability vector, it holds that
$$D_{\max }(\rho \| \sigma) \leq \max _{i \in I} D_{\max }\left(\rho_{i} \| \sigma_{i}\right).$$
I now look at a triparite state $\rho_{ABC} = \sum_i p_i\rho_{ABC}^i$. Is there any $i$ for which both the following inequalities hold?
$$D_{\max}(\rho_{ABC}\|\rho_{AB}\otimes\rho_C) \leq D_{\max}(\rho_{ABC}^i\|\rho_{AB}^i\otimes\rho_C^i)$$
$$D_{\max}(\rho_{AC}\|\rho_{A}\otimes\rho_C) \leq D_{\max}(\rho_{AC}^i\|\rho_{A}^i\otimes\rho_C^i)$$
Each individual equation holds due to quasi-convexity but jointly, it is not clear how to make them both hold for one $i$.
"
"['programming', 'error-correction']"," Title: Is there any software package tracking Pauli errors in stabilizing circuits with GUI?Body: I want to track the Pauli errors propagating in stabilizer circuits like surface code. I wonder whether there is any developed package that can do this elegantly. It will be better if it has GUI that I can throw Pauli errors in conveniently.
"
"['quantum-gate', 'quantum-state']"," Title: How do I construt a mixed state for an arbitrary symmetric matrix?Body: A symmetric matrix can be seen as a density matrix. If I have an arbitrary symmetrical matrix, can I use a quantum random access memory to construct a corresponding mixed state? What kind of quantum RAM do I need?
"
"['nielsen-and-chuang', 'phase-estimation']"," Title: Derivation of efficiency of Phase Estimation AlgorithmBody: In the section Performance and requirements of the phase estimation algorithm of Page 224, Quantum Computation and Quantum Information by Nielsen and Chuang
In order to obtain Eq. 5.27 we have shifted the index $l$ by subtracting $2^{t-1}-1$, thereby changing the range $0\leq l\leq 2^t-1$ to $-2^{t-1}+1\leq l\leq 2.2^{t-1}-1-2^{t-1}+1$ or $-2^{t-1}+1\leq l\leq 2^{t-1}$ or $-2^{t-1}< l\leq 2^{t-1}$.
For deriving Eq. 5.29 it seems to make use of the fact that $\sin|x|\geq 2|x|/\pi$ when $-\pi/2\leq x\leq\pi/2$ since $|1-\exp(i\theta)|=2|\sin(\theta/2)|$.
Now,
$$
-2^{t-1}<l\leq 2^{t-1} \quad\&\quad 0\leq \delta\leq 2^{-t} \\
\implies -2^{-1}<-l/2^t\leq 2^{-1}\implies -2^{-1}<\delta-l/2^t\leq 2^{-1}+2^{-t}\\
\implies -\pi<2\pi(\delta-l/2^t)\leq \pi+2\pi2^{-t}
$$
How do we obtain that $-\pi\leq 2\pi(\delta-l/2^t)\leq \pi$ ?
"
"['algorithm', 'nielsen-and-chuang', 'shors-algorithm', 'phase-estimation']"," Title: Register size in factoring 15 using Shor's algorithmBody: In Nielsen and Chuang's book: Quantum computation and quantum information (2016), there is an example in Box 5.4 which shows how to factor $15$ using Shor's algorithm. I am confused about a particular point in this example. They start with the state $|0\rangle|0\rangle$ and create the state
$$ \frac{1}{\sqrt{2^t}}\sum_{k=0}^{2^t-1}|k\rangle|0\rangle=\frac{1}{\sqrt{2^t}}\left[|0\rangle+|1\rangle+...+|2^t-1\rangle\right]. $$
The text says they are choosing $ t=11 $ to ensure an error probability $ \epsilon $ of at most 1/4. I have been trying to figure out where this comes from. Looking back to equation $(5.35)$ it says that
$$ t=n+\Big{\lceil}\log\left(2+\frac{1}{2\epsilon}\right)\Big{\rceil}. $$
For 15, $ n=4 $, right? How does $ t=11 $ work out?
Update: Okay, I have been doing alot of searching through this book and on the internet. I have come to Box 5.2 in Nielsen and Chuang (2016) and I find an expression that gives $ t=1 $. Quoting the text:
"We use $ t=2L+1+\lceil\log(2+1/(2\epsilon))\rceil=\mathcal{O}(L) $, so a total of $ t-1-\mathcal{O}(L) $ squaring operations is performed at a total cost of $ \mathcal{O}(L^3) $ for the first stage."
So that is where the $ t=1 $ comes from. Going back to the expression for $ t $, this works if $ n\rightarrow 2L+1 $. According to page 227 of the text (Nielsen and Chuang, 2016), this gives and estimate for the phase accurate to $ 2L+1 $ bits. Still feeling a bit confused, but I think things are becoming clear.
"
"['algorithm', 'grovers-algorithm']"," Title: Soundness of Grover's search applicationBody: I find that some algorithms can be sped up using Grover's search, but I have a question about the soundness of new algorithms. Since Grover's search is a probabilistic method, it has a chance to make mistakes during the program, resulting the algorithm result different from classical methods. Do people pay attention to speed up the algorithms with a tolerance on the soundness? Or, is there a way to keep the soundness while the speedup achieves?
"
"['qiskit', 'quantum-fourier-transform', 'linear-algebra']"," Title: Hamiltonian of Qiskit QFT is not hermitianBody: I am trying to generate the Hamiltonian of a quantum Fourier transform by taking the log of the corresponding unitary using qiskit and scipy.
I don't find a hermitian matrix. Why?
import numpy as np
from qiskit.circuit.library import QFT
from scipy.linalg import logm, norm
from qiskit.quantum_info import Operator
circuit = QFT(num_qubits=4, do_swaps=True)
op = Operator(circuit)
U = op.data
H = 1j*logm(U)
print(norm(U@U.T.conj()-np.identity(2**4))) #check if U is unitary
print(norm(H-H.T.conj())) #check if H is hermitian
Note that I find U to be unitary and that there is no issue when do_swaps=False.
"
"['programming', 'ibm-q-experience', 'error-correction', 'error-mitigation']"," Title: How can I add readout error in constructing a quantum noise model?Body: I'm trying to construct a quantum noise model with readout error only: qiskit.providers.aer.noise.NoiseModel.add_readout_error. However, when I try to specify the qubits for my error (there will be 3 qubits), it seems like the program doesn't have a very clear constraint on how I can define that. Here's my code:
prob_nmc = [[0.571787, 0.117113, 0.117113, 0.023987, 0.117113, 0.023987,
0.023987, 0.004913],
[0.103335, 0.585565, 0.021165, 0.119935, 0.021165, 0.119935,
0.004335, 0.024565],
[0.103335, 0.021165, 0.585565, 0.119935, 0.021165, 0.004335,
0.119935, 0.024565],
[0.018675, 0.105825, 0.105825, 0.599675, 0.003825, 0.021675,
0.021675, 0.122825],
[0.103335, 0.021165, 0.021165, 0.004335, 0.585565, 0.119935,
0.119935, 0.024565],
[0.018675, 0.105825, 0.003825, 0.021675, 0.105825, 0.599675,
0.021675, 0.122825],
[0.018675, 0.003825, 0.105825, 0.021675, 0.105825, 0.021675,
0.599675, 0.122825],
[0.003375, 0.019125, 0.019125, 0.108375, 0.019125, 0.108375,
0.108375, 0.614125]]
readout_noise_model_nmc = NoiseModel(basis_gates = ['cx', 'id', 'reset', 'rz', 'sx', 'x'])
readout_noise_model_nmc.add_readout_error(prob_nmc, [0,1,2])
print(readout_noise_model_nmc)
Where prob_nmc is my 8 by 8 confusion matrix. The simulation result based on this model and qubit list doesn't quite make sense, so I wonder if there's anything wrong with the way I added the readout error. I found the code still works if I replace [0,1,2] with [0,-2,1], the latter is obviously incorrect.
Is there anything wrong with my error model? I thought [0,1,2] represents the noise of 'physical qubits' of my simulation model. Am I understanding that correct? Thanks!
"
"['information-theory', 'fidelity']"," Title: Properties of the generalized fidelity for subnormalized statesBody: The generalized fidelity for quantum states that may be sub-normalized is given by (Defn 3.12)
$$F_{*}(\rho, \tau):=\left(\operatorname{Tr}|\sqrt{\rho} \sqrt{\tau}|+\sqrt{(1-\operatorname{Tr} \rho)(1-\operatorname{Tr} \tau)}\right)^{2},$$
where $|A| = \sqrt{A^\dagger A}$.
Is this generalized fidelity also bounded between $0$ and $1$? How can one see this?
"
['amplitude-amplification']," Title: Amplifying entangled qubitsBody: Suppose I have a three-qubit entangled state of the following form:
$$
|00\rangle|\psi_1\rangle + |01\rangle|\psi_2\rangle + |10\rangle|\psi_3\rangle + |11\rangle|\psi_4\rangle
$$
I refer to the first two qubits as address qubits. The third qubit is the data qubit.
I want to be able to extract some arbitrary $|\psi_i\rangle$, but collapsing the first two qubits and post-selecting has a success probability of $1/4$. And this probability gets even worse with more address qubits: $1/2^n$.
Trying amplitude amplification on the address qubits does not work as the amplitudes of the data qubit also get modified.
Is there any procedure that allows me to increase the success probability of $1/2^n$? Or maybe some proof that it is not possible to do such thing?
"
"['quantum-state', 'quantum-circuit', 'initialization']"," Title: From the final quantum state to the quantum circuit compositionBody: When I build a quantum circuit and my initial state is the one composed only by zeros ($|000\ldots 0\rangle$), I have a final state $|\psi\rangle$ that is the result of the application of the quantum circuit to $|000\ldots 0\rangle$.
My question is: if I have the final state $|\psi\rangle$ (or something similar, like the probability related to each element of the computational basis) and I know that my initial state is $|000\ldots 0\rangle$, is there a way (exact, variational, etc.) to find one of the quantum circuit that applied to $|000\ldots 0\rangle$ give me $|\psi\rangle$?
"
"['qiskit', 'programming']"," Title: What is the difference between Qiskit Terra, Aer, Ignis and Aqua?Body: I am going through the Qiskit tutorials and they have an article on each of the above 4. however, As a beginner, I am not very clear. Could anyone share some insights on these?
"
['quantum-gate']," Title: How to to build/simulate Toffoli gate using CSWAP (Fredkin) gates?Body: I have seen a question about the other way (CSWAP from CCNOT). Both are 3 qubit gates.
Is there a way to simulate CCnot from Fredkin gates?
"
['superposition']," Title: How to create uniform superpostion of N states where N is not power of 2Body: Many textbooks only consider superposition of N states where N is a power of 2. For example, H|0> is a uniform superpostion of |0> and |1> and N=2.
How to construct quantum circuit for a uniform superpostion of arbitrary number of states, like N=3?
"
"['quantum-state', 'information-theory']"," Title: How many minimum Quantum Rats are needed to figure out which bottle contains poison?Body: For the classical Poison and Rat puzzle, we need at least $\lceil\log_2({\rm bottles})\rceil$ rats to figure out the poisoned bottle.
If we have Schrödinger’s quantum rats, can we use fewer rats(qubits) to determine which bottle is poisonous?
"
"['qiskit', 'entanglement', 'quantum-circuit']"," Title: What is the difference between the two entanglement circuits?Body: For a three qubits system to be in an entanglement(GHZ) state, the circuit can be built as per Qiskit,
Here, the control bit of the second X gate is on q0. what if the control bit is shifted to q1. This also leads to entanglement. what is the difference between the two different ways?
Further to my question, I did the same for 5 qubits, I get different results:
which one is correct?
"
['grovers-algorithm']," Title: Confusion about the Grover algorithmBody: Suppose I have a list of items: $(a, b, c, d, e, f, g, h)$. I could encode these letters in $3$ qubits such that $a = \vert 000\rangle, b = \vert 001\rangle, \cdots, h = \vert 111\rangle$. If I'm looking for $f$, my oracle is an $8\times 8$ matrix with $1'$s on the diagonal and a $-1$ as the $6^{th}$ element on the diagonal. Then I apply the Grover algorithm and get $f$.
But, what happens if $f$ is encoded as $\vert 111\rangle$ and I don't know that? How do I know how to construct my oracle?
"
"['pennylane', 'fubini-study-metric']"," Title: What is the $K_i$ in Fubini-Study tensor?Body: Following this paper and tutorial from Pennylane, I'm trying to re-calculate the Fubini-Study tensor:
$$
g_{i j}^{(\ell)}=\left\langle\psi_{\ell-1}\left|K_{i} K_{j}\right| \psi_{\ell-1}\right\rangle-\left\langle\psi_{\ell-1}\left|K_{i}\right| \psi_{\ell-1}\right\rangle\left\langle\psi_{\ell-1}\left|K_{j}\right| \psi_{\ell-1}\right\rangle
$$
where
$$
\left|\psi_{\ell-1}\right\rangle=V_{\ell-1}\left(\theta_{\ell-1}\right) W_{\ell-1} \cdots V_{0}\left(\theta_{0}\right) W_{0}\left|\psi_{0}\right\rangle
$$
with:
$K_i$ is the generator of the parametrized operation. In this case, when calculating $g_{0,1}^{(0)}$, I understand that $K_0=K_1=-\frac{1}{2}Z$ with $Z$ is the 2x2 Pauli matrix. But $|\psi\rangle$ is the state of 3 qubits, so how to perform $g_{0,1}^{(0)}$? Or $K_0=-\frac{1}{2}Z\otimes I\otimes I$ and $K_1=-\frac{1}{2}I\otimes Z\otimes I$?
Thanks for reading!
"
['qiskit']," Title: In ""from qiskit import *"" , how can I check the entire spectrum of imports availableBody: In some codes, I have seen "from qiskit import QuantumCircuit, aer, execute". Some say "From qiskit import *".
This is python related, I understand, but with respect to Quantum World,
- In first case, I am explicitly importing the objects(correct me if this is not the wright word) . In case 2, I am importing everything. Is there an advantage of doing case 1? In case 2, cos of generic nature, should not it be more useful in coding?
- what is the full spectrum of *. How to check that for qiskit?
"
"['measurement', 'probability', 'correlations']"," Title: Why does measurement in computational basis result in classic probability?Body: I am working on a problem related to finding the limits on the joint probability distributions/correlations of three or more quantum systems who share entangled states, after measurement.
I have been told that measurement in the computational basis is equivalent to having a classical probability distribution and is in fact not quantum at all. But I don't understand why this is the case. What other basis do I need to consider? Or if I need to have a general representation of measurement in an arbitrary basis what should that be like?
"
['qiskit']," Title: For the circuit below, could anyone explain the results I get?Body: This was sent to qasm_simulator, and the results look like:
It seems qasm has added classical bits but why there are gates on the right side of the line. What do they mean?
Also, what does the result mean? with the pair like data?
Circuit :
"
['non-locality']," Title: What are the vertices of the no-signalling set $\mathcal{NS}$?Body: Consider the standard 2-2 Bell scenario, with two parties each one choosing between two measurement settings, with each measurement setting leading to one of two possible measurement outcomes.
Consider the space of possible corresponding behaviours, that is, conditional probability distributions $(p(ab|xy))_{a,b,x,y\in\{0,1\}}$.
As also discussed here, it is standard in this context to distinguish between different classes of behaviours. I'll mention in particular the set $\mathcal L$ of local behaviours, the set $\mathcal Q$ of quantum behaviours, and the set $\mathcal{NS}$ of no-signalling behaviours.
These are all clearly convex sets. In particular, $\mathcal L$ can be easily characterised via its vertices, which are bound to be the local deterministic behaviours of the form $\boldsymbol{e}_{a_0 a_1 b_0 b_1}\in\mathbb R^{16}$, which are ($16$) behaviours whose only 4 nonzero elements are $(\boldsymbol{e}_{a_0 a_1 b_0 b_1})_{a_x b_y,xy}=1$, for all $x,y\in\{0,1\}$.
One way to further clarify what these vectors are is representing them as 4x4 matrices with columns representing measurement choices and rows measurement outcomes (sorted in the standard way as binary numbers). Explicitly, these are
$$\tiny
\boldsymbol{e}_{0000}=\begin{pmatrix}1&1&1&1\\0&0&0&0\\0&0&0&0\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{0011}=\begin{pmatrix}0&0&0&0\\1&1&1&1\\0&0&0&0\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{1100}=\begin{pmatrix}0&0&0&0\\0&0&0&0\\1&1&1&1\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{1111}=\begin{pmatrix}0&0&0&0\\0&0&0&0\\0&0&0&0\\1&1&1&1\end{pmatrix}, \\\tiny
\boldsymbol{e}_{0001}=\begin{pmatrix}1&0&1&0\\0&1&0&1\\0&0&0&0\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{0010}=\begin{pmatrix}0&1&0&1\\1&0&1&0\\0&0&0&0\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{0100}=\begin{pmatrix}1&1&0&0\\0&0&0&0\\0&0&1&1\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{0101}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}, \\\tiny
\boldsymbol{e}_{0110}=\begin{pmatrix}0&1&0&0\\1&0&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}, \quad
\boldsymbol{e}_{0111}=\begin{pmatrix}0&0&0&0\\1&1&0&0\\0&0&0&0\\0&0&1&1\end{pmatrix}, \quad
\boldsymbol{e}_{1000}=\begin{pmatrix}0&0&1&1\\0&0&0&0\\1&1&0&0\\0&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{1001}=\begin{pmatrix}0&0&1&0\\0&0&0&1\\1&0&0&0\\0&1&0&0\end{pmatrix}, \\\tiny
\boldsymbol{e}_{1010}=\begin{pmatrix}0&0&0&1\\0&0&1&0\\0&1&0&0\\1&0&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{1011}=\begin{pmatrix}0&0&0&0\\0&0&1&1\\0&0&0&0\\1&1&0&0\end{pmatrix}, \quad
\boldsymbol{e}_{1101}=\begin{pmatrix}0&0&0&0\\0&0&0&0\\1&0&1&0\\0&1&0&1\end{pmatrix}, \quad
\boldsymbol{e}_{1110}=\begin{pmatrix}0&0&0&0\\0&0&0&0\\0&1&0&1\\1&0&1&0\end{pmatrix}.
$$
For example, $\boldsymbol{e}_{0000}$ represents the situation where both outcomes are $0$ regardless of the measurement choices, whereas $\boldsymbol{e}_{0001}$ the one where Bob gets the outcome "1" whenever he uses the measurement setting "1", and any other outcome is "0".
A recognisable feature is that these have a tensor product structure, representing the locality of the behaviours:
$$(\boldsymbol{e}_{a_0 a_1 b_0 b_1})_{ab,xy} = (\boldsymbol{e}_{a_0 a_1})_{a,x}(\boldsymbol{e}_{b_0 b_1})_{b,y}
= (\boldsymbol{e}_{a_0 a_1}\otimes \boldsymbol{e}_{b_0 b_1})_{ab,xy},$$
where $\boldsymbol{e}_{a_0 a_1}\in\mathbb R^2$ represents a possible behaviour representing a deterministic outcome assignment with $a_0$ observed whenever the measurement choice is $0$, and $a_1$ observed whenever the measurement choice is $1$.
The set $\mathcal L$ can then be characterised as the convex hull of these 16 vectors.
Which brings me to my question: can a similarly simple characterisation be done for the no-signalling set, $\mathcal{NS}$?
In other words, assuming $\mathcal{NS}$ can also be characterised as the convex hull of a finite number of vectors, what are these vertices?
"
"['programming', 'cirq', 'openfermion']"," Title: Openfermion state transformation from Bravyi-Kitaev basis to occupation numberBody: I'm working in the Bravyi-Kitaev basis implemented by the openfermion.bravyi_kitaev() function to find the ground state of a fermionic operator in the BK representation. Now I want to convert this ground state from the BK basis to the occupation number basis. I couldn't find any functions implementing this, and the transformation matrix shown in arXiv:1208.5986 is not the correct one. Has anyone managed to find a transform between these two bases?
"
"['quantum-gate', 'error-correction']"," Title: Is Toffoli a fault tolerant transversal gate of the repetition code on bit-flip-error-only qubits?Body: Suppose you have physical qubits that only have bit flip noise (no phase flip noise, no unwanted measurements, no leakage, no amplitude decay, etc; just unwanted X rotations). Such qubits can be kept alive, protected from the bit flip noise, using just the repetition code. And you are doing so.
A transversal Toffoli between logical qubits A, B, C works by applying physical Toffoli gates pairwise (tripletwise?) across the physical qubits making up A, B, and C.
You attempt to apply a logical Toffoli between your repetition code qubits by applying transversal Toffolis across them. Is this correct? Is the transversal Toffoli a fault tolerant logical Toffoli, when applied to repetition codes, given that the only type of noise present is bit flip noise?
"
"['cryptography', 'key-distribution']"," Title: Why is Measurement Device Independent (MDI) Quantum Key Distribution (QKD) truly MDI?Body: This is a repost from a question I posted in the physics stack exchange
I am having a hard time understanding why MDI-QKD is truly measurement device independent. My current vision is that Charlie (the one who performs the Bell state measurements) is simply sampling the qubits Alice and Bob sent: the ones for which the measurement does not fail should have certain correlations.
But why is this schema imune against all detector side channels?
"
['ibm-q-experience']," Title: Accessing more than 5-qubit IBM Quantum ComputerBody: I'm doing a university project related to Physics using IBM Qiskit. I want to know how to get access to Quantum Computers with more than 5-qubits (preferably more than 10 qubits)? My account information says "Public Access", but is it possible to upgrade it? If not please tell all about the different profiles or status necessary to access different qubits-Quantum Computer.
Thank you
"
"['entanglement', 'teleportation']"," Title: Why doesn't this simpler teleportation idea work?Body: This circuit:
The first (upper) qubit is the one we want to teleport, so could start it any state, call $\alpha|0\rangle+\beta|1\rangle$. Our goal is to teleport it to the third (bottom) bit.
After entangling the second and third bits, we have
$$\frac{1}{\sqrt2}\Big(\alpha(|0\rangle\otimes(|00\rangle+|11\rangle))+\beta(|1\rangle\otimes(|00\rangle+|11\rangle))\Big)$$
After applying CNOT from the first to second bit, we have
$$\frac{1}{\sqrt2}\Big(\alpha(|0\rangle\otimes(|00\rangle+|11\rangle))+\beta(|1\rangle\otimes(|10\rangle+|01\rangle))\Big)$$
At this point, we measure the second qubit. If it's $|0\rangle$, then we end up in the state
$$\alpha(|0\rangle\otimes|00\rangle)+\beta(|1\rangle\otimes|01\rangle)=\alpha|000\rangle+\beta|101\rangle$$
If it's $|1\rangle$, then we end up in
$$\alpha(|0\rangle\otimes|11\rangle)+\beta(|1\rangle\otimes|10\rangle)=\alpha|011\rangle+\beta|110\rangle$$
In this case, we apply X to the third bit, yielding
$$\alpha|010\rangle+\beta|111\rangle$$
In either case, if we have access to the third qubit only, it appears to be in the state $\alpha|0\rangle+\beta|1\rangle$, which is what we want. What's wrong with this scheme? The only thing I can think of is that it "doesn't count" as teleportation because the first and third qubits are still entangled at the end. But I thought the main point of teleportation was just to transmit a state using only classical data and a pre-entangled pair, in which case this does seem to "count".
"
"['textbook-and-exercises', 'nielsen-and-chuang']"," Title: Factoring Decision Problem - why not in P?Body: Nielsen and Chuang, 10th Anniversary Edition, page 142, refers to the following (classical) computation problem: Given a composite integer m and L <m, does m have a non-trivial
factor less than L?
They say the problem is thought not to be the the polynomial time class P. I do not see this; it seems you could just perform trial divisions from 2 to L-1 and that would be polynomial time.
"
"['quantum-state', 'entanglement', 'bell-basis']"," Title: Are $(|00\rangle-|11\rangle)/\sqrt2$ and $(|11\rangle-|00\rangle)/\sqrt2$ the same quantum state?Body: The state
$(|00\rangle-|11\rangle)/\sqrt2$ is an entangled state. If we think about the state $(|11\rangle-|00\rangle)/\sqrt2$, is this also entangled, but with maybe a phase change? The above two can not be similar? Maybe, the second state is entangled but not maximally?
"
"['quantum-gate', 'mathematics', 'textbook-and-exercises']"," Title: Why does $H^2=X^2 =I$ not imply $H=X$?Body: if $HH = I$ and $XX =I$, then is $H=X$?
$HH = I = XX$ or, $HH = XX$
then, taking under root, is $H = X$?
This is absurd but how to disprove it?
"
"['quantum-state', 'terminology']"," Title: What is the difference between quantum ""system"", ""register"" and ""Hilbert space""?Body: As far as I can tell, these terms are interchangeable but I am not sure of this.
What is meant by each of the terms "quantum system", "quantum register" and "Hilbert space" in the context of quantum information?
"
['non-locality']," Title: Is the boundary of the set of quantum behaviours a polytope?Body: Consider the standard 2-2 Bell scenario, with two parties each one choosing between two measurement settings, with each measurement setting leading to one of two possible measurement outcomes.
Consider the space of possible corresponding behaviours, that is, conditional probability distributions $(p(ab|xy))_{a,b,x,y\in\{0,1\}}$.
As also discussed in What is the no-signaling set and how can it be related to other types of correlations? and What are the vertices of the no-signalling set $\mathcal{NS}$?, it is standard in this context to distinguish between different classes of behaviours. I'll mention in particular the set $\mathcal L$ of local behaviours, the set $\mathcal Q$ of quantum behaviours, and the set $\mathcal{NS}$ of no-signalling behaviours.
A standard representation of the relations between these sets, given in the review by Brunner et al., is
One notable feature of this is that while $\mathcal L$ and $\mathcal{NS}$ are polytopes, that is, the convex hull of a finite number of points, $\mathcal Q$ is represented as having a boundary that is non-flat in some sections.
I wouldn't call this feature surprising, but is there an easy way to see why this is the case?
"
"['qiskit', 'ibm-q-experience', 'simulation', 'quantum-volume']"," Title: Is it possible to set quantum volume in IBM Quantum simulator?Body: A quantum volume serves as a metric of a quantum processor quality. So far, IBM Quantum provides processors with quantum volume up to 128. Freely accessbile processors have QV up to 32. A user using free access can employ fake processors (see details here) to simulate behavior of her/his circuits on processor with QV higher than 32.
However what about simulation of processors with QV above 128? Is it possible to somehow set qasm_simulator to behave like a processor with given quantum volume?
"
"['qiskit', 'programming', 'grovers-algorithm', 'amplitude-amplification']"," Title: Setting the $\texttt{state_preparation}$ for $\texttt{AmplificationProblem()}$ in the scope of Grover's algorithmBody: I am having trouble setting the state_preparation parameter of AmplificationProblem() from qiskit.algorithms.
I’d like to apply a generalized version of Grover on only one of the multiple registers in my circuit.
The total number of registers in the circuit is 3.
After several computation steps (including quantum counting algo) the target register gets in a superposition of non-uniform basis states - also, it is entangled with the other two registers.
According to the documentation, state_preparation parameter takes just a QuantumCircuit (sometimes also referred to as Operator).
Since my circuit includes the Initialize() method from qiskit.extensions.initialize (for the other two registers), i.e. a non-unitary operation, there exists no inverse.
My questions are two-fold:
- What should I pass as the
state_preparation parameter? I just need
one specific QuantumRegister to be passed, but I do not have a circuit or operator for only that register (have only the full QuantumCircuit of the entire algorithm).
- Per the documentation/tutorials, the state_preparation operator $\mathcal{A}$ should be invertible - but the
Initialize() method introduces a qubit reset, which is non-unitary. How can I circumvent this?
So as a summary I'm wondering what would be the best approach to avoid passing the entire circuit to the state_preparation?
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: queueinfo() module in QiskitBody: I want to know how to use queueinfo() module in IBM Qiskit. When I type job.QueueInfo(), it says "QueueInfo" is not defined. How to import it? I'm trying to use queueinfo() to know the time of start of execution of quantum circuit. Please help.
"
"['qiskit', 'quantum-gate', 'circuit-construction']"," Title: What is the method to create arbitrary controlled circuits in Qiskit?Body: I am working on an implementation of an algorithm which uses ampitude estimation and amplification as a subroutine but we are not using qiskit but QuEST. QuEST doesn't have any direct method to create a controlled circuit. So we're trying to find out some efficient method for that using only the basic functionality present in most quantum computing languages.
I am looking into this paper - https://www.nature.com/articles/ncomms1392.pdf. But I am having a hard time understanding how the particular thing is working, I also looked at the backend code of qiskit but that is far more confusing as it has a lot of inter-dependencies from different classes and all.
"
"['qiskit', 'programming']"," Title: How to return phase angles as seen in IBMQ composer using qiskit?Body: I recently transitioned from using the IBMQ composer and am using qiskit in the IBM lab. To start, I wanted to learn how to reproduce the computational basis states, probabilities and phase angles as seen in the IBM composer. I've learned how to generate the computational basis states and probabilities with the code below but I can't find any function for generating the phase angles.
stat_vec = Statevector.from_instruction(circuit)
stat_vec.probabilities_dict()
The above returns the computational basis states and their probabilities as seen in the composer.
I looked through the StateVector class docs and the Result class docs but I didn't find a function that returns the phase angle for each computational basis state. Am I missing something?
I do know how to use draw("qsphere") to visually look at the phase angles but I want to return the phase angles in a data structure. Since I can visualize the phase angles, I feel like I'm overlooking something in the docs about returning the phase angles in something like an array or list.
"
"['density-matrix', 'open-quantum-systems']"," Title: Show that if the Lindblad satisfy $\sum_\mu L_\mu L_\mu^\dagger=\sum_\mu L_\mu^\dagger L_\mu$ then the von Neumann entropy increases monotonicallyBody: How can we show that when the Lindblad operators satisfy the condition:
$$\sum_{\mu}L_{\mu} L_{\mu}^{\dagger} = \sum_{\mu} L_{\mu}^{\dagger}L_{\mu},\tag{1}$$
the master equation evolution monotonically increases the von Neumann entropy. When measurements are made in the basis in which $\rho$ is diagonal, the von Neumann entropy coincides with the Boltzmann-Shannon entropy.
I have worked with the basis which is going to diagonalise $\rho$ and also I have taken the necessary condition where von Neumann entropy has been increased monotonically but how to proceed the next step I am not getting.
"
"['qiskit', 'grovers-algorithm', 'amplitude-amplification']"," Title: Understanding Qiskit 0.32 's $\texttt{AmplificationProblem()}$ behaviourBody: This is related to my previous question.
To apply amplitude amplification in Qiskit, one needs to use AmplificationProblem() or GroverOperator().
According to documentation:
$$\mathcal{Q}=\mathcal{AS_0A}^{\dagger}\mathcal{S_f},$$ $\mathcal{A}$
is an input state preparation. In the standard Grover search
$\mathcal{A=H^{\otimes n}}$.
However, in generalized form, $\mathcal{A}$ to could be a circuit representing any (non-uniform) superposition of basis states.
So now imagine we have a circuit. One of the QuantumRegisters (qubits=[0,1,2]), is initialised in the superposition of $\{|0001\rangle, |0100\rangle, |0111\rangle\}$ states. The oracle and good_states have been both set to $|0111\rangle$.
good_state=['0111']
oracle_state_vector=[0]*(2**4)
for index in [7]:
oracle_state_vector[index]=complex(1, 0)
oracle=Statevector(oracle_state_vector)
testCirc=QuantumCircuit(4)
initial_state=[1,4,7]
init_state_vector=[0]*(2**3)
normConstant=1/m.sqrt(len(initial_state))
for state in initial_state:
init_state_vector[state]=normConstant*complex(1, 0)
testCirc.initialize(init_state_vector, [0,1,2] )
testCirc = RemoveResetInZeroState()(testCirc.decompose())
state_preparation=testCirc
#state_preparation.x([3])
problem = AmplificationProblem(oracle, is_good_state=good_state,
state_preparation=state_preparation, objective_qubits=[0,1,2])
state_preparation.draw()
backend = Aer.get_backend('aer_simulator')
quantum_instance = QuantumInstance(backend, shots=1024)
grover = Grover(quantum_instance=quantum_instance)
result = None
if problem is not None:
result = grover.amplify(problem)
print(result.assignment)
if result is not None:
display(plot_histogram(result.circuit_results[0]))
The histogram shows we were able to amplify the amplitude of the $|0111\rangle$ state.
However, if we add a X gate (by X I am trying to abstract part of a potential algorithm that can be applied on a QuantumRegister) to the other QuantumRegister,qubit[3], the amplification result is not satisfying anymore.
What am I missing here?
"
"['algorithm', 'nielsen-and-chuang', 'phase-estimation']"," Title: Definition(s) of $\delta$ in quantum phase estimationBody: I read the chapter on QPE (quantum phase estimation) in Nielsen and noticed that $\delta$ is defined there as follows: $0 \leq \delta \leq 2^{-t}$, see:
5.2.1 Performance and requirements
The above analysis applies to the ideal case, where $\varphi$ can be written exactly with a $t$ bit binary expansion. What happens when this is not the case? It turns out that the procedure we have described will produce a pretty good approximation to $\varphi$ with high probability, as forshadowed by the notation used in 5.22. Showing this requires some careful manipulations.
Let $b$ be the integer in the range $0$ to $2^t-1$ such that $b/2^t=0.b_1\ldots b_t$ is the best $t$ bit approximation to $\varphi$ which is less than $\varphi$. That is, the difference $\delta\equiv \varphi-b/2^t$ between $\varphi$ and $b/2^t$ satisfies $0\leq\delta\leq 2^{-t}$.
When I read the Wikipedia article about QPE I noticed that $\delta$ is defined as follows, see Wikipedia QPE:
We can approximate the value of $\theta \in [0, 1]$ by rounding $2^n \theta$ to the nearest integer. This means that $2^n \theta = a + 2^n \delta,$ where $a$ is the nearest integer to $2^n \theta,$ and the difference $2^n\delta$ satisfies $0 \leqslant |2^n\delta| \leqslant \tfrac{1}{2}$.
Now I wonder why two such different definitions of $\delta$ are used here. I have a guess why this might be, but I am not sure, so I ask here what the goal of the $\delta$ variant defined in Wikipedia is all about.
My guess:
Wikipedia uses this definition of delta at the point of measurement. My guess is that by using this definition of delta in the measurement, the "surrounding" of nearby values is also taken into account. Let's say the ideal measurement would be e.g. $|010\rangle$, with the $|\delta| \leq \frac{1}{2^{n+1}}$ we reach then that the "environment" around $|010\rangle$ is included in positive AND negative direction, the environment could be understood then e.g. in such a way: $|001\rangle$, $|010\rangle$, $|011\rangle$.
This is only an assumption made by me. I would be very happy if someone is willing to explain this in more detail, why two different definitions of $\delta$ can be found.
"
"['quantum-gate', 'entanglement', 'spintronics']"," Title: Can the spin-1/2 720° rotation trick apply to qubits?Body: The idea of a 4π rotation to return an electron to its original state instead of just a single 2π rotation exists - but can this idea apply to qubits or entangled qubits?
Are there any use cases for 360° or 720° quantum logic gates?
"
"['density-matrix', 'open-quantum-systems', 'master-equation']"," Title: Show that if the Lindblad satisfy $\sum_\mu L_\mu L_\mu^\dagger=\sum_\mu L_\mu^\dagger L_\mu$ then $\rho\propto I$ is a fixed point of an evolutionBody: How can we show that the Lindblad condition:
$$\sum_{\mu}L_{\mu} L_{\mu}^{\dagger} = \sum_{\mu} L_{\mu}^{\dagger}L_{\mu},\tag{1}$$
implies that $\rho \propto I$ is the fixed point of the evolution with the maximum entropy (this corresponds to the microcanonical distribution)?
I have worked with the basis which is going to diagonalize $\rho$ and also I have taken the necessary condition where von Neumann entropy has been increased monotonically but how to proceed the next step I am not getting.
This is a follow-up to: Show that if the Lindblad satisfy $\sum_\mu L_\mu L_\mu^\dagger=\sum_\mu L_\mu^\dagger L_\mu$ then the von Neumann entropy increases monotonically.
"
"['quantum-state', 'pauli-gates', 'stabilizer-code', 'clifford-group', 'stabilizer-state']"," Title: What is the largest number of stabilizers a pure state can have?Body: What is the largest number of stabilizers a pure state can have? Elaborately put:
Let $P(n)$ denote the Pauli group. Given an arbitrary pure state $|\psi\rangle$, what is the upper limit on how many unitary matrices $U_i \in P(n)$ there can be such that $U_i|\psi\rangle = |\psi\rangle$?
An exact reference and/or a proof is very, very much appreciated.
"
"['qiskit', 'grovers-algorithm']"," Title: Qiskit Implementation of Grover's Algorithm to search a listBody: Suppose I have a list of numbers from 0 to 32, that is $ [0,1,2....31, 32].$ I want to find a number $n$ in this list such that it satisfies a property, say $n$ is prime. How would I translate this to an Oracle that can be used with Grovers's Algorithm in Qiskit?
I am following this guide but, it seems like the general pattern to the solution is already known in this Sudoku example, that is the pattern of the bits of a potential solution is known and it can be checked.
What if there isn't a general pattern? How would you implement an oracle to look through the list, check each item and return the one that matches some criteria?
I'm following the same code in the link referenced above but, changing the sudoku_oracle to my own custom function.
Any help is appreciated, thanks.
"
"['physical-realization', 'physical-qubit', 'superconducting-quantum-computing', 'transmon']"," Title: In a transmon qubit, what corresponds to the ground and excited states?Body: In a transmon qubit, we have ground and energy eigenstates but what is actually happening in the circuit here? How do the current and voltage look?
It looks like its made up of things you would find normally in a classical circuit so whats different here?
(if there is an easy-to-understand resource for transmon qubits, would appreciate any links)
"
"['physical-realization', 'pauli-gates', 'physical-qubit', 'superconducting-quantum-computing']"," Title: How are gates implemented in a transmon qubit?Body: A transmon qubit is fundamentally in LC circuit. How are gates implemented in a transmon qubit? How do we know what voltage corresponds to the $\sigma_x$ gate for example?
"
"['physical-realization', 'physical-qubit', 'superconducting-quantum-computing']"," Title: How do we know that a superconducting circuit is a quantum system?Body: In introductions to superconducting qubits, we often take the classical LC circuit and then quantize the operators. Why are we allowed to do this?
I do not see this derivation anywhere -- what convinces us that the many electrons in a superconducting circuit will behave as a dynamical two-level system. It often says that the only dynamics in the superconducting circuit are the charge and flux oscillating but how do we know this?
"
"['qiskit', 'pauli-gates', 'quantum-enhanced-machine-learning', 'kernel-methods']"," Title: How does the ZZ Feature Map influence the measurement?Body: I've been look at this Notebook from qiskit and trying to understand whats happening, but can't quite figure it out.
From my understanding, rotations around the Z Axis do not influence the probabilities of measuring $|0\rangle$ and $|1\rangle$. So, with my Knowledge, I would assume that the ZZFeatureMap has no direct influence.
After that, the RealAmplitudesis applied which corresponds more to my knowledge. We use weights inside of RY gates to play with the importance of single features and their contribution to the probability of measuring 0/1.
Even after looking at the Bloch sphere after the ZZFeatureMap, I can't see anything special. For example, for this circuit, the Bloch spheres before measurement look like this.
I would assume that given the circuit, my measurements should be a perfect 1/4 split across all 4 possible states, yet that is not the case.
Maybe I'm missing key information/relation between the global phase and measurements. I'm quite intrigued by it, as my circuits that incorporate RY/CRY gates for features and weights barely manage to hit 60% accuracy, where with the same training and problem the ZZFeatureMap + RealAmplitudes achieves a perfect 100% accuracy
"
"['cryptography', 'communication']"," Title: What are conceptual open problem in quantum communications and cryptography?Body: I recently heard that most of the challenges in quantum communications nowadays are related to "practical" engineering implementations and there are no longer "real" conceptual challenges (I mean, of course we could still find open conceptual questions but the main activity is not longer really here in the field).
In order to know if it is the case, I would be interested by having some list of open problems in quantum communications and quantum cryptography that are "conceptual" (i.e related to theoretical physics). What are some important problems remaining to solve in those fields?
I am in particular interested by the interconnection with quantum computing and quantum error correction.
"
"['quantum-state', 'measurement', 'locc-operation']"," Title: Universal resource for measurement based quantum computationBody: Consider universal resources for measurement based quantum computation, as defined here:
We are now ready to formulate the following definition. A family $\Psi$
is called a universal resource for MQC if for each state $|\phi\rangle$ on $n$
qubits there exists a state $|\psi\rangle \in \Psi$ on m qubits, with $m \geq n$, such that
the transformation $$|\psi\rangle \rightarrow |\phi\rangle|+\rangle ^{m−n}$$ is possible deterministically
(with probability 1) by LOCC.
However, note that $|\phi\rangle|+\rangle ^{m−n}$ is a product state. Its Schmidt coefficient is $1$. Thus, no matter what state $|\psi\rangle$ is, its Schmidt coefficients will always be majorized by $1$. Hence, by Nielsen's theorem, the transformation
$$|\psi\rangle \rightarrow |\phi\rangle|+\rangle ^{m−n}$$
will always be possible by LOCC (it may be an inefficient LOCC protocol, but the authors explicitly remark they do not care about efficiency and just care about universality.)
Doesn't it make this definition trivial?
"
"['qiskit', 'programming', 'qasm']"," Title: Qiskit does not interpret qasm string as 3.0?Body: I am trying to get my first openqasm3.0 program and I am getting error messages that I cannot interpret.
Here is my program:
cloner1 = """
OPENQASM 3.0;
//include "qelib1.inc";
qubit[5] q;
bit[1] c;
x q[2];
x q[4];
x q[0]; //Set up input
measure q[0] -> c[0];
if (c[0]==1) {
CX q[1],q[2];
CX q[2],q[1];
CX q[1],q[2];
CX q[3],q[4];
CX q[4],q[3];
CX q[3],q[4];
}
measure q[1]->c[0];
measure q[3]->c[0];
"""
qc= QuantumCircuit.from_qasm_str(cloner1)
result = execute(qc, backend=qiskit.BasicAer.get_backend('qasm_simulator'),shots=1024).result()
counts = result.get_counts()
plot_histogram(counts)
THe error message I get is
Error near line 4 Column 7
Expected an ID, received '['"
Apparently it doesn't like bit[1] c. But this is just like the code in the arxiv.org article
So I don't know what is wrong. It doesn't seem to be interpreting it as ASM3.0 code.
"
"['qiskit', 'programming', 'ibm-q-experience']"," Title: Can I initialize only one qubit in a 4-qubit circuit?Body: I wonder if there's a way we can initialize the quantum state only for part of the qubits in a quantum circuit. Say if I have a quantum circuit defined as qc = QuantumCircuit(4), can we only initialize the first qubit (qubit 0) to a particular quantum state, and leave other qubits unchanged (i.e. $|0\rangle$)?
I tried to follow a documentation on qiskit, but am still confused about how to do that. I tried to initialize all the qubits by generating a statevector from the tensor product of each qubit: qc.initialize(np.kron(...)), but it returns me LinAlgError: Last 2 dimensions of the array must be square. Is there an easier way I can do that by specifying which qubit I want to initialize? Thanks for the help!!
"
"['qiskit', 'programming', 'clifford-group']"," Title: Computing specific observable for a Clifford circuitBody: Given a clifford circuit, how can I simulate it efficiently to get the 2-RDM (reduced density matrix) $D^2=\langle a_i^\dagger a_j^\dagger a_k a_l\rangle$ in the presence of deplorizing error? The simulation will take a lot of time, which seems conter-intuitive for simulation of clifford circuit. It seems that the cost is mainly caused by CircuitSampler. Is there a way to avoid the using of it while can get the noisy expectation result for the 2-RDM or other weighted pauli string-like observables, such as a Hamiltonian, in the Clifford case?
from qiskit import *
import numpy as np
import itertools
#Circuit imports
import matplotlib
# import cirq
import qiskit.quantum_info as qi
from qiskit.quantum_info import random_clifford
matplotlib.use('Agg')
from qiskit_nature.operators.second_quantization import FermionicOp
from qiskit.opflow.converters import CircuitSampler
from qiskit_nature.mappers.second_quantization import JordanWignerMapper
from qiskit_nature.converters.second_quantization import QubitConverter
from qiskit.utils import QuantumInstance
from qiskit.opflow import Z, X, I, StateFn, CircuitStateFn
from qiskit.opflow.expectations import PauliExpectation
import qiskit.providers.aer.noise as noise
from qiskit.providers.aer import AerSimulator
np.set_printoptions(threshold=np.inf)
prob_1 = 1e-3 # 1-qubit gate
prob_2 = 1e-2 # 2-qubit gate
# Depolarizing quantum errors
error_1 = noise.depolarizing_error(prob_1, 1)
error_2 = noise.depolarizing_error(prob_2, 2)
# Add errors to noise model
noise_model = noise.NoiseModel()
noise_model.add_all_qubit_quantum_error(error_1, ['s', 'sdg', 'x', 'y', 'z', 'i', 'h'])
noise_model.add_all_qubit_quantum_error(error_2, ['cx', 'cz', 'swap'])
num_qubits = 10
two_rdm = np.zeros((num_qubits,) * 4)
mapper = JordanWignerMapper()
converter = QubitConverter(mapper=mapper, two_qubit_reduction=False)
backend = AerSimulator(method='stabilizer',
noise_model=noise_model)
quantum_instance = QuantumInstance(backend=backend,
shots=1000,
noise_model=noise_model)
circuit_sampler = CircuitSampler(quantum_instance)
cliff = random_clifford(num_qubits)
cliff = cliff.to_circuit()
for i, j, k, l in itertools.product(range(num_qubits), repeat=4):
s = "+_{i} +_{j} -_{k} -_{l}".format(i=str(i),j=str(j),k=str(k),l=str(l))
fermi_term = FermionicOp(s, register_length=num_qubits)
qubit_term = converter.convert(fermi_term, num_particles=(1,1))
# Evaluate the 2-RDM term w.r.t. the given circuit
temp = ~StateFn(qubit_term) @ CircuitStateFn(primitive=cliff, coeff=1.)
temp = circuit_sampler.convert(
PauliExpectation().convert(temp)
).eval()
two_rdm[i,j,k,l] = temp
"
"['qiskit', 'ibm-q-experience']"," Title: Bell state measurement IBM circuit composerBody: This is my first post in this forum so it is likely that I'll make some rookie mistakes here. In the simple Bell state circuit in IBM circuit composer
we measure the first qubit and for this seed we get the following statevector
Now if we add a second measurement to the second qubit, we should expect the second qubit to also be in the 0 state with certainty, as decided by the first measurement result with state $|00\rangle$. However, instead it seems that the circuit resets somehow. For the same seed the result changes to $|11\rangle$ with the addition of the measurement of the second qubit.
Does anyone know why this happens? I'm new to qiskit so any tips and answers will be gladly accepted.
"
"['quantum-state', 'textbook-and-exercises', 'notation']"," Title: For two-qubit systems, do we have $\langle 01|01\rangle = \langle 0|0\rangle\langle 1|1\rangle$?Body: I am new to quantum computing and I want to know the following: If I have a 2 qubit system in state e.g. $\left|01\right>$ and I want to calculate the probability of measuring e.g. $\left<01\right|$ I can write it as following: $|\left<01|01\right>|^2$. Now is the notation $\left<01|01\right>$ equal to this notation $\left<0|0\right>\left<1|1\right>$?
"
"['quantum-state', 'entanglement', 'measurement', 'entropy']"," Title: Does entanglement entropy follow a volume or an area law for 2D cluster states?Body: Consider a 2D cluster state defined on a rectangular lattice, which is universal for one way quantum computers. For a description of the state, see for example question 2 in this problem set.
Now, consider a bipartition of this state and look at the entanglement entropy of each partition. Does the entropy follow a volume law or an area law?
"
"['quantum-circuit', 'quantum-turing-machine', 'church-turing-thesis']"," Title: How does a quantum circuit capture the ""non-halting ability"" of classical Turing machines?Body: It is claimed that a quantum Turing machine is "computationally" equivalent to the circuit model. Quantum computing also includes all classical computing. However, we know that there are classical Turing machines that do not halt on certain inputs.
How does a quantum circuit capture this non-halting "ability" of classical Turing machines? The way we draw them, every quantum circuit inevitably halts when we perform the measurements at the end.
"
"['qiskit', 'programming', 'machine-learning', 'neural-network']"," Title: How could I choose cost function in Qiskit TwoLayerQNN?Body: So here is the problem, I've found that in a TwoLayerQNN, the backward gradient is only to minimize the expectation of observable I've chosen. But I'm not going to minimize the predict of the input, instead, I need to minimize the cost function. So how can I choose my own cost function without using NeuralNetworkClassifier? thanks.
"
"['qiskit', 'programming', 'transpile']"," Title: Replace Gate with Known Identity in Quantum CircuitBody: I have a quantum circuit with 3 two-qubits gates XX, YY, and ZZ (as defined in the qiskit circuit library) with arbitrary angles on each gate. I'd like to replace the YY and ZZ gates with XXs. I know how to do this mathematically with RZ and RY single qubit rotations, but I don't know how to programmically get Qiskit to do this switch. Unfortunately, the transpiler converts the YY and ZZ into CNOTs and then into XXs (evaluated at $\pi/2$). I want to avoid this though and preserve the arbitrary angles on YY and ZZ when converting them into XX gates. Is there a way I can tell the transpiler how to handle YY and ZZ gates?
Or maybe remove the YY and ZZ gates from the quantum circuit from QuantumCircuit.data and insert XX gates (with the appropriate RZ and RY rotations)?
"
"['qiskit', 'chemistry']"," Title: How to construct a parameterised UCCSD ansatz?Body: I want to try the UCC ansatz for problems other than quantum chemistry. For that I want to 'extract' the UCC ansatz (say from Qiskit) and supply it to my own VQE: I need a parameterised circuit where everything else is already set up.
How do I do that?
"
"['quantum-gate', 'textbook-and-exercises', 'quantum-operation', 'kraus-representation']"," Title: Implication of SWAP being not positive in terms of quantum channelBody: I am going over chapter 3 of Preskill's lecture notes regarding complete positivity. Specifically, on page 19, it is mentioned that since SWAP has eigenstates with eigenvalue -1, it is not positive, thus not a physically realizable operation.
This is quite strange to me since SWAP is quite common in quantum circuits. Also, I tried more general form of SWAP, e.g., adding a global phase, or adding a phase to $|01\rangle$ and $|10\rangle$ like iSWAP, but it seems like there will always be some eigenstates with eigenvalues not positive, or not even real.
So, from the point of quantum channels, why are SWAP gates possible? Is it because we have to involve a third qubit into consideration? But I don't think on those superconducting chips, we need to take over a third qubit when performing a SWAP gate.
"
"['quantum-gate', 'grovers-algorithm', 'quirk']"," Title: How to implement *nested* Grover search (in Quirk)?Body: $\newcommand{\ket}[1]{|#1 \rangle}$
$\newcommand{\bra}[1]{\langle #1 |}$
PS: I suppose this question could also ask "How to implement $2 \ket{s}\bra{s} - I$ for any (identifiable) $\ket{s} \in \mathcal{H}_A \subset \mathcal{H}$" (in Quirks)?
I am struggling to implement a nested Grover search on gate level, e.g. in quirk (https://algassert.com/quirk).
(Essentially, I was following this paper: https://arxiv.org/pdf/quant-ph/9806078.pdf)
Setup
Consider the Hilbert space $\mathcal{H} = \mathcal{H}_A \otimes \mathcal{H}_B$,
with $\mathcal{H} = \mathbb{C}^{2^n}$,
such that there are $2^n$ elements in $\mathcal{H}$ (respectively $n_A, n_B$ for $\mathcal{H}_A, \mathcal{H}_B$).
(Also, sorry for slight abuse of set-formalisms here)
We are given a function
$f_A(x) = \begin{cases}
1 \Leftrightarrow x \in \mathcal{H}_A,\\
0 \text{ otherwise}
\end{cases} \qquad$
and $f_a(x) = \begin{cases}
1 \Leftrightarrow x \in M,\\
0 \text{ otherwise}
\end{cases}$
Grover Search
... on any element in $H_A$ performs the following steps:
- Create uniform superposition: $\ket{\psi_0} = H^{\otimes n'}$
- Repeat about $\frac{4}{\pi} \sqrt{N/n_A}$ times:
- Define Circuit $G_A$:
- Apply oracle: $\ket{\psi_{A,1}} = U_{f_A} \ket{\psi_0}$
- Apply Diffusion on $\mathcal{H}$: $\ket{\psi_{A, 2}} = 2 \ket{\psi_{A,1}} \bra{\psi_{a,1}} - I$
- The resulting state is close to $\ket{x} \in \mathcal{H}_A$.
where
$2 \ket{\psi_{A,1}} \bra{\psi_{A,1}} - I$ is implemented via: $H^{\otimes n} (I - 2\ket{0}\bra{0}) H^{\otimes n}$
Nested Grover Search
... to find a elements $a \in M \subset\mathcal{H_A}$.
... first creates a superposition over $\mathcal{H}_A$ via a search using the function $f_A$, then searches that subspace via function $f_a$:
- Create uniform superposition: $\ket{\psi_0} = H^{\otimes n}$
- Repeat about $\sqrt{n_a/ |M|}$ times:
- Define Function G_{Aa}
- Apply $G_A$ about $\frac{4}{\pi} \sqrt{N/n_A}$ times
// Now $\ket{\psi_{A, 2}}$ is (close to) a superposition of $\ket{x} \in \mathcal{H}_A$
-
- Apply oracle: $\ket{\psi_{a,1}} = U_{f_a} \psi_{A,2}$
- Apply Diffusion on $\mathcal{H_A}$: $\ket{\psi_{a,2}} = 2 \ket{\psi_{A,2}} \bra{\psi_{A,2}} - I$
where
$2 \ket{\psi_{A,2}} \bra{\psi_{A,2}} - I$ is implemented via: $G_A (I - 2\ket{0}\bra{0}) G_A^{\dagger}$
Simple Instantiation
For simplicity, consider $n=4$ such that the database are the numbers from $0,1,... 15$. Our target values are $M = \{2\}$ ('10'), hence a single element.
- We first identify the number in $a \in \mathcal{H}_A$ with $f_A(x) = 1 \leftrightarrow x \leq 3$. For this particular example $G_A$ has to be applied once to get $\psi_{A,2} = \sqrt{1/4} \sum_{x=0}^{3} \ket{x}$.
- Then we identify $a$ with $f_a(x) = 1 \leftrightarrow x \leq 2$.
In theory, a single call to the oracle should be sufficient here too.
Since $\sqrt{\frac{n_a}{|M|}} = 1$ I suppose we would need to iterations of the complete circuit. In my implementation (Quirk Nested Grover); after one step of each '10' clearly has a larger amplitude than the other states, but not close to 100%.
- What is wrong about my intuition on a nested Grover search?
- And/ or how do I implement this in Quirk?
- If this is not a good example, do you know a simple example that can be implemented? (I would prefer an implementation in Quirk, Q# would be okay'ish too ;))
"
"['algorithm', 'grovers-algorithm', 'amplitude-amplification']"," Title: In generals Amplitude Amplification algorithm, the initial state does not need to attain equally superposition?Body: In the beginning of this paper about amplitude amplification algorithm, the author stated the conventions of amplitude amplification which I quoted the important part for your convenience as follows:
Let $|\Psi\rangle=\mathcal{A}|0\rangle$ denote the superposition obtained by applying algorithm $\mathcal{A}$ on the initial state $|0\rangle$. Let $\left|\Psi_{1}\right\rangle=$ $\mathbf{P}_{\text {good }}|\Psi\rangle$ where $\mathbf{P}_{\text {good }}=\sum_{x: \chi(x)=1}|x\rangle\langle x|$ denotes the projection onto the subspace spanned by the good basis states, and similarly let $\left|\Psi_{0}\right\rangle=\mathbf{P}_{\mathrm{bad}}|\Psi\rangle$ where $\mathbf{P}_{\mathrm{bad}}=\sum_{x: \chi(x)=0}|x\rangle\langle x| .$ Let $a=\left\langle\Psi_{1} \mid \Psi_{1}\right\rangle$ denote the probability that a measurement of $|\Psi\rangle=\mathcal{A}|0\rangle$ yields a good state, and let $b=\left\langle\Psi_{0} \mid \Psi_{0}\right\rangle$ denote the probability that a measurement of $|\Psi\rangle$ yields a bad state. We then have that $|\Psi\rangle=\left|\Psi_{1}\right\rangle+\left|\Psi_{0}\right\rangle$ and $1=a+b$. Finally, let angle $\theta$ be so that $0 \leq \theta \leq \pi / 2$ and $a=\sin ^{2}(\theta)$
So from the statement above, I didn't see the requirement that $|\Psi\rangle$ need be state like $\frac{1}{\sqrt{N}}\sum_i|i\rangle$, i.e., the equal superposition state. It seems there's no wrong theoretically, but shouldn't we prepare an equal superposition state considering we don't have any idea which one is the answer? It's kind of weird for me.
Did I misunderstand the Amplitude Amplification algorithm or it is exactly what I said above just for theoretical generality?
"
"['textbook-and-exercises', 'density-matrix', 'bloch-sphere', 'wigner-function']"," Title: Evaluation of Wigner function representation of a Bloch SphereBody: Consider Wigner function representation of a qubit in the basis labeled by $\sigma_z$ and $\sigma_x$ eigenvalues. A general single qubit mixed state has the Bloch representation,$\rho = 1/2 (I + r.\sigma)$with $|r| ≤ 1$. Find the region of the Bloch sphere such that each element of its Wigner function is positive.
In this problem how can we evaluate the wigner function as we know that wigner function is one of the density matrices?
"
"['quantum-state', 'circuit-construction', 'quantum-circuit', 'bell-basis']"," Title: How to create a Bell state with asymmetric amplitudes using single-qubit and CNOT gates?Body: Is there a systematic way - in terms of a quantum circuit with single qubit and CNOT gates - to create a bell state with asymmetric amplitudes, e.g.,
$$
\alpha |00\rangle + \beta|11\rangle
$$
where $\alpha, \beta$ are arbitrary complex values satisfying the condition of normalization?
"
"['quantum-state', 'circuit-construction', 'quantum-circuit', 'state-preparation']"," Title: How to create superposition of states with fixed parity with a quantum circuit?Body: I'm searching for a circuit to generate, starting from the $|00\, ...\,0\rangle$ state, an arbitrary superposition of all states with either even or odd parity. The gate choice is irrelevant for now, but sticking with single qubit gates and controlled rotations would be preferrable.
For example, for 3 qubits, I want to be able to generate the states
$$
|\mathrm{odd}\rangle = a|001\rangle + b|010\rangle + c |100\rangle + d|111\rangle
$$
and
$$
|\mathrm{even}\rangle = a|000\rangle + b|011\rangle + c |101\rangle + d|110\rangle
$$
where $a,b,c,d$ are freely chosen complex values satisfying the condition of normalization.
"
"['partial-trace', 'trace']"," Title: What do normalization term and partial measurement represent when tracing out ancillary qubits?Body: I am reading a paper and I am having trouble following some equations.
The system in this paper has $N$ qubits, with $N_A$ ancillary and the rest ($N - N_A$) as data qubits. For the purpose of this question, any subscript $t$ can be ignored. $|\Psi(z)\rangle$ represents the quantum state of the entire system.
We then take the partial measurement $\Pi_{\mathcal A}$ on the ancillary subsytem $\mathcal A$ of $|\Psi(\mathcal z)\rangle$, i.e., the post-measurement quantum state $\rho_t(\mathcal z)$ is
$$ \rho_t(\mathcal z) = \frac{\text{Tr}_{\mathcal A}(\Pi_{\mathcal A}|\Psi_t(\mathcal z)\rangle\langle\Psi_t(\mathcal z)|)}{\text{Tr}(\Pi_{\mathcal A}\otimes\mathbb{I}_{2^{N-N_{\mathcal A}}}|\Psi_t(\mathcal z)\rangle\langle\Psi_t(\mathcal z)|)} $$
An immediate observation is that state $\rho_t(\mathcal z)$ is a nonlinear map for $|\mathcal z\rangle$, since both the nominator and denominator of Eq. (13) [the one above] are the function of the variable $|\mathcal z\rangle$.
What do the top and bottom lines mean?
I understand the top line is trying to trace out the ancillary qubits. However, I don't understand the purpose of the partial measurement $\Pi_\mathcal{A}$. The point is to disregard the ancillary qubits, so is $Tr_\mathcal{A}(|\Psi(z)\rangle \langle \Psi(z)|)$ not sufficient? (How to get subspace of quantum circuit?)
Regarding the bottom line, does this act as some form of normalisation?
Many thanks for the help!
"
"['programming', 'hamiltonian-simulation', 'phase-estimation', 'amazon-braket']"," Title: Applying QPE on a large matrix on amazon-braketBody: I'm running a QPE algorithm on the amazon-braket but it can only apply on a 22 or 44 matrix, when I want to expand it into a 5*5 or more, it will come an error. As I know, there is no theoretical limitation on the size of matrix QPE can solve.
Here is the main part of the code:
def get_qpe_phases(measurement_counts, precision_qubits, items_to_keep=1):
bitstrings_precision_register = [
substring(key, precision_qubits) for key in measurement_counts.keys()
]
bitstrings_precision_register_set = set(bitstrings_precision_register)
bitstrings_precision_register_list = list(bitstrings_precision_register_set)
precision_results_dic = {key: 0 for key in bitstrings_precision_register_list}
for key in measurement_counts.keys():
counts = measurement_counts[key]
count_key = substring(key, precision_qubits)
precision_results_dic[count_key] += counts
c = Counter(precision_results_dic)
topmost = c.most_common(items_to_keep)
phases_decimal = [binaryToDecimal(item[0]) for item in topmost]
return phases_decimal, precision_results_dic
def run_qpe(
unitary,
precision_qubits,
query_qubits,
query_circuit,
items_to_keep=1,
shots=1000
):
circ = query_circuit
circ.qpe(precision_qubits, query_qubits, unitary, control_unitary=False)
# Add desired results_types
number_precision_qubits = len(precision_qubits)
num_qubits = len(precision_qubits)
circ.probability(np.array(precision_qubits))
device = LocalSimulator()
task=device.run(circ,shots=shots)
result=task.result()
metadata = result.task_metadata
probs_values = result.values[0]
measurements = result.measurements
measured_qubits = result.measured_qubits
measurement_counts = result.measurement_counts
measurement_probabilities = result.measurement_probabilities
format_bitstring = "{0:0" + str(num_qubits) + "b}"
bitstring_keys = [format_bitstring.format(ii) for ii in range(2 ** num_qubits)]
phases_decimal, precision_results_dic = get_qpe_phases(
measurement_counts, precision_qubits, items_to_keep
)
print('\nPhases:',phases_decimal)
eigenvalues = [np.exp(2 * np.pi * 1j * phase) for phase in phases_decimal]
# aggregate results
out = {
"circuit": circ,
"task_metadata": metadata,
"measurements": measurements,
"measured_qubits": measured_qubits,
"measurement_counts": measurement_counts,
"measurement_probabilities": measurement_probabilities,
"probs_values": probs_values,
"bitstring_keys": bitstring_keys,
"precision_results_dic": precision_results_dic,
"phases_decimal": phases_decimal,
"eigenvalues": eigenvalues,
}
return out
And when it comes to a 6*6 matrix,
from scipy.stats import unitary_group
import numpy as np
np.random.seed(seed=3000)
unitary1 = unitary_group.rvs(6)
result = estimate_phase(4,unitary1,5,printcir=False)
the error report is like:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-21-4eae0beac402> in <module>
4
5 unitary = unitary_group.rvs(6)
----> 6 result = estimate_phase(4,unitary,5,printcir=False)
<ipython-input-9-30dffae9e6c6> in estimate_phase(n, unitary, runit, shots, printcir)
15 query = Circuit().h(query_qubits)
16
---> 17 result = run_qpe(unitary, precision_qubits, query_qubits, query, items_to_keep=elen, shots = shots)
18 qeigvals= postprocess_qpe_results(result,printcir)
19
<ipython-input-6-1875e0e5a610> in run_qpe(unitary, precision_qubits, query_qubits, query_circuit, items_to_keep, shots)
92 ):
93 circ = query_circuit
---> 94 circ.qpe(precision_qubits, query_qubits, unitary, control_unitary=False)
95
96 # Add desired results_types
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in method_from_subroutine(self, *args, **kwargs)
75
76 def method_from_subroutine(self, *args, **kwargs) -> SubroutineReturn:
---> 77 return self.add(func, *args, **kwargs)
78
79 function_name = func.__name__
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in add(self, addable, *args, **kwargs)
495 self.add_circuit(item, *args, **kwargs)
496 elif callable(item):
--> 497 self.add(item(*args, **kwargs))
498 else:
499 raise TypeError(f"Cannot add a '{type(item)}' to a Circuit")
<ipython-input-6-1875e0e5a610> in qpe(precision_qubits, query_qubits, unitary, control_unitary)
39 else:
40 for _ in range(2 ** power):
---> 41 qpe_circ.controlled_unitary(qubit, query_qubits, unitary)
42 qpe_circ.inverse_qft(precision_qubits)
43
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in method_from_subroutine(self, *args, **kwargs)
75
76 def method_from_subroutine(self, *args, **kwargs) -> SubroutineReturn:
---> 77 return self.add(func, *args, **kwargs)
78
79 function_name = func.__name__
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in add(self, addable, *args, **kwargs)
495 self.add_circuit(item, *args, **kwargs)
496 elif callable(item):
--> 497 self.add(item(*args, **kwargs))
498 else:
499 raise TypeError(f"Cannot add a '{type(item)}' to a Circuit")
<ipython-input-6-1875e0e5a610> in controlled_unitary(control, target_qubits, unitary)
21 targets = [control] + target_qubits
22
---> 23 circ.unitary(matrix=controlled_matrix, targets=targets)
24
25 return circ
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in method_from_subroutine(self, *args, **kwargs)
75
76 def method_from_subroutine(self, *args, **kwargs) -> SubroutineReturn:
---> 77 return self.add(func, *args, **kwargs)
78
79 function_name = func.__name__
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/circuit.py in add(self, addable, *args, **kwargs)
495 self.add_circuit(item, *args, **kwargs)
496 elif callable(item):
--> 497 self.add(item(*args, **kwargs))
498 else:
499 raise TypeError(f"Cannot add a '{type(item)}' to a Circuit")
~/anaconda3/envs/Braket/lib/python3.7/site-packages/braket/circuits/gates.py in unitary(targets, matrix, display_name)
1339 """
1340 if 2 ** len(targets) != matrix.shape[0]:
-> 1341 raise ValueError("Dimensions of the supplied unitary are incompatible with the targets")
1342
1343 return Instruction(Gate.Unitary(matrix, display_name), target=targets)
ValueError: Dimensions of the supplied unitary are incompatible with the targets
So I'm wondering if it's the packages' problem or the program problem or any other had met the similar problem as I?
Thanks in advance!
"
"['entanglement', 'hadamard']"," Title: Can you detect if the collapse of an entangled pair using a Hadamard gate?Body: I'm trying to understand how the Hadamard gate works with entangled pairs.
If I have two particles A and B which are entangled and have gone through a Hadamard gate to become super-positioned Qubits, if I then observe and collapse particle A to a binary bit, has particle B has also collapsed, even though I have not yet observed it, to a binary state?
If so, if I then pass particle B through a Hadamard gate will it behave like a binary bit input rather than a super-positioned qubit input?
"
"['qiskit', 'programming', 'grovers-algorithm', 'oracles']"," Title: Phase Oracle in Qiskit Solving Satisfiability Problems using Grover's Algorithm SectionBody: In Qiskit Textbook, there is a section on solving satisfiability problems using Grover's Algorithm. For the 3SAT instance
they construct the following phase oracle:
Is there any reasoning behind this construction? Are they using the solutions to the actual problem while constructing it?
"
['qiskit']," Title: What is the default coupling map for qiskitBody: When creating a coupling map the parameters can be left empty, but what type of coupling map does this create. In the Qiskit documentation it says
By default, the generated coupling has no nodes.
But I don't quite understand what this means. What is a coupling map without nodes? I obviously presume that it uses a fully connected coupling map, but I can't seem to find a straight answer to this question.
"
"['entanglement', 'povm']"," Title: Are measurement probabilities on the two qubits of a maximally entangled state equal?Body: Suppose we get the Bell state
$$
|\Phi ^{+}\rangle ={\frac {1}{{\sqrt {2}}}}(|0\rangle _{A}\otimes |0\rangle _{B}+|1\rangle _{A}\otimes |1\rangle _{B}).
$$
If we now apply a unitary operator $U$ only to the first qubit then this operator is given as follows:
$$
U \otimes I
$$
but if we consider a POVM with the elements ($E_1, E_2$), and since we get the same result when we measure the second qubit, then we should have
$$
E_1 \otimes I = I \otimes E_1
$$
But this is obviously not the case. Where is my reasoning error here?
"
"['circuit-construction', 'stabilizer-state', 'magic-states']"," Title: Given a $|W_8\rangle$, perform a CCCZ using stabilizer operationsBody: I know it's possible to perform a CCZ operation using only stabilizer operations (Cliffords + Pauli measurements + classical feedback) by consuming a $|CCZ\rangle$ state, and that a $|W_4\rangle$ state can be turned into a $|CCZ\rangle$ state, so I can perform a CCZ using a $|W_4\rangle$. But I've been struggling to find the smallest $|W_n\rangle$ state that can perform a CCCZ deterministically. Initially I thought $|W_8\rangle$ would work, since I can turn it into a $|CCCZ\rangle$ state, but then when I teleport through it I end up with CCZ corrections and no way to do them.
"
['grovers-algorithm']," Title: Does the diffusion operator change when there are multiple iterations of the Grover cycle?Body: My question relates to the theoretical application of the diffusion operator in Grover's algorithm.
I understand that a single Grover iteration on an equal superposition will change the amplitude of one specific basis and give it a higher probability of being measured.
The diffusion operation is defined as
$H^{\otimes n}(2|0\rangle\langle0|-I)H^{\otimes n} = 2|s\rangle\langle s|-I$
where it basically assumes that the input states are in equal superposition. But this assumption is wrong as soon as more than one operation is applied, right? So how does this shape for the diffusion operator still hold when there is more than a single iteration of the Grover cycle?
Or is this definition simply like this for any initial state in the register and will always result in the inversion about the mean? I just haven't really found any good explanation on how did Grover/anybody else come up with this formula and what are the assumptions of it...
"
"['programming', 'quantum-state', 'density-matrix', 'qutip', 'master-equation']"," Title: QuTiP VS RK45: Which one gives the correct results for time-dependent systems?Body: I am writing a code for a quantum thermal machine which includes both coherent and dissipative time evolutions in its different stages of operation. However, evolving the system with "mesolve" function of QuTiP (which uses either Adams or BDF methods) and Runge-Kutta gives different results. My code has time dependent Hamiltonians and collapse operators. For demonstration purposes I wrote a simple code which deals with the master equation of a time-dependent harmonic oscillator of mass and frequency equal to 1. The jump operator is the position operator times a time-dependent coefficient.
import numpy as np
import scipy as sp
from qutip import *
tend = 5
tvec = np.linspace(0,tend,1000)
ω1 = 1 #initial frequency
ω2 = 2 #final frequency
gamma = 1 #dissipation rate
def omg_fun(t, args): #time-dependent frequency
s = t/tend
ω_t = ω1 + 10*(ω2-ω1)*s**3 - 15*(ω2-ω1)*s**4 + 6*(ω2-ω1)*s**5
return ω_t
def col_fun(t, args): #time dependent collapse operator coefficient
return np.sqrt(gamma * np.exp(-t))
def omg_fun_rk(t): #time-dependent frequency for RK45
s = t/tend
ω_t = ω1 + 10*(ω2-ω1)*s**3 - 15*(ω2-ω1)*s**4 + 6*(ω2-ω1)*s**5
return ω_t
def col_fun_rk(t): #time dependent collapse operator coefficient for RK45
return np.sqrt(gamma * np.exp(-t))
N=10
m = 1 #mass
ħ = 1
x = np.sqrt(ħ/(2*m*ω1))*(create(N)+destroy(N)) #position operator
p = 1j*np.sqrt((ħ*m*ω1)/2)*(create(N)-destroy(N)) #momentum operator
H = [(p**2)/(2*m), [(1/2)*m*x**2,omg_fun]]
c_ops = [[x,col_fun]]
rho_init = fock_dm(N,1)
rhot_vec = mesolve(H,rho_init,tvec,c_ops)
rhot_qutip = rhot_vec.states[-1]
#Right hand side of the master equation
def rhs(ρ,H,gamma,op):
c_op = np.sqrt(gamma)*op
res = -1j*(H*ρ - ρ*H)+(1/2)*(2*c_op*ρ*c_op.dag()-ρ*c_op.dag()*c_op-c_op*c_op.dag()*ρ)
return res
#Runge-Kutta Solver
def rksolver(ρ,dt,H,gamma,op):
k1 = rhs(ρ,H,gamma,op)
k2 = rhs(ρ+(dt/2)*k1,H,gamma,op)
k3 = rhs(ρ+(dt/2)*k2,H,gamma,op)
k4 = rhs(ρ+dt*k3,H,gamma,op)
rho = ρ+dt*(k1+2*k2+2*k3+k4)/6
return rho
dt = tvec[1]-tvec[0]
for i in range(len(tvec)):
H_rk = (p**2)/(2*m) + (1/2)*m*x**2*omg_fun_rk(tvec[i])
gamma_rk = col_fun_rk(tvec[i])
rhot_rk = rksolver(rho_init,dt,H_rk,gamma_rk,x)
rho_init = rhot_rk
The final density matrix using mesolve is:
\begin{equation*}\left(\begin{array}{*{11}c}0.212 & 0.0 & (0.004-0.052j) & 0.0 & (0.006+0.022j) & 0.0 & (-0.005-0.005j) & 0.0 & (0.002+9.285\times10^{-04}j) & 0.0\\0.0 & 0.384 & 0.0 & (-0.070+0.018j) & 0.0 & (0.009-0.004j) & 0.0 & (0.002+0.001j) & 0.0 & (-0.005-0.002j)\\(0.004+0.052j) & 0.0 & 0.195 & 0.0 & (-0.054+0.023j) & 0.0 & (0.011-0.010j) & 0.0 & (-0.001+0.003j) & 0.0\\0.0 & (-0.070-0.018j) & 0.0 & 0.082 & 0.0 & (-0.039+0.011j) & 0.0 & (0.015-0.008j) & 0.0 & (-0.012+0.011j)\\(0.006-0.022j) & 0.0 & (-0.054-0.023j) & 0.0 & 0.049 & 0.0 & (-0.019+0.009j) & 0.0 & (0.007-0.005j) & 0.0\\0.0 & (0.009+0.004j) & 0.0 & (-0.039-0.011j) & 0.0 & 0.039 & 0.0 & (-0.013-0.002j) & 0.0 & (0.008-0.004j)\\(-0.005+0.005j) & 0.0 & (0.011+0.010j) & 0.0 & (-0.019-0.009j) & 0.0 & 0.019 & 0.0 & (-0.006-0.002j) & 0.0\\0.0 & (0.002-0.001j) & 0.0 & (0.015+0.008j) & 0.0 & (-0.013+0.002j) & 0.0 & 0.008 & 0.0 & (-0.004+5.540\times10^{-04}j)\\(0.002-9.285\times10^{-04}j) & 0.0 & (-0.001-0.003j) & 0.0 & (0.007+0.005j) & 0.0 & (-0.006+0.002j) & 0.0 & 0.005 & 0.0\\0.0 & (-0.005+0.002j) & 0.0 & (-0.012-0.011j) & 0.0 & (0.008+0.004j) & 0.0 & (-0.004-5.540\times10^{-04}j) & 0.0 & 0.007\\\end{array}\right)\end{equation*}
The final density matrix using RK45 is:
\begin{equation*}\left(\begin{array}{*{11}c}0.243 & 0.0 & (-0.010-0.017j) & 0.0 & (0.003+0.006j) & 0.0 & (-0.001-0.001j) & 0.0 & (3.398\times10^{-04}+5.923\times10^{-05}j) & 0.0\\0.0 & 0.271 & 0.0 & (-0.038+0.003j) & 0.0 & (0.004+0.002j) & 0.0 & (0.002-0.002j) & 0.0 & (-0.004+0.003j)\\(-0.010+0.017j) & 0.0 & 0.186 & 0.0 & (-0.040+0.009j) & 0.0 & (0.008-0.003j) & 0.0 & (-0.001-1.722\times10^{-06}j) & 0.0\\0.0 & (-0.038-0.003j) & 0.0 & 0.105 & 0.0 & (-0.036+0.009j) & 0.0 & (0.013-0.008j) & 0.0 & (-0.013+0.010j)\\(0.003-0.006j) & 0.0 & (-0.040-0.009j) & 0.0 & 0.066 & 0.0 & (-0.020+0.006j) & 0.0 & (0.005-0.005j) & 0.0\\0.0 & (0.004-0.002j) & 0.0 & (-0.036-0.009j) & 0.0 & 0.046 & 0.0 & (-0.014-4.931\times10^{-04}j) & 0.0 & (0.002-0.006j)\\(-0.001+0.001j) & 0.0 & (0.008+0.003j) & 0.0 & (-0.020-0.006j) & 0.0 & 0.030 & 0.0 & (-0.010-0.003j) & 0.0\\0.0 & (0.002+0.002j) & 0.0 & (0.013+0.008j) & 0.0 & (-0.014+4.931\times10^{-04}j) & 0.0 & 0.016 & 0.0 & (-0.005+0.001j)\\(3.398\times10^{-04}-5.923\times10^{-05}j) & 0.0 & (-0.001+1.722\times10^{-06}j) & 0.0 & (0.005+0.005j) & 0.0 & (-0.010+0.003j) & 0.0 & 0.014 & 0.0\\0.0 & (-0.004-0.003j) & 0.0 & (-0.013-0.010j) & 0.0 & (0.002+0.006j) & 0.0 & (-0.005-0.001j) & 0.0 & 0.022\\\end{array}\right)\end{equation*}
The fidelity of the final density matrices for these two methods is 0.9778358587429837. Basically they are not close enough. So the question is, which one is correct?!
Note: Changing the solver options and subdividing the time into smaller intervals doesn't change anything. For example, here are the results for the same code but with the following time vector and mesolve options:
tvec = np.linspace(0,tend,10000)
options = Options(nsteps=5000)
The result using mesolve is:
\begin{equation*}\left(\begin{array}{*{11}c}0.212 & 0.0 & (0.004-0.052j) & 0.0 & (0.006+0.022j) & 0.0 & (-0.005-0.005j) & 0.0 & (0.002+9.285\times10^{-04}j) & 0.0\\0.0 & 0.384 & 0.0 & (-0.070+0.018j) & 0.0 & (0.009-0.004j) & 0.0 & (0.002+0.001j) & 0.0 & (-0.005-0.002j)\\(0.004+0.052j) & 0.0 & 0.195 & 0.0 & (-0.054+0.023j) & 0.0 & (0.011-0.010j) & 0.0 & (-0.001+0.003j) & 0.0\\0.0 & (-0.070-0.018j) & 0.0 & 0.082 & 0.0 & (-0.039+0.011j) & 0.0 & (0.015-0.008j) & 0.0 & (-0.012+0.011j)\\(0.006-0.022j) & 0.0 & (-0.054-0.023j) & 0.0 & 0.049 & 0.0 & (-0.019+0.009j) & 0.0 & (0.007-0.005j) & 0.0\\0.0 & (0.009+0.004j) & 0.0 & (-0.039-0.011j) & 0.0 & 0.039 & 0.0 & (-0.013-0.002j) & 0.0 & (0.008-0.004j)\\(-0.005+0.005j) & 0.0 & (0.011+0.010j) & 0.0 & (-0.019-0.009j) & 0.0 & 0.019 & 0.0 & (-0.006-0.002j) & 0.0\\0.0 & (0.002-0.001j) & 0.0 & (0.015+0.008j) & 0.0 & (-0.013+0.002j) & 0.0 & 0.008 & 0.0 & (-0.004+5.540\times10^{-04}j)\\(0.002-9.285\times10^{-04}j) & 0.0 & (-0.001-0.003j) & 0.0 & (0.007+0.005j) & 0.0 & (-0.006+0.002j) & 0.0 & 0.005 & 0.0\\0.0 & (-0.005+0.002j) & 0.0 & (-0.012-0.011j) & 0.0 & (0.008+0.004j) & 0.0 & (-0.004-5.540\times10^{-04}j) & 0.0 & 0.007\\\end{array}\right)\end{equation*}
The result using RK45 is:
\begin{equation*}\left(\begin{array}{*{11}c}0.243 & 0.0 & (-0.010-0.017j) & 0.0 & (0.003+0.006j) & 0.0 & (-0.001-0.001j) & 0.0 & (3.368\times10^{-04}+4.977\times10^{-05}j) & 0.0\\0.0 & 0.271 & 0.0 & (-0.038+0.003j) & 0.0 & (0.004+0.002j) & 0.0 & (0.002-0.002j) & 0.0 & (-0.004+0.003j)\\(-0.010+0.017j) & 0.0 & 0.186 & 0.0 & (-0.040+0.009j) & 0.0 & (0.007-0.003j) & 0.0 & (-0.001+4.236\times10^{-06}j) & 0.0\\0.0 & (-0.038-0.003j) & 0.0 & 0.105 & 0.0 & (-0.036+0.009j) & 0.0 & (0.013-0.008j) & 0.0 & (-0.013+0.010j)\\(0.003-0.006j) & 0.0 & (-0.040-0.009j) & 0.0 & 0.066 & 0.0 & (-0.020+0.006j) & 0.0 & (0.005-0.005j) & 0.0\\0.0 & (0.004-0.002j) & 0.0 & (-0.036-0.009j) & 0.0 & 0.046 & 0.0 & (-0.014-4.878\times10^{-04}j) & 0.0 & (0.002-0.006j)\\(-0.001+0.001j) & 0.0 & (0.007+0.003j) & 0.0 & (-0.020-0.006j) & 0.0 & 0.030 & 0.0 & (-0.010-0.003j) & 0.0\\0.0 & (0.002+0.002j) & 0.0 & (0.013+0.008j) & 0.0 & (-0.014+4.878\times10^{-04}j) & 0.0 & 0.016 & 0.0 & (-0.005+0.001j)\\(3.368\times10^{-04}-4.977\times10^{-05}j) & 0.0 & (-0.001-4.236\times10^{-06}j) & 0.0 & (0.005+0.005j) & 0.0 & (-0.010+0.003j) & 0.0 & 0.014 & 0.0\\0.0 & (-0.004-0.003j) & 0.0 & (-0.013-0.010j) & 0.0 & (0.002+0.006j) & 0.0 & (-0.005-0.001j) & 0.0 & 0.022\\\end{array}\right)\end{equation*}
Their fidelity is 0.9778975808571535. So there is no convergence issue.
"
['qasm']," Title: Where is definitive documentation for OpenQASM 2.0 and 3.0Body: I have gotten conflicting information about OpenQASM; some sources point to version 3 while others say 3 is not ready. I want to refer to a document that will tell me what instructions actually work with the official library.
"
['algorithm']," Title: Direct sum in Eq.(25) of *A Grand Unification of Quantum Algorithms* should be changed into $\sum_\lambda$?Body: I have a problem when I read this paper, is there someone who has occasionally read this paper and can help me solve the problem?
The problem is just about the notation used in the paper, the authors stated that $U=\left[\begin{array}{cc}\mathcal{H} & \sqrt{I-\mathcal{H}^{2}} \\ \sqrt{I-\mathcal{H}^{2}} & -\mathcal{H}\end{array}\right]$, where $\mathcal{H}=\sum_{\lambda} \lambda|\lambda\rangle\langle\lambda|$. But later, they stated again in eq.(25):
$$
\begin{aligned}
U &=\bigoplus_{\lambda}\left[\begin{array}{cc}
\lambda & \sqrt{1-\lambda^{2}} \\
\sqrt{1-\lambda^{2}} & -\lambda
\end{array}\right] \otimes|\lambda\rangle\langle\lambda| \\
&=\bigoplus_{\lambda}\left[\sqrt{1-\lambda^{2}} X+\lambda Z\right] \otimes|\lambda\rangle\langle\lambda| \\
&=: \bigoplus_{\lambda} R(\lambda) \otimes|\lambda\rangle\langle\lambda|,
\end{aligned}
$$
My question is, should the direct sum be changed into $\sum_\lambda$? Because the dimension in the direct sum form seems not the same as the original $U$.
"
"['gate-synthesis', 'universal-gates', 'superconducting-quantum-computing', 'solovay-kitaev-algorithm', 'compiling']"," Title: Is the Solovay-Kitaev theorem relevant for modern hardware?Body: The Solovay-Kitaev theorem (and more recent improvements) explains how to efficiently compile any 2-qubit unitary into any universal (dense) finite set of gates. My question is if this theorem is relevant for modern hardware?
Take, for example, superconducting qubits. There, modulo noise and errors, arbitrary single-qubit gates can be executed. Having the capacity to perform arbitrary single-qubit gates allows to compile any 2-qubit gate with at most three CNOTs.
I am not sure, but I'm guessing that other hardware platforms also allow for the continuous single-qubit gates. Does this make the Solovay-Kitaev theorem obsolete for practical purposes, or am I missing something?
"
['entanglement']," Title: How is the creation of entangled two-photon states such as $|00\rangle\pm|11\rangle$ compatible with the conservation of angular momentum?Body: Quoting, "Spin is the simplest example — two photons would either be (+1 and -1) or (-1 and +1), two electrons would either be (+½ and -½) or (-½ and +½) — and you don’t know which is which until you measure it"
Source: https://medium.com/starts-with-a-bang/ask-ethan-whats-so-spooky-about-quantum-entanglement-e62c35ba339d
Question: The above states of photon polarization: (+1 and -1) relates to entangled state of 01+10 and is understandable for conservation of ang. momentum.
How is the state 00+11 realized in terms of polarization. Does not having two photons with (+1 and +1) violate conservation of ang. momentum?
"
"['qiskit', 'programming', 'ibm-q-experience', 'experiment']"," Title: 'Internal error. Error code 9999' when running job on IBMQBody: I'm trying to run a series of circuits in a job and I keep getting this error message which I haven't been able to find the meaning of anywhere in qiskit's documentation, online, etc. The job appears to run for 15 minutes and only then does an error appear... Anyone have any clue as to what this could be? The job consists of batches of circuits where each batch is just a certain circuit repeated a different number of times (before measurement), so I don't see any obvious reason why the circuits from one batch work fine but not from another.
"
"['entanglement', 'quantum-circuit', 'quantum-fourier-transform']"," Title: Does QFT exploit entanglement?Body: I was studying the quantum circuit for the Quantum Fourier Transform (QFT) on the Mike & Ike, and they write the result of the transformation as a product state.
More precisely they wrote the output of the QFT in the form
$$\frac{1}{\sqrt{2^n}} (\left| 0 \right> + e^{2\pi i 0.j_n} \left| 1\right>) (\left| 0\right> + e^{2\pi i 0.j_{n-1}j_n} \left| 1\right>)...(\left| 0\right> + e^{2\pi i 0.j_1j_{2}...j_n} \left| 1\right>).$$
Is it an entangled state? It seems just the (tensor) product of single-qubit states to me, but I think I am missing something here.
"
"['quantum-state', 'entanglement', 'measurement', 'tensor-product']"," Title: How to measure a correlated operator $Z_1Z_2$?Body: I was reading this articl and I am stuck trying to understand equation $(60)$, which reads
$$\langle\psi|\Lambda_{1,2}(X)Z_1\Lambda_{1,2}(X)|\psi\rangle=\langle\psi|Z_1Z_2|\psi\rangle$$ where $\Lambda(X)=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X$ defines the CNOT gate.
How do we obtain this equation?
Also, I do not understand what does $Z_i$ mean for $i=1,2$ and what the subscripts $_{1,2}$ in $\Lambda_{1,2}$ are.
"
"['quantum-gate', 'gate-synthesis', 'teleportation', 'universal-gates', 'bell-basis']"," Title: Decompose bell measurement gate into combination of controlled-not gates and one-qubit gatesBody: OPENQASM2.0 has only one two-qubit gate: controlled not. For a teleportation experiment, I need to perform a measurement in the Bell basis. That is, I need a two-qubit gate with matrix representation
$$\begin{bmatrix}
0&1&1&0\\
0&-1&1&0\\
1&0&0&1\\
1&0&0&-1
\end{bmatrix}/\sqrt{2}.$$
To use this library, I need to decompose this gate into a combination of CNOTs and elementary single-qubit gates such as X,Y,Z, etc.
I don't expect the person answering this question to give the decomposition, but hope that they can point me to a helpful resource. I am familiar with linear algebra and have tools such as Mathematica.
"
"['quantum-state', 'unitarity', 'tensor-product']"," Title: What is the form of a unitary $U$ that preserves the marginals on a given state, $\text{Tr}_A(U\rho_{AB} U^\dagger) = \rho_B$?Body: Suppose for some quantum state $\rho_{AB}$ and unitary $U_{AB}$, one has
$$\text{Tr}_A(U\rho U^\dagger) = \rho_B$$
does this imply that $U_{AB} = U_A\otimes I_B$?
Also, the same question as above, but if it holds for all states, $\rho_{AB}$, is that sufficient to claim that $U_{AB} = U_A\otimes I_B$?
"
"['hamiltonian-simulation', 'phase-estimation']"," Title: Why does quantum phase estimation complexity scale with maximum representable energy?Body: In Quantum simulation of chemistry with sublinear scaling in
basis size Ryan Babbush and other authors from Google Quantum team argue, when talking about performing Quantum Phase Estimation in 1st quantization, that
The reason for our greatly increased efficiency is that the complexity scales like the maximum possible energy representable in the basis.
But they do not really give a reason why this is the case or point to a reference to understand it better. Does anyone know why this is indeed true?
"
['error-correction']," Title: Show that ${\cal C}(\rho)={\rm Tr}[U(\rho\otimes|0\rangle\!\langle0|)U^\dagger]$ can be corrected iff $t=0$, where $U=I+(e^{it}-1)|\Psi^-〉〈\Psi^-|$Body:
Let $ \mathcal{C} $ be the quantum channel defined by $$
\mathcal{C}(\rho)=\operatorname{Tr}_{2}\left[U(\rho
\otimes|0\rangle\langle 0|) U^{\dagger}\right], $$ where $ U $ is the
two-qubit unitary gate $$ U=I \otimes I+\left(e^{i
t}-1\right)\left|\Psi^{-}\right\rangle\left\langle\Psi^{-}\right|,
\quad t \in \mathbb{R} $$ $ \left|\Psi^{-}\right\rangle=(|0\rangle
\otimes|1\rangle-|1\rangle \otimes|0\rangle) / \sqrt{2} $, and $
\operatorname{Tr}_{2} $ denotes the partial trace on the second qubit.
Show that $ \mathcal{C} $ can be corrected if and only if $ t=0 $.
I wonder if there are any other ways to do this without expanding all the terms.
"
"['quantum-state', 'physical-qubit', 'qubit-mapping']"," Title: Is it possible to build a ""Quantum Karnaugh Map""?Body: Is it possible to build something similar to the Karnaugh Map but instead of classical bits input and output with qubits input and output?
"
"['decoherence', 'trapped-ion']"," Title: Raman scattering goes in all directions, so why doesn't it decohere trapped ions?Body: I'm trying to learn about the physics of ion traps, and my understanding is that an ion can be moved from a ground state to an excited state by stimulation with a laser pulse. More specifically, this is a Raman transition: the ion absorbs an incoming photon and reaches a "virtual state", then releases a photon and decays back down to either the initial state or the excited state.
The emitted photon is thus entangled with the qubit. To maintain coherence, it needs to fit into a coherent state such as a laser state.
However, everything I've read about this kind of scattering states that the outgoing photon has a random direction (which I assume means a superposition of directions until the outgoing photons start interacting with the environment). If this happens, then the outgoing photon is no longer part of the coherent laser state (which is mostly propagated in the original direction). All outgoing photons will be correlated with the qubit, and so when they interact with the environment, they will decohere the qubit.
It seems like the only way to maintain coherence would be if the outgoing photons had the same momentum (but why would this happen?) or if there was so much scattering that there was effectively a coherent scattered state that was only weakly entangled with the trapped ion. Is any of this accurate?
"
"['grovers-algorithm', 'linear-algebra', 'arithmetic']"," Title: How to verify a matrix-vector product with Grover search?Body: I am looking at the Ambainis et al. method of verifying whether $AB = C$ in $O(n^{7/4})$ queries, as described in Buhrman and Špalek. They have the following sentence:
verify the matrix-vector product $Ay=z$ by a Grover search.
What, exactly, does this refer to?
Presumably, we would like to find--if they exist--any "marked elements", where an element in $z$ is marked if it does not equal the corresponding element in $Ay$. However, we do not a priori know the labels of the marked elements, which, as far as I know, Grover search requires (even as quantum walk algorithms do not). So, how does Grover's search help us in this case?
"
"['textbook-and-exercises', 'mathematics', 'linear-algebra', 'eigenvalues-and-eigenvectors']"," Title: How to find the eigenstates of a general $2\times 2$ Hermitian matrix?Body:
Given a measurement operator in the general Hemitian form
$$
M = \begin{pmatrix} z_1 & x+iy \\ x-iy & z_2\end{pmatrix},
$$
where $x,y,z_1,z_2 \in \mathbb{R}$, show that the eigenvalues are
$$
m_{1,2} = \frac{z_1 + z_2}{2} \pm \frac{1}{2}\Big[ (z_1-z_2)^2 + 4(x^2+y^2)\Big]^{1/2}
$$
with eigenvectors
$$
|m_1\rangle = \begin{pmatrix}e^{i\varphi}\cos(\theta/2) \\ \sin(\theta/2)\end{pmatrix}
$$
and
$$
|m_2\rangle = \begin{pmatrix}-e^{i\varphi}\sin(\theta/2) \\ \cos(\theta/2)\end{pmatrix},
$$
where $\varphi = \tan^{-1}(y/x)$ and $\theta = \cos^{-1}([z_1-z_2]/[m_1-m_2])$.
I have found the eigenvalues but I am not able to find eigenstates in that form after hours of work.
"
"['algorithm', 'decoherence', 'quantum-walks']"," Title: How to simulate a quantum walk with decoherence?Body: I'm trying to reproduce quantum walk with decoherence as shown in figure 3 in V. M. Kendon, Phil. Trans. R. Soc. A, 364, 2006 (quant-ph/0609035).
I am able to reproduce quantum walk without decoherence. And the code is attached.
To reproduce quantum walk with decoherence, I am thinking following the formula
$$|\psi_{t+1}\rangle = (1-p)U|\psi_t\rangle + pMU|\psi_t\rangle$$
where $|\psi_t\rangle$ represents the state at $t$-th step, $U$ is the quantum-walk operator, and $M$ is a measurement operator modeling the decoherence, $p$ is a specified probability that decoherence occurs at each step.
However, I'm having a hard time determining the operator $M$. Any suggestions?
The MATLAB code for quantum walk without decoherence:
clearvars; clc; close all
t = 100; % number of steps
P = 2*t+1; % number of positions
% coins
c0 = [1, 0];
c1 = [0, 1];
C00 = c0'*c0;
C01 = c0'*c1;
C10 = c1'*c0;
C11 = c1'*c1;
C = [1 1; 1 -1]/sqrt(2); % coin operator, or just the Hadamard operator
% shift operation
shiftplus = circshift(eye(P),1);
shiftminus = circshift(eye(P),-1);
S = kron(shiftplus, C00) + kron(shiftminus, C11);
% walk operation
U = S*kron(eye(P), C);
% initial condition
x0 = zeros(P,1);
x0(t+1) = 1;
psi0 = kron(x0, (c0+c1*1i)'/sqrt(2));
% evolution
psi = U^t*psi0;
% measurement
p = zeros(P,1);
for i = 1:P
x = zeros(P,1);
x(i) = 1;
Mi = kron(x*x', eye(2));
proj = Mi*psi;
p(i) = sum(real(proj.*conj(proj)));
end
% plotting
x = (-t:t)';
plot(x(1:2:end),p(1:2:end))
"
"['quantum-gate', 'clifford-group', 'terminology']"," Title: Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates?Body: Clifford gates are transversal What exactly does this transversal mean? What is the difference between non-Clifford gates and Clifford gates? Why is it simple for Clifford gates to implement transversal for quantum fault tolerance? Please explain the definitions, differences, and functions of the two in detail. I don't understand them very well, thank you.
"
"['quantum-gate', 'circuit-construction', 'bell-basis']"," Title: What quantum gates admit a basis-independent interpretation of their action?Body: The SWAP gate swaps the state of the two qubits so that in the computational basis $|01\rangle \rightarrow |10 \rangle$ with a matrix representation given by:
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
What I found interesting (but not necessarily surprising) is that the matrix representation of the SWAP gate is independent of the basis used, e.g. in the polar basis we also have $|+-\rangle \rightarrow |-+\rangle$ and the matrix representation is the same. As such the SWAP gate can be interpreted as swapping the qubits independent of the basis used. It's also relatively straightforward to check that this holds for any basis $\alpha |0\rangle + \beta |1\rangle$, $\beta^* |0\rangle - \alpha^* |1\rangle$.
Now my question is whether there are other such gates (2- or n-qubit) that have a basis independent interpretation of their action. Mathematically I guess this would translate to the unitary matrices $U_G$ satisfying:
\begin{equation}
\left(U_b^{\otimes n}\right)^\dagger U_G U_b^{\otimes n} = U_G
\end{equation}
for any $2 \times 2$ unitary matrix $U_b$.
I guess one (not super interesting) example would be any arbitrary sequence of m SWAP gates as this would result in:
\begin{equation}
U_G = \prod_m\left(I^{\otimes k_m}\otimes U_{\text{SWAP}} \otimes I^{\otimes n-k_m-2}\right)
\end{equation}
which satisfies the requirement as a result of the single SWAP gate satisfying the requirement. However I was hoping there might other more interesting gates that are basis independent or some interesting mathematical details on the set of such gates.
"
"['physical-qubit', 'superconducting-quantum-computing', 'circuit-qed']"," Title: Meaning of Continuous Charge in the Inductively Shunted Cooper Pair BoxBody: In the Cooper Pair box, the conjugate momentum $\hat{n}$ of the reduced superconducting phase variable $\hat{\varphi}$ takes only discrete, integer values due to the $2\pi$ periodicity of the phase. As this conjugate momentum is the relative charge number on the island, this corresponds to the discrete charge on the island.
In the inductively shunted CPB, the inductance destroys the periodicity of the potential in $\varphi$, we have a $\frac{1}{2}E_L \varphi^2$ term additional to the usual $\cos{(\varphi)}$ term of the Josephson Junction.
Now Girvin (http://www.capri-school.eu/lectureres/master_cqed_les_houches.pdf, after 4.41) or Koch et al. (PRL 103, 217004 (2009)) write that this leads to the charge variable becoming continuous as opposed to integer-valued like in the CPB.
Formally, this makes sense to me: As we do not have periodic boundary conditions for $\varphi$ anymore, we will not have discreteness of the conjugate momentum, i.e. the charge anymore.
I wonder, however, how to interpret this physically: After all, the transferred charge must still be quantized in the form of Cooper pairs. So what is meant by the continuity of the charge here?
"
"['qiskit', 'programming', 'vqe']"," Title: Variational quantum eigensolver in qiskitBody: I have implemented a hybrid quantum NN on a dataset to perform classification. Now I want to apply quantum PCA to my dataset to find the eigenvalues. After going through a few qiskit tutorials, I found that VQE is used for finding eigenvalues in qiskit. Is there a demo program implementing VQE on a dataset where we can check the steps?
"
"['qiskit', 'programming']"," Title: Very simple matrix operation (Markov chain) in terms of QiskitBody: I am trying to approach Markov chains as a use case for Quantum Computing. For this I took the simple introductory case from Wikipedia (Markow-Kette):
- $v_0=\begin{pmatrix}
1 & 0 & 0
\end{pmatrix}$
- M=$\begin{pmatrix}
0 & 0.2 & 0.8\\
0.5 & 0 & 0.5\\
0.1 & 0.9 & 0\\
\end{pmatrix}$
- $v_1=v_0M$
- $v_3=v_0M^3$
As a starter/"appetizer" I implemented this situation with the following 3-liner using Numpy and got very straight forwardly the correct result v3=[0.37 0.126 0.504] which is in line with the result from the Wikipedia Site:
M = np.array([[0, 0.2, 0.8], [0.5, 0, 0.5], [0.1, 0.9, 0]])
v0=np.array([1,0,0])
v1=v0.dot(M)
print(v1)
v3=v0.dot(matrix_power(M, 3))
print(v3)
Now I'm stuck porting the whole thing to Qiskit, where I am really would be satisfied with a simulator-based solution:
qiskit.IBMQ.save_account('your_token', overwrite=True)
qiskit.IBMQ.load_account()
n_wires = 1
n_qubits = 1
provider = qiskit.IBMQ.get_provider('ibm-q')
backend = Aer.get_backend('qasm_simulator')
[...]
Asking Google led me to Matrix product state simulation method, but it seems to be not obvious how to apply this to my simple problem. A simple nudge in the right direction would be really appreciated.
"
"['circuit-construction', 'unitarity', 'quantum-turing-machine', 'church-turing-thesis']"," Title: Does there exists an algorithm to construct a quantum circuit given an arbitrary unitary?Body: Suppose there exists an algorithm that takes as input an arbitrary unitary matrix and produces as output a quantum circuit representing that matrix. Then in theory that algorithm could construct any quantum circuit. This would be quite useful.
Furthermore, since any computable algorithm may be implemented as a quantum circuit, the hypothetical circuit constructing algorithm could in principle construct any such algorithm as a quantum circuit. This seems similar, though not identical, to the idea of Turing completeness.
Intuitively it seems bizarre that such an algorithm could exist. However, I am not able to think of something that disproves this. Has such an algorithm's existence been proven/disproven?
"
"['quantum-gate', 'measurement', 'quantum-circuit', 'deferred-measurement']"," Title: Show that the effect of a Controlled Unitary on qubits followed by a measurement is unchanged depending on when measurement is takenBody:
I understand that a Controlled Unitary is just a generalization of a control gate, such as CNOT etc, and that it is given in state representation as $$\hat C_U = |0\rangle\langle0|\otimes\mathbb{I} + |1\rangle\langle1|\otimes \hat U $$or matrix representation of
\begin{pmatrix}
\mathbb{I} & \textbf{0}\\
\textbf{0} & \textbf{U}
\end{pmatrix}
The question is asking to show that the time of measurement does not impact the effect of a controlled unitary. I'm unsure how to show this.
"
"['quantum-gate', 'quantum-state', 'algorithm']"," Title: Deutsch-Jozsa on balanced 3 bit functionBody: I am trying to understand the Deutsch-Jozsa algorithm for general $U_f$, but the following function is causing me trouble $f(x,y,z)=x\cdot y \oplus z$.
It gives rise to the following quantum gate $U_f:$
$\begin{align}
U_{f}(|000x\rangle)&=|000(x)\rangle\\U_{f}(|001x\rangle)&=|001(x\oplus1)\rangle\\U_{f}(|010x\rangle)&=|010(x)\rangle\\U_{f}(|011x\rangle)&=|011(x\oplus1)\rangle\\U_{f}(|100x\rangle)&=|100(x)\rangle\\U_{f}(|101x\rangle)&=|101(x\oplus1)\rangle\\U_{f}(|110x\rangle)&=|110(x\oplus1)\rangle\\
U_{f}(|111x\rangle)&=|111(x)\rangle
\end{align}
$
From what I understand, for Deutsch-Jozsa to work we need to have $U_f|+++-\rangle =|----\rangle,$ for $f$ balanced.
However, when I try to compute the LHS I get
\begin{align}
U_{f}|+++-\rangle&=U_{f}\frac{1}{4}(\sum_{x,y,z\in{0,1}}|xyz0\rangle-\sum_{x,y,z\in{0,1}}|xyz1\rangle)\\&=\frac{1}{4}(|0000\rangle+|0011\rangle+|0100\rangle+|0111\rangle+|1000\rangle+|1011\rangle+|1101\rangle+|1110\rangle\\&-(|0001\rangle+|0010\rangle+|0101\rangle+|0110\rangle+|1001\rangle+|1010\rangle+|1100\rangle+|1111\rangle))\\
&\not = |----\rangle.
\end{align}
How can that be if $f$ is balanced?
"
"['quantum-state', 'ibm-q-experience', 'quantum-circuit', 'teleportation']"," Title: Getting different sets of plots for the teleportation algorithm in Composer and LabBody: I tried recreating the quantum teleportation circuit (in the Qiskit Foundation Youtube Playlist) both in Lab and Composer and getting different plots for each.
Here is circuit and histogram from Composer
And here is the one in Lab
How do I make sense of these? Link for tutorial https://www.youtube.com/watch?v=mMwovHK2NrE&list=PLOFEBzvs-Vvp2xg9-POLJhQwtVktlYGbY&index=5
Edit : Sorry for the wrong composer circuit earlier, thanks for correcting me.
"
"['quantum-circuit', 'matrix-representation', 'physical-qubit']"," Title: Calculate Outputs of a Teleportation CircuitBody:
In this question, I assume we use matrix representation to calculate what each output could be?
For example, for the middle qubit in state: $$|00\rangle$$
After the first Hadamard and CNOT gate (so the dashed red line), would this be carried out by:
$$ |00\rangle((\mathbb{I} \otimes \hat H)(|0\rangle\langle0|\otimes \mathbb{I} + |1\rangle\langle1|\otimes \hat X))$$ of which there is a solution given at this link: https://www.quora.com/What-is-the-matrix-of-a-Hadamard-with-a-CNOT-gate
Which shows that we are given a superposition after this operation.
My question is what happens after the further CNOT12 and CNOT23 are applied to the state. I assume it is just a further application of the appropriate matrices? And I suppose with this we will be left with a superposition in the output? Is this correct? I am quite new to qubit circuits and I am actually unsure if it is correct that you may have a superposition at the end of a circuit. I thought that CNOT gates were essentially a measurement, and should collapse the superposition into a single state $$|0\rangle \space or \space |1\rangle$$
"
"['textbook-and-exercises', 'swap-test']"," Title: Confusion in computing the $1+|\langle\phi|\psi\rangle|^2$ term in the quantum swap test algorithmBody: I am having trouble understanding a particular step of the Swap-test algorithm.
As I am struggling with this for the past week, I thought I should ask here.
So, I get the procedure until right after we measure the probability of the the system to collapse at state $|0\rangle$.
$$P(\mathrm{First\:qubit=0})=\frac{1}{2}\big (\langle\phi|\langle\psi|+\langle\psi|\langle\phi|\big)\frac{1}{2}\big (|\phi\rangle|\psi\rangle+|\psi\rangle|\phi\rangle\big)=\frac{1}{2}+\frac{1}{2}|\langle\psi|\phi\rangle|^2$$
In this equation, I cannot understand how we go from the second part to the third part.
If I do the math, I get the second part to be equal with
$$=\frac{1}{4}\big(\langle\phi|\langle\psi||\psi\rangle|\phi\rangle+\langle\psi|\langle\phi||\phi\rangle|\psi\rangle\big)$$
How do we get from that to the third part with the l2-norm?
Perhaps I am missing something really simple here, but I cannot seem to get it.
Thanks in advance
"
"['quantum-state', 'entanglement']"," Title: Volume law spread after Hamiltonian evolutionBody: Start with an $n \times n$ lattice, with each qubit initialized to the state $|0\rangle$. Then, apply the Hadamard gate on each qubit. Then, evolve the system under the Hamiltonian
\begin{equation}
H = \sum_{l, m \in [n]} \text{Z}_l \text{Z}_m,
\end{equation}
for $d$ time steps.
Note that the final state of the Hamiltonian can be written as
\begin{equation}
|\psi\rangle_{\text{final}} = \frac{1}{\sqrt{2^{n^{2}}}} \sum_{x \in \{0, 1\}^{n^{2}}} \sum_{l, m \in [n]} e^{-i d (-1)^{x_l + x_m}} |x\rangle,
\end{equation}
where $x_i$ is the $i^{\text{th}}$ bit of $x$.
I could not formally prove that this state abides by a volume law entanglement spread and that is where I needed help.
Since the Hamiltonian allows for long-range interactions, it is qualitatively evident that the entanglement will follow a volume-law spread.
"
"['qiskit', 'programming', 'quantum-gate', 'circuit-construction', 'ibm']"," Title: Can the ancilla for Qiskit's mcx with mode=""recursion"" be dirty?Body: I think their implementation is close to the one from here which does use a dirty ancilla, but I just want to make sure
"
"['measurement', 'quantum-operation', 'quantum-optics']"," Title: What are the measurement operators $F_k$ corresponding to a homodyne measurement?Body: By definition, a measurement is characterized by a set of positive-semidefinite matrices $\{F_k\}$ satisfying the completeness relation $\sum_k F_k = \textbf{I}$. I am interested in knowing how does the Homodyne measurement fit into this definition?
Edit: My understanding of Homodyne detection is no better than given in Wikipedia: homodyne detection is a method of extracting information encoded as modulation of the phase and/or frequency of an oscillating signal, by comparing that signal with a standard oscillation that would be identical to the signal if it carried null information. "Homodyne" signifies a single frequency, in contrast to the dual frequencies employed in heterodyne detection.
What are the corresponding $\{F_k\}$ operators for Homodyne detection?
"
"['quantum-gate', 'textbook-and-exercises', 'quantum-circuit']"," Title: Is a quantum circuit with a controlled-T gate possible?Body: This diagram comes from the textbook, Quantum information (Author: Stephen Barnett), fig. 6.13.
The problem is what I know that T gate isn't a multi-qubit gate, so is it possible that T gate becomes controlled-something?
"
"['quantum-operation', 'information-theory', 'kraus-representation']"," Title: Is the composition of two extremal channels also extremal?Body: In this question, I follow the terminology and notation of the book of Watrous, most notably chapter two.
Extremal channels
An extremal channel $\Phi(X) \in C(\mathcal{X},\mathcal{Y})$ is a channel that can not be written as a convex combination of other channels. In other words, $\Phi$ is an extremal channel if and only if the equality
\begin{equation}
\Phi(X) = \lambda \Phi_{1}(X) + (1-\lambda)\Phi_{2}(X),
\end{equation}
for $\lambda \in (0,1)$ implies that $\Phi_{1} = \Phi_{2} = \Phi$.
Question
Given two extremal channels $\Lambda_{1} \in C(\mathcal{X},\mathcal{Y})$ and $\Lambda_{2} \in C(\mathcal{Y},\mathcal{Z})$, is the composition $\Lambda_{12} \in C(\mathcal{X},\mathcal{Z})$ defined by
$$
\Lambda_{12} = \Lambda_{2} \circ \Lambda_{1},
$$
also an extremal channel? Or are there extra criteria that the maps should adhere to for the composition to be an extremal channel, too?
In other words, suppose that $\Lambda_{12}(X) = \lambda\Lambda_{12}^{1}(X) + (1-\lambda)\Lambda_{12}^{2}(X)$, does that imply that $\Lambda_{12} = \Lambda_{12}^{1} = \Lambda_{12}^{2}$?.
Do $\Lambda_{12}^{1}$ and/or $\Lambda_{12}^{2}$ even necessarily need to have the structure of mapping $L(\mathcal{X})\rightarrow L(\mathcal{Y}) \rightarrow L(\mathcal{Z})$? (Insofar that this is not an ill-posed question).
Some thoughts
As is shown in the aforementiond book (Thm. $2.31$, page $96$), a channel represented by linearily independent Kraus operators $\{A_{k}\}_{k}$ is an extremal channel if and only if the collection $\{A_{k}^{\dagger}A_{k'}\}_{kk'}$ is also linearily independent.
Let $\{A_{k}: A_{k} \in L(\mathcal{X},\mathcal{Y})\}_{k}$ and $\{B_{l}\in L(\mathcal{Y},\mathcal{Z})\}_{l}$ be such Kraus operators for $\Phi_{1}$ and $\Phi_{2}$, respectively.
The collection $\{B_{l}A_{k}: B_{l}A_{k} \in L(\mathcal{X},\mathcal{Z})\}_{kl}$ forms a valid set of Kraus operators representing $\Phi$. However, these might not be linearily independent, which means that we cannot invoke the above criterium for extremal channels. One could take only a spanning but linearily independent subset and invoke the criterium, but I am not sure if this is a properly justified step. Even more so, such a set $\{A^{\dagger}_{k'}B^{\dagger}_{l'}B_{l}A_{k}\}_{(kl),(k'l')}$ is not necessarily linearily independent, I believe.
"
"['mathematics', 'partial-trace', 'trace']"," Title: How to compute derivatives of partial traces of the form $\frac{\partial \operatorname{Tr}_B(F(\mathbf{X}))}{\partial \mathbf{X}}$?Body: The Matrix Cookbook says that for any differentiable matrix function $F(\cdot)$, it holds that
$$\frac{\partial \operatorname{Tr}(F(\mathbf{X}))}{\partial \mathbf{X}}=f(\mathbf{X})^{T},$$
where $f(\cdot)$ is the scalar derivative of $F(\cdot)$. Is there a relation like this for the case where one has the partial trace i.e., for some bipartite operator $X_{AB}$
$$\frac{\partial \operatorname{Tr}_B(F(\mathbf{X}))}{\partial \mathbf{X}}= \ ?$$
I will eventually apply this to optimization problems where $X_{AB}$ will be a quantum state so assumptions like positive semidefiniteness and unit trace are okay.
"
"['simulation', 'quantum-circuit', 'clifford-group']"," Title: What is the fastest classical simulator for quantum circuits with only Clifford gates?Body: What is the fastest classical simulator for quantum circuits with only Clifford Gates?
And is there any "friendly" implementation e.g. in Python (or in some well-known libraries like Qiskit)?
Fast simulators for quantum circuits with other constraints are also well accepted.
Thank you!
"
"['textbook-and-exercises', 'resource-request']"," Title: Should one learn the math of quantum computing from a ""pure"" perspective, or are quantum computing texts ""good enough""?Body: Math for quantum computing includes advanced linear algebra, functional analysis, group and representation theory, probability theory, and more.
There are plenty of pure math books out there for those, but there are also quantum computing/information theory books that contain only the parts relevant for QC.
Is there any advantage to learning the math from a pure math perspective first, then learning QC, or learning the math directly from quantum computing textbooks? I guess before I crack open Dummit and Foote, I want to make sure I'm not doing overkill.
I ask as someone who is slightly more interested in the math/computer science side of QC, and probably less of the physical implementation. The goal would be to read/understand research papers in the field and possibly contribute.
"
['superposition']," Title: If 3 polarizer experiment to teach quantum superposition can be explained classically, should it not be used to explain Quantum Mechanics?Body: Here is the link to the Dirac's three polarizer experiment.
https://www.informationphilosopher.com/solutions/experiments/dirac_3-polarizers/
When a 90$^o$ and 0$^o$ polarizers are placed in front of each other, no light comes out of the other end.
When a 45$^o$ polarizing filter is placed between 90$^o$ and 0$^o$ filters, we surprisingly see light coming out from the setup.
A quantum explanation of polarization of light was given by Dirac.
However, I found a few sources where this is explained classically. The crux of their argument is that there are long molecules in the polarizer film. They not only attenuate the light but also rotate it. This combined effect can be used to explain the phenomenon classically.
http://alienryderflex.com/polarizer/
https://qr.ae/pGqOMb
Is this a good experiment to teach about Quantum Superposition. Is there is any flaw in the second argument?
"
"['qiskit', 'programming', 'hadamard']"," Title: I can not extract the final statevector when using a binded Parametric Controlled gateBody: I'm trying to implement a Parametric Hadamard Test.
I have already my parametric evolution gate $\exp(-i\theta H)$ where $\theta$ is the parameter.
When I defined the controlled-gate with Gate.control(1) and add it to the main circuit. I'm unable to correctly bind the parameters after and I can not get the state vector after the binded circuit.
thetas = ParameterVector('T', length=1)
it = iter(theta)
# Define Hadamard Test
qc = QuantumCircuit(3)
qc.initialize(psi_0, [1,2])
qc.h(0)
# Apply control gate
tr_g_k = tr_g(dt=next(it)) # tr_g is the evolution gate $\exp(-i\theta H)$
tr_g_c = tr_g_k.control(1)
qc.append(tr_g_c, [0,1,2])
qc.h(0)
# --------------------------------------------------------
# Get the StateVector
qc_b = qc.bind_parameters({theta: [np.pi]})
simulator = Aer.get_backend('aer_simulator')
qc_bt = transpile(qc_b, simulator)
qc_bt.save_statevector()
result = simulator.run(qc_bt).result()
statevector = result.get_statevector(qc_bt)
When running the circuit I get:
TypeError: ParameterExpression with unbound parameters ({ParameterVectorElement(T[0])}) cannot be cast to a float.
I have tried without the control, i.e, only the evolution in the qubit 1 and 2 and it works.
I think it's because the control, but so far, I have not been able to solve it.
Thanks for any help !
"
"['programming', 'circuit-construction', 'shors-algorithm', 'modular-exponentiation']"," Title: How to create this feature map?Body: In this paper, the following feature map is used:
$$x \to \vert\phi(x)\rangle = \frac{1}{\sqrt{2^k}}\sum_{i=0}^{2^k-1}\vert x\cdot g^i\rangle$$
But no circuit is provided. A theoretical description of the circuit is provided in the supplementary information on page 17 (the image is provided below).
The steps require:
- Modular multiplication and exponentiation: $$C_{y,k}\vert i \rangle \vert 0^n \rangle= \vert i \rangle \vert (y\cdot g^i) \% p \rangle$$
But they don't describe how to create this.
- Discrete log: $$U_y \vert (y\cdot g^i) \% p \rangle \vert0\rangle = \vert i \rangle\vert (y\cdot g^i) \% p \rangle$$
The overall process is described as: $$\vert0^n\rangle \overset{H^{\otimes k}}{\to}\frac{1}{\sqrt{2^k}}\sum_{i \in\{0,1\}^k}\vert i\rangle \overset{C_{y,k}}{\to}\frac{1}{\sqrt{2^k}}\sum_{i \in\{0,1\}^k}\vert i\rangle \vert (y\cdot g^i) \% p \rangle \overset{U_y^\dagger}{\to}\frac{1}{\sqrt{2^k}}\sum_{i \in\{0,1\}^k}\vert (y\cdot g^i) \% p \rangle$$
How to create this feature map?
"
['algorithm']," Title: Can we say that we've already have a lot quantum algorithms offer speed up over classical algorithms(at least polynomial)?Body: The question is inspired by the comment of this link that people say we still don't have a lot of quantum algorithms that offer speed up over classical algorithms. While I found that on this website: Quantum Algorithm Zoo, it seems that there are already a lot of problems showing speed-up over classical algorithms(polynomial or exponential or more).
But rather strange thing is that the algorithm I often heard about is mainly these three: Grover's algorithm(Amplitude amplification), Hamiltonian Simulation, Phase estimation(Maybe I need to add Quantum Machine Learning? Not very familiar with that filed)$^{[1]}$. So the reason that we feel we don't have a lot of algorithms might be that a lot of algorithms are mainly based on these basic algorithms?
$[1]$: The talk by Issac Chuang also mainly stated these several algorithms.
"
"['mathematics', 'bloch-sphere']"," Title: How to decompose Bloch sphere rotations $e^{\frac{i\theta}{2}(\cos(\phi)\sigma_x + \sin(\phi)\sigma_y)}$ in terms of $R_x,R_y,R_z$?Body: I learned a formula to represent the rotation around bloch sphere:
$\theta_{\phi} = e^{\frac{i\theta}{2}(\cos(\phi)\sigma_x + \sin(\phi)\sigma_y)}$
So that $\pi_0$ is the gate $X$ and $\pi_{\frac{\pi}{2}}$ is the gate $Y$.
My question is: how do we get this formula to represent the rotation gate? If we have a gate, say $\pi_{\frac{\pi}{6}}$, how do we use the rotation gates like $R_x$, $R_y$, or $R_Z$ to represent the gate?
"
"['quantum-state', 'entanglement', 'mathematics', 'linear-algebra', 'inner-product']"," Title: Prove that $|(\langle \psi|_{A} \otimes \langle \phi|_{B})|\theta\rangle_{AB}|^{2}<1$ for entangled $|\theta\rangle_{AB}$Body: I am trying to show that $|\langle \psi|_{A} \otimes \langle \phi|_{B}|\theta\rangle_{AB}|^{2}<1$ given $|\theta\rangle$ is an entangled state, and as such has schmidt rank >1. Decomposing it, we get $$|\theta\rangle=\sum_{i}\lambda_{i}|i\rangle_{A}|i\rangle_{B}$$ so $$\langle \psi|_{A} \otimes \langle \phi|_{B}|\theta\rangle_{AB}=\sum_{i}\lambda_{i}\langle\psi|i\rangle_{A}\langle\phi|i\rangle_{B}$$ which means $$\begin{align}|\langle \psi|_{A} \otimes \langle \phi|_{B}|\theta\rangle_{AB}|^{2}&=\left(\sum_{i}\lambda_{i}\langle\psi|i\rangle_{A}\langle\phi|i\rangle_{B}\right)\left(\sum_{j}\lambda_{j}\langle\psi|j\rangle_{A}\langle\phi|j\rangle_{B}\right)^{*}\\&=\sum_{i,j}\lambda_{i}\lambda_{j}^{*}\langle\psi|i\rangle_{A}\langle j|\psi\rangle_{A}\langle\phi|i\rangle_{B}\langle j|\phi\rangle_{B}\end{align}$$
Now I am told to use the Cauchy Schwarz, and immediately it can be used on the 4 complex numbers resulting from the I.N. here, so we get $$\sum_{i,j}\lambda_{i}\lambda_{j}^{*}\langle\psi|i\rangle_{A}\langle j|\psi\rangle_{A}\langle\phi|i\rangle_{B}\langle j|\phi\rangle_{B}\le\sum_{i,j}\lambda_{i}\lambda_{j}^{*}$$
However, this last term is not strictly upper bound by 1. The only thing I can think of is that, due to the choice of the product state being free, you would choose them so the overlap with the product state assigned to the largest Schmidt coefficient would be 1, the modulus squared of which has to be less than 1. However, I am not sure how to present a tidy proof of this.
"
"['programming', 'error-correction', 'stim']"," Title: Simulating flag qubits and conditional branches using StimBody: In a quantum error correcting code using flag qubits, it's common to have flag measurements that tell you it's necessary to do some extra measurements for safety. So, for example, I want to say:
if measurement_result_was_true:
do_a_different_measurement
How do I do this in Stim? There doesn't seem to be an if.
(This was a question I received by email. Moving it here for posterity.)
"
['optimization']," Title: Number of required Qubits for combinatorial optimization problemsBody: In general, are there better ways to encode combinatorial optimization problems, e.g. TSP, than using O(n^2) Qubits and still find optimal solutions (with high probability via Grover)?
"
"['grovers-algorithm', 'optimization']"," Title: Is the execution of a circuit neglectable for large optimization problems?Body: Assume a large combinatorial optimization problem should be solved (e.g. via Grover) and further assume there is a (near error free) universal quantum computer with a sufficient number of qubits (and sufficiently good quantum volume/clops/gate fidelity): is the wall clock time of the circuit execution neglectable (in comparison to a classical exhaustive search or branch&bound)?
For instance, is it ok to assume that the execution of such a circuit for a TSP with thousands of cities only takes milliseconds or seconds? And even if thousands of shots are required, this would be faster by magnitudes than classical approaches.
So is it correct that once a (near perfect) quantum computer is available classical approaches can be easily beaten?
"
"['qiskit', 'simulation', 'noise']"," Title: Simulators vs Real BackendsBody: I am using Qiskit to run some circuits and a question arises in my mind. I know that when we run in the simulators we are running in "ideal" environments. This means there is no noise that could cause errors in the readouts. So I expect this to be reflected in the expected results.
But when I run a circuit for example, the running time on a real machine is much bigger than in a simulator.
So my question is: why is it faster to run programs or circuits on a simulator? Is the noise of the real device affecting the speed of the computations?
Thank you very much in advance!
"
"['error-correction', 'error-mitigation']"," Title: Which improvements can we expect in Quantum Error Correction?Body: According to this article:
The surface code is currently the most widely pursued quantum error correction scheme
(Emphasis mine). It is also said:
However, there are drawbacks to the surface code, most notably its poor encoding density
(Emphasis mine). One can also often read in the literature that around a thousand of physical qubits are required to produce a single logical qubit.
Is this the only improvement one can hope/expect concerning error correction? Is this improvement realistic, given that, if I'm not mistaken, surface codes have been around for a while? I know that some research groups on error correction/mitigation prefer to focus on the physical implementation of existing schemes rather than trying to develop a new, more efficient scheme. Does that mean that we probably reached the peak of what can be done in error correction/mitigation algorithmic-wise?
"
"['quantum-circuit', 'notation']"," Title: Is there a convention in quantum circuit diagrams for specific quantum measurements?Body: Is there a convention in quantum circuit diagrams for specific quantum measurements? For example, how could one express the measurement $|0\rangle \langle 0|$ in a circuit diagram?
"
"['qiskit', 'd-wave', 'qubo']"," Title: Can D-Wave machines solve QUBO problems more efficiently than gate model devices?Body: I'm new to quantum annealing and D-Wave computer. I saw that it has about 5000 qubits which can solve a QUBO problem with 5000 variables.
From my understanding, if we use a gate model device, say, an IBM quantum device to solve a QUBO problem, the number of variables is equal to the number of qubits. Is that correct? If so, does it mean that DWAVE can solve larger scale problems than these gate model devices?
In terms of the resulting fidelity, which one is better? For example, if we want to solve maxcut problem, is it better to use the D-Wave machine or QAOA?
"
"['qiskit', 'ibm-q-experience', 'adiabatic-model', 'qubo']"," Title: How to formulate QUBO as summation quadratic and linear parts of K-graph coloring problem?Body: While trying to understand the graph coloring problem with VQE using the QUBO Formulation mentioned section "5.2 Graph Coloring". Mentioned article prepared the QUBO directly in to matrix form as shown below. But would like to achieve through the python code.
My query:
What shall be the initial matrix we need to consider? ex: all zero or all one's
I am assuming shall look like linear_term * x + xT * qudratic_term * x. if there is better approach please do share.
I am able to get solution with the hard coded matrix as mentioned in the paper using VQE. But i want to try with the python code for the matrix part.
And graph part as shown below
G = nx.Graph()
G.add_nodes_from([1, 2, 3, 4, 5])
G.add_edges_from([(1, 2), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (4, 5)])
nx.draw(G, with_labels=True)
Please share the hints or reference for further explore.
Thank you
"
['linear-optics']," Title: Any good sources to demonstrate Heisenberg uncertainty principle using polarizers?Body: Sakurai introduces QM using Stern Gerlach experiment. He also demonstrates HUP using the experiment.
SG experiment deals with spin. However, spin is very similar to polarization. Hence, HUP should also be demonstrable using polarizers.
Are there any good sources which deals with it ?
"
['entanglement']," Title: What is a simple example of ""weak entanglement"" in a two-qubit system?Body: Bell states produce maximal entanglement between two qubits. On the other hand, two unentangled qubits provide no (i.e. minimal) entanglement at all.
However, I haven't seen any example of a weak entanglement and how it can be prepared.
"
['entanglement']," Title: Why is entanglement so important if it introduces dependent information?Body: I still don't understand, why is entanglement such a crucial property of a quantum algorithm. If I understand it, it means that the information between different qubits is somehow correlated, which means redundant, at least in statistics.
"
['entanglement']," Title: Can we somehow measure the strength of an entanglement?Body: If I have a list of qubits, is there any formula how to calculate the strength of their entanglement? Something like a correlation coefficient.
"
"['measurement', 'tensor-product']"," Title: Transformation matrix for a two-qubit operation where there are more than two qubitsBody: I have an OPENQASM program that performs entanglement swapping. It has five qubits: the data qubit and four link qubits. It works, but I want to see the details of the Bell measurement transformation. So what I am looking for is a reference or technique that will help me construct the 32 by 32 matrix from the four-by-for matrix for the Bell measurement basis. I understand that this is written as a direct product or tensor product, but I don't know what that means in terms of matrix operations.
Something like $B \otimes I$? Again, what does this mean?
Of course, the general problem is, given an $n$-qubit unitary transformation, how to construct the $m$-qubit matrix where $m>n$?
"
"['measurement', 'nonclassicality']"," Title: Defining joint-measurability on ensembles of statesBody: Joint Measurability for a collection of POVMs $\{\Omega_j\}_j$ where $j$ is the index of the POVMs with associated effects $\{\Omega^\omega_j\}_{\omega}$ is defined as
$$\Omega^\omega_j = \sum_{\theta} p(\omega|j,\theta) \Theta^\theta,$$
where $\Theta^\theta$ is a POVM it self, and $p(\cdot | j, \theta)$ is a probability distribution.
The justification for this, is that in such case to measure any $\Omega_j$ one can just measure $\Theta$ and sample $\omega$ according to $p(\cdot|j,\theta)$. Yet, this justification is a statement about probability distributions of outcomes, not about the actual shape of the effects. I.e. the justification says,
$$\forall \rho, \quad \mathrm{Tr}(\Omega^\omega_j \rho)= \mathrm{Tr}(\sum_{\theta} p(\omega|j,\theta) \Theta^\theta \rho).$$
If this holds for a set of density matrices that spans linearly the set of all density matrices then this implies the previous operator equality because $\mathrm {Tr}$ is an inner product for the space of hermitian operators.
So far so good.
The question I have is, what if it is not spanning it? In other terms, does it make sense to say that two POVMs are jointly measurable wrt a set of states?
If a qubit-system is in a mixture of $|0\rangle$ and $|1\rangle$, then I take $\Theta$ to be the computational basis measurement $Z$. Now I can consider the observable $X$ on this system. I know that the probability of measuring $|+\rangle$ or $|-\rangle$ is going to be $1/2$ no matter the mixture. As a consequence, I will be able to conclude that on this set of states, $X$ and $Z$ are jointly measurable.
If you think this does not make sense, then what more are we trying to capture with the usual operator equality when we define joint-measurability?
"
"['qiskit', 'programming']"," Title: Projection Operator in qiskit.opflowBody: I am looking for a way to implement a projection operator like $\mid +\rangle\langle+\mid$ in qiskits opflow module. I tried Plus @ ~Plus but this gives me an error message. There must be a direct implementation of projection operators right? I can't use the operators in qiskit.quantum_info for what I want to do, except if there is a way to convert those operators to the ones in opflow.
Edit:
The error message I get from (Plus)@(~Plus) is ValueError: Composition with a Statefunctions in the first operand is not defined.
The reason I think I can't use qiskit.quantum_info's opearotors it that I want to compute the spectrum using qiskit.algorithms.NumPyEigensolver and this seems to me to not work with a quantum_info operator:
>>>plus = Statevector([1/np.sqrt(2),1/np.sqrt(2)]).to_operator()
>>>plus
Operator([[0.5+0.j, 0.5+0.j],
[0.5+0.j, 0.5+0.j]],
input_dims=(2,), output_dims=(2,))
>>>solver = NumPyEigensolver()
>>>spectrum = solver.compute_eigenvalues(plus)
AttributeError: 'Operator' object has no attribute 'to_spmatrix'
I am generally confused about the connection and difference between qiskit.quantum_info and qiskit.opflow because they seem to me to have a large overlap. Is one of those an older module and should not be used anymore? Is there a general way to convert objects like operators from one to the other?
"
"['algorithm', 'entanglement', 'deutsch-jozsa-algorithm']"," Title: Where does Deutsch's algorithm use entanglement?Body: I have read that to be useful, all quantum algorithms must use entanglement somewhere. However, reading several tutorials describing Deutsch's algorithm, I haven't seen any mention of how entanglement is used there.
"
"['quantum-state', 'physical-qubit', 'superconducting-quantum-computing']"," Title: What does the $\sigma_z$ operator correspond to in the context of a Transmon qubit?Body: In the context of the transmon qubit and an LC circuit with a coupling capacitor and driving voltage.
We can write the charge operator $Q$ as $-iQ_{ZPF}\sigma_y$ (since we defined $Q$ using the ladder operators $a$ and $a^+$). Similarly we can do the same for the magnetic flux operator $\Phi$ in terms of $\sigma_x$. What $\sigma_x$ and $\sigma_y$ represent make sense to me conceptually since they correspond to observables.
But can we do the same for $\sigma_z$? I am asking this since I was reading this paper that was writing the driving Hamiltonian as $H_d=\dfrac{Q_{ZPF}V_0f(t)\sigma_y}{1+C/C_d}$ (Eq D.19 Pg 190).
And it also states that the single qubit Hamiltonian for single nearly harmonic qubits like the transmon is: $\dfrac{H_q}{\hbar}=-\dfrac{\omega_q}{2}\sigma_z$ (Eq D.38 Pg 196).
But what does this Hamiltonian mean? Or how can we prepare a qubit in such a state that it would correspond to this Hamiltonian?
"
"['quantum-gate', 'notation', 'projection-operator']"," Title: What does the expression $\langle y^{(n)}|\otimes𝟙 \,|\Psi_b\rangle$ mean?Body: I'm trying to understand the following paper, https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.3.013167, but I'm new to quantum computing. In it they use this expression:
$$\langle y^{(n)}|\otimes𝟙 \,|\Psi_b\rangle.$$
What is this operator and what effect does it have on the state $\Psi_b$? I think it is some sort of projection of the state $y^{(n)}$ into $\Psi_b$ based on the context although that would be written as $|y^{(n)}\rangle\langle y^{(n)}|\Psi_b\rangle$. Thanks for the help.
"
"['algorithm', 'grovers-algorithm']"," Title: Is it possible to run the Grover algorithm under specific conditionBody: The Grover algorithm deals with sorting in an unstructured database and we can build an oracle (target function f) to achieve this. The oracle returns 1 if the element we search is founded otherwise 0. Now my question is whether it is possible to add a condition into the oracle such as I'm looking odd element from a list l where l = [0,1,2,3,4,5]. As far as I know, the Grover algorithm can't do a search under a specific condition, correct? Thank you for your answer.
"
"['optimization', 'annealing', 'qubo']"," Title: Mathematical definition of QUBO problemBody: The quantum annealing approach is using the equivalence between QUBO matrix and Ising Hamiltonian to solve the problem. Therefore, it is necessary to transform a NP-hard problem into a QUBO matrix. However, I still don't figure out the mathematical definition of QUBO matrix. Does it mean that we transfer a target function f (which reflects the original NP-hard) problem to a quadratic function at first? The solution of function f is binary encoded (either 1 or 0). But what does unconstrained mean? As far as I understood, unconstrained means that the value of each variable could be any possible value, correct? If variables are binary encoded then why do they should be unconstrained here (since unconstrained means they can be 2,3 and so on)? Can anyone explain this? Thank you very much!
"
"['mathematics', 'textbook-and-exercises', 'tensor-product', 'linear-algebra', 'bell-basis']"," Title: Two-qubit Bell measurement matrix where the two qubits are not contiguouisBody: In the answer here, it is explained that where the measurement operates on only a subset of the qubits of the system (for example qubits 2 and 3 out of five), the matrix can be constructed using the Kronecker product. However, I need to perform the measurement on qubits 1 and 4. So it is not clear to me what matrices to put into the Kronecker product.
The particular measurement I need to do is the Bell measurement, whose matrix is
$$\begin{bmatrix}
0&1&1&0\\
0&-1&1&0\\
1&0&0&1\\
1&0&0&-1
\end{bmatrix}.$$
"
"['grovers-algorithm', 'quantum-circuit', 'superposition']"," Title: Is it possible to recover a marked bitstring from a superposition?Body: Is it possible to recover a marked bitstring from a superposition?
For example, consider the state
$$\lvert \psi \rangle = \frac{1}{2}\left(\lvert 00 \rangle \lvert 0 \rangle + \lvert 01 \rangle \lvert 0 \rangle + \lvert 10 \rangle \lvert \mathbf{1} \rangle + \lvert 11 \rangle \lvert 0 \rangle\right)$$
which has a uniform superposition in the first register and one marked $\lvert 1 \rangle$ in the ancilla register.
If I were blindly given $\lvert \psi \rangle$, is there a quantum circuit that would recover the marked bitstring $\lvert 10 \rangle$?
It almost feels like a Grover Search / Amplitude Amplification use case (with the aim of boosting the probability of $\lvert 1 \rangle$ in the ancilla). But that doesn't quite seem to work or at least I can't see what oracle to use, given just one copy of the quantum state.
Thanks.
"
"['complexity-theory', 'classical-computing', 'cryptography']"," Title: Has the possibility of there being a classical cryptography algorithm able to withstand quantum computing been proven?Body: Has it been proven, that a classical codec (encoder-decoder) (classical meaning one that doesn't require a quantum system for its operation) is possible, such that a quantum computer cannot crack it?
I'm assuming that a quantum computer can only solve problems from the NP class and problems that classical computers can solve, where an "NP class problem" is one for which a solution can not be found in polynomial time but if a correct answer is provided, its correctness can be checked in polynomial time.
"
"['quantum-state', 'density-matrix', 'optimization', 'fidelity', 'partial-trace']"," Title: Closest quantum state with a fixed marginal: Analytical solution?Body: Let $\rho_{AB}$ be a bipartite state and let $\sigma_{B}$ be another state. What state $\tilde{\rho}_{AB}$ is closest to $\rho_{AB}$ and satisfies $\tilde{\rho}_B = \sigma_B$? We can define closeness in many ways but I pick fidelity here arbitrarily. Hence, the optimization problem is
\begin{align}
&\max_{\tilde{\rho}_{AB}} F(\tilde{\rho}_{AB}, \rho_{AB})\\
&s.t. \tilde{\rho}_B = \sigma_B
\end{align}
This can be written as a semidefinite program and solved numerically. MATLAB code below
rho = RandomDensityMatrix(4,4);
sigma = RandomDensityMatrix(2,2);
cvx_begin sdp
variable rho_tilde(4, 4) hermitian;
maximize Fidelity(rho_tilde, rho)
rho_tilde >= 0;
trace(rho_tilde) == 1;
PartialTrace(rho_tilde, 1, [2,2]) == sigma;
cvx_end
The code requires both cvxquad and QETLAB to be installed if you wish to run it. My question is if there is some analytical form for $\tilde{\rho}$? I tried the following attempt
$$\tilde{\rho} = (I_A\otimes \sigma_B^{1/2})(I_A\otimes\rho_B^{-1/2})\rho_{AB}(I_A\otimes\rho_B^{-1/2})(I_A\otimes \sigma_B^{1/2})$$
followed by a normalization of $\tilde{\rho}$ to get unit trace but my numerics showed that this is not the correct solution!
"
"['quantum-gate', 'quantum-state', 'entanglement', 'information-theory', 'entropy']"," Title: Entanglement entropy and depthBody: I wanted to verify two intuitions about the entanglement entropy of quantum states.
Consider an $n$ qubit quantum state, prepared by a depth $d$ circuit acting on $|0\rangle^{\otimes n}$ and a bipartition of the state into two systems, $A$ and $B$. Let the boundary between $A$ and $B$ be of size $M$.
The von Neumann entanglement entropy of the reduced density matrix, for each bipartition, should be at most $Md$. This is because there can be at most $Md$ entangling gates across the bipartition ($M$ gates for each time-step), and each gate would increase the entanglement entropy by at most $1$.
Hence, for all 1D circuits of depth $d$, where $M$ is a constant, the entanglement entropy is at most a constant times $d$.
Are these intuitions correct?
The source of the confusion is this paper, where on page 19, they exhibit a $\text{poly}\log$ depth 1D circuit with entropy ~$n$.
"
"['tensor-product', 'product-states']"," Title: Is factoring of a product state unique?Body: Suppose I have a product state of two qubits (i.e. a vector of size 4x1). Given it is separable (no entanglement), is this separation unique?
"
"['qiskit', 'programming', 'simulation']"," Title: What does a statevector with 3 elements (in Qiskit) represent?Body: I wasn't quite sure where to post this as I don't know if this is a Qiskit specific thing or not, but I'm not sure how to interpret this result I got from running a simulation.
from result.data():
{'counts': {'0x0': 371, '0x1': 653},
'statevector': [[0.6095190950364658, 0.00167238253077826],
[0.6389605613454776, 0.46926856185163585],
[0.0002864410240029574, -0.00010852146395313456]]}
From result.get_statevector():
array([6.09519095e-01+1.67238253e-03j, 6.38960561e-01+4.69268562e-01j,
2.86441024e-04-1.08521464e-04j])
This is a 1-qubit system btw
Also, I'm pretty new to QC, so pls be nice
Here's the code I'm using to simulate the system:
backend_sim = FakeArmonk()
custom_gate = Gate('custom_gate', 1, [])
qc1 = QuantumCircuit(1, 1)
qc1.initialize([np.cos(a[0]/2), np.exp(a[1]*1.j)*np.sin(a[0]/2)], 0)
qc1.append(custom_gate, [0])
qc1.measure(0, 0)
with pulse.build(backend_sim, name='custom_gate') as my_schedule:
pulse.play(Gaussian(duration=256+64, amp=.36, sigma=80), pulse.drive_channel(0))
qc1.add_calibration(custom_gate, [0], my_schedule)
qc1 = transpile(qc1, backend_sim)
pulse_sched = schedule(qc1, backend_sim)
pulse_sched.draw()
job1 = execute(pulse_sched, backend_sim, shots=1024)
result1 = job1.result()
result1.data()
The initialize state doesn't matter, it is a random pure state, and the parameters of the Gaussian pulse are also arbitrary
"
"['quantum-gate', 'universal-gates']"," Title: What is the purpose of gates with more than 2 inputs?Body: What is the purpose of multi-qubit gates (n>=3), if gates with one or two inputs are enough for any computation?
"
['quantum-gate']," Title: Implement approximate $Ry(2\pi /3)$ with gate set {$Rx(\pi),Ry(\pi),Rz(\pi),Rx(\pm \pi/2),Ry(\pm \pi/2),Rz(\pm \pi/2),T,S,H,CZ$}Body: With gate sets {$Rx(\pi),Ry(\pi),Rz(\pi),Rx(\pm \pi/2),Ry(\pm \pi/2),Rz(\pm \pi/2),T,S,H,CZ$}, I want to implement an approximate $2\pi/3$ rotation around Y axis. An ancilla qubit can be used as well. Is there any efficient way to do this?
"
['quantum-gate']," Title: Why are the angle coding of the samples cascaded and only use so few qubitsBody:
I want to ask about the angle coding. Is the angle coding that Abbas said really like this? There are two samples and four features. Why does she only use two qubits? Instead of four. And the sample and the sample are separated by a Hadamard gate. Is this design correct?
https://www.youtube.com/watch?v=rtsz_ioqbt0&list=PLrfsF3Qlg8YIsu5HKPpFkAEJyR6R_oSHH&index=18
"
"['quantum-gate', 'bloch-sphere', 'qudit', 'qutrit']"," Title: Can we rotate Bloch vectors for qudits like we do with qubits in the Bloch sphere?Body: I have been looking into the Bloch vectors for qudits and have been wondering if we can do rotations that are similar to the rotations in the qubit Bloch sphere.
Like, once we create a Bloch vector for a qutrit, it exists in 8-dimensional space. In this 8 dimensional space, we could do its rotation about a 6-dimensional hyperspace (like look here). One possible method to come up with this is to exponentiate a flip matrix, they should flip the sign of two of the basis states and should let the others stay the same.
But I can not find a matrix that does that. Using the qutrit Z gate we can flip the signs of 4 of the 6 antisymmetric and symmetric matrices but not 2 at a time, which is the problem. Furthermore, a matrix that flips diagonal Gell–Mann matrices changes the other basis states.
"
"['qiskit', 'programming', 'simulation', 'quantum-parallelism']"," Title: How to order results after multi-circuit qiskit.execute parallel run?Body: I'm kinda new to qiskit and I find really fascinating its parallelization capabilities, then I'm trying to creating all the needed circuits for my application at once and transpile, assemble and execute them all at once using the execute method.
Basically,
qcircuits = []
# construct my circuits and append to qcircuits
# ...
backend: backend: BaseBackend = qiskit.Aer.get_backend('qasm_simulator')
n_shots = 1024
job = qiskit.execute(
qcircuits,
backend,
optimization_level=optimization_level,
shots=n_shots
)
counts = job.result().get_counts()
Nevertheless, I noticed that the job.result().get_couts() output is not deterministic as, I guess, it runs all the circuits using a parallel_map and appends in the returned list in the order they finish. Is there any way to force the execute method respecting the order of qcircuits ? If it is not the case, is there any way to label the execution results so that I can sort them myself afterwards ?
Thanks in advance.
"
['qiskit']," Title: Qiskit **Param - Power of ParameterBody: Trying to create gate, that its angle is parametrized,
where my parameter is k, and I want to assign to theta = 1/2**k - 2 in the power of k.
Looks like:
k = Parameter('k')
# Build a sub-circuit
q = QuantumRegister(2)
CROT_circ = QuantumCircuit(q, name='CROT')
theta = 2*pi/(2**k)
CROT_circ.cp(theta, 0, 1)
And I get this error:
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'Parameter'
Suggestions? Thanks!
"
"['quantum-gate', 'clifford-group']"," Title: When can we unprepare a circuit using Clifford + measurements?Body: I have seen sometimes that in some protocols, one can uncompute a circuit using only Clifford + measurements. See for example
Erase the two qubits containing $p_{w,r}$ and $p_{w,s}$, then the register containing component w of p. These erasures can be done with measurements and Clifford gates.
before eq 73 in Su et al. For context, these are qubits that were "copied" via C-Nots from another register, and have been used as a control in a C-Z gate.
When can one erase registers using measurements and Clifford gates in general?
"
"['density-matrix', 'noise', 'decoherence']"," Title: Simulating a quantum circuit with decoherence and noiseBody: Based on the answers given here and here, it is pretty clear that an arbitrary quantum circuit can be simulated with matrix algebra. The difficulty is that this assume perfect fidelity. I am unsure how to generalize this method to take into account imperfect gates and decoherence. I am sure that density matrices are involved.
"
"['qiskit', 'programming']"," Title: When I try to transpile circuit with Qiskit, how can I use $Ry(\pi/2)$ as a basis gate?Body: When I try to transpile circuit with Qiskit, I can use 'ry' as a basis gate. But I want to set one of the basis gate as $R_y(\pi/2)$. How can I do that?
Edited:
my_z2 = QuantumCircuit(1,name='z2')
my_z2.rz(np.pi,0)
z2_def = QuantumCircuit(1)
z2_def.append(my_z2.to_gate(),[0])
StandardEquivalenceLibrary.add_equivalence(RZGate(np.pi), z2_def)
qc = QuantumCircuit(1)
qc.rz(np.pi,0)
qc_trans = transpile(qc, basis_gates=['id','z2'],translation_method='translator')
qc_trans.draw('mpl')
This is my code and it throws CircuitError:
CircuitError: 'Cannot bind parameters (rz[0]) not present in the circuit.'
How can I fix this?
"
"['qiskit', 'programming', 'simulation', 'openpulse']"," Title: Why the pulse scheduler produces a different output from the original circuit?Body: As part of a larger code, I have to convert a quantum circuit into a Pulse scheduler. The problem is that the scheduler output is incompatible with the circuit output. In particular, the difference between the circuit output and the expected output seems to be compatible with the statistical error, while the scheduler output does not converge to the target state for a large number of shots.
This is an example:
from qiskit import circuit, transpile, schedule
from qiskit.test.mock import FakeAthens
backend = FakeAthens()
circ = circuit.QuantumCircuit(5)
circ.h(0)
circ.measure_all()
circ_transpiled = transpile(circ, backend)
#without scheduler
counts = backend.run(circ_transpiled,shots=100000).result().get_counts()
print(counts)
#with scheduler
scheds = schedule(circ_transpiled, backend)
sched_counts = backend.run(scheds,shots=100000).result().get_counts()
print(sched_counts)
What is the source of this difference? And what can I do in order to produce the right result with the pulse scheduler?
Thank you in advance.
"
"['qiskit', 'programming', 'algorithm', 'quantum-enhanced-machine-learning']"," Title: Calculating the quantum euclidean distance between vectorsBody: I am trying to get the distance using the swap test circuit.
,
With the help of the codes I shared, I can only estimate the distance between two vectors. Can it calculate the distances of many vectors from each other with the help of a single circuit?
# import the necessary libraries
import math as m
from qiskit import *
from qiskit import BasicAer
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit_quantum_knn.encoding import analog
from numpy import linalg as LA
from scipy.spatial import distance
# First step is to encode the data into quantum states.
#There are some techniques to do it, in this case Amplitude embedding was used.
A= [2,9,8,5,4,18,16,10]
B= [7,5,10,3,14,10,20,6]
A_norm=LA.norm(A)
B_norm=LA.norm(B)
Dist=distance.euclidean(A, B)
Z = round( A_norm**2 + B_norm**2 )
# create phi and psi state with the data
phi = [A_norm/m.sqrt(Z),-B_norm/m.sqrt(Z)]
psi = []
for i in range(len(A)):
psi.append(((A[i]/A_norm) /m.sqrt(2)))
psi.append(((B[i]/B_norm) /m.sqrt(2)))
# Quantum Circuit
q1 = QuantumRegister(1,name='q1')
q2 = QuantumRegister(1,name='q2')
q3 = QuantumRegister(4,name='q3')
c = ClassicalRegister(1,name='c')
qc= QuantumCircuit(q1,q2,q3,c)
# states initialization
qc.initialize( phi, q2[0] )
qc.initialize( psi, q3[0:4])
# The swap test operator
qc.h( q1[0])
qc.cswap( q1[0], q2[0], q3[0] )
qc.h( q1[0] )
qc.measure(q1,c)
display(qc.draw(output="mpl"))
## Results
shots = 1000000
job = execute(qc,Aer.get_backend('qasm_simulator'),shots=shots)
job_result = job.result()
counts = job_result.get_counts(qc)
x = abs(((counts['0']/shots - 0.5)/0.5)*2*Z)
Q_Dist = round(m.sqrt(x),4)
print('Quantum Distance: ', round(Q_Dist,3))
print('Euclidean Distance: ',round(Dist,3))
"
"['quantum-gate', 'hadamard', 'superposition']"," Title: Does the X (NOT) gate affect superpositions at all?Body: Does "NOT" gate have any effect on qubit in superposition state? After applying Hadamard gate on qubit seems like the "NOT" gate doesn't have any effect on it. Could somebody describe this behavior?
"
"['measurement', 'bloch-sphere', 'probability']"," Title: How to change the probability of observation by some set amount when initial probability is unknown?Body: If I have some state $|\psi> = \alpha |0> + \beta|1>$, I know that the probability of observing $|0>$ is $p_1 = |\alpha|^2$. Is it possible to change the probability of observing $|0>$ by some $\Delta p$ without knowing the initial state?
I've been thinking about it in terms of the Bloch sphere representation
$$
|\psi> = \cos\frac{\theta}{2}|0> + e^{i\phi}\sin\frac{\theta}{2}|1>,
$$
so the probability of observation is just a function of $\theta$. The problem is that the change in $\theta$ is a nonlinear function of the initial and final probability
$$
\Delta \theta = 2\arccos(\sqrt{1-p_2}) - 2\arccos(\sqrt{1-p_1}).
$$
There doesn't seem to be a way to effect a given $\Delta p$ unless you know the initial probability $p_1$.
I've been wondering if there's some way to "encode" the information in $\phi$ since that doesn't affect the observation probability.
"
"['qiskit', 'textbook-and-exercises']"," Title: What is the number of transition amplitudes needed to describe an $n$-qubit state?Body: In describing quantum computers page in the fourth quick quiz it asks "An n-qubit state vector can contain up to $2^n$
amplitudes. What’s the largest number of transition amplitudes we’d need to represent any quantum operation on n qubits?"
My question is why is $4^n$ is wrong and $(2^n)^2$ is right, when $4^n = (2^n)^2$? Or is my math just wrong? I tried $n=1,...,5$. Isn't $(2^n)^2 = 2^{n\cdot 2} = 2^{2n} = (2^2)^n = 4^n$?
"
"['qiskit', 'quantum-operation', 'nielsen-and-chuang', 'density-matrix', 'quantum-process-tomography']"," Title: How to compute the unitary from the $\chi$ matrix obtained from QPTBody: I am trying to do quantum process tomography for one qubit and obtain the unitary for the gates that are applied on the qubit. I have studied the theory on process tomography from mike and ike and the box 8.5 describes a simple procedure for obtaining the chi matrix for our quantum operation.
Now I am a little confused how would I go from the said chi matrix to obtaining the unitary which directly depend upon $E_i$'s.
Note - I am not getting the same chi matrix when I compare my results to qiskit backends but I figured that was happening because of different basis states.
Furthermore I have implemented the above using Qiskit and I dont think I am getting the correct result.
def one_qubit_process_tomography(circuit, samples):
# I, rho_1
qc = QuantumCircuit(1,1)
qc = qc.compose(circuit)
rhod_1 = one_qubit_tomography(qc, samples)
# X, rho_4
qc = QuantumCircuit(1,1)
qc.x(0)
qc = qc.compose(circuit)
rhod_4 = one_qubit_tomography(qc, samples)
# H, rho_h, E(|+><+|)
qc = QuantumCircuit(1,1)
qc.h(0)
qc = qc.compose(circuit)
rhod_h = one_qubit_tomography(qc, samples)
# XH, rho_xh, E(|-><-|)
qc = QuantumCircuit(1,1)
qc.x(0)
qc.h(0)
qc = qc.compose(circuit)
rhod_xh = one_qubit_tomography(qc, samples)
# this is E(|0><1|)
rhod_2 = rhod_h - 1j*rhod_xh - (1-1j)*(rhod_1 + rhod_4)/2
# this is E(|1><0|)
rhod_3 = rhod_h + 1j*rhod_xh - (1+1j)*(rhod_1 + rhod_4)/2
# now we will find the chi matrix
lambdaa = 0.5*np.array([[1,0,0,1],[0,1,1,0],[0,1,-1,0],[1,0,0,-1]])
#print(rhod_1)
#print(rhod_2)
#print(rhod_3)
#print(rhod_4)
rho = np.zeros([4,4],dtype=np.complex_)
rho[0:2,0:2] = rhod_1
rho[0:2,2:4] = rhod_2
rho[2:4,0:2] = rhod_3
rho[2:4,2:4] = rhod_4
chi = np.matmul(np.matmul(lambdaa, rho), lambdaa)
#print(rho)
return chi
"
"['textbook-and-exercises', 'teleportation', 'tensor-product']"," Title: Why do unitaries act on maximally entangled states as $(U\otimes I)|\phi\rangle=(I\otimes U^T)|\phi\rangle$?Body: I was reading about teleportation which had the following Bell counterpart in $N$ dimensions
$|{\phi}\rangle=\sum_{i=0}^{N-1}|i\rangle\otimes|i\rangle$. The next line was
$$(U\otimes I)|\phi\rangle=\sum_{i,j=0}^{N-1}|j\rangle U_{ji}\otimes |i\rangle=\sum_{i,j=0}^{N-1}|j\rangle\otimes|i\rangle U_{ij}^T= (I\otimes U^T)|\phi\rangle$$
Here $U$ is unitary. Now I understand $(U\otimes I)=(I\otimes U)$. But the terms in between I am finding hard to grasp. Okay I understood the second part which was $|j\rangle U_{ji}$, but the next equivalence I could not understand. How did the $U_{ji}$ got shifted on the $i$. Also should there be a $U^{\dagger}$ instead of Transpose.
"
['quantum-state']," Title: Does each qubit correspond to some wave?Body: Reading about qubits, I see a lot of names related to waves from physics (amplitude, magnitude, phase, ...).
Does it mean that each qubit corresponds to some wave? If yes, what is the mapping between wave features and qubit features? For example, qubit has 2 numbers called as amplitudes. How can these be mapped to a wave? On the other hand, waves have some frequencies. Does it mean that a qubit has also some frequency?
"
"['quantum-gate', 'quantum-state', 'probability']"," Title: Statistical 'process' behind quantum gatesBody: Thinking about gate creating entangled state, it looks to me that the inputs to the gate look like marginal/independent distributions, and the output looks like their joint distribution. Does this process have any statistical meaning?
"
"['measurement', 'textbook-and-exercises', 'density-matrix']"," Title: Given a three-qubit state, how do you obtain the density matrix for the third qubitBody: I have a quantum simulator that yields a three-qubit final state. However, I need to measure the first two qubits and apply a one-qubit gate (x,y or z) to the third qubit. How do you reduce a three-qubit state to a one-qubit state by measuring the first two qubits?
"
"['measurement', 'simulation', 'teleportation', 'bell-basis']"," Title: How to simulate the state of a system after partial measurement?Body: Based on the answers at here and here, I have a quantum simulator which implements the operations described in the classic Teleporting an Unknown Quantum State. Careful comparison of circuits with the IBM qiskit platform indicates that my simulator correctly implements gates, circuits and n-qubit measurement outcomes.
I am able to do this but unable to apply gates at the end to reconstruct the teleported qubit.
The teleportation circuit is quite simple; it first places qubits two and three in the Bell state $\Psi^-$ and then measures qubits 1 and 2 in the Bell basis. I extract the 3-qubit counts, using code that agrees with IBM's Q experience, and it appears based on the measurement counts that the final state from my simulator is correct.
The paper gives the final state as a function of the measurement outcomes. For example, it says if the initial sate is |0> and the measurement outcome is 00, then the final state of qubit 3 should be |1>, etc. When I look at my counts, it appears that the circuit is working correctly. THe measurement outcomes for input qubit |0> are
010
011
100
101
which looks correct.
However, the paper, and it's equation (5), imply that to reconstruct the teleported state, you apply the following gates to the third qubit:
$00\rightarrow Y$
$01\rightarrow Z$
$10\rightarrow X$
$11\rightarrow none$
I tried this, using the kronecker product to apply the gate to the third qubit, as described in the answer here. However, this give the wrong final states. I suspect that the reason is that I have to first reduce the 3-qubit state after measurement to a one-qubit state and apply the gate to that.
Running the corresponding circuit on IBM's quantum platform, I just measure the first two qubits and the counts look good.
I don't know how to simulate the state change that takes place during measurement. On my simulator, I don't simulate the measurement, so all three qubits remain entangled.
I doubt if this last step is correct - applying the gate to the three-qubit state - and even if it were, I don't know how to reduce the state to a single qubit.
"
"['quantum-state', 'entanglement']"," Title: Separable decomposition of states near the maximally mixed stateBody: This question concerns the neighborhood of separable states around the maximally mixed state in a bipartite system; I will restate the theorem as it appears in Watrous' The Theory of Quantum Information (Theorem 6.13, page 321):
Let $H$ be a Hermitian operator on $\mathcal{X} \otimes \mathcal{Y}$ for complex Euclidean spaces $\mathcal{X}, \mathcal{Y}$ satisfying $\lVert H \rVert_2 \leq 1$. Then,
\begin{equation}\tag{1}
\mathbb{I}_\mathcal{X} \otimes \mathbb{I}_\mathcal{Y} - H \in \text{Sep}(\mathcal{X}:\mathcal{Y})
\end{equation}
where $\lVert A \rVert_2 = \sqrt{\text{Tr}(A^\dagger A)}$ is the Schatten 2-norm.
An operator $S$ is here said to be in $\text{Sep}(\mathcal{X}:\mathcal{Y})$ if it admits a form
\begin{equation}\tag{2}
S = \sum_k p_k A_k \otimes B_k
\end{equation}
for a probability vector $p$ ($\lVert p \rVert_1 = 1$), and the sets $\{A_k\}$ and $\{B_k\}$ contain positive operators on $\mathcal{X}$ and $\mathcal{Y}$ respectively.
In plain language, this says (up to normalization) that applying an arbitrary perturbation $H$ to the maximally mixed state results in another state that is not maximally mixed but is still separable.
My question is, can someone describe how to construct such an operator $S$ where both the perturbation $H$ and the decomposition of $\mathbb{I}_\mathcal{X} \otimes \mathbb{I}_\mathcal{Y} - H$ according to Equation (2) are known? I'm especially interested in the case of a pair of qubits, $\mathcal{X},\mathcal{Y}=\mathbb{C}^2$ where $H$ has a known decomposition in the Pauli basis, $H = \sum_{i,j=0}^3 \omega_{ij} \sigma_i \otimes \sigma_j$.
"
"['interpretations', 'biology']"," Title: How similar is the recent (2021) tardigrade experiment to a Schrödinger's cat experiment?Body: In a recent paper on the arXiv, a team of researchers from Singapore and elsewhere claim to have established entanglement between a superconducting qubit and a tardigrade (or water-bear), which is a teeny little critter that's known for being able to survive all sorts of extreme conditions (apparently even in the vacuum of outer space), by being able to enter a cryptobiotic state of suspended animation.
There may be scientific value in the study of the extremes tardigrades can be exposed to, e.g. in a dil-fridge, but it's natural to consider the experiment as a very trimmed-down version of Schrödinger's cat.
If we define a Schrödinger's cat experiment as preparing and maintaining coherence of a state $\vert\psi\rangle=\frac{1}{\sqrt 2}(\vert\text{alive}\rangle+\vert\text{dead}\rangle)$ for some macroscopic cat-state, and then measuring in the appropriate basis to prove that the cat is in a coherent superposition of being alive and being dead, then can we say that the tardigrade experiment "also" put a tardigrade into a similar superposition?
Clearly there's some click-baity headlines and perhaps some run-away conclusions, but can we formalize what the Singapore team did, in a way that requires a superconducting quantum computer?
"
"['bb84', 'key-distribution']"," Title: BB84 Protocol doubtBody: I was studying BB84 protocol from lecture notes by John Watrous. I had some doubts which i thought of asking. Here is the protocol.
Alice prepares strings $x=(01110100)$ and $y=(11010001)$. based on the pair $(x_i,y_i)$ it prepares $|A_{00}\rangle=|0\rangle$,$|A_{10}\rangle=|1\rangle$, $|A_{01}\rangle=|+\rangle$,$|A_{11}\rangle=|-\rangle$. He distributes these to Bob. Bob genarates a random key $y'=01110110$. If $y_i=0$ Bob measures the $i-th$ qubit in $Z$ basis, else if $y_i=1$ Bob measures it in $X$ basis. He notes his measurement result as $x_i'$. Then the protocol says that whenever $y_i=y{_i'}$ then $x_i=x{_i'}$. But in the example for $x_5,y_5=00$ and Bob has $y_{5'}=0$ then his outcome $x_5'=0$. Whereas I think it should be $x_5'=1$.
Am I missing something?
"
['programming']," Title: Is there a software to simplify commutators such as $[{\hat a}^\dagger{\hat a}^\dagger {\hat a},{\hat a}^\dagger\hat a \hat a]$?Body: Sometimes I need to simplify some commutators in the form
$[{\hat a}^\dagger{\hat a}^\dagger {\hat a},{\hat a}^\dagger\hat a \hat a]$.
Doing it by hand is exhausting and boring.
Is there software (Matlab, Python, Mathematica, etc) that can handle such commutators?
"
"['grovers-algorithm', 'amplitude-amplification']"," Title: Oblivious Amplitude AmplificationBody: I've been looking for the OAA paper but I've been unsuccessful in finding it. (so any links will also be helpful)
My question is essentially this, given the state:
$$\vert 0good \rangle + \vert 1bad \rangle$$
If I know the amplitudes of both states, can I amplify the amplitude of $\vert 0good \rangle$ without a reflection by the initial state using the flag qubit only? What conditions do I need to satisfy in order to do this?
"
"['entanglement', 'textbook-and-exercises']"," Title: Show by example that a linear combination of entangled states is not necessarily entangledBody: $\newcommand{\bra}[1]{\langle#1\rvert} % Bra
\newcommand{\ket}[1]{\lvert#1\rangle} % Ket
\newcommand{\qprod}[2]{ \langle #1 | #2 \rangle} %Inner Product
\newcommand{\braopket}[3]{\langle #1 | #2 | #3\rangle} % Matrix Element
\newcommand{\expect}[1]{ \langle #1 \rangle} % Expectation value$
I am working through the book Quantum Computing: A Gentle Introduction and I was working on problem 3.2. There are no solutions in the back of the book, so I wanted to double-check this one because I was unsure if I was correct or not. (I probably could do this for all of these questions, but I don't want to spam the board) The problem is:
Show by example that a linear combination of entangled states is not necessarily entangled.
I read this and thought that the only way a linear combination of entangled states would be not entangled is if they could be measured from a different basis. My thought was to find a linear combination of Bell states where the outcome is of the form $\ket{v} = a\ket{00} + 0\ket{11}$ which would be the standard basis state $\ket{00}$. That equation looks like this:
$\ket{\phi^+} + \ket{\phi^-} = \frac{2}{\sqrt{2}}\ket{00} + 0\ket{11}$
Is my thought process correct? If it's not, can you explain why it's wrong and what a correct answer to this question would look like?
"
"['pauli-gates', 'cryptography', 'bb84']"," Title: Heisenberg Uncertainty Principle for BB84 Protocol using Paulis Spin MatricesBody: I am doing a term project on the BB84 Protocol and it makes use of the Heisenberg Uncertainty Principle. I think I understand the principle in theory. If we have two non-commuting observables, then we cannot simultaneously measure a state with these observables, since after the measurement the state collapses to one of the eigenstates of the observable, but non-commuting observables do not have common eigenstates. This is what I understood.
I also found that the Paulis spin matrices for x and z, which are used in the BB84 protocol do not commute. So they should (and no dot) have common eigenstates. I tried to find the Heisenberg inequality using the formula for the Heisenberg inequality where we use average values and each time for the 0 ket I find the inequality side 0. Shouldn't it give something other than 0?
Then I tried to justify the 0, thinking that maybe for one of the spin matrices the uncertainty is 0 since we are using the right operator, and that is why when we multiply the uncertainties we get 0?
Am I doing something wrong in my calculations, or have I completely misunderstood the subject.
Thanks for any kind of help.
"
"['quantum-gate', 'quantum-circuit']"," Title: Are input/output nodes only a fiction?Body: When running quantum algorithms, are input and output nodes of any gate in a quantum circuit two separate sets of (physical qubit) nodes, or are we only mutating/overwriting one fixed set of nodes? Because, from pictures, I am a bit confused - they look like two sets and immutable.
"
"['quantum-state', 'textbook-and-exercises', 'nielsen-and-chuang', 'density-matrix', 'linear-algebra']"," Title: Are the states in the convex decomposition of a density matrix necessarily orthogonal?Body: In Nielsen and Chuang's QC&QI, I do not see a statement one way or another. In Steeb and Hardy's Problems and Solutions, orthogonality is asserted. If the $p_i$ in $\sum_i p_i |\psi_i\rangle\langle\psi_i|$ were guaranteed to be distinct, then the eigenvalues would be distinct and orthogonality would be assured. In the general case, I don't know, and I wonder if this question is important given that the $\psi_i$ are not uniquely determined.
"
"['qiskit', 'programming', 'quantum-circuit']"," Title: Quantum circuit error in QISKITBody: I am trying to build a simple 16-qubit Quantum circuit where I am appending an 8-qubit quantum circuit to the first 8-qubits of my custom circuit. Then I measure all the qubits.
However when I execute it, I get the error:
DAGCircuitError: expected 8 wires, got 16
(See attached image).
Any help on how to resolve this would be much appreciated.
"
['qiskit']," Title: I want to initialize any 3 qubit state in QiskitBody: The state of interest is (1/sqrt(2))|000> + (1/sqrt(2))|111>. How do I initialize this state in Qiskit ?
I know if I plot a histogram it will have 50% probability for |000> and 50% probability for |111>. I have no idea how to evolve it with gates yet, but I will be content with simply initializing it for now.
Thank you.
Will be happy if I also get bonus code for statevector_simulator, unitary_simulator, counts and plot_histogram
"
"['quantum-state', 'mathematics']"," Title: Are complex amplitudes really needed?Body: Qubit amplitudes are defined as complex numbers. But in all tutorials I have recently read, only real numbers are used and everything works. So, if I completely forget the official 'complex' definition of a qubit, what will I loose? Are complex numbers somehow important for practical quantum computing?
"
"['error-correction', 'error-mitigation', 'surface-code']"," Title: Correcting Coherent errors with Surface CodesBody: Following this article: Correcting coherent errors with surface codes
I wonder about the modeling of coherent error and its effect on syndrome after measurement.
They say that applying U on the initial logical state, and stabilizing using syndrome measurement, will collapse the state to $exp(i\theta_sZ)$ where $\theta_s$ is a new angle.
I feel that a few steps were skipped. I would be happy to see a detailed mathematical explanation that shows how the angle was changed from arbitrary, to one that depends on the syndrome measurement.
Thank you!
"
"['physical-realization', 'noise', 'error-mitigation']"," Title: Why does making a quantum circuit more noise resilient make it easier to simulate classically?Body: I was reading Quantum Computing in the NISQ era and beyond (John Preskill, 2018) but I didn't get this point on pages 9-10:
There is a substantial opportunity for experimentalists and theorists, working together
over the next few years, to find better ways of making quantum circuits noise resilient, and so extend the computational reach of NISQ technology. We should be wary, though,
of a potential tradeoff — making a quantum circuit more noise resilient may also make it easier to simulate classically.
How does making a quantum circuit more noise resilient may also make it easier to simulate classically? What noise mitigation techniques could imply this?
"
"['quantum-gate', 'circuit-construction']"," Title: How to implement general 2-qubit gate in n-qubit system?Body: I am trying to implement a general 2-qubit gate in an n-qubit system (not using qiskit or cirq). Example: Consider 4 qubits. Assume we want to act a CX on qubit 2 as control and qubit 3 as target. The right implementation would be $I \otimes CX \otimes I$ (most significant qubit is left-most). For two neighboring qubits it will always be a tensor product.
How would you implement a CX gate if we wanted to act it, let's say, on qubit 1 as control and qubit 3 as target? I'm assuming it's playing around with the projectors, but I was hoping there is a systematic way of doing it, especially since I need to do this for an n-qubit system.
"
"['quantum-gate', 'quantum-circuit', 'gate-synthesis', 'state-preparation']"," Title: How many quantum gates are needed to prepare an arbitrary state?Body: In this paper there is this sentence:
[...] the description of a $2^n\times2^n$ unitary matrix $U$ (which is a poly($n$)-size quantum circuit)
According to the meaning of "which" in English, in contrast to "that", the sentence means that the effect of any unitary matrix $U$ can be done by a quantum circuit composed by $m$ quantum gates, with $m$ polynomial in the number of qubits $n$. I assume that the quantum gates act on 1 or 2 qubits (or a fixed number of qubit), else the sentence is trivial ($U$ is a quantum gate itself).
However, I think that this is not true. In particular, I think that an $m$ exponential in $n$ is needed for preparing an arbitrary state, which is a simpler task than simulating the effect of an arbitrary $U$. Can you confirm and suggest a reference?
"
"['quantum-enhanced-machine-learning', 'probability']"," Title: Why is sampling from probability distributions generated by specific quantum circuits classically intractable?Body: I was reading a paper by Benedetti et al. titled Parameterized quantum circuits as machine learning models. Its authors state the following:
We also know that sampling from the probability distribution
generated by instantaneous quantum polynomial-time circuits is
classically intractable in the average case. A natural application for
them is in generative modeling where the task itself requires sampling
from complex probability distributions
Could someone explain why "sampling from the probability distribution" would be intractable? Does it mean that if we tried to classically simulate the p.d. of the quantum state prepared by these specific quantum circuits, that would be intractable?
For reference, the authors also state the following in their other work on A generative modeling approach for benchmarking and training shallow quantum circuits:
For example, learning probabilistic generative models is in many cases an intractable task <...>
Although this seems to be stating the same/similar thing, I cannot fully understand this statement either.
"
"['nielsen-and-chuang', 'information-theory', 'entropy', 'stabilizer-code']"," Title: Proof of upper and lower bound (Gilbert-Varshamov bound) for linear codeBody: I am trying to prove the following bounds for a $[n, k]$ code that can correct $t$ errors
\begin{align}
1-H\left(\frac{t}{n}\right)\geq \frac{k}{n}\geq 1-H\left(\frac{2t}{n}\right)
\end{align}
where
\begin{align}
H(x) = -x \log_2x-(1-x)\log_2(1-x)
\end{align}
is the binary Shannon entropy. I have two questions.
- Are these bounds true for all $[n, k]$ code that can correct $t$ errors? For the lower bound, or the Gilbert-Varshamov bound, from the text around Eq. 10.63 in Nielsen-Chuang, it seems to be the case (see here). However, from Gottesman, it seems like both bounds are true in certain asymptotic limits (see Eq. 1.15-1.20 in here).
- How to prove these two bounds? From the inequalities
\begin{align}
\frac{2^{nH(k/n)}}{n+1}\leq {n \choose k}\leq 2^{nH(k/n)}
\end{align}
which can be found here, together with the following known bounds (see again Gottesman)
\begin{align}
\sum_{j=0}^{2t}{n \choose j}\geq2^{n-k}\geq\sum_{j=0}^t{n \choose j}
\end{align}
I was almost able to obtain something similar to the bounds, but not exactly the same. Any helps are appreciated!
"
"['programming', 'quantum-gate', 'matrix-representation']"," Title: Writing Toffoli Gate Matrix by one and two qubit gate matricesBody: I am trying to write Toffoli gate matrice by using one and two qubit gates matrices.
I follow this circuit
link for the circuit
I first started to write the matrices of one and two qubit gates:
identity = np.array([[1, 0], [0, 1]])
xgate = np.array([[0, 1], [1, 0]])
ygate = np.array([[0,-1j],[1j,0]])
zgate = np.array([[1,0],[0,-1+0j]])
hgate = 1/math.sqrt(2)*(xgate+zgate)
sgate = np.sqrt(zgate)
tgate = np.sqrt(sgate)
tdag = tgate.conj().T
cnot = 0.5*(np.kron(identity,identity)+np.kron(identity,xgate)+np.kron(zgate,identity)-np.kron(zgate,xgate))
deneme = np.kron(identity, swap)
deneme2 = np.kron(cnot,identity)
deneme3 = np.kron(identity,swap)
#deneme_ = deneme*deneme2*deneme3
deneme_ = np.matmul(deneme,deneme2)
non_adjacent = np.matmul(deneme_,deneme3)
Then, I started to write each part of the circuit in the following way:
tof1 = np.kron(np.kron(identity,identity),hgate)
tof2 = np.kron(identity,cnot)
tof3 = np.kron(np.kron(identity,identity),tdag)
tof4 = non_adjacent
tof5 = np.kron(np.kron(identity,identity),tgate)
tof6 = np.kron(identity,cnot)
tof7 = np.kron(np.kron(identity,identity),tdag)
tof8 = non_adjacent
tof9 = np.kron(np.kron(identity,tdag),tgate)
tof10 = np.kron(cnot,hgate)
tof11 = np.kron(np.kron(identity,tdag),identity)
tof12 = np.kron(cnot,identity)
toffoli = tof1*tof2*tof3*tof4*tof5*tof6*tof7*tof8*tof9*tof10*tof11*tof12
And the final matrix is that:
My guess is that: I did a mistake when I tried to write cnot gate for the first and third qubits or maybe I am wrong to write identities
Can someone explain to me what I missed?
Sorry for this dumb question
Thanks in advance
"
"['programming', 'qutip']"," Title: QuTip: How to multiply symbol with matrixBody: I am trying to multiply a symbol with a matrix which is defined by QuTip quantum object, but I got this error:
TypeError: Incompatible object for multiplication
I used:
from qutip import *
import sympy as sp
w0 = sp.Symbol('\omega_{0}')
w0*destroy(4)
Did I miss something?
"
"['qiskit', 'programming']"," Title: How to make qiskit jupyter plot and draw properlyBody: The problem:
You try to plot or draw more than once within a cell, or you try to plot or draw within a code block,but nothing comes out and you're going nuts... :)
"
['measurement']," Title: Elitzur-Vaidman bombBody: In the original paper (Quanum Mechanical Interaction-Free Measurements - Elitzur, Vaidman, p.991), they make an algebraic substitution for the 'appearance' or 'scattering' of the bomb (green arrow):
Can anyone shed any light on what this substitution is? The "up" path (where the bomb lays) is $|2\rangle$. I do not see how (algebraically) the 'scattered' state is being introduced.
Thanks!
Abstract of paper
PDF of paper
Wikipedia page
"
"['qiskit', 'measurement']"," Title: Qubit identities get swapped in IBM QiskitBody: Edit: Improved code a bit
Edit 2: After corresponding with a Qiskit developer, this issue was considered not a bug per se but a missing functionality that has not yet been implemented (and will be difficult to do so). The proscribed solution is to not transpile partial circuits. In practice I find one can transpile partial circuits then check for qubit identity swapping and fix as needed. The correspondence is here: https://github.com/Qiskit/qiskit-terra/issues/7472
This is a condensed description of the IBM bug that was a problem here, to make it more clear.
The following code compiles to a correct circuit when the measurement is present, but not when the measurement is absent:
from qiskit.compiler import transpile
from qiskit import QuantumCircuit, IBMQ
provider = IBMQ.load_account()
lima = provider.get_backend('ibmq_lima')
n_q = 3
qc_foo = QuantumCircuit(n_q, n_q)
qubit_list = [0,1,2]
qc_foo.swap(0,1)
qc_foo.swap(0,2)
qc_foo.barrier()
qc_foo.measure(qubit_list, qubit_list)
qc_foo_trans = transpile(qc_foo, backend=lima, optimization_level=3
, initial_layout=qubit_list, seed_transpiler=101)
qc_foo_trans.draw()
With measurement the circuit is:
And without measurement (comment out .measure line in code):
Notice the latter circuit is not equivalent to the intended circuit. The reason is that in both cases part of the work is moved to the measurements by swapping them i.e. q1->c0 and q0->c1. But when there are no measurements, that extra work disappears and the final qubit identities are wrong. It is further strange that a barrier does not stop this in either case.
This is an especially big problem when trying to perform a circuit multiple times in a row before measurement. In that case the circuit itself has to be correct, and simple solutions like remapping state prep or measurements won't help.
(This is mostly a bug report, to make the problem more visible to Qiskit contributors. But temporary solutions are welcome.)
"
['quantum-turing-machine']," Title: What is the minimum set of primitive operations for a quantum computer?Body: In 1938, in a famous paper, Alan Turing proved that you could simulate any Turing machine with the following six primitive operations:
1. Move one square to the right
2. Move one square to the left
3. Write a symbol on the current square
4. Read any symbols on the current square
5. Erase any symbols on the current square
6. Do nothing
Is there an analogous set of minimum primitive operations for a quantum computer? Or is it the same set?
"
"['quantum-gate', 'bloch-sphere']"," Title: Why the Ry rotation matrix give counterclockwise rotation?Body: The y-axis centered rotation matrix is $R_{y}(\delta)=\left[\begin{matrix} \cos \frac{\delta}{2} & -\sin \frac{\delta}{2} \\ \sin \frac{\delta}{2} & \cos \frac{\delta}{2} \end{matrix} \right]$.
I tried to use Bloch sphere to understand why this rotation matrix $R_{y}(\delta)$ would rotate the qubit state around y-axis with a counterclockwise $\delta$.
Here is what I do:
Firstly, I change the basis into eigenstates of $\sigma_{y}$, and transform the rotation matrix $R_{y}(\delta)$ into the new form $R'_{y}(\delta)$ with new basis:
$$R'_{y}(\delta)= S R_{y}(\delta) S^{-1}= \frac{1}{\sqrt{2}}\left[\begin{matrix} -i & 1 \\ 1 & -i \end{matrix} \right]\left[\begin{matrix} \cos \frac{\delta}{2} & -\sin \frac{\delta}{2} \\ \sin \frac{\delta}{2} & \cos \frac{\delta}{2} \end{matrix} \right]\frac{1}{\sqrt{2}}\left[\begin{matrix} i & 1 \\ 1 & i \end{matrix} \right]=\exp(i\frac{\delta}{2}) \left[\begin{matrix} 1 & 0 \\ 0 & \exp(-i\delta) \end{matrix}\right]$$
Similar to the $z$ bases case when we use points on the Bloch sphere to describe qubit states, an arbitrary qubit state under $y$ bases can be written as:
$$|\psi\rangle=\cos\frac{\theta}{2}|+\rangle_{y}+\sin\frac{\theta}{2}\exp(i\phi)|-\rangle_{y}$$
Then, I exert $R'_{y}(\delta)$ on $|\psi\rangle$ written this way,
$$R'_{y}(\delta)|\psi\rangle=\exp(i\frac{\delta}{2})[\cos\frac{\theta}{2}|+\rangle_{y}+\sin\frac{\theta}{2}\exp[i(\phi-\delta)]|-\rangle_{y}]$$
Here is my question: if it's counterclockwise rotation, it should be ($\phi+\delta$) above. Why it's $(\phi-\delta$)?
Is it because I wrongly use the Bloch interpretation with y basis?
Thank you for your help!
"
"['qiskit', 'programming', 'algorithm', 'quantum-circuit']"," Title: Error : Cannot unroll the circuit to the given basisBody: I want to run the circuit given below, but I am getting the following error.
QiskitError: "Cannot unroll the circuit to the given basis, ['u1', 'u2', 'u3', 'cx', 'id', 'unitary']. Instruction cphi_0 not found in equivalence library and no rule found to expand."
Why do you think I am encountering this error? I am sharing the codes below. What should I do to run the circuit?
from qiskit_quantum_knn.qknn.qknn_construction import create_oracle, initialise_qknn, state_transformation, add_measurements
from qiskit import BasicAer, execute
n_dim_qubits = 1 # must be log(len(test_state))
n_samps_qubits = 1 # must be log(len(train_data))
test_state = [0, 1]
train_data = [
[1, 0],
[0, 1]
]
oracle = create_oracle(train_data)
init_circ = initialise_qknn(n_dim_qubits, n_samps_qubits, test_state)
state_circ = state_transformation(init_circ, oracle)
final_circ = add_measurements(state_circ)
display(final_circ.draw(output="mpl"))
backend = BasicAer.get_backend('qasm_simulator')
job = execute(final_circ, backend, shots=1024)
"
"['simulation', 'experiment', 'photonics', 'boson-sampling']"," Title: How big is the Hilbert space of a boson sampling experiment?Body: Boson sampling experiments are typically characterized by two key parameters: the number of photons $M$ and the number of modes $N$.
A recent experimental demonstration (arXiv:2106.15534) with $M = 113$ and $N = 144$ says that the Hilbert space dimension is $10^{43}$. This is approximately $2^N$, so I assume that's where they got that number (although I could well be wrong). But the Wikipedia page on boson sampling says that
simple counting arguments show that the size of the Hilbert space corresponding to a system of $M$ indistinguishable photons distributed among $N$ modes is given by the binomial coefficient $\binom{M+N-1}{M}$.
For $M = 113,\ N = 144$ this expression gives $10^{75}$, not $10^{43}$. Why is the paper reporting such a smaller Hilbert space than the Wikipedia article's counting argument would imply?
"