diff --git a/tensorflow_quantum/core/ops/math_ops/fidelity_op.py b/tensorflow_quantum/core/ops/math_ops/fidelity_op.py index 8f2e87e44..9e704794d 100644 --- a/tensorflow_quantum/core/ops/math_ops/fidelity_op.py +++ b/tensorflow_quantum/core/ops/math_ops/fidelity_op.py @@ -25,9 +25,11 @@ def fidelity(programs, symbol_names, symbol_values, other_programs): Compute (potentially many) fidelities between the given circuits and the symbol free comparison circuits. - Calculates out[i][j] = $ | \langle \psi_{\text{programs[i]}} \\ - (\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle \\ - |^2 $ + Calculates out[i][j] as: + $$ + |\langle \psi_{\text{programs[i]}}(\text{symbol_values[i]}) \mid + \psi_{\text{other_programs[j]}} \rangle|^2 + $$ >>> symbols = sympy.symbols('alpha beta') diff --git a/tensorflow_quantum/core/ops/math_ops/inner_product_op.py b/tensorflow_quantum/core/ops/math_ops/inner_product_op.py index 5d92b7b92..18529ba18 100644 --- a/tensorflow_quantum/core/ops/math_ops/inner_product_op.py +++ b/tensorflow_quantum/core/ops/math_ops/inner_product_op.py @@ -75,8 +75,11 @@ def inner_product(programs, symbol_names, symbol_values, other_programs): Compute (potentially many) inner products between the given circuits and the symbol free comparison circuits. - Calculates out[i][j] = $ \langle \psi_{\text{programs[i]}} \\ - (\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle $ + Calculates out[i][j] as: + $$ + \langle \psi_{\text{programs[i]}}(\text{symbol_values[i]}) \mid + \psi_{\text{other_programs[j]}} \rangle + $$ >>> symbols = sympy.symbols('alpha beta')