Skip to content

The Krylov approximation method provides an efficient approach to perform time-evolutions of quantum states for systems with large-dimensional Hilbert spaces.

License

Notifications You must be signed in to change notification settings

emilianomfortes/krylovsolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyKrylovSolver

E. M. Fortes, J. M. Ruffinelli, M. Larocca and D. A. Wisniacki.

The Krylov approximation method provides an efficient approach to perform time-evolutions of quantum states for systems with large-dimensional Hilbert spaces.

Support

Unitary Fund

We are proud to have received a grant to develop this open-source code from Unitary Fund. We have also received funding from the Faculty of Exact and Natural Sciences at the University of Buenos Aires.

Installation

Dependencies:

qutip
numpy
scipy

PyKrylovSolver is not currently in PyPi. You can install directly from GitHub by doing

pip install git+https://github.com/emilianomfortes/krylovsolver/

Documentation

Time evolution of state vectors for time independent Hamiltonians.

Evolve the state vector ("psi0") finding an approximation for the time evolution operator of Hamiltonian ("H") by obtaining the projection of the time evolution operator on a set of small dimensional Krylov subspaces (m<<dim(H)).

The output is either the state vector or the expectation values of supplied operators ("e_ops"), computed at each time in a list ("tlist").

Additional options

Additional options to krylovsolve can be set with the following:

"store_states": stores states even though expectation values are requested via the "e_ops" argument.

"store_final_state": store final state even though expectation values are requested via the "e_ops" argument.

Parameters
   -------------
 H : :class:`qutip.Qobj`
    System Hamiltonian.
    
 psi0 : :class: `qutip.Qobj`
     initial state vector (ket).

 tlist : None / *list* / *array*
    List of times on which to evolve the initial state. If provided, it overrides
    t0, tf and dt parameters.

 krylov_dim: int
     Dimension of Krylov approximation subspaces used for the time evolution
     approximation.

 e_ops : None / list of :class:`qutip.Qobj`
     Single operator or list of operators for which to evaluate
     expectation values.
     
 if store_states : bool (default False)
     If e_ops is provided, store each state vector corresponding to each time
     in tlist.
     
 store_final_state : bool (default False)
     If e_ops is provided, store the final state vector of the evolution.

 progress_bar : None / BaseProgressBar
     Optional instance of BaseProgressBar, or a subclass thereof, for
     showing the progress of the simulation.          

 sparse : bool (default False)
     Use np.array to represent system Hamiltonians. If True, scipy sparse
     arrays are used instead.

 tolerance : :float: (default 1e-7)
     Minimum bound value for the final state infidelity with respect to 
     the exact state.       

Returns
---------
 result: :class:`qutip.Result`

    An instance of the class :class:`qutip.Result`, which contains
    either an *array* `result.expect` of expectation values for operators
    `e_ops` at times specified by the user input `tlist`, or an *array* 
    `result.states` of state vectors corresponding to the times in `tlist`.        

The documentation website is coming up soon.

from PyKrylovsolver.krylovsolver import krylovsolve
from PyKrylovsolver.hamiltonians import h_ising_transverse
from qutip.qobj import Qobj
import numpy as np

N = 8
dim = 2 ** N
psi = np.random.random(dim) + 1j * np.random.random(dim)
psi = psi / np.linalg.norm(psi)
psi = Qobj(psi)

hx, hz = np.ones(N), 0.5 * np.ones(N)
Jx, Jy, Jz = 0 * np.ones(N), 0 * np.ones(N), np.ones(N)
H = h_ising_transverse(N, hx, hz, Jx, Jy, Jz)

tlist = np.linspace(0, 1, 100)

psi_evolved = krylovsolve(H, psi, tlist=tlist, tolerance=1e-2, krylov_dim=5, progress_bar=False, sparse=True)

Krylov Aproximation

Contribute

You are most welcome to contribute in the development of the algorithm by forking this repository and sending pull requests, or filing bug reports at the issues page. Any code contributions will be acknowledged in the upcoming contributors section in the documentation.

Citing

If you use our error bound approach for the Krylov approximation in your research, please cite the original paper available here.

About

The Krylov approximation method provides an efficient approach to perform time-evolutions of quantum states for systems with large-dimensional Hilbert spaces.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages