Use the entanglement-assisted promised equality protocol. Alice applies the phase oracle on , and Bob applies on . These are unitary operators because their diagonal entries have modulus one. After Alice sends to Bob, the joint pure state isLet be the original maximally entangled state. If is the Hamming distance, thenBob performs the projective measurement with projectors and . Under the promise,He declares equal strings for the first outcome and distance for the other. This is exact because the promised outputs occupy orthogonal subspaces. A basic measurement also suffices: extend to an orthonormal basis and group all its other outcomes together. Alice transmits one -dimensional system, realizable using qubits; need not be a power of two.