Superposition
Signed Hadamard Chain
Difficulty: Easy ★
A uniform superposition hides a lot of structure in its signs. Here some qubits must sit in |-> instead of |+>, so the amplitude of |x> becomes (-1)^(sum of x_i over the negated qubits) / sqrt(2^n).
Objective
create_hadamard_chain(num_qubits, negated) returns a num_qubits circuit where every qubit index in negated is in |-> and every other qubit is in |+>.
Constraints
- No initialize / state_preparation shortcuts.
Entry Point
create_hadamard_chainChecks
- Exports create_hadamard_chain(num_qubits, negated).
- Sign patterns match for registers of 1 to 5 qubits.
Your Code
Outputpending
Execution results will appear here.