View source on GitHub
|
A LinearOperator from a QubitOperator with multiple processors.
openfermion.linalg.ParallelLinearQubitOperator(
qubit_operator, n_qubits=None, options=None
)
Attributes | |
|---|---|
H
|
Hermitian adjoint.
See Alsoscipy.sparse.linalg.LinearOperator.adjoint : Equivalent method. |
T
|
Transpose.
See Alsoscipy.sparse.linalg.LinearOperator.transpose : Equivalent method. |
Methods
adjoint
adjoint()
Hermitian adjoint.
Returns the Hermitian adjoint of this linear operator, also known as the Hermitian conjugate or Hermitian transpose. For a complex matrix, the Hermitian adjoint is equal to the conjugate transpose.
Returns
LinearOperator
Hermitian adjoint of self.
See Also
:attr:~scipy.sparse.linalg.LinearOperator.H : Equivalent attribute.
dot
dot(
x
)
Multi-purpose multiplication method.
Parameters
x : array_like or LinearOperator or scalar
Array-like input will be interpreted as a 1-D row vector or
2-D matrix (or batch of matrices)
depending on its shape. See the Returns section for details.
Returns
Ax : array or LinearOperator
- For `LinearOperator` input, operator composition is performed.
- For scalar input, a lazily scaled operator is returned.
- Otherwise, the input is expected to take the form of a dense
1-D vector or 2-D matrix (or batch of matrices),
interpreted as follows
(where ``self`` is an ``M`` by ``N`` linear operator):
- If `x` has shape ``(N,)``
it is interpreted as a row vector
and `matvec` is called.
- If `x` has shape ``(..., N, K)`` for some
integer ``K``, it is interpreted as a matrix
(or batch of matrices if there are batch dimensions)
and `matmat` is called.
See Also
mul : Equivalent method used by the * operator.
matmul :
Method used by the @ operator which rejects scalar
input before calling this method.
Notes
To perform matrix-vector multiplication on batches of vectors,
use matvec.
For clarity, it is recommended to use the matvec or
matmat methods directly instead of this method
when interacting with dense vectors and matrices.
matmat
matmat(
X
)
Matrix-matrix multiplication.
Performs the operation A @ X where A is an M x N
linear operator (or batch of linear operators)
and X is a dense N x K matrix
(or batch of dense matrices).
Parameters
X : {matrix, ndarray}
An array with shape (..., N, K) representing the dense matrix
(or batch of dense matrices).
Returns
Y : {matrix, ndarray}
An array with shape (..., M, K).
Notes
This method wraps any user-specified matmat routine or overridden
_matmat method to ensure that Y has the correct type.
matvec
matvec(
x
)
Matrix-vector multiplication.
Applies A to x, where A is an M x N
linear operator (or batch of linear operators)
and x is a row vector (or batch of such vectors).
Parameters
x : {matrix, ndarray}
An array with shape (..., N) representing a row vector
(or batch of row vectors).
.. versionadded:: 1.18.0
A ``FutureWarning`` is emitted for column vector input of shape
``(N, 1)``, for which an array with shape ``(M, 1)`` is returned.
`matmat` can be called instead for identical behaviour on such input.
Returns
y : {matrix, ndarray}
An array with shape (..., M).
Notes
This method wraps the user-specified matvec routine or overridden
_matvec method to ensure that y has the correct shape and type.
rdot
rdot(
x
)
Multi-purpose multiplication method from the right.
.. note ::
This method returns ``x A``.
To perform adjoint multiplication instead, use one of
`rmatvec` or `rmatmat`, or take the adjoint first,
like ``self.H.rdot(x)`` or ``x * self.H``.
Parameters
x : array_like or LinearOperator or scalar
Array-like input will be interpreted as a 1-D row vector or
2-D matrix (or batch of matrices)
depending on its shape. See the Returns section for details.
Returns
xA : array or LinearOperator
- For `LinearOperator` input, operator composition is performed.
- For scalar input, a lazily scaled operator is returned.
- Otherwise, the input is expected to take the form of a dense
1-D vector or 2-D matrix (or batch of matrices),
interpreted as follows
(where ``self`` is an ``M`` by ``N`` linear operator):
- If `x` has shape ``(M,)``
it is interpreted as a row vector.
- If `x` has shape ``(..., K, M)`` for some
integer ``K``, it is interpreted as a matrix
(or batch of matrices if there are batch dimensions).
See Also
dot : Multi-purpose multiplication method from the left.
rmul :
Equivalent method, used by the * operator from the right.
rmatmul :
Method used by the @ operator from the right
which rejects scalar input before calling this method.
rmatmat
rmatmat(
X
)
Adjoint matrix-matrix multiplication.
Performs the operation A^H @ X where A is an M x N
linear operator (or batch of linear operators)
and X is a dense M x K matrix
(or batch of dense matrices).
The default implementation defers to the adjoint.
Parameters
X : {matrix, ndarray}
An array with shape (..., M, K) representing the dense matrix
(or batch of dense matrices).
Returns
Y : {matrix, ndarray}
An array with shape (..., N, K).
Notes
This method wraps any user-specified rmatmat routine or overridden
_rmatmat method to ensure that Y has the correct type.
rmatvec
rmatvec(
x
)
Adjoint matrix-vector multiplication.
Applies A^H to x, where A is an
M x N linear operator (or batch of linear operators)
and x is a row vector (or batch of such vectors).
Parameters
x : {matrix, ndarray}
An array with shape (..., M) representing a row vector
(or batch of row vectors),
or an array with shape (M, 1) representing a column vector.
.. versionadded:: 1.18.0
A ``FutureWarning`` is now emitted for column vector input of shape
``(M, 1)``, for which an array with shape ``(N, 1)`` is returned.
`rmatmat` can be called instead for identical behaviour on such input.
Returns
y : {matrix, ndarray}
An array with shape (..., N).
Notes
This method wraps the user-specified rmatvec routine or overridden
_rmatvec method to ensure that y has the correct shape and type.
transpose
transpose()
Transpose.
Returns
LinearOperator
Transpose of the linear operator.
See Also
:attr:~scipy.sparse.linalg.LinearOperator.T : Equivalent attribute.
__add__
__add__(
x
)
Linear operator addition.
The input must be a LinearOperator.
A lazily summed linear operator is returned.
__call__
__call__(
x
)
Apply this linear operator.
Equivalent to __matmul__.
__matmul__
__matmul__(
other
)
Matrix Multiplication.
Used by the @ operator.
Rejects scalar input.
Otherwise, equivalent to dot.
__mul__
__mul__(
x
)
Multiplication.
Used by the * operator. Equivalent to dot.
__neg__
__neg__()
__pow__
__pow__(
p
)
__rmatmul__
__rmatmul__(
other
)
Matrix Multiplication from the right.
Used by the @ operator from the right.
Rejects scalar input.
Otherwise, equivalent to rdot.
__rmul__
__rmul__(
x
)
Multiplication from the right.
Used by the * operator from the right. Equivalent to rdot.
__sub__
__sub__(
x
)
__truediv__
__truediv__(
other
)
Scalar Division.
Returns a lazily scaled linear operator.
View source on GitHub