Skip to content

Add chemical potential parameter mu to Hubbard model - #199

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/add-chemical-potential-parameter
Mar 5, 2026
Merged

Add chemical potential parameter mu to Hubbard model#199
hzhangxyz merged 2 commits into
mainfrom
copilot/add-chemical-potential-parameter

Conversation

Copilot AI commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Adds a chemical potential mu to the Hubbard model Hamiltonian (-μΣn_{iσ}), and clarifies that electron_number is ignored by networks without particle number conservation.

Changes

  • ModelConfig: New mu: float = 0 field representing chemical potential
  • _prepare_hamiltonian: Adds -mu * n_{iσ} diagonal terms for each site and spin orbital
  • electron_number comment: Updated to note the parameter is ignored when using networks without particle number conservation
  • Logging: __init__ log message now includes mu

Example

from qmp.models.hubbard import ModelConfig, Model

# Grand canonical ensemble — tune filling via chemical potential
cfg = ModelConfig(m=4, n=4, t=1.0, u=8.0, mu=0.5)
model = Model(cfg)
Original prompt

This section details on the original issue you should resolve

<issue_title>给hubbard模型添加化学势参数mu, 并修改 "electron_number"的注释, 说明如果使用的是没有限制粒子数的网络, 这个参数会被忽略.</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add chemical potential parameter mu to Hubbard model Add chemical potential parameter mu to Hubbard model Mar 5, 2026
@hzhangxyz
hzhangxyz marked this pull request as ready for review March 5, 2026 19:38
Copilot AI review requested due to automatic review settings March 5, 2026 19:38
@hzhangxyz
hzhangxyz force-pushed the copilot/add-chemical-potential-parameter branch from da91a9a to d1e68e9 Compare March 5, 2026 19:40
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
@hzhangxyz
hzhangxyz force-pushed the copilot/add-chemical-potential-parameter branch from d1e68e9 to f29607e Compare March 5, 2026 19:44
@hzhangxyz
hzhangxyz merged commit 581a381 into main Mar 5, 2026
8 checks passed
Copilot AI removed the request for review from Copilot March 23, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants