29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
---
|
||
title: check_commutativity
|
||
description: API reference for qiskit.aqua.operators.legacy.check_commutativity
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: function
|
||
python_api_name: qiskit.aqua.operators.legacy.check_commutativity
|
||
---
|
||
|
||
# qiskit.aqua.operators.legacy.check\_commutativity
|
||
|
||
<Function id="qiskit.aqua.operators.legacy.check_commutativity" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/operators/legacy/common.py" signature="check_commutativity(op_1, op_2, anti=False)">
|
||
Check the (anti-)commutativity between two operators.
|
||
|
||
**Parameters**
|
||
|
||
* **op\_1** ([*WeightedPauliOperator*](qiskit.aqua.operators.legacy.WeightedPauliOperator "qiskit.aqua.operators.legacy.WeightedPauliOperator")) – operator
|
||
* **op\_2** ([*WeightedPauliOperator*](qiskit.aqua.operators.legacy.WeightedPauliOperator "qiskit.aqua.operators.legacy.WeightedPauliOperator")) – operator
|
||
* **anti** (*bool*) – if True, check anti-commutativity, otherwise check commutativity.
|
||
|
||
**Returns**
|
||
|
||
whether or not two operators are commuted or anti-commuted.
|
||
|
||
**Return type**
|
||
|
||
bool
|
||
</Function>
|
||
|