Commit Graph

903 Commits

Author SHA1 Message Date
Matthew Treinish a559a22ed7 Add 'auto' mode to user config for circuit_drawer (#2331)
This commit adds a new valid field to the circuit_drawer field in the
user config file. If the value is set to auto the circuit drawer will
determine if matplotlib is installed and if it is will use mpl,
otherwise it'll just revert to using the text backend.
2019-05-12 07:54:19 -04:00
Lev Bishop ef04325d17 Remove useless pylint suppressions (#2365)
* Remove useless pylint suppressions

* some of them are necesary
2019-05-10 16:52:08 -04:00
Lev Bishop 315ba5465f Spelling fixes (#2392)
* Spelling fixes

* More spelling fixes

* Fix line-length lint fail due to typo fix

* A few more typos
2019-05-10 16:00:28 -04:00
Thomas Alexander c9c6d46cae Update expression math sanitization (#2376)
* Add test for pulse issue.

* update test cmd_def strings

* Fix sanitize regex.

* linting.
2019-05-10 11:09:23 -04:00
Luciano 8aa1081515
ast_to_dag support for opaque gates (#2343)
* support for opaque gates

* custom gate

* cleaning up

* remove test_custom_gate

* lint

* lint!

* do not process standard lib
2019-05-10 08:04:25 -04:00
Luciano 43cbe08f71
Fixing spacing in text circuit drawer (#2381)
* test

* fix

* test adjustment

* test

* lint
2019-05-10 07:21:10 -04:00
Lev Bishop 7f0ad7ff30 Remove profile testing loader (#2368) 2019-05-09 10:45:40 +02:00
Diego M. Rodríguez 52fc5f0352
Remove redefined-builtin ignores (#2338)
* Remove redefined-builtin from test

* Remove redefined-builtin from qiskit

* Remove tools.compiler from redefining-builtins
2019-05-09 09:43:06 +02:00
Paul Nation 940d55fc6d
Make colored circuits the default for mpl drawer (#2344)
* colorblind palette

* fix imports

* fix styling

* allow for setting style in settings.conf

* lint

* fix tests
2019-05-08 15:26:33 -04:00
Ali Javadi-Abhari ab2632b97a Remove `qiskit.mapper` directory (#2337)
* remove qiskit.mapper folder

* fix seed -> seed_transpiler
2019-05-07 09:07:20 -04:00
Matthew Treinish 571c9ae7fb Match appveyor requirements install to travis (#2332)
* Match appveyor requirements install to travis

In #2328 tests were added that required nxpd to be installed, but it was
merged before waiting for the results from appveyor. These new tests
don't pass appveyor because the requirements installed were different
from what were installed on travis. This commit fixes this so that we
install the same set of requirements on appveyor and travis jobs to
make sure when people take shortcuts in the future there are less
surprises.

* Add tempfile skip for newly enabled test

* Fix windows skip
2019-05-06 22:39:07 -04:00
Luciano d090eca91d
Better error message when Graphviz is not installed (#2328)
* catch and raise

* testing

* lint
2019-05-06 16:55:52 -04:00
Luciano eef0394ca2
Parameter expansion at QuantumCircuit.append level (#2282)
* append_

* expansion methods

* structure

* default is []

* measure

* barrier

* reset

* merge

* test.python.circuit.test_initializer

* test.python.circuit.test_initializer

* custom instruction

* check measure

* reset

* operator

* return an instruction set

* some #1668 cleaning

* argument_expansion for gates

* more #1668 cleaning

* test_measure_slice_raises

* empty argument

* the rest of #1668 cleaning

* len-as-condition

* len-as-condition

* test.python.circuit.test_registerless_circuit.TestGatesOnWires.test_circuit_qwire_out_of_range

* range and slice

* missing-final-newline

* barrier is sooo special

* docstring

* docstring

* docstring

* docstring

* remove prints

* no need for this change

* removing map

* QiskitError text

* spacing

* exception text

* exception text

* operation to instruction sonner

* cannot handle a list of integers

* best effort casting

* long line is not that long

* comments for helping

* Update qiskit/circuit/quantumcircuit.py

Co-Authored-By: 1ucian0 <luciano@debian.org>

* expansion enumaration

* Update qiskit/circuit/quantumcircuit.py

Co-Authored-By: 1ucian0 <luciano@debian.org>

* list in a barrier

* instruction arg expansion

* Update qiskit/extensions/standard/barrier.py

Co-Authored-By: 1ucian0 <luciano@debian.org>

* lint

* flanten instead of zipping

* simpler expansion

* docstring

* ups

* argument_expansion -> argument_conversion

* broadcast_arguments -> argument_expansion

* undo 33e81f9

* docstrings

* message in casting error
2019-05-06 14:36:13 -04:00
Jay Gambetta ffb463ae19 removing deprecated code in transpile, assemble, execute and derivatives. (#2301)
* Removing old code.

* Small updates

* Editing changeling

* Edit to changeling
2019-05-04 21:13:16 -04:00
Luciano 9612b3f66f Register size type error (and casting when possible) (#2288)
*  not isinstance(size, int) or size <= 0

* lint

* lint

* change the strategy, cast first

* docstring

* lint
2019-05-04 08:51:27 -04:00
Thomas Alexander 8d692b3615 Remove buffer from first pulse on channel. (#2280) 2019-05-02 10:00:35 -04:00
Thomas Alexander 07da540051 Pulse assembly bug (#2279)
* small bug

* Add test for bug.
2019-05-02 08:36:01 -04:00
Ali Javadi-Abhari e44d7aebfc Define transpile optimization levels (#2266)
* allow commutation analysis pass to skip over non gates
* rename to CheckCXDirection
* cx direction uses u2 instead of h
* add new preset pass managers
* do not require transformation passes
2019-05-02 12:51:11 +02:00
Paul Nation 25bed6f9f0 Obtain a reduced coupling_map for a subgraph of a device (#2225)
* reduced_coupling_map

* style

* new headers

* make reduce a CouplingMap method

* get rid of 'backend'

* fix test for python version dependent ordering

* fix idx
2019-05-02 05:35:16 -04:00
Thomas Alexander 03fb844039 Enforce meas map at assembly (#2276)
* Added meas_map to assemble.

* Add meas_map check.

* Add meas_map tests.

* linting.
2019-05-01 22:32:33 -04:00
Thomas Alexander f8fdfc514b schedule assembly bug. (#2274)
* schedue assembly bug.

* A couple more.

* fix bugs.
2019-05-01 21:55:58 -04:00
Thomas Alexander c869c9c2ac
Openpulse drawer (#2213)
* add assembler for schedule (@itoko, @nkanazawa1989)

* update tests

* ensure value is complex

* convert list to tuple before taking lo_range from backend

* add execute assembler to init

* lint

* switch back to original spec about #schedule:#user_lo_dicts

* Add ops module. Begin breaking up schedule operations.

* Add lshift and rshift to schedule.

* Initialize Schedule from Schedules. TimeslotCollection now accepts *slots rather than slots.

* remove default pulse lib from qobj config

* lint

* fix bug when pulse_library is not defined

* Update assembler.py

docstring fix

* Update assembler.py

docstring update.

* Fix docstrings.

* wip schedule draw support

* add pulse backend mock

* rename lo_frequency to lo_freq

* get freq_est from backend.defaults()

* update test

* remove conditioned_schedule

* remove conditioned_schedule

* fix bugs

* update assembler test

* lint

* restructure

* optimize import

* remove empty kernel and discriminator

* update test

* add lo_range check __eq__

* update UserLoDict to check channel type

* remove _replaced_with_user_los

* move converter under qobj

* update test

* add lo converter

* add lo converter

* update docstring

* Change LoDict to LoConfig.

* removed lo_converter as argument and hardcoded instead. This should reduce the complexity of the interface for now. We can always readd.

* Assembler now accepts lo_config as a dictionary (which is then converted to an LoConfig).

* Remove unnecessary return placeholders and commented print statements from tests.

* Renamed LoDictConverter to LoConfigConverter.

* linting

* import linting

* Update LO kwarg documentation

* Remove continuation statements by wrapping with parenthesis.

* Remove lo range and lofreq from output channel identity check.

* Remove dependence of channel hash on frequency.

* Remove lo freq from channel hash.

* Fix test assembler docstrings.

* Remove unnecessary placeholder assignment.

* Restructured assemble_schedules to remove run_config and pass arguments as kwargs.

* renamed lo_configs to schedule_los.

* Change meas_lo_dict to actually return dict.

* Fix test.

* linting.

* Updated changelog.

* remove unnecessary hash.

* wip update channel manager

* Removed __eq__ from output channel.

* update schedule drawer

* wip update drawer

* Add to changelog to force test rerun.

* update drawer

* fix plot range bug

* fix plot range bug

* Remove unneeded raises in docstring.

* remove extra schedule los docstring.

* Fix overrwritten scedule config.

* Add memory/meas_level error messages and handling to schedules.

* Update qobj header docstring.

* Added qobjheader support for dict argument.

* Updated schedule execute and assemble signatures to match. Updated case of meas_level 2 and meas_return, warnings.

* Moved schedule.pulse_schedule to schedule modeule.

* Began shifting to immutable Schedule. Update Timeslots to handle creation from list of timeslots. Can also return time over channels."

* Switched timeslot channels to property.

* reordered schedule methods to go after dunder methods.

* Add insertion method logic.

* Rename occupancies to timeslots. Renamed shifted to shift.

* Switched to ch_start/stop_time methods and start/stop_time properties. All timing is now derived from timeslots.

* update instruction starting times to be handled by timeslots.

* Unify ops between schedule and instruction.

* Update docstring.

* All pulse schedule/instruction/command methods now access attributes through proproperties in order to ensure immutability.

* Remove linebreaks in if statement

* Added schedule operation to ScheduleComponent interface.

* Add schedule composition via timeslots.

* Move pulse.common modules up a level to pulse

* Update schedule flatten generators.

* rename flatten_generator to flatten

* Made schedule methods immutable. Required reworking many of the interfaces.

* More changes to interfaces and bug fixing. Still not passing.

* pulse tests passing.

* Add immutable tests.

* Schedule names are inherited from leftmost child. Fix Instruction naming.

* Fix 0 in timeslots duration.

* Fix 0 in timeslots duration.

* Readd union to schedulecomponent.

* Update tests for latest code.

* Linting.

* Update changelog.

* Fix test formatting.

* Rework pulse instruction converter to no longer use introspection.

* Test fix

* linting.

* disable cyclic import.

* Remove rshift from schedulecomponent.

* Add type hint to pulse schedule.

* Add type hint to sample pulse.

* Switch to style docstring due to cyclic imports.

* Fix channels for pulses.

* Remove individual channel from instructions implementations.

* Update visualization for start times.

* Schedules are now composed of child nodes that track time of children.

* rework instructions.

* Delete extra interface methods.

* Fix typo.

* Added pulse visualization test case.

* added snapshot to visualization

* Remove unused device specification.

* Add visualization to instruction.

* Add plotting to instruction.

* Add instruction plotting test.

* Readd methods to interfaces.

* Add legend.

* Refactor schedule visualization.

* Add acquires to schedule.

* Refactor interpolation module.

* Added reference images and skip image tests again.

* linting.

* fix styling bug.

* Added ability to toggle legend and table.

* Restructure pulse module.

* linting.

* Fix styling defaults.

* Add labels to visualization.

* Add labelling to pulse plots.

* linting

* pulse boundaries are now visualized with lines.

* Update plots

* linting.

* update snapshot location.

* Fix plotting after merge.

* Remove output visualization option.

* Make use of figstyle consistent

* Update pulse scaling and linting.

* Update copyrights

* fix lint

* add space

* I hate the linter

* fix whitespace

* Fix init

* Fix tests.:

* And error check for channel.

* Add type dict.
2019-05-01 21:21:16 -04:00
Thomas Alexander ba79de1bdf Move schedule children attribute to private. (#2265) 2019-05-01 18:42:20 -04:00
Thomas Alexander 52b9d37f17 Pulse command definition (#2263)
* Add pulse backend configuration.

* Add QASM and Pulse backend configuration objects.

* Added QASMBackendConfiguration and PulseBackendConfiguration with factory method from_dict.

* add tests for qasm/pulse backend configuration.

* linting.

* Parameter update

* Cleanup provider models and rename.

* linting

* Linting

* Make QASM -> Qasm

* remove invalid name

* Update open_pulse field to required.

* Remove from_dict hackery.

* Update tests.

* linting.

* linting.

* linting and required variable.

* readd comment.

* Add setting of u_channel_lo frequency.

* Redo qubit signature, all control channels present.

* linting

* Remove lo_freq from pulse channels.

* linting.

* Rework the way lo configuration works. Removed from channels and instead responsibility is placed on assembler.

* Small change to trigger rebuild.

* Fix rebasing.

* Add buffering of commands.

* Add buffer tests.

* linting.

* Small bug in device specification fall back.

* Add buffer to acquire channel.

* Added command definition data structure.

* Added casting of integer input qubits to tuple for cmd_def.

* Added cmd_def object tests. Not running as proper pulse schedule api is not yet running.

* Update imports and making pulse library.

* Added cmd_def and pulse_library to defaults in pulse mock backend

* Remove duplicate of PulseLibraryItem.

* remove redefinition of pulse qobj schema.

* linting

* update schema for parameterizable pulses.

* Add mutable mapping

* Remove mutablemapping and dunder methods.

* cmd_def pulse_library defaults methods.

* Add cmd_def accesor method.

* Update schema for vals and phase of type string.

* Added parameterized schedule and typing to cmd_def.

* Update typing of CmdDef. Add cmd_qubits method.

* Make ConversionMethodBinder generic.

* Rename PulseQobjConverter to InstructionToQobjConverter

* Add conversion logic for qobj to schedules.

* Convert without built pulse_library.

* QobjToInstruction tests and passing.

* Small bug fix.

* Fix cmd_def tests.

* linting.

* linting.

* add linting.

* Add safe expression parsing.

* Add Parameterized Schedule logic.

* Add parameterized schedules with tests.

* Fix cmd_def test.

* Working cmd def.

* Added parameterized cmd_def test

* Update tests.

* Tests passing.

* change cmd_types to cmds)

* Update cmd_def errors.

* Update error strings.

* Fix cmd_qubits.

* Linting.

* update regex and docs.

* Add testing of sanitization

* Update sanitization testing.

* linting.

* Update imports.

* Undo standard imports.

* Fix bug in pulse

* Escape regex
2019-05-01 17:16:36 -04:00
Kevin Krsulich 08a77324d6 Add parameter_map keyword arg to circuit_to_instruction (#2271)
* Move Parameter promotion from Instruction.params to converter.

* Add optional parameter_map to circuit_to_instruction.
2019-05-01 15:30:49 -04:00
Lev Bishop a493a64cfa Implement approximate KAK decomposition (#2121)
* Change two_qubit_kak to use approximate method. Passes current tests

* Move files around and rename two_qubit_kak to cnot_decompose

* Better testing for euler_angles_1q()

* Better testing for euler_angles_1q()

* Better precision for euler_angles_1q

* Better precision for euler_angles_1q

* Better testing for TwoQubitWeylDecomposition

* Testing improvements for quantum_info.synthesis module

* Changelog

* appease the linter. again

* Remove f-strings for python 3.5 compatibility. Change cnot_decompose() to two_qubit_cnot_decompose()
2019-05-01 15:27:29 -04:00
Luciano fe644f669f
Allow PassManager instances to be reused (#2272)
* reset

* lint

* del line

* lint!
2019-05-01 14:33:11 -04:00
Thomas Alexander e775700191 Pulse channel buffers (#2237)
* Add pulse backend configuration.

* Add QASM and Pulse backend configuration objects.

* Added QASMBackendConfiguration and PulseBackendConfiguration with factory method from_dict.

* add tests for qasm/pulse backend configuration.

* linting.

* Parameter update

* Cleanup provider models and rename.

* linting

* Linting

* Make QASM -> Qasm

* remove invalid name

* Update open_pulse field to required.

* Remove from_dict hackery.

* Update tests.

* linting.

* linting.

* linting and required variable.

* readd comment.

* Add setting of u_channel_lo frequency.

* Redo qubit signature, all control channels present.

* linting

* Remove lo_freq from pulse channels.

* linting.

* Rework the way lo configuration works. Removed from channels and instead responsibility is placed on assembler.

* Small change to trigger rebuild.

* Fix rebasing.

* Add buffering of commands.

* Add buffer tests.

* linting.

* Small bug in device specification fall back.

* Add buffer to acquire channel.
2019-05-01 13:51:31 -04:00
Thomas Alexander 9b6db1620f Rework los and lo_ranges for channels (#2226)
* Add pulse backend configuration.

* Add QASM and Pulse backend configuration objects.

* Added QASMBackendConfiguration and PulseBackendConfiguration with factory method from_dict.

* add tests for qasm/pulse backend configuration.

* linting.

* Parameter update

* Cleanup provider models and rename.

* linting

* Linting

* Make QASM -> Qasm

* remove invalid name

* Update open_pulse field to required.

* Remove from_dict hackery.

* Update tests.

* linting.

* linting.

* linting and required variable.

* readd comment.

* Add setting of u_channel_lo frequency.

* Redo qubit signature, all control channels present.

* linting

* Remove lo_freq from pulse channels.

* linting.

* Rework the way lo configuration works. Removed from channels and instead responsibility is placed on assembler.

* Small change to trigger rebuild.

* Fix rebasing.
2019-05-01 08:59:31 -04:00
Luciano 185d6635c4 qubits and clbits as properties (#2257) 2019-04-30 14:43:16 -04:00
Matthew Treinish ed99ad2da2 Handle opaque instructions and identity in qobj_to_circuits (#2147)
* Handle opaque instructions and identity in qobj_to_circuits

This commit fixes the qobj_to_circuits converter to handle opaque/custom
instructions that aren't decomposed in the qobj. At the same time the
identity gate handling is fixed because it is a special case where the
gate name doesn't match the function name (id vs iden()) and needs to be
handled that way.

* Add test

* Fix lint

* Fix lint and test imports

* Just use getattr for params
2019-04-30 14:28:11 -04:00
Kevin Krsulich bb8d7387b8
Improve error message when unrolling parameterized CU1. (#2250) 2019-04-30 14:06:13 -04:00
Thomas Alexander a82a774d34
Pulse backend configuration (#2216)
* Add pulse backend configuration.

* Add QASM and Pulse backend configuration objects.

* Added QASMBackendConfiguration and PulseBackendConfiguration with factory method from_dict.

* add tests for qasm/pulse backend configuration.

* linting.

* Parameter update

* Cleanup provider models and rename.

* linting

* Linting

* Make QASM -> Qasm

* remove invalid name

* Update open_pulse field to required.

* Remove from_dict hackery.

* Update tests.

* linting.

* linting.

* linting and required variable.

* readd comment.
2019-04-30 13:26:39 -04:00
Paul Nation 97cf677137
Copyrights (#2249)
* 2017 cps

* 2018 cps

* 2019 cps
2019-04-30 10:36:47 -04:00
Matthew Treinish beeff75ce6 Add user config file for local settings (#2122)
* Add user config file for local settings

This commit adds the concept of a user config file to set local defaults
when using qiskit-terra. This enables the end user to override the
default values for some commonly used terra functions in their local
environment. Right now this only includes the backend used by the
circuit drawer, but it will be expanded in the future as more settings
with opinionated defaults are exposed. To set a config file you can
either create one in the default location
'~/.config/qiskit/settings.conf' or use the QISKIT_SETTINGS environment
variable to specify an alternative location.

* Updates

* Fix lint issues

* Fix tests on windows

* Fix lint

* Try to fix tests on python <3.7

* More testing updates

* Fix lint

* Skip tempfile tests on windows

Since I can't figure out a reliable way to mock open on python 3.5 and
3.6 (it works fine on 3.7) this commit just skips the tests that used to
use tempfile and sets them to skip on windows environments, since they
don't work on appveyor.

* Remove unused import
2019-04-30 07:59:29 -04:00
Matthew Treinish 018289a92b Remove aer provider tests (#2201)
These tests haven't run in a long time, they skip (not silently but
among all the test results no one notices) They also don't work
currently even if we fix the original breakage. If we're not
cross-testing terra master on aer and vice versa keep these tests in
terra don't provide value (although travis and appveyor limit how much
we can do there). We can revisit adding them back in the future if
needed.
2019-04-30 00:32:31 -04:00
Kevin Krsulich 6623e99c17 Add name collisions for parameterized circuits (#2245)
* Change Paramater.__eq__ to respect identity instead of name.

* Raise if appending different Parameters of same name to circuit.
2019-04-30 00:31:48 -04:00
Jay Gambetta b39827ad26 Compiler api (#2244) 2019-04-29 22:43:48 -04:00
Thomas Alexander d4f58d903b
Refactor enhance schedule (#2241)
* Refactor tree traversal.

* Add flatten test.

* linting.
2019-04-29 20:56:29 -04:00
Kevin Krsulich a475c1d447 Treat parameterized gates as opaque in Optimize1qGates (#2243)
* Update Optimize1qGates to treat Parameterized gates as opaque.

* Remove Parameterized circuit check from default transpile passes.

* Update Instruction.__eq__ to handle Parameters in params.
2019-04-29 16:35:11 -04:00
Ali Javadi-Abhari 10f640aafd
1q unitary decomposition (#2242)
* add 1q unitary decomposition

* changelog

* use to_matrix
2019-04-29 14:36:14 -04:00
Kevin Krsulich 7fc9c9ef31
Add parameterized circuits support in RunConfig and execute (#2210)
* Move parameter binding from ParameterTable to QuantumCircuit.

* Add check that parameters are present in circuit before binding.

* Add __repr__ for Parameter.

* Add test for partial parameter binding.

* Add parameter_binds to RunConfig and execute kwargs.
2019-04-29 14:10:01 -04:00
Luciano a9f770e895 text drawing unitary gates (#2238)
* drawing unitary gates

* unitary

* Kraus and multiplexer

* register name
2019-04-29 13:27:34 -04:00
Luciano eda45e2861 Reset before initializer and optimization to remove it when zero state (#2212)
* add Reset before initialize

* The reset in front of initializer should be removed when zero state

* run after unroller

* RemoveResetInZeroState in default_pass_manager

* test.python.circuit.test_initializer.TestInitialize.test_combiner

* unused-import

* -    if 'reset' in basis_gates:

* adapting InitializeGate to the Instruction API

* lint

* rename InitializeGate-> Initialize

* no more TODO

* test_initialize_FakeMelbourne

* TODO
2019-04-28 21:34:32 -04:00
Ali Javadi-Abhari d1c79f2e66 (re)introduce consolidate blocks pass (#2209)
* introduce consolidate blocks pass

* use auto conversion from operator to instruction

* update to use UnitaryGate
2019-04-28 15:19:15 -04:00
Ali Javadi-Abhari e3b3d18328 move Layout and CouplingMap to transpiler, deprecate qiskit.mapper (#2222)
* move Layout and CouplingMap to transpiler, deprecate qiskit.mapper

* move tests

* add missing files
2019-04-28 13:57:37 -04:00
nkanazawa 7922df9518 PulseQobj and Json Schema updates for pulse simulator (#2052)
* add json schema of pulse simulator configuration

* update custom field of nested dictionary parameter

* add hamiltonian schema

* change dt validation type to float

* add specific QobjConfig

* remove simulator dedicated config

* remove helper qobjs and use pattern properties

* update unittest

* avoid lint error

* relax required restriction in pulse config

* modify simulator config and add schema for each field

* fix schema

* update unittest

* removed unnecessary validation

* remove lint error

* change module name and import

* update simulator_spec

* set required to meas_lo_freq and qubit_lo_freq

* update field name

* allow for empty list of gates and basis_gates

* remove lint error

* reordered pulse qobj config arguments.

* Remove simulator_spec from jsonschema.

* remove simulator spec.
2019-04-27 16:47:28 -04:00
itoko eddef45d42 Fix Pulse naming issues (#2167)
* remove common module and move contents to top-level

* rename PulseCommand to Command

* rename channels module to device module

* remove pulse_ from file name

* rename OutputChannel to PulseChannel

* rename DriveInstruction to PulseInstruction

* improve comments

* rename back module name  to
2019-04-27 15:42:20 -04:00
Luciano a85c741a6e
Pass to remove diagonal gates before measurement (#2208)
* rz_and_z_optimization

* bug fixing and more testing

* changelog

* lint

* RemoveRZandZbeforeMeasure -> RemoveDiagonalGatesBeforeMeasure

* changelog

* invalid-name

* test

* diagonal_control_gates

* CrzGate, Cu1Gate, RZZGate

* lint

* from qiskit.compiler import transpile

* remove_diagonal_gates_before_measurere

* diagonal_control_gates -> diagonal_2q_gates

* quantum_predecessors

* use quantum_predecessors

* test_optimize_1rzz_2measure docstring

* lint
2019-04-26 23:17:07 -04:00
Christopher J. Wood e673d1c2fa Custom instruction assembly and circuit append (#2173)
* add assemble method to instruction

* add optional label to Gate

* add UnitaryGate instruction

* add `to_instruction` to circuit.append

* add to_instruction to Pauli

* add to_instruction to Operator

* add to_instruction to QuantumChannel

* update Snapshot instruction

* allow other snapshots with circuit.snapshot

* add optional label to aer gate classes
2019-04-26 22:56:23 -04:00