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

Add densitymatrix observable at thermal equilibrium #241

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Feb 16, 2024

This PR introduces densitymatrix(::GreenSlice,...), which produces a ρ::DensityMatrix over a set of sites. To evaluate the matrix itself at a given temperature and chemical potential, and for a set of system parameters, we do ρ(mu, kBT; params...)

We implement three algorithms in this PR: a generic one that relies on numerical integration on the complex plane of G(ω)*f(ω), another for GreenSolver.Spectrum and another for GreenSolver.KPM at zero temperature. More can be added at a later time.

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (27a7e97) 92.66% compared to head (8163698) 92.29%.
Report is 1 commits behind head on master.

Files Patch % Lines
src/types.jl 86.66% 4 Missing ⚠️
src/solvers/green/kpm.jl 92.50% 3 Missing ⚠️
src/show.jl 80.00% 2 Missing ⚠️
src/greenfunction.jl 92.85% 1 Missing ⚠️
src/observables.jl 97.67% 1 Missing ⚠️
src/slices.jl 90.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
- Coverage   92.66%   92.29%   -0.38%     
==========================================
  Files          34       35       +1     
  Lines        5538     5647     +109     
==========================================
+ Hits         5132     5212      +80     
- Misses        406      435      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

density matrix of GreenSlice

docstrings

add fallback

reorganize

rename density to densitymatrix

complete the rename

reorganized josephson to match densitymatrix

tweak docstrings
@pablosanjose
Copy link
Owner Author

This introduces more refactoring around GreenSlice indexing than I'd like. The reason is that we sometimes need inds and sometimes sites_to_orbs(inds, gs), where inds is some GreenSlice indices. The conversion should only be done once, so we compute it upon construction of a new row/col type GreenIndex living inside GreenSlice. Also, we sometimes want rows or sites_to_orbs(rows, gs) depending on whether rows (and cols) are both contact indices, because then we can get a view of the intracontact GreenSolution that is always computed up-font.

All this functionality should have been split into a separate PR, but then again, this was necessary for densitymatrix with a Spectrum solver, so it landed here. Proper developer discipline is hard! I'll merge this now and remain vigilant for issues from GreenSlice indexing

@pablosanjose pablosanjose merged commit 8b6e367 into master Feb 20, 2024
9 checks passed
@pablosanjose pablosanjose deleted the density branch February 20, 2024 14:13
@pablosanjose pablosanjose mentioned this pull request Apr 25, 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