Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Return re-usable values from user facing functions such as bogoliubov_transform #302

Open
Strilanc opened this issue Oct 31, 2018 · 0 comments

Comments

@Strilanc
Copy link
Contributor

Strilanc commented Oct 31, 2018

In quantumlib/Cirq#1087 @Wuggins was surprised by the fact that they couldn't use the result of bogoliubov_transform transform twice (i.e. iterate it twice). I think it is a reasonable expectation that many users will have for the result to be reusable. We should be careful to always return values that can be re-used, though internally we will always be careful to allow users to give us values that can only be used once and work correctly despite that limitation.

To resolve this issue, we need to audit every method returning OP_TREE and check if it is exposed to users (for example, it is fine for _decompose_ methods to return OP_TREE because cirq.decompose takes care of it for you).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant