@@ -493,17 +493,15 @@ def ode_evol_local(
493
493
) -> Tensor :
494
494
"""
495
495
ODE-based time evolution for a time-dependent Hamiltonian acting on a subsystem of qubits.
496
-
497
496
This function solves the time-dependent Schrodinger equation using numerical ODE integration.
498
497
The Hamiltonian is applied only to a specific subset of qubits (indices) in the system.
499
-
500
- The ode_backend parameter defaults to 'jaxode' (which uses `jax.experimental.ode.odeint` with a default solver
501
- of 'Dopri5');if set to 'diffrax', it uses `diffrax.diffeqsolve` instead (with a default solver of 'Tsit5').
498
+ The ode_backend parameter defaults to 'jaxode' (which uses ``jax.experimental.ode.odeint`` with a default solver
499
+ of 'Dopri5'); if set to 'diffrax', it uses ``diffrax.diffeqsolve`` instead (with a default solver of 'Tsit5').
502
500
503
501
Note: This function currently only supports the JAX backend.
504
502
505
503
:param hamiltonian: A function that returns a dense Hamiltonian matrix for the specified
506
- subsystem size. The function signature should be hamiltonian(time, *args) -> Tensor.
504
+ subsystem size. The function signature should be `` hamiltonian(time, *args) -> Tensor`` .
507
505
:type hamiltonian: Callable[..., Tensor]
508
506
:param initial_state: The initial quantum state vector of the full system.
509
507
:type initial_state: Tensor
@@ -515,15 +513,16 @@ def ode_evol_local(
515
513
:type callback: Optional[Callable[..., Tensor]]
516
514
:param args: Additional arguments to pass to the Hamiltonian function.
517
515
:param solver_kws: Additional keyword arguments to pass to the ODE solver.
518
- ode_backend='jaxode'(default) uses `jax.experimental.ode.odeint`; ode_backend='diffrax'
519
- uses `diffrax.diffeqsolve`.
520
- rtol (default: 1e-12) and atol (default: 1e-12) are used to determine how accurately you would
521
- like the numerical approximation to your equation.
522
- The solver parameter accepts one of {'Tsit5' (default), 'Dopri5', 'Dopri8', 'Kvaerno5'}
523
- and only works when ode_backend='diffrax'.
524
- dt0 (default: 0.01) specifies the initial step size and only works when ode_backend='diffrax'.
525
- max_steps (default: 10000) The maximum number of steps to take before quitting the computation
526
- unconditionally and only works when ode_backend='diffrax'.
516
+ - ode_backend='jaxode'(default) uses ``jax.experimental.ode.odeint``; ode_backend='diffrax'
517
+ uses ``diffrax.diffeqsolve``.
518
+ - rtol (default: 1e-12) and atol (default: 1e-12) are used to determine how accurately you would
519
+ like the numerical approximation to your equation.
520
+ - The solver parameter accepts one of {'Tsit5' (default), 'Dopri5', 'Dopri8', 'Kvaerno5'}
521
+ and only works when ode_backend='diffrax'.
522
+ - dt0 (default: 0.01) specifies the initial step size and only works when ode_backend='diffrax'.
523
+ - max_steps (default: 10000) The maximum number of steps to take before quitting the computation
524
+ unconditionally and only works when ode_backend='diffrax'.
525
+
527
526
:return: Evolved quantum states at the specified time points. If callback is provided,
528
527
returns the callback results; otherwise returns the state vectors.
529
528
:rtype: Tensor
@@ -566,18 +565,16 @@ def ode_evol_global(
566
565
) -> Tensor :
567
566
"""
568
567
ODE-based time evolution for a time-dependent Hamiltonian acting on the entire system.
569
-
570
568
This function solves the time-dependent Schrodinger equation using numerical ODE integration.
571
- The Hamiltonian is applied to the full system and should be provided in sparse matrix format
572
- for efficiency.
573
-
574
- The ode_backend parameter defaults to 'jaxode' (which uses `jax.experimental.ode.odeint` with a default solver
575
- of 'Dopri5');if set to 'diffrax', it uses `diffrax.diffeqsolve` instead (with a default solver of 'Tsit5').
569
+ The Hamiltonian is applied to the full system and should be provided in sparse matrix
570
+ format for efficiency.
571
+ The ode_backend parameter defaults to 'jaxode' (which uses ``jax.experimental.ode.odeint`` with a default solver
572
+ of 'Dopri5'); if set to 'diffrax', it uses ``diffrax.diffeqsolve`` instead (with a default solver of 'Tsit5').
576
573
577
574
Note: This function currently only supports the JAX backend.
578
575
579
576
:param hamiltonian: A function that returns a sparse Hamiltonian matrix for the full system.
580
- The function signature should be hamiltonian(time, *args) -> Tensor.
577
+ The function signature should be `` hamiltonian(time, *args) -> Tensor`` .
581
578
:type hamiltonian: Callable[..., Tensor]
582
579
:param initial_state: The initial quantum state vector.
583
580
:type initial_state: Tensor
@@ -588,15 +585,16 @@ def ode_evol_global(
588
585
:param args: Additional arguments to pass to the Hamiltonian function.
589
586
:type args: tuple | list
590
587
:param solver_kws: Additional keyword arguments to pass to the ODE solver.
591
- ode_backend='jaxode'(default) uses `jax.experimental.ode.odeint`; ode_backend='diffrax'
592
- uses `diffrax.diffeqsolve`.
593
- rtol (default: 1e-12) and atol (default: 1e-12) are used to determine how accurately you would
594
- like the numerical approximation to your equation.
595
- The solver parameter accepts one of {'Tsit5' (default), 'Dopri5', 'Dopri8', 'Kvaerno5'}
596
- and only works when ode_backend='diffrax'.
597
- dt0 (default: 0.01) specifies the initial step size and only works when ode_backend='diffrax'.
598
- max_steps (default: 10000) The maximum number of steps to take before quitting the computation
599
- unconditionally and only works when ode_backend='diffrax'.
588
+ - ode_backend='jaxode'(default) uses ``jax.experimental.ode.odeint``; ode_backend='diffrax'
589
+ uses ``diffrax.diffeqsolve``.
590
+ - rtol (default: 1e-12) and atol (default: 1e-12) are used to determine how accurately you would
591
+ like the numerical approximation to your equation.
592
+ - The solver parameter accepts one of {'Tsit5' (default), 'Dopri5', 'Dopri8', 'Kvaerno5'}
593
+ and only works when ode_backend='diffrax'.
594
+ - dt0 (default: 0.01) specifies the initial step size and only works when ode_backend='diffrax'.
595
+ - max_steps (default: 10000) The maximum number of steps to take before quitting the computation
596
+ unconditionally and only works when ode_backend='diffrax'.
597
+
600
598
:type solver_kws: dict
601
599
:return: Evolved quantum states at the specified time points. If callback is provided,
602
600
returns the callback results; otherwise returns the state vectors.
@@ -632,7 +630,7 @@ def evol_local(
632
630
:param index: qubit sites to evolve
633
631
:type index: Sequence[int]
634
632
:param h_fun: h_fun should return a dense Hamiltonian matrix
635
- with input arguments time and *args
633
+ with input arguments `` time`` and `` *args``
636
634
:type h_fun: Callable[..., Tensor]
637
635
:param t: evolution time
638
636
:type t: float
@@ -658,7 +656,7 @@ def evol_global(
658
656
:param c: _description_
659
657
:type c: Circuit
660
658
:param h_fun: h_fun should return a **SPARSE** Hamiltonian matrix
661
- with input arguments time and *args
659
+ with input arguments `` time`` and `` *args``
662
660
:type h_fun: Callable[..., Tensor]
663
661
:param t: _description_
664
662
:type t: float
0 commit comments