forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pymatgen.core.tensors.html
784 lines (716 loc) · 49.8 KB
/
pymatgen.core.tensors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.core.tensors module — pymatgen 2019.5.1 documentation</title>
<link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pymatgen.core.tensors">
<span id="pymatgen-core-tensors-module"></span><h1>pymatgen.core.tensors module<a class="headerlink" href="#module-pymatgen.core.tensors" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="pymatgen.core.tensors.SquareTensor">
<em class="property">class </em><code class="descname">SquareTensor</code><a class="reference internal" href="_modules/pymatgen/core/tensors.html#SquareTensor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.core.tensors.Tensor" title="pymatgen.core.tensors.Tensor"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.core.tensors.Tensor</span></code></a></p>
<p>Base class for doing useful general operations on second rank tensors
(stress, strain etc.).</p>
<p>Create a SquareTensor object. Note that the constructor uses __new__
rather than __init__ according to the standard method of
subclassing numpy ndarrays. Error is thrown when the class is
initialized with non-square matrix.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>input_array</strong> (<em>3x3 array-like</em>) – the 3x3 array-like
representing the content of the tensor</p></li>
<li><p><strong>vscale</strong> (<em>6x1 array-like</em>) – 6x1 array-like scaling the
voigt-notation vector with the tensor entries</p></li>
</ul>
</dd>
</dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.SquareTensor.det">
<code class="descname">det</code><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.det" title="Permalink to this definition">¶</a></dt>
<dd><p>shorthand for the determinant of the SquareTensor</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.SquareTensor.get_scaled">
<code class="descname">get_scaled</code><span class="sig-paren">(</span><em>scale_factor</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#SquareTensor.get_scaled"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.get_scaled" title="Permalink to this definition">¶</a></dt>
<dd><p>Scales the tensor by a certain multiplicative scale factor</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>scale_factor</strong> (<em>float</em>) – scalar multiplier to be applied to the
SquareTensor object</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.SquareTensor.inv">
<code class="descname">inv</code><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.inv" title="Permalink to this definition">¶</a></dt>
<dd><p>shorthand for matrix inverse on SquareTensor</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.SquareTensor.is_rotation">
<code class="descname">is_rotation</code><span class="sig-paren">(</span><em>tol=0.001</em>, <em>include_improper=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#SquareTensor.is_rotation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.is_rotation" title="Permalink to this definition">¶</a></dt>
<dd><p>Test to see if tensor is a valid rotation matrix, performs a
test to check whether the inverse is equal to the transpose
and if the determinant is equal to one within the specified
tolerance</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tol</strong> (<em>float</em>) – tolerance to both tests of whether the
the determinant is one and the inverse is equal
to the transpose</p></li>
<li><p><strong>include_improper</strong> (<em>bool</em>) – whether to include improper
rotations in the determination of validity</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.SquareTensor.polar_decomposition">
<code class="descname">polar_decomposition</code><span class="sig-paren">(</span><em>side='right'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#SquareTensor.polar_decomposition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.polar_decomposition" title="Permalink to this definition">¶</a></dt>
<dd><p>calculates matrices for polar decomposition</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.SquareTensor.principal_invariants">
<code class="descname">principal_invariants</code><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.principal_invariants" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of principal invariants for the tensor,
which are the values of the coefficients of the characteristic
polynomial for the matrix</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.SquareTensor.refine_rotation">
<code class="descname">refine_rotation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#SquareTensor.refine_rotation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.refine_rotation" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method for refining rotation matrix by ensuring
that second and third rows are perpindicular to the first.
Gets new y vector from an orthogonal projection of x onto y
and the new z vector from a cross product of the new x and y</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>to test for rotation</strong> (<em>tol</em>) – </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>new rotation matrix</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.SquareTensor.trans">
<code class="descname">trans</code><a class="headerlink" href="#pymatgen.core.tensors.SquareTensor.trans" title="Permalink to this definition">¶</a></dt>
<dd><p>shorthand for transpose on SquareTensor</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.core.tensors.Tensor">
<em class="property">class </em><code class="descname">Tensor</code><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">monty.json.MSONable</span></code></p>
<p>Base class for doing useful general operations on Nth order tensors,
without restrictions on the type (stress, elastic, strain, piezo, etc.)</p>
<p>Create a Tensor object. Note that the constructor uses __new__
rather than __init__ according to the standard method of
subclassing numpy ndarrays.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>input_array</strong> – (array-like with shape 3^N): array-like representing
a tensor quantity in standard (i. e. non-voigt) notation</p></li>
<li><p><strong>vscale</strong> – (N x M array-like): a matrix corresponding
to the coefficients of the voigt-notation tensor</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.as_dict">
<code class="descname">as_dict</code><span class="sig-paren">(</span><em>voigt=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.as_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.as_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Serializes the tensor object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>voigt</strong> (<em>bool</em>) – flag for whether to store entries in
voigt-notation. Defaults to false, as information
may be lost in conversion.</p>
</dd>
</dl>
<dl class="simple">
<dt>Returns (Dict):</dt><dd><p>serialized format tensor object</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.average_over_unit_sphere">
<code class="descname">average_over_unit_sphere</code><span class="sig-paren">(</span><em>quad=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.average_over_unit_sphere"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.average_over_unit_sphere" title="Permalink to this definition">¶</a></dt>
<dd><p>Method for averaging the tensor projection over the unit
with option for custom quadrature.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>quad</strong> (<em>dict</em>) – quadrature for integration, should be
dictionary with “points” and “weights” keys defaults
to quadpy.sphere.Lebedev(19) as read from file</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Average of tensor projected into vectors on the unit sphere</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.convert_to_ieee">
<code class="descname">convert_to_ieee</code><span class="sig-paren">(</span><em>structure</em>, <em>initial_fit=True</em>, <em>refine_rotation=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.convert_to_ieee"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.convert_to_ieee" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a structure associated with a tensor, attempts a
calculation of the tensor in IEEE format according to
the 1987 IEEE standards.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – a structure associated with the
tensor to be converted to the IEEE standard</p></li>
<li><p><strong>initial_fit</strong> (<em>bool</em>) – flag to indicate whether initial
tensor is fit to the symmetry of the structure.
Defaults to true. Note that if false, inconsistent
results may be obtained due to symmetrically
equivalent, but distinct transformations
being used in different versions of spglib.</p></li>
<li><p><strong>refine_rotation</strong> (<em>bool</em>) – whether to refine the rotation
produced by the ieee transform generator, default True</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.einsum_sequence">
<code class="descname">einsum_sequence</code><span class="sig-paren">(</span><em>other_arrays</em>, <em>einsum_string=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.einsum_sequence"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.einsum_sequence" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the result of an einstein summation expression</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.fit_to_structure">
<code class="descname">fit_to_structure</code><span class="sig-paren">(</span><em>structure</em>, <em>symprec=0.1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.fit_to_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.fit_to_structure" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a tensor that is invariant with respect to symmetry
operations corresponding to a structure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure from which to generate
symmetry operations</p></li>
<li><p><strong>symprec</strong> (<em>float</em>) – symmetry tolerance for the Spacegroup Analyzer
used to generate the symmetry operations</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="classmethod">
<dt id="pymatgen.core.tensors.Tensor.from_dict">
<em class="property">classmethod </em><code class="descname">from_dict</code><span class="sig-paren">(</span><em>d</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.from_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.from_dict" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="classmethod">
<dt id="pymatgen.core.tensors.Tensor.from_values_indices">
<em class="property">classmethod </em><code class="descname">from_values_indices</code><span class="sig-paren">(</span><em>values</em>, <em>indices</em>, <em>populate=False</em>, <em>structure=None</em>, <em>voigt_rank=None</em>, <em>vsym=True</em>, <em>verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.from_values_indices"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.from_values_indices" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a tensor from values and indices, with options
for populating the remainder of the tensor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>values</strong> (<em>floats</em>) – numbers to place at indices</p></li>
<li><p><strong>indices</strong> (<em>array-likes</em>) – indices to place values at</p></li>
<li><p><strong>populate</strong> (<em>bool</em>) – whether to populate the tensor</p></li>
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure to base population
or fit_to_structure on</p></li>
<li><p><strong>voigt_rank</strong> (<em>int</em>) – full tensor rank to indicate the
shape of the resulting tensor. This is necessary
if one provides a set of indices more minimal than
the shape of the tensor they want, e.g.
Tensor.from_values_indices((0, 0), 100)</p></li>
<li><p><strong>vsym</strong> (<em>bool</em>) – whether to voigt symmetrize during the
optimization procedure</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) – whether to populate verbosely</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="classmethod">
<dt id="pymatgen.core.tensors.Tensor.from_voigt">
<em class="property">classmethod </em><code class="descname">from_voigt</code><span class="sig-paren">(</span><em>voigt_input</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.from_voigt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.from_voigt" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructor based on the voigt notation vector or matrix.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>voigt_input</strong> (<em>array-like</em>) – voigt input for a given tensor</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.get_grouped_indices">
<code class="descname">get_grouped_indices</code><span class="sig-paren">(</span><em>voigt=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.get_grouped_indices"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.get_grouped_indices" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets index sets for equivalent tensor values</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>voigt</strong> (<em>bool</em>) – whether to get grouped indices
of voigt or full notation tensor, defaults
to false</p></li>
<li><p><strong>**kwargs</strong> – <p>keyword args for np.isclose. Can take atol
and rtol for absolute and relative tolerance, e. g.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">tensor</span><span class="o">.</span><span class="n">group_array_indices</span><span class="p">(</span><span class="n">atol</span><span class="o">=</span><span class="mf">1e-8</span><span class="p">)</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">tensor</span><span class="o">.</span><span class="n">group_array_indices</span><span class="p">(</span><span class="n">rtol</span><span class="o">=</span><span class="mf">1e-5</span><span class="p">)</span>
</pre></div>
</div>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of index groups where tensor values are equivalent to
within tolerances</p>
</dd>
</dl>
</dd></dl>
<dl class="staticmethod">
<dt id="pymatgen.core.tensors.Tensor.get_ieee_rotation">
<em class="property">static </em><code class="descname">get_ieee_rotation</code><span class="sig-paren">(</span><em>structure</em>, <em>refine_rotation=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.get_ieee_rotation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.get_ieee_rotation" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a structure associated with a tensor, determines
the rotation matrix for IEEE conversion according to
the 1987 IEEE standards.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – a structure associated with the
tensor to be converted to the IEEE standard</p></li>
<li><p><strong>refine_rotation</strong> (<em>bool</em>) – whether to refine the rotation
using SquareTensor.refine_rotation</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.get_symbol_dict">
<code class="descname">get_symbol_dict</code><span class="sig-paren">(</span><em>voigt=True</em>, <em>zero_index=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.get_symbol_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.get_symbol_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a summary dict for tensor with associated symbol</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>voigt</strong> (<em>bool</em>) – whether to get symbol dict for voigt
notation tensor, as opposed to full notation,
defaults to true</p></li>
<li><p><strong>zero_index</strong> (<em>bool</em>) – whether to set initial index to zero,
defaults to false, since tensor notations tend to use
one-indexing, rather than zero indexing like python</p></li>
<li><p><strong>**kwargs</strong> – <p>keyword args for np.isclose. Can take atol
and rtol for absolute and relative tolerance, e. g.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">tensor</span><span class="o">.</span><span class="n">get_symbol_dict</span><span class="p">(</span><span class="n">atol</span><span class="o">=</span><span class="mf">1e-8</span><span class="p">)</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">tensor</span><span class="o">.</span><span class="n">get_symbol_dict</span><span class="p">(</span><span class="n">rtol</span><span class="o">=</span><span class="mf">1e-5</span><span class="p">)</span>
</pre></div>
</div>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of index groups where tensor values are equivalent to
within tolerances</p>
</dd>
</dl>
<p>Returns:</p>
</dd></dl>
<dl class="staticmethod">
<dt id="pymatgen.core.tensors.Tensor.get_voigt_dict">
<em class="property">static </em><code class="descname">get_voigt_dict</code><span class="sig-paren">(</span><em>rank</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.get_voigt_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.get_voigt_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary that maps indices in the tensor to those
in a voigt representation based on input rank</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>rank</strong> (<em>int</em>) – Tensor rank to generate the voigt map</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.is_fit_to_structure">
<code class="descname">is_fit_to_structure</code><span class="sig-paren">(</span><em>structure</em>, <em>tol=0.01</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.is_fit_to_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.is_fit_to_structure" title="Permalink to this definition">¶</a></dt>
<dd><p>Tests whether a tensor is invariant with respect to the
symmetry operations of a particular structure by testing
whether the residual of the symmetric portion is below a
tolerance</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure to be fit to</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance for symmetry testing</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.is_symmetric">
<code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>tol=1e-05</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.is_symmetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.is_symmetric" title="Permalink to this definition">¶</a></dt>
<dd><p>Tests whether a tensor is symmetric or not based on the residual
with its symmetric part, from self.symmetrized</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tol</strong> (<em>float</em>) – tolerance to test for symmetry</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.is_voigt_symmetric">
<code class="descname">is_voigt_symmetric</code><span class="sig-paren">(</span><em>tol=1e-06</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.is_voigt_symmetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.is_voigt_symmetric" title="Permalink to this definition">¶</a></dt>
<dd><p>Tests symmetry of tensor to that necessary for voigt-conversion
by grouping indices into pairs and constructing a sequence of
possible permutations to be used in a tensor transpose</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.populate">
<code class="descname">populate</code><span class="sig-paren">(</span><em>structure</em>, <em>prec=1e-05</em>, <em>maxiter=200</em>, <em>verbose=False</em>, <em>precond=True</em>, <em>vsym=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.populate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.populate" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes a partially populated tensor, and populates the non-zero
entries according to the following procedure, iterated until
the desired convergence (specified via prec) is achieved.</p>
<ol class="arabic simple">
<li><p>Find non-zero entries</p></li>
<li><p>Symmetrize the tensor with respect to crystal symmetry and
(optionally) voigt symmetry</p></li>
<li><p>Reset the non-zero entries of the original tensor</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> (<em>structure object</em>) – </p></li>
<li><p><strong>prec</strong> (<em>float</em>) – precision for determining a non-zero value</p></li>
<li><p><strong>maxiter</strong> (<em>int</em>) – maximum iterations for populating the tensor</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) – whether to populate verbosely</p></li>
<li><p><strong>precond</strong> (<em>bool</em>) – whether to precondition by cycling through
all symmops and storing new nonzero values, default True</p></li>
<li><p><strong>vsym</strong> (<em>bool</em>) – whether to enforce voigt symmetry, defaults
to True</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.project">
<code class="descname">project</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.project"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.project" title="Permalink to this definition">¶</a></dt>
<dd><p>Convenience method for projection of a tensor into a
vector. Returns the tensor dotted into a unit vector
along the input n.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> (<em>3x1 array-like</em>) – direction to project onto</p>
</dd>
</dl>
<dl class="simple">
<dt>Returns (float):</dt><dd><p>scalar value corresponding to the projection of
the tensor into the vector</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.rotate">
<code class="descname">rotate</code><span class="sig-paren">(</span><em>matrix</em>, <em>tol=0.001</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.rotate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.rotate" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies a rotation directly, and tests input matrix to ensure a valid
rotation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>matrix</strong> (<em>3x3 array-like</em>) – rotation matrix to be applied to tensor</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance for testing rotation matrix validity</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.round">
<code class="descname">round</code><span class="sig-paren">(</span><em>decimals=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.round"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.round" title="Permalink to this definition">¶</a></dt>
<dd><p>Wrapper around numpy.round to ensure object
of same type is returned</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>decimals</strong> – Number of decimal places to round to (default: 0).
If decimals is negative, it specifies the number of
positions to the left of the decimal point.</p>
</dd>
</dl>
<dl class="simple">
<dt>Returns (Tensor):</dt><dd><p>rounded tensor of same type</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.structure_transform">
<code class="descname">structure_transform</code><span class="sig-paren">(</span><em>original_structure</em>, <em>new_structure</em>, <em>refine_rotation=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.structure_transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.structure_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transforms a tensor from one basis for an original structure
into a new basis defined by a new structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>original_structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure corresponding
to the basis of the current tensor</p></li>
<li><p><strong>new_structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure corresponding to the
desired basis</p></li>
<li><p><strong>refine_rotation</strong> (<em>bool</em>) – whether to refine the rotations
generated in get_ieee_rotation</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Tensor that has been transformed such that its basis
corresponds to the new_structure’s basis</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.Tensor.symbol">
<code class="descname">symbol</code><em class="property"> = 'T'</em><a class="headerlink" href="#pymatgen.core.tensors.Tensor.symbol" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.Tensor.symmetrized">
<code class="descname">symmetrized</code><a class="headerlink" href="#pymatgen.core.tensors.Tensor.symmetrized" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a generally symmetrized tensor, calculated by taking
the sum of the tensor and its transpose with respect to all
possible permutations of indices</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>symm_op</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies a transformation (via a symmetry operation) to a tensor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>symm_op</strong> (<a class="reference internal" href="pymatgen.core.operations.html#pymatgen.core.operations.SymmOp" title="pymatgen.core.operations.SymmOp"><em>SymmOp</em></a>) – a symmetry operation to apply to the tensor</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.Tensor.voigt">
<code class="descname">voigt</code><a class="headerlink" href="#pymatgen.core.tensors.Tensor.voigt" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the tensor in Voigt notation</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.Tensor.voigt_symmetrized">
<code class="descname">voigt_symmetrized</code><a class="headerlink" href="#pymatgen.core.tensors.Tensor.voigt_symmetrized" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a “voigt”-symmetrized tensor, i. e. a voigt-notation
tensor such that it is invariant wrt permutation of indices</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.Tensor.zeroed">
<code class="descname">zeroed</code><span class="sig-paren">(</span><em>tol=0.001</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#Tensor.zeroed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.Tensor.zeroed" title="Permalink to this definition">¶</a></dt>
<dd><p>returns the matrix with all entries below a certain threshold
(i.e. tol) set to zero</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.core.tensors.TensorCollection">
<em class="property">class </em><code class="descname">TensorCollection</code><span class="sig-paren">(</span><em>tensor_list</em>, <em>base_class=<class 'pymatgen.core.tensors.Tensor'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">collections.abc.Sequence</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">monty.json.MSONable</span></code></p>
<p>A sequence of tensors that can be used for fitting data
or for having a tensor expansion</p>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.as_dict">
<code class="descname">as_dict</code><span class="sig-paren">(</span><em>voigt=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.as_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.as_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>A JSON serializable dict representation of an object.</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.convert_to_ieee">
<code class="descname">convert_to_ieee</code><span class="sig-paren">(</span><em>structure</em>, <em>initial_fit=True</em>, <em>refine_rotation=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.convert_to_ieee"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.convert_to_ieee" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.fit_to_structure">
<code class="descname">fit_to_structure</code><span class="sig-paren">(</span><em>structure</em>, <em>symprec=0.1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.fit_to_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.fit_to_structure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="classmethod">
<dt id="pymatgen.core.tensors.TensorCollection.from_dict">
<em class="property">classmethod </em><code class="descname">from_dict</code><span class="sig-paren">(</span><em>d</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.from_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.from_dict" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="classmethod">
<dt id="pymatgen.core.tensors.TensorCollection.from_voigt">
<em class="property">classmethod </em><code class="descname">from_voigt</code><span class="sig-paren">(</span><em>voigt_input_list</em>, <em>base_class=<class 'pymatgen.core.tensors.Tensor'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.from_voigt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.from_voigt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.is_fit_to_structure">
<code class="descname">is_fit_to_structure</code><span class="sig-paren">(</span><em>structure</em>, <em>tol=0.01</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.is_fit_to_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.is_fit_to_structure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.is_symmetric">
<code class="descname">is_symmetric</code><span class="sig-paren">(</span><em>tol=1e-05</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.is_symmetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.is_symmetric" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.is_voigt_symmetric">
<code class="descname">is_voigt_symmetric</code><span class="sig-paren">(</span><em>tol=1e-06</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.is_voigt_symmetric"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.is_voigt_symmetric" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.TensorCollection.ranks">
<code class="descname">ranks</code><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.ranks" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.rotate">
<code class="descname">rotate</code><span class="sig-paren">(</span><em>matrix</em>, <em>tol=0.001</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.rotate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.rotate" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.round">
<code class="descname">round</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.round"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.round" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.TensorCollection.symmetrized">
<code class="descname">symmetrized</code><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.symmetrized" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>symm_op</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.transform" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.TensorCollection.voigt">
<code class="descname">voigt</code><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.voigt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.core.tensors.TensorCollection.voigt_symmetrized">
<code class="descname">voigt_symmetrized</code><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.voigt_symmetrized" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorCollection.zeroed">
<code class="descname">zeroed</code><span class="sig-paren">(</span><em>tol=0.001</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorCollection.zeroed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorCollection.zeroed" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.core.tensors.TensorMapping">
<em class="property">class </em><code class="descname">TensorMapping</code><span class="sig-paren">(</span><em>tensors=None</em>, <em>values=None</em>, <em>tol=1e-05</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorMapping"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorMapping" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">collections.abc.MutableMapping</span></code></p>
<p>Base class for tensor mappings, which function much like
a dictionary, but use numpy routines to determine approximate
equality to keys for getting and setting items.</p>
<p>This is intended primarily for convenience with things like
stress-strain pairs and fitting data manipulation. In general,
it is significantly less robust than a typical hashing
and should be used with care.</p>
<p>Initialize a TensorMapping</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tensor_list</strong> (<em>[</em><a class="reference internal" href="#pymatgen.core.tensors.Tensor" title="pymatgen.core.tensors.Tensor"><em>Tensor</em></a><em>]</em>) – list of tensors</p></li>
<li><p><strong>value_list</strong> (<em>[</em><em>]</em>) – list of values to be associated with tensors</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – an absolute tolerance for getting and setting
items in the mapping</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorMapping.items">
<code class="descname">items</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → a set-like object providing a view on D's items<a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorMapping.items"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorMapping.items" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.core.tensors.TensorMapping.values">
<code class="descname">values</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → an object providing a view on D's values<a class="reference internal" href="_modules/pymatgen/core/tensors.html#TensorMapping.values"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.TensorMapping.values" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.core.tensors.get_uvec">
<code class="descname">get_uvec</code><span class="sig-paren">(</span><em>vec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#get_uvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.get_uvec" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets a unit vector parallel to input vector</p>
</dd></dl>
<dl class="function">
<dt id="pymatgen.core.tensors.symmetry_reduce">
<code class="descname">symmetry_reduce</code><span class="sig-paren">(</span><em>tensors</em>, <em>structure</em>, <em>tol=1e-08</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/core/tensors.html#symmetry_reduce"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.core.tensors.symmetry_reduce" title="Permalink to this definition">¶</a></dt>
<dd><p>Function that converts a list of tensors corresponding to a structure
and returns a dictionary consisting of unique tensor keys with symmop
values corresponding to transformations that will result in derivative
tensors from the original list</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tensors</strong> (<em>list of tensors</em>) – list of Tensor objects to test for
symmetrically-equivalent duplicates</p></li>
<li><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure from which to get symmetry</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance for tensor equivalence</p></li>
<li><p><strong>kwargs</strong> – keyword arguments for the SpacegroupAnalyzer</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>dictionary consisting of unique tensors with symmetry operations
corresponding to those which will reconstruct the remaining
tensors as values</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.core.tensors.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Pymatgen Development Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.0.1.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html>