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

Introduce Space, Dimensions, and GeneralDimensions #360

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Jan 1, 2025

Checklist

Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to QuantumToolbox.jl.
  • Any code changes were done in a way that does not break public API.
  • Appropriate tests were added and tested locally by running: make test.
  • Any code changes should be julia formatted by running: make format.
  • All documents (in docs/ folder) related to code changes were updated and able to build locally by running: make docs.
  • (If necessary) the CHANGELOG.md should be updated (regarding to the code changes) and built by running: make changelog.

Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.

Description

Summary of this PR:

New structures:

  • AbstractSpace
  • Space
  • AbstractDimensions
  • Dimensions
  • GeneralDimensions

New field

  • dimensions (originally called dims) for Qobj / QobjEvo / TimeEvolutionProblem / EigsolveResult

New property

  • dims for Qobj / QobjEvo / TimeEvolutionProblem / EigsolveResult

New internal functions:

  • get_dimensions_to
  • get_dimensions_from
  • dimensions_to_dims: transform AbstractDimensions to integer-vector
  • _get_dims_string: to get the dims string for printing

Changed internal functions:

  • _check_dims -> _gen_dimensions. This was the one to check the format of user specified dims, now it also checks the format and generates the Dimensions structure.
  • check_dims -> check_dimensions. This was the one to check if the two Qobj have the same dims, now it allows multiple input Qobj and check whether all Qobj.dimensions are equal).

Related issues or PRs

close #271
close #353

@ytdHuang ytdHuang marked this pull request as ready for review January 7, 2025 08:12
@ytdHuang ytdHuang changed the title Introduce Space, Dimensions, and CompoundDimensions Introduce Space, Dimensions, and GeneralDimensions Jan 7, 2025
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 96.66667% with 9 lines in your changes missing coverage. Please review.

Project coverage is 93.15%. Comparing base (5b08c04) to head (e6166b8).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/qobj/dimensions.jl 92.10% 3 Missing ⚠️
src/qobj/arithmetic_and_attributes.jl 96.66% 2 Missing ⚠️
src/qobj/quantum_object_base.jl 94.44% 2 Missing ⚠️
src/qobj/quantum_object.jl 95.83% 1 Missing ⚠️
src/time_evolution/time_evolution.jl 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #360   +/-   ##
=======================================
  Coverage   93.14%   93.15%           
=======================================
  Files          41       43    +2     
  Lines        2684     2775   +91     
=======================================
+ Hits         2500     2585   +85     
- Misses        184      190    +6     

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

@ytdHuang ytdHuang removed the request for review from albertomercurio January 8, 2025 07:04
@ytdHuang ytdHuang marked this pull request as draft January 8, 2025 07:04
@ytdHuang ytdHuang marked this pull request as ready for review January 8, 2025 07:18
src/qobj/dimensions.jl Outdated Show resolved Hide resolved
src/qobj/dimensions.jl Show resolved Hide resolved
src/qobj/dimensions.jl Outdated Show resolved Hide resolved
src/qobj/dimensions.jl Outdated Show resolved Hide resolved
src/qobj/dimensions.jl Outdated Show resolved Hide resolved
src/qobj/eigsolve.jl Outdated Show resolved Hide resolved
src/qobj/quantum_object.jl Show resolved Hide resolved
src/qobj/quantum_object.jl Show resolved Hide resolved
src/qobj/quantum_object_evo.jl Outdated Show resolved Hide resolved
src/time_evolution/time_evolution.jl Outdated Show resolved Hide resolved
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.

Space and Dimensions structure to align with QuTiP Support type = Composed quantum objects
2 participants