Fix hpc parameters handling

This commit is contained in:
Diego M. Rodriguez 2017-12-22 22:08:20 +01:00
parent 67490ede64
commit fd8d06894e
2 changed files with 19 additions and 1 deletions

View File

@ -127,6 +127,15 @@ The parameters can be specified to ``QuantumProgram.compile()`` and
'omp_num_threads': 16
})
If the ``ibmqx_hpc_qasm_simulator`` backend is used and the ``hpc`` parameter
is not specified, the following values will be used by default:
.. code-block:: python
hpc={
'multi_shot_optimization': True,
'omp_num_threads': 16
}
Please note that these parameters must only be used for the
``ibmqx_hpc_qasm_simulator``, and will be reset to None along with emitting

View File

@ -63,7 +63,16 @@ class QeRemote(BaseBackend):
hpc = None
if (qobj['config']['backend'] == 'ibmqx_hpc_qasm_simulator' and
'hpc' in qobj['config']):
hpc = qobj['config']['hpc']
try:
# Use CamelCase when passing the hpc parameters to the API.
hpc = {
'multiShotOptimization':
qobj['config']['hpc']['multi_shot_optimization'],
'ompNumThreads':
qobj['config']['hpc']['omp_num_threads']
}
except:
hpc = None
output = self._api.run_job(api_jobs, qobj['config']['backend'],
shots=qobj['config']['shots'],