Hypergraphstates¶
-
circuit_creation
(n, hyperedges)[source]¶ Creates an empty circuit with the number of qubits required.
Parameters: - n (int) – The number of qubits of which depends the number of wires to create.
- hyperedges (list[list[int]]) – A list containing the lists of the vertices which are linked by an hyperedge.
Returns: QuantumCircuit – A circuit with the required number of quantum wires and classical wires.
-
circuit_initialisation
(n, hyperedges)[source]¶ - Creates an empty circuit with the number of qubits required and places
- the circuit in the initial state before adding gates for calculations. Places and Hadamard gate on every main (non additional) qubits wire. This is needed in order to place the qubits in a \(|+>\) state which is \((|0> + |1>) / sqrt(2)\).
Parameters: - n (int) – The number of qubits of which depends the number of wires to create.
- hyperedges (list[list[int]]) – A list containing the lists of the vertices which are linked by an hyperedge.
Returns: QuantumCircuit – The created and initialized circuit.
-
edges_layout
(n, hyperedges, circuit)[source]¶ - Disposes all the gates corresponding to the edges.
- In fact, for a two-vertices edge, there not much to do, as for a three-vertices edge, too. For more an edge of than three vertices, things are a little different. First, Toffoli gates are used to link qubits two by two. The target qubit here is an auxiliary qubit. Then, the last link is a simple CZ. But all the Toffoli gates that we put create an entanglement which is removed by replacing exactly the same gates again after the CZ.
Parameters: - n (int) – The number of qubits.
- hyperedges (list[list[int]) – The list of the vertices which are linked by an hyperedge.
- circuit (QuantumCircuit) – The circuit that will be modified.
Returns: None