qiskit-documentation/docs/api/qiskit/0.35/qiskit.utils.validate_entan...

35 lines
1.2 KiB
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: validate_entangler_map
description: API reference for qiskit.utils.validate_entangler_map
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.utils.validate_entangler_map
---
# qiskit.utils.validate\_entangler\_map
<Function id="qiskit.utils.validate_entangler_map" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.20/qiskit/utils/entangler_map.py" signature="validate_entangler_map(entangler_map, num_qubits, allow_double_entanglement=False)">
Validate a user supplied entangler map and converts entries to ints.
**Parameters**
* **entangler\_map** (*list\[list]*) An entangler map, keys are source qubit index (int), value is array of target qubit index(es) (int)
* **num\_qubits** (*int*) Number of qubits
* **allow\_double\_entanglement** (*bool*) If we allow in two qubits can be entangled each other
**Returns**
Validated/converted map
**Return type**
list
**Raises**
* **TypeError** entangler map is not list type or list of list
* **ValueError** the index of entangler map is out of range
* **ValueError** the qubits are cross-entangled.
</Function>