Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration.from_dict() hangs when reading ConfigurationWithProperties #13

Open
xivh opened this issue Jul 23, 2024 · 0 comments
Open

Comments

@xivh
Copy link
Contributor

xivh commented Jul 23, 2024

import libcasm.configuration as casmconfig

config_prim = casmconfig.Prim.from_dict(
    {
        'basis': [{'coordinate': [0.0, 0.0, 0.0],
                   'occupants': ['Si', 'Ge']},
                  {'coordinate': [0.25000000000000006, 0.25000000000000006, 0.25000000000000006],
                   'occupants': ['Si', 'Ge']}],
        'coordinate_mode': 'Fractional',
        'lattice_vectors': [[0.0, 2.8, 2.8], [2.8, 0.0, 2.8], [2.8, 2.8, 0.0]],
        'title': 'SiGe'
    }
)

test_config = {'configuration_with_properties': {'configuration': {'dof': {'occ': [1,
     1,
     1,
     0,
     1,
     0,
     0,
     1]},
   'supercell_name': 'SCEL4_4_1_1_0_0_2',
   'transformation_matrix_to_supercell': [[0, 2, 0], [0, -1, 2], [1, -1, -1]]},
  'global_properties': {'Ustrain': {'values': [1.0054834883907082,
     1.005483488390708,
     1.0056851071471589,
     -9.379833134831695e-05,
     9.379833134814043e-05,
     0.0006108405094212646]},
   'energy': {'values': [-38.7416835]}},
  'local_properties': {'disp': {'values': [[-0.027599739999999595,
      0.027599712000005716,
      -0.031352076000000784],
     [-0.0053863040000005635, 0.005386331999996663, 0.04898910800000267],
     [0.027381340000002308, -0.02738134000000364, 0.0331455599999988],
     [0.005037647999999895, -0.005037647999998562, -0.04681219200000242],
     [0.008053331999998303, -0.008053332000001856, 0.007075656000003372],
     [0.019395516000000612, -0.019395516000001056, 0.035224504000000545],
     [-0.026343519999999898, 0.02634352000000345, 0.009207520000001468],
     [-0.000538272000001061, 0.0005382719999992847, -0.05547808000000365]]},
   'force': {'values': [[-0.00033322008972287297,
      0.0003332200897228733,
      0.0027679199783971634],
     [-0.00248276002627387, 0.0024827600262738703, 0.0008105398390413289],
     [0.0004677500306573891, -0.00046775003065738924, -0.0009457699696755137],
     [0.002675390082332513, -0.0026753900823325133, -0.00253992982655302],
     [-0.00011274007798854557, 0.00011274007798854586, 0.0024059199926910013],
     [-0.000788290054432044, 0.0007882900544320442, 0.0016792099488947315],
     [0.00212837013262837, -0.0021283701326283706, -0.0040915398620166195],
     [-0.0015544899972006153,
      0.0015544899972006153,
      -8.636010077842493e-05]]}}},
 'structure_mapping': {'atom_cost': 0.0006847615340316632,
  'deformation_gradient': [[1.0054834883928572,
    0.0004319294642856187,
    6.635803571418679e-05],
   [0.0004319294642856187, 1.0054834883928572, -6.635803571432015e-05],
   [6.629285714289119e-05, -6.629285714289119e-05, 1.0056851071428572]],
  'displacement': [[-0.027599739999999595,
    0.027599712000005716,
    -0.031352076000000784],
   [-0.0053863040000005635, 0.005386331999996663, 0.04898910800000267],
   [0.027381340000002308, -0.02738134000000364, 0.0331455599999988],
   [0.005037647999999895, -0.005037647999998562, -0.04681219200000242],
   [0.008053331999998303, -0.008053332000001856, 0.007075656000003372],
   [0.019395516000000612, -0.019395516000001056, 0.035224504000000545],
   [-0.026343519999999898, 0.02634352000000345, 0.009207520000001468],
   [-0.000538272000001061, 0.0005382719999992847, -0.05547808000000365]],
  'isometry': [[0.999999999999999,
    3.526194122778263e-16,
    3.241526965286855e-08],
   [2.421406791471407e-16, 0.9999999999999992, -3.241526966137954e-08],
   [-3.241526971652477e-08, 3.2415269826886546e-08, 0.9999999999999984]],
  'lattice_cost': -1.0,
  'left_stretch': [[1.005483488395007,
    0.0004319294621348482,
    6.632545669682505e-05],
   [0.00043192946213495916, 1.0054834883950072, -6.632545669684739e-05],
   [6.632545669682501e-05, -6.632545669683359e-05, 1.0056851071385577]],
  'permutation': [0, 1, 2, 5, 3, 6, 7, 4],
  'reorientation': [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
  'right_stretch': [[1.0054834883907082,
    0.00043192946643522134,
    6.632543616025281e-05],
   [0.00043192946643533237, 1.005483488390708, -6.632543616037763e-05],
   [6.632543616025277e-05, -6.632543616036379e-05, 1.0056851071471589]],
  'total_cost': -1.0,
  'transformation_matrix_to_supercell': [[0, 2, 0], [0, -1, 2], [1, -1, -1]],
  'translation': [-2.8145159699999995,
   2.8145159700000018,
   -5.632207839999994]},
 'path': 'training_data/SCEL4_4_1_1_0_0_2/28'}

supercell_set = casmconfig.SupercellSet(config_prim)
supercell_set.add_by_canonical_name(test_config['configuration_with_properties']['configuration']['supercell_name'])
casmconfig.Configuration.from_dict(test_config['configuration_with_properties'], supercell_set)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant