qiskit-documentation/docs/api/qiskit/0.25/qiskit.aqua.utils.random_h2...

32 lines
806 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: random_h2_body
description: API reference for qiskit.aqua.utils.random_h2_body
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.aqua.utils.random_h2_body
---
# qiskit.aqua.utils.random\_h2\_body
<Function id="qiskit.aqua.utils.random_h2_body" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/utils/random_matrix_generator.py" signature="random_h2_body(N, M)">
Generate a random two body integrals.
**Parameters**
* **N** (*int*) number of spin-orbitals (dimension of h2)
* **M** (*int*) number of non-zero entries
**Returns**
a numpy 4-D tensor with complex data type.
**Return type**
np.ndarray
**Raises**
**ValueError** invalid spin orbitals
</Function>