def measure_message_qubit(basis: bool, q: Qubit): if basis: q.h() result = q.measure() return result
def prepare_message_qubit(message: bool, basis: bool, q: Qubit): if message: q.x() if basis: q.h()