def __init__(self, name: str,
                 qiskrypt_quantum_circuit: QiskryptQuantumCircuit,
                 bell_state_sub_type: str):
        """
        Constructor of the Qiskrypt's Bell State.

        :param name: the name of the Qiskrypt's Bell State.
        :param qiskrypt_quantum_circuit: the name of the Qiskrypt's Bell State.
        :param bell_state_sub_type: the sub-type of the Qiskrypt's Bell State.
        """

        if bell_state_sub_type in POSSIBLE_CONFIGURATIONS_BELL_STATES:
            """
            If the Qiskrypt's Quantum Entanglement is a valid Bell State.
            """

            if qiskrypt_quantum_circuit.get_total_num_qubits() >= 2:
                """
                If the number of qubits of
                the given Qiskrypt's Quantum Circuit is greater or equal than 2.
                """

                super().__init__(
                    name, POSSIBLE_QUANTUM_ENTANGLEMENT_CARDINALITIES[0],
                    POSSIBLE_QUANTUM_ENTANGLEMENT_TYPES[0],
                    qiskrypt_quantum_circuit, bell_state_sub_type)
                """
                Call of the constructor of the super-class Qiskrypt's Quantum Entanglement.
                """

                self.qiskit_quantum_register_control_index = None
                """
                Set the index of the control IBM Qiskit's Quantum Register, as None.
                """

                self.qiskit_quantum_register_target_index = None
                """
                Set the index of the target IBM Qiskit's Quantum Register, as None.
                """

                self.control_qubit_index = None
                """
                Set the index of a qubit inside the control IBM Qiskit's Quantum Register, as None.
                """

                self.target_qubit_index = None
                """
                Set the index of a qubit inside the target IBM Qiskit's Quantum Register, as None.
                """

            else:
                """
                If the number of qubits and bits of
                the given Qiskrypt's Quantum Circuit is strictly lower than 2.
                """

                # TODO - Throw Exception

        else:
            """
Exemple #2
0
    def __init__(self, name: str,
                 qiskrypt_quantum_circuit: QiskryptQuantumCircuit):
        """
        Constructor of the Qiskrypt's W State.

        :param name: the name of the Qiskrypt's W State.
        :param qiskrypt_quantum_circuit: the name of the Qiskrypt's W State.
        """

        if qiskrypt_quantum_circuit.get_total_num_qubits() >= 3:
            """
            If the number of qubits of
            the given Qiskrypt's Quantum Circuit is greater or equal than 3.
            """

            super().__init__(name,
                             POSSIBLE_QUANTUM_ENTANGLEMENT_CARDINALITIES[1],
                             POSSIBLE_QUANTUM_ENTANGLEMENT_TYPES[2],
                             qiskrypt_quantum_circuit)
            """
            Call of the constructor of the super-class Qiskrypt's Quantum Entanglement.
            """

            self.qiskit_quantum_registers_indexes = None
            """
            Set the index of the IBM Qiskit's Quantum Registers, as None.
            """

            self.qubits_indexes = None
            """
            Set the indexes of the qubits inside the IBM Qiskit's Quantum Registers, as None.
            """

        else:
            """
Exemple #3
0
    def __init__(self, name: str,
                 qiskrypt_quantum_circuit: QiskryptQuantumCircuit):
        """
        Constructor of the Qiskrypt's Cluster State.

        :param name: the name of the Qiskrypt's Cluster State.
        :param qiskrypt_quantum_circuit: the name of the Qiskrypt's Cluster State.
        """

        if qiskrypt_quantum_circuit.get_total_num_qubits() >= 1:
            """
            If the number of qubits of
            the given Qiskrypt's Quantum Circuit is greater or equal than 1.
            """

            super().__init__(name, qiskrypt_quantum_circuit,
                             POSSIBLE_CONFIGURATIONS_RESOURCE_STATES[1])
            """
            Call of the constructor of the super-class Qiskrypt's Resource State.
            """

            self.qiskit_quantum_registers_indexes = None
            """
            Set the indexes of the IBM Qiskit's Quantum Registers, associated to the Cluster State itself,
            as the given indexes for it, as None.
            """

            self.qubits_vertices_indexes = None
            """
            Set the indexes of the qubits inside the IBM Qiskit's Quantum Register,
            representing the vertices of the Cluster State, as the given indexes for it, as None.
            """

        else:
            """
    def __init__(self, name: str, qiskrypt_quantum_circuit: QiskryptQuantumCircuit, resource_type: str):
        """
        Constructor of the Qiskrypt's Resource State.

        :param name: the name of the Qiskrypt's Resource State.
        :param qiskrypt_quantum_circuit: the name of the Qiskrypt's Resource State.
        :param resource_type: the resource type (i.e., Graph or Cluster) for
                              the Qiskrypt's Resource State.
        """

        if qiskrypt_quantum_circuit.get_total_num_qubits() >= 3:
            """
            If the number of qubits of
            the given Qiskrypt's Quantum Circuit is greater or equal than 3.
            """

            if resource_type in POSSIBLE_CONFIGURATIONS_RESOURCE_STATES:
                """
                If the given resource type of the Qiskrypt's Resource State is valid.
                """

                super().__init__(name, POSSIBLE_QUANTUM_ENTANGLEMENT_CARDINALITIES[1],
                                 POSSIBLE_QUANTUM_ENTANGLEMENT_TYPES[5],
                                 qiskrypt_quantum_circuit)
                """
                Call of the constructor of the super-class Qiskrypt's Quantum Entanglement.
                """

                self.resource_type = resource_type
                """
                Set the resource type of the Qiskrypt's Resource State.
                """

        else:
            """