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

Device deprecations #4744

Closed
MichaelBroughton opened this issue Dec 10, 2021 · 1 comment
Closed

Device deprecations #4744

MichaelBroughton opened this issue Dec 10, 2021 · 1 comment
Assignees
Labels
area/devices kind/task for tracking progress on larger efforts triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@MichaelBroughton
Copy link
Collaborator

Summarize the task
As a part of the devices p1 and p2 we plan to move some behaviors and functionalities out of devices (in order to ensure the class is focused on validating). This issue is to track the deprecation progress of device functionality.

Acceptance criteria - when is the task considered done?

  1. Deprecate the ability to construct a circuit with a device attached.
  2. Deprecate the QidPairs and qid_pairs functionality. (Replacement logic will be in MetaData from the nx.Graph)
  3. Deprecate the can_add_operation_into_moment functionality ("online" validation was decided that it was not worth trying to support in addition to existing validation paths)
  4. Deprecate decompose_operation.
  5. Deprecate qubit_set and move it over to MetaData.

Related

Related issues: #4743

@MichaelBroughton MichaelBroughton added kind/task for tracking progress on larger efforts triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add labels Dec 10, 2021
@MichaelBroughton MichaelBroughton self-assigned this Dec 10, 2021
CirqBot pushed a commit that referenced this issue Jan 7, 2022
…cuit.device deprecation (#4757)

First devices removal as a part of #4744 .

The high level plan for deprecation is to:

1. pull all components of the library off of `.device` and onto `._device` to keep existing behavior working.
2. Deprecate dependent functionality that relies on `.device`.
3. After all dependency deprecations are done, deprecate the `.device` property in `cirq-core` circuits.py.
4. After the deprecation cycle is over, delete .device and _device properties from circuit, abstractcircuit, frozencircuit etc.

This PR is tackles `cirq-pasqal`.
CirqBot pushed a commit that referenced this issue Jan 11, 2022
Next step in #4744 .  Removes use of device attachment ability in cirq-google. This is a breaking change in the sense that some methods become "more forgiving" which I've highlighted below. Happy to add the tag if people think it's appropriate to label it.
CirqBot pushed a commit that referenced this issue Jan 13, 2022
Another sub-component for #4744 . This removes the use of `circuit.device` from all contrib modules.

BREAKING_CHANGE=removing the `device` property from the `SwapNetwork` class.
It also removes some type checking done by the code (all logic in the bulk still works), which makes it more forgiving.

With the amount of meaningful maintenance contrib has had (not much), I'm not a huge fan of going through a deprecation process for these mild behavior widenings with no API changes. Are others alright with this ?
CirqBot pushed a commit that referenced this issue Jan 14, 2022
Second part of #4744 

As far as I can tell there was just one use of `.device` in cirq-aqt in the form of an assertion that the attached device to a circuit was in fact a `cirq.IonDevice` where no call to validate ever took place. Also somewhat confusingly the number of qubits used in simulation would be dictated by the device qubit count instead of the circuit qubit count which could lead to some confusion on the users end.

I've gone ahead and just removed the use of device to revert this confusing behavior (which does make this a breaking change).
CirqBot pushed a commit that referenced this issue Jan 19, 2022
CirqBot pushed a commit that referenced this issue Jan 21, 2022
Adds metadata property default to None to all devices. I'm going to leave this open to vendors to add to this as they see fit. Part of #4743 . Note that if in the process of deprecating other things for #4744 , I will pull vendor devices onto using metadata to keep behavior working.
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
…cuit.device deprecation (quantumlib#4757)

First devices removal as a part of quantumlib#4744 .

The high level plan for deprecation is to:

1. pull all components of the library off of `.device` and onto `._device` to keep existing behavior working.
2. Deprecate dependent functionality that relies on `.device`.
3. After all dependency deprecations are done, deprecate the `.device` property in `cirq-core` circuits.py.
4. After the deprecation cycle is over, delete .device and _device properties from circuit, abstractcircuit, frozencircuit etc.

This PR is tackles `cirq-pasqal`.
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
Next step in quantumlib#4744 .  Removes use of device attachment ability in cirq-google. This is a breaking change in the sense that some methods become "more forgiving" which I've highlighted below. Happy to add the tag if people think it's appropriate to label it.
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
Another sub-component for quantumlib#4744 . This removes the use of `circuit.device` from all contrib modules.

BREAKING_CHANGE=removing the `device` property from the `SwapNetwork` class.
It also removes some type checking done by the code (all logic in the bulk still works), which makes it more forgiving.

With the amount of meaningful maintenance contrib has had (not much), I'm not a huge fan of going through a deprecation process for these mild behavior widenings with no API changes. Are others alright with this ?
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
Second part of quantumlib#4744 

As far as I can tell there was just one use of `.device` in cirq-aqt in the form of an assertion that the attached device to a circuit was in fact a `cirq.IonDevice` where no call to validate ever took place. Also somewhat confusingly the number of qubits used in simulation would be dictated by the device qubit count instead of the circuit qubit count which could lead to some confusion on the users end.

I've gone ahead and just removed the use of device to revert this confusing behavior (which does make this a breaking change).
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
MichaelBroughton added a commit to MichaelBroughton/Cirq that referenced this issue Jan 22, 2022
Adds metadata property default to None to all devices. I'm going to leave this open to vendors to add to this as they see fit. Part of quantumlib#4743 . Note that if in the process of deprecating other things for quantumlib#4744 , I will pull vendor devices onto using metadata to keep behavior working.
CirqBot pushed a commit that referenced this issue Jan 28, 2022
Deprecate `qid_pairs`. Next step on #4744 .

This also makes a small update to the DeviceMetadata to make optional fields required (since the metadata property itself is optional this seems fine).
CirqBot pushed a commit that referenced this issue Jan 31, 2022
CirqBot pushed a commit that referenced this issue Feb 16, 2022
This deprecates qubit_set on `UnconstrainedDevice`, `Device` and `HyperGraphDevice` in contrib. Note that device already has metadata. UnconstrainedDevice probably shouldn't have a metadata and to add Metadata for HyperGraphDevice, might take a non-trivial amount of work. Maybe we open an issue for this ?

xref: #4744 .
95-martin-orion pushed a commit to 95-martin-orion/Cirq that referenced this issue Mar 2, 2022
Yet more of quantumlib#4744 .

It also looks like now we can get rid of the device shim @mpharrigan , @dstrain115 (will leave to seperate PR).
95-martin-orion pushed a commit to 95-martin-orion/Cirq that referenced this issue Mar 2, 2022
95-martin-orion pushed a commit to 95-martin-orion/Cirq that referenced this issue Mar 2, 2022
95-martin-orion pushed a commit to 95-martin-orion/Cirq that referenced this issue Mar 2, 2022
This deprecates qubit_set on `UnconstrainedDevice`, `Device` and `HyperGraphDevice` in contrib. Note that device already has metadata. UnconstrainedDevice probably shouldn't have a metadata and to add Metadata for HyperGraphDevice, might take a non-trivial amount of work. Maybe we open an issue for this ?

xref: quantumlib#4744 .
@MichaelBroughton
Copy link
Collaborator Author

Closing now since this is finished. Now just a matter of removing the deprecations themselves once the right version comes around.

rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
…cuit.device deprecation (quantumlib#4757)

First devices removal as a part of quantumlib#4744 .

The high level plan for deprecation is to:

1. pull all components of the library off of `.device` and onto `._device` to keep existing behavior working.
2. Deprecate dependent functionality that relies on `.device`.
3. After all dependency deprecations are done, deprecate the `.device` property in `cirq-core` circuits.py.
4. After the deprecation cycle is over, delete .device and _device properties from circuit, abstractcircuit, frozencircuit etc.

This PR is tackles `cirq-pasqal`.
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Next step in quantumlib#4744 .  Removes use of device attachment ability in cirq-google. This is a breaking change in the sense that some methods become "more forgiving" which I've highlighted below. Happy to add the tag if people think it's appropriate to label it.
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Another sub-component for quantumlib#4744 . This removes the use of `circuit.device` from all contrib modules.

BREAKING_CHANGE=removing the `device` property from the `SwapNetwork` class.
It also removes some type checking done by the code (all logic in the bulk still works), which makes it more forgiving.

With the amount of meaningful maintenance contrib has had (not much), I'm not a huge fan of going through a deprecation process for these mild behavior widenings with no API changes. Are others alright with this ?
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Second part of quantumlib#4744 

As far as I can tell there was just one use of `.device` in cirq-aqt in the form of an assertion that the attached device to a circuit was in fact a `cirq.IonDevice` where no call to validate ever took place. Also somewhat confusingly the number of qubits used in simulation would be dictated by the device qubit count instead of the circuit qubit count which could lead to some confusion on the users end.

I've gone ahead and just removed the use of device to revert this confusing behavior (which does make this a breaking change).
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Adds metadata property default to None to all devices. I'm going to leave this open to vendors to add to this as they see fit. Part of quantumlib#4743 . Note that if in the process of deprecating other things for quantumlib#4744 , I will pull vendor devices onto using metadata to keep behavior working.
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Deprecate `qid_pairs`. Next step on quantumlib#4744 .

This also makes a small update to the DeviceMetadata to make optional fields required (since the metadata property itself is optional this seems fine).
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Yet another deprecation for quantumlib#4744 . Vendor deprecations of this fxn to follow.
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Also adds the metadata field to devices. More of quantumlib#4744 .
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
Yet more of quantumlib#4744 .

It also looks like now we can get rid of the device shim @mpharrigan , @dstrain115 (will leave to seperate PR).
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
This deprecates qubit_set on `UnconstrainedDevice`, `Device` and `HyperGraphDevice` in contrib. Note that device already has metadata. UnconstrainedDevice probably shouldn't have a metadata and to add Metadata for HyperGraphDevice, might take a non-trivial amount of work. Maybe we open an issue for this ?

xref: quantumlib#4744 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devices kind/task for tracking progress on larger efforts triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

No branches or pull requests

3 participants