Skip to content

Allow all function to work with auto_real_casting=False#2752

Merged
Ericgig merged 3 commits into
qutip:masterfrom
Ericgig:bug_expect_casting
Oct 29, 2025
Merged

Allow all function to work with auto_real_casting=False#2752
Ericgig merged 3 commits into
qutip:masterfrom
Ericgig:bug_expect_casting

Conversation

@Ericgig

@Ericgig Ericgig commented Sep 24, 2025

Copy link
Copy Markdown
Member

Description
We have the options auto_real_casting that control the casting to real in expect for hermitian operators.
It's is useful for plug-in with auto-differentiation, but it was not fully tested and broke some functionalities.
I ran the full test without auto casting and fixed the issues:

  • expect with multiple state would fails when trying to return an array.
  • In measurement, complex probability would cause errors.
  • stochastic measurement output would be complex and not usable in run_from_experiment.
  • Steadystate "propagator" method convergence would break.

@coveralls

coveralls commented Oct 29, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 87.014% (+0.01%) from 87.003%
when pulling ca89b80 on Ericgig:bug_expect_casting
into 0223d21 on qutip:master.

@Ericgig Ericgig force-pushed the bug_expect_casting branch from 4188203 to ca89b80 Compare October 29, 2025 17:21
@Ericgig Ericgig merged commit 3a4346e into qutip:master Oct 29, 2025
15 of 16 checks passed
@Ericgig Ericgig deleted the bug_expect_casting branch October 29, 2025 20:08
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.

2 participants