# Class SpaceGroup

java.lang.Object
org.jmol.symmetry.SpaceGroup

All Implemented Interfaces:
  `Cloneable, HallInfo.HallReceiver`

Direct Known Subclasses:
  `SpecialGroup`

public class SpaceGroup extends Object implements Cloneable, HallInfo.HallReceiver
A general class to deal with Hermann-Mauguin or Hall names Bob Hanson 9/2006 references: International Tables for Crystallography Vol. A. (2002) http://www.iucr.org/iucr-top/cif/cifdic_html/1/cif_core.dic/Ispace_group_symop_operation_xyz.html http://www.iucr.org/iucr-top/cif/cifdic_html/1/cif_core.dic/Isymmetry_equiv_pos_as_xyz.html Hall symbols: https://cci.lbl.gov/sginfo/hall_symbols.html and https://cci.lbl.gov/cctbx/explore_symmetry.html (-)L [N_A^T_1] [N_A^T_2] ... [N_A^T_P] V(Nx Ny Nz) lattice types S and T are not supported here data table is from Syd Hall, private email, 9/4/2006, amended using * to indicate nonstandard H-M symbols or full names amended 2024.03.24 to add several ITA settings; full set of ITA settings are now encoded. NEVER ACCESS THESE METHODS DIRECTLY! ONLY THROUGH CLASS Symmetry

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected static class`
`SpaceGroup.ParamCheck`

## Field Summary

Fields
Modifier and Type
Field
Description
`String`
`displayName`
`int`
`groupType`
`boolean`
`isSSG`
`protected String`
`itaIndex`
index in cleg_settings.tab; "-" if in Jmol's list but not at ITA -- 152:_2 and 154:_2
`int`
`itaNo`
X in X.n or X:a...
`protected String`
`itaNumber`
`protected int`
`nDim`
number of dimesions -- 2 (plane, frieze) or 3 (layer, rod, space)
`protected static final String`
`NEW_NO_HALL_GROUP`
`protected int`
`periodicity`
`static final String`
`PREFIX_FRIEZE`
`static final String`
`PREFIX_LAYER`
`static final String`
`PREFIX_PLANE`
`static final String`
`PREFIX_ROD`
`static final String`
`PREFIX_SPACE`
`int`
`setNo`
n in X.n or 9 for X:a...
`int`
`sfIndex`
just while SpaceGroupFinder is sorting
`protected String`
`specialPrefix`
`SymmetryOperation[]`
`symmetryOperations`
`static final int`
`TYPE_FRIEZE`
`static final int`
`TYPE_INVALID`
`static final int`
`TYPE_LAYER`
`static final int`
`TYPE_PLANE`
`static final int`
`TYPE_ROD`
`static final int`
`TYPE_SPACE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`SpaceGroup(int index, String strData, boolean doInit)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`addHallOperationCheckDuplicates(M4 operation)`
Add a (possibly) new operation, checking for duplicates.
`boolean`
`addMagLatticeVectors(Lst<float[]> lattvecs)`
`protected int`
`addOp(SymmetryOperation op, String xyz0, boolean isSpecial)`
`protected int`
`addOperation(String xyz0, int opId, boolean allowScaling)`
`void`
`addSpinLattice(Lst<String> lstSpinFrames, Map<String,String> mapSpinIdToUVW)`
spin space groups only
`int`
`addSymmetry(String xyz, int opId, boolean allowScaling)`
`String`
`asString()`
`static String`
`canonicalizeCleg(String t)`
adds :a,b,c;0,0,0 or ;0,0,0; does NOT change :h or :r
`boolean`
`createCompatibleUnitCell(float[] params, float[] newParams, boolean allowSame)`
Create a unit cell compatible with
`static SpaceGroup`
`createSpaceGroup(int desiredSpaceGroupIndex, String name, Object data, int modDim)`
`static SpaceGroup`
`determineSpaceGroupNA(String name, float[] unitCellParams)`
`static SpaceGroup`
`determineSpaceGroupNS(String name, SpaceGroup sg)`
`String`
`dumpInfo()`
`static SpaceGroup`
`findSpaceGroupFromXYZ(String xyzList)`
`String`
`getClegId()`
`String`
`getDisplayName()`
`static int`
`getExplicitSpecialGroupType(String name)`
`static String`
`getGroupTypePrefix(int itno)`
`String`
`getHMName()`
`Object`
`getHMNameShort()`
`static int`
`getImplicitSpecialGroupType(int itno)`
`int`
`getIndex()`
`String`
`getItaIndex()`
`static int`
`getITNo(String name, int n)`
`M4`
`getMatrixOperation(int i)`
Get the 4x4 matrix for the kth operation.
`int`
`getMatrixOperationCount()`
Get the receiver's current operation count.
`static int`
`getMax(int groupType)`
`static SpaceGroup`
`getNull(boolean doInit, boolean doNormalize, boolean doFinalize)`
`static String`
`getSpecialGroupName(int type)`
`String`
`getSpecialPrefix()`
`static boolean`
`hmMatches(String hm, String name, int specialType)`
Matches Hermann-Mauguin names for special types by ignoring spaces and some special treatment for plane groups.
`boolean`
`isHexagonalSG(int n, float[] params)`
`static boolean`
`isInRange(float itno, int groupType, boolean allowSetIndex, boolean allow300)`
`void`
`mapSpins(Map<String,String> mapSpinIdToUVW)`
`void`
`setClegId(String cleg)`
`protected void`
`setFinalOperations()`
`void`
`setFinalOperationsSafely()`
`void`
`setMatrixOperationCount(int nOps)`
`Lst<String>`
`setSpinList(String configuration)`
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### PREFIX_FRIEZE

public static final String PREFIX_FRIEZE

See Also:
  - Constant Field Values

### PREFIX_ROD

public static final String PREFIX_ROD

See Also:
  - Constant Field Values

### PREFIX_LAYER

public static final String PREFIX_LAYER

See Also:
  - Constant Field Values

### PREFIX_PLANE

public static final String PREFIX_PLANE

See Also:
  - Constant Field Values

### PREFIX_SPACE

public static final String PREFIX_SPACE

See Also:
  - Constant Field Values

### TYPE_FRIEZE

public static final int TYPE_FRIEZE

See Also:
  - Constant Field Values

### TYPE_ROD

public static final int TYPE_ROD

See Also:
  - Constant Field Values

### TYPE_LAYER

public static final int TYPE_LAYER

See Also:
  - Constant Field Values

### TYPE_PLANE

public static final int TYPE_PLANE

See Also:
  - Constant Field Values

### TYPE_SPACE

public static final int TYPE_SPACE

See Also:
  - Constant Field Values

### TYPE_INVALID

public static final int TYPE_INVALID

See Also:
  - Constant Field Values

### specialPrefix

protected String specialPrefix

### displayName

public String displayName

### NEW_NO_HALL_GROUP

protected static final String NEW_NO_HALL_GROUP

See Also:
  - Constant Field Values

### groupType

public int groupType

### symmetryOperations

public SymmetryOperation[] symmetryOperations

### itaNumber

protected String itaNumber

### itaNo

public int itaNo
X in X.n or X:a... for SpaceGroupFinder sorting

### setNo

public int setNo
n in X.n or 9 for X:a... (152_2 and 154_2 only)

### sfIndex

public transient int sfIndex
just while SpaceGroupFinder is sorting

### itaIndex

protected String itaIndex
index in cleg_settings.tab; "-" if in Jmol's list but not at ITA -- 152:_2 and 154:_2

### nDim

protected int nDim
number of dimesions -- 2 (plane, frieze) or 3 (layer, rod, space)

### periodicity

protected int periodicity

### isSSG

public boolean isSSG

## Constructor Details

### SpaceGroup

protected SpaceGroup(int index, String strData, boolean doInit)

## Method Details

### getSpecialPrefix

public String getSpecialPrefix()

Returns:
  [p/ | f/ | l/ | r/ | ""]

### getNull

public static SpaceGroup getNull(boolean doInit, boolean doNormalize, boolean doFinalize)

### createSpaceGroup

public static SpaceGroup createSpaceGroup(int desiredSpaceGroupIndex, String name, Object data, int modDim)

### getItaIndex

public String getItaIndex()

### getIndex

public int getIndex()

### setClegId

public void setClegId(String cleg)

### getClegId

public String getClegId()

### addSymmetry

public int addSymmetry(String xyz, int opId, boolean allowScaling)

Parameters:
  `xyz` -
  `opId` - generally 0; -1 for subsystems
  `allowScaling` - generally false; true for subsystems
Returns:
  index

### setFinalOperationsSafely

public void setFinalOperationsSafely()

### setFinalOperations

protected void setFinalOperations()

### findSpaceGroupFromXYZ

public static SpaceGroup findSpaceGroupFromXYZ(String xyzList)

### dumpInfo

public String dumpInfo()

Returns:
  detailed information

### addOperation

protected int addOperation(String xyz0, int opId, boolean allowScaling)

### addOp

protected int addOp(SymmetryOperation op, String xyz0, boolean isSpecial)

### determineSpaceGroupNS

public static SpaceGroup determineSpaceGroupNS(String name, SpaceGroup sg)

### determineSpaceGroupNA

public static SpaceGroup determineSpaceGroupNA(String name, float[] unitCellParams)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### asString

public String asString()

### getDisplayName

public String getDisplayName()

### addMagLatticeVectors

public boolean addMagLatticeVectors(Lst<float[]> lattvecs)

Parameters:
  `lattvecs` - could be magnetic centering, in which case there is an additional lattice parameter that is time reversal
Returns:
  true if successful

### addSpinLattice

public void addSpinLattice(Lst<String> lstSpinFrames, Map<String,String> mapSpinIdToUVW)
spin space groups only

Parameters:
  `lstSpinFrames` -
  `mapSpinIdToUVW` -

### getMatrixOperation

public M4 getMatrixOperation(int i)
Description copied from interface: `HallInfo.HallReceiver`
Get the 4x4 matrix for the kth operation. Translations must be in 12ths.

Specified by:
  `getMatrixOperation` in interface `HallInfo.HallReceiver`
Parameters:
  `i` -
Returns:
  4x4 matrix, translations in integer 12ths

### getMatrixOperationCount

public int getMatrixOperationCount()
Description copied from interface: `HallInfo.HallReceiver`
Get the receiver's current operation count.

Specified by:
  `getMatrixOperationCount` in interface `HallInfo.HallReceiver`
Returns:
  number of operations

### addHallOperationCheckDuplicates

public boolean addHallOperationCheckDuplicates(M4 operation)
Description copied from interface: `HallInfo.HallReceiver`
Add a (possibly) new operation, checking for duplicates.

Specified by:
  `addHallOperationCheckDuplicates` in interface `HallInfo.HallReceiver`
Parameters:
  `operation` -
Returns:
  true if added, false if duplicate

### canonicalizeCleg

public static String canonicalizeCleg(String t)
adds :a,b,c;0,0,0 or ;0,0,0; does NOT change :h or :r

Parameters:
  `t` -
Returns:
  full CLEG

### getHMName

public String getHMName()

### getHMNameShort

public Object getHMNameShort()

### getITNo

public static int getITNo(String name, int n)

### isInRange

public static boolean isInRange(float itno, int groupType, boolean allowSetIndex, boolean allow300)

### getMax

public static int getMax(int groupType)

### getGroupTypePrefix

public static String getGroupTypePrefix(int itno)

### getExplicitSpecialGroupType

public static int getExplicitSpecialGroupType(String name)

### getSpecialGroupName

public static String getSpecialGroupName(int type)

### getImplicitSpecialGroupType

public static int getImplicitSpecialGroupType(int itno)

### hmMatches

public static boolean hmMatches(String hm, String name, int specialType)
Matches Hermann-Mauguin names for special types by ignoring spaces and some special treatment for plane groups.

Parameters:
  `hm` - the standard name, generally with x/ if special
  `name` - the name to check, maybe abbreviated, no spaces, no x/
  `specialType` -
Returns:
  true if matching

### createCompatibleUnitCell

public boolean createCompatibleUnitCell(float[] params, float[] newParams, boolean allowSame)
Create a unit cell compatible with

Parameters:
  `params` -
  `newParams` -
  `allowSame` - true to allow same-distance a,b,c for lower-symmetry sg
Returns:
  true if changes have occurred

### isHexagonalSG

public boolean isHexagonalSG(int n, float[] params)

### mapSpins

public void mapSpins(Map<String,String> mapSpinIdToUVW)

### setMatrixOperationCount

public void setMatrixOperationCount(int nOps)

### setSpinList

public Lst<String> setSpinList(String configuration)