Questions tagged [matrix-representation]

For questions about matrix representations of quantum gates.

Filter by
Sorted by
Tagged with
0
votes
1answer
58 views

Quick question about Two-qubit SWAP gate from the Exchange interaction

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

What is the effect of the reset gate on the matrix form of a gate/circuit?

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 ...
1
vote
2answers
57 views

How to find original matrix from eigenbasis and eigenvalues?

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

Difference between change of basis in bra-ket notation and matrix notation

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

Creating a custom gate (given by a matrix) more efficiently

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

How to force a matrix to be unitary given constraints on some of the elements? [duplicate]

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\\ ...
1
vote
2answers
49 views

How does a $d\times\ell$ matrix of rank $\ell$ and with singular values all equal to 1 imply it is maximally entangled

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

How are the Pauli $X$ and $Z$ matrices expressed in bra-ket notation? [duplicate]

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|=\...
1
vote
3answers
60 views

How do I apply a Hadamard gate on a given qubit, in matrix formalism?

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

Information about two algorithms of Matrix product state

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 ...
1
vote
1answer
55 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
55 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
27 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
46 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
95 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
100 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
149 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
145 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
183 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
117 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
125 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
187 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
113 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
79 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
63 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
103 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
59 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
116 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
68 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
246 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
178 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) & ...
3
votes
1answer
301 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 ...
2
votes
1answer
88 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
288 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
152 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
77 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
71 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
96 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
98 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{...
8
votes
2answers
2k 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
428 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
60 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
41 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
208 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
183 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
615 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
115 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
148 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
178 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 ...