Adapter
inspeqtor.models.adapter
inspeqtor.models.adapter.observable_to_expvals
observable_to_expvals(
output, unitaries: ndarray
) -> ndarray
Function to be used with Wo-based model for probabilistic model construction
with make_probabilistic_model function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
Any
|
The output from Wo-based model |
required |
unitaries
|
ndarray
|
Ideal unitary, ignore in this function. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
jnp.ndarray: Expectation values array |
Source code in src/inspeqtor/v1/model.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
inspeqtor.models.adapter.unitary_to_expvals
unitary_to_expvals(output, unitaries: ndarray) -> ndarray
Function to be used with Unitary-based model for probabilistic model construction
with make_probabilistic_model function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
Any
|
The output from Unitary-based model |
required |
unitaries
|
ndarray
|
Ideal unitary, ignore in this function. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
jnp.ndarray: Expectation values array |
Source code in src/inspeqtor/v1/model.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
inspeqtor.models.adapter.toggling_unitary_to_expvals
toggling_unitary_to_expvals(
output: ndarray, unitaries: ndarray
) -> ndarray
Calculate \(U_J\) and convert it to expectation values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
ndarray
|
Parameters parametrized unitary operator |
required |
unitaries
|
ndarray
|
Ideal unitary operators corresponding to the output |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
jnp.ndarray: Predicted expectation values |
Source code in src/inspeqtor/v1/model.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | |