<jupyter_start><jupyter_text>But Bob doesn't know the way the qubit has been encoded by Alice!!!> So he makes a guess, and decodes according to his guess. However, if he guesses it wrong, he may get the wrong result.>> For example, if Alice sent $|+\rangle$ but Bob guesses that Alice used the Standard way of encoding, then he will (wrongly) expect that either $q=|0\rangle$ or $q=|1\rangle$ holds. Thus, he will believe that by simply measuring $q$ he can retrieve the bit value that Alice sent (see code below). But in fact, he will measure $q=|+\rangle$ and get randomly 0 or 1, with 50% chance each.<jupyter_code>#
# Bob decodes the qubit into bit, according to his guess.
#
guess = "Standard" # we know Alice encoded in the Hadamard way, so Bob's guess is wrong

if guess == "Standard":
    dec = q.measure()
elif guess == "Hadamard":
    q.H() # brings |+> to |0>, |-> to |1>
    dec = q.measure()

print("Decoded bit value: {}".format(dec))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11451942740286299, 'fraction_numerical': 0.0081799591002045, 'mean_word_length': 4.235294117647059, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '277520', 'license': 'Apache-2.0', 'n_tokens_mistral': 309, 'n_tokens_neox': 298, 'n_words': 147, 'path': 'notebooks/Bob.ipynb', 'repo_name': 'muttley2k/simulaqron-hands-on-1', 'size': '978'}