This setup cell below must be run first
%autosave 0
%matplotlib inline
import sglib
reload(sglib)
from sglib import *
# The next import makes expressions like 1/2 work.
# So you no longer have to say frac(1/2)
from __future__ import division
Autosave disabled
ipython notebook
prob = vector_problem(max_dim=3, max_int=5, complex=True)
prob.new()
answer = sqrt(33)
prob.check(answer)
The correct answer is:
Matrix([ (row2), (row2), ... ])
.
Matrix([ (1,2,3), (4,5,6), (7,8,9) ])
prob = matrix_problem(max_dim=2, max_int=5, complex=True)
prob.new()
answer = Matrix([ (4,8), (7,27) ])
prob.check(answer)
The correct answer is:
Matrix Test
M = Matrix([ (1,2,3), (4,5,6), (7,8,9) ])
Print('$%s$'%sy.latex(M))
prob = change_basis_problem(max_int=5, complex=False)
prob.new()
answer = col(0,0)
prob.check(answer)
draw_projections(vector(1,0), vector(0,1), vector(-4,1))
draw_projections(vector(-1,0), vector(0,-1), vector(-4,1))
draw_projections(1/sqrt(2)*vector(1,1), 1/sqrt(2)*vector(1,-1), vector(-4,1))
draw_projections(1/sqrt(5)*vector(2,1), 1/sqrt(5)*vector(-1,2), vector(-4,1))
import sglib
reload(sglib)
from sglib import *
#
set_font_size(3) # Font size of 3 or 4 works pretty well
z=1; x=2; y=3 # Don't change this line!!!
prob = electron_problem(
min_int=0, max_int=5, use_y=False, complex=False)
#prob.set_debug(True) # Probably leave this commented out
prob.new()
answer = 10/23
prob.check(answer)
You can ignore everything below this point.
Print(prob.latex)
print(prob.latex)
Given the input state: $\;-| +z \rangle$ <br><br> If you do the observation associated with the matrix $\left[\begin{matrix}0 & 1\\1 & 0\end{matrix}\right]$ <br><br> What is the probability of seeing the $1$ eigenvalue <br><br>