qiskit-documentation/docs/api/qiskit/0.29/qiskit.aqua.circuits.DNF.mdx

105 lines
3.4 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: DNF (v0.29)
description: API reference for qiskit.aqua.circuits.DNF in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.aqua.circuits.DNF
---
# DNF
<Class id="qiskit.aqua.circuits.DNF" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/circuits/boolean_logical_circuits.py" signature="DNF(ast, num_vars=None)" modifiers="class">
Bases: `qiskit.aqua.circuits.boolean_logical_circuits.BooleanLogicNormalForm`
Class for constructing circuits for Disjunctive Normal Forms
Constructor.
**Parameters**
* **ast** (*tuple*) The logic expression as an Abstract Syntax Tree (AST) tuple
* **num\_vars** (*int*) Number of boolean variables
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") invalid input
## Methods
<span id="qiskit-aqua-circuits-dnf-compute-num-ancillae" />
### compute\_num\_ancillae
<Function id="qiskit.aqua.circuits.DNF.compute_num_ancillae" signature="DNF.compute_num_ancillae(mct_mode='basic')">
returns the number of ancillary qubits needed
</Function>
<span id="qiskit-aqua-circuits-dnf-construct-circuit" />
### construct\_circuit
<Function id="qiskit.aqua.circuits.DNF.construct_circuit" signature="DNF.construct_circuit(circuit=None, variable_register=None, clause_register=None, output_register=None, ancillary_register=None, mct_mode='basic')">
Construct circuit.
**Parameters**
* **circuit** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")) The optional circuit to extend from
* **variable\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) The optional quantum register to use for problem variables
* **clause\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) The optional quantum register to use for problem clauses
* **output\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) The optional quantum register to use for holding the output
* **ancillary\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) The optional quantum register to use as ancilla
* **mct\_mode** (*str*) The mode to use for building Multiple-Control Toffoli
**Returns**
quantum circuit.
**Return type**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") invalid input
</Function>
## Attributes
### ancillary\_register
<Attribute id="qiskit.aqua.circuits.DNF.ancillary_register">
returns ancillary register
</Attribute>
### clause\_register
<Attribute id="qiskit.aqua.circuits.DNF.clause_register">
returns clause register
</Attribute>
### num\_clauses
<Attribute id="qiskit.aqua.circuits.DNF.num_clauses">
returns num clauses
</Attribute>
### num\_variables
<Attribute id="qiskit.aqua.circuits.DNF.num_variables">
return num variables
</Attribute>
### output\_register
<Attribute id="qiskit.aqua.circuits.DNF.output_register">
returns output register
</Attribute>
### variable\_register
<Attribute id="qiskit.aqua.circuits.DNF.variable_register">
returns variable register
</Attribute>
</Class>