Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

evaluating the UU of an unitary matrix does not work

asked 12 years ago

d3banjan gravatar image

updated 12 years ago

mat = matrix([[0,1],[1,0]]) #creates a pauli matrix
u = exp(i*mat)# creates an unitary matrix
print ((u.H)*u).n() # u*u evaluated numerically

UU does not return the identity. why?

sage output-
[4.44305526025399e6 4.44305526025388e6]
[4.44305526025388e6 4.44305526025399e6]

Preview: (hide)

Comments

the weirdest thing - it works now! hmm .. i was using the sagenb.org worksheet interface. thanks!

d3banjan gravatar imaged3banjan ( 12 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

twch gravatar image

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?

Preview: (hide)
link

Comments

1

The U.H abbreviation for U.conjugate_transpose() was added only relatively recently.

Volker Braun gravatar imageVolker Braun ( 12 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 5,909 times

Last updated: Apr 12 '12