Skip to content

Commit

Permalink
Demo checks for v0.37 (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiro-Raven authored Jul 5, 2024
1 parent 13fc290 commit 62bff23
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 72 deletions.
4 changes: 2 additions & 2 deletions demonstrations/getting_started_with_hybrid_jobs.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"dateOfPublication": "2023-10-16T00:00:00+00:00",
"dateOfLastModification": "2024-03-04T00:00:00+00:00",
"dateOfLastModification": "2024-07-04T00:00:00+00:00",
"categories": [
"Devices and Performance"
],
Expand Down Expand Up @@ -35,4 +35,4 @@
"logo": "/_static/hardware_logos/aws.png"
}
]
}
}
8 changes: 4 additions & 4 deletions demonstrations/getting_started_with_hybrid_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@
.. warning::
The following demo is only compatible with Python version 3.10 and PennyLane v0.32.
The following demo is only compatible with Python version 3.10.
"""


######################################################################
# First, we define a quantum simulator to run the algorithm on. In this example, we will use the Braket
# local simulator before moving onto a QPU.
Expand Down Expand Up @@ -250,8 +249,9 @@ def circuit(params):

import pandas as pd
import matplotlib.pyplot as plt
from braket.jobs.metrics_data.definitions import MetricType

df = pd.DataFrame(job.metrics())
df = pd.DataFrame(job.metrics(metric_type=MetricType.ITERATION_NUMBER))
df.sort_values(by=["iteration_number"], inplace=True)

plt.plot(df["iteration_number"], df["expval"], "-o", color="orange")
Expand Down Expand Up @@ -373,7 +373,7 @@ def circuit(params):
# is not as smooth as the simulator, but the minimum still is detected correctly!
#

df = pd.DataFrame(qpu_job.metrics())
df = pd.DataFrame(qpu_job.metrics(metric_type=MetricType.ITERATION_NUMBER))
df.sort_values(by=["iteration_number"], inplace=True)

plt.plot(df["iteration_number"], df["expval"], "-o", color="teal")
Expand Down
4 changes: 2 additions & 2 deletions demonstrations/oqc_pulse.metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"dateOfPublication": "2023-10-30T00:00:00+00:00",
"dateOfLastModification": "2024-01-01T00:00:00+00:00",
"dateOfLastModification": "2024-07-04T00:00:00+00:00",
"categories": [
"Quantum Computing"
],
Expand Down Expand Up @@ -71,4 +71,4 @@
"weight": 1.0
}
]
}
}
Loading

0 comments on commit 62bff23

Please sign in to comment.