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

Improve qiskit.circuit.QuantumCircuit page #13300

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cad1c03
Create config.yml
abbycross Dec 4, 2023
185ee78
Update CONTRIBUTING.md
abbycross Dec 4, 2023
2a8978b
Update contributing.md
abbycross Dec 5, 2023
9e5b9cd
Merge branch 'Qiskit:main' into main
abbycross Dec 5, 2023
a61f9cf
Update .github/ISSUE_TEMPLATE/config.yml
abbycross Dec 6, 2023
1757433
Update CONTRIBUTING.md
abbycross Dec 6, 2023
38cc9a0
Merge branch 'main' into main
abbycross Dec 6, 2023
22899e6
code review
abbycross Dec 7, 2023
538aebb
code review
abbycross Dec 7, 2023
1800b91
add migration guide link, add "issues" to header
abbycross Dec 7, 2023
d6bd6bf
add to toc at top, update anchor tag
abbycross Dec 7, 2023
e6d068e
Update CONTRIBUTING.md
abbycross Dec 7, 2023
77a28fb
Merge remote-tracking branch 'upstream/main'
abbycross Oct 4, 2024
425ba27
Merge remote-tracking branch 'upstream/main'
abbycross Oct 8, 2024
a0fe84d
Add code example to class description
abbycross Oct 8, 2024
614a460
Merge branch 'main' into main
abbycross Oct 8, 2024
a94a099
add data example
abbycross Oct 18, 2024
9b8b3fb
first attempt to add global_phase examples
abbycross Oct 18, 2024
0f110c0
add :context:
abbycross Oct 21, 2024
88a7972
Merge branch 'main' into main
abbycross Oct 21, 2024
e0dedbf
tox -e black
abbycross Oct 22, 2024
b533bc5
shorten line
abbycross Oct 22, 2024
e0760db
Merge remote-tracking branch 'upstream/main'
abbycross Oct 23, 2024
05df475
example for name attr
abbycross Oct 23, 2024
f7409b0
example of metadata attr
abbycross Oct 23, 2024
ffc2d4e
clarify it's a dictionary, copyedit
abbycross Oct 24, 2024
31bb0d6
ex. for qregs cregs qubits ancilla clbits
abbycross Oct 24, 2024
d49d26b
tox -e black fix
abbycross Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,34 @@ class QuantumCircuit:
structures that go with it, how it fits into the rest of the :mod:`qiskit` package, and the
different regimes of quantum-circuit descriptions in Qiskit, see the module-level
documentation of :mod:`qiskit.circuit`.

Example:
abbycross marked this conversation as resolved.
Show resolved Hide resolved

.. plot::
:include-source:
:nofigs:

from qiskit import QuantumCircuit

# Create a new circuit with two qubits
qc = QuantumCircuit(2)

# Add a Hadamard gate to qubit 0
qc.h(0)

# Perform a controlled-X gate on qubit 1, controlled by qubit 0
qc.cx(0, 1)

# Return a text drawing of the circuit.
qc.draw()

.. code-block:: text

┌───┐
q_0: ┤ H ├──■──
└───┘┌─┴─┐
q_1: ─────┤ X ├
└───┘

Circuit attributes
==================
Expand Down
Loading