Skip to content

Add histogram plotting feature for simulator#362

Merged
Takishima merged 20 commits intoProjectQ-Framework:developfrom
AriJordan:feature/hist
Apr 20, 2020
Merged

Add histogram plotting feature for simulator#362
Takishima merged 20 commits intoProjectQ-Framework:developfrom
AriJordan:feature/hist

Conversation

@AriJordan
Copy link
Contributor

@AriJordan AriJordan commented Mar 25, 2020

Allows users to draw a histogram plot of all possible measurement outcomes.

Typical usage:

from projectq import MainEngine
from projectq.ops import H, CNOT, Measure, All
from projectq.libs.hist import histogram
import matplotlib.pyplot as plt

eng = MainEngine()
qureg = eng.allocate_qureg(4)
H | qureg[0]
CNOT | (qureg[0], qureg[1])
CNOT | (qureg[0], qureg[2])
CNOT | (qureg[0], qureg[3])
eng.flush()

histogram(eng.backend, qureg)
plt.show()

All(Measure) | qureg

@Takishima Takishima merged commit f88a0f6 into ProjectQ-Framework:develop Apr 20, 2020
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.

2 participants