New answers tagged

1

Conjugate by CNOTs to reduce to a case where the two states differ by exactly one bit, and conjugate by NOTs to make all the controls look for 1s instead of 0s. Find a bit position t where the two states disagree about a bit. Let s be the state where the bit at t is 0. For each bit position p other than t where the bit is 0 in s, apply a NOT to qubit p. For ...


8

For any controlled-$U$, if the input state is $|+\rangle|\phi\rangle$ where $|\phi\rangle$ is not an eigenstate of $U$, then the output state is entangled. This immediately deals with trivial cases such as $U=I$ because in that case all states $|\phi\rangle$ are eigenstates, and so it is not entangling. For any other $U$, there is an input state that is ...


4

It cannot be the case that $H=e^{i\pi/4}\sqrt{iNOT}$. Whatever your interpretation of $iNOT$ (I'd agree with your definition), just square the thing. $H^2=I$, the identity, and so it is certainly not the case that $$ I=e^{i\pi/2}iNOT. $$ It is true, however, that if you perform the sequence that would give you an operation such as $NOT$ or $iNOT$, and you ...


0

This isn't supported in qiskit-terra yet with parametrized circuits. There is an open issue to add support for adding a parameter sweep with trig functions here: https://github.com/Qiskit/qiskit-terra/issues/3908


0

I think these gates only accept float or np.float as a parameter. Try casting to one of these types, for example phase = float(phase) and it should work.


2

The application of Hadamard gate on the first qubit is correct. Since CNOT is two qubit gate, it has to be described by matrix 4x4, so far you have only 2x2 matrix. However, there is a identity operator $I$ described by unit matrix on the second qubit. Hence the first step in you circuit can be described by matrix $H \otimes I$. Resulting matrix is of type ...


2

For the way round that you've got your inequalities, I don't think there's much that can be said. To see why, let's consider the first expression $$ \|U-V\|_1=\text{Tr}(\sqrt{2I-VU^\dagger-UV^\dagger}). $$ Now, $VU^\dagger$ is a unitary, and hence as a spectral decomposition. Let the eigenvectors be $|\lambda_i\rangle$ with eigenvalues $e^{i\lambda_i}$. $UV^\...


1

There are many possible ways to encode data into a quantum neural network (QNN). In one of the first papers to suggest the use of variational circuits to classify data [1], the authors suggest the following general architecture for a QNN: The circuit starts with the $|0\rangle$ state, encodes a data point $\textbf{x}$ using a circuit $S_\textbf{x}$, and ...


2

I asked Sergio Boxio about this and he noted that this is discussed in the supplementary information of the Supremacy paper. In particular, Figure S47 has a plot of the speedup you get due to imbalance in the Schmidt coefficients as the rotation angle drifts: and equations 103, 104, and 105 show how to compute the relevant coefficients:


0

You can use a method described in Transformation of quantum states using uniformly controlled rotations. Authors of the article introduced method how to change an arbitrary state $|a\rangle$ to state $|b\rangle$ with so-called uniformly controlled rotation, i.e. a rotation which rotational angle depends on combination of zeros and ones in controlling ...


0

What you seem to be asking for is the general construction of an arbitrary permutation. There’s nothing quantum about this; the equivalent question in classical is how to construct an arbitrary reversible circuit of n bits. There are $2^n!$ such circuits, from which it is hopefully obvious that there is not a compact description for the vast majority. I ...


1

I tried to simulate on IBM Q. I realized that input states $|01\rangle$ and $|10\rangle$ have oposite phase in comparison with others. This is desired behavior of the algorithm because these states have to be marked. Phase of other two states is intact. Because two states are marked and two do not, average amplitude is zero. When you rotate amplitudes around ...


4

Your states differ in global phase only, hence they are indistinguishable (or in other words they are equivalent). Therefore you do not need to apply gate $-I$. Note that the global phase is $\pi$ as $-1 = \mathrm{e}^{i\pi}$ However, in case the state is produced by controlled gate, global phase cannot be neglected. In that case you can implement ...


1

Please have a look at article Transformation of quantum states using uniformly controlled rotations, chapters 1 and 2. These provides you with construction of general rotation gate controlled by $n$ qubits with different rotations angles for each basis state $|x\rangle$. You also might be interested in some of these articles on quantum computers application ...


4

You want to implement $$ e^{i3\pi/4}e^{iX\pi/4}. $$ I would rewrite this as $$ e^{i3\pi/4}He^{iZ\pi/4}H. $$ This is the same as $$ -HS^\dagger H $$ in standard gate terminology. If you're only implementing the gate $e^{iAt}$, then you can neglect the global phase and just implement $HS^\dagger H$. Both of these gates are readily implemented in qiskit as sdg ...


4

There is actually a nice way to do this in Qiskit, since it has decompositions for single-qubit unitaries built in. The QuantumCircuit.squ method takes a unitary 2x2 matrix $U$ and a qubit and computes the decomposition $$ U = R_Z(\alpha) R_Y(\beta) R_Z(\gamma) $$ This is a common decomposition, you can find a proof here https://arxiv.org/pdf/quant-ph/...


1

There is no measurement in the picture; the picture shows how to construct 4 Bell states $|\Phi^+\rangle$, $|\Phi^-\rangle$, $|\Psi^+\rangle$ and $|\Psi^-\rangle$ using Hadamard-CNOT circuit.


3

Denoting phase gate by $P$ probably comes from its name Phase Phase gate is usually denoted by $S$ as you can see from your Nielsen and Chuang book example. Moreoer, symbol $S$ is used also on IBM Q. To sum up, it is a matter of a paper's author decission. As I remember, I have seen phase gate denoted by $S$ only.


2

I think this is enough $e^{iAt}= e^{i(1.5I)t} e^{i(0.5X)t}$ for constructing the circuit. From rx and u3: $$R_x(-t) = e^{i(0.5X)t} \qquad R_x(\theta) = u3(\theta, -\pi/2, \pi/2)$$ The $e^{i(1.5I)t}$ is a global phase gate that can be implemented via the following circuit for q[0] qubit. Here is the whole circuit for the $e^{iAt}$: # Rx part circuit.u3(-t, -...


2

$$R_y(\theta) = e^{-i\frac{\theta}{2}Y} = \begin{bmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{bmatrix}$$ This gate might be named slightly differently depending on the source; Wikipedia doesn't seem to know it but this primer on rotations on Bloch sphere lists all rotation gates nicely.


4

The coefficient $\frac{1}{\sqrt{2^3}}$ is the normalization factor: if you have a 3-qubit state that is an equal superposition of 8 basis states, its norm still has to be 1; thus the squared amplitude of each basis state has to be $\frac{1}{8}$, and the amplitude will be square root of that, i.e. exactly $\frac{1}{\sqrt{2^3}}$. You can also obtain that ...


1

Firstly, I think there's a reason why the bit in the textbook before the question is using $\delta$ instead of $\epsilon$ for the results. So, replacing what you've written, it should really be $$ E<\sqrt{2(1-\cos(\delta/2))} $$ Now, start with a double-angle formula: $1-\cos(\delta/2)=2\sin^2(\delta/4)$. Thus, $$ E<2\sin(\delta/4) $$ Now if you apply ...


3

This depends on the context in which you're using the operators. You're talking about multiplying them, so I guess you're thinking of, for example, unitaries (and other circuit model elements). In this case, not only are terms $A\otimes I$ local operators, but $A\otimes B$ is also a local operator. For example, on a quantum circuit, two Hadamard gates ...


1

There are two inequivalent definitions of "local operator" used in quantum information theory. The first definition is used in the context of communication over a classical channel (e.g. LOCC). In this context, you have a fixed partition of the complete Hilbert space into a tensor product of $k$ different subsystems, and the subsystems are assumed to be so ...


5

Martin Vesely's answer is the way to go in general, and especially if you know more than one column. However, if you're given just one column, there's an easier trick for generating a suitable unitary. Note that $V=2|v\rangle\langle v|-I$ is a unitary ($V=V^\dagger$ and $V^2=I$). So, the question is whether you can select a $|v\rangle$ such that the first ...


6

Take your vector $\frac{1}{\sqrt{5}}(0, 1, 1, 1, 1, 1)^T$ and five other arbitrary ones but at the same time these vectors have to be linearly independent. After that apply Gram-Schmidt process which produces orthonormal vectors. Put these vectors to a matrix and you will get a unitary matrix with the first column equal to $\frac{1}{\sqrt{5}}(0, 1, 1, 1, 1, ...


5

I am going to assume that $|0\rangle$ is represented by , and $|1\rangle$ by . Then, represents the bit-flip, or NOT gate. What it does is: $|x\rangle\mapsto |x\oplus1\rangle$. This can be verified easily in the graphical calculus, using the "spider" rule: and Now, by definition, CNOT controls NOT: $|x_1,x_2\rangle\mapsto|x_1,x_1\oplus x_2\rangle$. In ...


-2

firstly write CNOT⊗𝐼2 matrix, then change the order of index2 and index3 with matlab. in this way, you can do any number of qubits.


2

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


1

If you are using the QFT inside a bigger circuit you really can't avoid the swaps in the QFT and/or the invQFT the reason being that the value of qubit x1 dictates the symmetry of the phases in your entire superposition. Pay attention at how the phases look like in the following images: I think your intuition in question 1 is correct but it will only work ...


Top 50 recent answers are included