New answers tagged

2

As Craig said, you applied b_big and a_big differently. The adjoint a_big is missing from your product. Try rotated_state = b_big @ a_big @ state @ a_big.conj().T @ b_big.conj().T. But Craig's right. Using Circuits would be much simpler: import itertools import random import cirq import numpy as np def chsh_circuit(i, j, qs): return cirq.Circuit(cirq.H(...


3

Assuming $x$ is $n$ bits, here's a simple procedure: take $n$ ancilla qubits, all prepared in $|0\rangle$. Do a transversal controlled-not (i.e. bit by bit controlled-not) from the register with $|x\rangle$ to the ancilla register. THis means that if you started wuth $$ \sum_xa_x|x\rangle, $$ you now have $$ \sum_xa_x|x\rangle|x\rangle. $$ Next, find a bit ...


Top 50 recent answers are included