Recent Questions - Quantum Computing Stack Exchange most recent 30 from quantumcomputing.stackexchange.com 2021-10-16T12:10:44Z https://quantumcomputing.stackexchange.com/feeds https://creativecommons.org/licenses/by-sa/4.0/rdf https://quantumcomputing.stackexchange.com/q/21561 0 SWAP test and density matrix distinguishability BlackHat18 https://quantumcomputing.stackexchange.com/users/1351 2021-10-16T07:17:00Z 2021-10-16T07:22:13Z <p>Let us either be given the density matrix <span class="math-container">\begin{equation} |\psi\rangle\langle \psi| \otimes |\psi\rangle\langle \psi| , \end{equation}</span> for an <span class="math-container">$n$</span> qubit pure state <span class="math-container">$|\psi \rangle$</span> or the maximally mixed density matrix <span class="math-container">\begin{equation} \frac{\mathbb{I}}{{2^{2n}}}. \end{equation}</span></p> <hr /> <p>I am trying to analyze the following algorithm to distinguish between these two cases.</p> <p>We plug the <span class="math-container">$2n$</span> qubit state we are given into the circuit of a <a href="https://en.wikipedia.org/wiki/Swap_test" rel="nofollow noreferrer">SWAP test</a>. Then, following the recipe given in the link provided, if the first qubit is is <span class="math-container">$0$</span>, I say that we were given two copies of <span class="math-container">$|\psi \rangle$</span>, and if it is <span class="math-container">$1$</span>, we say we were given the maximally mixed state over <span class="math-container">$2n$</span> qubits.</p> <p>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?</p> https://quantumcomputing.stackexchange.com/q/21560 0 how to simulate toric and surface codes with stim + PyMatching unknown https://quantumcomputing.stackexchange.com/users/12265 2021-10-16T01:57:45Z 2021-10-16T01:57:45Z <p>According to <a href="https://github.com/oscarhiggott/PyMatching" rel="nofollow noreferrer">PyMatching's github page</a> the package can be decode toric and surface codes. <a href="https://github.com/quantumlib/Stim/blob/main/doc/getting_started.ipynb" rel="nofollow noreferrer">Stim's example</a> 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.</p> https://quantumcomputing.stackexchange.com/q/21558 1 ATS Sparse Hamiltonian Simulation notation Hmecher https://quantumcomputing.stackexchange.com/users/15617 2021-10-15T23:20:35Z 2021-10-15T23:20:35Z <p>In the equations in section 3.4.2 of <a href="https://www.cs.tau.ac.il/%7Eamnon/Papers/AT.stoc03.pdf" rel="nofollow noreferrer">Aharonov and Ta-Shma's paper</a>, they define the operator <span class="math-container">$$T_1:|k,0\rangle\rightarrow|b_k,m_k,M_k,\tilde{A_k},\tilde{U_k},k\rangle,$$</span> where <span class="math-container">$b_k,m_k,M_k,$</span> and <span class="math-container">$k$</span> are all integers and <span class="math-container">$\tilde{A_k}$</span> and <span class="math-container">$\tilde{U_k}$</span> are <span class="math-container">$2\times2$</span> matrices. The state <span class="math-container">$|b_k\rangle$</span> can then be taken to be a computational basis state by writing the bit-string representation of <span class="math-container">$b_k$</span>, and similarly for <span class="math-container">$m_k,M_k,$</span> and <span class="math-container">$k$</span>.</p> <p>My question is what is the meaning of <span class="math-container">$|\tilde{A_k}\rangle$</span> and <span class="math-container">$|\tilde{U_k}\rangle$</span>? These are matrices with entries which are not integers, so how are they represented in terms of the computational basis?</p> https://quantumcomputing.stackexchange.com/q/21557 0 What is the best way to get started on quantum finance? Markonian https://quantumcomputing.stackexchange.com/users/18569 2021-10-15T20:01:01Z 2021-10-15T21:18:45Z <p>What is the best way to get started on quantum finance? Any books, websites or learning material you can advice?</p> https://quantumcomputing.stackexchange.com/q/21556 0 Two body integral calculation taking too long Diana https://quantumcomputing.stackexchange.com/users/18567 2021-10-15T18:00:49Z 2021-10-16T11:28:30Z <p>I'm running the most recent version of qiskit and am trying to run H2 in the cc-pvtz basis. However, it is taking an incredibly long time. This is what my code looks like:</p> <pre><code>molecule_coordinates = &quot;H 0.0 0.0 0.0; H 0.0 0.0 0.735&quot; charge = 0 basis = 'cc-pvtz' driver = PySCFDriver(atom=molecule_coordinates, charge=charge, unit=UnitsType.ANGSTROM, basis=basis) molecule = driver.run() </code></pre> <p>It seems to be getting stuck in the two body electronic integral calculation. I'm not having any issues running with the sto-3g or cc-pvdz bases. I hadn't had this problem when running older versions of qiskit, so I'm wondering if this is just an issue with the update. If it is how can I get around it?</p> https://quantumcomputing.stackexchange.com/q/21551 0 Is it possible to collapse a superposition into a preset state such that all entangled qubits collapse to the same state? Tom https://quantumcomputing.stackexchange.com/users/16051 2021-10-15T06:41:38Z 2021-10-15T07:26:59Z <p>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 &amp; 1.</p> <p>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.</p> <p>By 'collapse' I mean turning the superposition on both qubits into a binary number.</p> <p>I'm not sure if this is even possible? Apologies if this comes off as a newbie question.</p> <p><a href="https://i.stack.imgur.com/qG6Ji.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qG6Ji.png" alt="enter image description here" /></a></p> https://quantumcomputing.stackexchange.com/q/21550 0 In quantum error correction using repetition codes, how would I decode an even # of repetitions with errors on half the qubits using majority voting? [closed] John Macintosh https://quantumcomputing.stackexchange.com/users/18438 2021-10-14T21:28:13Z 2021-10-14T22:41:14Z <p>For example its easy to see that <span class="math-container">$101\rightarrow 1$</span>, because it's an odd number of repetitions.</p> <p>But what would, for example, <span class="math-container">$1100$</span> be decoded to?</p> https://quantumcomputing.stackexchange.com/q/21547 0 How is transformation for measurement in an arbitrary basis derived? MichaelW https://quantumcomputing.stackexchange.com/users/18558 2021-10-14T17:32:25Z 2021-10-15T15:36:33Z <p>I started with <code>Qiskit</code> today and find it very exciting. As a first question I want to understand how to measure an arbitrary state <span class="math-container">$|\Psi\rangle$</span> not in the basis of Z (<span class="math-container">$|1\rangle$</span>, <span class="math-container">$|0\rangle$</span>) but in the basis of Y (<span class="math-container">$|R\rangle$</span>, <span class="math-container">$|L\rangle$</span>).</p> <p>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</p> <p><span class="math-container">$|\Psi'\rangle = U |\Psi\rangle$</span></p> <p>into a new state, on which the measurement is done in the Z-basis. U is to be determined. So I want a &quot;mapping&quot; from <span class="math-container">$|R\rangle \rightarrow |0\rangle$</span> and <span class="math-container">$|L\rangle \rightarrow |1\rangle$</span></p> <p>The requirement on U is, therefore:</p> <ul> <li><p>the amplitude of <span class="math-container">$|R\rangle$</span> in <span class="math-container">$|\Psi\rangle$</span> equals to the amplitude of <span class="math-container">$|0\rangle$</span> in <span class="math-container">$U|\Psi\rangle$</span></p> </li> <li><p>the amplitude of <span class="math-container">$|L\rangle$</span> in <span class="math-container">$|\Psi\rangle$</span> equals to the amplitude of <span class="math-container">$|1\rangle$</span> in <span class="math-container">$U|\Psi\rangle$</span></p> </li> </ul> <p>So I have</p> <ul> <li><span class="math-container">$\langle 0|U|\Psi\rangle = \langle R|\Psi\rangle$</span></li> <li><span class="math-container">$\langle 1|U|\Psi\rangle = \langle L|\Psi\rangle$</span></li> </ul> <p>or</p> <ul> <li><span class="math-container">$U^\dagger|0\rangle = |R\rangle$</span></li> <li><span class="math-container">$U^\dagger|1\rangle = |L\rangle$</span></li> </ul> <p>Therefore, the Z-base matrix-representation is</p> <p><span class="math-container">$U^\dagger = \begin{pmatrix}1 &amp; 1&amp; \\ i &amp;-i\end{pmatrix}$</span></p> <p><span class="math-container">$U = \begin{pmatrix} 1 &amp; -i&amp; \\ 1 &amp;i\end{pmatrix}$</span></p> <p>This is a well known result: Actually, it can be written as</p> <p><span class="math-container">$U = H S^\dagger$</span></p> <p>The circuit in <code>Qiskit</code> is as follows</p> <p><a href="https://i.stack.imgur.com/JDJjZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JDJjZ.png" alt="enter image description here" /></a></p> <p>and works as expected:</p> <p><a href="https://i.stack.imgur.com/meYgU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/meYgU.png" alt="enter image description here" /></a></p> <p>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.</p> https://quantumcomputing.stackexchange.com/q/21546 2 How to write the covariance matrix of a quantum gaussian state as a function of photon numbers? Hafez https://quantumcomputing.stackexchange.com/users/13426 2021-10-14T17:30:17Z 2021-10-15T10:33:46Z <p>Assume having a one-mode quantum Gaussian state with quadrature observable vector <span class="math-container">$\hat r = [\hat q , \hat p ]$</span> and covariance matrix <span class="math-container">$\sigma$</span>. According to definition : <span class="math-container">\begin{equation} \sigma = \text{tr}\left(\begin{bmatrix} \hat q^2 &amp; \frac{1}{2}\{\hat q, \hat p\}\\ \frac{1}{2}\{\hat p, \hat q\} &amp; \hat p^2 \end{bmatrix} \rho \right) \end{equation}</span> My question is how can we show the covariance matrix as a function of the average photon number <span class="math-container">$N = \text{tr}(\hat a^\dagger \hat a \rho)$</span>? I have found an answer in  section III.B. (gauge-invariant states) which states the covariance matrix as: <span class="math-container">\begin{equation} \alpha = \begin{bmatrix} \text{Re}N + I/2 &amp; -\text{Im}N \\ \text{Im}N &amp; \text{Re}N + I/2 \end{bmatrix} \end{equation}</span> 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.</p> <p>EDIT: Would you please also explain about the feasibility and meaning of <span class="math-container">$\text{Im}N$</span>? I thought <span class="math-container">$N$</span> is physical observable thus it can just have real values representing the average number of photons.</p> <p>Any help or reference is highly appreciated. Thanks.</p> <p> 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.</p> <p> 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.</p> https://quantumcomputing.stackexchange.com/q/21545 1 $E(U_j,V_j)\leq\Delta/(2m)$ if probabilities of outcomes obtained from the approximate circuit is within a tolerance $Δ>0$ Sooraj S https://quantumcomputing.stackexchange.com/users/18369 2021-10-14T17:00:36Z 2021-10-14T17:00:36Z <blockquote> <p>Suppose we wish to perform a quantum circuit containing <span class="math-container">$m$</span> gates, <span class="math-container">$U_1$</span> through <span class="math-container">$U_m$</span>. Unfortunately, we are only able to approximate the gate <span class="math-container">$U_j$</span> by the gate <span class="math-container">$V_j$</span> . In order that the probabilities of different measurement outcomes obtained from the approximate circuit be within a tolerance <span class="math-container">$Δ&gt;0$</span> of the correct probabilities, it suffices that <span class="math-container">$E(U_j,V_j)\leq\Delta/(2m)$</span></p> </blockquote> <p>How do I make sense of this statement which is given in the section <a href="http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf" rel="nofollow noreferrer">&quot;Approximating unitary operators&quot; in Page 194 of QC and QI by Nelsen and Chuang</a>.</p> <p>It is proved in the same section that,</p> <p>The probability of obtaining an outcome if <span class="math-container">$U$</span> (or <span class="math-container">$V$</span>) is performed with a starting state <span class="math-container">$|\psi\rangle$</span> then <span class="math-container">$|P_U-P_V|\leq 2E(U,V)$</span>, where <span class="math-container">$E(U,V)=\max_{|\psi\rangle}||(U-V)|\psi\rangle||=||U-V||$</span> is the error when <span class="math-container">$V$</span> is implemented instead of <span class="math-container">$U$</span>.</p> <p>And if we perform a sequence of gates <span class="math-container">$V_1,\cdots,V_m$</span> intended to approximate some other sequence of gates <span class="math-container">$U_1,\cdots,U_m$</span>, then the errors add at most linearly, i.e., <span class="math-container">$E(U_m\cdots U_1,V_m\cdots V_1)\leq \sum_{j=1}^m E(U_j,V_j)$</span></p> <p>How do I make use of these equations to validate the given statement ?</p> <p><strong>My Try</strong></p> <p>The statement, the probabilities of different measurement outcomes obtained from the approximate circuit be within a tolerance <span class="math-container">$Δ&gt;0$</span> of the correct probabilities implies, <span class="math-container">$0\leq |P_{U_1\cdots U_m}-P_{V_1\cdots V_m}|\leq \Delta$</span></p> https://quantumcomputing.stackexchange.com/q/21543 0 What exactly happens in a quantum annealing process? Felix https://quantumcomputing.stackexchange.com/users/18552 2021-10-14T13:31:44Z 2021-10-14T13:31:44Z <p>I recently began to learn about quantum annealing, with focus on d-waves quantum annealers and QUBO optimization problems.</p> <p>By now I more or less understood the basic idea of quantum annealing. But with many details still unknown to me, I can't find a <strong>detailed</strong> description of the actual &quot;annealing/computational&quot; part. So this question should focus on the steps after problem formulation and embedding on the annealer.</p> <p>Said <em>very</em> <em>loosely</em> we begin with some state of which we know the lowest energy level, say <span class="math-container">$H_A$</span>, then we begin our annealing process by slowly introducing our problem called <span class="math-container">$H_B$</span>. This annealing step often only takes <span class="math-container">$\mu s$</span> in common literature.</p> <p>After this annealing process we &quot;calculated&quot; our optimal solution through some magical internal procedure (at least it seems so for me).</p> <p>Coming from traditional computers I'm used to strict and predictable behaviour of such devices, this annealing process however seems arbitrary to me, so how does a quantum annealer solve such problems and how does it work internally?</p> <p>Is an annealing process just pure randomness and &quot;magic&quot; or is there some structure behind it?</p> https://quantumcomputing.stackexchange.com/q/21541 2 Computing expectation value of a Pauli string on stabilizer states archxrk https://quantumcomputing.stackexchange.com/users/18551 2021-10-14T13:15:24Z 2021-10-15T10:29:41Z <p>I need some help on <code>stim</code>, where I'm trying to compute expectation values of Pauli strings. Hopefully I did not overlook on the documentation an implementation of this method.</p> <h1><strong>Problem Statement</strong></h1> <p>Given a generic Pauli string <span class="math-container">$O$</span> acting on <span class="math-container">$N$</span> qubits and a stabilizer state <span class="math-container">$\rho$</span> on <span class="math-container">$N$</span> qubits, compute within <code>stim</code> the expectation value <span class="math-container">\begin{equation} \langle O\rangle \equiv \mathrm{Tr}(O \rho). \end{equation}</span> Since <span class="math-container">$O$</span> is a Pauli string, <span class="math-container">$\langle O\rangle \in \{0,+1,-1\}$</span>.</p> <h1><strong>Tentative Solution</strong></h1> <p>To be concrete, within this question I fix <span class="math-container">$N=4$</span>, and I want to compute <span class="math-container">$\mathrm{Tr}(X_1 Z_3 \rho)$</span>. Furthermore, I specify I work on the <code>c++</code> library, within which my state is contained in an instance of <code>TableauSimulator</code>:</p> <pre><code>... 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 ... </code></pre> <p>Now, I know I can apply a measurement gate <code>MPP X1Z3</code>. If this measurement is deterministic (equivalently, if <span class="math-container">$X1Z3$</span> commute with <span class="math-container">$\rho$</span>), the measurement readout gives <span class="math-container">$\langle O\rangle$</span>, which is either <span class="math-container">$+1$</span> or <span class="math-container">$-1$</span>. If, instead, the measurement is non-deterministic (equivalently, if <span class="math-container">$X1Z3$</span> anticommute with <span class="math-container">$\rho$</span>), <span class="math-container">$\langle O\rangle=0$</span>. Given the above, I tried the following. I initialize two new <code>TableauSimulator</code></p> <pre><code>TableauSimulator PsiPlus = Psi; TableauSimulator PsiMinus = Psi; </code></pre> <p>and applied to them <code>PsiPlus</code> the gate <code>MPP X1Z3</code>, whereas in <code>PsiMinus</code> the gate <code>MPP !X1Z3</code>. Then, since in general <span class="math-container">\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}</span> I expect the difference:</p> <pre><code>int aveO = PsiPlus.measurement_record.storage[last_entry]-PsiMinus.measurement_record.storage[last_entry]; </code></pre> <p>where last_entry is the index of the last measurement (respectively of <code>MPP X1Z3</code> for <code>PsiPlus</code> and <code>MPP !X1Z3</code> for <code>PsiMinus</code>) should be the required value <span class="math-container">$\langle O\rangle$</span>.</p> <p><strong>Problems</strong> 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 <code>stim</code>, as there is a method <code>TableauSimulator.is_deterministic_x</code> (and similarly for y,z) which should exactly check if the outcome of <code>MX</code> (<code>MY</code>,<code>MZ</code>) is deterministic or not. If a similar method would be present for generic <code>MPP</code>, probably a solution would still be easily implementable. In <em>pseudo-code</em>:</p> <pre><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]; } </code></pre> <p>Still, I'm not an expect in HPC, but probably there are smarter way to implement the computation of expectation values.</p> https://quantumcomputing.stackexchange.com/q/21539 1 How to take 3-point or more correlators into edge probability computation in surface code decoding? Inm https://quantumcomputing.stackexchange.com/users/11562 2021-10-14T11:10:42Z 2021-10-14T11:49:29Z <p>In Google's work of repetition code (<a href="https://www.nature.com/articles/s41586-021-03588-y" rel="nofollow noreferrer">Exponential suppression of bit or phase errors with cyclic error correction</a>), they use the method of <code>Correlation Matrix</code> to characterize the error events and decode. But they only describe the calculation of the correlators up to 2-point correlation.</p> <p>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.</p> https://quantumcomputing.stackexchange.com/q/21536 0 Knill Laflamme conditon alpha https://quantumcomputing.stackexchange.com/users/18469 2021-10-14T06:51:28Z 2021-10-14T13:28:22Z <p>In <a href="http://theory.caltech.edu/%7Epreskill/ph229/notes/chap7.pdf" rel="nofollow noreferrer">Preskill's notes</a> on quantum error correcting codes in Section 7.2, there seems to be no condition on the environment part of the state, <em>i.e.</em> <span class="math-container">$|0\rangle_E$</span> in <span class="math-container">$|\psi\rangle \otimes |0\rangle_E$</span>.</p> <p>Does it have to belong in a certain Hilbert space of <span class="math-container">$n$</span>-dimension for the whole discussion to go through, <em>i.e.</em> the Knill-Laflamme condition being necessary and sufficient to perform quantum error correction?</p> https://quantumcomputing.stackexchange.com/q/21534 0 How to perform encoding and syndrome measurement in stim unknown https://quantumcomputing.stackexchange.com/users/12265 2021-10-14T02:16:34Z 2021-10-15T19:12:06Z <p>I can generate the encoding circuit of a stabilizer code and can read it into <a href="https://github.com/quantumlib/Stim" rel="nofollow noreferrer">stim</a>. For example for the <span class="math-container">$[[5,1,3]]$</span> code :</p> <pre><code> circuit=stim.Circuit() circuit.append_operation(&quot;H&quot;,) circuit.append_operation(&quot;CY&quot;,[0,4]) circuit.append_operation(&quot;H&quot;,) circuit.append_operation(&quot;CX&quot;,[1,4]) circuit.append_operation(&quot;H&quot;,) circuit.append_operation(&quot;CZ&quot;,[2,0]) circuit.append_operation(&quot;CZ&quot;,[2,1]) circuit.append_operation(&quot;CX&quot;,[2,4]) circuit.append_operation(&quot;H&quot;,) circuit.append_operation(&quot;CZ&quot;,[3,0]) circuit.append_operation(&quot;CZ&quot;,[3,2]) circuit.append_operation(&quot;CY&quot;,[3,4]) </code></pre> <p>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 <span class="math-container">$(0,0,0,0)$</span>.</p> <p>First step : the &quot;data&quot; qubit is placed on qubit 4 (numbering starts from 0). So the input to the encoder is <span class="math-container">$(q0=0,q1=0,q2=0,q3=0,q4=d0)$</span>. <span class="math-container">$k=1$</span> for this code so there's only one data qubit. How would I initialize the input to be of that form?</p> <p>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?</p> https://quantumcomputing.stackexchange.com/q/21531 3 Why does quantum distinguishability ensure no faster-than-light communication? Alexia. https://quantumcomputing.stackexchange.com/users/14857 2021-10-14T01:58:31Z 2021-10-15T10:36:38Z <p>On page 56-57 in Nielsen and Chuang, for a proposed scenario, it's said that:</p> <blockquote> <p>if Bob had access to a device that could distinguish the four states <span class="math-container">$|0\rangle$</span>, <span class="math-container">$|1\rangle$</span>, <span class="math-container">$|+\rangle$</span>, <span class="math-container">$|−\rangle$</span> from one another, then he could tell whether Alice had measured in the computational basis, or in the <span class="math-container">$|+\rangle$</span>, <span class="math-container">$|−\rangle$</span> basis.</p> </blockquote> <p>I'm confused about why this is the case.</p> https://quantumcomputing.stackexchange.com/q/21528 4 What is the structure of coefficients of $2^N\times 2^N$ unitary matrices decomposed in terms of the Pauli basis? Nichola https://quantumcomputing.stackexchange.com/users/12547 2021-10-13T22:12:48Z 2021-10-14T13:32:52Z <p>Any square <span class="math-container">$2^N\times 2^N$</span> matrix can be written as a sum of tensor products of pauli matrices. Eg a <span class="math-container">$8\times 8$</span> matrix can be written as <span class="math-container">$$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}.$$</span> <strong>If U is unitary, what does it imply about <span class="math-container">$u_{i_1,i_2,i_3}$</span> ?</strong></p> <p>We can write <span class="math-container">$U^\dagger U=1 \implies Tr[U^\dagger U\cdot(\sigma_{i_1}\otimes\sigma_{i_2}\otimes\sigma_{i_3})]=0$</span> for <span class="math-container">$\{i_1,i_2,i_3\}\neq \{0,0,0\}$</span> and <span class="math-container">$Tr(U^\dagger U)=2^N$</span>. The second equality gives: <span class="math-container">\begin{align}Tr(U^\dagger U)&amp;=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}\\&amp;=\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}\\ &amp;=\sum_{i_1,i_2,i_3}|u_{i_1,i_2,i_3}|^2=8 \end{align}</span> But I have hard time using the first equality to derive a useful constraint on <span class="math-container">$u_{i_1,i_2,i_3}$</span>.</p> https://quantumcomputing.stackexchange.com/q/21527 1 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}$? Alexia. https://quantumcomputing.stackexchange.com/users/14857 2021-10-13T22:04:22Z 2021-10-14T18:15:28Z <p>On pg. 55 in Nielsen and Chuang, it's said that:</p> <blockquote> <p>the <span class="math-container">$|0\rangle + |1\rangle$</span> product can be well approximated by a superposition of states of the form <span class="math-container">$|0\rangle ^{\otimes n(1−p)/2}|1\rangle ^{\otimes n(1−p)/2}$</span>.</p> </blockquote> <p>I'm confused about how we get the exponents for <span class="math-container">$|0\rangle$</span> and <span class="math-container">$|1\rangle$</span>, namely, <span class="math-container">$\otimes n(1−p)/2$</span>.</p> https://quantumcomputing.stackexchange.com/q/21523 2 How to show that Werner states produce correlations explainable via local hidden variable models? glS https://quantumcomputing.stackexchange.com/users/55 2021-10-13T17:58:31Z 2021-10-15T08:17:50Z <p><a href="https://en.wikipedia.org/wiki/Werner_state" rel="nofollow noreferrer">Werner states</a> can be written as <span class="math-container">$$\rho_W= p\frac{\Pi_+}{\binom{n+1}{2}} +(1-p)\frac{\Pi_-}{\binom{n}{2}},$$</span> with <span class="math-container">$\Pi_\pm\equiv\frac12(I\pm\mathrm{SWAP})$</span> projectors onto the <span class="math-container">$\pm1$</span> eigenspaces of the swap operator, defined as the one acting on basis states as <span class="math-container">$\mathrm{SWAP}(e_a\otimes e_b)=e_b\otimes e_a$</span>, and <span class="math-container">$n$</span> the dimension of the underlying spaces.</p> <p>These are known to be separable for <span class="math-container">$p\ge 1/2$</span>, as seen <em>e.g.</em> via PPT criterion. However, as shown in <a href="https://journals.aps.org/pra/abstract/10.1103/PhysRevA.40.4277" rel="nofollow noreferrer"><em>Werner's 1989</em></a> paper, these states admit local hidden variable (LHV) models also for <span class="math-container">$p&lt;1/2$</span> corresponding to nonseparable states. In this context, by &quot;admits LHV model&quot; I mean that the correlation it produces can be explained by such a model, <em>i.e.</em> <span class="math-container">$$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),$$</span> for some probability distribution <span class="math-container">$p_\lambda$</span> (which can be continuous, in which case the sum above becomes an integral over some measure), and conditional probability distributions <span class="math-container">$p_\lambda(a|x)$</span> and <span class="math-container">$p_\lambda(b|y)$</span>. The collections <span class="math-container">$\{\Pi^x_a\}_a,\{\Pi^b_b\}$</span> are spanning sets of orthogonal unit-trace projections, so that <span class="math-container">$x,y$</span> denote the &quot;measurement choice&quot; made by Alice and Bob when measuring, while <span class="math-container">$a,b$</span> are the corresponding measurement outcomes. More explicitly, we are thus calling <span class="math-container">$\rho_W$</span> &quot;local&quot; if <span class="math-container">$$\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),$$</span> for any pair of projective measurements <span class="math-container">$\{\Pi_a\}_a,\{\Pi'_b\}_b$</span>, and (some) conditional probability distributions <span class="math-container">$p_\lambda(a|\{\Pi_a\}_a),p_\lambda(b|\{\Pi'_b\}_b)$</span>.</p> <p>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/&quot;better&quot; way to construct such LHV models?</p> https://quantumcomputing.stackexchange.com/q/21516 1 Compute expectation value of an operator in openfermion ironmanaudi https://quantumcomputing.stackexchange.com/users/8611 2021-10-12T09:47:37Z 2021-10-15T17:54:25Z <p>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</p> <pre><code>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) </code></pre> <p>The problem is with the last line, which gives the following exception</p> <pre><code>TypeError: can only concatenate str (not &quot;ABCMeta&quot;) to str </code></pre> <p>After examning the source code, I figured out that the problem is with the <code>[operator * state]</code>. Can anybody help to fix this?</p> https://quantumcomputing.stackexchange.com/q/21449 0 Measurement of single qubit operator $U$ which is both Hermitian and unitary with eigenvalues $±1$ Sooraj S https://quantumcomputing.stackexchange.com/users/18369 2021-10-07T15:49:13Z 2021-10-14T17:49:08Z <blockquote> <p>Suppose we have a single qubit operator <span class="math-container">$U$</span> with eigenvalues <span class="math-container">$±1$</span>, so that <span class="math-container">$U$</span> 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 <span class="math-container">$U$</span>. 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 <span class="math-container">$U$</span>:</p> </blockquote> <p><a href="https://i.stack.imgur.com/uF5J9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uF5J9.png" alt="qc" /></a></p> <p><strong>Ref. to Exercise 4.34 in QC and QI by Nelsen and Chuang</strong></p> <p><span class="math-container">$$|\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]$$</span> Note that,</p> <p><span class="math-container">$U(I+U)|\psi_{in}\rangle=(U+U^2)|\psi_{in}\rangle=(U+I)|\psi_{in}\rangle=1(I+U)|\psi_{in}\rangle$</span> and <span class="math-container">$U(I-U)|\psi_{in}\rangle=-1(I-U)|\psi_{in}\rangle$</span></p> <p><span class="math-container">$\implies (I+U)|\psi_{in}\rangle$</span> and <span class="math-container">$(I-U)|\psi_{in}\rangle$</span> are eigenvectors of the operator <span class="math-container">$U$</span> with corresponding eigenvalues <span class="math-container">$+1$</span> and <span class="math-container">$-1$</span>, respectively.</p> <p>And by projecting the first qubit the second qubit is projected to either <span class="math-container">$(I+U)|\psi_{in}\rangle$</span> or <span class="math-container">$(I-U)|\psi_{in}\rangle$</span>, therefore this circuit implements a measurement of <span class="math-container">$U$</span>.</p> <hr /> <p>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 <span class="math-container">$|m\rangle$</span> in one-to-one correspondence with the possible outcomes of the measurement we wish to implement.</p> <p>Please check <a href="http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf" rel="nofollow noreferrer">Page 94, QC and QI by Nelsen and Chuang</a> for the proof of this statement.</p> <p>Are we using this statement to implement the circuit above ?</p> <hr /> <p>Can't we have a circuit like : <a href="https://i.stack.imgur.com/tx9EY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tx9EY.png" alt="qc2" /></a></p> <p>with <span class="math-container">$U'=\sum |m \rangle\langle\psi_m |=|0\rangle\langle \psi|(I+U)+|1\rangle\langle \psi|(I-U)$</span> where <span class="math-container">$|\psi_i\rangle$</span> are the eigenvectors of the operator <span class="math-container">$U$</span> ?</p> https://quantumcomputing.stackexchange.com/q/21427 0 How to create a quantum circuit to implement the same operations but acting on different qubits? Aulan Lucrèce https://quantumcomputing.stackexchange.com/users/18481 2021-10-06T08:34:45Z 2021-10-15T23:55:29Z <p>I want the draw the quantum circuit of the following Hamiltonian: <span class="math-container">$$H = - 4 \times X\otimes X\otimes X\otimes X - 4\times Z\otimes Z\otimes Z \otimes Z$$</span>. I have been able to draw the circuits of <span class="math-container">$- X\otimes X\otimes X\otimes X$</span> and <span class="math-container">$- Z\otimes Z\otimes Z \otimes Z$</span>. But adding them up using qiskit functions like compose, and combine did not give me the matrix I am looking for.</p> <p>I would like to recall that when looking at <span class="math-container">$4 \times X\otimes X\otimes X\otimes X$</span> for instance, the operator <span class="math-container">$X\otimes X\otimes X\otimes X$</span> will be applied <span class="math-container">$4$</span> times but not on the same set of qubits and the matrix should <span class="math-container">$16\times 16$</span>. Using compose and combine function, I still obtain the <span class="math-container">$16\times 16$</span> matrix by its components do not add up. Instead, the gates acted on the same set of qubits.</p> <p>It will be very helpful if someone can help me. Thanks</p> https://quantumcomputing.stackexchange.com/q/21186 5 Enforcing a particular layout mapping in Qiskit soara https://quantumcomputing.stackexchange.com/users/18287 2021-09-14T11:35:41Z 2021-10-15T08:07:50Z <p>I would like to ask how to set a particular layout during <a href="https://qiskit.org/documentation/stubs/qiskit.compiler.transpile.html" rel="nofollow noreferrer">transpiling</a>. I guess that the layout can be set by the <code>initial_layout</code> parameter in the transpiler. However, there are several options that may conflict, namely: <code>layout_method</code>, and optimisation <code>optimization_level</code>. I do not know which one suppress the other. I guess that <code>optimization_level</code> 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.</p> https://quantumcomputing.stackexchange.com/q/17543 1 Running qiskit on jupyter notebook certverification error: unable to get local user certificate LOC https://quantumcomputing.stackexchange.com/users/13261 2021-05-17T23:55:15Z 2021-10-15T10:01:15Z <p>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 :</p> <pre><code>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: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 </code></pre> <p>However running the simple test</p> <pre><code>#simple test circtest(1,0,100) </code></pre> <p>returns the following error:</p> <pre><code>--------------------------------------------------------------------------- SSLCertVerificationError Traceback (most recent call last) &lt;ipython-input-3-8d451fe64647&gt; in &lt;module&gt; 1 #simple test ----&gt; 2 totcirc1Qx(1,0,100) &lt;ipython-input-2-5ff78fcf31bb&gt; in totcirc1Qx(x1, x2, shotsin) 23 device = provider.get_backend('ibmq_casablanca') 24 Cfin=circuit2; ---&gt; 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 &quot;&quot;&quot; 275 # pylint: disable=arguments-differ --&gt; 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: --&gt; 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: --&gt; 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 --&gt; 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.') ---&gt; 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: --&gt; 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: --&gt; 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 &lt;= retries: 257 try: --&gt; 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: --&gt; 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) --&gt; 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) -&gt; WebSocketClientProtocol: 621 for redirects in range(self.MAX_REDIRECTS_ALLOWED): --&gt; 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 -&gt; 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: -&gt; 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 --&gt; 284 yield self # This tells Task to wait for completion. 285 if not self.done(): 286 raise RuntimeError(&quot;await wasn't used with future&quot;) /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py in __wakeup(self, future) 326 def __wakeup(self, future): 327 try: --&gt; 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: --&gt; 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: --&gt; 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. --&gt; 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 &quot;&quot;&quot;Start the SSL/TLS handshake.&quot;&quot;&quot; --&gt; 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) </code></pre> <p>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</p> https://quantumcomputing.stackexchange.com/q/17518 5 How can one cheat in Mahadev's classical verification protocol if one can find a "claw''? Arnab https://quantumcomputing.stackexchange.com/users/13809 2021-05-16T06:23:44Z 2021-10-15T16:02:55Z <p>I was going through the seminal paper of Urmila Mahadev on <a href="https://arxiv.org/abs/1804.01082" rel="nofollow noreferrer">Classical Verification of Quantum Computations</a>(for an overview see <a href="https://youtu.be/kql5dSywvy0?t=2269" rel="nofollow noreferrer">this excellent talk by her</a>). 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.</p> <p>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 <span class="math-container">$|\psi\rangle=\alpha_0|0\rangle+\alpha_1|1\rangle.$</span> To commit to this state, the prover entangles this state with the two pre-images <span class="math-container">$x_0,x_1$</span> of the trapdoor clawfree function pair <span class="math-container">$f_0,f_1$</span> using a quantum oracle and sends back the classical string <span class="math-container">$y=f(x_0)=f(x_1)$</span>. At this point, the prover holds the state <span class="math-container">$|\psi_{ent}\rangle=\alpha_0|0\rangle|x_0\rangle+\alpha_1|1\rangle|x_1\rangle$</span> which is a state that he himself doesn't know the full description of because it is hard to know <span class="math-container">$x_0 \; \text{and}\; x_1$</span> (actually even one of bit of <span class="math-container">$x_1$</span>) 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 <span class="math-container">$|\psi_{enc}\rangle$</span> this U is computationally randomized both by the state encoding and the decoding of the verifier.</p> <p>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 <span class="math-container">$|\psi_{enc}\rangle$</span>. 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.</p> <p>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.</p> <p>Thanks in advance.</p> https://quantumcomputing.stackexchange.com/q/15656 8 What's the 'physical consistency' in the partial trace scenario? ZR- https://quantumcomputing.stackexchange.com/users/12334 2021-01-23T23:45:06Z 2021-10-15T05:44:49Z <p>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:</p> <blockquote> <p>Physical consistency requires that any prescription for associating a ‘state’, <span class="math-container">$\rho^A$</span>, to system A, must have the property that measurement averages be the same whether computed via <span class="math-container">$\rho^A$</span> or <span class="math-container">$\rho^{AB}$</span> : <span class="math-container">$\text{tr}(Mf(\rho^{AB}))=\text{tr}((M\otimes I_B)\rho^{AB})$</span></p> </blockquote> <p>Here <span class="math-container">$M$</span> is any observable on system A. I'm wondering what 'physical consistency' and 'measurement average' are?</p> <p>It is also argued that <span class="math-container">$f(\rho^{AB})=\rho^A=\text{tr}_B(\rho^{AB})$</span> is a uniquely determined map. I'm also confused about this point. Could someone give me some more explanations? Thanks!!</p> https://quantumcomputing.stackexchange.com/q/14603 7 How to learn parameters in a quantum circuit, given an interference pattern? Calum Macdonald https://quantumcomputing.stackexchange.com/users/13792 2020-11-12T09:19:08Z 2021-10-14T18:04:25Z <p>Using <a href="https://cirq.readthedocs.io/en/stable/" rel="nofollow noreferrer"><code>cirq</code></a>, I have the following quantum circuit, with three parameters: phi, alpha and beta:</p> <pre><code>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) </code></pre> <p><a href="https://i.stack.imgur.com/XVmI7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XVmI7.png" alt="circuit" /></a></p> <p>This circuit is just some randomness I was playing with, so please don't take it too seriously...</p> <p>If I fix the values of alpha=2 and beta=-3 and perform a scan over phi from <span class="math-container">$[0,2\pi]$</span> I can generate a distribution of the number of times the system is measured in state <span class="math-container">$|00\rangle$</span> (actually not 100% sure I am right here)...</p> <p>Example scan with phi=0.25</p> <pre><code>&gt;&gt;&gt; resolver = cirq.ParamResolver({'phi':0.25,'alpha':alpha,'beta':beta}) &gt;&gt;&gt; trials = cirq.Simulator().run(circuit, resolver, repetitions=1000) &gt;&gt;&gt; trials.histogram(key='m') Counter({0: 726, 2: 124, 3: 122, 1: 28}) </code></pre> <p>Plotting <code>trials.histogram(key='m')</code> as a function of phi, I get:</p> <p><a href="https://i.stack.imgur.com/rZV04.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rZV04.png" alt="" /></a></p> <hr /> <h2>Finally, my question...</h2> <p>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</p> <p>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 <a href="https://www.tensorflow.org/quantum/api_docs/python/tfq" rel="nofollow noreferrer"><code>tfq</code></a>?</p> <p>Any suggestions? Or suggestions to move to qiskit/pennylane?</p> https://quantumcomputing.stackexchange.com/q/12080 8 Evaluating expectation values of operators in Qiskit mavzolej https://quantumcomputing.stackexchange.com/users/6313 2020-05-19T12:04:02Z 2021-10-14T12:36:44Z <p>I'm wondering how in Qiskit one can calculate the expectation value of an operator given as a <code>WeightedPauli</code> (or, at least, of a single <code>Pauli</code> operator...) in a certain state (given as a <code>QuantumCircuit</code> 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 <code>float</code>s, not <code>Parameter</code>s (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).</p> <p>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.</p> <p>I guess, <code>PauliBasisChange</code> may be involved...</p> https://quantumcomputing.stackexchange.com/q/11525 4 What is a separable decomposition for the Werner state? glS https://quantumcomputing.stackexchange.com/users/55 2020-04-13T08:20:50Z 2021-10-15T15:52:24Z <p>Consider the two-qubit Werner state, defined as <span class="math-container">$$\rho_z = z |\Psi_-\rangle\!\langle \Psi_-| + \frac{1-z}{4}I, \quad |\Psi_-\rangle\equiv\frac{1}{\sqrt2}(|00\rangle-|11\rangle),$$</span> for <span class="math-container">$z\ge0$</span>. Using the <a href="https://en.wikipedia.org/wiki/Peres%E2%80%93Horodecki_criterion" rel="nofollow noreferrer">PPT criterion</a>, one can see that this state is separable <em>iff</em> <span class="math-container">$0\le z\le 1/3$</span>.</p> <p>I couldn't, however, find a source discussing explicit separable decompositions (in the <span class="math-container">$z\le1/3$</span> regime, of course). Is there a "nice" way to find such decompositions?</p> https://quantumcomputing.stackexchange.com/q/5564 4 How to find a separable decomposition for $|\Psi^+\rangle\!\langle\Psi^+|+|\Phi^+\rangle\!\langle\Phi^+|$? Mahathi Vempati https://quantumcomputing.stackexchange.com/users/2832 2019-02-27T09:23:21Z 2021-10-15T16:35:14Z <p>The state <span class="math-container">$$\frac{1}{2}\left(| \phi^+ \rangle \langle \phi^+ | + | \psi^+ \rangle \langle \psi^+ | \right)$$</span></p> <p>where <span class="math-container">$$| \phi^+ \rangle = \frac{1}{\sqrt2} \left(|00 \rangle + | 11 \rangle \right)$$</span> <span class="math-container">$$| \psi^+ \rangle = \frac{1}{\sqrt2} \left(|01 \rangle + | 10 \rangle \right)$$</span></p> <p>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?</p>