* Change benchmarks run in CI job
This commit changes up the benchmarks we run in the travis CI job. This
job is very susceptible to noise because of shifts in CI node
performance. The environment that travis uses to host their environment
has variable performance being that they run on public clouds so to
minimize spurious failures caused by things outside of our control we
should try to limit the benchmarks we run to smaller synthetic ones then
larger full path tests. To this end this commit removes the state
tomography benchmark and replaces it with synthetic benchmarks for
circuit construction, converters, and the assembler. The state
tomography benchmarks involves running a simulation with BasicAer,
ignis, and quantum_info to calculate the state fidelity and while this
is a useful benchmark in dedicated benchmarking environment there is too
much work going on to provide repeatable results for the CI job.
* Remove converters from list of ci benchmarks
This commit removes the converters benchmarks from the list while each
benchmark iteration takes at most a few seconds the matrix of benchmarks
run is quite large and the setup can be expensive for the larger
circuits. While it only takes a few extra minutes locally on a
reasonable system, in the slow ci nodes this pushes things beyond the
45min timeout. To make sure we have enough time budget this commit
removes the converter benchmarks from the list we run in ci.
* Remove QFT from list of benchmarks too
The qft benchmarks also run for a long time and suffer from the same
kind of variability that state_tomography did (although to a lesser
extent). This commit removes it from the list too.
* Add converter benchmarks for depth 8
Running the full range of benchmarks for the converter functions across
takes too much time (mostly in setup). But they can provide valuable
insights. This commit adds just the depth 8 versions of the benchmarks
to the list we run in CI. This should be a tradeoff of actually running
them but having it execute quickly enough in our ci env.
After #3325 the import structure of the tools directory was changed so
that sometimes the ibmq imports at the top of the
qiskit.tools.monitor.backend_overview module get evaluated prior to the
pkgutil call in qiskit.providers.__init__ that is used to look for
namespace packages outside of the terra repo. When this happens the
imports from the qiskit-ibmq-provider package fail because they haven't
been added to the python namespace yet. The way the backend monitor was
checking made this non-fatal but would never populate the names. So when
you'd later go to run the function it would fail with a NameError
because the imports didn't work, even if ibmq was installed (and
working otherwise). This commit works around this issue by making the
ibmq imports occur at runtime inside the functions in the module. This
makes the imports happen as late as possible and ensures that if ibmq is
installed and working that we'll be checking that after pkgutil has a
chance to search for the namespace packages.
Related-To Qiskit/qiskit#559Fixes#3413
* 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
* fix zeroed_width for gaussian and gaussian_square
* fix some definitions
* fix test
* make sampler midpoint by default
* fix rescale_amp docstrings, fix tests to reflect midpoint, fix sech
* added filter_type argument to pulse.Schedule.filter to enable switching between filtering, inverse filtering (i.e. keeping instructions that fail some filter), or returning both
* fixed error in the way Schedule._filter() was constructing total_filter
* added testing for pulse.Schedule.filter in the filter_type=1 case
* adding tests for Schedule.filter for the new filter_type=1 and filter_type=2; however too much repeated code, will simplify
* simplified test cases in test_schedule.TestScheduleFilter to simultaneously test all options of filter_type=0,1,2. All original tests have been retained
* Removing filter_type argument from Schedule.filter, and adding a Schedule.exclude method
* fixing the way Schedule.filter deals with un-keyed arguments in the filter_func argument. Modified tests to deal with new method signature for Schedule.filter and Schedule.exclude
* updated tests in test_schedule.TestScheduleFilter to reflect new changes to Schedule.filter and Schedule.exclude
* fixed stylistic issues in schedule.py and test_schedule.py
* corrected style in Schedule.filter and Schedule.exclude, and test_schedule.py
* added a new method Schedule._apply_filter to refactor duplicate code from Schedule.filter and Schedule.exclude
* corrected error in Schedule._apply_filter
* minor changes to comments in schedule.py
* Update qiskit/pulse/schedule.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Update qiskit/pulse/schedule.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Update qiskit/pulse/schedule.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Update qiskit/pulse/schedule.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* fixing comments in filter and exclude methods in schedule.py
* Removed unnecessary lines from Schedule._construct_filter
* fix for #3070 graphviz installation instructions
I have included the URL to the Graphviz software package download page for the different operating systems.
* lint
Right now many classes document class constructors and they're arguments
in the docstring for the __init__() methods of the class. However, by
default autodoc does not show these for the classes' documentation and
instead relies on only the class docstring. This commit sets the sphinx
autodoc config option [1] to use both the class and init docstring
together.
[1] https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
* Tweaks to validation/base docstrings
* Use "validate" constructor attribute
* Update validation.base docstrings
* Add test
* Adjust quotes in docstrings
Actually doubling as a re-triggering of CI.
* added Instruction.is_parameterized()
* Applied new method Instruction.is_parameterized() in obvious places.
Added test case for Instruction.is_parameterized().
* release note for Instruction.is_parameterized
* Cleaned up for linter.
Added typographical style to release note.
* Added bound parameter test to test_is_parameterized()
* Added detail to release note.
* Updated the cases in Collect2qBlocks and CommutationAnalysis
* changed test to bind parameter to instruction in approved fashion
* corrected test
Setting an explict background color in the histogram plotgram results
in slightly more pleasing default color (a light grey vs white) but has
the negative side effect of making some plot features illegble for cases
where users have a custom style set. For example, if you set a
background style with matplotlib.pyplot.style.use('dark_background')
this will result in the bar labels being nearly illegible because it is
white on light grey. This commit removes the explicit background color
and enables our users to set their own background color if they desire.
* Add useful methods to PulseBackendConfiguration. This will remove the need for the redundant PulseChannelsSpec class in pulse.
* Add release notes
* Style: Remove unused import
* Remove old test
* Fix issue in test: plot gate map only works with > 5 qubits
* Respond to feedback: Valid + realistic hamiltonian in mocked configuration, releasenotes augmented to alert users of dt/dtm change, hamiltonian methods on config return whole hamiltonian + tests updated to match, and dt/dtm are put it proper units during init rather than access
* Style
In #3143 we added back most of the jobs which we removed from travis to
see if we preferred running jobs in travis or azure pipelines. After
having this for a full day it's become apparent that even with the extra
capacity from our travis subscription that the wait times on travis with
the full job load are too high. The travis check returned significantly
slower than the equivalent job in azure pipelines. So for now we'll
stick to running the majority of and required testing in azure pipelines
and use travis only for extra jobs where needed. This commit removes all
the duplicated jobs that we run in azure from the travis config.
* implemented functions to enable slicing and concatenation of PassManagers
* fixed errors, added release notes, added unittests
* resolving conflict
* adapter implementation to new PassManager
* fixes a bug caused by shallow copy
* test name capitalization
This commit fixes issues reported with long parameter lists in the mpl
drawer. The issue is that when the length of the parameters list exceeds
20 characters the mpl drawer removes the parameters. Multiple attempts
have attempted to address this issue (#2994#3353) by just increasing
that limit. But this doesn't actually solve the problem because the
boxes are fixed width so the parameters just exceed the width of the
boxes. The proper way to fix this is to dynamically
In addition this whole problem is primarily caused because we don't
round any parameter values. This commit rounds the parameters so that we
rarely have to scale to have super wide parameter lists.
Fixes#2822
* DAGCircuit.substitute_node should respect name from replacement op.
* Remove unroller error message resolved by #3148.
* Unroller and optimize_1q_gates to use substitute_node when possible.
This commit adds a basic configuration for using mergify.io. It simply
will just squash merge the PR if it's been approved and passes ci. The
configuration documentation for the service can be found here:
https://doc.mergify.io/configuration.html
We have not been able to get this bot working, even after numerous
attempts and alternative configuration settings. We're going to abandon
this bot and try a different service. So this commit removes the file
since we no longer need it around.
We started setting the basepython attribute in the root testenv
configuration in the tox.ini in #1761. This was done to ensure that
users on environments with both python2 and python3 installed that jobs
which weren't explicit about the python version (like 'lint') would not
attempt to use python2 in error. However, this had the unintended side
effect of also making jobs which were opinionated about python version
(basically the standard test jobs 'py37', 'py36', and 'py35') would end
up using the 'python3' binary in the standard path instead of the
version specified in the job name. This mostly came up on systems with
more than one python version installed. The basepython declaration is
only needed for jobs that do not specify a python version. This commit
updates the tox.ini to remove the basepython from the base testenv
definition and only use it for jobs where the python version isn't
explicitly set.
* split!
* passes()
* max_iteration
* replace
* some RunningPassManager clean up
* callback support
* property_set result
* lint
* cleaning up runninpassmanager
* docstring
* args
* parallel
* test
* parallelize using dill
* dill in requirements.txt
* lint
* runningpassmanager style
* dill in setup
* fix the drawer with the new format from passes
* new refs
* Update qiskit/visualization/pass_manager_visualization.py
Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
* no label for linear
* refs
* _pass_sets
* pass set in a docstring
* lint
* different circuits
* circuit_or_circuits -> circuits
* Add dual of mpl mathtext syntax for latex drawer labels
This commit adds a new feature to the latex drawer that adds support for
a similar syntax to matplotlib's mathtext to labels on the latex drawer.
In matplotlib if you specify a string between two dollar signs (for
example $\gamma$) that string will be parsed with mpl's native TeX
expression parser and that will be used to layout and render the string
per the TeX syntax. This uses the same syntax as mathtext, and enables
users to write raw latex syntax as gate labels between a pair of dollar
signs. All characters outside of the dollar signs are treated as utf8
and get encoded by pylatexenc to create valid latex, however all text
inside the dollar signs get passed verbatim to the output latex. This
enables users to mix and match having their unicode encoded for them and
manually passing latex
Fixes#3171
* Fix lint
* Use jupyter-execute instead of describing diagram
* Revert "Use jupyter-execute instead of describing diagram"
This reverts commit ab7bc18c39. Running
the code example in jupyter-execute will require a latex distribution
with qcircuit to be installed. That adds a lot of run time to the doc
build and a non-obvious dependency. To avoid this, we'll just rely on
the code example and a description of the output.
#3143 restored travis jobs for environments other than 3.6, but
the benchmarks are currently set to run on 3.5, which needed
to be overridden explicitly.
* Add back travis config for unit tests
Since we now have a subscription for travis we no longer have to worry
as much about longer queue delays. The core team preference is to use
travis for more than for azure. This commit moves the majority of the
testing out of azure and into travis accordingly.
* Add missing echo and cache stestr dir
This commit adds a missing echo for the python hashseed so we can
actually see what we set the hash seed to. It also adds caching for the
.stestr dir which will enable seeding the test runner's scheduler with
data from previous runs to optimize the worker balance and hopefully
improve run time slightly.
* Fix typo
* Also cache stestr on osx
* Restore azure config
* Remove travis wheel build configs
* Default to python 3.7
Adds Burlington as an example of a 5-qubit backend supporting pulse.
configuration, properties and defaults are included.
Additionally allows FakeBackend instances to be interacted in jupyter
similar to IBMQBackend instances.
* add mock Burlington and allow htmlrep for FakeBackends
* lint
* Update plot_state_city to align labels
Fixes#3234. Added two attributes in the call of set_ticklabels() in plot_state_city in order to align the labels of the created plot with the ticks on the x and y axes.
* Added indentation
* Corrected Whitespace
The latex drawer uses a class attribute img_depth to keep track of the
number of columns to put in the output img_depth (along with some other
things related to that). This value was attempted to be figured out by
looking at the number of layers except if there is a cu1 gate in a
layer then that layer has 2 columns (because the label takes up one).
However this count was done incorrectly and instead the number of
columns was equivalent to the number of gates in each layer plus 2
columns for each cu1. This resulted in a huge empty space for circuits
with lots of qubits, especially if they had lots of gates per layer.
This commit corrects the layer count loop to instead properly only
count a layer once and twice if it has a cu1 gate in the layer.
Fixes#3232
* Add alias for cnot function to cx()
We often call the cx gate a cnot. Especially when giving presentations
or intros to quantum information you have to explain that cx == cnot. To
make this a bit simpler this commit adds a alias to the
QuantumCircuit.cx() function QuantumCircuit.cnot(). This way when doing
code examples we can just say run "cnot".
* Add aliases for other common gate names
Just as with cx and cnot there are other common names used for several
other quantum gates that are often used interchangeably. These alias are
also added:
ccx -> toffoli
cswap -> fredkin
s -> p
sdg -> pdg