It would be nifty if the pyquil namespace was open to all. Take for example, the pyquil.operator_estimation code: it is useful, but also niche and could reasonably live externally to the base pyquil package as a sort of extension to pyquil. That is, pyquil/operator_estimation.py might live at a different location (and a different git repo), say in a package called "pyquil-operator-estimation". Then you would pip install pyquil-operator-estimation and import pyquil.operator_estimation, etc. The directory structure for pyquil-operator-estimation would look something like
Python does in fact enable this kind of common namespace packaging of dislocated source trees via PEP 420 (blazeit). And the only change we would need to make would be to remove the file pyquil/__init__.py and replace its functionality.
The operator estimation stuff above is just an example, and I wouldn't necessarily suggest that we make that change since it would be backwards incompatible (though I expect operator estimation users are few and far between). What prompted this thought was an interest in extending pyquil (the library) to include tools that would for example convert cirq to quil, etc. That stuff really doesn't need to live in pyquil main, but it would be nice to have it under the pyquil namespace in python.
The downsides are:
I haven't figured out (or even tried to figure out) how to replace the functionality in __init__.py: importing Program and get_qc into the pyquil namespace.
It would be nifty if the
pyquil
namespace was open to all. Take for example, thepyquil.operator_estimation
code: it is useful, but also niche and could reasonably live externally to the base pyquil package as a sort of extension to pyquil. That is,pyquil/operator_estimation.py
might live at a different location (and a different git repo), say in a package called "pyquil-operator-estimation". Then you wouldpip install pyquil-operator-estimation
andimport pyquil.operator_estimation
, etc. The directory structure forpyquil-operator-estimation
would look something likePython does in fact enable this kind of common namespace packaging of dislocated source trees via PEP 420 (blazeit). And the only change we would need to make would be to remove the file
pyquil/__init__.py
and replace its functionality.The operator estimation stuff above is just an example, and I wouldn't necessarily suggest that we make that change since it would be backwards incompatible (though I expect operator estimation users are few and far between). What prompted this thought was an interest in extending pyquil (the library) to include tools that would for example convert cirq to quil, etc. That stuff really doesn't need to live in pyquil main, but it would be nice to have it under the pyquil namespace in python.
The downsides are:
__init__.py
: importingProgram
andget_qc
into thepyquil
namespace.