Skip to content

Commit cdc0408

Browse files
authored
Merge pull request #1784 from qiboteam/summary
Summary stdout + typing
2 parents 3c84ae0 + 371e294 commit cdc0408

File tree

3 files changed

+79
-79
lines changed

3 files changed

+79
-79
lines changed

doc/source/code-examples/examples.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ total number of qubits and all gates in order of the number of times they appear
7070
The QASM name is used as identifier of gates.
7171
For example
7272

73-
.. testcode::
73+
.. code-block:: python
7474
7575
from qibo import Circuit, gates
7676
@@ -81,7 +81,9 @@ For example
8181
circuit.add(gates.CNOT(1, 2))
8282
circuit.add(gates.H(2))
8383
circuit.add(gates.TOFFOLI(0, 1, 2))
84-
print(circuit.summary())
84+
85+
circuit.summary()
86+
8587
# Prints
8688
'''
8789
Circuit depth = 5
@@ -92,17 +94,6 @@ For example
9294
cx: 2
9395
ccx: 1
9496
'''
95-
.. testoutput::
96-
:hide:
97-
98-
Circuit depth = 5
99-
Total number of gates = 6
100-
Number of qubits = 3
101-
Most common gates:
102-
h: 3
103-
cx: 2
104-
ccx: 1
105-
10697
10798
The circuit property ``circuit.gate_types`` (or ``circuit.gate_names``) will return a ``collections.Counter``
10899
that contains the gate types (or names) and the corresponding numbers of appearance. The

0 commit comments

Comments
 (0)