gav-quantum
gav-quantum is a quantum information utility package developed by Emil Marinov and Gray Alien Ventures.
Installation
pip install gav-quantum
Usage
Sample import statement below:
from gav_quantum import X, Y, Z, operator_from_sparse_pauli
Objects
ZERO - A column vector representation of the 0-state, [1 0]^T.
ONE - A column vector representation of the 1-state, [0 1]^T.
X, Y, Z - Standard X, Y, and Z Pauli operators.
PAULIS - An array of the Pauli operators in standard quantum information convention. Convenient for enumerations.
BELL_STATES[PHI_PLUS | PHI_MINUS | PSI_PLUS | PSI_MINUS] - The four maximally entangled Bell states.
Functions
W(N)
Inputs
- N - The number of qubits in the quantum state.
Output
- A vector corresponding to the maximally entangled N-qubit W-state.
GHZ(N)
Inputs
- N - The number of qubits in the quantum state.
Output
- A vector corresponding to the maximally entangled N-qubit GHZ-state.
operator_from_sparse_pauli(N, nonidentities) - Creates an operator from a list of tuples of qubits and the non-identity Pauli operators acting upon them.
Inputs
- N - The number of qubits in the quantum state.
- nonidentities - List of tuples specifying qubit number (indexed at 0) in ascending order and corresponding Pauli operator. Example: [(0,X),(2,Y)]
Output
- A 2^N by 2^N operator.
Notes
- Make sure to have also imported whichever Pauli operators (
X,Y,Z) are used in thenonidentitiesargument
Paulis_N_k(N, k)
Generates a list of the subset of operator bases over N qubits of weight less than or equal to k; it is a "tensor product of N operators, each of which is in {I, X, Y, Z} such that at most k are not I" [1].
Inputs
- N - The number of qubits in the quantum state.
- k - The maximum locality of Pauli operators acting upon the qubits.
Output
- A 2-tuple containing the set of operators where the first element is a list of the operators in matrix form and the second element is a verbose human-friendly list specifying qubit number (indexed at 0) in ascending order and corresponding Pauli operator. Example: [(0,X),(2,Y)]
Notes
- Returns the full operator basis if
k = N
QMaxCutHamiltonian(N, k, mode="Ising")
Generates a Quantum MaxCut Hamiltonian.
Inputs
- N - The number of qubits in the quantum state.
- k - The locality of qubit interations.
- mode -
"Ising"|"Heisenberg"
Output
- A 2^N by 2^N matrix corresponding to a QMaxCut Hamiltonian.
moment_constraint_matrix(N, E, k)
Generates the constraint matrix accompanying the moment matrix for a Lasserre semidefinite program assuming an anti-ferromagnetic state. Entries correspond to a matrix with rows and columns indexed by the subset of operator bases (see Paulis_N_k(N, k)). A row with adjacent edges with the same Pauli operator and a column with the same adjacent edges and Pauli operator between them are penalized with a -0.5 weight for their anti-alignment. For example, if the edges in question are 0 and 2, row X_0 X_2 and column X_0 X_2 are penalized for not exhibiting anti-alignment.
Inputs
- N - The number of qubits in the quantum state or nodes in the constraint graph.
- E - A 2-tuple corresponding to the edge of the constraint graph with constraint graph node numbers in ascending order as constraints. Example:
(0, 2) - k - The locality of qubit interactions.
Output
- A $\gamma$ by $\gamma$ matrix where $\gamma$ is the size of the subset of operator bases corresponding to the inputted
Nandkand the entries are real.
rootsOfUnity(n)
Returns a list of the $n$th roots of unity.
Output
- A list of the $n$th roots of unity i.e. [1, \omega, \omega^2, ..., \omega^{n-1}]
WeylBrauer(n)
Inputs
- n - The number of required Clifford generators
Output
- Array of generators
vectorToUnitaryIsometry(vector)
Inputs
- vector - A unit vector to be embedded into a unitary via Tsirelson's map
Output
- An order-2 unitary
roundToOrderKUnitary(A, k, method)
Inputs
- A - Operator to be rounded
- k - Number of partitions
- method - Type of rounding; 'polar' or 'schur'; Note, 'schur' not yet implemented
randomHaarUnitary(n)
Generate random Haar unitary operator of dimension n by n
diagOrderKUnitaries(k, d)
Generate array of diagonal basis order-@k unitaries of dimension @d
greedyEpsilonUnitaries(k, d, epsilon, numSamples)
Greedy epsilon packing of order-@k unitaries of dimension @d. Compact sets, amirite?
order_k_gridSearch_2x2(k, num_intervals)
Generate grid of 2x2 order-@k unitaries
References
[1] Parekh, O., & Thompson, K. (2021). Application of the Level-2 Quantum Lasserre Hierarchy in Quantum Approximation Algorithms. arXiv. https://doi.org/10.48550/arXiv.2105.05698
Metadata
Release files for gav-quantum 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gav_quantum-0.0.14.tar.gz | 7.9 kB | Without provenance | Details for gav_quantum-0.0.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gav_quantum-0.0.14-py3-none-any.whl | Python 3 | none | any | Details for gav_quantum-0.0.14-py3-none-any.whl |
Total release size: 16.1 kB
Release files / gav_quantum-0.0.14.tar.gz
| Download URL | gav_quantum-0.0.14.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
261100cc4c988ad4e82a3f0ca48d7f9bba926944ddbe19e0b811716660e687dc
|
|
BLAKE2b-256 checksum How to use checksums |
765cfcebb311dcbf3f3d3ac61226138d3822006b286d7b520175ef969b8c28d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / gav_quantum-0.0.14-py3-none-any.whl
| Download URL | gav_quantum-0.0.14-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ea165bc02b87ec807f00bd5d4659fe1d7474a9a51d15e0f50ff958b62ddbd15
|
|
BLAKE2b-256 checksum How to use checksums |
f2243882fd176abf2cd3b512f6906441060ac52f3e465bb43bf93eb072e691b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Security for gav-quantum 0.0.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.