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

Incomplete documentation in Solving Problems with Time-dependent Hamiltonians page #1538

Closed
iAditya09 opened this issue Feb 25, 2021 · 7 comments
Assignees
Labels
DOC Issues relating the QuTiP documentation

Comments

@iAditya09
Copy link

http://qutip.org/docs/latest/guide/dynamics/dynamics-time.html

Under section Accessing the state from solver, it says the state of the system can be obtained using args for the time dependent Hamiltonian, but I couldn't figure out what that key was to use the state of system in the time dependent Hamiltonian , an example would be good.

qutipIssue

@iAditya09
Copy link
Author

@Ericgig

@Ericgig
Copy link
Member

Ericgig commented Feb 26, 2021

You're right, the table listing the keyword does not show up in the final documentation and they are not up-to-date...
You can find the keywords in QobjEvo's Docstring: help(qutip.QobjEvo).

@Ericgig Ericgig self-assigned this Feb 26, 2021
@iAditya09
Copy link
Author

@Ericgig thanks! found the keywords. I am having some issue with the state being returned though and I am unsure how to work around them. I basically want to calculate expect(Oper, args["state"]) which gives me a dimension mismatch, if I try doing (Oper*args["state"]).tr() to find the expectation value, it tells me there is a shape mismatch. I initially start with Oper and psi0 shape as (8,8) but the args["state"] returns a shape of (64,1). Any idea how to get around this issue? states in the 1d vector or the 2d matrix form also doesn't help leading to similar dimension mismatch errors. I was trying to look into the source code but couldn't figure out how to unflatten the Qobj state

@Ericgig
Copy link
Member

Ericgig commented Feb 27, 2021

In the latest version, the Qobj should be reshaped to (8,8)...
Could you send me your mesolve call and qutip version.

In your case, my guess is that you have oper not a super operator but state as a vector dm.
You could change oper with oper = qutip.spre(oper) then expect(Oper, args["state"]) should work.

Or you could reshape the state to (8,8) with vector_to_operator(state). Then (Oper*args["state"]).tr() should work

@jakelishman jakelishman transferred this issue from qutip/qutip-doc May 1, 2021
@jakelishman jakelishman added the DOC Issues relating the QuTiP documentation label May 1, 2021
@hodgestar
Copy link
Contributor

The table is now present https://qutip.org/docs/latest/guide/dynamics/dynamics-time.html#accesing-the-state-from-solver.

Closing this, but please let me know if I missed something.

@tnadolny
Copy link

Hi everyone,

the table in https://qutip.org/docs/latest/guide/dynamics/dynamics-time.html#accesing-the-state-from-solver confuses me. What is 'name'? Can I chose it? I tried using custom names which did not work for me.

Instead, using the keywords as explained in the section in https://qutip.org/docs/latest/apidoc/classes.html?highlight=qobjevo#qobjevo without any 'name' worked for me.

@Ericgig
Copy link
Member

Ericgig commented Jan 20, 2023

Thank you for reporting.
The feedback interface changed a few times (and will change in future version.)
The documentation in guide is wrong, but the apidoc should be up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOC Issues relating the QuTiP documentation
Projects
None yet
Development

No branches or pull requests

5 participants