question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Density matrix simulator sometimes returns measurement results when ignore_measurement_results is True

See original GitHub issue

Split off from #2567 . Input:

import cirq

q = cirq.LineQubit(0)
circuit1 = cirq.Circuit(cirq.measure(q))
circuit2 = circuit1 + cirq.I(q)

print('Circuit 1:')
print(circuit1)
print()
print('Circuit2:')
print(circuit2)
print()

simulator = cirq.DensityMatrixSimulator(noise=cirq.X, ignore_measurement_results=True)
result1 = simulator.run(circuit1, repetitions=10)
result2 = simulator.run(circuit2, repetitions=10)

print('Result 1:')
print(result1)
print()
print('Result 2:')
print(result2)
print()

Output:

Circuit 1:
0: ───M───

Circuit2:
0: ───M───I───

Result 1:
0=1111111111

Result 2:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinsungcommented, Sep 2, 2020

Yes, that’s correct.

0reactions
balopatcommented, Dec 16, 2020

Thank you @akushnarov! It’s all yours!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Density Matrix & Mixed States - Qiskit
Find the corresponding density matrix for the following pure states. Use Qiskit to prepare the states, and verify your results using the quantum_info...
Read more >
cirq.DensityMatrixSimulator - Google Quantum AI
A simulator for density matrices and noisy quantum circuits. ... These methods return Result s which contain both the measurement results, ...
Read more >
Density matrix - Wikipedia
In quantum mechanics, a density matrix (or density operator) is a matrix that describes the quantum state of a physical system.
Read more >
Lecture Notes for Ph219/CS219: Quantum Information Chapter 2
sometimes called the measurement problem of quantum theory. Seeking a ... (or density matrix) for qubit A. It is self-adjoint, positive (its eigenvalues....
Read more >
Functions — QuTiP 4.7 Documentation
Returns. dmqobj. Density matrix representation of coherent state. ... A dispatch method that provides measurement results handling both observable style ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found