Skip to content

How to compute expectation values guide, issue #473#541

Closed
esraayantuna wants to merge 10 commits intoqiskit-community:mainfrom
esraayantuna:docs/compute-expval-guide
Closed

How to compute expectation values guide, issue #473#541
esraayantuna wants to merge 10 commits intoqiskit-community:mainfrom
esraayantuna:docs/compute-expval-guide

Conversation

@esraayantuna
Copy link
Copy Markdown
Contributor

Added a Jupyter notebook explaining how to compute expectation values with ffsim.

@esraayantuna
Copy link
Copy Markdown
Contributor Author

Hi @0sophy1! Can you review this PR, please?

@esraayantuna esraayantuna changed the title How to compute expectation values guide #473 How to compute expectation values guide for the issue #473 Jan 24, 2026
@esraayantuna esraayantuna changed the title How to compute expectation values guide for the issue #473 How to compute expectation values guide, issue #473 Jan 24, 2026
@0sophy1
Copy link
Copy Markdown
Member

0sophy1 commented Jan 30, 2026

Hi @0sophy1! Can you review this PR, please?

Thank you so much for this awesome work Esra,

I found these 5 expectation functions

state.spin_square
reduceDensityMatrix.expectation
expectation_one_body_product
expectation_squared_diag_coulomb
SingleFactorizedHamiltonian.expectation_product_state

and wonder if these are also good to be added to this guide.

@kevinsung Your input will be very helpful and valuable!

@kevinsung
Copy link
Copy Markdown
Collaborator

kevinsung commented Jan 30, 2026

Hi @0sophy1! Can you review this PR, please?

Thank you so much for this awesome work Esra,

I found these 5 expectation functions

state.spin_square reduceDensityMatrix.expectation expectation_one_body_product expectation_squared_diag_coulomb SingleFactorizedHamiltonian.expectation_product_state

and wonder if these are also good to be added to this guide.

@kevinsung Your input will be very helpful and valuable!

No, we shouldn't mention those functions. This guide should only show how to get expectation values with Scipy LinearOperator and np.vdot. I will review this PR (hopefully soon).

@0sophy1
Copy link
Copy Markdown
Member

0sophy1 commented Jan 30, 2026

Hi @0sophy1! Can you review this PR, please?

Thank you so much for this awesome work Esra,
I found these 5 expectation functions
state.spin_square reduceDensityMatrix.expectation expectation_one_body_product expectation_squared_diag_coulomb SingleFactorizedHamiltonian.expectation_product_state
and wonder if these are also good to be added to this guide.
@kevinsung Your input will be very helpful and valuable!

No, we shouldn't mention those functions. This guide should only show how to get expectation values with Scipy LinearOperator and np.vdot. I will review this PR (hopefully soon).

Thank you @kevinsung ! I believe this tutorial meets your expectations.

Comment thread compute-expectation-values.ipynb Outdated
Comment thread compute-expectation-values.ipynb Outdated
@kevinsung
Copy link
Copy Markdown
Collaborator

Hi Esra, thank you for your work on this, but I had something a bit different in mind, and I've opened #563 to supersede this PR. Your pull request was very helpful though. Sorry for not communicating my vision more clearly.

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

Successfully merging this pull request may close these issues.

3 participants