Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check build: set heatmap bounds and y axis label
Browse files Browse the repository at this point in the history
purva-thakre committed Jan 16, 2025
1 parent 5e59346 commit d0d4b2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/examples/pt_zne.md
Original file line number Diff line number Diff line change
@@ -186,7 +186,7 @@ print(circuit)
```
```{code-cell} ipython3
ptmcnot = ptm_matrix(circuit, 2)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5, vmin=-1, vmax=1)
print("Ideal CNOT PTM")
plt.show()
```
@@ -196,7 +196,7 @@ noisy_circuit_incoherent = circuit.with_noise(depolarize(p=0.3))
print(noisy_circuit_incoherent)
ptmcnot = ptm_matrix(noisy_circuit_incoherent, 2)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5, vmin=-1, vmax=1)
print("\n Pauli Transfer Matrix of noisy CNOT (incoherent)")
plt.show()
```
@@ -206,7 +206,7 @@ noisy_circuit_coherent = circuit.with_noise(Ry(rads=np.pi/12))
print(noisy_circuit_coherent)
ptmcnot = ptm_matrix(noisy_circuit_coherent, 2)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5)
ax = sns.heatmap(ptmcnot.real, linewidth=0.5, vmin=-1, vmax=1)
print("Pauli Transfer Matrix of noisy CNOT (coherent)")
plt.show()
```
@@ -370,7 +370,7 @@ plt.plot(noise_strength, error_with_twirling,"", label=r"|Ideal - Twirling|", co
plt.plot(noise_strength, error_with_twirling_and_zne, "", label=r"|Ideal - (ZNE + Twirling)|", color="#2ca02c")
plt.xlabel(r"Noise strength, Coherent noise:$R_y(\frac{\pi}{2} \times \text{noise_strength})$")
plt.ylabel("Expectation Values Difference")
plt.ylabel("Absolute Error")
plt.title("Comparison of expectation values with ideal as a function of noise strength")
plt.legend()
plt.show()

0 comments on commit d0d4b2c

Please sign in to comment.