Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
31eb0a09
Commit
31eb0a09
authored
Nov 14, 2019
by
Mccaskey, Alex
Browse files
adding circuit-optimizer doc
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
338d05c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/source/extensions.rst
View file @
31eb0a09
...
...
@@ -638,6 +638,7 @@ or in Python
print(qbits['opt-params'])
Accelerator Decorators
----------------------
ROErrorDecorator
...
...
@@ -703,6 +704,35 @@ IR Transformations
CircuitOptimizer
+++++++++++++++++
This ``IRTransformation`` of type ``Optimization`` will search the DAG representation
of a quantum circuit and remove all zero-rotations, hadamard and cnot pairs, and merge
adjacent common rotations (e.g. ``Rx(.1)Rx(.1) -> Rx(.2)``).
.. code:: python
# Create a bell state program with too many cnots
xacc.qasm('''
.compiler xasm
.circuit foo
.qbit q
H(q[0]);
CX(q[0], q[1]);
CX(q[0], q[1]);
CX(q[0], q[1]);
Measure(q[0]);
Measure(q[1]);
''')
f = xacc.getCompiled('foo')
assert(6 == f.nInstructions())
# Run the circuit-optimizer IRTransformation, can pass
# accelerator (here None) and options (here empty dict())
optimizer = xacc.getIRTransformation('circuit-optimizer')
optimizer.apply(f, None, {})
# should have 4 instructions, not 6
assert(4 == f.nInstructions())
Observables
-----------
...
...
@@ -721,7 +751,7 @@ To use this Observable, ensure you have Psi4 installed under the same
$ make -j8 install
$ export PYTHONPATH=$(python3 -m site --user-site)/psi4/lib:$PYTHONPATH
This observable type takes a
n
dictionary of options describing the
This observable type takes a dictionary of options describing the
molecular geometry (key ``geometry``), the basis set (key ``basis``),
and the list of frozen (key ``frozen-spin-orbitals``) and active (key ``active-spin-orbitals``) spin
orbital lists.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment