Skip to content

Commit

Permalink
Merge pull request #35 from CQCL/docs-fix
Browse files Browse the repository at this point in the history
fix docs error
  • Loading branch information
SamDuffield authored Sep 23, 2022
2 parents aedfc73 + 1f6097c commit aec4738
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/get_statetensor_to_sampled_expectation_func.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
get_statetensor_to_expectation_func
===================================
get_statetensor_to_sampled_expectation_func
===========================================

.. autofunction:: qujax.get_statetensor_to_sampled_expectation_func

Expand Down
11 changes: 6 additions & 5 deletions qujax/observable.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ def get_statetensor_to_expectation_func(gate_seq_seq: Sequence[Sequence[Union[st
coefficients: Union[Sequence[float], jnp.ndarray]) \
-> Callable[[jnp.ndarray], float]:
"""
Converts gate strings, qubit indices and coefficients into a function that converts statetensor into expected value.
Converts gate strings (or arrays), qubit indices and coefficients into a function that
converts statetensor into expected value.
Args:
gate_seq_seq: Sequence of sequences of gates.
Each gate is either a tensor (jnp.ndarray) or a string corresponding to a array in qujax.gates.
Each gate is either a tensor (jnp.ndarray) or a string corresponding to an array in qujax.gates.
E.g. [['Z', 'Z'], ['X']]
qubits_seq_seq: Sequence of sequences of integer qubit indices.
E.g. [[0,1], [2]]
Expand Down Expand Up @@ -105,12 +106,12 @@ def get_statetensor_to_sampled_expectation_func(gate_seq_seq: Sequence[Sequence[
coefficients: Union[Sequence[float], jnp.ndarray]) \
-> Callable[[jnp.ndarray, random.PRNGKeyArray, int], float]:
"""
Converts gate strings, qubit indices and coefficients into a function that converts statetensor into
a sampled expectation value.
Converts gate strings (or arrays), qubit indices and coefficients into a function that
converts statetensor into a sampled expectation value.
Args:
gate_seq_seq: Sequence of sequences of gates.
Each gate is either a tensor (jnp.ndarray) or a string corresponding to a array in qujax.gates.
Each gate is either a tensor (jnp.ndarray) or a string corresponding to an array in qujax.gates.
E.g. [['Z', 'Z'], ['X']]
qubits_seq_seq: Sequence of sequences of integer qubit indices.
E.g. [[0,1], [2]]
Expand Down

0 comments on commit aec4738

Please sign in to comment.