-
Notifications
You must be signed in to change notification settings - Fork 37
Adding cirq support #5
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
Conversation
| with a string as key. The string is formatted as 'qubit-X' where | ||
| X is a number between 0 and len(target_qubits). | ||
| circuit_type : str, optional | ||
| One of 'scheduled circuit' or 'standard circuit'. In the case of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure about python best practice here, but instead you could refer to constants.SCHEDULED_CIRCUIT and constants.STANDARD_CIRCUIT. That might make it a bit harder to pass an invalid value (even though we don't have a compiler, people might use IDEs that warn them about using non-existent constants).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with legacy here. If this needs to be changes, we have to check carefully other similar instances.
|
Comments:
|
…d description for the cirq notebook
|
|
Consistency comments: With qiskit, we have a Cirq currently has a method To change the cirq module to match the qiskit module we should remove this "circuit_type" keyword altogether (and it's constants) and instead use two method:
Each method now returns a predictable type, which is clearer. They are implied to be for cirq through the module. Technically they should also be in separate files |
…algorithm keyword removed from qiskit example
…me in text updated to 0.4 to match the code
…le in respective files
|
updates:
|
qctrlopencontrols/cirq/circuit.py
Outdated
| from qctrlopencontrols.dynamic_decoupling_sequences import DynamicDecouplingSequence | ||
| from qctrlopencontrols.exceptions import ArgumentsValueError | ||
|
|
||
| from qctrlopencontrols.qiskit import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cirq should not import anything from qiskit. Could you pull these constants into global and put the method in a module where it would be more appropriate.
|
# This is the 1st commit message: starting pyquil support # This is the commit message #1: pyquil support added # This is the commit message #2: first version of pyquil notebook added # This is the commit message #3: pyquil dependency added to setup # This is the commit message #4: trying gcc install for pyquil # This is the commit message #5: replacing gcc install with build-essential # This is the commit message #6: forcing yes to install anything # This is the commit message #7: ignoring blocks in pyquil notebook for tests # This is the commit message #8: linted; unnecessary import removed from notebook # This is the commit message #9: removed all references of circuits and replaced those with programs; pyquil removed from method names # This is the commit message #10: notebook rerun after changes # This is the commit message #11: pyquil program conversion removes unnecessary method
# This is the 1st commit message: starting pyquil support # This is the commit message #1: pyquil support added # This is the commit message #2: first version of pyquil notebook added # This is the commit message #3: pyquil dependency added to setup # This is the commit message #4: trying gcc install for pyquil # This is the commit message #5: replacing gcc install with build-essential # This is the commit message #6: forcing yes to install anything # This is the commit message #7: ignoring blocks in pyquil notebook for tests # This is the commit message #8: linted; unnecessary import removed from notebook # This is the commit message #9: removed all references of circuits and replaced those with programs; pyquil removed from method names # This is the commit message #10: notebook rerun after changes # This is the commit message #11: pyquil program conversion removes unnecessary method # This is the commit message #12: Public methods are bundled as __all__; changed ported over to notebooks; base object removed; repr method created # This is the commit message #13: additional error handling for new repr method # This is the commit message #14: repr method updated with class instance as input
Major : Add method to convert a DDS to a
cirq.Circuitorcirq.ScheduleRequest for review:
circuit_typeis an option with 2 possible string values - a) 'standard circuit' - where the circuit will contain sequence operations and gaps will be filled up by identity gates; returns acirq.Circuitinstance b) 'scheduled circuit' - where sequence operations are scheduled to be occurring at offsets and does not require any Identity gates to fill; returns acirq.Scheduleinstance; in either case the returned instance is accepted bycirq.Simulatorfor simulation (both are illustrated in the notebook. Please check if the string keys make sense.Example notebook in examples/run_a_dds_on_cirq.ipynb.
Other additions/points to consider: