qiskit-documentation/docs/api/qiskit/0.37/qiskit.providers.aer.librar...

35 lines
1.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: save_amplitudes_squared
description: API reference for qiskit.providers.aer.library.save_amplitudes_squared
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.providers.aer.library.save_amplitudes_squared
---
# qiskit.providers.aer.library.save\_amplitudes\_squared
<Function id="qiskit.providers.aer.library.save_amplitudes_squared" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-aer/tree/stable/0.10/qiskit/providers/aer/library/save_instructions/save_amplitudes.py" signature="save_amplitudes_squared(self, params, label='amplitudes_squared', unnormalized=False, pershot=False, conditional=False)">
Save squared statevector amplitudes (probabilities).
**Parameters**
* **params** (*List\[int] or List\[str]*) the basis states to return amplitudes for.
* **label** (*str*) the key for retrieving saved data from results.
* **unnormalized** (*bool*) If True return save the unnormalized accumulated probabilities over all shots \[Default: False].
* **pershot** (*bool*) if True save a list of probability vectors for each shot of the simulation rather than the a single amplitude vector \[Default: False].
* **conditional** (*bool*) if True save the probability vector conditional on the current classical register values \[Default: False].
**Returns**
with attached instruction.
**Return type**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
**Raises**
**ExtensionError** if params is invalid for the specified number of qubits.
</Function>