Welcome to pq-engine’s documentation!
pq_engine package
Submodules
pq_engine.exceptions module
- exception pq_engine.exceptions.NonOneTraceError
Bases:
PQEngineBaseErrorerror that trace of matrix is not 1.
- message = 'trace of matrix is not 1.'
- exception pq_engine.exceptions.NotHermiteError
Bases:
PQEngineBaseErrorerror that matrix is not hermite
- message = 'matrix is not hermite.'
- exception pq_engine.exceptions.NotSquareError
Bases:
PQEngineBaseErrorerror that matrix is not square.
- message = 'matrix is not square.'
- exception pq_engine.exceptions.NotUnitaryError
Bases:
PQEngineBaseErrorerror that matrix is not unitary
- message = 'matrix is not unitary.'
- exception pq_engine.exceptions.PQEngineBaseError
Bases:
Exceptionbase error class
- exception pq_engine.exceptions.SizeNotMatchError
Bases:
PQEngineBaseErrorerror that dimension is not matching
- message = 'size of matrix is not match.'
- exception pq_engine.exceptions.TargetNotFoundError
Bases:
PQEngineBaseErrorerror that target is not found
- message = 'target is not found.'
pq_engine.matricies module
- pq_engine.matricies.controlled_not = array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j], [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j], [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j], [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j]], dtype=complex64)
controled-not matrix
- pq_engine.matricies.create_matrix_from_vector(vector: ndarray) ndarray
create matrix from vector
- Parameters:
vector (xp.ndarray) – source vector
- Returns:
matrix converted by source vector
- Return type:
xp.ndarray
- pq_engine.matricies.epr_pair_matricies = [array([[0.49999997+0.j, 0. +0.j, 0. +0.j, 0.49999997+0.j], [0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [0.49999997+0.j, 0. +0.j, 0. +0.j, 0.49999997+0.j]], dtype=complex64), array([[0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [0. +0.j, 0.49999997+0.j, 0.49999997+0.j, 0. +0.j], [0. +0.j, 0.49999997+0.j, 0.49999997+0.j, 0. +0.j], [0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j]], dtype=complex64), array([[ 0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [ 0. +0.j, 0.49999997+0.j, -0.49999997+0.j, 0. +0.j], [ 0. +0.j, -0.49999997+0.j, 0.49999997+0.j, 0. +0.j], [ 0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j]], dtype=complex64), array([[ 0.49999997+0.j, 0. +0.j, 0. +0.j, -0.49999997+0.j], [ 0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [ 0. +0.j, 0. +0.j, 0. +0.j, 0. +0.j], [-0.49999997+0.j, 0. +0.j, 0. +0.j, 0.49999997+0.j]], dtype=complex64)]
epr pairs state matricies
- pq_engine.matricies.epr_pair_vectors = [array([0.70710677+0.j, 0. +0.j, 0. +0.j, 0.70710677+0.j], dtype=complex64), array([0. +0.j, 0.70710677+0.j, 0.70710677+0.j, 0. +0.j], dtype=complex64), array([ 0. +0.j, 0.70710677+0.j, -0.70710677+0.j, 0. +0.j], dtype=complex64), array([ 0.70710677+0.j, 0. +0.j, 0. +0.j, -0.70710677+0.j], dtype=complex64)]
epr pairs state vectors
- pq_engine.matricies.hadamard_matrix = array([[ 0.70710677+0.j, 0.70710677+0.j], [ 0.70710677+0.j, -0.70710677+0.j]], dtype=complex64)
hadamard matrix
- pq_engine.matricies.minus_state_matrix = array([[ 0.49999997+0.j, -0.49999997+0.j], [-0.49999997+0.j, 0.49999997+0.j]], dtype=complex64)
- pq_engine.matricies.minus_state_vector = array([ 0.70710677+0.j, -0.70710677+0.j], dtype=complex64)
|->
- pq_engine.matricies.not_matrix = array([[0.+0.j, 1.+0.j], [1.+0.j, 0.+0.j]], dtype=complex64)
not matrix
- pq_engine.matricies.one_state_matrix = array([[0.+0.j, 0.+0.j], [0.+0.j, 1.+0.j]], dtype=complex64)
- pq_engine.matricies.pauli_x_matrix = array([[0.+0.j, 1.+0.j], [1.+0.j, 0.+0.j]], dtype=complex64)
σ_x
- pq_engine.matricies.pauli_y_matrix = array([[ 0.+0.j, -0.-1.j], [ 0.+1.j, 0.+0.j]], dtype=complex64)
σ_y
- pq_engine.matricies.pauli_z_matrix = array([[ 1.+0.j, 0.+0.j], [ 0.+0.j, -1.+0.j]], dtype=complex64)
σ_z
- pq_engine.matricies.plus_state_matrix = array([[0.49999997+0.j, 0.49999997+0.j], [0.49999997+0.j, 0.49999997+0.j]], dtype=complex64)
- pq_engine.matricies.plus_state_vector = array([0.70710677+0.j, 0.70710677+0.j], dtype=complex64)
|+>
- pq_engine.matricies.zero_state_matrix = array([[1.+0.j, 0.+0.j], [0.+0.j, 0.+0.j]], dtype=complex64)
pq_engine.observable module
pq_engine.settings module
- pq_engine.settings.atol = 1e-05
atol value used by numpy or cupy.
- pq_engine.settings.rounded_decimal = 8
approximation order of decimal used by numpy or cupy
- pq_engine.settings.rtol = 1e-05
rtol value used by numpy or cupy.
- pq_engine.settings.xp: Any = <module 'numpy' from '/home/runner/.cache/pypoetry/virtualenvs/pq-engine-YFEFS7qb-py3.11/lib/python3.11/site-packages/numpy/__init__.py'>
calculation engine (numpy or cupy)
pq_engine.state module
pq_engine.time_evolution module
pq_engine.utils module
- pq_engine.utils.check_density(matrix: ndarray) None
check matrix is density
- Parameters:
matrix (xp.ndarray) – target matrix
- pq_engine.utils.check_hermite(matrix: ndarray) None
check matrix is hermite
- Parameters:
matrix (xp.ndarray) – target matrix
- pq_engine.utils.check_one_trace(matrix: ndarray) None
check trace of matrix is one
- Parameters:
matrix (xp.ndarray) – target matrix
- pq_engine.utils.check_square(matrix: ndarray) None
check matrix is square
- Parameters:
matrix (xp.ndarray) – target matrix
- pq_engine.utils.check_unitary(matrix: ndarray) None
check matrix is unitary
- Parameters:
matrix (xp.ndarray) – target matrix