Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Dec 7, 2023
1 parent 6ffdecb commit 6da040f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docs/source/example_big_circuit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
"source": [
"Qlasskit is capable of producing large circuit without any issue. The only thing that you have to do, is to use the `fastOptimizer`, since running CSE is too slow on large expressions lists.\n",
"\n",
"In the next example we are going to create a quantum circuit with 64 `Qint8` in input, and one `Qint8` in output, resulting on a circuit of ~1000 qubits and ~16000 gates in around 2 seconds."
"In the next example we are going to create a quantum circuit with 32 `Qint8` in input, and one `Qint8` in output, resulting on a circuit of ~527 qubits and ~8000 gates in around 8 seconds."
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 55,
"metadata": {},
"outputs": [],
"source": [
"from qlasskit import Qint8, Qlist, boolopt, qlassfa\n",
"\n",
"@qlassfa(bool_optimizer=boolopt.fastOptimizer)\n",
"def test(message: Qlist[Qint8, 64]) -> Qint8:\n",
"def test(message: Qlist[Qint8, 32]) -> Qint8:\n",
" h_val = Qint8(0)\n",
" for c in message:\n",
" h_val = ((h_val >> 4) + c) & 0xFF\n",
Expand All @@ -34,14 +34,14 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 56,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"QCircuit test\t\tGates: 16540\t\tQubits: 1039\n"
"QCircuit<test>(8248 gates, 527 qubits)\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion qlasskit/algorithms/deutschjozsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(

self.f: QlassF = f
self.search_space_size = len(f.args[0])
self._qcircuit = QCircuit(self.f.num_qubits)
self._qcircuit = QCircuit(self.f.num_qubits, name=f"deutsch_" + f.name)

self._f_circuit = self.f.circuit()

Expand Down
2 changes: 1 addition & 1 deletion qlasskit/algorithms/grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(

self.n_iterations = n_iterations

self._qcircuit = QCircuit(self.search_space_size)
self._qcircuit = QCircuit(self.search_space_size, name=f"grover_" + oracle.name)

# State preparation
self._qcircuit.barrier(label="s")
Expand Down
2 changes: 1 addition & 1 deletion qlasskit/algorithms/simon.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(

self.f: QlassF = f
self.search_space_size = len(f.args[0])
self._qcircuit = QCircuit(self.f.num_qubits)
self._qcircuit = QCircuit(self.f.num_qubits, name=f"simon_" + f.name)

# State preparation
self._qcircuit.barrier(label="s")
Expand Down
6 changes: 3 additions & 3 deletions qlasskit/qcircuit/qcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def get_key_by_index(self, i: int):
if self.qubit_map[key] == i:
return key
raise Exception(f"Qubit with index {i} not found")

def __repr__(self):
""" Return a string representation of the QCircuit """
return f'QCircuit {self.name}\t\tGates: {self.num_gates}\t\tQubits: {self.num_qubits}'
"""Return a string representation of the QCircuit"""
return f"QCircuit<{self.name}>({self.num_gates} gates, {self.num_qubits} qubits)"

def __contains__(self, key: Union[str, Symbol, int]):
"""Return True if the circuit contain a qubit with a given name/symbol"""
Expand Down

0 comments on commit 6da040f

Please sign in to comment.