XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
100 stars 55 forks source link

reduced state fix #395

Closed RyosukeNORO closed 1 month ago

RyosukeNORO commented 1 month ago

Context: There was a code that compare the value in numpy.ndarray and list in reduced_state (numpy.ndarray == list). This comparison was allowed in the previous version of numpy but prohibited in the latest one. Therefore, an error is raised.

Description of the Change: Codes to convert the type from numpy.ndarray to list was added.

Benefits: The error is fixed.

Possible Drawbacks: This change may break other parts because codes to restore the type after the comparison have not been implemented.

Related GitHub Issues:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (0e51518) to head (06df1f4).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #395 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 28 28 Lines 1912 1914 +2 ========================================= + Hits 1912 1914 +2 ``` | [Files](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/395?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [thewalrus/symplectic.py](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/395?src=pr&el=tree&filepath=thewalrus%2Fsymplectic.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL3N5bXBsZWN0aWMucHk=) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/395?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/395?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [0e51518...06df1f4](https://app.codecov.io/gh/XanaduAI/thewalrus/pull/395?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI).