Skip to content
126 changes: 98 additions & 28 deletions docs/guides/algorithmiq-tem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,26 @@
"\n",
"**Parameters**\n",
"\n",
"Name | Type | Description | Required | Default | Example\n",
"-- | -- | -- | -- | -- | --\n",
"`pubs` | Iterable[EstimatorPubLike] | An iterable of PUB-like (primitive unified bloc) objects, such as tuples `(circuit, observables)` or `(circuit, observables, parameters, precision)`. See [Overview of PUBs](/docs/guides/primitive-input-output#overview-of-pubs) for more information. If a non-ISA circuit is passed, it will be transpiled with optimal settings. If an ISA circuit is passed, it will not be transpiled; in this case, the observable must be defined on the whole QPU. | Yes | N/A | (circuit, observables)\n",
"`backend_name` | str | Name of the backend to make the query.| No | If not provided, the least-busy backend will be used. | \"ibm_fez\"\n",
"`options` | dict | Input options. See `Options` section for more details. | No | See `Options` section for more details.| \\{\"max_bond_dimension\": 100\\}\n",
"### `pubs`\n",
"<Attribute attributeTypeHint=\"Iterable[EstimatorPubLike]\">\n",
"An iterable of PUB-like (primitive unified bloc) objects, such as tuples `(circuit, observables)` or `(circuit, observables, parameters, precision)`. See [Overview of PUBs](/docs/guides/primitive-input-output#overview-of-pubs) for more information. If a non-ISA circuit is passed, it will be transpiled with optimal settings. If an ISA circuit is passed, it will not be transpiled; in this case, the observable must be defined on the whole QPU.\n",
"- Required: Yes\n",
"- Example: `(circuit, observables)`\n",
"</Attribute>\n",
"\n",
"### `backend_name`\n",
"<Attribute attributeTypeHint=\"str\" attributeValue=\"Least busy backend\">\n",
"Name of the backend to make the query\n",
"- Required: No\n",
"- Example: `\"ibm_fez\"`\n",
"</Attribute>\n",
"\n",
"### `options`\n",
"<Attribute attributeTypeHint=\"dict\">\n",
"Input options. See the [Options](#options) section for more details.\n",
"- Required: No\n",
"- Example: `{\"max_bond_dimension\": 100}`\n",
"</Attribute>\n",
"\n",
"<Admonition type=\"caution\">\n",
" TEM currently has the following limitations:\n",
Expand All @@ -306,19 +321,60 @@
"\n",
"A dictionary containing the advanced options for the TEM. The dictionary may contain the keys in the following table. If any of the options are not provided, the default value listed in the table will be used. The default values are good for typical use of TEM.\n",
"\n",
"Name | Choices | Description | Default\n",
"-- | -- | -- | --\n",
"`tem_max_bond_dimension` | int | The maximum bond dimension to be used for the tensor networks. | 500 |\n",
"`tem_compression_cutoff` | float | The cutoff value to be used for the tensor networks. | 1e-16\n",
"`compute_shadows_bias_from_observable` | bool | A boolean flag indicating whether the bias for the classical shadows measurement protocol should be tailored to the PUB observable or not. If False, the classical shadows protocol (equal probability of measuring Z, X, Y) will be used.| False\n",
"`shadows_bias` | np.ndarray | The bias to be used for the randomized classical shadows measurement protocol, a 1d or 2d array of size 3 or shape (num_qubits, 3) respectively. order is ZXY | np.array([1 / 3, 1 / 3, 1 / 3])\n",
"`max_execution_time` | int or `None` | The maximum execution time on the QPU in seconds. If the runtime exceeds this value, the job will be canceled. If `None`, a default limit set by Qiskit Runtime will apply. | `None`\n",
"`num_randomizations` | int | The number of randomizations to be used for noise learning and gate twirling. | 32\n",
"`max_layers_to_learn` | int | The maximum number of unique layers to learn. | 4\n",
"`mitigate_readout_error` | bool | A Boolean flag indicating whether to perform readout error mitigation or not. | True\n",
"`num_readout_calibration_shots` | int | The number of shots to be used for readout error mitigation. | 10000\n",
"`default_precision` | float | The default precision to be used for the PUBs for which the precision is not specified. |0.02\n",
"`seed` | int or `None` | Set the seed of the random number generator for reproducibility. If `None`, don't set the seed. | None"
"#### `tem_max_bond_dimension` \n",
"<Attribute attributeTypeHint=\"int\" attributeValue=\"500\">\n",
"The maximum bond dimension to be used for the tensor networks.\n",
"</Attribute>\n",
"\n",
"#### `tem_compression_cutoff`\n",
"<Attribute attributeTypeHint=\"float\" attributeValue=\"1e-16\">\n",
"The cutoff value to be used for the tensor networks.\n",
"</Attribute>\n",
"\n",
"#### `compute_shadows_bias_from_observable`\n",
"<Attribute attributeTypeHint=\"bool\" attributeValue=\"False\">\n",
"A boolean flag indicating whether the bias for the classical shadows measurement protocol should be tailored to the PUB observable or not. If False, the classical shadows protocol (equal probability of measuring Z, X, Y) will be used.\n",
"</Attribute>\n",
"\n",
"#### `shadows_bias`\n",
"<Attribute attributeTypeHint=\"np.ndarray\" attributeValue=\"np.array([1 / 3, 1 / 3, 1 / 3])\">\n",
"The bias to be used for the randomized classical shadows measurement protocol, a 1d or 2d array of size 3 or shape (`num_qubits`, 3) respectively. Order is ZXY.\n",
"</Attribute>\n",
"\n",
"#### `max_execution_time`\n",
"<Attribute attributeTypeHint=\"int or None\" attributeValue=\"None\">\n",
"The maximum execution time on the QPU in seconds. If the runtime exceeds this value, the job will be canceled. If `None`, a default limit set by Qiskit Runtime will apply.\n",
"</Attribute>\n",
"\n",
"#### `num_randomizations`\n",
"<Attribute attributeTypeHint=\"int\" attributeValue=\"32\">\n",
"The number of randomizations to be used for noise learning and gate twirling.\n",
"</Attribute>\n",
"\n",
"#### `max_layers_to_learn`\n",
"<Attribute attributeTypeHint=\"int\" attributeValue=\"True\">\n",
"The maximum number of unique layers to learn.\n",
"</Attribute>\n",
"\n",
"#### `mitigate_readout_error`\n",
"<Attribute attributeTypeHint=\"bool\" attributeValue=\"True\">\n",
"A boolean flag indicating whether to perform readout error mitigation or not.\n",
"</Attribute>\n",
"\n",
"#### `num_readout_calibration_shots`\n",
"<Attribute attributeTypeHint=\"int\" attributeValue=\"10000\">\n",
" The number of shots to be used for readout error mitigation.\n",
" </Attribute>\n",
"\n",
"#### `default_precision`\n",
"<Attribute attributeTypeHint=\"float\" attributeValue=\"0.02\">\n",
"The default precision to be used for the PUBs for which the precision is not specified.\n",
"</Attribute>\n",
"\n",
"#### `seed`\n",
"<Attribute attributeTypeHint=\"int or None\" attributeValue=\"None\">\n",
"Set the seed of the random number generator for reproducibility. If `None`, don't set the seed.\n",
"</Attribute>"
]
},
{
Expand All @@ -331,20 +387,33 @@
"A Qiskit [PrimitiveResults](/docs/api/qiskit/qiskit.primitives.PrimitiveResult) containing the TEM-mitigated result. The result for each PUB is returned as a [PubResult](/docs/api/qiskit/qiskit.primitives.PubResult) containing the following fields:\n",
"\n",
"\n",
"Name |Type | Description\n",
"-- | -- | --\n",
"data | DataBin | A Qiskit [DataBin](/docs/api/qiskit/qiskit.primitives.DataBin) containing the TEM mitigated observable and its standard error. The DataBin has the following fields: <ul><li>`evs`: The TEM-mitigated observable value.</li><li>`stds`: The standard error of the TEM-mitigated observable.</li></ul>\n",
"metadata | dict | A dictionary containing additional results. The dictionary contains the following keys: <ul><li>`\"evs_non_mitigated\"`: The observable value without error mitigation.</li><li>`\"stds_non_mitigated\"`: The standard error of the result without error mitigation.</li><li>`\"evs_mitigated_no_readout_mitigation\"`: The observable value with error mitigation but without readout error mitigation.</li><li>`\"stds_mitigated_no_readout_mitigation\"`: The standard error of the result with error mitigation but without readout error mitigation.</li><li>`\"evs_non_mitigated_with_readout_mitigation\"`: The observable value without error mitigation but with readout error mitigation.</li><li>`\"stds_non_mitigated_with_readout_mitigation\"`: The standard error of the result without error mitigation but with readout error mitigation.</li></ul>"
"### `data`\n",
"<Attribute attributeTypeHint=\"DataBin\">\n",
"A Qiskit [DataBin](/docs/api/qiskit/qiskit.primitives.DataBin) containing the TEM mitigated observable and its standard error. The DataBin has the following fields:\n",
"- `evs`: The TEM-mitigated observable value.\n",
"- `stds`: The standard error of the TEM-mitigated observable.\n",
"</Attribute>\n",
"\n",
"### `metadata`\n",
"<Attribute attributeTypeHint=\"dict\">\n",
"A dictionary containing additional results. The dictionary contains the following keys:\n",
"- `\"evs_non_mitigated\"`: The observable value without error mitigation.\n",
"- `\"stds_non_mitigated\"`: The standard error of the result without error mitigation.\n",
"- `\"evs_mitigated_no_readout_mitigation\"`: The observable value with error mitigation but without readout error mitigation.\n",
"- `\"stds_mitigated_no_readout_mitigation\"`: The standard error of the result with error mitigation but without readout error mitigation.\n",
"- `\"evs_non_mitigated_with_readout_mitigation\"`: The observable value without error mitigation but with readout error mitigation.\n",
"- `\"stds_non_mitigated_with_readout_mitigation\"`: The standard error of the result without error mitigation but with readout error mitigation.\n",
"</Attribute>"
]
},
{
"cell_type": "markdown",
"id": "fd045ee6",
"metadata": {},
"source": [
"## Fetching error messages\n",
"## Fetch error messages\n",
"\n",
"If your workload status is ERROR, use job.result() to fetch the error message as follows:"
"If your workload status is ERROR, use `job.result()` to fetch the error message as follows:"
]
},
{
Expand Down Expand Up @@ -390,10 +459,11 @@
"\n",
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
"\n",
"- [Request access to Algorithmiq Tensor-network error mitigation](https://quantum.cloud.ibm.com/functions?id=algorithmiq-tem)\n",
"- Review [Filippov, S., et al. (2023). Scalable tensor-network error mitigation for near-term quantum computing. arXiv preprint arXiv:2307.11740.](https://arxiv.org/abs/2307.11740)\n",
"- Review [Filippov, S., et al. (2024). Scalability of quantum error mitigation techniques: from utility to advantage. arXiv preprint arXiv:2403.13542.](https://arxiv.org/abs/2403.13542)\n",
"- Review [Fischer, E. F., et al. (2024). Dynamical simulations of many-body quantum chaos on a quantum computer. arXiv preprint arXiv:2411.00765.](https://arxiv.org/abs/2411.00765)\n",
"- [Request access to Algorithmiq Tensor-network error mitigation.](https://quantum.cloud.ibm.com/functions?id=algorithmiq-tem)\n",
"- Review the following papers:\n",
" - [Filippov, S., et al. (2023). Scalable tensor-network error mitigation for near-term quantum computing. arXiv preprint arXiv:2307.11740.](https://arxiv.org/abs/2307.11740)\n",
" - [Filippov, S., et al. (2024). Scalability of quantum error mitigation techniques: from utility to advantage. arXiv preprint arXiv:2403.13542.](https://arxiv.org/abs/2403.13542)\n",
" - [Fischer, E. F., et al. (2024). Dynamical simulations of many-body quantum chaos on a quantum computer. arXiv preprint arXiv:2411.00765.](https://arxiv.org/abs/2411.00765)\n",
"\n",
"</Admonition>"
]
Expand Down
Loading
Loading