1 | initial version |
Mhh strange: For me this code works fine on sagenb.org: http://sagenb.org/home/pub/4689
On the sage Version which is installed on my PC (sage 4.7.1) the code throws an attribute Error: Attribute H unknown. However replacing .H by .conjugate_transpose() solves the problem there:
sage: mat = matrix([[0,1],[1,0]]) #creates a pauli matrix
sage: u = exp(i*mat) # creates an unitary matrix
sage: show(((u.conjugate_transpose())*u).n()) # u*u evaluated numerically
returns a unity matrix. Maybe the version you work with doesn't properly support .H either?