pyqcstrc.ico2 package

Submodules

pyqcstrc.ico2.intsct module

pyqcstrc.ico2.intsct.ball_radius(tetrahedron: ndarray[Any, dtype[int64]], centroid: ndarray[Any, dtype[int64]]) float
pyqcstrc.ico2.intsct.ball_radius_obj(obj: ndarray[Any, dtype[int64]], centroid: ndarray[Any, dtype[int64]]) float

estimate maximum distance between verices of given OBJ and its centroid.

Parameters:
  • obj (array (ndim=4)) – in TAU-style

  • centroid (array, (ndim=2)) – a 6-dimensional coordinates in TAU-style

Returns:

length

Return type:

float

pyqcstrc.ico2.intsct.check_intersection_two_tetrahedron_4(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) int
pyqcstrc.ico2.intsct.decomposition(p: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.intsct.distance_in_perp_space(vt1: ndarray[Any, dtype[int64]], vt2: ndarray[Any, dtype[int64]]) float
pyqcstrc.ico2.intsct.intersection_segment_surface(segment: ndarray[Any, dtype[int64]], surface: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

check intersection between a line segment and a triangle.

Möller–Trumbore intersection algorithm https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm

Parameters:
  • line_segment (array) – 6-dimensional coordinates of line segment,xyzuvw1, xyzuvw2, in TAU-style

  • triangle (array) – containing 6-dimensional coordinates of tree vertecies of a triangle, xyzuvw1, xyzuvw2, xyzuvw3, xyzuvw4 in TAU-style

pyqcstrc.ico2.intsct.intersection_two_obj_1(obj1: ndarray[Any, dtype[int64]], obj2: ndarray[Any, dtype[int64]], kind=None, verbose: int = 0) ndarray[Any, dtype[int64]]

Return an intersection between two objects.

Parameters:
  • obj1 (ndarray) – a set of tetrahedra to be intersected with obj2.

  • obj2 (ndarray) – a set of tetrahedra to be intersected with obj1.

  • kind ({'standard', 'simple'}, optional) – The default is ‘standard’.

Returns:

intersection between obj1 and obj2 – Array of the same type and shape as obj1 and obj2.

Return type:

ndarray

Notes

‘standard’ intersection is default.

Output from ‘simple’ intersection is simpler but may cause a problem when generating its surface triangles.

pyqcstrc.ico2.intsct.intersection_two_obj_convex(obj1: ndarray[Any, dtype[int64]], obj2: ndarray[Any, dtype[int64]], verbose: int = 0) ndarray[Any, dtype[int64]]

Return an intersection between two objects.

Parameters:
  • obj1 (ndarray) – a set of tetrahedra to be intersected with obj2.

  • obj2 (ndarray) – a set of tetrahedra to be intersected with obj1.

  • kind ({'standard', 'simple'}, optional) – The default is ‘standard’.

Returns:

intersection between obj1 and obj2 – Array of the same type and shape as obj1 and obj2.

Return type:

ndarray

Notes

Both obj1 and obj2 have to be convex hull.

pyqcstrc.ico2.intsct.intersection_two_segment(segment_1: ndarray[Any, dtype[int64]], segment_2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

check intersection between two line segments.

Parameters:

line_segment_2 (line_segment_1) – 6-dimensional coordinates of line segment,(xyzuvw1, xyzuvw2) and (xyzuvw3, xyzuvw4), in TAU-style

pyqcstrc.ico2.intsct.intersection_two_tetrahedron_4(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.intsct.rough_check_intersection_tetrahedron_obj(tetrahedron: ndarray[Any, dtype[int64]], cententer: ndarray[Any, dtype[int64]], distance: float) bool
pyqcstrc.ico2.intsct.subtraction_two_obj(obj1: ndarray[Any, dtype[int64]], obj2: ndarray[Any, dtype[int64]], verbose: int = 0) ndarray[Any, dtype[int64]]

Operate A not B (= A NOT (A AND B)).

Parameters:
  • obj1 (array,(number of tetrahedra, 4, 6, 3)) – Object A to be subtracted.

  • obj2 (array, (number of tetrahedra, 4, 6, 3)) – Object B that subtracts the tetrahedron.

  • verbose (int)

Returns:

obj

Return type:

array, (number of tetrahedra, 4, 6, 3)

pyqcstrc.ico2.intsct.tetrahedron_not_obj_1(tetrahedron: ndarray[Any, dtype[int64]], obj: ndarray[Any, dtype[int64]], surface_obj: ndarray[Any, dtype[int64]], verbose: int = 0) ndarray[Any, dtype[int64]]

Operate tetrahedron not object = tetrahedron not (tetrahedron and object).

Parameters:
  • tetrahedron (array, (1, 4, 6, 3)) – Tetrahedron to be subtracted.

  • obj (array, (number of tetrahedra, 4, 6, 3)) – Object that subtracts the tetrahedron.

  • surface_obj (array, (number of triangles, 3, 6, 3)) – Surface trianges of the object.

  • verbose (int)

Returns:

obj

Return type:

array, (number of tetrahedra, 4, 6, 3)

Note

Current implementation may return wrong object when the intersecting between the objects is not simple.

pyqcstrc.ico2.intsct.tetrahedron_not_obj_2(tetrahedron: ndarray[Any, dtype[int64]], obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Operate tetrahedron not object = tetrahedron not (tetrahedron and object).

tetrahedronからobjを引いた物体の表面にある三角形を求める(本当は四面体を求めたいが難しい) アルゴリズム 1. tetrahedronとobjの共通部分Aを求める。 2. A表面の三角形T1を求める 3. objの表面の三角形T2を求める。 4. T1のうち、T2上にあるものT1’を得る。T1’は求めたい差分tetrahedron NOT objの表面の一部になる。 5. T1のうち、T2の外側にあるものとT1’を合わせる。

Parameters:
  • tetrahedron (array, (1, 4, 6, 3)) – Tetrahedron to be subtracted.

  • obj (array, (number of tetrahedra, 4, 6, 3)) – Object that subtracts the tetrahedron.

Returns:

obj

Return type:

array, (number of tetrahedra, 4, 6, 3)

Note

Under development.

pyqcstrc.ico2.math1 module

pyqcstrc.ico2.math1.add(a: ndarray[Any, dtype[int64]], b: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

# summation (a+b) in TAU-style

Parameters:
  • a (array) – value in TAU-style

  • b (array) – value in TAU-style

Return type:

float

pyqcstrc.ico2.math1.add_vectors(vt1: ndarray[Any, dtype[int64]], vt2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Composition of two vectors, v1+v2

Parameters:
  • vt1 (array) – a vector in TAU-style

  • vt2 (array,) – a scalar in TAU-style

Returns:

Composition of two vectors

Return type:

array in TAU-style

pyqcstrc.ico2.math1.centroid(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

geometric center, centroid of tetrahedron, triangle or edge, in TAU-style.

Parameters:

obj (array) – 6-dimensional vector in TAU-style

Returns:

centroid

Return type:

array in TAU-style

pyqcstrc.ico2.math1.centroid_obj(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

geometric center, centroid of tetrahedron, in TAU-style.

Parameters:

tetrahedron (array) – 6-dimensional vector in TAU-style

Returns:

centroid

Return type:

array in TAU-style

pyqcstrc.ico2.math1.coplanar_check(p: ndarray[Any, dtype[int64]], num_iteration: int = 5) bool

Check whether a given set of points (in TAU-style) is coplanar or not.

メモ:xyz1とxyz2の選び方次第で、outer_product(v1,v2)が小さくなりcoplanarと間違って判定する場合がある。 これを避けるために適切なxyz1とxyz2の選び方が必要。以下では、ランダムにxyz1とxyz2の選ぶ。

Parameters:

p (array) – a set of pointsin TAU-style.

Returns:

  • int

  • #bool

pyqcstrc.ico2.math1.det_matrix(mtx: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Determinant of 3x3 matrix, mtx, in TAU style

Parameters:

mtx (array) – 3x3 matrix in TAU-style

Return type:

6d vectors projected onto Eperp in TAU-style.

pyqcstrc.ico2.math1.div(a: ndarray[Any, dtype[int64]], b: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

# division (a/b) in TAU-style

Parameters:
  • a (array) – value in TAU-style

  • b (array) – value in TAU-style

Return type:

float

pyqcstrc.ico2.math1.dot_product(mat1: ndarray[Any, dtype[int64]], mat2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

product of two matrices, mat1*mat2.

Parameters:
  • mat1 (ndarray) – (s,t) in TAU-style

  • mat2 (ndarray) – (t,u) in TAU-style

Returns:

Inner product

Return type:

array in TAU-style

pyqcstrc.ico2.math1.dot_product_1(mat1: ndarray[Any, dtype[int64]], mat2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

product of two matrices, mat1*mat2.

Parameters:
  • mat1 (ndarray) – (s,t) in “NOT” TAU-style

  • mat2 (ndarray) – (t,u) in TAU-style

Returns:

Inner product

Return type:

array in TAU-style

pyqcstrc.ico2.math1.inner_product(vt1: ndarray[Any, dtype[int64]], vt2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Inner product of two vectors, v1 and v2 in TAU-style.

Parameters:
  • vt1 (array) – vector in TAU-style

  • vt2 (array,) – vector in TAU-style

Returns:

Inner product

Return type:

array in TAU-style

pyqcstrc.ico2.math1.matrixpow(ma: ndarray[Any, dtype[int64]], n: int) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.math1.mtrixcal(m1: ndarray[Any, dtype[int64]], m2: ndarray[Any, dtype[int64]], m3: ndarray[Any, dtype[int64]], m4: ndarray[Any, dtype[int64]], m5: ndarray[Any, dtype[int64]], m6: ndarray[Any, dtype[int64]], v: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
function used in projection()

projection3() projection_perp()

Parameters:
  • m1 (array for projection materix)

  • m2 (array for projection materix)

  • m3 (array for projection materix)

  • m4 (array for projection materix)

  • m5 (array for projection materix)

  • m6 (array for projection materix)

  • v (array) – 6-dimensional vector in TAU-style

Return type:

6d vectors projected onto Eperp in TAU-style.

pyqcstrc.ico2.math1.mul(a: ndarray[Any, dtype[int64]], b: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

# multiplication (a*b) in TAU-style

Parameters:
  • a (array) – value in TAU-style

  • b (array) – value in TAU-style

Return type:

float

pyqcstrc.ico2.math1.mul_vector(vt: ndarray[Any, dtype[int64]], coeff: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Multiplying a vector by a scalar in TAU-style.

Parameters:
  • vt (array) – a vector in TAU-style

  • coeff (array,) – a scalar in TAU-style

Returns:

Multiplied vector

Return type:

array in TAU-style

pyqcstrc.ico2.math1.mul_vectors(vts: ndarray[Any, dtype[int64]], coeff: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

multiplying a set of vectors by a scalar in TAU-style.

Parameters:
  • vts (array) – a set of vectors in TAU-style

  • coeff (array,) – a scalar in TAU-style

Returns:

Multiplied vectors

Return type:

array in TAU-style

pyqcstrc.ico2.math1.outer_product(vt1: ndarray[Any, dtype[int64]], vt2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Outer product of two 3d vectors, v1 and v2 in TAU-style.

Parameters:
  • v1 (array) – 3-dimensional vector in TAU-style

  • v2 (array,) – 3-dimensional vector in TAU-style

Returns:

Outer product

Return type:

array in TAU-style

pyqcstrc.ico2.math1.projection(vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

projection of a 6d vector onto Epar and Eperp in “TAU-style” NOTE: coefficient (alpha) of the projection matrix is set to be 1. alpha = a/np.sqrt(2.0+TAU) see Yamamoto ActaCrystal (1997)

Parameters:

vt (array) – 6-dimensional vector in TAU-style

Return type:

array containing two 3d vectors projected onto Epar and Eperp in TAU-style.

pyqcstrc.ico2.math1.projection3(vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

projection of a 6d vector onto Eperp in “TAU-style” NOTE: coefficient (alpha) of the projection matrix is set to be 1. alpha = a/np.sqrt(2.0+TAU) see Yamamoto ActaCrystal (1997)

Parameters:

vt (array) – 6-dimensional vector in TAU-style

Return type:

3d vectors projected onto Eperp in TAU-style.

pyqcstrc.ico2.math1.projection_perp(vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

This returns 6D indeces of a projection of 6D vector (v) onto Eperp

Parameters:

v (array) – 6-dimensional vector in TAU-style

Return type:

6d vectors projected onto Eperp in TAU-style.

pyqcstrc.ico2.math1.sub(a: ndarray[Any, dtype[int64]], b: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

# subtraction (a/b) in TAU-style

Parameters:
  • a (array) – value in TAU-style

  • b (array) – value in TAU-style

Return type:

float

pyqcstrc.ico2.math1.sub_vectors(vt1: ndarray[Any, dtype[int64]], vt2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Subtraction of two vectors, v1-v2

Parameters:
  • vt1 (array) – a vector in TAU-style

  • vt2 (array,) – a scalar in TAU-style

Returns:

Subtraction of two vectors

Return type:

array in TAU-style

pyqcstrc.ico2.numericalc module

pyqcstrc.ico2.numericalc.check_intersection_segment_surface_numerical(ln: ndarray[Any, dtype[float64]], tr: ndarray[Any, dtype[float64]]) bool

check intersection between a line segment and a triangle.

Möller–Trumbore intersection algorithm https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm

Parameters:
  • line_segment (array) – two 3-dimensional coordinates of line segment, xyz1, xyz2.

  • triangle (array) – containing 3-dimensional coordinates of tree vertecies of a triangle (a), xyz1, xyz2, xyz3.

pyqcstrc.ico2.numericalc.check_intersection_segment_surface_numerical_6d_tau(line_segment: ndarray[Any, dtype[int64]], triangle: ndarray[Any, dtype[int64]]) bool

check intersection between a line segment and a triangle.

Parameters:
  • line_segment (array) – 6-dimensional coordinates of line segment,xyzuvw1, xyzuvw2, in TAU-style

  • triangle (array) – containing 6-dimensional coordinates of tree vertecies of a triangle (a) in TAU-style

pyqcstrc.ico2.numericalc.check_intersection_two_segment_numerical(ln1: ndarray[Any, dtype[float64]], ln2: ndarray[Any, dtype[float64]]) bool

check intersection between two line segments.

Parameters:
  • line_segment_1 (array) – two 3-dimensional coordinates of line segment, xyz1, xyz2. line_segment_1: A–B line_segment_2: C–D

  • line_segment_2 (array) – two 3-dimensional coordinates of line segment, xyz1, xyz2. line_segment_1: A–B line_segment_2: C–D

  • Returns

    int, out = 0 (Intersection was found when a view allong to Z-axis)

    1 (Intersection was found when a view allong to X-axis) 2 (Intersection was found when a view allong to Y-axis) 3 (No intersection was found)

  • -------

pyqcstrc.ico2.numericalc.check_intersection_two_segment_numerical_6d_tau(segment_1: ndarray[Any, dtype[int64]], segment_2: ndarray[Any, dtype[int64]]) bool

check intersection between two line segments

Parameters:
  • line_segment_1 (array) – two 6-dimensional coordinates of line segment,xyzuvw1, xyzuvw2, in TAU-style

  • line_segment_2 (array) – two 6-dimensional coordinates of line segment,xyzuvw1, xyzuvw2, in TAU-style

  • triangle (array) – containing 3-dimensional coordinates of tree vertecies of a triangle (a), xyz1, xyz2, xyz3.

pyqcstrc.ico2.numericalc.coplanar_check_numeric(pns: ndarray[Any, dtype[float64]], num_iteration: int = 5) bool

check the points (pns) are in coplanar or not メモ:xyz1とxyz2の選び方次第で、outer_product(v1,v2)が小さくなりcoplanarと間違って判定する場合がある。 これを避けるために適切なxyz1とxyz2の選び方が必要。以下では、ランダムにxyz1とxyz2の選ぶ。

Parameters:
  • pns (array) – coordinate of the points in Eperp, xyz.

  • num_iteration (int) – number of iterations.

Return type:

bool

pyqcstrc.ico2.numericalc.coplanar_check_numeric_tau(pts: ndarray[Any, dtype[int64]], num_iteration: int = 5) bool

check the points (pts) are in coplanar or not

Parameters:
  • pns (array) – 6d coordinates of the points, xyz, in TAU-style

  • num_iteration (int) – number of iterations.

Return type:

bool

pyqcstrc.ico2.numericalc.get_internal_component_numerical(vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[float64]]
Parameters:

vn (array) – 6-dimensional vector, xyzuvw.

pyqcstrc.ico2.numericalc.get_internal_component_sets_numerical(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[float64]]

parallel and perpendicular components of a 6D lattice vector in direct space.

Parameters:

vsn (array) – set of 6-dimensional vectors, xyzuvw1, xyzuvw2, …

pyqcstrc.ico2.numericalc.inner_product_numerical(v1, v2)
pyqcstrc.ico2.numericalc.inside_outside_obj(point: ndarray[Any, dtype[float64]], obj: ndarray[Any, dtype[float64]]) bool

this function judges whether the point is inside an object (set of tetrahedra) or not

Parameters:
  • point (array) – coordinate of the point,xyz

  • obj (array) – vertex coordinates of tetrahedra, (xyz1, xyz2, xyz3, xyz4), (), (), …

pyqcstrc.ico2.numericalc.inside_outside_obj_tau(point: ndarray[Any, dtype[int64]], obj: ndarray[Any, dtype[int64]]) bool
pyqcstrc.ico2.numericalc.inside_outside_tetrahedron(point: ndarray[Any, dtype[float64]], tetrahedron: ndarray[Any, dtype[float64]]) bool

this function judges whether the point is inside a tetrahedron or not

Parameters:
  • point (array) – coordinate of the point,xyz

  • tetrahedron (array) – vertex coordinates of tetrahedron, (xyz1, xyz2, xyz3, xyz4)

pyqcstrc.ico2.numericalc.inside_outside_tetrahedron_tau(point: ndarray[Any, dtype[int64]], tetrahedron: ndarray[Any, dtype[int64]]) bool

this function judges whether the point is inside a tetrahedron or not

Parameters:
  • point (array) – 6d coordinate of the point in TAU-style.

  • tetrahedron (array) – 6d vertex coordinates of tetrahedron in TAU-style.

pyqcstrc.ico2.numericalc.length_numerical(vt: ndarray[Any, dtype[int64]]) float

numerical value of norm of vector, v, in Tau-style

Parameters:

vt (array) – vector in TAU-style

pyqcstrc.ico2.numericalc.matrix_dot(m1, m2)
pyqcstrc.ico2.numericalc.numeric_value(t: ndarray[Any, dtype[int64]]) float

Numeric value of a TAU-style value, a.

Parameters:

t (array) – value in TAU-style

Return type:

float

pyqcstrc.ico2.numericalc.numerical_vector(vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Numeric value of a TAU-style vector, v.

Parameters:

vt (array) – vector in TAU-style

Return type:

array

pyqcstrc.ico2.numericalc.numerical_vectors(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Numeric value of a TAU-style vector, v.

Parameters:

vts (array) – vector in TAU-style

Return type:

array

pyqcstrc.ico2.numericalc.obj_volume_6d_numerical(obj: ndarray[Any, dtype[int64]]) float

This function returns volume of an object (set of tetrahedra).

Parameters:

object (array) – 6-dimensional vertex coordinates of tetrahedra.

pyqcstrc.ico2.numericalc.obj_volume_numerical(obj: ndarray[Any, dtype[float64]]) float

This function returns volume of an object (set of tetrahedra).

Parameters:

object (array) – 3-dimensional vertex coordinates of tetrahedra.

pyqcstrc.ico2.numericalc.on_out_surface(point: ndarray[Any, dtype[int64]], triangle: ndarray[Any, dtype[int64]]) bool

check whether the point is inside the triangle.

Parameters:
  • point (array) – 6d coordinates of the point in TAU-style.

  • triangle (array) – 6d coordinates of three vertices of triangle in TAU-style

Return type:

float

pyqcstrc.ico2.numericalc.point_on_segment(point: ndarray[Any, dtype[int64]], line_segment: ndarray[Any, dtype[int64]]) bool

judge whether a point is on a line segment, A-B, or not.

Parameters:
  • point (array) – coordinate of the point, xyz

  • line_segment (array) – two coordinates of line segment, xyz0, xyz1

Return type:

int

pyqcstrc.ico2.numericalc.projection3_numerical(vn: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]

perpendicular component of a 6D lattice vector in direct space.

Parameters:

vn (array) – 6-dimensional vector, xyzuvw.

pyqcstrc.ico2.numericalc.projection3_sets_numerical(vns: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]

perpendicular component of a 6D lattice vector in direct space.

Parameters:

vsn (array) – set of 6-dimensional vectors, xyzuvw1, xyzuvw2, …

pyqcstrc.ico2.numericalc.projection_numerical(vn: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]

parallel and perpendicular components of a 6D lattice vector in direct space.

Parameters:

vn (array) – 6-dimensional vector, xyzuvw.

pyqcstrc.ico2.numericalc.projection_sets_numerical(vns: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]

parallel and perpendicular components of a 6D lattice vector in direct space.

Parameters:

vsn (array) – set of 6-dimensional vectors, xyzuvw1, xyzuvw2, …

pyqcstrc.ico2.numericalc.tetrahedron_volume_6d_numerical(tetrahedron: ndarray[Any, dtype[int64]]) float

This function returns volume of a tetrahedron

Parameters:

tetrahedron (array) – 6-dimensional vertex coordinates of the tetrahedron, xyzuvw0,xyzuvw1,xyzuvw2,xyzuvw3

pyqcstrc.ico2.numericalc.tetrahedron_volume_numerical(tetrahedron: ndarray[Any, dtype[float64]]) float

This function returns volume of a tetrahedron

Parameters:

tetrahedron (array) – vertex coordinates of the tetrahedron, xyz0,xyz1,xyz2,xyz3

pyqcstrc.ico2.numericalc.triangle_area(a: ndarray[Any, dtype[int64]]) float

Numerial calcuration of area of given triangle, a. The coordinates of the tree vertecies of the triangle are given in TAU-style.

Parameters:

a (array containing 3-dimensional coordinates of tree vertecies of a triangle (a) in TAU-style)

Returns:

area of given triangle

Return type:

float

pyqcstrc.ico2.numericalc.triangle_area_numerical(a: ndarray[Any, dtype[float64]]) float

Numerial calcuration of area of given triangle, a. The coordinates of the tree vertecies of the triangle are given.

Parameters:

a (array containing 3-dimensional coordinates of tree vertecies of a triangle (a))

Returns:

area of given triangle

Return type:

float

pyqcstrc.ico2.occupation_domain module

pyqcstrc.ico2.occupation_domain.asymmetric(symmetric_obj, position, vecs)

Asymmetric part of occupation domain.

Parameters:
  • symmetric_obj (numpy.ndarray) – Occupation domain of which the asymmetric part is calculated. The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • position (numpy.ndarray) – 6d coordinate of the site of which the occupation domain centres. The shape is (6,3)

  • vecs (numpy.ndarray) – Three vectors that defines the asymmetric part. The shape is (3,6,3)

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Asymmetric part of the occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.generate_border_edges(obj)

Generate border edges of the occupation domain.

Parameters:

obj (numpy.ndarray) – The occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Returns:

The shape is (num,2,6,3), where num=numbre_of_edge.

Return type:

Border edges of the occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.read_xyz(path, basename, select='tetrahedron', verbose=0)

Load new occupation domain on input XYZ file.

Parameters:
  • path (str) – Path of the input XYZ file

  • basename (str) – Basename of the input XYZ file

  • select (str) – ‘tetrahedron’: set of tetrahedra (default) ‘vertex’ : set of vertices (default, select = ‘tetrahedron’)

  • verbose (int) – verbose option

Returns:

Loaded occupation domains. The shape is (num,4,6,3), where num=numbre_of_tetrahedra (select = ‘tetrahedron’). The shape is (num,6,3), where num=numbre_of_vertices (select = ‘vertex’).

Return type:

Occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.shift(obj, shift)

Shift the occupation domain.

Parameters:
  • obj (numpy.ndarray) – The occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • shift (numpy.ndarray) – 6d coordinate to which the occupation domain is shifted. The shape is (6,3)

  • verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Shifted occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.simple_hand_step1(obj, path, basename_tmp)

Simplification of occupation domains by hand (step1).

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • path (str) – path of the tmporal file

  • basename_tmp (str) – name for tmporal file.

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Tmporal occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.simple_hand_step2(obj, merge_list)

Simplification of occupation domains by hand (step2).

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • merge_list (list[[int,int,int,int,],[],...,[]]) – A list containing lists of indices of vertices of tetrahedron. The indices of vertices of tetrahedron in temporal file obtaind by ‘simple_hand_step1()’.

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Simplified occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.simplification(obj, verbose=0)

Simplification of occupation domains.

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • num_cycle (int) – numbre of cycles

  • verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal) verbose > 2 (detail)

Returns:

Simplified occupation domains (numpy.ndarray)

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

pyqcstrc.ico2.occupation_domain.site_symmetry(wyckoff_position, centering, verbose=0)

Symmetry operators in the site symmetry group G and its left coset decomposition.

Parameters:
  • position (Wyckoff) – 6D coordinate. The shape is (6,3).

  • centering – primitive lattice (‘p’) face-centered lattice (‘f’) and body-centered lattice (‘i’)

  • verbose (int)

Returns:

The symmetry operators leaves xyz identical.

List of index of symmetry operators in the left coset representatives of the poibt group G (list):

The symmetry operators generates equivalent positions of the site xyz.

Return type:

List of index of symmetry operators of the site symmetry group G (list)

pyqcstrc.ico2.occupation_domain.symmetric(obj, centre)

Generate symmterical occupation domain by symmetric elements of m-3-5 on the asymmetric unit.

Parameters:
  • obj (numpy.ndarray) – Asymmetric unit of the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • centre (numpy.ndarray) – 6d coordinate of the symmetric centre. The shape is (6,3)

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Symmetric occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.symmetric_0(obj, centre, indx_symop)

Generate symmterical occupation domain by symmetric elements of m-3-5 on the asymmetric unit.

Parameters:
  • obj (numpy.ndarray) – Asymmetric unit of the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • centre (numpy.ndarray) – 6d coordinate of the symmetric centre. The shape is (6,3)

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Symmetric occupation domains (numpy.ndarray)

pyqcstrc.ico2.occupation_domain.volume(obj)
pyqcstrc.ico2.occupation_domain.write(obj, path='.', basename='tmp', format='xyz', color='k', verbose=0, select='tetrahedron')

Export occupation domains.

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • path (str) – Path of the output XYZ file

  • basename (str) – Basename of the output XYZ file

  • format (str) – format of output file format = ‘xyz’ (default) format = ‘vesta’

  • color (str) – one of the characters {‘k’,’r’,’b’,’p’}, which are short-hand notations for shades of black, red, blue, and pink, in case where ‘vesta’ format is selected (default, color = ‘k’).

Returns:

0 (succeed), 1 (fail)

Return type:

int

pyqcstrc.ico2.occupation_domain.write_podatm(obj, position, vlist, path='.', basename='tmp', shift=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], verbose=0)

Generate pod and atom files.

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • position (numpy.ndarray) – 6D coordinates of the position of the occupation domain.

  • vertices (list)

  • vlist (list)

  • path (str) – Path of the output files

  • basename (str) – Basename of the output files

  • verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)

Returns:

0 (succeed), 1 (fail)

Return type:

int

pyqcstrc.ico2.occupation_domain.write_vesta(obj, path='.', basename='tmp', color='k', select='normal', verbose=0)

Export occupation domains in VESTA format.

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • path (str) – Path of the output XYZ file

  • basename (str) – Basename of the output XYZ file

  • color (str) – one of the characters {‘k’,’r’,’b’,’p’}, which are short-hand notations for shades of black, red, blue, and pink, in case where ‘vesta’ format is selected (default, color = ‘k’).

  • select (str) – ‘simple’ or ‘normal’ ‘simple’: Merging tetrahedra into one single objecte ‘normal’: Each tetrahedron is set as single objecte (large file) ‘podatm’: same as ‘simple’ but return “vertices” necessary to input (default, select = ‘normal’)

Returns:

0 (succeed), 1 (fail) when select = ‘simple’ or ‘normal’. ndarray: vertices, when select = ‘podatm’.

Return type:

int

pyqcstrc.ico2.occupation_domain.write_xyz(obj, path='.', basename='tmp', select='tetrahedron', verbose=0)

Export occupation domains in XYZ format.

Parameters:
  • obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

  • path (str) – Path of the output XYZ file

  • basename (str) – Basename of the output XYZ file

  • select (str) – ‘tetrahedron’: set of tetrahedra (default) ‘triangle’ : set of triangles ‘edge’ : set of edges ‘vertex’ : set of vertices (default, select = ‘tetrahedron’)

Returns:

0 (succeed), 1 (fail)

Return type:

int

pyqcstrc.ico2.symmetry module

pyqcstrc.ico2.symmetry.generator_equivalent_vec(vector, centre)
pyqcstrc.ico2.symmetry.generator_equivalent_vectors(vectors, centre)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_obj(obj, centre)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_surface(obj, centre)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_tetrahedron(obj, centre)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_tetrahedron_0(obj, centre, symmetry_operation_index)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_tetrahedron_specific_symop(obj, centre, list_of_symmetry_operation_index)
pyqcstrc.ico2.symmetry.generator_obj_symmetric_vec(vectors, centre)
pyqcstrc.ico2.symmetry.icosasymop()
pyqcstrc.ico2.symmetry.symop_obj(symop, obj, centre)

Apply a symmetric operation on an object around given centre. in TAU-style

pyqcstrc.ico2.symmetry.symop_vec(symop, vt, centre)

Apply a symmetric operation on a vector around given centre. in TAU-style

pyqcstrc.ico2.symmetry.symop_vecs(symop, tetrahedron, centre)

Apply a symmetric operation on set of vectors around given centre. in TAU-style

pyqcstrc.ico2.two_occupation_domains module

pyqcstrc.ico2.two_occupation_domains.intersection(obj1, obj2, kind=None, verbose=0)

Return an intersection between two objects: obj1 AND obj2.

Parameters:
  • obj1 (ndarray) – a set of tetrahedra to be intersected with obj2.

  • obj2 (ndarray) – a set of tetrahedra to be intersected with obj1.

  • kind ({'standard', 'simple'}, optional) – The default is ‘standard’.

Returns:

intersection between obj1 and obj2 – Array of the same type and shape as obj1 and obj2.

Return type:

ndarray

Notes

‘standard’ intersection …

‘simple’ intersection …

pyqcstrc.ico2.two_occupation_domains.intersection_convex(obj1, obj2, verbose=0)

Intersection of two occupation domains projected onto perp space: obj1 AND obj2. The common part forms convex hull.

Parameters:
  • (numpy.ndarray) (obj2) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.

  • (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

Common part of two occupation domains projected onto perp space (numpy.ndarray)

pyqcstrc.ico2.two_occupation_domains.subtraction(obj1, obj2, verbose=0)

Subtraction of two occupation domains projected onto perp space: obj1 NOT obj2 = obj1 NOT (obj1 AND obj2).

Parameters:
  • (numpy.ndarray) (obj2) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.

  • (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.

Returns:

The shape is (num,4,6,3), where num=numbre_of_tetrahedron.

Return type:

obj1 NOT obj2

pyqcstrc.ico2.utils module

pyqcstrc.ico2.utils.breps(tetrahedron)

四面体の頂点を指す6d vectors (TAU-style)から 境界表現 (Boundary Representation, B-reps) に変換する。

四面体の重心を求める。稜線

pyqcstrc.ico2.utils.check_connectivity_tetrahedra(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) bool

Checking whether tetrahedron_1 and _2 are sharing a triangle surface or not.

pyqcstrc.ico2.utils.coplanar_check_two_triangles(triange1: ndarray[Any, dtype[int64]], triange2: ndarray[Any, dtype[int64]]) bool

Checking whether two triangles are coplanar or not.

Note

Current implementation may return wrong judgement when the cross product of the first two vectors chosen randomly are very small in coplanar_check() and coplanar_check_numeric_tau().

vtxはソートされており、coplanar_checkやcoplanar_check_numeric_tauでの外積計算の際に小さい値になるとcoplanar判定を間違うので注意。

pyqcstrc.ico2.utils.decomposition(tmp2v: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.utils.equivalent(obj1: ndarray[Any, dtype[int64]], obj2: ndarray[Any, dtype[int64]]) bool

Checking whether obj1 and obj1 are equivalent or not.

pyqcstrc.ico2.utils.equivalent_edges(edge1: ndarray[Any, dtype[int64]], edge2: ndarray[Any, dtype[int64]]) bool

Checking whether edge1 and edge2 are equivalent or not.

pyqcstrc.ico2.utils.equivalent_tetrahedra(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) bool

Checking whether tetrahedron_1 and _2 are equivalent or not.

pyqcstrc.ico2.utils.equivalent_triangles(triangle1: ndarray[Any, dtype[int64]], triangle2: ndarray[Any, dtype[int64]]) bool

Checking whether triangle1 and triangle2 are equivalent or not.

pyqcstrc.ico2.utils.equivalent_vertices(vertex1: ndarray[Any, dtype[int64]], vertex2: ndarray[Any, dtype[int64]]) bool
pyqcstrc.ico2.utils.gen_border_edges_of_coplanar_triangles(coplanar_triangles: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

同一平面上にある三角形の辺のうち、どの三角形とも共有していない独立な辺を求める.

pyqcstrc.ico2.utils.generate_convex_hull(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

generate convex hull from object

objの凸包を得る。

アルゴリズム 1. objの表面三角形を得る。 2. 無駄な表面三角形をなくす by surface_cleaner()。 3. objの頂点座標を得る 4. 四面体分割

objが凸包であれば、この関数を実行することで、よりシンプルに四面体分割されたobjを得ることができる。

pyqcstrc.ico2.utils.generator_all_edges(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Generate all egdes in Object

Parameters:

obj (array) – set of tetrahedra

Returns:

edges – set of edges in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.generator_surface_1(obj: ndarray[Any, dtype[int64]], verbose: int = 0) ndarray[Any, dtype[int64]]

Generate triangles of the object’s surface.

Parameters:

obj (array)

Returns:

surfaces – set of surface triangles in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.generator_unique_edges(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return unique egdes in Object

Note

Current implementation may return wrong object when the object is a set of tetrahedra.

pyqcstrc.ico2.utils.generator_unique_triangles(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Generate unique triangles in an object

Parameters:

obj (array) – set of tetrahedra

Returns:

triangles – set of triangles in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.get_common_edges(trianges: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Get common edges in trianges

pyqcstrc.ico2.utils.get_common_triangle_in_two_tetrahedra(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return common triangle of two connected tetrahedra.

pyqcstrc.ico2.utils.get_sets_of_coplanar_triangles(surface: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

同一平面上にある三角形の集合を作る。surfaceに含まれるtriangleについて 順に同一平面上にあるかどうかをチェックし、もし以前のどの三角形とも同一平面 にない時はそのインデックスをlst_indx_groupに収納する。また、lst_indx_triangle にもそのインデックスを収納する。一方、すでにチェックした三角形と同一平面に にある場合はlst_indx_triangleに同一平面三角形のインデックスを収納

pyqcstrc.ico2.utils.get_tetrahedron_edge(tetrahedron: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return six edges of tetrahedron.

pyqcstrc.ico2.utils.get_tetrahedron_surface(tetrahedron: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return four triangles of tetrahedron.

pyqcstrc.ico2.utils.get_triangle_edge(triangle: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return three edges of triange.

pyqcstrc.ico2.utils.merge_two_tetrahedra(tetrahedron_1: ndarray[Any, dtype[int64]], tetrahedron_2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Return merged tetrahedra.

pyqcstrc.ico2.utils.merge_two_tetrahedra_in_obj(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.utils.middle_position(pos1, pos2)
pyqcstrc.ico2.utils.obj_volume_6d(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Calculate volume of an object (set of tetrahedra) in TAU style.

Parameters:

obj (array)

Returns:

volume – Volume in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.remove_doubling(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Remove doubling 6d coordinates

Parameters:

obj (array) – set of 6-dimensional vectors in TAU-style

Returns:

obj – set of 6-dimensional vectors in TAU-style

Return type:

array

pyqcstrc.ico2.utils.remove_doubling_in_perp_space(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Remove 6d coordinates which is doubled in Eperp.

Parameters:

vts (array) – set of 6-dimensional vectors in TAU-style

Returns:

vts – set of 6-dimensional vectors in TAU-style

Return type:

array

pyqcstrc.ico2.utils.remove_vector(vts: ndarray[Any, dtype[int64]], vt: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

remove a 6d vector(vt2) from a set of 6d vectors (vts). 6次元ベクトルリストvlst1から6次元ベクトルvt2を抜きとる

pyqcstrc.ico2.utils.remove_vectors(vts1: ndarray[Any, dtype[int64]], vts2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

remove 6d vectors in a set vts2 from a set vts1. 6次元ベクトルリストvts1から6次元ベクトルリストvts2にあるベクトルを抜きとる

pyqcstrc.ico2.utils.shift_object(obj: ndarray[Any, dtype[int64]], shift: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

shift an object

pyqcstrc.ico2.utils.sort_obj(obj: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

sort tehtahedra in an object

pyqcstrc.ico2.utils.sort_vctors(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

sort vectors in TAU-style

xi,yi,ziをxiでソート

pyqcstrc.ico2.utils.surface_cleaner(surface: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

generate border edges from a set of triangles on the objct’s surface.

obj表面の三角形からobjの外枠を出力。

アルゴリズム: 1) 同一平面上にある三角形ごとにグループ分けする 2) 各グループにおいて、以下を行う.

2-1) 三角形の3辺が、他のどの三角形とも共有していない辺を求める 2-3) 2つの辺が1つの辺にまとめられるのであれば、まとめる 2-3) 辺の集合をアウトプット

pyqcstrc.ico2.utils.tetrahedralization_points(points: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]
pyqcstrc.ico2.utils.tetrahedron_volume(vts: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Calculate volume of tetrahedron in TAU style.

Parameters:

obj (array) – vertex coordinates of the tetrahedron (x0,y0,z0),(x1,y1,z1),(x2,y2,z2),(x3,y3,z3) in TAU-style.

Returns:

volume – Volume in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.tetrahedron_volume_6d(tetrahedron: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Calculate volume of tetrahedron in TAU style.

Parameters:

obj (array) – 6d vectors of tetrahedron vertices in TAU-style.

Returns:

volume – Volume in TAU-style.

Return type:

array

pyqcstrc.ico2.utils.two_segment_into_one(line_segment_1: ndarray[Any, dtype[int64]], line_segment_2: ndarray[Any, dtype[int64]]) ndarray[Any, dtype[int64]]

Module contents