Post-Processing#
We have introduced the workflow from building circuits to executing post-processing to get the final result. However, for some users that already have measurement outcomes from their own calculations, they may want to skip the building circuits and job manager to use the post-processing part only.
In this notebook, we will focus on the post-processing part. We will introduce how to access the fuctions that performs post-processing for those who are familiar with the post-processing procedure and more experienced with Python.
1. Entanglement Entropy#
All three methods calculate the entropy of a quantum state, but their calculation techniques and post-processing procedures are entirely different.
Hadamard Test
Randomized Measurement
Randomized Measurement with Error Mitigation
Randomized Measurement V1 - the deprecated version
This method is deprecated, and we recommend not using it for post-processing except when dealing with data from versions below
0.9.1
EntropyRandomizedMeasureV1
is a deprecated version ofEntropyRandomizedMeasure
because it lacks clarity on the relationship between bitstrings and qubit indices. This limitation can easily cause confusion, especially when working with systems that do not measure all qubits. However, it is retained for backward compatibility.
Randomized Measurement V1 with Error Mitigation - the deprecated version
This method is deprecated, and we recommend not using it for post-processing except when dealing with data from versions below
0.9.1
EntropyRandomizedMeasureV1
is a deprecated version ofEntropyRandomizedMeasure
because it lacks clarity on the relationship between bitstrings and qubit indices. This limitation can easily cause confusion, especially when working with systems that do not measure all qubits. However, it is retained for backward compatibility.
2. WaveFuction Overlap#
Hadamard Test
Randomized Measurement
Randomized Measurement V1 - the deprecated version
This method is deprecated, and we recommend not using it for post-processing except when dealing with data from versions below
0.9.1
EntropyRandomizedMeasureV1
is a deprecated version ofEntropyRandomizedMeasure
because it lacks clarity on the relationship between bitstrings and qubit indices. This limitation can easily cause confusion, especially when working with systems that do not measure all qubits. However, it is retained for backward compatibility.
WaveFuction Overlap
3. Classical Shadow#
This feature has been implemented. The documentation is comingโฆ
4. Magnetization Square#
This feature has been implemented. The documentation is comingโฆ
Access the post-processing functions with Rust or Cython acceleration#
All the functions are located in the qurry.process
module. You can access them by importing the module.
We also prepared Rust and Cython acceleration for the post-processing because Python is notorious for its inefficiency. The post-processing is the most time-consuming part in the workflow, as a result of the exponential amount of quantum data. Thus, acceleration of the process is of extreme importance.
For comparison, Rust is the fastest, Cython is the second, and Python is the slowest. You can check whether the acceleration module is available by checking AVAIBILITY_STATESHEET
from qurry.process.status
from qurry.process.status import AVAIBILITY_STATESHEET
AVAIBILITY_STATESHEET
| Qurrium version: 0.13.0
---------------------------------------------------------------------------
### Qurrium Post-Processing
- Backend Availability ................... Python Cython Rust JAX
- randomized_measure
- entangled_entropy.entropy_core_2 ....... Yes Depr. Yes No
- entangle_entropy.purity_cell_2 ......... Yes Depr. Yes No
- entangled_entropy_v1.entropy_core ...... Yes Depr. Yes No
- entangle_entropy_v1.purity_cell ........ Yes Depr. Yes No
- wavefunction_overlap.echo_core_2 ....... Yes Depr. Yes No
- wavefunction_overlap.echo_cell_2 ....... Yes Depr. Yes No
- wavefunction_overlap_v1.echo_core ...... Yes Depr. Yes No
- wavefunction_overlap_v1.echo_cell ...... Yes Depr. Yes No
- hadamard_test
- purity_echo_core ....................... Yes No Yes No
- magnet_square
- magnsq_core ............................ Yes No Yes No
- string_operator
- strop_core ............................. Yes No Yes No
- classical_shadow
- rho_m_core ............................. Yes No No Yes
- utils
- randomized ............................. Yes Depr. Yes No
- counts_process ......................... Yes No Yes No
- bit_slice .............................. Yes No Yes No
- dummy .................................. Yes No Yes No
- test ................................... Yes No Yes No
---------------------------------------------------------------------------
+ Yes ...... Working normally.
+ Error .... Exception occurred.
+ No ....... Not supported.
+ Depr. .... Deprecated.
---------------------------------------------------------------------------
by <Hoshi>
The Future of Acceleration#
The future version of Qurry will only maintain Rust acceleration.
Cython acceleration that has been implemented will remain in the package, but not be updated anymore. For the computation efficiency of Cython is only slightly better than that of Python. Nonetheless, Cython and Python are hard to work parallelly due to not just GIL (Global Interpreter Lock) in multi-thread, but also memory-wasted and inefficient for each children process in multi-process. Therefore, we decided to focus on Rust acceleration. Python version will be remained for the compatibility and the convenience of debugging.