Share Your Experience: Take the 2024 Developer Survey

# Tag Info

Accepted

### How to get QASM code from an Amazon Braket circuit in Python?

You can get OpenQASM output from Braket circuits by using the following code: ...
Accepted

### Can I postpone a Pauli gate $X$ over a conditioned measurement $Y$ or $X$?

A trick you can use in this situation is "control splitting". Replace "do X" with "do X if C; also do X if not C". Do this: Now you can advance each case individually. ...
• 37.5k
Accepted

### How to come up with Simon's Algorithm circuit for this 3 qubit system? (given truth table & s)

I'm not saying this is a good way of doing it, but if you're completely stumped, there is always a fallback: use a multi-controlled-not. For example, if you use controlled-controlled-controlled-not, ...
• 58.7k
Accepted

### Controlled NOT gate which flips target when at least one of the control qubits is |1>

Use De Morgan's law to turn intersection into union.
• 37.5k
Accepted

• 58.7k

### Can you decompose a 4-qubit Toffoli gate (CCCX) into basic gates without an ancillary state?

The seminal paper Barenco et al., Elementary gates for quantum computation is a great resource for decompositions of many quantum gates, including multi-control Toffoli gates, into elementary gates. (...
• 6,679
Accepted

### Where do I create my first circuit?

Google colab is one good option. You will need to install Qiskit module(s) at the beginning, then you are ready:
• 10.5k
Accepted

### How do we measure the probability of outcomes in a quantum computer if qubits collapse when measured?

Do we have to repeat the whole process of the circuit 1000 times? Yes, the idea of (many) quantum circuits is that they produce the desired output with some probability, and thus to ensure the success ...
• 25.3k

### How to read the result of this HHL algorithm circuit output?

One of your challenges is that you're only doing phase estimation over two qubits. Basically, this means you're trying to get a 2-bit approximation to the eigenvalues of $e^{i\pi A/2}$, i.e. ...
• 58.7k

### How to convert a simple matrix into circuit?

In qiskit, you can run the following code: ...
• 47

### How do I prove these gate identities?

For (a), and in accordance with the hint: With controls = 00, the target qubit is not operated on (because all the gates have their controls set to 0 and so they do not affect the target). With ...
Accepted

### Computing the evolution of expectation values of the Pauli observable

$\langle X\rangle=\text{Tr}(X\rho)$. So, if we update by a single qubit unitary, $\rho\mapsto U\rho U^\dagger$, we have that  \langle X\rangle\mapsto \text{Tr}(XU\rho U^\dagger)=\text{Tr}(U^\dagger ...
• 58.7k

### Quantum circuits, quantum Turing machine and universal quantum computer-comparing different models of quantum computations

A quantum computer (or quantum Turing machine or quantum circuit) cannot solve any problem that a classical computer could not, because one can simulate the other Initially in a comment I had ...
• 12.5k

### How to apply rotation about X and Z in stim?

See Gates supported by Stim in stim's doc/ directory. Stim only supports stabilizer gates, so it can't rotate by 2 radians around the Z axis like you are doing in your circuit. The closest would be ...
• 37.5k
Accepted

### How to interpret the circuit that measures stabilizers in the 5-qubit error correcting code

The circuit image from wikipedia is quite mangled, and I am not quite sure if correct. Here is a nicely laid out syndrome measurement circuit for the $[[5,1,3]]$ code. Here, the top five qubits are ...
• 1,803
Accepted

### Is the full quantum circuit always in a pure state?

Yes. If you prepare a state, say $|0\rangle ^{\otimes n}$ (or any pure state in general) and only perform quantum gates (which are unitary operations) and qubits are perfectly isolated (there are no ...
• 2,401
Accepted

### Equivalence of circuits in measurement-based QC

In step 2, you are doing two measurements, $X$ on qubit 1 and $X$ on qubit 2. To move to step 3, you need to bring these measurements earlier in the circuit, which means updating what they look like ...
• 58.7k

### Can any matrix be translated into a quantum circuit?

Not all matrices are allowed in the conventional quantum circuit model. That is, quantum circuits composed of gates correspond to unitary matrices that preserve distances, e.g., matrices $U$ such ...
• 12.5k
Accepted

### Understanding how to solve group isomorphism given the state $\sum_{\pi \in S_n} |\pi(G) \rangle$

There are several pretty standard approaches to "solving" graph isomorphism given access to uniform superpositions over all the permutations of particular graphs (untensored with garbage). ...
• 12.5k
Accepted

• 14.5k

### Where do I create my first circuit?

Once you have the .qasm, you can also upload it to the Classiq platform https://platform.classiq.io/circuit, and then run it on a simulator. To create your .qasm file (qiskit version 1.1) you will ...

### Is there a clear, understandable example of Quantum Circuit Cutting I can use to understand the process?

Circuit Knitting Toolbox is a Qiskit extension for entanglement forging, circuit cutting, and classical embedding. One of its modules is cutqc which implements the ...
• 10.5k

### Avoiding garbage amplitudes in block-encoding

If I understand your question correctly, you're right, there always will be 'garbage' after you act with a block-encoded matrix. Equivalently, block encoding only performs the transformation you need ...
• 1,645
Accepted

### Finding the Clifford circuit that implement a particular mapping of Paulis strings

You can convert a stabilizer tableau (a Pauli observable mapping) into a circuit by transforming the tableau into the identity tableau and keeping track of the steps you used. Basically, it's the same ...
• 37.5k

### Trying to understand a quantum adder

The correct way to interpret the number is using a compiler that follows the qubit mapping. You can see how it is done in Classiq, for example, by running examples from the arithmetic library To your ...
• 1,402

Only top scored, non community-wiki answers of a minimum length are eligible