heuristics
calculate_distance
calculate_distance(
q0_index: int,
q1_index: int,
num_columns: int,
distance_metric: DistanceMetric,
) -> float
Calculate the distance between two qubits based on the specified distance metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q0_index
|
int
|
The index of the first qubit. |
required |
q1_index
|
int
|
The index of the second qubit. |
required |
num_columns
|
int
|
The number of columns in the grid. |
required |
distance_metric
|
DistanceMetric
|
Distance metric to be used (Manhattan, Euclidean, or Chebyshev). |
required |
Returns:
| Type | Description |
|---|---|
float
|
The distance between the two qubits. |