Questions tagged [matrix-representation]

For questions about matrix representations of quantum gates.

Filter by
Sorted by
Tagged with
1 vote
1 answer
53 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 ...
user avatar
  • 1,223
1 vote
1 answer
28 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 ...
user avatar
  • 406
1 vote
1 answer
70 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 ...
user avatar
1 vote
1 answer
40 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).(...
user avatar
4 votes
3 answers
189 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 ...
user avatar
3 votes
1 answer
72 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: ...
user avatar
1 vote
0 answers
17 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 ...
user avatar
2 votes
0 answers
18 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 ...
user avatar
  • 31
0 votes
1 answer
42 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 ...
user avatar
3 votes
2 answers
81 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. ...
user avatar
  • 637
2 votes
2 answers
76 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 ...
user avatar
  • 637
1 vote
0 answers
26 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&...
user avatar
  • 21
2 votes
2 answers
51 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} $...
user avatar
  • 143
1 vote
1 answer
94 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_{...
user avatar
  • 143
-4 votes
1 answer
47 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 ...
user avatar
  • 1
1 vote
1 answer
70 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 ...
user avatar
  • 21
1 vote
1 answer
131 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: ...
user avatar
  • 406
1 vote
0 answers
55 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 ...
user avatar
  • 71
3 votes
1 answer
103 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 ...
user avatar
0 votes
1 answer
148 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 <...
user avatar
  • 147
0 votes
1 answer
67 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 "...
user avatar
2 votes
1 answer
53 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, ...
user avatar
1 vote
2 answers
248 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 + ...
user avatar
6 votes
1 answer
239 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?
user avatar
2 votes
2 answers
291 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 ...
user avatar
1 vote
1 answer
36 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 ...
user avatar
2 votes
1 answer
80 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: ...
user avatar
  • 119
1 vote
0 answers
77 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 ...
user avatar
  • 2,576
0 votes
1 answer
196 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?
user avatar
0 votes
2 answers
140 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 ...
user avatar
  • 173
6 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}&...
user avatar
  • 421
3 votes
2 answers
88 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 ...
user avatar
2 votes
1 answer
118 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 ...
user avatar
3 votes
1 answer
131 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(\...
user avatar
  • 2,148
2 votes
1 answer
298 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=...
user avatar
  • 2,148
11 votes
2 answers
640 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 ...
user avatar
2 votes
0 answers
72 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 ...
user avatar
4 votes
2 answers
120 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 &...
user avatar
4 votes
1 answer
132 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, ...
user avatar
  • 4,507
3 votes
1 answer
222 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 ...
user avatar
  • 4,507
2 votes
1 answer
48 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....
user avatar
9 votes
2 answers
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 = ¬...
user avatar
3 votes
1 answer
87 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 &...
user avatar
  • 139
3 votes
2 answers
130 views

How do you represent one-qubit rotations in two registers as a $4\times 4$ 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-...
user avatar
  • 1,626
3 votes
1 answer
241 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^...
user avatar
5 votes
1 answer
321 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 ...
user avatar
  • 164
1 vote
1 answer
113 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 ...
user avatar
  • 31
3 votes
0 answers
67 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 ...
user avatar
  • 31
7 votes
3 answers
141 views

Decomposing gates resembling exponentiated members of desired gateset

Suppose I have access to a pretty typical gate set, for example $\{\text{CNOT}, \text{SWAP}, \text{R}_{x}, \text{R}_{y}, \text{R}_{z}, \text{CR}_x, \text{CR}_y, \text{CR}_z\}$ where $\text{CR}$ is a ...
user avatar
  • 4,507
2 votes
1 answer
317 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 ...
user avatar
  • 31