5 votes
Accepted

How to construct a quantum circuit for quantum Fourier transform in a prime dimensional Hilbert space?

This is covered in the paper "Exact quantum Fourier transforms and discrete logarithm algorithms": We show how the quantum fast Fourier transform (QFFT) can be made exact for arbitrary ...
Craig Gidney's user avatar
  • 34.9k
3 votes
Accepted

Implementing cphase gate on IonQ through Amazon Braket

You'll want to write the cphaseshift gate in terms of gates that are supported by the IonQ device through Amazon Braket. For example, the circuit ...
Ryan Shaffer's user avatar
3 votes

How to implement the modular exponentiation implementation in Shor's algorithm?

Given two coprime integers $a$ and $N$, you can compute $a^{-1} \text{ mod } N$ efficiently classically by using the extended Euclidean algorithm even if the factorization of $N$ is unknown. This is ...
Martin Ekerå's user avatar
3 votes

How to implement the modular exponentiation implementation in Shor's algorithm?

$a^{-1}$ is an integer, because you're working in modular arithmetic. $a^{-1}$ is the value that satisfies $a \cdot a^{-1} = 1$. For example, on a clock, 5-oclock times 5-oclock equals 25-oclock which ...
Craig Gidney's user avatar
  • 34.9k
2 votes
Accepted

How to find a quantum circuit to generate a target state?

You can split tasks like this into two steps. Make any state with the right amplitudes. Make a state that has the amplitude $\sqrt{3}/2$. Use NOT and CNOT gates to change what the amplitudes are ...
Craig Gidney's user avatar
  • 34.9k
1 vote
Accepted

What is the explicit action of the following circuit?

I am assuming the two control symbols connecting |𝜓⟩ and |+⟩ are entangling the states somehow? Yes, this represents a CZ gate. Then I don't understand the top right measurement. It is not in a ...
Peter-Jan's user avatar
  • 1,249
1 vote
Accepted

How to make sense of `Pauli observables` in the gate cutting code here?

The Pauli list says the operator or the basis on which you want to measure the quantum state. Whenever you implement a QAOA, or any other code that requires you to find the expectation value of an ...
Yet another Random Guy's user avatar
1 vote

Expectation values using qiskit

Note that $A$ isn't actually a quantum gate because it isn't necessarily unitary, so $V^\dagger AV| \mathbf{0} \rangle$ is not even a valid quantum circuit. Suppose that $A$ is unitary (for example a ...
Cody Wang's user avatar
  • 1,138

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