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

Refactoring QutipEmulator class #602

Merged
merged 15 commits into from
Dec 11, 2023
Merged

Refactoring QutipEmulator class #602

merged 15 commits into from
Dec 11, 2023

Conversation

a-corni
Copy link
Collaborator

@a-corni a-corni commented Oct 26, 2023

Add a Hamiltonian class to generate an hamiltonian using the samples and the noise model each time a new noise config is added or each time generate_hamiltonian is called.

Closes #600

@a-corni a-corni requested a review from HGSilveri October 26, 2023 10:35
@a-corni a-corni self-assigned this Oct 26, 2023
@a-corni
Copy link
Collaborator Author

a-corni commented Oct 26, 2023

@HGSilveri I have one error that I don't understand yet - and I don't fully understand why it was working before. Other than that I think the structure of the code will not change -I have mainly just moved the code from one place to another.

Copy link
Collaborator

@HGSilveri HGSilveri left a comment

Choose a reason for hiding this comment

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

I have a few suggestions but it looks good overall!

pulser-simulation/pulser_simulation/hamiltonian.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/simulation.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/simulation.py Outdated Show resolved Hide resolved
tests/test_simulation.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/hamiltonian.py Outdated Show resolved Hide resolved
@a-corni a-corni requested a review from madagra November 8, 2023 10:15
pulser-simulation/pulser_simulation/simulation.py Outdated Show resolved Hide resolved
tests/test_simulation.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/hamiltonian.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/hamiltonian.py Outdated Show resolved Hide resolved
pulser-simulation/pulser_simulation/simulation.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@HGSilveri HGSilveri left a comment

Choose a reason for hiding this comment

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

LGTM, great job! I think we can merge and then change the target of PR #616 , what do you think?

@a-corni a-corni merged commit ab65b7f into develop Dec 11, 2023
7 checks passed
@HGSilveri HGSilveri deleted the hamiltonian_generator branch December 29, 2023 11:33
@HGSilveri HGSilveri mentioned this pull request Feb 6, 2024
HGSilveri added a commit that referenced this pull request Feb 6, 2024
* Bump to version 0.17dev0

* Refactoring `QutipEmulator` class (#602)

* Adding Hamiltonian class

* fixing type

* Modifying docstring

* Simplifying refactoring

* Simplifying refactoring

* Fix test, simplify attributes in QutipEmulator

* Restore _eval_times_instruction, def device in ham

* delete get_attr

* using NoiseModel for config in Hamiltonian

* Fixing doc, tests

* Move build_operator, add_config to simulation

* Fix typing

* Bump to v0.17dev1

* Clarify confusion between kraus operators and collapse operators (#616)

* Bump version to v0.17dev0

* Delete L0, refactor error message

* Delete identity condition, 2nd order approximation

* Fixing tests

* Fixing test + doc

* Create rate attr, deprecate prob attr

* Replace prob by rate, err if def of rate and prob

* Fixing type

* Use dataclasses.fields, run effective noise notebook

* Illustrate rate > 1 in notebook

* Modifying cell count

* Support standalone serialization of `Register` and `RegisterLayout` to the abstract representation + Hashing for coordinate collections (#627)

* Implement CoordsCollection superclass to share hash with Register

* Incorporating register and layout schemas

* Add serialization and deserialization for layout and register

* Add new JSON schemas to the MANIFEST

* Add extra UTs

* Cover both jsonschema versions in CI

* Fix legacy jsonschema validation

* Test for legacy jsonschema more efficiently

* Addressing review comments

* FIX: Coordinate matching in `WeightMap.get_qubit_weight_map()` (#631)

* Bump version to 0.17dev2

* Explicitly define public symbols for all modules  (#630)

* Fix pyright import errors

* WIP: Attempt to use __all__

* Exposing the appropriate symbols throughout the codebase

* Fix typo

* Expose relevant submodules

* Expose layout classes in pulser.register

* [FIX] Restore compatibility with pytest 8.0.0 (#637)

* Unrestrict scipy<1.12  (#635)

* Bump version to v0.17dev0

* Remove restriction scipy<1.12

* Clip qutip to 4.7.5

* Replace `Register.rotate()` with `Register.rotated()` (#639)

* Modify deprecation of total_bottom_detuning to v0.18 (#638)

* Reduce imports on main tutorials (#636)

* Bump version to 0.17.0

---------

Co-authored-by: a_corni <antoine.cornillot@pasqal.com>
Co-authored-by: Antoine Cornillot <61453516+a-corni@users.noreply.github.com>
HGSilveri added a commit that referenced this pull request Feb 6, 2024
Main Changes:
ab65b7f Refactoring `QutipEmulator` class (#602)
007a0ae Clarify confusion between kraus operators and collapse operators (#616)
80cf640 Support standalone serialization of `Register` and `RegisterLayout` to the abstract representation + Hashing for coordinate collections (#627)
f1637ae Explicitly define public symbols for all modules  (#630)
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.

Refactor the noise implementation in pulser_simulation
2 participants