You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/advance.rst
+153-7Lines changed: 153 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,13 +157,13 @@ These methods are essential for studying quantum dynamics, particularly in many-
157
157
158
158
**Exact Diagonalization:**
159
159
160
-
For small systems where full diagonalization is feasible, the :py:meth:`tensorcircuit.timeevol.ed_evol` method provides exact time evolution by directly computing matrix exponentials:
160
+
For small systems where full diagonalization is feasible, the :py:meth:`tensorcircuit.timeevol.ed_evol` method provides exact time evolution by directly computing matrix exponentials
This method is particularly efficient for time-independent Hamiltonians as it uses eigendecomposition to compute the evolution.
194
197
It provides exact results but is limited to small systems (typically <16 qubits) due to the exponential growth of the Hilbert space.
195
198
199
+
.. note::
200
+
201
+
For real time evolution, the time should be chosen as ``times = 1.j * tc.backend.convert_to_tensor([0.0, 0.5, 1.0, 2.0])``
202
+
203
+
196
204
**Krylov Subspace Methods:**
197
205
198
206
For larger systems where exact diagonalization becomes intractable, the Krylov subspace method provides an efficient approximation.
@@ -246,9 +254,147 @@ It supports both standard and scan-based jit-friendly implementations:
246
254
**ODE-Based Evolution:**
247
255
248
256
For time-dependent Hamiltonians or when fine control over the evolution process is needed, TensorCircuit provides ODE-based evolution methods.
249
-
These methods solve the time-dependent Schrödinger equation directly:
250
-
the usage can be found at Analog circuit simulation section
257
+
These methods solve the time-dependent Schrödinger equation directly by integrating the equation :math:`i\frac{d}{dt}|\psi(t)\rangle = H(t)|\psi(t)\rangle`.
258
+
259
+
TensorCircuit provides two ODE-based evolution methods depending on whether the Hamiltonian acts on the entire system or just a local subsystem:
260
+
261
+
1. **Global Evolution** (:py:meth:`tensorcircuit.timeevol.ode_evol_global`): For time-dependent Hamiltonians acting on the entire system. The Hamiltonian should be provided in sparse matrix format for efficiency.
2. **Local Evolution** (:py:meth:`tensorcircuit.timeevol.ode_evol_local`): For time-dependent Hamiltonians acting on a subsystem of qubits. The Hamiltonian should be provided in dense matrix format.
345
+
346
+
.. code-block:: python
347
+
348
+
import tensorcircuit as tc
349
+
import jax.numpy as jnp
350
+
from jax import jit
351
+
352
+
# Set JAX backend for ODE support
353
+
tc.set_backend("jax")
354
+
K = tc.backend
355
+
356
+
# Time-dependent local Hamiltonian on qubits 1 and 2
Both ODE-based methods support automatic differentiation and JIT compilation when using the JAX backend, making them suitable for optimization tasks in quantum control and variational quantum algorithms.
390
+
The methods integrate the time-dependent Schrödinger equation using JAX's ODE solvers, providing flexible and efficient simulation of quantum dynamics with time-dependent Hamiltonians.
391
+
392
+
.. note::
251
393
394
+
1. ODE-based methods currently only support the JAX backend due to the dependency on JAX's ODE solvers.
395
+
2. Global evolution requires sparse Hamiltonian matrices for efficiency with large systems.
396
+
3. Local evolution requires dense Hamiltonian matrices and is suitable for subsystems with few qubits.
397
+
4. Both methods support callback functions to compute observables during evolution without storing all state vectors.
252
398
253
399
**Comparison of Time Evolution Methods:**
254
400
@@ -266,7 +412,7 @@ the usage can be found at Analog circuit simulation section
266
412
267
413
**Method Selection Guidelines:**
268
414
269
-
1. **Exact diagonalization Evolution**: Best for small systems where exact results are required. Most efficient for time-independent Hamiltonians.
415
+
1. **Exact diagonalization Evolution**: Best for small systems where exact results are required. Most efficient for time-independent Hamiltonians. Support imaginary time evolution.
270
416
271
417
2. **Krylov Evolution**: Ideal for large systems with time-independent Hamiltonians. Provides a good balance between accuracy and computational efficiency. The subspace dimension controls the trade-off between accuracy and speed.
0 commit comments