Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect elements in anti commutation graph for abelian grouping #6645

Closed
irajput opened this issue Jun 25, 2021 · 5 comments
Closed

Incorrect elements in anti commutation graph for abelian grouping #6645

irajput opened this issue Jun 25, 2021 · 5 comments
Labels
bug Something isn't working mod: opflow Related to the Opflow module

Comments

@irajput
Copy link
Contributor

irajput commented Jun 25, 2021

Information

  • Qiskit Terra version: 0.17.4
  • Python version: 3.9.5
  • Operating system: macOS Big Sur

What is the current behavior?

The _anti_commutation_graph function which is used by group_ops in AbelianGrouper sometimes returns anti commutation graphs which has edges with commutable operators instead of anti-commutable operators.

Below, acg is the anti commutation graph for sparse_pauli. acg contains (1,2) which corresponds to the Sparse Pauli operators ('XX', (coeff)) and ('YY', (coeff)) which are commutable. Therefore, (1,2) should not be in the anti commutation graph.

Steps to reproduce the problem

from qiskit.quantum_info import SparsePauliOp, Operator
from qiskit.opflow import PauliSumOp, AbelianGrouper
import numpy as np
sparse_pauli=SparsePauliOp([[0, 0, 0, 0],[1,1,0,0],[1,1,1,1]])
#sparse_pauli.to_list() returns [('II', (1+0j)), ('XX', (1+0j)), ('YY', (1+0j))]
pauli_sum=PauliSumOp(sparse_pauli)
acg=AbelianGrouper()._anti_commutation_graph(pauli_sum)

What is the expected behavior?

The _anti_commutation_graph function should only return edges which have operators that are not commutable.

Note: Fixing #6624 would also fix this issue for group_ops implemented with PauliLists.

@irajput irajput added the bug Something isn't working label Jun 25, 2021
@woodsp-ibm woodsp-ibm added the mod: opflow Related to the Opflow module label Jun 26, 2021
@jlapeyre
Copy link
Contributor

I think it may not be worth fixing this bug. I don't know the origin anyway. It depends on how when the PauliList PR is merged (#5993) and when a PR for #6624 might be ready.

@ikkoham
Copy link
Contributor

ikkoham commented Jun 28, 2021

This is not a bug. AbelianGrouper assumes qubit-wise commutativity, so XX and YY can't belong the same group.

@jlapeyre
Copy link
Contributor

jlapeyre commented Jun 28, 2021

What does qubit-wise commutativity mean? Each pair of qubits must commute? Doesn't this mean only identical strings commute?
EDIT: Ok. Isha showed me an explanation.

@ikkoham
Copy link
Contributor

ikkoham commented Jun 28, 2021

Each pair of qubits must commute?

Yes. for example, XI and XX are qubit-wise commutable.
This concept is introduced in https://arxiv.org/abs/1704.05018.
They said grouping into TPB sets.

@jlapeyre
Copy link
Contributor

jlapeyre commented Jun 28, 2021

What is the meaning of TPB? I see this acronym sometimes in qiskit comments, for example in the abelian_grouper.py.
EDIT: TPB = Tensor Product Basis.

@irajput irajput closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mod: opflow Related to the Opflow module
Projects
None yet
Development

No branches or pull requests

4 participants