# Tag Info

17

Specific Circuit The first gate is a Hadamard gate which is normally represented by $$\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}$$ Now, since we're only applying it to the first qubit, we use a kronecker product on it (this confused me so much when I was starting out - I had no idea how to scale gates; as you can imagine, it's rather ...

9

$$CNOT = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{bmatrix}$$But what does this matrix mean? The above matrix means: on a two qubit system (such as $\left|00\right>$, $\left|10\right>$, $\left|11\right>$, etc.) if the first qubit is a one,...

9

Your first option is the correct one, being related to $e^{-i\phi X\otimes X}$, which is $$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}.$$ The second option doesn't make a ...

8

From IBM Q Documentation (the link is hard to find) here is the definition of the generic gate: $$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}$$ ...

8


6

This is indeed a correct way to solve linear systems with dimension not equal to a power of 2. Solve the smallest possible system of dimension 2$^n$ that contains the system you want to solve, and pad the matrices and vectors with zeros to make it the right size. This is because the vector $|b\rangle$ in the HHL algorithm, is a quantum state, which means if ...

6

The insight that suggests that sparse matrices are useful goes along the lines of: for any $H$, we can decompose it in terms of a set of $H_i$ whose individual components all commute (making diagonalisation straightforward), $$H=\sum_{i=1}^mH_i.$$ If the matrix is sparse, then you shouldn't need too many distinct $H_i$. Then you can simulate the ...

6

This is actually a much easier problem. In the case of states, you're trying to use the PPT criterion, or others, to distinguish if $\rho$ can be written in the form $$\rho=\sum_ip_i\sigma^A_i\otimes\sigma^B_i,$$ where $\sum_ip_i=1$ and the $\sigma^A_i$ and $\sigma^B_i$ are valid states on single sites. The difficulty actually comes from the freedom that ...

6

The Hadamard gate has close ties to the discrete Fourier transform. Consider the DFT for an $N$-level system: $$\vert j \rangle = \frac{1}{\sqrt{N}} \sum\limits_{k=0}^{N-1} e^{\frac{i2 \pi j k}{N}} \vert k \rangle.$$ For $N=2$ this is simply $$\vert j \rangle = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1 \end{bmatrix} \, \vert k \rangle = H \... 5 Since your desired operation is a non-injective function, you need a third qubit and a unitary acting on all three qubits. Using an operator on your two input qubits and tensoring this with {\rm I}_2 on the third qubit is not going to work as you might as well forget about the third qubit completely if that were the case. By the way, the two matrices you ... 5 All quantum operators must be unitary. Unitary means the conjugate-transpose of the operator is its inverse. In your case: UU^{\dagger} = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 1 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & ... 5 Immediately, we can see that$$ A = |1\rangle\langle0| + |0\rangle\langle1|. $$If the input and out bases are \{|0\rangle, |1\rangle\}, then$$ |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix} \quad\textrm{and}\quad \langle0| = \begin{pmatrix} 1 & 0 \end{pmatrix}, \quad \langle1| = \begin{pmatrix}...

5

A matrix is positive if and only if it is Hermitian (and thus unitarily diagonalizable) and all its eigenvalues are positive (that they are real follows automatically from it being Hermitian). If this is not the way you define a positive operator, then you need to specify how you do so that we can prove the equivalence. In other words, $A$ is positive, $A\... 5 I like to use the projectors $$P_0=|0\rangle\langle 0|\equiv\left(\begin{array}{cc} 1 & 0 \\ 0 & 0 \end{array}\right)\qquad P_1=|1\rangle\langle 1|\equiv\left(\begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array}\right)$$ to express the intuition of the controlled-not when constructing it: $$CNOT=P_0\otimes\mathbb{I}+P_1\otimes X.$$ Here you can ... 5 That's not the right way to look at it. In quantum mechanics, time evolutions are considered to be unitary and any unitary evolution can be written as a sequence of unitary operators$U_1, U_2, U_3,\ldots$acting on a quantum state$|\Psi\rangle$. Any single-qubit unitary operation is a$2\times 2$matrix of the form: $$U=\begin{pmatrix}a&b\\-e^{i\phi}b^... 5 Yes, in the circuit the qubit "enters" to the left, and exits to the right, but when applying the gates to a state you must apply the one on the far left first, then the next and so on, so concretely you do write them down right to left, but it's just a consequence of writing the operator that we want to apply on the left of the vector, while our natural way ... 5 You specifically ask about qubits, so I'll keep it to that. Imagine you have a state$$ |\psi\rangle=\sum_{x\in\{0,1\}^n}a_x|x\rangle. $$You can choose to look at each qubit. I'll take the first qubit for the sake of simplicity. We have that$$ |\psi\rangle=|0\rangle\sum_{y\in\{0,1\}^{n-1}}a_{0y}|y\rangle+|1\rangle\sum_{y\in\{0,1\}^{n-1}}a_{1y}|y\rangle$$... 5 Consider that a control qubit is$q_k$and a target qubit is$q_{k+n}$and you want to apply operator$U$on the target qubit. Denote$N=2^{n+1}$. Then matrix representation of this controlled$U$is $$CU= \begin{pmatrix} I_{\frac{N}{2}} & O_{\frac{N}{2}} \\ O_{\frac{N}{2}} & I_{\frac{N}{4}} \otimes U \\ \end{pmatrix}$$ ... 5 Here, what you need to do is to understand writing CNOT gate based on the control qubit. Your first CNOT gate has qubit 1 as control and qubit 2 as target. So, what this means is the second qubit will not be flipped until qubit 1 is set to zero. I am going to use computational basis for this$CNOT_1\left|00\right> = \left|00\right>$,$CNOT_1\left|01\...

5

All tensor products of $n$ Pauli operators $\{I,X,Y,Z\}$ (that is $4^n$ combinations) form an orthogonal basis for the vector space of $2^n \times 2^n$ complex matrices. Hence, for every matrix there is a unique decomposition as a linear combination of tensor products of Pauli unitaries. Same is true if we fix some other unitary basis. If we not fix the ...

5

The overall matrix can be built from the knowledge of the matrices representing each element of the circuit (in your example, the Toffoli and single-qubit gates) by simple matrix multiplication. To obtain the matrix representation of a Toffoli gate acting between three qubits, a good way to start is by first writing down its bra-ket representation. This ...

4

Mostly I'm confused over whether the common convention is to use +i or -i along the anti-diagonal of the middle 2x2 block. The former. There are two $+i$'s along the anti-diagonal of the middle $2\times 2$ block of the iSWAP gate. See page 95 here[$\dagger$]. [$\dagger$]: Explorations in Computer Science (Quantum Gates) - Colin P. Williams

4

If instead of manipulating the quantum information in qubits, your quantum computer were to do operations on qu$d$its with $d$ being infinity, then you'd essentially be processing infinite matrices on a quantum computer. However most quantum computing hardware we have today, and even most of the experiments being done in academic labs, do operations on ...

4

You can use Python with Qiskit. Say your string representation is written using OpenQASM syntax. qasm = """ OPENQASM 2.0; include "qelib1.inc"; qreg q[2]; h q[0]; t q[1]; cx q[0], q[1]; """ You can build a circuit out of this and simulate it on a unitary simulator: import qiskit as qk import numpy as np circuit = qk.load_qasm_string(qasm) result = qk....

4

Consider the linear maps $A: V\to W$ and $B: W\to X$. The composition $BA$ is a linear map from $V$ to $X$. Now, how can $\mathcal{M}(BA)$ be computed from $\mathcal{M}(B)$ and $\mathcal{M}(A)$? $\mathcal{M}(A)$ is the $n\times p$ matrix representation of the linear map $A$ w.r.t the basis $\{v_1,...,v_p\}$ and $\{w_1,...,w_n\}$. $\mathcal{M}(B)$ is the $m\... 4 Since the quantum teleportation circuit has three qbits, the matrix at each step is 8x8 and thus has 64 elements; this is pretty clunky to type out in its entirety, so I'll just walk you through step by step and you can derive the full matrix for a specific step if you want. Given a qbit we want to teleport:$|\psi\rangle = \begin{bmatrix} \alpha \\ \beta \...

4

The main criteria that you need, in order to multiply by a matrix on a quantum computer (in the sense of permuting the states, not in the sense of adjusting the amplitudes) is for the matrix to have an inverse. You can find this inverse by performing Guassian elimination. Performing the Guassian elimination spits out exactly the operations you will need to ...

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