Questions tagged [matrix-representation]

For questions about matrix representations of quantum gates.

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

Is there a different way to represent Pauli gates in X basis?

It's easy to see that in computational basis, Pauli matrices could be represented in the outer product form: $$ X=|0\rangle\langle1|+|1\rangle\langle0|\\ Y=-i|0\rangle\langle1|+i|1\rangle\langle0|\\ Z=...
0
votes
0answers
16 views

Compiling Quantum Circuits using the Palindrome Transform

This paper shows a way to produce optimal circuits. I haver verified most of them and they are correct except this procedure: procedure ProduceArray(n) I cannot ...
8
votes
2answers
476 views

How to check if a quantum circuit can be constructed for a given matrix representation?

Let's say I have a matrix representation, e.g. $$ \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}. $$ How ...
2
votes
0answers
39 views

Representation of multiple qubit matrices in Dirac notation

Imagine one wants to represent the and function for any number of qubits in Dirac notation. The and gate flips the target qubit if all the control qubits are in state 1. This is its matrix ...
4
votes
2answers
58 views

Is the column vector of a uniformly sampled random unitary matrix a uniformly sampled random state vector?

I am wondering if a random unitary matrix taken from a Haar measure (as in, it is uniformly sampled at random) can yield a uniformly sampled random state vector. In section 3 of this paper it says &...
4
votes
1answer
80 views

Single-qubit rotations on a subspace within two-qubit unitary

I would like to implement the operation $$ U(a,b) = \exp\left(i \frac{a}{2} (XX + YY) + i \frac{b}{2} (XY - YX) \right) $$ ($a,b \in \mathbb{R}$) without using Baker-Campbell-Hausdorf expansion, ...
2
votes
1answer
33 views

Qiskit PauliWeightedOperator in the matrix representation?

Suppose we have a PauliWeightedOperator object from Qiskit. Is there any built-in method to convert it to the matrix representation in the computational basis? My search in the docs was not successful....
9
votes
2answers
2k views

Is there a name for the 3-qubit gate that does NOT NOT NOTHING?

It seems to me that the "disjunction gate" (aside: is that its proper name?) can be thought of as the combination of three gates, G1, G2, and G3, where G2 is the CCNOT gate, and $G1 = G3 = ¬...
3
votes
1answer
52 views

Mistake in using dirac notation when applying $X$ gate to vector

The X gate is given by $\big(\begin{smallmatrix} 0 & 1 \\ 1 & 0 \end{smallmatrix}\big)$ in the computational basis. In the Hadamard basis, the gate is $X_H = \big(\begin{smallmatrix} 1 &...
3
votes
2answers
70 views

How do you represent one-quibit rotations in two registers as its own 4x4 unitary matrix?

Let's say you have a circuit that performs a Z-rotation in the first register, and a Y-rotation in second register. How can we express this "moment" in terms of a 4x4 matrix, i.e. a two-...
3
votes
1answer
67 views

XY Hamiltonian in a 1D Heisenberg Chain

I've been trying to implement the 1D Heisenberg chain (i.e. the XXZ model) on Qiskit but have been having trouble. To recap, the Heisenberg hamiltonian is as follows: $$H_{XXZ} = \sum^{N}_{i = 1} [J(S^...
4
votes
1answer
124 views

What is the matrix for a SWAP operation on two qubits?

Say we want to swap qubits $a$, $b$ in the same register, where $a,b \in \left \{ 0, 1,\cdots, n-1 \right \}$. What would be the corresponding matrix. For those interested, I'm curious about this ...
1
vote
1answer
62 views

Get a sparse matrix of quantum circuit

Is there a way that can obtain sparse matrix of quantum circuit? I used to check my quantum circuit with quantum_info.Operator, but for large number of qubits, it ...
3
votes
0answers
29 views

D-WAVE QUBO Matrix Form

I am trying to write down this problem (friend/enemy graph) in a polynomial matrix form in order to understand quantum annealing better, but it seems like the problem should actually be split into ...
2
votes
1answer
87 views

How to get subspace of quantum circuit?

How can I get a subspace of a quantum circuit? More precisely, I'm dealing with quantum circuit with data qubits ('q') and ancilla qubits ('anc'), such as $(q_0,q_1,...,q_n,anc_0,..anc_m)$. After some ...
0
votes
1answer
89 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
59 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 ...
3
votes
2answers
62 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 ...
4
votes
1answer
91 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\...
3
votes
2answers
116 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
56 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\\ ...
2
votes
2answers
52 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 "...
3
votes
1answer
369 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
75 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
35 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
60 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
60 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
34 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
2answers
77 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
98 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
111 views

Nielsen and Chuang: Demonstration of equation 2.12 [duplicate]

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
46 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)(...
0
votes
2answers
165 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
176 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
190 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
216 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
142 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
288 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
131 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
85 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
64 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
149 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
75 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
170 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
72 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
311 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
217 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
352 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
96 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
338 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{...