Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346#include "ZZ.h"1#include "typedef.h"2#include "getput.h"3#include "name.h"4#include "bravais.h"5#include "datei.h"6#include "matrix.h"7#include "voronoi.h"8#include "autgrp.h"9#include "symm.h"10#include "contrib.h"11#include "base.h"12#include "zass.h"13#include "gmp.h"14#include "longtools.h"1516#define DATABASE_NAME TOPDIR "/tables/qcatalog/data"1718boolean GRAPH = FALSE;19int SFLAG;20int INFO_LEVEL;21int main (int argc, char *argv[])22232425{2627bravais_TYP *P,28*R,29*Rnew,30*RC,31*DATAQ = (bravais_TYP *) 1,32*DATAZ;3334matrix_TYP *T,35*TI,36*TZ,37*PRES;3839database *database;4041MP_INT aff_name;4243char qname[1024],44symb[1024];454647int zname[2];4849char comment[1024];5051read_header (argc, argv);525354if (is_option('h'))55INFO_LEVEL = optionnumber('h');5657if (INFO_LEVEL == 8)58SFLAG = 1;5960if ((is_option('h') && INFO_LEVEL != 8) || FILEANZ == 0)61{62printf("Usage: %s file [-T] [-Z] [-o] [-M] [-c]\n",argv[0]);63printf("\n");64printf("file: bravais_TYP containing the space group R or the finite unimodular\n");65printf(" group G.\n");66printf("\n");67printf("The program is used to give crystallographic groups a name, i.e.\n");68printf("compute a string which is depends only on the crystallographic\n");69printf("class of the group R/G, and determines it uniquely.\n");70printf("CAUTION: the program assumes the translation lattice to be Z^n.\n");71printf("If called with -Z, the program assumes file to contain a finite unimodular\n");72printf("group G, and will output a name for the arithmetic class of G.\n");73printf("Otherwise, it will assume file to contain generators for the space group\n");74printf("R, and will output a name for the affine class of R.\n");75printf("\n");76printf("Note that the first part of the name for a space group R is exactly the\n");77printf("name for the arithmetic class of the point group G of R.\n");78printf("\n");79printf("Options:\n");80printf("-h : gives this help.\n");81printf("-T : output a matrix transforming the given group R/G into CARAT's\n");82printf(" representative.\n");83printf("-o : output CARAT's representative for this affine/arithmetic class.\n");84printf("-Z : assume file to contain a finite unimodular group, more details\n");85printf(" see above.\n");86printf("-M : give short Hermann-Mauguin symbols to describe a group\n");87printf(" isomorphic to the given only (has an effect only if the\n");88printf(" degree of R is two or three)\n");89printf("-c : gives the CARAT name as\n"); // Oliver: 10.04.200290printf(" \"Q-class-name\"-\"Z-class-name\"(-\"name for the affine class\")\n");91printf("\n");92printf("Cf.: Q_catalog, QtoZ, Extensions, Symbol, Standard_affine_form.\n");9394if (FILEANZ == 0)95exit(0);96else97exit(31);98}99100R = get_bravais(FILENAMES[0]);101102if (is_option('Z')) {103P = copy_bravais(R);104}105else{106P = point_group(R,2);107}108109database = load_database (DATABASE_NAME,P->dim);110111T = q_class_inf (P,database,qname,symb,&DATAQ,&PRES,FALSE);112113TZ = z_class_inf(P,DATAQ,&DATAZ,zname);114free_bravais(DATAQ);115116117if (is_option('Z')){118/* we are finished here */119if (is_option('c')){ // Oliver: 10.04.2002120printf("%s-%d.%d\n",qname,zname[0],zname[1]);121}122else{123printf("qname: %s ",qname);124printf("zname: %d %d\n",zname[0],zname[1]);125}126127if (is_option('T')){128sprintf(comment,"transformation matrix for %s",FILENAMES[0]);129put_mat(TZ,NULL,comment,2);130}131132if (is_option('o')){133sprintf(comment,"standard group for %s",FILENAMES[0]);134put_bravais(DATAZ,NULL,comment);135}136137free_bravais(P);138free_bravais(R);139free_mat(TZ);140free_bravais(DATAZ);141free_database (database);142cleanup_prime();143144if (INFO_LEVEL == 8) pointer_statistics(0,0);145146exit(0);147}148149extend(TZ);150Rnew = konj_bravais(R,TZ);151152T = mat_inv(TZ); free_mat(TZ); TZ = T; T = NULL;153154if (INFO_LEVEL & 4)155put_bravais(Rnew,NULL,NULL);156157if (INFO_LEVEL & 4)158put_mat(TZ,NULL,"transformation matrix",2);159160161mpz_init(&aff_name);162163if (is_option('o'))164T = aff_class_inf(Rnew,DATAZ,PRES,&aff_name,&RC);165else166T = aff_class_inf(Rnew,DATAZ,PRES,&aff_name,NULL);167168/* put_mat(TZ,0,"TZ",0);169put_mat(T,0,"T",0); */170171if (is_option('T')){172Check_mat(T);173Check_mat(TZ);174TI = long_mat_inv(T);175mat_muleq(TZ,TI);176put_mat(TZ,NULL,"transformation matrix",2);177free_mat(TI);178}179180if (is_option('o')){181sprintf(comment,"standard group for %s",FILENAMES[0]);182put_bravais(RC,NULL,comment);183free_bravais(RC);184}185186if (is_option('c')){ // Oliver: 10.04.2002187printf("%s-%d.%d-", qname, zname[0], zname[1]);188mpz_out_str(stdout, 10, &aff_name);189printf("\n");190}191else{192printf("qname: %s ",qname);193printf("zname: %d %d ",zname[0],zname[1]);194printf("aff_name: "); mpz_out_str(stdout,10,&aff_name); printf("\n");195}196197if (is_option('M') && (R->dim == 4 || R->dim == 3)){198display_HM_symbol(qname,zname[0],zname[1],&aff_name);199}200201free_mat(PRES);202free_mat(TZ);203free_mat(T);204free_bravais(P);205free_bravais(Rnew);206free_bravais(R);207free_bravais(DATAZ);208free_database (database);209mpz_clear(&aff_name);210cleanup_prime();211212if (INFO_LEVEL == 8) pointer_statistics(0,0);213214exit(0);215}216217218