Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.85 KB

sparse-simulator.md

File metadata and controls

31 lines (22 loc) · 1.85 KB
author description ms.author ms.date ms.service ms.subservice ms.topic no-loc title uid
SoniaLopezBravo
Learn how to run your Q# programs on the Azure Quantum Development Kit sparse simulator.
sonialopez
11/22/2023
azure-quantum
qsharp-guide
conceptual
Q#
$$v
Quantum Development Kit
target
targets
Sparse quantum simulator
microsoft.quantum.machines.overview.sparse-simulator

Sparse quantum simulator

The sparse simulator is the default local simulator for Azure Quantum development environments, and utilizes a sparse representation of quantum state vectors, as opposed to the full-state simulator. This feature allows the sparse simulator to minimize the memory footprint used to represent quantum states, thus enabling simulations over a larger number of qubits. The sparse simulator is efficient for representing quantum states that are sparse in the computational basis, that is, quantum states for which most of the amplitude coefficients are zero in the computational basis. As such, sparse simulator enables users to explore larger applications than what can be represented using the full-state simulator which will waste both memory and time on an exponentially large number of zero-amplitudes.

For more information about the sparse simulator, please see Jaques and Häner (arXiv:2105.01533).

Calling the sparse simulator

The sparse simulator is the default local simulator in Visual Studio Code with the Azure Quantum Development Kit extension installed, and in the Azure Quantum portal.

Scenario Method
In a Q# program in VS Code Select Run Q# file
In a Python notebook cell result=qsharp.eval("EntryPointOperation()")
or
result=qsharp.run("EntryPointOperation()", shots=##)
In a %%qsharp notebook cell EntryPointOperation()