Questions tagged [matrix-representation]

For questions about matrix representations of quantum gates.

Filter by
Sorted by
Tagged with
2 votes
1 answer
54 views

Writing a Density matrix in terms of the magnitude of the Bloch Vector

Working with the density matrix and the Bloch sphere, I have been attempting to complete an exercise in Entangled Systems; New Directions in Quantum Physics. If anyone has the book it is Question 4.3 ...
  • 313
2 votes
1 answer
84 views

What is the tensor product expression for the following quantum circuit? [duplicate]

Qiskit generates the following matrix for this 3-qubit CNOT circuit. Can anyone explain how do we get this mathematically ? This is the Quantum Circuit This is the Output of Unitary Simulator
1 vote
2 answers
52 views

What are the Pauli-Y eigenvectors?

The question should be pretty simple, but it turns out that there's more to it with respect to what I initially expected. Starting from the definition of the gate $Y = \begin{bmatrix} 0 & -i \\ i &...
  • 476
0 votes
1 answer
43 views

How to get the Dirac representation of a general quantum gate?

writing a matrix from bra-ket notations is easier. Going back is like finding prime factors. How to get the bra-ket form of all basic quantum gates in their matrix form in general?
  • 1
3 votes
1 answer
55 views

Qiskit: Is there an efficient way to convert custom operator (matrix) to circuits/gates and vice versa?

I'm using qiskit and would like to convert easily between matrix operators and their corresponding circuits. I have 2 types of operators: Permutation matrices (binary entries only) which must be ...
  • 159
0 votes
0 answers
40 views

Commutative operators

I have got a 2-qubit circuit with the following instructions: ...
0 votes
1 answer
44 views

Are the SDG and TDG gates hermitian?

I know that phase shift gates like $S$ and $T$ are not hermitian operators. But are the $S^\dagger$ and $T^\dagger$ gates non-hermitian too?
2 votes
1 answer
155 views

How to implement subplots (several blochsphere plots) using qiskit?

Qiskit seems to use matplotlib for rendering bloch spheres under the hood. Therefore, it would be nice if we could also make use of matplotlib's subplot technique. I would like to implement subplots, ...
2 votes
1 answer
61 views

How to convert between little/big-endian unitary forms in Braket?

As noted in this post, the Amazon Braket unitary calculation method as_unitary has been deprecated (#325) as it uses little-endian qubit order. The new, big-endian method is to_unitary. Here's a code ...
  • 1,928
3 votes
0 answers
36 views

How is this Variational Quantum Singular Value Decomposition paper efficient in any way?

Link to paper here. This algorithm seems neat but the unitary decomposition of the matrix M generally takes an exponential number of Pauli basis elements in the number of qubits $N$, therefore an ...
  • 51
1 vote
1 answer
58 views

math behind rotation gate

$R_Z(\theta) = e^{-i\frac{\theta}{2}Z}$ and $R_{ZX}(\theta) = e^{-i\frac{\theta}{2}XZ}$ My question is, why is the rotation gate defined in an exponential format? Where does the $\frac{1}{2}$ come ...
  • 1,283
2 votes
1 answer
47 views

From Hamiltonian to the Pulse Sequence

I know my Hamiltonian: I know which unitary I want to have. Suppose that I want to have this matrix from Hamiltonian: How can I find the pulse sequence to have this matrix from the Hamiltonian? What ...
  • 446
1 vote
1 answer
75 views

Why Qiskit doesn't invert hard coded unitary matrix?

I was expecting Qiskit to do a upside down version of my unitary as it does for other unitary matrices of CNOT and Toffoli gates given in textbooks : if you convert a toffoli matrix from quantum ...
1 vote
1 answer
48 views

Manually calculating quantum circuit with custom gate

I am trying to calculate the state of this Quirk circuit by hand: where U is a custom gate with 2x2 matrix: From what I've read, I should be able to calculate the resultant amplitudes as: (U⊗I⊗I).(...
4 votes
3 answers
460 views

How to represent the Hadamard gate as a rotations on the Bloch sphere?

I am new to Quantum Computing, and I have decided to try and learn the quantum gates. I am trying to understand how to represent some basic gates as rotations on the Bloch Sphere. I was able to ...
3 votes
1 answer
81 views

How does one derive quantum gates from a custom gate systematically?

I have been trying to solve a puzzle (not homework) in which I need to derive a quantum circuit from given a superposition, $|\psi\rangle$, where $$ |00\rangle: 20\%\\ |10\rangle: 40\%\\ |11\rangle: ...
1 vote
0 answers
22 views

Question about performing VQE with an embedded Hamiltonian

Say I have a physical Hamiltonian $\mathcal{H}$ which is $D$-dimensional and I encode it into a larger matrix $M$ which is $\Delta$-dimensional. In the cases I care about $\Delta$ is strictly greater ...
2 votes
0 answers
25 views

How to simulate these Floquet and Rotation operators for kicked top model?

In this and other papers relating to the kicked top model, it is mentioned that spin coherent states can be expressed as: $$\left|\theta,\phi\right>=R(\theta,\phi)\left|j,j\right>$$ for given ...
  • 41
0 votes
1 answer
69 views

Matrix representation of multi-qubit operations when there's irrelevant qubit(s)

Suppose there are three qubits, q0, q1, and q2, if you perform a CX on q0 and q1, the entire matrix of the operation you performed on the whole quantum circuit will simply be the tensor product of CX ...
3 votes
2 answers
114 views

Projection and expected value in Qiskit?

I want to make a circuit that measures the expected value of a projector. In this case I want to measure the expected value of the singlet projector operator, that is a non-unitary hermitian matrix. ...
  • 665
2 votes
2 answers
263 views

How to implement a exponential of a hamiltonian, but non-unitary, matrix in QISKIT?

I need a way to implement exponential of a matrix so that I can create a gate that is analogous to rotation using that matrix, similar to how rotation in the $x$ axis uses the Pauli-$X$ gate. This is ...
  • 665
1 vote
0 answers
31 views

Can a Hankel matrix $H$ be efficiently decomposed into a linear combination of unitaries (LCU), so that $H=\sum_k a_k U_k$

Suppose I have a Hankel matrix of arbitrary size $N\times M=2^n\times 2^m$ for integers $n<m$ (the qubit numbers of two circuits I have at my possession), given by: $H=\begin{pmatrix}x_1&x_2&...
  • 51
2 votes
2 answers
77 views

How to prove that the trace of n-qubit matrices satisfies ${\rm Tr}(XY)=2^n\sum_{M\in\{I,X,Y,Z\}^n} x_M y_M$?

It is known that for n-qubit matrices X, Y $\in \mathbb{C}^{2^{n}\times 2^{n}}$ (and Pauli matrices $I, X, Y, Z$) such that $$ X = \sum_{M \in \{I, X, Y, Z\}^{n}} x_{M}M_{1}\otimes ... \otimes M_{n} $...
  • 153
1 vote
1 answer
124 views

How to express $n$-qubit Hermitian operator with Pauli matrices

How can we prove that all $n$-qubit Hermitian matrices can be written in terms of Pauli matrices $I$, $X$, $Y$, and $Z$ as $$ \sum_{W_k \in \{I, X, Y, Z\}} a_{W_1,\dots,W_n}W_{1}\otimes ... \otimes W_{...
  • 153
-4 votes
1 answer
52 views

Quantum Linear Algebra [closed]

[![Question][1]][1] Find a 4 x 4 unitary matrix U such that U = eiA. (Possibly up to multiplying by a unit scalar, U is a matrix seen in the course.) Verify your calculation by showing how if U were ...
  • 1
2 votes
1 answer
116 views

Encoding a block unitary matrix in a quantum circuit

My goal would be to implement the unitary matrix $M=\begin{bmatrix}U_{1} &0\\0&U_{0}\end{bmatrix}$ as a circuit for arbitrary $N \mathrm{x} N$ unitary matrices. It is trivial to show that if ...
  • 31
1 vote
1 answer
177 views

Writing Toffoli Gate Matrix by one and two qubit gate matrices

I am trying to write Toffoli gate matrice by using one and two qubit gates matrices. I follow this circuit link for the circuit I first started to write the matrices of one and two qubit gates: ...
  • 446
2 votes
0 answers
57 views

Calculate Outputs of a Teleportation Circuit

In this question, I assume we use matrix representation to calculate what each output could be? For example, for the middle qubit in state: $$|00\rangle$$ After the first Hadamard and CNOT gate (so ...
  • 101
4 votes
1 answer
147 views

Random quantum states and Schur-Weyl duality

Consider the following density matrix over $n$ qubits, with $C$ being a single qubit operator: $$ \rho_{n} = \int_{C \sim \text{Haar}} \big(C|0\rangle\langle0|C^\dagger\big)^{\otimes n} dC. $$ Let's ...
0 votes
1 answer
244 views

Calculating measurement probabilities from a quantum circuit

Currently I'm trying to calculate the circuits I'm building and show that they work as intended. Somehow, my measurments do not, at all, represent my calculated expectancies. This is my circuit in <...
  • 147
0 votes
1 answer
99 views

Understanding Constant Multiplication Circuit for Binary Field - How to Construct Quantum Circuit from Linear Mapping

I was thinking to ask this on Math Stackexchange, but maybe here would be better since I also hope the answers also explain from quantum computation context. Problem So I was reading the paper "...
3 votes
1 answer
69 views

Why can the Hamiltonian $H=P_x(t)X+P_y(t)Y$ make an arbitrary unitary $U=R_x(b)R_y(c)R_x(d)$?

p.281 of Nielsen and Chuang's book says that A single spin might evolve under the Hamiltonian $H = P_x(t)X + P_y(t)Y$, where $P_{\{xy\}}$ are classically controllable parameters. From Exercise 4.10, ...
1 vote
2 answers
276 views

How to analyze the following quantum circuit?

I'm trying to analyze the following quantum circuit The goal here is to analyze the final outputs at q3 & q4. For inputs, at q0 & q1, one of the Bell state $$|\psi\rangle = \frac{|01\rangle + ...
9 votes
1 answer
356 views

What is the set of generators for the qutrit Clifford group?

According to this article, any Clifford gate, acting on $n$ qubits, can be generated by Hadamard, CNOT, and S gates. What are the set of generators for qutrit Cliffords?
2 votes
2 answers
497 views

How is outer product an operator?

I was going through Qiskit online text book and came across this part. The relevant (slightly modified) paragraph is - Suppose we have two states $|\psi_0\rangle$ and $|\psi_2\rangle$. Their inner ...
1 vote
1 answer
42 views

Vector math of applying an X-gate on an $|i\rangle$ basis state

It is well known that the X-gate will apply a rotation about the x-axis on the bloch sphere. Knowing this, the $|i\rangle$ state should be converted to the $|-i\rangle$ state on the application of ...
3 votes
2 answers
122 views

How to get the matrix representation of a circuit in Amazon braket?

Say I define a circuit using the amazon-braket-sdk, for example: ...
  • 143
1 vote
0 answers
96 views

Matrix for $U^{2^j}$ from Shor's algorithm for any $a$ and $N$

I'm implementing Shor's algorithm from scratch and therefore want to implement a unitary gate $U$ such that $U^{2^j}|y\rangle = |a^{2^j}y \: \text{mod} \: N\rangle$. I know that an efficient way of ...
  • 2,655
0 votes
1 answer
363 views

How to represent a CNOT gate operating on three-qubit states as a matrix? [duplicate]

I am wondering how to represent these kinds of circuits as a matrix. Is there any formula for doing this?
0 votes
2 answers
183 views

How do I apply a matrix to a ket state?

If we have the following matrix: $$\frac{1}{\sqrt{2}}\begin{pmatrix}1&1&0&0\\ 1&-1&0&0\\ 0&0&1&-1\\ 0&0&1&1\end{pmatrix}$$ How do we find the output for ...
  • 173
7 votes
2 answers
3k views

What is the square root of the NOT gate? [duplicate]

I have encountered different matrix of operator "the Square Root of NOT gate". For example, the matrix is specified here: $\sqrt {NOT} = \frac{1}{2}\left( {\begin{array}{*{20}{c}} {1 + i}&...
  • 441
3 votes
2 answers
118 views

Method to derive Matrix description of a circuit [duplicate]

This question is about finding a matrix description of a specific circuit. I am learning quantum computing through edX's Quantum Information Science lecture series. The question below is the one I am ...
2 votes
1 answer
234 views

How would I apply rotations to both qubits in a 2 qubit system?

Say I have the two qubit system $\frac{1}{\sqrt{2}}\begin{bmatrix} 0 \\ 1 \\ 1 \\ 0 \end{bmatrix}$. I have two 2x2 unitary gates, one is a rotation ...
3 votes
1 answer
167 views

How does a general rotation $R_\hat{n}(\theta)$ related to $U_3$ gate?

From eqn. $(4.8)$ in Nielsen and Chuang, a general rotation by $\theta$ about the $\hat n$ axis is given by $$ R_\hat{n}(\theta)\equiv \exp(-i\theta\hat n\cdot\vec\sigma/2) = \cos(\theta/2)I-i\sin(\...
  • 2,238
2 votes
1 answer
490 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=...
  • 2,238
11 votes
2 answers
733 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
0 answers
75 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
2 answers
141 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
1 answer
152 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, ...
  • 5,067
3 votes
1 answer
293 views

Can we understand multi-qubit gates in terms of rotation groups?

I'm trying to reconcile (i) the statement that swapping two subsystems constitutes a rotation by $2\pi$ and (ii) the angle that is implied by the Hermitian generator of a SWAP gate. I haven't tracked ...
  • 5,067