qiskit/test/python/scheduler
Lauren Capelluto 007d47852f Format pulse defaults (#3526)
Fixes:

Fixes #2955 (improved error message for CmdDef.get)
Fixes #2861 (improved repr and str for CmdDef)

Changes:

qubit_freq_est and meas_freq_est now return frequency in Hz. (no warnings)
Replacing CmdDef

CmdDef will be deprecated following this PR. All existing methods are supported by
InstructionScheduleMap (via defaults().ops_def rather than .from_defaults()) with the
following exceptions:

-  __init__ should be blank unless provided by the PulseDefaults object being initialized
- add should be used instead of init args by the user
- cmds and cmd_qubits are included with a deprecation message to use ops and
  qubits_with_op instead.

New (not in CmdDef):

- qubit_ops(qubits): Return the operations that are defined for the qubit(s)
- assert_has(operation, qubits): Raise a PulseError if the op isn't defined
- remove(operation, qubits)

* Add helpful methods to defaults. methods previously existed in cmddef. still TODO: replace_pulse and TESTS

Add tests and bonus backend.version() to match backend.name()

Implement replace_pulse. Add more tests. Fixup style.

Add back build_cmd_defaults with deprecation warning. Make qubit/meas_freq_est a list attribute again, and handle related dependencies in assemble.

The example json was incorrect: the acquire commands did not have all the values required to be valid

Ops order isn't meaningful, test same keys instead

Add type hints to file

Fix #2955: improved error messaging for CmdDef

Update __str__ method, fix style

Move replace pulse feature to different branch. Also move base backend work.

Add release notes

Fix bug in assembler due to inconsistent units

Change inputs to assembler tests

Fixup issues in frequency units in assemble and assemble tests. They are still in GHz

Suppress warnings during assemble

Use module name to resolve name conflict between qiskit.validation.fields.List and typing.List

Rename op_qubits to qubits_with_op. Move _to_tuple out of util. Remove unnecessary attributes.

Respond to CR by Naoki

remove deprecation warnings

Remove filterwarnings and fixup repr

* Separate InstructionScheduleMap, give it such a name, give it the ops_def attribute for access. repr->str.

* Fixup rebase error

* Fix tests, fix style

* Improve class initialization. Fix bug where qubit ops wasn't being updated

* Remove outdated raises documentation and unused import

* Remove warning on redefinition

* Fix up removing operations or qubits, raise error if qubits or op are not found, fill in str test

* Rename op/operation to inst/instruction

* Move map to pulse

* Update release note, final style fix

* Add deprecation warning to the CmdDef.

* Added InstructionScheduleMap tests.

* modify instruction schedule to no longer be mutable objects used by internal representation.

* Revert cmd_def changes.

* instruction scheduler map linting.

* Final tests fixup

* rename duplicate test name

* Remove copy, simplify qubit_insts

* rename qubit_insts to qubit_instructions

* rename qubits_with_inst to qubits_with_instruction

* Update qiskit/pulse/instruction_schedule_map.py

* Update qiskit/pulse/instruction_schedule_map.py

* Update releasenotes/notes/extend-backend-defaults-4370f983d599a26b.yaml

* Update releasenotes/notes/extend-backend-defaults-4370f983d599a26b.yaml

* linting.

* more linting.

* Add to_dict schema validation tests for assembler.

* Fixed bug where enums repr was being stored in to_dict.

* linting.

* Add helpful methods to defaults. methods previously existed in cmddef. still TODO: replace_pulse and TESTS

Add tests and bonus backend.version() to match backend.name()

Implement replace_pulse. Add more tests. Fixup style.

Add back build_cmd_defaults with deprecation warning. Make qubit/meas_freq_est a list attribute again, and handle related dependencies in assemble.

The example json was incorrect: the acquire commands did not have all the values required to be valid

Ops order isn't meaningful, test same keys instead

Add type hints to file

Fix #2955: improved error messaging for CmdDef

Update __str__ method, fix style

Move replace pulse feature to different branch. Also move base backend work.

Add release notes

Fix bug in assembler due to inconsistent units

Change inputs to assembler tests

Fixup issues in frequency units in assemble and assemble tests. They are still in GHz

Suppress warnings during assemble

Use module name to resolve name conflict between qiskit.validation.fields.List and typing.List

Rename op_qubits to qubits_with_op. Move _to_tuple out of util. Remove unnecessary attributes.

Respond to CR by Naoki

remove deprecation warnings

Remove filterwarnings and fixup repr

* Separate InstructionScheduleMap, give it such a name, give it the ops_def attribute for access. repr->str.

* Fixup rebase error

* Fix tests, fix style

* Improve class initialization. Fix bug where qubit ops wasn't being updated

* Remove outdated raises documentation and unused import

* Remove warning on redefinition

* Fix up removing operations or qubits, raise error if qubits or op are not found, fill in str test

* Rename op/operation to inst/instruction

* Move map to pulse

* Update release note, final style fix

* Add deprecation warning to the CmdDef.

* Added InstructionScheduleMap tests.

* modify instruction schedule to no longer be mutable objects used by internal representation.

* Revert cmd_def changes.

* instruction scheduler map linting.

* Final tests fixup

* rename duplicate test name

* Remove copy, simplify qubit_insts

* rename qubit_insts to qubit_instructions

* rename qubits_with_inst to qubits_with_instruction

* Update qiskit/pulse/instruction_schedule_map.py

* Update qiskit/pulse/instruction_schedule_map.py

* Update releasenotes/notes/extend-backend-defaults-4370f983d599a26b.yaml

* Update releasenotes/notes/extend-backend-defaults-4370f983d599a26b.yaml

* linting.

* more linting.

* Switched cmd_def scheduluer tests to instruction_map and added cmd_def tests to eventually deprecated.

* Renamed InstructionScheduleMap to be InstructionScheduleMapping to be more pythonic and grammatically correct.

* name InstructionScheduleMapping to InstructionScheduleMap and defaults.instruction_schedulues to defaults.circuit_instruction_map

* fix scheduluer test.

* linting fix.
2019-12-09 20:02:22 -05:00
..
__init__.py Basic pulse scheduler (#2650) 2019-10-18 17:28:01 -04:00
test_basic_scheduler.py Format pulse defaults (#3526) 2019-12-09 20:02:22 -05:00