Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flips the result measurement display #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roosado
Copy link

@roosado roosado commented Jan 7, 2021

When ran, Bob's received message was printing flipped (i.e. it printed "01" when it received "10"). The issue wasn't in the measurement, because when printing "res.measurements" it correctly assigned the values to the qubits from the message as expected.

This correction flips the bitstring display so it prints the message correctly.

The error might come from a change in how cirq saves measurements from simulators, but I'm not sure.

When ran, Bob's received message was printing flipped (i.e. it printed "01" when it received "10"). The issue wasn't in the measurement, because when printing "res.measurements" it correctly assigned the values to the qubits from the message as expected.

This correction flips the bitstring display so it prints the message correctly.

The error might come from a change in how cirq saves measurements from simulators, but I'm not sure.
@rmlarose
Copy link
Collaborator

Thanks @roosado - which Cirq version are you running which has the flipped measurement outcome?

@krehermann
Copy link

I see the same bitstring, but I'm not convinced its a problem with the bitstring function.

I'm using
python 3.9.1
cirq 0.9.1

Here is the output with some extra prints:

cirq version: 0.9.1
Alice's sent msg is: 10

the superdense circuit
0: ───H───@───Z───@───H───M───
│ │
1: ───────X───────X───M───────

Bob's meausurement values dict_values([array([[0]], dtype=int8), array([[1]], dtype=int8)])

Bob's recv: 01
bitstring([1,0]): 10

@roosado
Copy link
Author

roosado commented Jan 14, 2021

@rmlarose
Same as @krehermann - cirq 0.9.1

But yeah, the problem is not in the bitstring function, it's got to be the way cirq is saving the values.

@stevescia
Copy link

I'm not seeing the problem,however I am using an older versions:

circ - 8.2
python 3.8

i embellished the book sample to superdense encode an arbituary string such as "hello world"

output snippet:
sender's sent message = 01

cirquit:
0: ───H───@───Z───@───H───M───
│ │
1: ───────X───────X───M───────
recv'ers recv'd message = 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants