Closed emipc closed 2 weeks ago
Looks like it's only 0 in the book, but the value is 1 in the repo. Closing this issue.
I'd like to reopen this issue because I don't see the purpose of this variable. It has a static value used in conditionals, which doesn't seem valuable.
Hi Emi, the spy_had variable is there on purpose, to allow you to easily select which basis the spy performs their interception attempt in. If the spy's choice matches Alice's choice, then the spy wins, intercepting a perfect copy of the stolen bit, and avoids detection. If the spy guesses wrong, then they intercept a random bit, and pass a random bit to Bob, making it likely they'll be detected.
Thanks for the response, Eric! I clearly missed that point. I might need to read the chapter again 🙂
The
spy_had
variable in the Example 2-4 Quantum random spy hunter seems to have no effect on the program's behavior as it is always set to 0. It might be redundant and can be removed.