This repo provides implementations and performance testings for quantum state preparation circuits using a qubit-efficient protocol (no ancilla qubit required) suitable for circuit simulators.
That is, given an arbitrary list of
The quantum circuit consists of a sequence of multi-control Ry and multi-control Rz gates, using the method described by Mottonen et al. 2004 (https://arxiv.org/pdf/quant-ph/0407010.pdf).
-
You can directly call the QSP function
qsp_qubit_eff
(implemented inqsp_circ_construction_qubit_efficient.py
) to prepare an arbitrary quantum state, as demonstrated inQSP_method_call_demo.ipynb
. -
We also provide a detailed implementation walkthrough in
QSP_detailed_implementation.ipynb
. We recommend first-time readers start with the walk-through inQSP_method_call_demo.ipynb
. -
We compare our implementation performance for dense quantum states against the existing Qiskit's
.initialize
function and the Braket's unitary operation inperformance_benchmark/dense_state_comparisons.ipynb
.
![Screenshot 2023-11-08 at 4 11 17 PM](https://private-user-images.githubusercontent.com/24789128/281557218-8dfcc84d-40c8-42d2-9f36-d9dbbd931f71.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMTA3MTAsIm5iZiI6MTcxOTMxMDQxMCwicGF0aCI6Ii8yNDc4OTEyOC8yODE1NTcyMTgtOGRmY2M4NGQtNDBjOC00MmQyLTlmMzYtZDlkYmJkOTMxZjcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI1VDEwMTMzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUwMDNlN2M1MmFjM2E4MGMyYjY4NGYxOTUxNDhlM2I4NDUwMzQ1ZGI2MjEwNWViYjA2MTVhNTE0YWU2YmU3YWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PEpJ0_lmQVXE35Ky36um1WcS16aXl0VoOnHjybVaBJ8)
- We provide some performance testings and complexity analysis of sparse state preparation for Braket in
performance_benchmark/braket_sparse_state_cost_benchmark.ipynb
and for Qiskit inperformance_benchmarkqiskit_sparse_state_gate_count.ipynb
.
The Amazon Braket Python SDK can be installed with pip on your local machine as follows:
pip install amazon-braket-sdk
The IBM Qiskit Python SDK can be installed with pip on your local machine as follows:
pip install qiskit
See requirements.txt
for other required Python packages and corresponding versions.
The current QSP operation demonstrated in this repo has the following circuit complexity numbers:
A.
B. No additional ancilla qubits required (total of
(Note that
See https://github.com/guikaiwen/QSP_Paper_Artifact and https://arxiv.org/pdf/2303.02131.pdf for an alternative method that has the following circuit complexity numbers:
A.
B.
Please contact [email protected] if you have any questions.