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

Fermion spin charge sep #1

Merged
merged 5 commits into from
Jan 29, 2024

Conversation

fretchen
Copy link

Summary

Provides a basic notebook for a simulation of fermions in an extended system. The fermion simulator might be replaced or the notebook might be extended. Both options are fine by me.

Details and comments

Quite embarrassingly the routines for the spin correlation function are super slow and the main bottleneck in extending the tutorial to longer chains right now...

@kevinsung
Copy link
Owner

Thank you! Can you take a stab at replacing FermionSimulator with FfsimBackend and check that the results remain the same? Also, just to clarify, are you saying the simulator is performance is not the bottleneck for scaling this up? In that case, this isn't the best demonstration for the ffsim backend, right?

@fretchen
Copy link
Author

fretchen commented Jan 13, 2024

Two observations:

  • Replacing the Backend worked like a charm.
  • I also found out that the limiting factor are not the correlation functions, but a qiskit routine that is common to all the backends.

Once I go too nine sites the following lines take forever (minutes):

count_list_1 = jobs_1.result().get_counts()
count_list_2 = jobs_2.result().get_counts()

Everything else works nicely.

@kevinsung
Copy link
Owner

Ah those lines are doing the circuit simulation. Did you find that at 9 sites, the ffsim backend was at least faster than the FermionSimulator backend?

The circuits in this notebook use the FermiHubbard gate, which involves direct exponentiation of the Hamiltonian. This currently does not play to the comparative strengths of ffsim. The speed advantage of ffsim would be more apparent with a Trotterized implementation that uses e.g. the Hop, Interaction, and Phase gates. Can the notebook be adapted to use a Trotterized implementation instead?

@fretchen
Copy link
Author

Indeed the speed difference is only visible for the trotterized version. If you have the motivation to extend the notebook towards a trotterized simulation of the graphics above feel free. Otherwise, I think that this nicely could already demonstrate a number of important features.

@kevinsung
Copy link
Owner

Thanks, it looks good to me now. Since this tutorial is a standalone exploration of a concept, and the other tutorial I made is a simple explanation of how to use the ffsim simulator, how about we keep both of them? In that case you should prefix your tutorial with 11 instead of 10.

@kevinsung kevinsung merged commit 02b8833 into kevinsung:ffsim Jan 29, 2024
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.

2 participants