Skip to content

Add is_entangled Method to Statevector Class for Entanglement Check #14188

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

Open
default741 opened this issue Apr 7, 2025 · 0 comments · May be fixed by #14191
Open

Add is_entangled Method to Statevector Class for Entanglement Check #14188

default741 opened this issue Apr 7, 2025 · 0 comments · May be fixed by #14191
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request

Comments

@default741
Copy link

What should we add?

Currently, the Qiskit Statevector class does not provide a built-in method to easily check if a quantum state is entangled or separable. I have searched extensively for existing implementations or methods within the library and other resources but could not find a straightforward solution.

To address this gap, I've developed a simple yet efficient method, is_entangled, to determine if a given statevector represents an entangled state using the Von Neumann entropy criterion. The method evaluates single-qubit subsystems, and if any subsystem exhibits entropy greater than a specified threshold (epsilon), the state is classified as entangled.

from qiskit.quantum_info import Statevector, DensityMatrix, partial_trace, entropy

def is_entangled(state: Statevector, epsilon: float = 1e-10) -> bool:
    num_qubits = state.num_qubits
    density_matrix = DensityMatrix(state)

    for qubit in range(num_qubits):
        trace_out = [i for i in range(num_qubits) if i != qubit]
        reduced_dm = partial_trace(density_matrix, trace_out)

        subsystem_entropy = entropy(reduced_dm)

        if subsystem_entropy > epsilon:
            return True

    return False

I propose integrating this method directly into the Statevector class or as a utility within qiskit.quantum_info to enhance user experience and simplify entanglement analysis.

@default741 default741 added the type: feature request New feature or request label Apr 7, 2025
default741 added a commit to default741/qiskit that referenced this issue Apr 7, 2025
default741 added a commit to default741/qiskit that referenced this issue Apr 7, 2025
default741 added a commit to default741/qiskit that referenced this issue Apr 7, 2025
default741 added a commit to default741/qiskit that referenced this issue Apr 7, 2025
@ShellyGarion ShellyGarion added the mod: quantum info Related to the Quantum Info module (States & Operators) label Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants