Skip to content

Commit

Permalink
10129 pauli doctring (Qiskit#10334)
Browse files Browse the repository at this point in the history
* 10129: update pauli docstrings

* base pauli docstring update

* linting errors fixed
  • Loading branch information
thspreetham98 authored and jlapeyre committed Jun 28, 2023
1 parent ded4f96 commit f6bff44
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
16 changes: 10 additions & 6 deletions qiskit/quantum_info/operators/symplectic/base_pauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,24 @@ def commutes(self, other, qargs=None):
return a_dot_b == b_dot_a

def evolve(self, other, qargs=None, frame="h"):
r"""Heisenberg picture evolution of a Pauli by a Clifford.
r"""Performs either Heisenberg (default) or Schrödinger picture
evolution of the Pauli by a Clifford and returns the evolved Pauli.
This returns the Pauli :math:`P^\prime = C^\dagger.P.C`.
Schrödinger picture evolution can be chosen by passing parameter ``frame='s'``.
This option yields a faster calculation.
By choosing the parameter frame='s', this function returns the Schrödinger evolution of the Pauli
:math:`P^\prime = C.P.C^\dagger`. This option yields a faster calculation.
Heisenberg picture evolves the Pauli as :math:`P^\prime = C^\dagger.P.C`.
Schrödinger picture evolves the Pauli as :math:`P^\prime = C.P.C^\dagger`.
Args:
other (BasePauli or QuantumCircuit): The Clifford circuit to evolve by.
qargs (list): a list of qubits to apply the Clifford to.
frame (string): 'h' for Heisenberg or 's' for Schrödinger framework.
frame (string): ``'h'`` for Heisenberg or ``'s'`` for Schrödinger framework.
Returns:
BasePauli: the Pauli :math:`C^\dagger.P.C`.
BasePauli: the Pauli :math:`C^\dagger.P.C` (Heisenberg picture)
or the Pauli :math:`C.P.C^\dagger` (Schrödinger picture).
Raises:
QiskitError: if the Clifford number of qubits and ``qargs`` don't match.
Expand Down
17 changes: 11 additions & 6 deletions qiskit/quantum_info/operators/symplectic/pauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,20 +567,25 @@ def anticommutes(self, other, qargs=None):
return np.logical_not(self.commutes(other, qargs=qargs))

def evolve(self, other, qargs=None, frame="h"):
r"""Heisenberg picture evolution of a Pauli by a Clifford.
r"""Performs either Heisenberg (default) or Schrödinger picture
evolution of the Pauli by a Clifford and returns the evolved Pauli.
This returns the Pauli :math:`P^\prime = C^\dagger.P.C`.
Schrödinger picture evolution can be chosen by passing parameter ``frame='s'``.
This option yields a faster calculation.
By choosing the parameter frame='s', this function returns the Schrödinger evolution of the Pauli
:math:`P^\prime = C.P.C^\dagger`. This option yields a faster calculation.
Heisenberg picture evolves the Pauli as :math:`P^\prime = C^\dagger.P.C`.
Schrödinger picture evolves the Pauli as :math:`P^\prime = C.P.C^\dagger`.
Args:
other (Pauli or Clifford or QuantumCircuit): The Clifford operator to evolve by.
qargs (list): a list of qubits to apply the Clifford to.
frame (string): 'h' for Heisenberg or 's' for Schrödinger framework.
frame (string): ``'h'`` for Heisenberg (default) or ``'s'`` for
Schrödinger framework.
Returns:
Pauli: the Pauli :math:`C^\dagger.P.C`.
Pauli: the Pauli :math:`C^\dagger.P.C` (Heisenberg picture)
or the Pauli :math:`C.P.C^\dagger` (Schrödinger picture).
Raises:
QiskitError: if the Clifford number of qubits and qargs don't match.
Expand Down
16 changes: 10 additions & 6 deletions qiskit/quantum_info/operators/symplectic/pauli_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,20 +901,24 @@ def _commutes_with_all(self, other, anti=False):
return inds

def evolve(self, other, qargs=None, frame="h"):
r"""Evolve the Pauli by a Clifford.
r"""Performs either Heisenberg (default) or Schrödinger picture
evolution of the Pauli by a Clifford and returns the evolved Pauli.
This returns the Pauli :math:`P^\prime = C.P.C^\dagger`.
Schrödinger picture evolution can be chosen by passing parameter ``frame='s'``.
This option yields a faster calculation.
By choosing the parameter frame='s', this function returns the Schrödinger evolution of the Pauli
:math:`P^\prime = C.P.C^\dagger`. This option yields a faster calculation.
Heisenberg picture evolves the Pauli as :math:`P^\prime = C^\dagger.P.C`.
Schrödinger picture evolves the Pauli as :math:`P^\prime = C.P.C^\dagger`.
Args:
other (Pauli or Clifford or QuantumCircuit): The Clifford operator to evolve by.
qargs (list): a list of qubits to apply the Clifford to.
frame (string): 'h' for Heisenberg or 's' for Schrödinger framework.
frame (string): ``'h'`` for Heisenberg (default) or ``'s'`` for Schrödinger framework.
Returns:
Pauli: the Pauli :math:`C.P.C^\dagger`.
PauliList: the Pauli :math:`C^\dagger.P.C` (Heisenberg picture)
or the Pauli :math:`C.P.C^\dagger` (Schrödinger picture).
Raises:
QiskitError: if the Clifford number of qubits and qargs don't match.
Expand Down

0 comments on commit f6bff44

Please sign in to comment.