question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default value of `meas_return` should be `single`.

See original GitHub issue

Information

  • Qiskit Terra version:
  • Python version:
  • Operating system:

What is the current behavior?

Currently default values of meas_level and meas_return are respectively set to 2 and avg. https://github.com/Qiskit/qiskit-terra/blob/fa09a7f6d2c6d6b35f8b221221264f7a437a5b17/qiskit/compiler/assemble.py#L30-L39

However meas_level=2 and meas_return='avg' are invalid combination and this error is caught by qobj validator in ibmq provider.

Steps to reproduce the problem

qobj = qiskit.assemble(some_schedule, backend)
backend.rund(qobj) # error raises here

What is the expected behavior?

invalid default setting should be replaced.

Suggested solutions

maybe one of below

  1. change default meas_return to single
  2. add validation in assembler
  3. overwrite meas_return if meas_level is 2.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
taalexandercommented, Dec 21, 2019

This is a problem with the schemas. Both are required for the schemas to pass validation even in measurement level 2. The schemas would have to be updated to be conditional if this was to be fixed properly.

On Fri, Dec 20, 2019, 10:47 PM nkanazawa notifications@github.com wrote:

I was using old master branch but the problem doesn’t happen now (I’m not sure the commit id causing problem), but I don’t think it is ignored.

import qiskit

qiskit.IBMQ.load_account()

provider = qiskit.IBMQ.get_provider(hub=‘‘, group=’’, project=‘‘) backend = provider.get_backend(’’)

qc = qiskit.QuantumCircuit(1, 1) qc.h(0) qc.measure(0, 0)

qobj = qiskit.assemble(qiskit.schedule(qiskit.transpile(qc, backend), backend), backend, meas_level=2)

then qobj.config says

meas_level=2, meas_lo_freq=[7.264856891, 7.070226896, 7.222414155, 7.130569974, 7.215856761, 6.979389665, 7.140246272, 7.034825806, 7.297209412, 7.097757684, 7.286899984, 7.054657786, 7.203657122, 7.153318307, 7.182410566, 6.975843032, 7.133222076, 7.018386448, 7.30700796, 7.104129811], meas_return=‘avg’ …

the combination of meas_level=2 and meas_return=‘avg’ may be ignored in our backend, but this is not true for other providers. is it is ignored, we should remove this from qobj.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Qiskit/qiskit-terra/issues/3627?email_source=notifications&email_token=AAL3LNT3VAA3NTNYQNPBCH3QZWGVRA5CNFSM4J4IGZN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHOUKHY#issuecomment-568149279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL3LNUONXTW6A26CYWSF53QZWGVRANCNFSM4J4IGZNQ .

0reactions
taalexandercommented, Jan 7, 2020

Closing as this is not an issue as we do not plan to implement conditional JSON schemas. Extra parameters are fine to be ignored.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Ways to Set Default Value in JavaScript | SamanthaMing.com
Let's break down the 3 different ways to set Default Values using logical operator ... The value produced will always be the value...
Read more >
Executing Experiments ( qiskit.execute_function )
If a single LO config or dict is used, the values are set at job level. If a list is used, ... If...
Read more >
Assigning default values to shell variables with a single ...
how would I set multiple default values? I tried ": ${VARIABLE:=DEFAULT_VALUE} : ${VARIABLE2:=DEFAULT_VALUE2}" but that doesnt seem to work... – Björn.
Read more >
value expressions - produce the default value for any type
Use the default value expressions to obtain the default, uninitialized value of a type. The default value expression can be used with ...
Read more >
Default parameters - JavaScript - MDN Web Docs
Now, you can assign 1 as the default value for b in the function head: ... Note: Parameters after the first default parameter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found