compute_d

sknano.core.structures.compute_d(*Ch)[source] [edit on github][source]

Compute \(d=\gcd{(n, m)}\)

\(d\) is the Greatest Common Divisor of \(n\) and \(m\).

Parameters:*Ch

Either a 2-tuple of ints or 2 integers giving the chiral indices of the nanotube chiral vector \(\mathbf{C}_h = n\mathbf{a}_1 + m\mathbf{a}_2 = (n, m)\).

Returns:gcd – Greatest Common Divisor of \(n\) and \(m\)
Return type:int