Skip to content

Conversation

@albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Nov 17, 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 Quantum Toolbox in Julia.
  • 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

Before this pull request, the following code was failing

N = 10  # number of basis states
a = destroy(N)
H = a' * a

ψ0 = basis(N, 9)  # initial state

γ0 = 0.5
γ1(p, t) = sqrt(p[1] * exp(-t))

c_ops_2 = [QobjEvo(a, γ1) + QobjEvo(a, γ1)] # This generates a ComposedOperator internally

e_ops = [a' * a]

tlist = range(0, 10, 100)
params = [γ0]

sol_2 = mesolve(H, ψ0, tlist, c_ops_2, e_ops = e_ops; progress_bar = Val(false), params = params, saveat = tlist)

It was generating the lazy tensor warning, and then raising an error since the propagator was not cached, given that interally it has a ComposedOperator.

@albertomercurio albertomercurio added the Skip ChangeLog Skip changelog update check in PR label Nov 17, 2025
@albertomercurio albertomercurio removed the Skip ChangeLog Skip changelog update check in PR label Nov 17, 2025
@albertomercurio
Copy link
Member Author

Waiting this PR to be merged in order to fix the autodiff errors:

SciML/SciMLOperators.jl#326

Copy link
Member

@ytdHuang ytdHuang left a comment

Choose a reason for hiding this comment

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

LGTM !

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