Questions tagged [matrix-representation]

For questions about matrix representations of quantum gates.

Filter by
Sorted by
Tagged with
1
vote
1answer
44 views

Hadamard gate for three qubits; inconsistency between IBM and Matlab

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 ...
0
votes
1answer
46 views

How to implement quantum gate from matrix in Q#

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.
1
vote
1answer
26 views

What is the matrix for measuring a superposition of general number of qubits in standard basis?

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? ...
1
vote
1answer
34 views

How to make Toffoli gate using matrix form in multi qubits system?

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 ...
1
vote
1answer
88 views

How does the graphical notation used to denote doubly-controlled gates work?

$\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 ...
-1
votes
2answers
95 views

Nielsen and Chuang: Demonstration of equation 2.12

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 $...
1
vote
0answers
44 views

Step-by-step passages in calculation

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)(...
1
vote
2answers
143 views

How to find the matrix representation of an operator from its action on a basis?

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 ...
5
votes
2answers
116 views

Representation of rotation operators $e^{-i\theta(I-Z_1\otimes Z_2 \otimes Z_3)}$ about arbitrary axis for $3$ qubits

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 ...
3
votes
3answers
176 views

How to spot the matrix representation of the quantum NOT operation

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&...
3
votes
3answers
72 views

Show that a $CZ$ gate can be implemented using a $CNOT$ gate and Hadamard gates

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 ...
1
vote
3answers
111 views

Deriving a controlled Kraus operator from an uncontrolled Kraus operator

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 ...
0
votes
1answer
92 views

Expressing a term of an $n$-qubit Hamiltonian in terms of Pauli operators

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 ...
0
votes
1answer
84 views

Nielsen & Chuang Exercise 4.34 “Measuring an operator”

I need help with the exercise 4.34 from Nielsen & Chuang Book. I am supposed to get a matrix corresponding to the circuit. Thanks
2
votes
1answer
77 views

Generic matrix exponential in Q#

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 ...
0
votes
1answer
58 views

Find the decomposition of the following matrix into two level unitary matrices [duplicate]

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\\ ...
2
votes
1answer
83 views

Matrix definition of the Ising XX gate

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 &...
1
vote
1answer
45 views

Show how the Bell state arises from the circuit with Hadamard and CNOT, using matrix notation

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 ...
1
vote
1answer
83 views

Trying to use matrices for Hadamard and Controlled Not gates

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&...
2
votes
1answer
60 views

2 qubit gate operation on multi qubit systems

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?
6
votes
2answers
173 views

How to represent an $n$-qubit circuit in matrix form?

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 ...
1
vote
1answer
134 views

What is the general matrix for the Swap gate?

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) & ...
2
votes
1answer
246 views

Non-unitary matrix decomposition as a sum of unitary matrices

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 ...
1
vote
1answer
81 views

Syndrome extraction operator as matrix?

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]...
4
votes
3answers
244 views

Representing qubit swap using linear algebra

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{...
4
votes
3answers
130 views

How do I write the matrix for a CZ gate operating on nonadjacent qubits?

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 ...
2
votes
1answer
72 views

How do I apply a controlled gate to specific qbits in the register?

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
votes
1answer
57 views

Controlled phase shift gate

How does a controlled R gate look like (matrixwise)? And how to generate CCR, CCCR and so on?
5
votes
2answers
86 views

How to efficiently calculate the inverse of a Kronecker product?

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 qbits $$\begin{bmatrix}0 \\ 1 \\ 0 \...
3
votes
2answers
83 views

What is the matrix representation for $n$-qubit gates?

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{...
7
votes
2answers
1k views

Can arbitrary matrices be decomposed using the Pauli basis? [duplicate]

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 ...
7
votes
2answers
415 views

Could the Hadamard gate have been constructed differently with similar characteristics?

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&...
3
votes
1answer
58 views

Can I find the states of individual qubits in a quantum register using only linear algebra?

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 ...
2
votes
1answer
40 views

Why is $Z_1Z_2$ spanned by this set ? Surely it's too small?

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 ...
2
votes
2answers
191 views

Trace preserving condition in Choi's thorem

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 \...
5
votes
1answer
144 views

A basic question on circuits and matrix representation

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 ...
1
vote
3answers
558 views

Controlled Z gate acting on 3 qubits in matrix form

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 ...
5
votes
1answer
96 views

Equivalent determinant condition for Peres-Horodecki criteria

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 (...
2
votes
2answers
131 views

How do I write a tensor product of conditional gates in matrix form?

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 ...
4
votes
1answer
168 views

What applications does the quantum gate [(i,1),(1,i)] have?

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 ...
2
votes
1answer
279 views

Matrix representation of multiple qubit gates (Hadamard transform on single wire)

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=\...
3
votes
1answer
123 views

How to interpret the matrix representation of a quantum gate?

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 ...
3
votes
2answers
567 views

Square root of CNOT and spectral decomposition of the Hadamard gate

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 ...
1
vote
1answer
72 views

Error in showing $\operatorname{CPHASE}_{12}=\operatorname{CPHASE}_{21}$ in the matrix representation

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 ...
2
votes
1answer
394 views

Quantum addition and modulo operation using gates

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\}...
0
votes
0answers
34 views

How are multi-qubit gates extended into larger registers? [duplicate]

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 ...
4
votes
1answer
126 views

Differentiate between local and global unitaries

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 ...
6
votes
1answer
189 views

Is quantum computer equivalent to Turing machine with matrix multiplication oracle?

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 ...
2
votes
0answers
53 views

Nielsen & Chuang Exercise 2.2 - Matrix representations in different input and output basis [duplicate]

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 $...
10
votes
3answers
3k views

How to construct matrix of regular and “flipped” 2-qubit CNOT?

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 ...