measurements
Measurements.
QuantumStateTomography
Source code in jaxquantum/core/measurements.py
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 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
__init__(rho_guess, measurement_basis, measurement_results, complete_basis=None, true_rho=None)
Reconstruct a quantum state from measurement results using quantum state tomography. The tomography can be performed either by direct inversion or by maximum likelihood estimation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho_guess
|
Qarray
|
The initial guess for the quantum state. |
required |
measurement_basis
|
Qarray
|
The basis in which measurements are performed. |
required |
measurement_results
|
ndarray
|
The results of the measurements. |
required |
complete_basis
|
Optional[Qarray]
|
The complete basis for state |
None
|
true_rho
|
Optional[Qarray]
|
The true quantum state, if known. |
None
|
Source code in jaxquantum/core/measurements.py
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 |
|
quantum_state_tomography_direct()
Perform quantum state tomography using direct inversion.
This method reconstructs the quantum state from measurement results by directly solving a system of linear equations. The method assumes that the measurement basis is complete and the measurement results are noise-free.
Returns:
Name | Type | Description |
---|---|---|
Qarray |
Qarray
|
Reconstructed quantum state. |
Source code in jaxquantum/core/measurements.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
|
quantum_state_tomography_mle(L1_reg_strength=0.0, epochs=10000, lr=0.005)
Perform quantum state tomography using maximum likelihood estimation (MLE).
This method reconstructs the quantum state from measurement results by optimizing a likelihood function using gradient descent. The optimization ensures the resulting density matrix is positive semi-definite with trace 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L1_reg_strength
|
float
|
Strength of L1 |
0.0
|
epochs
|
int
|
Number of optimization iterations. |
10000
|
lr
|
float
|
Learning rate for the Adam optimizer. |
0.005
|
Returns:
Name | Type | Description |
---|---|---|
MLETomographyResult |
MLETomographyResult
|
Named tuple containing: - rho: Reconstructed quantum state as Qarray - params_history: List of parameter values during optimization - loss_history: List of loss values during optimization - grads_history: List of gradient values during optimization - infidelity_history: List of infidelities if true_rho was provided, None otherwise |
Source code in jaxquantum/core/measurements.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
fidelity(rho, sigma, force_positivity=False)
Fidelity between two states.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
Qarray
|
state. |
required |
sigma
|
Qarray
|
state. |
required |
force_positivity
|
bool
|
force the states to be positive semidefinite |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Fidelity between rho and sigma. |
Source code in jaxquantum/core/measurements.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
overlap(rho, sigma)
Overlap between two states or operators.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rho
|
Qarray
|
state/operator. |
required |
sigma
|
Qarray
|
state/operator. |
required |
Returns:
Type | Description |
---|---|
Array
|
Overlap between rho and sigma. |
Source code in jaxquantum/core/measurements.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
tensor_basis(single_basis, n)
Construct n-fold tensor product basis from a single-system basis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
single_basis
|
Qarray
|
The single-system operator basis as a Qarray. |
required |
n
|
int
|
Number of tensor copies to construct. |
required |
Returns:
Type | Description |
---|---|
Qarray
|
Qarray containing the n-fold tensor product basis operators. |
Qarray
|
The resulting basis has b^n elements where b is the number |
Qarray
|
of operators in the single-system basis. |
Source code in jaxquantum/core/measurements.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|