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

Simplify expressions #127

Closed
albertomercurio opened this issue Nov 2, 2022 · 4 comments
Closed

Simplify expressions #127

albertomercurio opened this issue Nov 2, 2022 · 4 comments

Comments

@albertomercurio
Copy link

Hello,

I want to find a simplify method for this simple test code

using QuantumCumulants

# Define hilbert space
hf = FockSpace(:cavity)
ha = NLevelSpace(:atom,(:g,:e))
h = hf  ha

# Define the fundamental operators
@qnumbers a::Destroy(h) σ::Transition(h,:g,:e)

σm = σ
σp = σ'
sz = σp * σm - σm * σp

sz

which returns (-1+σee+σee) instead of (-1+2*σee).
Is there a way to simplify it?

@ChristophHotter
Copy link
Member

Hi @albertomercurio,
Yes you can use QuantumCumulants.simplify(sz). I will export this function at the next release that you can use simplify(sz).

@albertomercurio
Copy link
Author

I'm using the stable version, but it says that QuantumCumulants.simplify doen't exist. Is it present only in the dev release?

@ChristophHotter
Copy link
Member

Sorry my mistake.
using Symbolics and then simplify(sz) should work.

If you do average(sz), it would also simplify the expression (but with expectation values in the expression).

@albertomercurio
Copy link
Author

Perfect, it works perfectly! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants