Skip to content

Commit

Permalink
Merge pull request #38 from qiboteam/fixticks
Browse files Browse the repository at this point in the history
Disable minor ticks in time evolution plot
  • Loading branch information
scarrazza authored Mar 16, 2022
2 parents eb62385 + 789431d commit 241ba51
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 58 deletions.
6 changes: 4 additions & 2 deletions plots/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def plot_dense(data, quantity, nqubits, fontsize=30, legend=True, save=False):
plt.show()


def plot_trotter(data, quantity, nqubits, fontsize=30, legend=False, save=False):
def plot_trotter(data, quantity, nqubits, fontsize=30, yticks=None, legend=False, save=False):
matplotlib.rcParams["font.size"] = fontsize

cpu_cp = sns.color_palette("Oranges", 4)
Expand Down Expand Up @@ -92,7 +92,9 @@ def plot_trotter(data, quantity, nqubits, fontsize=30, legend=False, save=False)

if legend:
plt.legend(fontsize="small")

if yticks is not None:
plt.minorticks_off()
plt.yticks(yticks)
if save:
plt.savefig(f"evolution_trotter_{nqubits}qubits_{quantity}.pdf", bbox_inches="tight")
else:
Expand Down
112 changes: 56 additions & 56 deletions plots/paper-plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"id": "f4d6d97f",
"metadata": {},
"source": [
"## Figure 2\n",
"## Figure 3\n",
"\n",
"Bar plot with import breakdown and dry run vs simulation comparison for qibojit."
]
Expand All @@ -60,7 +60,7 @@
"id": "6e2eeb0b",
"metadata": {},
"source": [
"## Figure 3\n",
"## Figure 4\n",
"\n",
"Scaling plots of execution time as a function of the number of qubits for all qibo backends."
]
Expand Down Expand Up @@ -88,7 +88,7 @@
"id": "8cb5555a",
"metadata": {},
"source": [
"## Figure 4\n",
"## Figure 5\n",
"\n",
"qibojit backend performance on different CPU and GPU devices."
]
Expand Down Expand Up @@ -131,7 +131,7 @@
"id": "5cd4c946",
"metadata": {},
"source": [
"## Figure 5\n",
"## Figure 6\n",
"\n",
"Bar plot with different multigpu configurations and qibojit vs qibotf comparison."
]
Expand All @@ -157,7 +157,7 @@
"id": "64538a61",
"metadata": {},
"source": [
"## Figure 6\n",
"## Figure 7\n",
"\n",
"Bar plot with comparisons between different simulation libraries on various circuits."
]
Expand Down Expand Up @@ -198,61 +198,12 @@
"plot_libraries(libraries, cpu_data, gpu_data, \"total_dry_time\", 30, precision=\"double\", legend=True, save=save)"
]
},
{
"cell_type": "markdown",
"id": "a5392b2d",
"metadata": {},
"source": [
"## Figure 7 \n",
"\n",
"Scaling plot vs time dt for adiabatic evolution of TFIM Hamiltonian using the dense form."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6d7c77f0",
"metadata": {},
"outputs": [],
"source": [
"from evolution import plot_dense\n",
"\n",
"data = load_evolution_data(\"data/evolution.dat\")\n",
"plot_dense(data, \"total_dry_time\", 10, save=save)"
]
},
{
"cell_type": "markdown",
"id": "0b8e88e7",
"metadata": {},
"source": [
"## Figure 8\n",
"\n",
"Scaling plot vs time dt for adiabatic evolution of TFIM Hamiltonian using the Trotter decomposition."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "67f4884c",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"from evolution import plot_trotter\n",
"\n",
"data = load_evolution_data(\"data/evolution.dat\")\n",
"plot_trotter(data, \"total_dry_time\", 10, save=save)\n",
"plot_trotter(data, \"total_dry_time\", 20, legend=True, save=save)"
]
},
{
"cell_type": "markdown",
"id": "20eb1827",
"metadata": {},
"source": [
"## Figure 9\n",
"## Figure 8\n",
"\n",
"Bar plot comparing fusion vs no fusion for all qibojit platforms and circuits"
]
Expand All @@ -278,7 +229,7 @@
"id": "909fbaeb",
"metadata": {},
"source": [
"## Figure 10\n",
"## Figure 9\n",
"\n",
"Bar plot comparing two-qubit fusion for different libraries (qibo, qiskit, qsim)."
]
Expand Down Expand Up @@ -311,6 +262,55 @@
"plot_libraries(libraries, cpu_data, gpu_data, \"total_dry_time\", 30, precision=\"single\", \n",
" legend=True, fontsize=45, logscale=True, fusion=True, save=save)"
]
},
{
"cell_type": "markdown",
"id": "a5392b2d",
"metadata": {},
"source": [
"## Figure 10\n",
"\n",
"Scaling plot vs time dt for adiabatic evolution of TFIM Hamiltonian using the dense form."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6d7c77f0",
"metadata": {},
"outputs": [],
"source": [
"from evolution import plot_dense\n",
"\n",
"data = load_evolution_data(\"data/evolution.dat\")\n",
"plot_dense(data, \"total_dry_time\", 10, save=save)"
]
},
{
"cell_type": "markdown",
"id": "0b8e88e7",
"metadata": {},
"source": [
"## Figure 11\n",
"\n",
"Scaling plot vs time dt for adiabatic evolution of TFIM Hamiltonian using the Trotter decomposition."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "67f4884c",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"from evolution import plot_trotter\n",
"\n",
"data = load_evolution_data(\"data/evolution.dat\")\n",
"plot_trotter(data, \"total_dry_time\", 10, yticks=[1, 10], legend=True, save=save)\n",
"plot_trotter(data, \"total_dry_time\", 20, yticks=[1, 10, 100], legend=False, save=save)"
]
}
],
"metadata": {
Expand Down

0 comments on commit 241ba51

Please sign in to comment.