Commit Graph

3347 Commits

Author SHA1 Message Date
Lauren Capelluto 362a31ab8d Parametric Pulses (#3620)
* Initial commit additing parametric pulses Commands to Pulse.

Functionally complete Gaussian parametric pulse.

Allow 'parametric_pulses' to be supplied at assemble time to be consistent with other arguments

Consistent ordering in imports

Removed outdated TODO and update parametric pulse module docstring

Add other parametric pulse shapes to converter pulse shapes

Work on docstrings. Make ParametricPulse methods abstract

Continue adding docstrings. Placeholders for reno note and tests

Rename SquarePulse -> ConstantPulse. Add placeholder tests across multiple test files

Improve how parameters are extracted from the parametric pulse classes to a dict. Params are now 'frozen' as properties. Complete drag documentation.

Handle complex param serialization

Cast amp to complex. Start writing tests

Write release note, including prelude note

Small doc improvements and remove AcquireChannel from release notes (does not apply)

Do not 'zero ends' by default

Add command tests

Small change to reno note, add placeholder for schedule tests

Fix cyclic import error and other style fixes. Add test docstrings

Add schedule and qobj conversion tests

Fix bug in qobj -> instruction converter, add test

Add assembler tests

Pick a more reasonable sigma for gaussian pulses. Add visualization test

Respond to Daniel Egger's helpful feedback

Add 'width' as optional parameter to discrete pulse lib gauss_square, since GaussianSquare command takes it (user consistency).

Fixup docstring mistake, change type hint for gaussian square width to float

Remove 'remove_baseline' option

Respond to Zach's feedback: Fixed bug in pulse library. Fixed up old reference to 'square' pulse. Added check that 'width' is non negative

Apply suggestions from code review

documentation improvements thanks to Thomas!

Co-Authored-By: Thomas Alexander <thomasalexander2718@gmail.com>

Update the documentation for the DRAG pulse

* Validate parameters properly by class

* Get beta restriction in with help from Daniel Egger and Zach Schoenfeld

* style fixes

* Add tests for beta

* Fixup bug (thank you Zach)

* Learn a bit more about the drag pulse: if beta < sigma, only the amplitude matters

* Improve how the math was written for the drag pulse params check

* Improve GaussianSquare error message, add another test

* Improve comments in beta check of drag pulse

* Improve beta checking, fixup the description a bit

* Respond to feedback: variable name updates and improved docstrings

* Finish moving get_params to get_parameters

* Add PulseCommand class between Command and SamplePulse/ParametricPulse

* Finish moving params to parameters, following schema

* Abstract methods had to be passed on to PulseCommand from Command. Added draw as an abstract method there and implemented in ParametricPulse

* Fix imports, lint, and whitelist dt

* Update qiskit/pulse/commands/parametric_pulses.py

Co-Authored-By: Thomas Alexander <thomasalexander2718@gmail.com>

* Fixup mismatch in schema name

* Write out the parameters dict and make it a property

* Fixup accidental change

* Fix repr

* Add one last test to check that the scheduler works with parametric input

* Add more assembler tests

* Add another test that fails with beta too large

* Update qiskit/pulse/commands/parametric_pulses.py

Co-Authored-By: Luciano Bello <luciano.bello@ibm.com>

Co-authored-by: Thomas Alexander <thomasalexander2718@gmail.com>
Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
2020-01-20 08:55:43 +00:00
Diego M. Rodríguez a01af02c2f Use raw literals in strings (#3715) 2020-01-17 09:14:01 +00:00
Lauren Capelluto a6be0cb72b Deprecate circuit_instruction_map (#3717)
This commit deprecates the circuit_instruction_map attribute of the Schedule class.
The new attribute to use is instruction_schedule_map because the class name for
the value of this attribute InstructionScheduleMap. This makes the attribute consistent
with the type returned by the attribute.
2020-01-17 09:51:19 +10:00
Lauren Capelluto 4affa630ed Remove outdated code from when backend defaults wasn't done (#3716) 2020-01-16 19:36:23 +00:00
Lauren Capelluto 2ca2653a3f Update schemas for parametric pulses (#3702)
* Update schemas for parametric pulses

* Update copy paste error :(((((((

* Update type of 'params'

* Add new fields to example jsons

* Update qiskit/schemas/examples/qobj_openpulse_example.json

remove trailing comma

Co-Authored-By: Diego M. Rodríguez <diego.plan9@gmail.com>

* Try out changing params to parameters to deal with type conflict

Co-authored-by: Diego M. Rodríguez <diego.plan9@gmail.com>
2020-01-16 02:45:57 +00:00
Matthew Treinish f6921825ae Make assemble() respect max_shots (#3606)
* Make assemble() respect max_shots

Currently the assemble() function was not respecting the value of the
max_shots property from the backend. It takes in a shots argument which
could exceed the maximum number of allowed shots reported by the backend
and not do anything. This will result in an error when running on the
backend and is something that should be caught before we send a job to
the backend. This commit adds this check, if the backend has the
max_shots property set and the value of shots is greater than that it
will raise a RuntimeWarning and switch the number of shots to be
max_shots. This behavior was chosen because some backends (namely from
qiskit-aqt-provider) have a max_shots value less than the default of
1024.

* Fix lint

* Raise instead of warn when shots>max_shots

This commit updates the logic to no longer warn if shots>max_shots and
then change the value to making that a hard exception. To address the
default behavior if no shots kwarg is specified either 1024 or max_shots
will be used, whichever is smaller.

* Update tests too

* Fix lint
2020-01-15 07:59:11 -03:00
Kevin Krsulich 2850768bcc Increase job watcher cancel button width. (#3708)
Co-authored-by: Paul Nation <nonhermitian@gmail.com>
2020-01-14 12:15:29 -03:00
Diego M. Rodríguez 083b82f413 Remove duplicated field in json example (#3711)
* Remove duplicated field in json example

* Fix extra file

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
2020-01-13 11:41:14 -05:00
neupat 594684dbcc Fix name and Email Patrick Neuweiler (#3712) 2020-01-13 10:43:25 -05:00
Lauren Capelluto e34a259dec Fixup bug where name isnt maintained by align_measures (#3701) 2020-01-10 15:22:42 +00:00
Kazuaki Ishizaki 6789862ace Fix typo under qiskit directory (#3659)
* fix typo

* address review comment

* address review comment
2020-01-09 17:23:54 -05:00
Magnus Berg Sletfjerding bb2ac64a96 Assemble meas levels validation (#3694)
* added error in assemble and added new test in test_assembler

* added error in assemble and added new test in test_assembler

* Update assemble.py

removed f-string

* linting

* added pylint exception

* Update qiskit/compiler/assemble.py

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-01-09 16:49:39 +00:00
Tareq El Dandachi 6bd09856ad Fixed issue 3673 (#3675)
* Added crx, cry and rxx gates

* Added ast_to_dag imports and extensions + modified gate definitions

* Modified qasm parser tests to account for length of new gates and reordered components

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-01-09 14:53:31 +00:00
Ali Javadi-Abhari 21a3424368 reorganize passes directory (#3621)
* reorganize passes directory

* release notes

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
2020-01-09 13:43:11 +00:00
Matthew Treinish 19f59c0a55 Pin pylint and astroid in requirements-dev.txt (#3699)
Currently we're pinning pylint and astroid via a constraints file. This
was done primarily because astroid is not a direct dependency for
development since we only actually directly use pylint. The constraints
file mechanism is designed for this purpose to let us set explict
versions for repeatability for any package installed via pip, even if
it's not a direct requirement. However, the constraints file mechanism
isn't obvious to developers who are manually installing development
requirements into their environment. Additionally, the
requirements-dev.txt had a pylint version cap which conflicts with the
version set via the constraints file which made it extra confusing.
This commit moves away from using the constraints for pylint and moves
to using requirements-dev.txt directly. To facilitate this astroid
pinned at a specific version is also added to the requirements-dev.txt
file to ensure we have a consistent output from pylint. While this isn't
a direct dependency for development it does make it simpler to find and
install a consistent pylint env locally.
2020-01-08 15:12:18 -05:00
Matthew Treinish 2fe5055411 Bump pylint version to unify across elements (#3635)
* Bump pylint version to unify across elements

This commit bumps the pinned versions of pylint and astroid to the
lastest versions of both. We are unifying the version of both used in CI
across all the elements to these versions to have a consistent
experience with the linters when working across the elements.

This adjusts the terra code to make the newer versions pass. This
involves disabling one rule globally because it doesn't apply to how
terra is structured, adding per file (and 1 per line) disable for usage
of numpy that pylint can't track because of the c extensions, and a
number of code changes to fix failing rules which are marked by the new
version.

Fixes #3629

* Fix tests

* Rename kron() args to avoid ordering confusion

* Fix lint failures introduced in recent patches

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-01-07 12:21:32 -05:00
Matthew Treinish 7718e3576d Pin nbformat to 4.4.0 (#3691)
The recent nbformat release 5.0.0 that was just pushed to pypi is
missing jsonschema files from the uploaded artifacts,
(see jupyter/nbformat#155). This is causing CI failures, until the issue
is resolved this commit pins the version installed via pip using the
constraints file (since it's not a direct dependency).
2020-01-06 17:40:06 -05:00
Kevin Krsulich 438928f221
Update CODEOWNERS 2020-01-06 12:15:46 -05:00
Thomas Alexander a187d838e5 Fix bug where lo units were not being properly converted (#3597)
* Fix backend config where lo ranges were not adjusted to Hz.

* Fix bug where assemble/execute accepted parameters in GHz rather than Hz.

* linting

* Documentation fixes for Hz.

* Add channel bandwidth.

* bug fix with kwarg pop.

* Missing None in kwargs pop.

* linting.

* Fix range in list comprehension for lo ranges in backend configuration.

* Update qiskit/compiler/assemble.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/compiler/assemble.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* lo to LO in docstrings.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
2020-01-06 17:13:51 +00:00
Lauren Capelluto 85d0d0357d Update deprecated call to cmd_qubits in the rescheduler (#3687) 2020-01-06 16:32:30 +00:00
sumitpuri 17dcd31f87 Visualizers properly represent complex numbers (#3666)
* Fixed issue 3640 by adding logic for complex imaginary numbers

Co-Author: Sumit Puri <er.sumitpuri@gmail.com>

* Added test for display of 'pi'.

* Added test for displaying 'pi' for both real and imaginary parts of complex number.

* Release notes added for Fixes #3640

* release notes

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
2020-01-05 14:17:38 +00:00
Paul Nation 21beac232c
update mel (#3677)
Merging this as it is trivial
2020-01-04 11:23:54 -05:00
Oluwatobi Ogunbayo 118911880a Updates draw method scale parameter: SamplePulse, Schedule (#3424)
* Update quantumcircuit.py

Setting the `scale` parameter to a default from a default value of 0.7 to a default value of 1 to prevent clipping of the returned image.

* Schedule: adjust and deprecate scaling parameter use scale instead

- Adjust scaling parameter in Schedule.draw to ensure consistent zooming behaviour with SamplePulse.draw function
- Deprecate scaling parameter in Schedule.draw use scale instead.

* SamplePulse: deprecate scaling parameter use scale instead

- Deprecate scaling parameter in SamplePulse.draw, use scale instead.

* Revert "SamplePulse: deprecate scaling parameter use scale instead"

This reverts commit 178b69ba94.

* Revert "Schedule: adjust and deprecate scaling parameter use scale instead"

This reverts commit 7b0addc80e.

* Updates draw method: SamplePulse, Schedule

- Adjust scaling parameter in Schedule.draw to ensure consistent zooming behaviour with SamplePulse.draw function
- Deprecate scaling parameter in Schedule.draw use scale instead.
- Deprecate scaling parameter in SamplePulse.draw, use scale instead.

* Revert "Update quantumcircuit.py"

This reverts commit 1f799c6abf.

* Fix Lint Issues

Fixes for Lint issues in previoius commit.

* Deprecation warning for staging parameter

* Revert "Fix Lint Issues"

This reverts commit c24688818a.

* Further Lint Fixes

* scaling parameter changed to scale

* Typo Fix

* Further Lint Fix

* More Lint Fixes

* Lint Fix

* Fix omitted warnings import

* Set scaling parameter to float

Co-Authored-By: Thomas Alexander <thomasalexander2718@gmail.com>

* Set scaling parameter to float

* Change `scale` to `scale_factor` && Cleaner zooming fix

* Remove log import

* Deprecate scaling in schedule and pulse drawers

* Lint Fixes

* Lint Fix

* Lint Fix

* More Lint Fixes

* Set more general conditonal to call scaling deprecation warning

* Use `scale` instead of `scale_factor` to deprecate the `scaling` keyword for visualizations

* Lint Fix

* Create update-scaling-draw-option-7f28e83ff3e3939f.yaml

* Set scaling parameter to None to prevent deprecation warning

* Remove code redundancies in constructors and conditionals

* Update qiskit/visualization/pulse_visualization.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/visualization/pulse/matplotlib.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/visualization/pulse/matplotlib.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/pulse/commands/instruction.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/pulse/schedule.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/visualization/pulse/matplotlib.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/pulse/commands/sample_pulse.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/pulse/commands/sample_pulse.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* Update qiskit/pulse/commands/instruction.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

Co-authored-by: Thomas Alexander <thomasalexander2718@gmail.com>
Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
2020-01-03 22:19:41 +00:00
Christopher J. Wood 0838180115 Fix Operator.transpose for non-square operators (#3672) 2020-01-03 19:47:23 +00:00
Ali Javadi-Abhari 6c6ce93d9c
slight change to quaternion class constructors (#3664)
* slight change to quaternion class constructors

* style
2020-01-03 13:41:06 -05:00
willhbang 8700dd2af8 Document `Bit.index` and `Bit.register` (#3662)
* Document `Bit.index` and `Bit.register`

* Fix parsing and formatting for Sphinx docs

* Follow grammar conventions in docs

* Fix class formatting

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
2020-01-02 20:49:31 +00:00
Luciano Bello 5221fe330a Visualizers print physical qubits as integers (#3663)
* fixing text

* adjust text test

* adjust test

* latex

* mpl

* release notes

* clean up

* lint

* with an arrow

* no parenthesis

* adjusting test

* mpl sequence

* Fixes #3520 via adding #3590

Co-authored-by: Tharrmashastha SAPV <51048173+TharrmashasthaPV@users.noreply.github.com>

* new mpl refs

* blacking qiskit/visualization/matplotlib.py

* lint

* shorter lines

* diff_tolerance for windows

Co-authored-by: Tharrmashastha SAPV <51048173+TharrmashasthaPV@users.noreply.github.com>
2020-01-02 09:59:30 -05:00
Christopher J. Wood b7a4006f1b Remove quaternions from XYX synthesis algorithm (#3628)
* Remove quaternions from XYX synthesis algorithm

Start adding infrastructure for phase correct one-qubit synthesis

* add angles_zxz function

Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
2019-12-31 06:13:35 +00:00
Luciano Bello 2d75ea7b46 Keeping randn in TwoQubitWeylDecomposition but seeded (#3653)
* seeding randn

* use np.random.RandomState

* i

* cleaning up

* test case

* Update test/python/quantum_info/test_synthesis.py

Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>

* Update qiskit/quantum_info/synthesis/two_qubit_decompose.py

Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
2019-12-28 20:44:07 -05:00
Luciano Bello 5dd98aac56 slack invitation link changed (#3655) 2019-12-27 15:24:40 +00:00
abbycross 2ee7a3ae5b docstring proofreading fixes (#3497)
* dist -> dict

* spacing and typos

* add comma so parser doesn't stop after i.e.

* punctuation for clarity

* had been -> were

* punctuation fix for clarity

* missing end parens

* typos and spacing

* more spacing

* punctuation, clarity, rewording

* punctuation/cap consistency

* extra comma, expand contraction

* clarity fixes

* typo

* consistency

* hyphenate controlled-not

* hyphenate single-qubit

* clarification

Luciano Bello helped with rewrite

* consistency fixes

* consistency fix

* capitalization consistency

* capitalization

* Conciseness fix

* capitalization, punctuation for readability

* missing colon, other readability fixes

* indentation fixes

* hyphen, consistent punctuation fix

* fixed literal blocks

* capitalizing since it refers to Parameter class

* trailing whitespace

* typos, indent/spacing, punctuation

Co-authored-by: Paul Nation <nonhermitian@gmail.com>
Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2019-12-26 16:20:02 -05:00
Kazuaki Ishizaki 1e2ad8e69a Fix typos under test/ (#3651) 2019-12-26 15:52:06 -05:00
Ali Javadi-Abhari 5bcc6ee7ea Revert "remove randomness from two_qubit_decompose (#3585)" (#3652)
This reverts commit 6fee616bd1.

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
2019-12-26 12:31:35 -05:00
Tharrmashastha SAPV 84b14b9093 Fixes issue 3607 (#3642) 2019-12-24 19:47:29 +00:00
Kazuaki Ishizaki bda3a94b1b fix typos (#3650) 2019-12-24 01:26:20 +00:00
Luciano Bello 9e3361ef9d skip test_crosstalk_adaptive_scheduler when z3-solver not available (#3648)
* skip test_crosstalk_adaptive_scheduler when z3-solver not avaialble

* requirements-dev - z3-solver>

* assert
2019-12-23 16:53:45 +00:00
Luciano Bello 6fee616bd1 remove randomness from two_qubit_decompose (#3585)
* remove random from two_qubit_decompose

* include negative numbers

* clean up diff

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2019-12-23 14:32:47 +00:00
Kazuaki Ishizaki 18858d2b57 fix typo (#3645) 2019-12-23 13:58:49 +00:00
prakashmurali 53e99fa4fe Crosstalk adaptive gate scheduling pass (#3532)
* Implementation of crosstalk adaptive scheduling

* Updated constructor params

* fixed lint issues

* fix test case bugs

* fixed lint issues

* updated setup.py requirements list with z3

* address review comments

* address review comments

* fixed parse_backend_properties

* Update qiskit/transpiler/passes/crosstalk_adaptive_schedule.py

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

* computing descendants and ancestors once per gate

* fixed comments

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
2019-12-22 22:16:09 +00:00
Kazuaki Ishizaki 75420eaca6 fix typo (#3643) 2019-12-20 16:19:52 -05:00
Matthew Treinish 23fd08f96b Make python 3.7 default in CI and remove duplicate job (#3636)
Since we've deprecated python 3.5 having 3.5 be the first round of
testing performed in CI feels out of place. This commit makes the
default jobs run in the first stage of the CI pipeline in azure all use
python 3.7. We still need to verify that 3.5 works and still gate on the
3.5 job passing. But, it doesn't get as much attention now that it's
deprecated. At the same time this commit takes the opportunity to remove
the duplicated python 3.8 job in the travis config. This was added
originally because travis had 3.8 support well before azure pipelines
but was never removed after azure added their 3.8 support.

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
2019-12-20 11:46:55 -05:00
Paul Nation 5cd120d14c output as first kwarg in circuit.draw (#3632)
* output as first kwarg

* add depreciation warning.

* fix import order

* add depreciation
2019-12-20 11:00:08 -05:00
Matthew Treinish 6b6170a04e Add missing quotes to issue templates (#3638)
In #3560 the issue templates were updated to include the tags. However
the tags for enhancement and feature request contain a ':' in them. This
confuses the yaml parser because ':' is a reserved character. To address
this issue, this commit adds quotes around the tags so the yaml parser
can process the issue templates and add them back to the list of
options.
2019-12-19 21:11:10 +00:00
Kevin Krsulich e11f8d1a82 Add CouplingMap.draw method. (#3630) 2019-12-19 20:12:48 +00:00
SooluThomas 1304903391 Update .mailmap (#3603) 2019-12-19 14:39:27 +00:00
Ali Javadi-Abhari 6086dbf1a9 Coupling map constructors (#3618)
* simple coupling map constructors

* release note

* add tests

* compare set of edges instead of list
2019-12-18 22:21:47 +00:00
Luciano Bello cfc98b5daf label in the template (#3560) 2019-12-18 19:06:16 +00:00
neupat 64e5eef979 Add Crx and Cry gates (#3600)
* add tests

* fix docstring of crx

* fix Rotation.control() function

* fix add_control

* fix test_unroller.py

* fix test_unroller and circuit_text_ref.txt drawing
2019-12-18 13:18:22 -05:00
Luciano Bello fa09a7f6d2
Revert "Allow giving jobs names via execute for IBMQ devices (#3622)" (#3624)
This reverts commit 72adb4fabc.
2019-12-17 12:04:14 -05:00
Kevin Krsulich 71802756e3 Replace scipy.kron with numpy.kron in quantum_initializer. (#3623) 2019-12-17 11:10:39 -05:00