JuliaAttic / QuBase.jl

A foundational library for quantum mechanics in Julia
Other
43 stars 6 forks source link

Expectation added. #40

Closed amitjamadagni closed 8 years ago

amitjamadagni commented 9 years ago

Calculating the expectation for AbstractQuVector and AbstractQuMatrix.

acroy commented 9 years ago

The question is if we want to restrict one of the arguments to explicitly be a state (vector) - so we would need something like #32?

acroy commented 8 years ago

I think this is actually Ok for now. I would vote for changing the function name to something like expectationvalue (is there something similar in QuDirac?). Tests are missing though.

amitjamadagni commented 8 years ago

@acroy I guess this is ready ! The tests pass on the release version !

amitjamadagni commented 8 years ago

Also a quick search on QuDirac didnt give any results for something similar :

amit@esornep:~/Downloads/QuDirac.jl$ cd src/
amit@esornep:~/Downloads/QuDirac.jl/src$ grep -r -i "expect" .
amit@esornep:~/Downloads/QuDirac.jl/src$ grep -r -i "expectation" .
amit@esornep:~/Downloads/QuDirac.jl/src$ grep -r -i "expectationvalue" .

amit@esornep:~/Downloads/QuDirac.jl$ grep -r -i "expectation" .
./docs/op_math.md:Thus, expectation values are naturally obtained in this manner:
amit@esornep:~/Downloads/QuDirac.jl$ grep -r -i "expect" .
./docs/op_math.md:Thus, expectation values are naturally obtained in this manner:
./docs/d_str.md:When using `d"..."` literals, the `|`, `>` and `<` characters *cannot be used for anything other than as symbols for Kets, Bras, and inner products*. Other than that, any other Julia syntax should evaluate properly. For example, assignments and function calls work as expected:
amit@esornep:~/Downloads/QuDirac.jl$ grep -r -i "expectionvalue" .