diff --git a/notebooks/v1/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb b/notebooks/v1/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb index d68978a73..e610efdbd 100644 --- a/notebooks/v1/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb +++ b/notebooks/v1/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb @@ -160,10 +160,12 @@ " def run(self, thetas):\n", " t_qc = transpile(self._circuit,\n", " self.backend)\n", - " qobj = assemble(t_qc,\n", - " shots=self.shots,\n", - " parameter_binds = [{self.theta: theta} for theta in thetas])\n", - " job = self.backend.run(qobj)\n", + " # Using a qobj for run() is deprecated as of qiskit-aer 0.9.0.\n", + " # Therefore the transpiled qc (t_qc) is directly passed to the run method.\n", + " # qobj = assemble(t_qc,\n", + " # shots=self.shots,\n", + " # parameter_binds = [{self.theta: theta} for theta in thetas])\n", + " job = self.backend.run(t_qc)\n", " result = job.result().get_counts()\n", " \n", " counts = np.array(list(result.values()))\n", diff --git a/notebooks/v2/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb b/notebooks/v2/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb index 758a16539..5bf3467ee 100644 --- a/notebooks/v2/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb +++ b/notebooks/v2/ch-machine-learning/machine-learning-qiskit-pytorch.ipynb @@ -160,10 +160,12 @@ " def run(self, thetas):\n", " t_qc = transpile(self._circuit,\n", " self.backend)\n", - " qobj = assemble(t_qc,\n", - " shots=self.shots,\n", - " parameter_binds = [{self.theta: theta} for theta in thetas])\n", - " job = self.backend.run(qobj)\n", + " # Using a qobj for run() is deprecated as of qiskit-aer 0.9.0.\n", + " # Therefore the transpiled qc (t_qc) is directly passed to the run method.\n", + " # qobj = assemble(t_qc,\n", + " # shots=self.shots,\n", + " # parameter_binds = [{self.theta: theta} for theta in thetas])\n", + " job = self.backend.run(t_qc)\n", " result = job.result().get_counts()\n", " \n", " counts = np.array(list(result.values()))\n",