Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

2 votes
Accepted

Better constant for linear depth incrementers

"Lower bounds on the non-Clifford resources for quantum computations " proves that producing an $n$-qubit $C^nZ$ state requires consuming $n \pm O(1)$ CCZ states (a CCZ state is a magic ...
Craig Gidney's user avatar
  • 37.8k
0 votes

Better constant for linear depth incrementers

The following circuit has depth less than $16n$ for $n < 100$ where $\text{QFT}$ is the Quantum Fourier transform and $P$ is the phase gate $$P(\lambda) = \begin{pmatrix} ...
Egretta.Thula's user avatar
3 votes

Definition of a quantum gate

Sometimes people mean unitary-only. Sometimes they mean generically anything you might do to the qubits (like a measurement gate or a reset gate or a dynamical decoupling gate or a leakage removal ...
Craig Gidney's user avatar
  • 37.8k
1 vote

How to convert states |0011⟩, |1100⟩, |0101⟩ to |1111⟩?

Unitary quantum circuits are reversible. For a computational operation to be logically reversible, its output can be computed from the input, and vice versa. In your case if the output is $|1111\...
Egretta.Thula's user avatar
3 votes

general way to decompose a CZ gate on $n$-qubit system

You can meet in the middle, use CXSWAPs instead of full swaps, and pipeline the CXSWAPs, to reduce the depth from $6n \pm O(1)$ to $n \pm O(1)$.
Craig Gidney's user avatar
  • 37.8k
1 vote

How to apply gates on a subspace of a superposition of qubits?

Assume that, $$U = \left( {\begin{array}{*{20}{c}} u_{00}&u_{01} \\ u_{10}&u_{11} \end{array}} \right)$$ Then, you want to apply the two-level unitary $$\left( {\begin{array}{*{20}{c}} 1&0&...
Egretta.Thula's user avatar
0 votes

How to understand the matrix representation of the Toffoli produced by qiskit?

This is because Qiskit uses tensor ordering convention different from what is used in most quantum computing textbooks. According to a recent preprint from Qiskit team: When interpreting circuits, a ...
Egretta.Thula's user avatar
1 vote
Accepted

Moving pauli product rotations past measurements

Let $\sigma$ and $\tau$ be two tensor products of Paulis. Imagine you have a gate sequence $$ e^{i\theta\tau}\sqrt{\sigma}, $$ then you can always rewrite this as $$ e^{i\theta\tau}=\sqrt{\sigma}e^{i\...
DaftWullie's user avatar
  • 58.8k
4 votes

Constructing a block unitary from non-unitary matrices

For Rep. 1 you can use a Linear Combination of Unitaries (LCU) for block encoding each of your projections, and then use a control statement according to the the $s_i$ variable. If we designate the ...
tomergf's user avatar
  • 41
2 votes

Understanding Quantum Adder Circuits Logic

2 very different methods for implementing adder are with QFT and with ripple carry adder. You will prefer to choose which one according to your HW and your constraints. To see that, you can go to ...
Ron Cohen's user avatar
  • 1,432
2 votes
Accepted

Alternative gate sets for universal Clifford computation?

You can choose $CZ$ and/or $CNOT$ gate. You can choose $\sqrt{X}$ and/or $S$. Any extension of a generator set is also a generator. You may find useful to introduce the Pauli operators $X, Y, Z$.
Daniele Cuomo's user avatar
1 vote

How to mathematically describe the action of CNOT on the control qubit alone?

In the ZX calculus, the CNOT gate factors into a Z type node for the control linked to an X type node for the target. The Z type node (the "control part of the operation") has three ports: $...
Craig Gidney's user avatar
  • 37.8k
0 votes

How to mathematically describe the action of CNOT on the control qubit alone?

This depends on the question if you are allowing to use the information about the initial state of qubit 2. I am pointing this out because the information about qubit 2 is no longer contained in the ...
qubitzer's user avatar
  • 197
2 votes

How to calculate eigenvalues by phase estimation?

Quantum Principal Component Analysis uses what the authors call a quantum phase algorithm. This refers to the HHL algorithm, not quantum phase estimation which requires a copy of an eigenvector to ...
Benjamin Rodrigues de Miranda's user avatar
4 votes

How to mathematically describe the action of CNOT on the control qubit alone?

The action $\mathcal{E}$ of CNOT on just the control qubit is the composition of two functions: the action \begin{align} \mathcal{C}(\rho)=\text{CNOT}\,\rho\,\text{CNOT}\tag1 \end{align} of CNOT on ...
Adam Zalcman's user avatar
  • 22.9k
3 votes
Accepted

Relation between Rz gate and Phase gate

The $RZ(\theta)$ gate is defined by: $$RZ(\theta)=\begin{pmatrix}\mathrm{e}^{-\mathrm{i}\frac\theta2}&0\\0&\mathrm{e}^{\mathrm{i}\frac\theta2}\end{pmatrix}=\mathrm{e}^{-\mathrm{i}\frac\theta2}\...
Tristan Nemoz's user avatar
  • 6,462
1 vote

Easiest hash function to implement on Qiskit

I wrote an example hash function in the documentation of the qlasskit library; the result is directly exportable to qiskit, so it may be the answer for your question: https://dakk.github.io/qlasskit/...
Davide Gessa's user avatar
1 vote

How can I implement an n-bit Toffoli gate?

You can use MCXGate: def toffoli_general(qr, control, target): qr.append(MCXGate(num_ctrl_qubits=len(control)), control + [target]) With for example ...
antomax33's user avatar
1 vote

What's the result of applying a CNOT gate followed by a Hadamard?

Your calculations are correct. Make the following three observations: $|\psi\rangle=|{++}\rangle$, $X|+\rangle=|+\rangle$, so $\text{CNOT}|{++}\rangle=|{++}\rangle$, $H|{+}\rangle=|0\rangle$. ...
Adam Zalcman's user avatar
  • 22.9k
1 vote

What's the result of applying a CNOT gate followed by a Hadamard?

Your formuals are correct 💯 It is also makes sense as if you would apply the reverse order on the output, you will get the input mentioned
Ron Cohen's user avatar
  • 1,432
2 votes

Finding the effect of conjugate transpose on a state $|b\rangle$

For a unitary $U$, the conjugate transpose $U^\dagger$ is the inverse of $U$, i.e. the linear operator such that$^1$ $U^\dagger U=UU^\dagger=I$. Guess and check The inverse is unique$^2$, so a general ...
Adam Zalcman's user avatar
  • 22.9k
1 vote

Universality of adding gate to Cliffords without inverses

Note that there are non-Clifford gates with no inverse. For example: measurement in a non-Pauli basis. Consider $M_{X+Y}$, which measures if a single qubit state is in the positive or negative ...
Craig Gidney's user avatar
  • 37.8k
1 vote

Fault Tolerance of 2-transversal gates

I think you are right that such a 2-local gate would be fault tolerant with "fault-tolerant distance 3" as you say. I think the reason that you don't see this idea around is that it is more ...
Ian Gershon Teixeira's user avatar
1 vote
Accepted

Universality of adding gate to Cliffords without inverses

TL;DR: Yes, in a finite dimensional Hilbert space, $G^{-1}$ can be approximated to arbitrary accuracy as a finite power of $G$. If $G$ has finite order $r$, this follows from $G^{-1}=G^{r-1}$. The ...
Adam Zalcman's user avatar
  • 22.9k
2 votes
Accepted

How is the controlled-n NOT gate represented in Qiskit?

For multi-controlled X gate, use Qiskit's class MCXGate which can be added to your circuit as follows: circ.mcx(range(7), 7)
Egretta.Thula's user avatar
2 votes
Accepted

IBM quantum computer backend cycle time and real gate duration

The integers in the InstructionDurations() are the multipliers of the real-system timestep dt. So for example, consider the ...
Shravan Patel's user avatar
5 votes

Is there a strategy for a single-shot identification of a Pauli gate?

Prepare a Bell pair $|00\rangle + |11\rangle$. Apply the gate to one of its qubits (either one; doesn't matter). Do a Bell basis measurement. The four possible measurement results are the four ...
Craig Gidney's user avatar
  • 37.8k
2 votes

Is there a strategy for a single-shot identification of a Pauli gate?

Deterministically, no you cannot. Specifically, not with a strategy that looks like: prepare some single-qubit input $\rho$, apply the gate $U$ to it, and then measure with some POVM. Given any input $...
glS's user avatar
  • 25.4k
1 vote

Can we somehow relate quantum volume with the total number of gates present in a circuit which the machine can succesfully run without large errors

Quantum volume is a metric designed to quantify the performance and capabilities of a quantum computer. It encompasses various factors like gate fidelity, connectivity, coherence time, and others to ...
Shravan Patel's user avatar

Top 50 recent answers are included