Skip to content

iniestarchen/quantum-phase-kickback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Phase Kickback Mechanism

Category: fundamentals  |  Difficulty: beginner  |  Qubits: 2  |  Gates: 5  |  Depth: 5

Phase kickback is a fundamental mechanism in quantum computing used in Deutsch-Jozsa, Grover's, and many other algorithms. When a CNOT acts with the target qubit in |−⟩, the phase of the control qubit is flipped rather than the target. The target remains in |−⟩ (unaffected), while the control picks up a phase of −1 if the control is |1⟩. This circuit demonstrates phase kickback and then converts the phase to a measurable bit-flip using a Hadamard.

Expected Output

c[0]=1 (phase kickback visible after Hadamard)

Circuit

The OpenQASM 2.0 circuit is in circuit.qasm.

OPENQASM 2.0;
include "qelib1.inc";
// Phase kickback: control q[0] in |1>, target q[1] in |->
qreg q[2];
creg c[1];
// Prepare control in |1>
x q[0];
// Prepare target in |-> = H|1>
x q[1];
h q[1];
// CNOT: phase kickback imprints -1 on |1> component of q[0]
cx q[0],q[1];
// Convert phase to measurable: Hadamard on control
h q[0];
// Should measure |1> (control picks up phase -> flips to |0> ... wait |1> -> -|1> -> after H: |0>)
// Actually: |1> -> -|1> after kickback; H(-|1>) = -H|1> = -(|0>-|1>)/sqrt(2)... let's just measure
measure q[0] -> c[0];

Tags

phase-kickback fundamentals oracle grover

References

License

MIT — part of the OpenQC Algorithm Catalog.

About

Demonstrate the phase kickback trick: a CNOT with ancilla in |−⟩ imprints a phase on the control qubit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors