Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Correct conversion discreteoperator.to_sparse() when constrained#1974

Draft
PhilipVinc wants to merge1 commit intonetket:master
base:master
Choose a base branch
Loading
fromPhilipVinc:pv/constrained-to-dense

Conversation

PhilipVinc
Copy link
Member

@PhilipVincPhilipVinc commentedJan 5, 2025
edited
Loading

[Sketch PR: leaving this here to avoid forgetting]

if the operator is not diagonal.
The fix is to remove the connected entries that violate the constraint.

I'm not sure we should merge this, as it would mean that calculations in full summation would not differ from Monte Carlo, because the full summation would correctly respect the constraint even in the connected components but not the Monte Carlo...

Needs some thought and design to fix it in Monte Carlo as well.

@codecovCodecov
Copy link

codecovbot commentedJan 5, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is80.00000% with4 lines in your changes missing coverage. Please review.

Project coverage is 84.47%. Comparing base(646255a) to head(5faa17f).

Files with missing linesPatch %Lines
netket/operator/_discrete_operator.py81.81%1 Missing and 1 partial⚠️
netket/operator/_discrete_operator_jax.py77.77%1 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #1974      +/-   ##==========================================- Coverage   84.47%   84.47%   -0.01%==========================================  Files         314      314                Lines       19057    19075      +18       Branches     2387     2391       +4     ==========================================+ Hits        16099    16113      +14- Misses       2199     2201       +2- Partials      759      761       +2

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

@gcarleo
Copy link
Member

shouldnt the conversion from vector to integer just fail if the constraint is violated?

@gcarleo
Copy link
Member

I mean if get_conn returns a state outside the Hilbert space one should just error or ignore it ?

@PhilipVinc
Copy link
MemberAuthor

Indeed, that is what happens currently.
But the error is not very clear, as testified by#1973.

It would be nice if we could automatically make the operators work in the chosen subspace.
I was plying with doing that.
But it'd be more work.

@gcarleo
Copy link
Member

I am not sure we should do this... at first sight it makes the code harder to read, adding another layer of logic we don't really need... I think we should just error and it should be the job of the operator to make sure it acts correctly on the given (constrained) hilbert space !

@PhilipVinc
Copy link
MemberAuthor

Yeah, I'm also unsure.

Though automatic stuff is very handy sometimes...
This kind of stuff is what is hard to work with.
Sometimes writing the projector for elaborate constraints is painful...

…e operator is not diagonal.The fix is to remove the connected entries that violate the constraint.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@PhilipVinc@gcarleo

[8]ページ先頭

©2009-2025 Movatter.jp