Commit Graph

3035 Commits

Author SHA1 Message Date
Luciano fd76c94d73 introduce ddt, test already-mapped circuits in the transpiler (#2563)
* fix

* cleaning up

* lint

* preset_passmanagers/level3.py

* test

* requirements-dev.txt from #2559

* docstring

* dsc

* docstring

* case are dicts

* simpler approach

* docstring

* avoid double zip

* lint

* add name

* add name

* name

* decorator

* lint

* lint

* no METATEST

* lint

* revert changes to preset pass managers

* docstring

* small consistency tweak

* style
2019-07-11 09:38:32 -04:00
Maddy Tod 513af7f1c1 Fixed DAG.layers() to be deterministic (#2740)
* Updated the layers method to only add the registers once

* Added in a test and made it so the nodes are added properly

* Added in a sort to the order of the nodes so that the order is maintained between DAGs

* Improved redundant code and added a more detailed comment

* Added another comment to clarify the return

* Removed some redundant code
2019-07-10 11:49:36 -04:00
Christopher J. Wood 9083ecca4d
Fix bug in circuit to Operator/SuperOp conversion (#2754) 2019-07-09 20:05:41 +02:00
George Barron ae1921a41a Fixed multi parameter bug (#2743)
* Remove repeated parameters

* Updated changelog

* Update CHANGELOG.md

* Adding test

* Adding test of CmdDef arguments issue being fixed

* Formatting

* Formatting

* Formatting

* Formatting

* Formatting
2019-07-08 10:10:28 -04:00
Paul Nation fae93bc413 Fix depth for barriers and snapshots (#2748)
* fix depth for barriers and snapshots

* Delete Untitled.ipynb

* fix lint not playing nice with snapshot import
2019-07-07 21:48:59 -04:00
Connor Howington 365b790b95 Change Snapshot signature to match simulator.snapshot (#2592) (#2671)
* Change Snapshot signature to match simulator.snapshot (#2592)
* Param name change: name -> label
* Param name change: snap_type -> snapshot_type
* Make snapshot_type optional
* New optional param: name

* Remove name attribute from comparison

* Set name to 'snapshot'

* Remove instruction.name from Snapshot construction

* Change snapshot argument names

* Always return name in __repr__

* Add line to CHANGELOG.md
2019-07-05 12:47:10 -04:00
Maddy Tod 0814912acc Updated the test files (#2729) 2019-07-04 21:59:37 -04:00
Paul Nation 8a99b2ab5b
Unroll before noise adaptive layout (#2727)
* Unroll before noise adaptive layout

* merge ifs

* merge ifs
2019-07-04 05:34:42 -04:00
Albert Frisch 580166ca83 Add new analysis pass CountOpsLongest to transpiler (#2734)
* add count_ops_longest to dagcircuit

* add CountOpsLongest as transpiler analysis pass

* update doc string

* update changelog

* cleanup

* renaming and adding longest_path() to DAGcircuit

* adding tests for longest_path

* minor updates

* minor update

* fix codestyle

* fix line break
2019-07-04 00:27:50 -04:00
nkanazawa c71fc56c54 Allow for np.integer as pulse duration (#2733)
* allow for np.integers

* add test
2019-07-03 23:56:32 -04:00
Luciano 1f95361032 Saving circuit.layout after transpiling (#2736)
* from unittest.mock import patch

* .

* alternative to 2721

* test

* remove subtest
2019-07-03 21:42:15 -04:00
Christopher J. Wood 4679413c91 fix qasm_simulator measure sampling (#2735) 2019-07-03 14:49:02 -04:00
George Barron 6226161d91 Adding hyperbolic secant pulse to pulse libraries (#2726)
* Adding hyperbolic secant and its derivative, not yet working. I think it is due to rescaling.

* Finishing tests

* Update CHANGELOG.md

* Fixed formatting

* Fixed formatting

* More formatting

* Update CHANGELOG.md

* Update CHANGELOG.md
2019-07-03 09:14:36 -04:00
George Barron fc3d24f197 Adding pulse tests (#2730)
* Adding tests for pulse/configuration.py

* Adding invalid case for interval

* Adding tests for intervals and timeslots

* Changing order of kwargs

* str->repr

* Update test_experiment_configurations.py
2019-07-02 23:10:50 -04:00
Christopher J. Wood 2c2f91c6d3 Fix operator initialization from circuit (#2723)
* fix bug in converting circuit to op

* gates were applied to incorrect qubits if they didn't have a matrix definition

* add additional test

* update changelog

* remove debug comment
2019-07-02 14:33:21 -04:00
Ali Javadi-Abhari c268a41cae align lookahead swap with layout convention (#2709)
* align lookahead swap with layout convention

* regenerate pickles

* Update qiskit/transpiler/passes/mapping/lookahead_swap.py

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
2019-07-02 13:21:32 -04:00
nkanazawa 3095127deb Allow for specifying device with element numbers (#2621)
* allow for specifying device with element numbers

* Revert "allow for specifying device with element numbers"

This reverts commit 26765162be.

* add deprecation warning to device specification

* add pulse specification

add pulse specification

* add test for pulse specification

* add device topology class

* refactoring of names and docstrings

* change module name

* refactoring of docstring

* change import order

* refactoring of docstring

* refactoring of docstring, method name

* refactoring of docstring

* refactoring of docstring

* change method name
2019-07-02 09:32:44 -04:00
Diego M. Rodríguez 87bc8518f9 Remove IBMQ resetting from QiskitTestCase (#2719) 2019-07-02 13:39:33 +02:00
Matthew Treinish 0efdfdd952
Update default gate display color docs (#2684)
In #2344 we changed the default output style for the mpl circuit drawer
backend to use colored gates. However, in that PR we didn't change the
documented default behavior in the documentation of the style dict.
This commit corrects the oversight and also cleans up some small issues
in that section of the api docs.
2019-07-01 17:57:11 -04:00
nkanazawa dc2358fbb8 add channels_to_plot to channel builder (#2716) 2019-07-01 11:40:54 -04:00
Matt-Stypulkoski a4a5506c9c Add informative representation for Interval, Timeslot, and TimeslotCollection (#2700)
* Add more informative representation

* Remove unnecessary variables; Reformat repr return calls
2019-07-01 10:34:31 -04:00
Diego M. Rodríguez 03014527cd Fix text drawer DeprecationWarning (#2720) 2019-07-01 09:11:10 -04:00
Samuel Bosch 8d80735b9a Implementation of the Gray-Synth and Patel–Markov–Hayes algorithms (#2457)
* implemented Gray-Synth algorithm

* fixed formatting of the code

* added functionality for processing matrices with same columns (multiple gates applied to same state)

* added functionality for processing matrices with same columns (multiple gates applied to same state) also during the algorithm

* fixed 2 bugs in lwr_cnot_synth() and in graysynth()

* minor formatting fixes

* Created test_graysynth.py file, for checking if graysynth.py works properly

* minor improvements

* fixed error as explained by @ajavadia

* changed __init__.py

* Fixed cyclic import error (suggested by @ajavadia)

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

* Created new folder transpiler/synthesis for synthesis algorithms and put GraySynth algorithm into it. More changes to follow

* upated testing function accordingly

* added function documentations, removed redundant state = np.matrix(state) line

* removed storage class, and replaced it with regular list using its stack functionality, and added raise Exception for numpy.ndarray

* added documentation for Exception in function cnot_synth()

* instead of using T-gates by default, it is now possible to specify any arbitrary phase-gate rotation

* changelog.md

* type fix angels -> angles

* docstring edits

* remove qreg from cnot_synth args

* remove number (n_qubits) from function args as it can be inferred

* specify a default of 2 for n_sections

* simplify test via Operator class, and add test from paper example

* make cnot_synth standalone (not cnot appender), and use QiskitError

* fix bug in cnot_synth and add test

* cnot_synth takes python lists or numpy ndarray

* lint

* Update graysynth.py

* renamed n_sections --> section_size
2019-07-01 07:22:07 +02:00
Luciano 92446e66d9 New slack link in the README.md (#2714)
* from unittest.mock import patch

* .

* slack link
2019-06-30 23:43:50 +02:00
Luciano a57c5b6369 add idle_wires option to drawers (#2692)
* qubits and clbits

* deprecated call

* text drawer

* lint

* utils._get_layered_instructions(circuit, idle_wires=False)

* CHANGELOG and QuantumCircuit.draw

* rest of the drawers

* .
2019-06-30 07:16:19 -04:00
Ali Javadi-Abhari 24fb5adb79
Remove LegacySwap, Remove default_pass_manager, Fix layout issues (#2672)
* use ApplyLayout pass in preset pass managers

* remove legacy swapper

* remove layout from CheckMap

* remove layout from CheckCXDirection

* use ApplyLayout in all preset pass managers

* remove layout from CXDirection

* fix level1 messing up initial layout, and rework tests

* duplicate registers raise dagcircuiterror

* make level 1 default

* add 2503, 2532 as tests

* lint and style

* changelog
2019-06-28 23:47:48 +02:00
Paul Nation 95163828d7
fix dot array alignment (#2705) 2019-06-28 17:08:18 -04:00
Christopher J. Wood 3264d0fd90
add 'unitary' to BasicAer simulators (#2342)
* add 'unitary' to BasicAer simulators
2019-06-28 22:22:26 +02:00
Thomas Alexander 5216f248a6 First rep time by default (#2697)
* qiskit/compiler/assemble.py: Change default rep_time to be the first available (typically the shortest)
2019-06-27 11:22:46 -04:00
Lauren Capelluto 9a53f89947 Ops merge refactor tangential to #2678 (#2685)
* Merge refactor tangential to #2678

* Style: had an extra line

* Deprecate rather than remove ops

* Update qiskit/pulse/schedule.py

Co-Authored-By: Thomas Alexander <thomasalexander2718@gmail.com>
2019-06-27 10:34:42 -04:00
Thomas Alexander 5f311629fb
Allow command names to start with a capital letter. (#2694) 2019-06-27 09:34:59 -04:00
Matthew Treinish 481555ab2b Remove tomography performance test (#2696)
The state tomography performance test has not worked in some time since
the module in terra it was using has been removed. The tomography code
lives in ignis now.
2019-06-26 18:19:08 -04:00
Paul Nation a30f961649
KAK decomposition triggered only if basis gate count in a block is not equal to that of KAK (#2539)
* local_invariance

* fix tests with foce_consolidation

* change binary op check

* tests and lint

* tests and lint

* remove cregs

* remove c

* fix module header

* lint and fix tests

* fix cyclic

* update docstrings

* add weyl here

* make sure to round and FP

* move out magic matrix

* more tests and move to reduced weyl coordinates

* updates

* fix edge case in weyl coords

* move things around

* use same weyl code as decomposer
2019-06-26 13:50:46 -04:00
Kevin Krsulich 31cf182783 Capture and raise with stderr on minimal_ext_cmd failure. (#2662)
* Capture and raise with stderr on minimal_ext_cmd failure.

* Output pip failure as warning

* Fix pylint pedantry
2019-06-26 12:52:23 -04:00
Thomas Alexander 4bfee43231 Pulse command type hinting (#2435)
* Fix type hints and docstrings for pulse commands module.

* Remove period from args/returns docstrings.

* Updated linebreak on acquire.

* Update drawer style type hinting.

* Remove None channel index default argument.

* Add optional type hints.

* Update metacount.
2019-06-26 12:06:27 -04:00
Luciano d20dcad485
Issue #1346 - removed "get" from function names (except get_backend) (#2683)
Co-authored-by: TrishaPe <trisha.pellis@gmail.com>
2019-06-25 18:17:32 -04:00
Matthew Treinish 20fdbe793f Set up CI with Azure Pipelines to replace appveyor (#2687)
* Set up CI with Azure Pipelines

This commit adds a yaml config to start using azure pipelines instead of using appveyor for our windows testing. For our purposes it's mostly the same except that azure is faster and provides much more capacity. [skip ci]

* Remove venv

* Add wheel build job

* Update job names

* Only run wheel builds on tags

* Rework trigger syntax

* Switch back to jobs instead of stages

* Use condtions instead of trigger to filter jobs

* Fix job names

* Enable twine upload

* Remove appveyor

* Fix pypi step definition

* Remove pypi step display name
2019-06-25 13:51:20 -07:00
Maddy Tod 9b066420e9 Updated PassManagerDrawer tests to use a static PassManager (#2677)
* Updated the pm drawer tests to use a predefined pm

* Removed self.config as it was no longer used

* Fixed linting
2019-06-25 08:54:53 -04:00
Lev Bishop e0fc7b9bde Add a mailmap to qiskit-terra (#2666)
This adds a mailmap for qiskit terra in order to merge multiple commit identities into a single author and to choose a canonical name/email for the authors suitable for the attribution scripts to use for generating the AUTHORS file, bibtex file, and zenodo authorship metadata. I did a small amount of work and figured out full names for a few authors who used opaque github ids. I didn't do too much detective work to unmask the last few in case they are trying to be anonymous on purpose.

This resolves the terra piece of Qiskit/qiskit#229

I preferred the noreply.github email if one was present and failing that preferred an IBM email over any other.

Without this PR git-shortlog thinks there are 146 unique authors. After this PR merges duplicates, it shows 105 unique authors. This is 5 fewer than the "100 contributors" quoted on the github webpage because of:

1. 2 authors who have commits but seem to have no github account: Vojtech Havlicek, Christian Claus
2. 3 authors who have a github account but have committed using an email address not attached with that account: @jerrymchow @Trabing @mryu1

* Initial mailmap

* Update mailmap

* Tweak mailmap and add help comments

* Update .mailmap

* Update mailmap from contributor comments

* Add @nkanazawa1989 to mailmap

* Update .mailmap

* Add @sathayen full name from PR comments

* Add comment about mailmaps for other elements. Narrow match for local addresses

* Mailmap consistency with qiskit/qiskit

* Add @gadial name from ignis mailmap

The ignis mailmap file [1] included the full name for @gadial. This
commit just propogates that over to terra too.

[1] https://github.com/Qiskit/qiskit-ignis/blob/master/.mailmap

* Mailmap add entries to fix Co-Authored-By lines
2019-06-24 16:35:36 -04:00
Thomas Alexander 57f3f93645 Add Lauren Capelluto as codeownder. (#2673) 2019-06-23 14:12:38 -04:00
Luciano 00ba08f742 StochasticSwap on physical circuit (#2598)
* change the API

* https://github.com/Qiskit/qiskit-terra/issues/2584#issuecomment-500032736

* regenerate

* unused import

* use trivial layout and simplify signatures

Co-authored-by: Ali Javadi-Abhari <ali.javadi@ibm.com>

* fix tests

* style

* fix stochastic swap example
2019-06-21 14:56:43 -04:00
Luciano b131cc4282 BasicSwap on physical circuit (#2590)
* basicswap on physical circuit

* regenarate

* unused import

* simplification

* always starts at trivial_layout

* fix test docstring circuit
2019-06-21 13:22:31 -04:00
Ali Javadi-Abhari a782c64c73 do not commute conditional gates (#2669)
* do not commute conditional gates

* changelog
2019-06-21 09:34:54 -04:00
Ali Javadi-Abhari f1764af6eb
deprecate u0 gate (#2665)
* deprecate u0

* Update u0.py
2019-06-20 23:25:25 -04:00
Paul Nation 9ebd75642b
Automated job tracking in Jupyter notebooks (#2653)
* automated jupyter job monitor

* style fixes

* remove outdated tests

* updates

* allow updates when main thread blocked

* get around key error bug in jobs for job.error_message
2019-06-20 16:07:56 -04:00
Kevin Krsulich d08d828c97
Run benchmarks in CI, resolve hypothesis errors (#2633)
* Trial job for asv continuous in travis.

* Print circuit QASM during randomized testing.

* Add coverage to python 3.6 job name.

* Suppress hypothesis filter_too_much health check.

* Reducuce random circuit count from 50 to 25.

* Set python version via command line arg rather than sed.
2019-06-20 15:18:58 -04:00
Ali Javadi-Abhari 576b984362
never remove id gates (#2663)
* never remove id gates

* update docstring

* revert changelog

* make id opaque and fix changelog

* lint
2019-06-20 14:19:06 -04:00
Matthew Treinish 5a9cc56b21 Make pip error for version discovery non-fatal (#2661)
As part of the qiskit.__qiskit_version__ attribute we have to call pip
to check for the meta-package version (since it doesn't contain any
python code). However, when doing this there was no error handling in
case pip failed for any reason. This is an issue because the version
discovery code runs on import, so if pip fails for any reason, this
becomes fatal and makes all of qiskit unusable. Since versions queried
via pip aren't critical to the operation this commit adds the necessary
error handling to the pip call. If pip fails for any reason we catch it
and just move on.

Fixes #2660
2019-06-20 12:37:42 -04:00
Ali Javadi-Abhari 2151cb9249 fix log 0 error in noise adaptive layout (#2656) 2019-06-19 17:08:55 -04:00
Paul Nation 913ec51f74 Allow for empty list in gates and basis_gates (#2618)
* allow for None in gates and basis_gates

* switch to empty list instead of None
2019-06-19 14:58:41 -04:00