qiskit-documentation/docs/api/qiskit/0.43/qiskit.opflow.primitive_ops...

52 lines
4.1 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: primitive_ops
description: API reference for qiskit.opflow.primitive_ops
in_page_toc_min_heading_level: 2
python_api_type: module
python_api_name: qiskit.opflow.primitive_ops
---
<span id="module-qiskit.opflow.primitive_ops" />
<span id="qiskit-opflow-primitive-ops" />
# qiskit.opflow\.primitive\_ops
<span id="primitive-operators-qiskit-opflow-primitive-ops" />
## Primitive Operators
<span id="module-qiskit.opflow.primitive_ops" />
`qiskit.opflow.primitive_ops`
<Admonition title="Deprecated since version 0.24.0" type="danger">
The [`qiskit.opflow`](opflow#module-qiskit.opflow "qiskit.opflow") module is deprecated and will be removed no earlier than 3 months after the release date. For code migration guidelines, visit [https://qisk.it/opflow\_migration](https://qisk.it/opflow_migration).
</Admonition>
Operators are defined to be functions which take State functions to State functions.
PrimitiveOps are the classes for representing basic Operators, backed by computational Operator primitives from Terra. These classes (and inheritors) primarily serve to allow the underlying primitives to “flow” - i.e. interoperability and adherence to the Operator formalism - while the core computational logic mostly remains in the underlying primitives. For example, we would not produce an interface in Terra in which `QuantumCircuit1 + QuantumCircuit2` equaled the Operator sum of the circuit unitaries, rather than simply appending the circuits. However, within the Operator flow summing the unitaries is the expected behavior.
<Admonition title="Note" type="note">
All mathematical methods are not in-place, meaning that they return a new object, but the underlying primitives are not copied.
</Admonition>
### Primitive Operators
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [`PrimitiveOp`](qiskit.opflow.primitive_ops.PrimitiveOp "qiskit.opflow.primitive_ops.PrimitiveOp")(primitive\[, coeff]) | Deprecated: A class for representing basic Operators, backed by Operator primitives from Terra. |
| [`CircuitOp`](qiskit.opflow.primitive_ops.CircuitOp "qiskit.opflow.primitive_ops.CircuitOp")(\*args, \*\*kwargs) | Deprecated: Class for Operators backed by Terra's `QuantumCircuit` module. |
| [`MatrixOp`](qiskit.opflow.primitive_ops.MatrixOp "qiskit.opflow.primitive_ops.MatrixOp")(\*args, \*\*kwargs) | Deprecated: Class for Operators represented by matrices, backed by Terra's `Operator` module. |
| [`PauliOp`](qiskit.opflow.primitive_ops.PauliOp "qiskit.opflow.primitive_ops.PauliOp")(\*args, \*\*kwargs) | Deprecated: Class for Operators backed by Terra's `Pauli` module. |
| [`PauliSumOp`](qiskit.opflow.primitive_ops.PauliSumOp "qiskit.opflow.primitive_ops.PauliSumOp")(\*args, \*\*kwargs) | Deprecated: Class for Operators backed by Terra's `SparsePauliOp` class. |
| [`TaperedPauliSumOp`](qiskit.opflow.primitive_ops.TaperedPauliSumOp "qiskit.opflow.primitive_ops.TaperedPauliSumOp")(\*args, \*\*kwargs) | Deprecated: Class for PauliSumOp after tapering |
### Symmetries
| | |
| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| [`Z2Symmetries`](qiskit.opflow.primitive_ops.Z2Symmetries "qiskit.opflow.primitive_ops.Z2Symmetries")(symmetries, sq\_paulis, sq\_list) | Deprecated: Z2 Symmetries |