splitjmatrix_simulator
¶
Split JMatrix quantum-inspired simulator.
SplitJMatrixSimulator
¶
Bases: ProductFormulaSimulator
Simulate open-system dynamics with the Split JMatrix method.
Each of the num_steps applies every Lindblad jump once, then
trotter_depth Hamiltonian slices. order=1 (the default) applies each
local term once per slice of width t / (num_steps * trotter_depth), in
list order. order=2 uses one Strang step per slice: half-steps forward,
a full step on the last term, then half-steps in reverse. Either order
covers coherent time t.
Counts come from circuit_backend. Omitting it uses Aer.
The shot count is that backend's shots attribute. Before the measurement,
each system qubit is rotated into its letter of basis (default all Z).
The result keeps one counts dict per time point, where bit i of a key is
system qubit i and the ancilla bit is dropped.
Read those counts with :meth:measure.
With workers greater than 1, that backend is pickled into each worker process.
Each time point starts from initial_state and uses the same seed.
workers=1 (the default) runs those points serially, in tlist order.
workers greater than 1 runs one process-pool task per time point.
Traces are still returned in tlist order, and progress(index, total)
may run in completion order. A job from start() counts each finished
time point in completed_steps.
Source code in shadowsim/simulators/splitjmatrix_simulator.py
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 | |
__init__
¶
__init__(
hamiltonians: List[LocalHamiltonian],
lindblads: List[LocalOperator],
initial_state: State,
*,
num_qubits: int,
total_time: float,
time_steps: int,
num_steps: int,
trotter_depth: int = 1,
order: Literal[1, 2] = 1,
verbose: bool = False,
seed: int | None = None,
progress: ProgressCallback | None = None,
workers: int = 1,
circuit_backend: CircuitBackend | None = None,
basis: str | None = None,
) -> None
Initialize a Split JMatrix simulator for the given model.
Source code in shadowsim/simulators/splitjmatrix_simulator.py
metrics_circuit
¶
metrics_circuit() -> Program
Return the program executed at the final time, including measurement.