Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
integers correspond to higher priority. If not specified, the QPU
object's default priority is used.
:return: The QPU object itself.
"""
# This prevents a common error where users expect QVM.run()
# and QPU.run() to be interchangeable. QPU.run() needs the
# supplied executable to have been compiled, QVM.run() does not.
if isinstance(self._executable, Program):
raise TypeError(
"It looks like you have provided a Program where an Executable"
" is expected. Please use QuantumComputer.compile() to compile"
" your program."
)
super().run()
request = QPURequest(
program=self._executable.program,
patch_values=self._build_patch_values(),
id=str(uuid.uuid4()),
)
job_priority = run_priority if run_priority is not None else self.priority
job_id = self.client.call(
"execute_qpu_request", request=request, user=self.user, priority=job_priority
)
results = self._get_buffers(job_id)
ro_sources = self._executable.ro_sources
if results:
bitstrings = _extract_bitstrings(ro_sources, results)
elif not ro_sources:
warnings.warn(