Commit 857233dd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

attempt to document probe_diagonal()

parent 01e0bb11
......@@ -107,8 +107,27 @@ def probe_with_posterior_samples(op, post_op, nprobes):
def probe_diagonal(op, nprobes, random_type="pm1"):
'''Probes the diagonal of an endomorphic operator.
The operator is called on a user-specified number of randomly generated
input vectors :math:`v_i`, producing :math:`r_i`. The estimated diagonal
is the mean of :math:`r_i^\dagger v_i`.
op: EndomorphicOperator
The operator to be probed.
nprobes: int
The number of probes to be used.
random_type: str
The kind of random number distribution to be used for the probing.
The default value `pm1` causes the probing vector to be randomly
filled with values of +1 and -1.
The estimated diagonal.
sc = StatCalculator()
for i in range(nprobes):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment