* 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
* 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
* 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
* 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
* 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.
* 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.
* Got a method that makes accpetable qam
* Added in a comment to remind myself
* Made some more minor changes
* Added in a test
* Updated variable naming to make clearer
* Tidying up for clarity
* Fixed typo in test
* Made the added fields private
* indexing openqasm
* Fixed spelling mistake and added in a test for multiple calls to the qasm algorithm
* Added in a test for 2 qubit unitaries to convert to qasm
* lint
* lint
* Scaling=None
Changes default scaling for Schedule drawing from 1 to None
* Auto scale PulseScheduler drawing
Extra code for scaling automatically pulse schedule drawing for given channels
* Update matplotlib.py
* Update matplotlib.py
* Update matplotlib.py
* Update matplotlib.py
* Update matplotlib.py
* Add a boolean parameter for removing spacing
* delete the spacing by changing the y0 offset
* New images for testing pulse visualization
* Update matplotlib.py
* Update matplotlib.py
* include non-zero negative values with small amp
* scale the y0 offset with minimum amplitude
* Uptdate reference files for testing
* Remove sympy from everywhere
This commit removes all the sympy usage from qiskit-terra. Sympy is very
slow, not just to perform computations, but also to just import (being
the second slowest import in terra, only behind qiskit.version which
calls git and pip in a subprocess) and doesn't actually provide us any
real advantages inside terra. None of the expressions or calculations
terra is doing need to be done symbolically, and using sympy as just an
output formatter (to get pretty output for things like pi) is overkill.
* Fix lint
* Fixes from running openqasm conformance tests
* Import sympy lazily for circuit Parameters.
* Add back sympy to requirements
While sympy has been removed from most places in the repo as of this
point, it is still used internally in the Parameter and
ParameterExpansion classes. The imports there have been made runtime to
remove the import performance impact and they are self contained in
those classes as of this commit. We can remove sympy from the
requirements in the future when we come up with way to replace the
parameter classes' use of sympy we can remove it from the requirements
lists.
* Make type warning a deprecation warning
* Fix rebase issue (and unnecessary runtime import)
* Update instruction parameter type handling
This commit updates some issues found during code review with the
parameter handling. Now instead of casting string parameters as a float
incorrectly, this uses them to create a new symbolic parameter. Also for
numpy number types that are not caught by the earlier type checks item()
is called as was the previous behavior.
* Revert switch from Node.sym->Node.num()
For ast Node parameter types that were passed as parameters for an
instruction the method call to get the value was incorrectly changed
to num() from sym(), which doesn't exist. This was a sloppy regex find
replace that did it by accident. This commit reverts that mistake and
restores the functionality.
* Deprecate not remove sympy.basic and sympy.matrix params
This commit adds back support, albeit it deprecated form, for passing in
instruction parameters as sympy.basic and sympy.matrix objects. It also
updates the release notes to reflect this change.
* Add deprecation for sympy.Expr instruction param too
* Update release notes
* Remove sympy types usage from unit tests
This commit removes the usage of sympy types from unit tests. There were
several cases of unit tests that were using sympy's pi or similar
constants for no particular reason. Since this usage is now deprecated
it is better to remove this. The only sympy usage that remains in the
tests now are for test cases that are explicitly testing behavior with
sympy. These will remain until the sympy support has been removed since
we need to verify that the deprecated feature still works as is until
removal.
* Update release of deprecation to 0.11.0
* Update changed error exception class
* lint
* split!
* passes()
* max_iteration
* replace
* some RunningPassManager clean up
* callback support
* property_set result
* lint
* cleaning up runninpassmanager
* docstring
* args
* runningpassmanager style
* 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
* #3204 Replace QiskitError with CircuitError in qiskit/circuit/*.
* Minor style fixes.
* Minor style fixes.
* Update copyright at qiskit/circuit/exceptions.py
Co-Authored-By: Luciano <luciano.bello@ibm.com>
* removed usage of trivial_flag that indicates when a layer should be skipped by layer_update (#3197)
* removed trivial_flag from stochastic_swap and added a test for omitted gates
* lint
* Initial commit for issue #1921: basic pulse scheduler
Consolidate language regarding greedy/late scheduling. Small time updating fixup. Do input checking sooner and outside of greedy scheduling
Min early schedule works but needs to be rewritten
Update structure to reflect transpiler/
Update mock CmdDef to work with previous cmd_def tests. Add tests, fixup a couple docstrings
Update mock to use u1, u2, u3. Update tests accordingly and make an expected schedule to compare to
Allow a list of circuits rather than only one circuit for top level `scheduler.schedule`
Update gregs->qubits for accuracy
Wrap cmd_def.get error in helpful message
Allow 'asap' and 'alap' method aliases. Add some comments for alap scheduler. move variables that are used nonlocally in helper functions before the helper function to introduce them to the reader
Allow more input options for schedule (cmd_def and meas_map, all optional)
Change name of cx-parametrized to ParametrizedGate
Use insert rather than union when we probably want to respect the buffer
Add documentation around Measure bug, where qubits aren't measured into the requested memory slot
Update tests for doing insertion schedule building rather than union
Add schedule to top level (from qiskit import schedule)
Fixup imports and move schedule from scheduler to compiler
Fixup tests and changelog (after rebase)
Be more specific in QiskitError import to fix cyclic import warning
Keep circuit name in newly scheduled schedule
ALAP now aligns ends of schedules. Additionally fix bug where qubits not yet seen (in reverse order) wouldn't have their times properly updated when a barrier with that qubit is encountered.
* Make docstring improvements
* Move two scheduling structures to better locations
* Add 3Q test, and 3Q mock to enable such a test. 3Q Pulse mock backend is essentially the same as the 2Q one.
* Style
* Add partial transpiler support for targeting ion trap backends. (#3122)
* handle reset/barrier/measure (#3130)
* Do not unroll an Rx,Ry,Rxx circuit to U3,CX because of measure. (#3140)
* rebase ion-trap branch (#3153)
* Remove changelog and document automated creation (#3109)
* Remove changelog and document automated creation
With the introduction of the qiskit-bot release automation for terra we
no longer need to manually maintain or keep a changelog in repo. The
github release pages (which we were manually copy and pasting the
changelog into already) take the place of this file. For all future
releases the creation of this page is completely automatic and handled
by the bot. This works by using the git log and PR tags to figure out
which commits belong in the changelog summary. The commit msg summary
(the first line) is used for the changelog based on the tags. If a
longer explanation is necessary that should be handled in the reno
release notes.
Fixes#3077
* Add README section on changelog
* Make tweaks to readme for clarity
* The option fig.tight_layout is triggering warnings in some situations so it is being removed (#3123)
* no fig.tight_layout
* removing the rest of fig.tight_layout()
* check casteable types in Layout (#3100)
* test
* cast in insinstance
* style
* layouts are already layouts :)
* Travis CI: The sudo: tag is deprecated on Travis (#3134)
https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
* Fix a syntax error in QuantumCircuit.mirror. (#3138)
* Fix for #3106 gatefacecolor key on circuit diagrams (#3137)
* Issue #3106 gatefacecolor key has no effect on circuit diagrams
If the style property "gatefacecolor" is set to a different value than the default, this color is applied.
Fixes#3106
* Solved style problem
space before : eliminated
* Update plot_state_hinton() formatting (#3093)
Add axes to the image part. It looks like the image axes already exist for non-empty graphs. The change that I made here is to remove if np.any(dataimag != 0): if the desired behavior is to see the axes on graphs that don't contain any elements.
Replace rho with the latex rho
Use standard format for real and imag parts of rho
Fixes#2321
* Set barrier across multi-qubits correctly (#3042)
* Previously it was assumed that specified barrier has
a single contiguous span across qubits. Qubits for the
barrier need not be adjacent in the diagram. This commit
handles this case by adding barrier across correct qubits.
* compute multiple short spans.
Fixes#2918
* Test pulse clipping fix Osx #1. (#3144)
* Remove superfluous reference to timeslots from assemble_schedules (#3139)
* Extend custom multiqubit gates over classical bits for mpl (#3062)
* Got it to extend over the clasical bits
* Fixed a small bug
* Removed a file accidentally modified
* Fix linter
* Deprecate allowing extra keys in circuit drawer style dict (#3105)
* test
* cast in insinstance
* style
* layouts are already layouts :)
* style['plotbarrier'] is being deprecated
* internal param for text drawer renamed to plot_barriers
* error when style contains unknown options
* better error message
* remove #3100, since it was not my intention to be on it
* style
* remove plotbarrier
* unused import
* replace error with warning
* release note
* rochester_layout (#3125)
* Use _append when args already converted and broadcast. (#2936)
* Remove line in init which had been commented out (#3150)
* Fix circuit drawing justification (#3061)
Fixes#2802
qiskit/visualization/utils.py _get_layered_instructions() was erroneous and did not justify left nor right correctly. I have reworked that code which underlies many visual representations of circuits to the user.
* refactored, needs more work on right justification
* Looks like this works for qiskit-terra issue #2802
* May fix first test failure for this pull request, while causing another?
* Draws conditionals on ClassicalRegister correctly now.
* - Occurs check for gate in gates leads to good test results.
- Added a few more self.maxDiff = None while debugging. Should they be pulled out?
* tabs and trailing spaces ;)
* removed the maxDiff's because they make the Style and lint test in Python 3.5 fail
* added tests
modified changelog
* Test case extended to include original issue reported in #2802
* oops, left a maxDiff=None in from testing. Fixed
* changes to utils.py requested by reviewer maddy-tod
* test cases split as requested by reviewer maddy-tod
* added circuit diagrams in comments to new tests
* removed note from changelog and made it a release note per @mtreinish
* made _LayerSpooler a private class
* Revert "Remove changelog and document automated creation (#3109)"
This reverts commit effad1228e.
* Make _LayerSpooler a subclass of list
The _LayerSpooler class was only ever used as list. While the class was
an independent type it basically just wrapped an internal list. THen
there were helper functions to access and manipulate that list. These
methods just duplicated what python already provides and the list class
itself already implements. This commit fixes this so the _LayerSpooler
itself is a subclass of list so when it's initialized you can just treat
it as the output list it was generating.
* Clean up release note, fix only, not prelude
* un reverted my revert of CONTRIBUTING.md
* refactored, needs more work on right justification
* Looks like this works for qiskit-terra issue #2802
* May fix first test failure for this pull request, while causing another?
* Draws conditionals on ClassicalRegister correctly now.
* - Occurs check for gate in gates leads to good test results.
- Added a few more self.maxDiff = None while debugging. Should they be pulled out?
* tabs and trailing spaces ;)
* removed the maxDiff's because they make the Style and lint test in Python 3.5 fail
* added tests
modified changelog
* Test case extended to include original issue reported in #2802
* oops, left a maxDiff=None in from testing. Fixed
* changes to utils.py requested by reviewer maddy-tod
* test cases split as requested by reviewer maddy-tod
* added circuit diagrams in comments to new tests
* removed note from changelog and made it a release note per @mtreinish
* made _LayerSpooler a private class
* Make _LayerSpooler a subclass of list
The _LayerSpooler class was only ever used as list. While the class was
an independent type it basically just wrapped an internal list. THen
there were helper functions to access and manipulate that list. These
methods just duplicated what python already provides and the list class
itself already implements. This commit fixes this so the _LayerSpooler
itself is a subclass of list so when it's initialized you can just treat
it as the output list it was generating.
* Clean up release note, fix only, not prelude
* put back missing section
* Add partial transpiler support for targeting ion trap backends. (#3122)
* handle reset/barrier/measure (#3130)
* Do not unroll an Rx,Ry,Rxx circuit to U3,CX because of measure. (#3140)
* Add global Molmer-Sorenson gate (#3149)
* add global ms gate
* clean up
* Update qiskit/extensions/standard/ms.py
Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
* Update qiskit/extensions/standard/ms.py
Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
* clean up
* Update qiskit/extensions/standard/ms.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Update MS docstring
* Add measure_all, measure_active, remove_final_measurement methods
* Add testing for measure_all, measure_active, remove_final_measurements
* Rename remove_final_measurements to remove_final_measures
* Rename test_remove_final_measurements to test_remove_final_measures
* Fix incorrect method call in test_remove_final_measures
* Fix remove_final_measures to only delete ClassicalRegister if it is unused. Fix measure_active to only check for non-idle qubits instead of non-idle qubits and clbits
* Add test_remove_final_measures_multiple_measures
* Remove 'gates' from docstrings when referring to measurements
* Rename remove_final_measures to remove_final_measurements
* Rework remove_final_measurements to use RemoveFinalMeasurements pass
* Add RemoveFinalMeasurements pass
* Add remove_final_measurements module
* Rework test_remove_final_measurements_multiple_measures to work with new circuit.remove_final_measurements
* Add pylint disable-cyclic-import to remove_final_measurements
* tests
* fix test
* test to avoid name conflict
* avoid code repetition
* Add QuantumCircuit methods to add and remove final measurements
* Add newline at end of file
* Change inst.control to inst.condition
* from unittest.mock import patch
* .
* positive power of standard gate
* one and zero
* minus one
* inverse
* docstring and test
* sqrt
* standard
* linting
* docstring
* docstring
* pylint: disable=cyclic-import
* unroller
* power(0)->u3(0,0,0)
* Update qiskit/circuit/instruction.py
* lint
* Implement general power of Gate
By asserting that a gate is Unitary we can diagonalize it and easily
compute powers of the gate.
* cyclic-import
* docstring
* disable
* sqrt test
* sqrt
* improve testing
* delete old tests
* refactor variable names
* docstrings
* power returns an instruction always
* line too long
* lint
* cyclic import
* test
* fix
* Update qiskit/circuit/instruction.py
Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
* docstring
* test with (-1,1) range
* improve test
* from numpy.linalg import matrix_power
* categories in gates
* test_measure
* measure -1
* return a gate when operating in a gate
* SGate().to_matrix() is diagonal so `**` is equivalent.
* TestPowerInvariant
* (op^(1/n))^(n) == op
* (op^(1/n))^(n) == op, integer n
* lint
* other invariant test
* simplification!
* import
* setting the label instead of the name
* readjust test.python.circuit.test_gate_power.TestPowerInt2Q
* docstring
* clean import
* adapted tests
* simpler complex
* Update test/python/circuit/test_gate_power.py
Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
* ddt in test_sgate_float
* test_invariant1_int
* TestPowerIntCX with ddt
* move test_zero_two to ddt
* unused inmports
* check
* docstring
* Move pulse utils, which are Schedule -> Schedule functions, to a reschedule file
* Raise helpful warning
* Style
* Ignore style warning for unused imports, because the functions aren't being called, they are only raising warnings for the user
Fixes#2802
qiskit/visualization/utils.py _get_layered_instructions() was erroneous and did not justify left nor right correctly. I have reworked that code which underlies many visual representations of circuits to the user.
* refactored, needs more work on right justification
* Looks like this works for qiskit-terra issue #2802
* May fix first test failure for this pull request, while causing another?
* Draws conditionals on ClassicalRegister correctly now.
* - Occurs check for gate in gates leads to good test results.
- Added a few more self.maxDiff = None while debugging. Should they be pulled out?
* tabs and trailing spaces ;)
* removed the maxDiff's because they make the Style and lint test in Python 3.5 fail
* added tests
modified changelog
* Test case extended to include original issue reported in #2802
* oops, left a maxDiff=None in from testing. Fixed
* changes to utils.py requested by reviewer maddy-tod
* test cases split as requested by reviewer maddy-tod
* added circuit diagrams in comments to new tests
* removed note from changelog and made it a release note per @mtreinish
* made _LayerSpooler a private class
* Revert "Remove changelog and document automated creation (#3109)"
This reverts commit effad1228e.
* Make _LayerSpooler a subclass of list
The _LayerSpooler class was only ever used as list. While the class was
an independent type it basically just wrapped an internal list. THen
there were helper functions to access and manipulate that list. These
methods just duplicated what python already provides and the list class
itself already implements. This commit fixes this so the _LayerSpooler
itself is a subclass of list so when it's initialized you can just treat
it as the output list it was generating.
* Clean up release note, fix only, not prelude
* un reverted my revert of CONTRIBUTING.md
* refactored, needs more work on right justification
* Looks like this works for qiskit-terra issue #2802
* May fix first test failure for this pull request, while causing another?
* Draws conditionals on ClassicalRegister correctly now.
* - Occurs check for gate in gates leads to good test results.
- Added a few more self.maxDiff = None while debugging. Should they be pulled out?
* tabs and trailing spaces ;)
* removed the maxDiff's because they make the Style and lint test in Python 3.5 fail
* added tests
modified changelog
* Test case extended to include original issue reported in #2802
* oops, left a maxDiff=None in from testing. Fixed
* changes to utils.py requested by reviewer maddy-tod
* test cases split as requested by reviewer maddy-tod
* added circuit diagrams in comments to new tests
* removed note from changelog and made it a release note per @mtreinish
* made _LayerSpooler a private class
* Make _LayerSpooler a subclass of list
The _LayerSpooler class was only ever used as list. While the class was
an independent type it basically just wrapped an internal list. THen
there were helper functions to access and manipulate that list. These
methods just duplicated what python already provides and the list class
itself already implements. This commit fixes this so the _LayerSpooler
itself is a subclass of list so when it's initialized you can just treat
it as the output list it was generating.
* Clean up release note, fix only, not prelude
* put back missing section
* test
* cast in insinstance
* style
* layouts are already layouts :)
* style['plotbarrier'] is being deprecated
* internal param for text drawer renamed to plot_barriers
* error when style contains unknown options
* better error message
* remove #3100, since it was not my intention to be on it
* style
* remove plotbarrier
* unused import
* replace error with warning
* release note
* Deprecate setting the QuatumCircuit data attribute directly
This commit deprecates setting a QuantumCircuit's data attribute
directly. Accessing and reading it are not deprecating, just directly
changing it's value outside of the circuits API.
Fixes#2826
* Update changelog
* POC Proxy interface for circuit.data.
* Implement CircuitData as MutableSequence and add tests.
* Correct bad merge resolution.
* Remove unused imports and lint.
* Update pickles
* Add release notes
* Update CHANGELOG.md
Co-Authored-By: Luciano <luciano.bello@ibm.com>
* Update qiskit/circuit/quantumcircuitdata.py
Co-Authored-By: Luciano <luciano.bello@ibm.com>
* add custom euler angle decomposition
* improve accuracy for ZYZ euler synthesis
* Use old euler_angle_1q method for ZYZ so we don't need quaternions
* XYX converts ZYZ to quaternions then to the new basis
* add 1q synthesis tests
* merge synthesis tests
* verify synthesised unitary
* LINTERLIFE
Truncation for Acquire command is not properly implemented. Pulse drawer crashes when we try to truncate Acquire command with plot_range option. In this PR, pulse length of Acquire is adjusted to fit in with specified plot range.
Fix#3076
* truncate acquire pulse
* add unittest
* add a snapshot of device properties to mock backends
changelog
release note
update location
update loc
rm jo
rm
rm
update backend files
* fix noise adaptive layout test
* deprecate Bit-tuple equality check
* tuples for bits!
* do not altern the topological order
* removing deprecation
* removing more deprecation
* removing even more deprecation
* release note
* changelog
* new reference files
* drop the not matching files
* inputs
* linux and mac
* another one fails
* new ref file
* do not save
* do not remove
* windows
* different refs for different os
* shorter lines
* remove ref
* new refernces
* udpate ref
* clean the azure conf
* moving the env to Makefile
* azure results
* ref image
* make test_ci
* at import time
* the other test
* clean up and new ref
* save for windows
* new ref
* clean up azure conf
* removing backend selection in qiskit/visualization/matplotlib.py
* add backend selection in testing
* lint
* tight
* backend in ci
* .
* drop
* do not remove and copy
* copy results
* save everything
* new ref
* skip these tests if matplotlib is not installed
* TestGraphDist only if HAS_MATPLOTLIB
* lint
* only under failing condition
* new ref
* rest of the artifacts
* Update azure-pipelines.yml
* twice in the same job
* Fix stray whitespace yaml syntax issue
* display name
Previously the graphivz availablity check was performed at import time.
This meant that everytime anyone imported anything from qiskit.* we'd be
shelling out to try and run 'dot -V' to see if python could find
graphviz in order to run the passmanager drawer. This was based on the
model we used for matplotlib which also does it at import time. However,
unlike matplotlib this isn't a simple python import path check shelling
out and running another program takes a non-negligble amount of time to
any import of qiskit. [1] We shouldn't force this check to run all the
time if graphviz is only needed when running the pass manager
visualizer. This commit address this by switching the graphviz check to
be the first operation that occurs in the pass_manager_drawer() function
instead of at the module level. There is no change in behavior except
for when the check is run. However, since this check was used for
testing and is needed to occur at import time for the test module the
check is duplicated in the test code to ensure we can properly skip
tests if graphviz is not present.
[1] https://qiskit.github.io/qiskit/#import.QiskitImport.time_qiskit_import?commits=2d14c1e3
* Modified timeslots to perform more efficient insertions.
* Reorder functions.
* Reset util.
* Redefine intervals by start and stop rather than begin and end.
* Update docstrings of timeslots.
* Add interval methods to timeslot.
* Update methods to use new timeslot methods rather than underlying interval methods.
* linting.
* Localize timeslotcollection try statement.
* Change dumb way of returning booleans.
* Improve locality check.
* fix bubble vs insertion sort comment
* Remove le,ge and starts_after and stops_after methods.
* Change timeslot collection merging to not use sets.
* Update mergeable method.
* Readd channel start and stop at 0 if no instructions are present
* Simplify logic in _merge_timeslot_collection
* Fix bug: cant set timeslots, need to copy them
Parameters were defined such that they would only ever __eq__ self. That way,
if a user defined a Parameter('theta') and wanted to compose in a subcircuit
defined elsewhere which contained a different Parameter('theta'), we would
be able to detect that the parameter names overlapped and raise an error.
However, if a user sent a Parameter to a different python instance though (say
through multiprocessing.Pool or qiskit.tools.parallel_map), it would be
instantiated as a different python object and so no longer be considered equal
to the original parameter.
This PR changes Parameter to instead generate a random UUID on
instantiation and use that for equality testing. Unlike id(self), self._uuid will be
preserved across pickling and de-pickling, but should otherwise preserve
Parameter's equality behavior.
Fixes#2429Fixes#2864
This adds pulse instruction and schedule equality testing. This will make writing Schedule tests easier.
I also added a small change to return instructions with a fixed ordering. This was required for the initial way I implemented equality testing, but have since refactored so that it is not necessary.
Instruction testing verifies that the lhs and rhs have the same Command on the same channels.
Schedule testing first ensures that the lhs and rhs each have the same channels and the same number of instructions. Then it verifies that each instruction at each time in the rhs is contained within the rhs.
* Add schedule and instruction equality testing.
* Modify equality check to be more straight forward.
* Updated changelog.
* refactor equality checking of Commands to not check name and also use the super class of eq.
* Update qiskit/pulse/commands/command.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Fix unpythonic equality checks.
* Add proper hashes for commands.
* Update test/python/pulse/test_schedule.py
Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>
* Change equality check to be based on position in .
This PR adds more informative errors of qubit_lo_freq and meas_lo_freq are missing. A set of tests are added other assemble_schedule optional kwargs to ensure the desired behaviour.
As a follow-up #2832 has been raised to discuss a better lo interface.
Closes#2547
* Add tests for kwargs in assemble schedules. Make qubit_lo_freq and meas_lo_freq raise errors if not supplied.
* Error is now raised for missing qubit and measurement los.
* Added additional missing assemble kwarg tests.
* Change test assertion.
* Update changelog.
* linting.
* Fix lo range checking in lo_config.
* update memory slot assembly test.
* Fix merge bug.
Fixes#2739
This PR adds layout support for all the drawers, with the option with_layout=bool.
* from unittest.mock import patch
* .
* util
* options
* docstring
* text
* done with text
* more tests
* remove utils function
* mpl
* remove namedtuple
* mpl
* latex
* lint
* flip order
* space in latex
* utils
* lint
* layout -> _layout
* Revert "layout -> _layout"
This reverts commit 576c243784.
* layout -> _layout
* merge
* CHANGELOG
* flip layout
* default is True, so no need to have arg
* new test
* changelog
* fixing text
* adjust tests
* fixing latex
* fix mpl
* add test
* name classical register
* __str__
* single_line
* optimization_level
* print result
* avoid paging
* from unittest.mock import patch
* .
* layout -> _layout
* qiskit/visualization/gate_map.py
* add a test for plot_circuit_layout
* increase tolerance
* keep the file
* artifact
* comment out other builds
* put it back
* remove jobs
* jobs back
* task
* first one seems to work!
* back to the tests
* backend[1]
* [2]
* [3]
* azure-pipelines
* do not remove
* results
* artifact
* copy
* other job
* condition
* no windows job
* condition
* copy
* specific test
* content
* monospace
* label
* extend automatically the layout
* plt.rcParams
* new references
* backend
* linting
* backend for windows
Fixes#2806
The issue was the way registers were being indexed in the pass. Previously, the overall index of a qubit was overall_index_of_reg + index_of_wire_in_reg. This became an issue when the registers had a size larger than 1.
For example,
qr0 = QuantumRegister(2, "qr0")
qr1 = QuantumRegister(1, "qr1")
would lead to a global list of registers [qr0, qr1]. This would then index the qubits using the above formula as
qr0[0] = 0 + 0 = 0
qr0[1] = 0 + 1 = 1
qr1[0] = 1 + 0 = 1
As you can see this means there are 2 qubits with the overall index of 1 and so when a CX gate was applied between these 2 it appeared to be applied to the same qubit twice, the qubit at index 1.
I fixed this by updating the way the index was calculated.
It is now sum_of_all_prev_reg_sizes + index_of_wire_in_reg
* Updated the way the registers are indexed so that there are no longer duplications
* Updated the testing
* Fixed the testing to compare the unitary gates each circuit produces to check they are equal
* Removed comments left in
* Implemented suggested change from review - much tidier!
* Fixed linter error
* Add ParameterExpression class supporting basic Parameter math.
* Consistently return ParameterExpressions, even when fully bound.
* Add ParameterExpression support to transpiler passes.
* ParameterExpression tests for instruction equality and converters.
* Add ParameterExpression tests for transpiler and assembler.
* Add ParameterExpression to qobj parameter validation.
* cast for __eq__
* Revert "cast for __eq__"
This reverts commit 8e0c650f4f.
In #2505 an output of a test was accidentally left in and as the tests are no longer running it won't be automatically removed. This commit removes it.
* color updates
* more style
* remove file
* updates
* fix inversion of target colors in bw mode
* lint
* make color setting easier
* color fix
* fixed ref images
* fix
* skip tests that can not be satisfied
* better styling
* lint
* fix cswap edge color
* update images
* update colors
* fix zorder of register lines vs gate lines
* fix skip reasons
* color multi-q gates same as other non-grouped gates
* fix style=False
* added n_qubit funtionality and test
* tests moved to circuit properties test file
* added tests to test_circuit_properties.py file and deleted the previous redundant test file
* Fixing method calling issue and updated qubitless circuit test
* fixed consolidate blocks to add the block in the correct place
* Updated how consolidating blocks works and added in a test
* Changed a comment into an error
* Made the comments on the tests more descriptive and updated a list to be a set
* Fixed the collect2qblocks pass to work if there are gates in the middle of a block
* add Statevector, DensityMatrix classes to quantum_info init
* add equiv method to Operator
* Checks if two operators are equivalent up to global phase
* return false rather than raise in equiv
* add Operator.equiv test
* add equiv method to Statevector
* update changelog
* mr lint
* Use stdlib python logging for pass manager logging
This commit reworks the pass manager logger to use python stdlib logging
instead of attributes in the Passmanager class. This will enable users
to use standard logging mechanism and capture to access debug messages
from the pass manager.
* Fix lint
* More Lint
* Fix lint
* Add log_level option to transpile()
* Fix lint and tests
* Make azure pipeline steps fail on intermediate commands
The azure pipelines commands were previously using the script directive
which on windows uses cmd.exe to run commands. The return code for the
step process only returns non-zero and exits if the last command in the
script returns non-zero, it will continue running if an intermediate
command fails. This can lead to hard to parse errors because something
failed earlier in the pipeline and we don't catch it until later. For
example pip install stestr failing because of a network issues and then
we get a command not found error when we go to run tests. This commit
fixes this issue by switching all the scripts to explicitly use bash
and then using 'set -e' to set errexit to make sure any failing
command causes the job to fail there.
Related to #2879
* Skip failing visualization comparison check on windows
* See if current stestr master fixes the weird osx failure
* Disable streaming output and summary for MacOS
For some reason that I'm not sure about the timestamps for at least one
test are being set to None by the underlying stdlib unittest test runner
in MacOS (instead of a date). This is breaking some of the formatting
used by stestr to provide information about how it's running in
parallel. There is a fix pending in stestr to address this case, but I
suspect something else is causing this which will also need to be fixed.
* Run stestr failing to get failing test name
* Decrease MacOS Job concurrency
* Remove concurrency limit on macos
* Add debug stage to osx to collect system info
* Always run debug stage on macos
* sudo dmesg on macos
* Add more macos debug info
* Downgrade macOS and decrease concurrency