# The seekpath code automatically standardized the primitive cell, which caused the structure to change and the expected energy band path could not be obtained

**URL:** <https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514>\
**Category:** General Usage\
**Created:** [December 13, 2024, 1:48pm UTC](https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514 "2024-12-13T13:48:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gswylq](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/gswylq/32/231_2.png) [@gswylq](https://aiida.discourse.group/u/gswylq)\
**Post date:** [December 13, 2024, 1:48pm UTC](https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514/1 "2024-12-13T13:48:25Z")

</div>

Dear all,  
I am calculating the energy bands and wannier TB of a particular structure using aiida-wannier90-workflows , but I cannot get the expected results because the seekpath automatically changes the crystal structure. Is there any way to achieve this? How to modify the seekpath.py file to achieve this goal？

I would be very grateful if you could give me some help.

Thank you every much.

Q Li

---

<div class="post-metadata">

**Author:** ![t-reents](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/t-reents/32/82_2.png) [@t-reents](https://aiida.discourse.group/u/t-reents)\
**Post date:** [December 17, 2024, 10:05am UTC](https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514/2 "2024-12-17T10:05:04Z")

</div>

Hi!

do I understand correctly that you essentially want to disable the seekpath analysis in the workflow to avoid that the structure gets refined?

Could you please provide a few more details about the workflows that you are using? (Personally, I’m not running `aiida-wannier90-workflows`, but if you point me to the workflows/code, I can have a look)

Best,  
Timo

---

<div class="post-metadata">

**Author:** ![gswylq](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/gswylq/32/231_2.png) [@gswylq](https://aiida.discourse.group/u/gswylq)\
**Post date:** [December 19, 2024, 12:57am UTC](https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514/3 "2024-12-19T00:57:45Z")

</div>

Hi,  
Thank you. The new seekpath code can obtain a k-point path for a non-standardized cell using seekpath.get\_path\_orig\_cell functions, but the aiida-wannier90-workflows seems to use an algorithm for automatically modifying primitive cells ( `get_path` and `get_explicit_k_path` functions).

Q Li

The aiida-wannier90-workflows as following:  
conda activate aiida  
verdi daemon start  
tot\_num\_mpiprocs=12  
export OMP\_NUM\_THREADS=1  
ulimit -s unlimited  
./launch\_wannier.py pb\_cell.xsf \>scdm\_1.out

[launch\_wannier.py.txt](https://aiida.discourse.group/uploads/short-url/3AhCDU8l2zsRNfrfRGJWIGbAIq6.txt) (1.7 KB)  
[Pb\_cell.xsf.txt](https://aiida.discourse.group/uploads/short-url/hQoMhPkOp73oCTkYtIFJx6y0lnt.txt) (542 Bytes)

---

<div class="post-metadata">

**Author:** ![t-reents](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/t-reents/32/82_2.png) [@t-reents](https://aiida.discourse.group/u/t-reents)\
**Post date:** [December 20, 2024, 5:24am UTC](https://aiida.discourse.group/t/the-seekpath-code-automatically-standardized-the-primitive-cell-which-caused-the-structure-to-change-and-the-expected-energy-band-path-could-not-be-obtained/514/4 "2024-12-20T05:24:41Z")

</div>

Hi,

thanks for the clarification.

You can circumvent the call of `seekpath` inside the workflow by explicitly providing the `Kpoints` as inputs to the `Wannier90BandsWorkChain`.  
Just to give you some context, the workflow calls the following method to determine whether seekpath should be used ([aiida-wannier90-workflows/src/aiida\_wannier90\_workflows/workflows/bands.py at main · aiidateam/aiida-wannier90-workflows · GitHub](https://github.com/aiidateam/aiida-wannier90-workflows/blob/main/src/aiida_wannier90_workflows/workflows/bands.py#L341-L343)):

```auto
    def should_run_seekpath(self):
        """Seekpath should only be run if the `kpoint_path` or `bands_kpoints` input is not specified."""
        return not any(_ in self.inputs for _ in ("kpoint_path", "bands_kpoints"))

```

I would suggest you use `seekpath.get_path_orig_cell` in the beginning (before creating the builder of the workflow) to get the `Kpoints` of you original cell. When constructing the builder, you can explicitly set the `Kpoints` (either by using the `overrides` of the `get_builder_from_protocol` or by simply setting it afterwards `builder.bands_kpoints = points_orig_cell`).  
Note, there is also the option to only provide the high symmetry `Kpoints` and Wannier90 will generate the `Kpoints` ([aiida-wannier90-workflows/src/aiida\_wannier90\_workflows/workflows/bands.py at main · aiidateam/aiida-wannier90-workflows · GitHub](https://github.com/aiidateam/aiida-wannier90-workflows/blob/main/src/aiida_wannier90_workflows/workflows/bands.py#L54-L65)). However, since I’m not a Wannier90 user, you probably know which of the options would work best for you.

Hope that helps.
