supermarq.features ================== .. py:module:: supermarq.features Functions --------- .. autoapisummary:: supermarq.features.compute_communication supermarq.features.compute_communication_with_qiskit supermarq.features.compute_depth supermarq.features.compute_depth_with_qiskit supermarq.features.compute_entanglement supermarq.features.compute_entanglement_with_qiskit supermarq.features.compute_liveness supermarq.features.compute_liveness_with_qiskit supermarq.features.compute_measurement supermarq.features.compute_measurement_with_qiskit supermarq.features.compute_parallelism supermarq.features.compute_parallelism_with_qiskit Module Contents --------------- .. py:function:: compute_communication(circuit: cirq.Circuit) -> float Compute the *communication* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the communication feature for this circuit. .. py:function:: compute_communication_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the program communication of the given quantum circuit. Program communication = circuit's average qubit degree / degree of a complete graph. :param circuit: A quantum circuit. :returns: The value of the communication feature for this circuit. .. py:function:: compute_depth(circuit: cirq.Circuit) -> float Compute the *depth* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the depth feature for this circuit. .. py:function:: compute_depth_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the critical depth of the given quantum circuit. Critical depth = # of 2-qubit gates along the critical path / total # of 2-qubit gates. :param circuit: A quantum circuit. :returns: The value of the depth feature for this circuit. .. py:function:: compute_entanglement(circuit: cirq.Circuit) -> float Compute the *entanglement* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the entanglement feature for this circuit. .. py:function:: compute_entanglement_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the entanglement-ratio of the given quantum circuit. Entanglement-ratio = ratio between # of 2-qubit gates and total number of gates in the circuit. :param circuit: A quantum circuit. :returns: The value of the entanglement feature for this circuit. .. py:function:: compute_liveness(circuit: cirq.Circuit) -> float Compute the *liveness* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the liveness feature for this circuit. .. py:function:: compute_liveness_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the liveness of the given quantum circuit. Liveness feature = sum of all entries in the liveness matrix / (num_qubits * depth). :param circuit: A quantum circuit. :returns: The value of the liveness feature for this circuit. .. py:function:: compute_measurement(circuit: cirq.Circuit) -> float Compute the *measurement* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the measurement feature for this circuit. .. py:function:: compute_measurement_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the measurement feature of the given quantum circuit. Measurement feature = # of layers of mid-circuit measurement / circuit depth. :param circuit: A quantum circuit. :returns: The value of the measurement feature for this circuit. .. py:function:: compute_parallelism(circuit: cirq.Circuit) -> float Compute the *parallelism* feature of the input circuit. This function acts a wrapper which first converts the input `cirq.Circuit` into a `qiskit.QuantumCircuit` before calculating the feature value. :param circuit: A quantum circuit. :returns: The value of the parallelism feature for this circuit. .. py:function:: compute_parallelism_with_qiskit(circuit: qiskit.QuantumCircuit) -> float Compute the parallelism of the given quantum circuit. Parallelism feature = max((((# of gates / depth) - 1) /(# of qubits - 1)), 0). :param circuit: A quantum circuit. :returns: The value of the parallelism feature for this circuit.