Welcome,
Share Files

Scripts 1

lattice(d1, d2, d3, p1, p2, p3, p, rad, col, r, rcol, l1, l2, l3, mode=0): Plots crystal structures with any unit cell.
d1 -> length of the unit cell in the x-axis
d2 -> length of the unit cell in the y-axis
d3 -> length of the unit cell in the z-axis
p1 -> angle between x and z-axis of the unit cell
p2 -> angle between y and z-axis of the unit cell
p3 -> angle between x and y-axis of the unit cell
p -> position of the points in the unit cell with format: [[x1, x2, ..., xn], [y1, y2, ..., yn], [z1, z2, ..., zn]]
rad -> radius of the points with format: [rad1, rad2, ..., radn]
col -> colors of the points in the unit cell with format: [col1, col2, ..., coln]
r -> radius of the connecting tubes
rcol -> color of the connecting tubes
l1 -> number of unit cells in the x-axis
l2 -> number of unit cells in the y-axis
l3 -> number of unit cells in the z-axis
mode = 0 -> plot only the points (by default)
mode = 1 -> plots tubes between the nearest neighbors
mode = [[p1, p2], [p3, p4], ..., [pm, pn]] -> plot tubes between the points p(p1)-p(p2), p(p3)-p(p4) ... p(pm)-p(pn) in every unit cell
wi -> Width for the output plots
he -> Height for the output plots


cg(j1, j2, j, m1, m2, m, mode=1): Computes Clebsch-Gordan coefficients.
j1 -> j-value of the first angular momentum
j2 -> j-value of the second angular momentum
j -> j-value of the coupled angular momentum
m1 -> m-value of the first angular momentum
m2 -> m-value of the second angular momentum
m -> m-value of the coupled angular momentum
mode = 0 -> return the clebsch-gordan coefficient squared with its corresponding sign, in fraction form when it's possible
mode = 1 -> return the clebsch-gordan coefficient in decimal form


cgtable(j1, j2, mode=0): Computes tables of Clebsch-Gordan coefficients, the output format is [m1, m2, j, m, C(j1, j2, m1, m2, j, m)].
j1 -> j-value of the first angular momentum
j2 -> j-value of the second angular momentum
mode = 0 -> return the clebsch-gordan coefficient squared with its corresponding sign, in fraction form when it's possible
mode = 1 -> return the clebsch-gordan coefficient in decimal form


RGBtoCMYK(a): This function converts a color in RGB mode to CMYK mode. The input format is a=[R, G, B] and the output format is [C, M, Y, K].


CMYKtoRGB: This function converts a color in CMYK mode to RGB mode. The input format is a=[C, M, Y, K] and the output format is [R, G, B].


WtoRGB: This function converts a visible wavelength (in nanometers) to RGB mode. The output format is [R, G, B].