Skip to content

Commit

Permalink
docs: Update notebooks (#167)
Browse files Browse the repository at this point in the history
* Update notebooks

* Formatting fix
  • Loading branch information
daniel-mills-cqc authored Jan 30, 2025
1 parent e4408d3 commit 6faf79b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions example_notebooks/blind_z_gate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Blind Z Gate\n",
"\n",
"In the following we exemplify how to implement an X gate with `pytket-mbqc`.\n",
"In the following we exemplify how to implement an Z gate with `pytket-mbqc`.\n",
"\n",
"We first initialise a graph state with 2 physical qubits and 3 logical qubits. The number of logical qubits can be higher than the number of phisical qubits if qubits are reused, as is the case here."
]
Expand Down Expand Up @@ -35,7 +35,7 @@
"id": "3515b03b",
"metadata": {},
"source": [
"Note that before any operations constructing a graph state have been added there is a round of randomness generation. This randomness is saved in the `rand` registers.\n",
"Note that before any operations constructing a graph state have been added there is a round of randomness generation. \n",
"\n",
"Next we create a linear cluster state consisting of 3 qubits. Note that vertices are measured once all of the edges they connect to are added. This allows for some qubit reuse.\n",
"\n",
Expand All @@ -53,7 +53,7 @@
"\n",
"input_vertex = graph_circuit.add_graph_vertex(measurement_order=0)\n",
"\n",
"graph_vertex = graph_circuit.add_graph_vertex(measurement_order=None)\n",
"graph_vertex = graph_circuit.add_graph_vertex(measurement_order=1)\n",
"graph_circuit.add_edge(input_vertex, graph_vertex)\n",
"graph_circuit.corrected_measure(vertex=input_vertex, t_multiple=4)\n",
"\n",
Expand Down Expand Up @@ -101,7 +101,7 @@
"compiled_circuit = backend.get_compiled_circuit(graph_circuit)\n",
"n_shots = 100\n",
"result = backend.run_circuit(circuit=compiled_circuit, n_shots=n_shots)\n",
"result.get_counts(cbits=output_reg)"
"graph_circuit.get_output_result(result=result).get_counts()"
]
}
],
Expand Down
5 changes: 4 additions & 1 deletion example_notebooks/verified_z_gate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"metadata": {},
"outputs": [],
"source": [
"import networkx as nx\n",
"import pytest\n",
"\n",
"from ocvqc_py import GraphCircuit\n",
Expand All @@ -41,7 +42,9 @@
"graph_circuit.add_edge(vertex_two, vertex_three)\n",
"graph_circuit.corrected_measure(vertex=vertex_two, t_multiple=0)\n",
"\n",
"graph_circuit.corrected_measure(vertex=vertex_three, t_multiple=0)"
"graph_circuit.corrected_measure(vertex=vertex_three, t_multiple=0)\n",
"\n",
"nx.draw(graph_circuit.entanglement_graph, with_labels=True)"
]
},
{
Expand Down

0 comments on commit 6faf79b

Please sign in to comment.