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

✨ Added an SiDB simulation file writer #176

Merged
merged 23 commits into from
Apr 19, 2023
Merged

Conversation

marcelwa
Copy link
Collaborator

@marcelwa marcelwa commented Apr 5, 2023

Description

This PR adds a new file writer that can write SiDB simulation results to XML files that are parsable by SiQAD. To this end, a new data type sidb_simulation_result is introduced that can serve as a unified return type across SiDB simulation algorithms.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@marcelwa marcelwa added the enhancement New feature or request label Apr 5, 2023
@marcelwa marcelwa requested a review from Drewniok April 5, 2023 16:27
@marcelwa marcelwa self-assigned this Apr 5, 2023
@marcelwa marcelwa changed the title Write sqd sim results ✨ Added an SiDB simulation file writer Apr 5, 2023
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #176 (21f1b56) into main (329e749) will increase coverage by 0.07%.
The diff coverage is 98.63%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   94.24%   94.31%   +0.07%     
==========================================
  Files          77       79       +2     
  Lines        7091     7165      +74     
==========================================
+ Hits         6683     6758      +75     
+ Misses        408      407       -1     
Impacted Files Coverage Δ
include/fiction/io/write_sqd_sim_result.hpp 98.55% <98.55%> (ø)
...orithms/simulation/sidb/sidb_simulation_result.hpp 100.00% <100.00%> (ø)
include/fiction/io/write_sqd_layout.hpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 329e749...21f1b56. Read the comment docs.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
include/fiction/io/write_sqd_sim_result.hpp Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

clang-tidy review says "All clean, LGTM! 👍"

@marcelwa marcelwa requested a review from Drewniok April 17, 2023 15:31
Signed-off-by: ClangFormat <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

include/fiction/io/write_sqd_sim_result.hpp Show resolved Hide resolved
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@marcelwa marcelwa requested a review from Drewniok April 19, 2023 09:54
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Drewniok
Drewniok previously approved these changes Apr 19, 2023
Copy link
Collaborator

@Drewniok Drewniok left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: ClangFormat <[email protected]>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"


using namespace fiction;

TEST_CASE("Utility function: any_to_string", "[sqd-sim-result]")

Check warning

Code scanning / CodeQL

Poorly documented large function

Poorly documented function: fewer than 2% comments for a function of 129 lines.
@marcelwa marcelwa merged commit 490b95d into main Apr 19, 2023
@marcelwa marcelwa deleted the write-sqd-sim-results branch April 19, 2023 15:54
Drewniok added a commit that referenced this pull request May 7, 2023
* ✨ header for temperature simulation

* ✨ header for temperature simulation

* ✅ occupation function with tests

* 🚧 "critical temperature function" is implemented. Test also added.

* 🚧 CT of "bestagon gates" can be simulated correctly

* ✅ tests updated

* ✅ tests updated

* ✅ tests updated

* 🎨 map replaced by vector

* 📝 docu for new functions

* 📝 docu for new functions

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🚀

* ⬆️ submodules upgraded

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 small cahnges

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 replaced std::rand(), caused problem at temperature implementation

* 🎨 small changes here and there

* 🎨 reformat code

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 renaming function

* ✨ flag added to decide between gate and random layout

* ✨ flag added to decide between gate and random layout

* ✨ flag added to decide between gate and random layout

* ✨ min_energy added in occupation_probability.hpp

* 🎨 Reformatted and cleaned up code

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 Slight revision for consistency

* 🎨 renaming

* ⬆️ Bump libs/Catch2 from `50bf00e` to `9a2a4ea` (#182)

* 🎨 reformat code

* redefinition of sidb_nm_position (#186)

* ⬆️ Bump libs/Catch2 from `6783411` to `1f881ab` (#27)

Bumps [libs/Catch2](https://github.com/catchorg/Catch2) from `6783411` to `1f881ab`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](catchorg/Catch2@6783411...1f881ab)

---
updated-dependencies:
- dependency-name: libs/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump libs/parallel-hashmap from `7883cb6` to `d2bed96` (#33)

Bumps [libs/parallel-hashmap](https://github.com/greg7mdp/parallel-hashmap) from `7883cb6` to `d2bed96`.
- [Release notes](https://github.com/greg7mdp/parallel-hashmap/releases)
- [Commits](greg7mdp/parallel-hashmap@7883cb6...d2bed96)

---
updated-dependencies:
- dependency-name: libs/parallel-hashmap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 return value of ``sidb_nm_position`` changed from meter to nanometer for consistency.

* 🎨 renaming.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Drewniok <[email protected]>

* 👷 Use the GitHub token of the checked-out repo instead of the own for the `add-and-commit` action after clang-format has been run

* 🎨 Changed the unit of the lambda-tf physical parameter from meter to nanometer (#188)

* 🎨 Unit of `lambda_tf` is changed from meter to nanometer.

* 🎨 `epsilon_r` is unit-less.

* ✨ Added a function to round a number to `n` decimal places (#189)

* ✨ small function to round numbers to ``n`` decimal places.

* ✅ test added.

* 🎨 implemented Marcel's suggestions.

* 🎨 make use of new function in ``energy_distribution``.

* ✨ Added an SiDB simulation file writer (#176)

* ✨ Added a new unified return type for SiDB simulation

* ✨ Added a file writer for SQD simulation runs parsable by SiQAD

* 📝 Added and fixed docstrings

* 📝 Added RST documentation

* 📝 Removed superfluous newlines

* 🎨 Incorporated clang-tidy's recommendations

* 🎨 Rewrote `any_to_string` to be more performant and extensible

* 🐛 Replaced the usage of the custom charge to string function with the one provided by `sidb_charge_state.hpp`

* ✅ Added a test case for positive SiDBs

* ✅ Added test cases for `any_to_string`

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🐛 Added `inline` to `any_to_string` in order to avoid ODR problems

* ✅ Fixed the test case

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 👽 Convert nm to Angstrom

* 👽 Round distances and energy values to 6 decimal points

* ✅ Added additional tests to cover more lines

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

---------

Signed-off-by: ClangFormat <[email protected]>
Co-authored-by: ClangFormat <[email protected]>

* 🎨 larger architectural changes.

* 🎨 reformat code and documentation.

* 🎨 small changes in exhaustive_ground_state_simulation.hpp due to unit changes from ``main`` branch.

* 📝 added docu.

* ⬆️ Bump ZedThree/clang-tidy-review from 0.12.2 to 0.13.0 (#193)

* ⬆️ Bump libs/Catch2 from `9a2a4ea` to `10596b2` (#191)

Bumps [libs/Catch2](https://github.com/catchorg/Catch2) from `9a2a4ea` to `10596b2`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](catchorg/Catch2@9a2a4ea...10596b2)

---
updated-dependencies:
- dependency-name: libs/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump libs/parallel-hashmap from `d2bed96` to `7807157` (#192)

Bumps [libs/parallel-hashmap](https://github.com/greg7mdp/parallel-hashmap) from `d2bed96` to `7807157`.
- [Release notes](https://github.com/greg7mdp/parallel-hashmap/releases)
- [Commits](greg7mdp/parallel-hashmap@d2bed96...7807157)

---
updated-dependencies:
- dependency-name: libs/parallel-hashmap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ✅ Ensured a reproducible SiDB order for test reproducibility (#194)

* ✅ Ensured a reproducible SiDB order for test reproducibility

* 💚 Ordered surfaces as well

---------

Co-authored-by: Jan Drewniok <[email protected]>

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* ⬆️ Bump DoozyX/clang-format-lint-action from 0.15 to 0.16 (#196)

Bumps [DoozyX/clang-format-lint-action](https://github.com/DoozyX/clang-format-lint-action) from 0.15 to 0.16.
- [Release notes](https://github.com/DoozyX/clang-format-lint-action/releases)
- [Commits](DoozyX/clang-format-lint-action@v0.15...v0.16)

---
updated-dependencies:
- dependency-name: DoozyX/clang-format-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 changes after review.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 changes after review.

* 🎨 use data type for energy distribution.

* 🎨 additional ``else`` to try to fix windows build issue.

* ✨ Make ClangFormat aware of different line ending types and enforce `LF` (#177)

* 🎨 Added a flag to the ClangFormat config to enforce LF line endings (as of version 16)

* 🎨 Re-applied ClangFormat to the project

* ⬆️ Switched to ClangFormat 16

* 📝 add links for RST.

* 📝 add links for RST.

* 📝 add named anchor.

* 📝 use ``-`` instead of ``_``.

* 🐛 add missing ``$`` in docstring.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 copy enum class to try to solve window build issue.

* 🎨 tiny change in docu.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🔥 remove file from git.

* ✅ add additional test.

* 🐛 add ``recompute_energy`` and test which failed before.

* 🎨 change to scoped enumerator.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 use enum struct.

* 🔥 remove ``enum class``due to windows CI issue.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 replace reference.

* ✨ code to generate unique random layouts.

* ✨ Temperature-aware simulation can be conducted with ``exgs`` or ``quicksim``. All simulation engines use ``sidb_simulation_result`` now to collect results.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 rename struct member.

* 🎨 activate automatic state count detection.

* ⬆️ Bump libs/parallel-hashmap from `7807157` to `9f09034` (#199)

* 🎨 Ensured SiQAD compatibility of SiDB simulation result writer (#197)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 fix ``state count`` to three. Two is not supported by SiQAD yet.

* 🎨 reformat code.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcel Walter <[email protected]>

* 🎨 update after review (main change: replace stats_pointer as input for simulators).

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 introduce impl_class for quickexact.

* 🎨 remove ``const``keyword.

* 🎨 add ``const``keyword.

* 🎨 split in several smaller functions.

* 🎨 rename some functions.

* 📝 add docu.

* ✨ automatic base number detection can be turned ``on`` and ``off``.

* 📝 add more documentation.

* 🔥 remove files to shift it to separate PR.

* 🎨 change order of ``const``keyword and type.

* 📝 add RST.

* 📝 add documentation.

* 💚 add ``const`` keyword.

* 🎨 smaller changes to try to fix test issue.

* ✅ small change to avoid windows issue.

* 📝 add documentation.

---------

Signed-off-by: ClangFormat <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Drewniok <[email protected]>
Co-authored-by: ClangFormat <[email protected]>
Co-authored-by: Marcel Walter <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants