~jrjohansson/qutip/master

« back to all changes in this revision

Viewing changes to test2.py

  • Committer: Paul Nation
  • Date: 2011-04-21 04:46:56 UTC
  • Revision ID: git-v1:dd4c966b490aa468dfbd28cef66694df4bf235c8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from qutip import *
 
2
 
 
3
 
 
4
N0=5
 
5
N1=5
 
6
N2=5
 
7
alpha=sqrt(2)
 
8
#define operators
 
9
a0=tensor(destroy(N0),qeye(N1),qeye(N2))
 
10
a1=tensor(qeye(N0),destroy(N1),qeye(N2))
 
11
a2=tensor(qeye(N0),qeye(N1),destroy(N2))
 
12
 
 
13
 
 
14
A=(alpha*a0.dag()-conj(alpha)*a0)
 
15
start_time=time.time()
 
16
D=A.expm()
 
17
finish_time=time.time()
 
18
print 'time elapsed = ',finish_time-start_time
 
19
 
 
20
 
 
21
print D
 
22
 
 
23