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

Guard against N_steps != 1 #51

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Guard against N_steps != 1 #51

merged 1 commit into from
Jan 6, 2025

Conversation

mrossinek
Copy link
Member

The LayerwiseEvolver based on tenpy has a N_steps argument in its public evolve method.
However, also as documented, this is supposed to be 1.

When it is not set to 1, the code runs fine but produces unexpected results.
This PR adds a guard against this to ensure the user cannot run into this.

@@ -176,7 +176,7 @@ max-args = 6
notice-rgx = """
# This code is a Qiskit project.
#
# \\(C\\) Copyright IBM 2024\\.
# \\(C\\) Copyright IBM \\d{4}((,\\s)\\d{4})*\\.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an ad-hoc fix. We should have a more general discussion on how to handle copyright headers in the Qiskit addons.

Here, I did what I also used to do back in the application modules (which is to ensure the year of the latest change of a file is present with at most 2 years being listed). However, this regex cannot enforce that pattern consistently. In the application modules we had a tool to check these headers. We could consider using something similar but rather than copying this tool everywhere I would rather do something similar to the extremal-python-dependencies tool and ship this separately (if we decide that this is needed).

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12634638468

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 12634274884: 0.0%
Covered Lines: 579
Relevant Lines: 579

💛 - Coveralls

@mrossinek mrossinek merged commit 2651094 into main Jan 6, 2025
15 checks passed
@mrossinek mrossinek deleted the guard-N_steps branch January 6, 2025 14:59
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