Lindblad Master Equation Solver¶
quanta.simulator.lindblad ¶
quanta.simulator.lindblad -- Lindblad master equation solver for open quantum systems.
Implements the Lindblad (Gorini-Kossakowski-Sudarshan-Lindblad, GKSL) master equation: d rho / dt = -i [H, rho] + sum_k ( L_k rho L_k^dagger - 1/2 {L_k^dagger L_k, rho} )
Uses Liouvillian superoperator matrix vectorization
| d rho / dt >> = L | rho >>
where L is given by: L = -i (I (x) H - H^T (x) I) + sum_k ( conj(L_k) (x) L_k - 1/2 I (x) L_k^dagger L_k - 1/2 L_k^T conj(L_k) (x) I )
LindbladError ¶
Bases: QuantaError
Exception raised for errors in Lindblad master equation evolution.
LindbladMasterEquation ¶
Lindblad master equation solver for open quantum systems.
Simulates Markovian open quantum system dynamics with exact Liouvillian matrix exponentials or Runge-Kutta 4th order (RK4) integration, strictly preserving complete positivity and trace preservation (CPTP).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
H
|
ndarray
|
System Hamiltonian matrix of shape (d, d). |
required |
jump_ops
|
Sequence[ndarray] | None
|
Sequence of Lindblad jump operators L_k of shape (d, d). |
None
|
Source code in quanta/simulator/lindblad.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
evolve ¶
evolve(
rho_0: ndarray,
t_span: tuple[float, float],
steps: int = 100,
method: str = "expm",
) -> tuple[np.ndarray, list[np.ndarray]]
Evolves initial density matrix rho_0 through the Lindblad master equation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho_0
|
ndarray
|
Initial density matrix of shape (d, d). |
required |
t_span
|
tuple[float, float]
|
Tuple of (t_start, t_end). |
required |
steps
|
int
|
Number of evolution steps. |
100
|
method
|
str
|
Integration method, "expm" (matrix exponential propagator) or "rk4". |
'expm'
|
Returns:
| Name | Type | Description |
|---|---|---|
times |
ndarray
|
Array of time points of length (steps + 1). |
states |
list[ndarray]
|
List of density matrices at each time point. |
Source code in quanta/simulator/lindblad.py
expectation_value
staticmethod
¶
rhs_matrix ¶
Evaluates d rho / dt directly in matrix form.
d rho / dt = -i [H, rho] + sum_k ( L_k rho L_k^dagger - 1/2 {L_k^dagger L_k, rho} )
Source code in quanta/simulator/lindblad.py
steady_state ¶
Computes the stationary state rho_ss satisfying L |rho_ss>> = 0 and Tr(rho_ss) = 1.
Solves the null space of the Liouvillian with the trace normalization constraint.
Returns:
| Type | Description |
|---|---|
ndarray
|
Stationary state density matrix of shape (d, d). |
Source code in quanta/simulator/lindblad.py
build_liouvillian ¶
Constructs the Liouvillian superoperator matrix in column-stacking convention.
Formula
L = -i (I (x) H - H^T (x) I) + sum_k ( conj(L_k) (x) L_k - 1/2 I (x) L_k^dagger L_k - 1/2 L_k^T conj(L_k) (x) I )
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
H
|
ndarray
|
Hamiltonian matrix of shape (d, d). |
required |
jump_ops
|
Sequence[ndarray] | None
|
Optional sequence of jump operators L_k of shape (d, d). |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Liouvillian superoperator matrix of shape (d^2, d^2). |
Source code in quanta/simulator/lindblad.py
unvectorize ¶
Reconstructs density matrix from column-stacked vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
ndarray
|
Complex vector of length dim^2. |
required |
dim
|
int
|
Hilbert space dimension. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Matrix of shape (dim, dim). |
Source code in quanta/simulator/lindblad.py
vectorize ¶
Vectorizes a density matrix using column-stacking convention: |rho>> = vec(rho).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
ndarray
|
Density matrix of shape (d, d). |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
1D column-stacked complex vector of length d^2. |