Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expectation added. #40

Merged
merged 1 commit into from
Mar 14, 2016
Merged

Expectation added. #40

merged 1 commit into from
Mar 14, 2016

Conversation

amitjamadagni
Copy link
Contributor

Calculating the expectation for AbstractQuVector and AbstractQuMatrix.

@acroy
Copy link
Contributor

acroy commented Aug 13, 2015

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
Copy link
Contributor

acroy commented Mar 13, 2016

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 amitjamadagni force-pushed the expect branch 3 times, most recently from 4a91de4 to 30c57f0 Compare March 13, 2016 16:11
@amitjamadagni
Copy link
Contributor Author

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

@amitjamadagni
Copy link
Contributor Author

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" .

@@ -198,8 +198,15 @@ tensor(bra::DualVector, ket::AbstractQuVector) = tensor(ket, bra)
commute(a::AbstractQuMatrix, b::AbstractQuMatrix) = (a*b) - (b*a)
anticommute(a::AbstractQuMatrix, b::AbstractQuMatrix) = (a*b) + (b*a)

###############
# Expectaion #
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "Expectation"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed !

acroy added a commit that referenced this pull request Mar 14, 2016
Function expectationvalue added.
@acroy acroy merged commit cc2c394 into JuliaAttic:master Mar 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants