supermarq.features
Functions
|
Compute the communication feature of the input circuit. |
|
Compute the program communication of the given quantum circuit. |
|
Compute the depth feature of the input circuit. |
|
Compute the critical depth of the given quantum circuit. |
|
Compute the entanglement feature of the input circuit. |
|
Compute the entanglement-ratio of the given quantum circuit. |
|
Compute the liveness feature of the input circuit. |
|
Compute the liveness of the given quantum circuit. |
|
Compute the measurement feature of the input circuit. |
|
Compute the measurement feature of the given quantum circuit. |
|
Compute the parallelism feature of the input circuit. |
|
Compute the parallelism of the given quantum circuit. |
Module Contents
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the communication feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the communication feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the depth feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the depth feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the entanglement feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the entanglement feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the liveness feature for this circuit.
- supermarq.features.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).
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the liveness feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the measurement feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the measurement feature for this circuit.
- supermarq.features.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.
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the parallelism feature for this circuit.
- supermarq.features.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).
- Parameters:
circuit – A quantum circuit.
- Returns:
The value of the parallelism feature for this circuit.