Author Topic: Type error: unsupported operand type(s) for /: 'NoneType' and 'float'  (Read 1277 times)

0 Members and 1 Guest are viewing this topic.

Offline coraline24

  • Regular QuantumATK user
  • **
  • Posts: 5
  • Country: jp
  • Reputation: 0
    • View Profile
Hi All,

I'm making a device from bulk of a molecular device (that was already optimized, and fixed where necessary).
However, for some particular file, I received this error message (see below).
This error happened at all 4 different laptop I tried on, and I have no idea how to fix it.

Can you provide some guidance on how to fix this error?

Best,
Thi

"Traceback (most recent call last):
  File "zipdir/NL/GUI/Plugin/PanelBar/PanelView.py", line 256, in itemClicked
  File "zipdir/NL/GUI/Tools/Builder/PanelBar.py", line 52, in widget
  File "/home/xuanthi/QuantumATK/QuantumATK-S-2021.06-SP1/lib/python3.8/site-packages/AddOns/DevicePackage/CreateDeviceFromBulkPlugin.py", line 74, in widget
    self._widget.setCentralRegion(use_transverse=use_transverse)
  File "/home/xuanthi/QuantumATK/QuantumATK-S-2021.06-SP1/lib/python3.8/site-packages/AddOns/DevicePackage/CreateDeviceFromBulkWidget.py", line 128, in setCentralRegion
    self._control.setCentralRegion()
  File "/home/xuanthi/QuantumATK/QuantumATK-S-2021.06-SP1/lib/python3.8/site-packages/AddOns/DevicePackage/CreateDeviceFromBulkWidget.py", line 270, in setCentralRegion
    self._electrode_size_widget.setPresenter(presenter)
  File "/home/xuanthi/QuantumATK/QuantumATK-S-2021.06-SP1/lib/python3.8/site-packages/AddOns/DevicePackage/AdjustElectrodeSizeWidget.py", line 275, in setPresenter
    self.updateMinimalElectrodeLengths()
  File "/home/xuanthi/QuantumATK/QuantumATK-S-2021.06-SP1/lib/python3.8/site-packages/AddOns/DevicePackage/AdjustElectrodeSizeWidget.py", line 330, in updateMinimalElectrodeLengths
    multiple = int(numpy.round(current_lengths / electrode_length))
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'"

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
This is hard to solve without seeing the structure, but probably the tool could not find any periodicity in the structure at the left and right edges. If you optimize the initial structure, you must constrain atoms corresponding to at least one period + 1 layer at the edges (either fixed or rigid constraints) in order for it to be possible to convert to a device. Otherwise there is no way to know what the electrode length should be, as this is based on the periodicity of the lattice.

Offline coraline24

  • Regular QuantumATK user
  • **
  • Posts: 5
  • Country: jp
  • Reputation: 0
    • View Profile
Hello,

Thank you for your suggestion.

I have checked again and made sure to constrain atoms on both sides of the model. For example, the attached model has 14 layers, and 9 bottom layers were fixed.

However, after geometry optimization, I still cannot make a device out of this model, and the same error message still appears.

Could you provide some guidance on this situation?

Thank you very much,
Thi

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Can you make a device from the structure you have before the optimization? If not, the problem may have been introduced even earlier, maybe some atom has moved just a little bit (can happen when you select it with the mouse). Also it looks like you might have some atom outside the cell on the right? Might not be a problem but worth checking. For more assistance we would need to see that actual input script.

Offline coraline24

  • Regular QuantumATK user
  • **
  • Posts: 5
  • Country: jp
  • Reputation: 0
    • View Profile
You are right, I checked with the not optimized structure and I cannot make a device with it already.
I made the structure again from scratch, and make sure to not accidentally move any atoms, but I still cannot make a device out of it (the not optimized structure).

I attached here the input script of the previous structure I sent. Thank you so much for helping.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
There is a lot of noise in the coordinates. One would expect for instance a set of atoms to be at 0.33333333333 and 0.11111111111 but you have 0.333337483735,  0.111109874572 for the first atom, and 0.333391885022,  0.108315309263 for the third, and that is the base reason, the exact periodicity is broken. You will need to go back and cleave Silicon and make sure all atoms stay in the symmetry positions, fix the outer layers, test that you can make a device from the unoptimized device, and then optimize it with appropriate constraints.
« Last Edit: April 12, 2023, 09:07 by Anders Blom »