Skip to content

QuantumCircuit __eq__ fails when comparing with None #5015

@raulotaolea

Description

@raulotaolea

Information

Qiskit Terra version: 0.15.1
Python version: 3.7.7
Operating system: MacOS v10.15.6

What is the current behavior?

When two QuantumCircuit objects are compared with == and one of them is None, an error is thrown.

Steps to reproduce the problem

from qiskit import QuantumCircuit
qc1 = QuantumCircuit()
qc2 = None
qc1 == qc2 --> error

What is the expected behavior?

The qc1 == qc2 comparison should always return True or False.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions