Skip to content

Commit

Permalink
add Patel-Markov-Hayes to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShellyGarion committed Nov 15, 2022
1 parent 04fbe38 commit 773d066
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion qiskit/synthesis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
.. autosummary::
:toctree: ../stubs/
synth_cnot_count_full_pmh
synth_cnot_depth_line_kms
"""
Expand All @@ -47,4 +48,4 @@
QDrift,
)

from .linear import synth_cnot_depth_line_kms
from .linear import synth_cnot_count_full_pmh, synth_cnot_depth_line_kms
28 changes: 16 additions & 12 deletions qiskit/synthesis/linear/graysynth.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,31 @@ def graysynth(cnots, angles, section_size=2):

def synth_cnot_count_full_pmh(state, section_size=2):
"""
This function is an implementation of the Patel–Markov–Hayes algorithm
for optimal synthesis of linear reversible circuits, as specified by an
n x n matrix.
Synthesize linear reversible circuits for all-to-all architecture
using Patel, Markov and Hayes method.
The algorithm is described in detail in the following paper:
"Optimal synthesis of linear reversible circuits."
Patel, Ketan N., Igor L. Markov, and John P. Hayes.
Quantum Information & Computation 8.3 (2008): 282-294.
This function is an implementation of the Patel, Markov and Hayes algorithm from [1]
for optimal synthesis of linear reversible circuits for all-to-all architecture,
as specified by an n x n matrix.
Args:
state (list[list] or ndarray): n x n matrix, describing the state
state (list[list] or ndarray): n x n boolean invertible matrix, describing the state
of the input circuit
section_size (int): the size of each section, used in _lwr_cnot_synth(), in the
Patel–Markov–Hayes algorithm. section_size must be a factor of num_qubits.
section_size (int): the size of each section, used in the
Patel–Markov–Hayes algorithm [1]. section_size must be a factor of num_qubits.
Returns:
QuantumCircuit: a CNOT-only circuit implementing the
QuantumCircuit: a CX-only circuit implementing the
desired linear transformation
Raises:
QiskitError: when variable "state" isn't of type numpy.matrix
QiskitError: when variable "state" isn't of type numpy.ndarray
References:
1. Patel, Ketan N., Igor L. Markov, and John P. Hayes,
*Optimal synthesis of linear reversible circuits*,
Quantum Information & Computation 8.3 (2008): 282-294.
`arXiv:quant-ph/0302002 [quant-ph] <https://arxiv.org/abs/quant-ph/0302002>`_
"""
if not isinstance(state, (list, np.ndarray)):
raise QiskitError(
Expand Down

0 comments on commit 773d066

Please sign in to comment.