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

Clean semidefinite.py #2138

Merged
merged 8 commits into from Mar 29, 2023
Merged

Clean semidefinite.py #2138

merged 8 commits into from Mar 29, 2023

Conversation

Ericgig
Copy link
Member

@Ericgig Ericgig commented Mar 28, 2023

Description
Did some cleaning in semidefinite.py:

  • Renamed functions that should be private: kron -> _kron, conj -> _conj, etc.
  • Removed dag, and bmat: never used.
  • Moved qudit_swap as swap in operator.py and added tests.
  • Use functools.lru_cache instead of re implementing a memoize decorator. This used to be done in dnorm, comments were still present, removed.
  • Merged herm pos_noherm, pos and dens into _make_constraints.
  • Removed the logger call.
  • black the file.

@hodgestar Now only qutip-ctrl use the logger, can we move logging_utils.py there?

@coveralls
Copy link

coveralls commented Mar 28, 2023

Coverage Status

Coverage: 75.019% (-0.3%) from 75.328% when pulling ea33630 on Ericgig:misc.semi into ef81573 on qutip:master.

Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Looks good!

I suggested removing the SciPy intermediate step, a little because it's fast, but more because it removes the dependency.

qutip/core/operators.py Outdated Show resolved Hide resolved
qutip/core/operators.py Outdated Show resolved Hide resolved
Ericgig and others added 2 commits March 29, 2023 09:04
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
@Ericgig Ericgig merged commit 0c2fac0 into qutip:master Mar 29, 2023
11 checks passed
@Ericgig Ericgig deleted the misc.semi branch March 29, 2023 16:27
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.

None yet

3 participants