Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic circuit & meas level 1 support #1554

Closed
3 tasks done
jyu00 opened this issue Mar 25, 2024 · 2 comments
Closed
3 tasks done

Dynamic circuit & meas level 1 support #1554

jyu00 opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request on hold
Milestone

Comments

@jyu00
Copy link
Collaborator

jyu00 commented Mar 25, 2024

What is the expected feature or enhancement?

Qiskit Runtime primitives will soon support dynamic circuits and measurement level 1 in SamplerV2. qiskit-ibm-runtime will need to make corresponding changes for that.

Acceptance criteria

  • Document that dynamic circuits are supported in SamplerV2 without DD
  • Raise an error if dynamic circuits are passed with DD
  • Separate execution options for SamplerV2 that includes measurement level and return (under meas_type)
@jyu00 jyu00 added enhancement New feature or request on hold labels Mar 25, 2024
@jyu00 jyu00 added this to the 0.23.0 milestone Mar 26, 2024
@ihincks
Copy link
Collaborator

ihincks commented Mar 27, 2024

The two options in the third bullet will actually be lumped into one option called meas_type as follows:

class SamplerExecutionOptions(ExecutionOptions):
    r"""Extension of :class:~.ExecutionOptions` for the sampler primitive."""

    meas_type: Literal["classified", "kerneled", "avg_kerneled"] = "classified"
    r"""How to process and return measurement results.
    
    This option sets the return type of all classical registers in all :class:`~.PubResult`\s.
    If a sampler pub with shape ``pub_shape`` has a circuit that contains a classical register 
    with size ``creg_size``, then the returned data associated with this register will have one of
    the following formats depending on the value of this option.

    * ``"classified"``: A :class:`~.BitArray` of shape ``pub_shape`` over ``num_shots`` with a 
      number of bits equal to ``creg_size``.

    * ``"kerneled"``: A complex NumPy array of shape ``(*pub_shape, num_shots, creg_size)``, where
      each entry represents an IQ data point (resulting from kerneling the measurement trace) in 
      arbitrary units.

    * ``"avg_kerneled"``: A complex NumPy array of shape ``(*pub_shape, creg_size)``, where
      each entry represents an IQ data point (resulting from kerneling the measurement trace and 
      averaging over shots) in arbitrary units. This option is equivalent to selecting
      ``"kerneled"`` and then averaging over the shots axis, but requires less data bandwidth.

    See https://pubs.aip.org/aip/rsi/article/88/10/104703/836456 for a description of kerneling.
    """

This can be further word-smithed. We could also add a note about how "kerneled" is essentially (meas_level=1, meas_return=avg), "avg_kerneled" is (meas_level=1, meas=single), and "classified" is meas_level 2.

@jyu00
Copy link
Collaborator Author

jyu00 commented Apr 15, 2024

Closing since both PRs are merged.

@jyu00 jyu00 closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request on hold
Projects
None yet
Development

No branches or pull requests

3 participants