Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import qutip
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. import scipy
  5.  
  6. N = 5
  7. D = qutip.displace(N, 3)
  8. C = qutip.dag(D)
  9. thermal = C * (qutip.states.thermal_dm(N,1)) * D
  10. thermal2 = C * (qutip.states.thermal_dm(N,2)) * D
  11. thermal3 = C * (qutip.states.thermal_dm(N,5)) * D
  12.  
  13. print thermal
  14.  
  15.  
  16.  
  17. fig, graph1 = plt.subplots(1, 3, figsize =(20, 5))
  18.  
  19. bar1 = graph1[0].bar(np.arange(0,N),thermal.diag())
  20. label1 = graph1[0].set_title("N = 100, n = 1, alpha = 1")
  21. lim1 = graph1[0].set_xlim([-.5, 30])
  22.  
  23. bar2 = graph1[1].bar(np.arange(0,N),thermal2.diag())
  24. label2 = graph1[1].set_title("N = 100, n = 2, alpha = 1")
  25. lim2 = graph1[1].set_xlim([-.5, 40])
  26.  
  27. bar3 = graph1[2].bar(np.arange(0,N),thermal3.diag())
  28. label3 = graph1[2].set_title("N = 100, n = 5, alpha = 1")
  29. lim3 = graph1[2].set_xlim([-.5, 60])
  30.  
  31.  
  32.  
  33. t1diag = np.matrix(thermal, dtype=object)
  34. a = np.arange,thermal.diag()
  35. b = np.array(a)
  36. x = str(b[1])
  37.  
  38. print x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement