Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.1k stars 2.34k forks source link

Typo on api/qiskit/providers page #13211

Open dbowmansqc opened 6 days ago

dbowmansqc commented 6 days ago

Environment

What is happening?

Code snippet in section custom basis gates on page api/qiskit/providers:


from qiskit.circuit import Gate
from qiskit.circuit import QuantumCircuit

class SYGate(Gate):
    def __init__(self, label=None):
        super().__init__("sy", 1, [], label=label)

    def _define(self):
        qc = QuantumCircuit(1)
        q.ry(np.pi / 2, 0)
        self.definition = qc

penultimate line should read

qc.ry(np.pi / 2, 0)

How can we reproduce the issue?

Typo

What should happen?

should read

qc.ry(np.pi / 2, 0)

Any suggestions?

No response

hegdeashwin commented 6 days ago

I would like to pick this bug as "good first issue".

Cryoris commented 4 days ago

Nice, go ahead @hegdeashwin 👍🏻