Coverage for ase/calculators/openmx/dos.py: 4.58%

284 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-11-27 15:21 +0000

1""" 

2The ASE Calculator for OpenMX <https://www.openmx-square.org>: Python interface 

3to the software package for nano-scale material simulations based on density 

4functional theories. 

5 Copyright (C) 2017 Charles Thomas Johnson, JaeHwan Shim and JaeJun Yu 

6 

7 This program is free software: you can redistribute it and/or modify 

8 it under the terms of the GNU Lesser General Public License as published by 

9 the Free Software Foundation, either version 2.1 of the License, or 

10 (at your option) any later version. 

11 

12 This program is distributed in the hope that it will be useful, 

13 but WITHOUT ANY WARRANTY; without even the implied warranty of 

14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

15 GNU Lesser General Public License for more details. 

16 

17 You should have received a copy of the GNU Lesser General Public License 

18 along with ASE. If not, see <https://www.gnu.org/licenses/>. 

19""" 

20 

21import os 

22import subprocess 

23import warnings 

24 

25import numpy as np 

26 

27from ase.calculators.openmx.reader import rn as read_nth_to_last_value 

28 

29 

30def input_command(calc, executable_name, input_files, argument_format='%s'): 

31 input_files = tuple(input_files) 

32 command = executable_name + ' ' + argument_format % input_files 

33 subprocess.check_call(command, shell=True, cwd=calc.directory) 

34 

35 

36class DOS: 

37 def __init__(self, calc): 

38 self.calc = calc 

39 self.dos_dict = {} 

40 

41 def read_dos( 

42 self, 

43 method='Tetrahedron', 

44 pdos=False, 

45 atom_index=1, 

46 orbital='', 

47 spin_polarization=False, 

48 ): 

49 """ 

50 function for reading DOS from the following OpenMX file extensions: 

51 ~.[DOS|PDOS].[Tetrahedron|Gaussian]<.atom(int).(orbital) 

52 

53 Parameters 

54 ---------- 

55 method : Literal['Tetrahedron', 'Gaussian'], default: 'Tetrahedron' 

56 Method used to calculate the density of states. 

57 pdos : bool, default: False 

58 True if the pseudo-density of states have been calculated, 

59 False if only the total density of states has been calculated. 

60 atom_index : int, default: 1 

61 Atom index in the unit cell as specified in the OpenMX input file. 

62 orbital : str, default: '' 

63 '' or 's1' or 'p1', 'p2', 'p3' or 'd1', 'd2', 'd3', 'd4', 'd5' etc. 

64 If pdos is True then this specifies the pdos from a particular 

65 orbital to read from. 

66 If '' is given, then the total pdos from the given atom is read. 

67 spin_polarization : bool 

68 If True, this reads the separate pdos for up and down spin states. 

69 

70 """ 

71 add = False 

72 if not spin_polarization and self.calc['initial_magnetic_moments']: 

73 add = True 

74 p = '' 

75 if pdos: 

76 p = 'P' 

77 filename = self.calc.label + '.' + p + 'DOS.' + method 

78 if pdos: 

79 period = '' 

80 if orbital != '': 

81 period = '.' 

82 filename += '.atom' + str(atom_index) + period + orbital 

83 

84 with open(filename) as fd: 

85 line = '\n' 

86 number_of_lines = -1 

87 while line != '': 

88 line = fd.readline() 

89 number_of_lines += 1 

90 

91 key = '' 

92 atom_and_orbital = '' 

93 if pdos: 

94 key = 'p' 

95 atom_and_orbital = str(atom_index) + orbital 

96 key += 'dos' 

97 self.dos_dict[f'{key}_energies_{atom_and_orbital}'] = np.ndarray( 

98 number_of_lines 

99 ) 

100 if spin_polarization: 

101 self.dos_dict[f'{key}{atom_and_orbital}up'] = np.ndarray( 

102 number_of_lines 

103 ) 

104 self.dos_dict[f'{key}{atom_and_orbital}down'] = np.ndarray( 

105 number_of_lines 

106 ) 

107 self.dos_dict[f'{key}_cum_{atom_and_orbital}up'] = np.ndarray( 

108 number_of_lines 

109 ) 

110 self.dos_dict[f'{key}_cum_{atom_and_orbital}down'] = np.ndarray( 

111 number_of_lines 

112 ) 

113 else: 

114 self.dos_dict[f'{key}{atom_and_orbital}'] = np.ndarray( 

115 number_of_lines 

116 ) 

117 self.dos_dict[f'{key}_cum_{atom_and_orbital}'] = np.ndarray( 

118 number_of_lines 

119 ) 

120 with open(filename) as fd: 

121 if spin_polarization: 

122 for i in range(number_of_lines): 

123 line = fd.readline() 

124 self.dos_dict[f'{key}_energies_{atom_and_orbital}'][i] = ( 

125 read_nth_to_last_value(line, 5) 

126 ) 

127 self.dos_dict[f'{key}{atom_and_orbital}up'][i] = ( 

128 read_nth_to_last_value(line, 4) 

129 ) 

130 self.dos_dict[f'{key}{atom_and_orbital}down'][i] = -float( 

131 read_nth_to_last_value(line, 3) 

132 ) 

133 self.dos_dict[f'{key}_cum_{atom_and_orbital}up'][i] = ( 

134 read_nth_to_last_value(line, 2) 

135 ) 

136 self.dos_dict[f'{key}_cum_{atom_and_orbital}down'][i] = ( 

137 read_nth_to_last_value(line) 

138 ) 

139 elif add: 

140 for i in range(number_of_lines): 

141 line = fd.readline() 

142 self.dos_dict[f'{key}_energies_{atom_and_orbital}'][i] = ( 

143 read_nth_to_last_value(line, 5) 

144 ) 

145 self.dos_dict[f'{key}{atom_and_orbital}'][i] = float( 

146 read_nth_to_last_value(line, 4) 

147 ) - float(read_nth_to_last_value(line, 3)) 

148 self.dos_dict[f'{key}_cum_{atom_and_orbital}'][i] = float( 

149 read_nth_to_last_value(line, 2) 

150 ) + float(read_nth_to_last_value(line)) 

151 else: 

152 for i in range(number_of_lines): 

153 line = fd.readline() 

154 self.dos_dict[f'{key}_energies_{atom_and_orbital}'][i] = ( 

155 read_nth_to_last_value(line, 3) 

156 ) 

157 self.dos_dict[f'{key}{atom_and_orbital}'][i] = ( 

158 read_nth_to_last_value(line, 2) 

159 ) 

160 self.dos_dict[f'{key}_cum_{atom_and_orbital}'][i] = ( 

161 read_nth_to_last_value(line) 

162 ) 

163 

164 def subplot_dos( 

165 self, 

166 axis, 

167 density=True, 

168 cum=False, 

169 pdos=False, 

170 atom_index=1, 

171 orbital='', 

172 spin='', 

173 erange=(-25, 20), 

174 fermi_level=True, 

175 ): 

176 """ 

177 Plots a graph of (pseudo-)density of states against energy onto a given 

178 axis of a subplot. 

179 

180 Parameters 

181 ---------- 

182 axis : Axes 

183 Matplotlib.pyplot.Axes object 

184 This allows the graph to plotted on any desired axis of a plot. 

185 density : bool, default: True 

186 If True, the density of states will be plotted. 

187 cum : bool, default: False 

188 If True, the cumulative (or integrated) density of states 

189 will be plotted. 

190 pdos : bool, default: False 

191 If True, the pseudo-density of states will be plotted for 

192 a given atom and orbital. 

193 atom_index: int, default: 1 

194 If ``pdos`` is True, atom_index specifies which atom's PDOS to plot. 

195 orbital : str, default: '' 

196 If ``pdos`` is True, orbital specifies which orbital's PDOS to plot. 

197 spin : Literal['', 'up', 'down'], default: '' 

198 If '', density of states for both spin states will be 

199 combined into one plot. 

200 If 'up' or 'down', a given spin state's PDOS will be plotted. 

201 

202 """ 

203 p = '' 

204 bottom_index = 0 

205 atom_orbital = atom_orbital_spin = '' 

206 if pdos: 

207 p = 'p' 

208 atom_orbital += str(atom_index) + orbital 

209 atom_orbital_spin += atom_orbital + spin 

210 key = p + 'dos' 

211 density_color = 'r' 

212 cum_color = 'b' 

213 if spin == 'down': 

214 density_color = 'c' 

215 cum_color = 'm' 

216 if density and cum: 

217 axis_twin = axis.twinx() 

218 axis.plot( 

219 self.dos_dict[key + '_energies_' + atom_orbital], 

220 self.dos_dict[key + atom_orbital_spin], 

221 density_color, 

222 ) 

223 axis_twin.plot( 

224 self.dos_dict[key + '_energies_' + atom_orbital], 

225 self.dos_dict[key + '_cum_' + atom_orbital_spin], 

226 cum_color, 

227 ) 

228 max_density = max(self.dos_dict[key + atom_orbital_spin]) 

229 max_cum = max(self.dos_dict[key + '_cum_' + atom_orbital_spin]) 

230 if not max_density: 

231 max_density = 1.0 

232 if not max_cum: 

233 max_cum = 1 

234 axis.set_ylim(ymax=max_density) 

235 axis_twin.set_ylim(ymax=max_cum) 

236 axis.set_ylim(ymin=0.0) 

237 axis_twin.set_ylim(ymin=0.0) 

238 label_index = 0 

239 yticklabels = axis.get_yticklabels() 

240 if spin == 'down': 

241 bottom_index = len(yticklabels) - 1 

242 for t in yticklabels: 

243 if ( 

244 label_index == bottom_index 

245 or label_index == len(yticklabels) // 2 

246 ): 

247 t.set_color(density_color) 

248 else: 

249 t.set_visible(False) 

250 label_index += 1 

251 label_index = 0 

252 yticklabels = axis_twin.get_yticklabels() 

253 if spin == 'down': 

254 bottom_index = len(yticklabels) - 1 

255 for t in yticklabels: 

256 if ( 

257 label_index == bottom_index 

258 or label_index == len(yticklabels) // 2 

259 ): 

260 t.set_color(cum_color) 

261 else: 

262 t.set_visible(False) 

263 label_index += 1 

264 if spin == 'down': 

265 axis.set_ylim(axis.get_ylim()[::-1]) 

266 axis_twin.set_ylim(axis_twin.get_ylim()[::-1]) 

267 else: 

268 color = density_color 

269 if cum: 

270 color = cum_color 

271 key += '_cum_' 

272 key += atom_orbital_spin 

273 axis.plot( 

274 self.dos_dict[p + 'dos_energies_' + atom_orbital], 

275 self.dos_dict[key], 

276 color, 

277 ) 

278 maximum = max(self.dos_dict[key]) 

279 if not maximum: 

280 maximum = 1.0 

281 axis.set_ylim(ymax=maximum) 

282 axis.set_ylim(ymin=0.0) 

283 label_index = 0 

284 yticklabels = axis.get_yticklabels() 

285 if spin == 'down': 

286 bottom_index = len(yticklabels) - 1 

287 for t in yticklabels: 

288 if ( 

289 label_index == bottom_index 

290 or label_index == len(yticklabels) // 2 

291 ): 

292 t.set_color(color) 

293 else: 

294 t.set_visible(False) 

295 label_index += 1 

296 if spin == 'down': 

297 axis.set_ylim(axis.get_ylim()[::-1]) 

298 if fermi_level: 

299 axis.axvspan(erange[0], 0.0, color='y', alpha=0.5) 

300 

301 def plot_dos( 

302 self, 

303 density=True, 

304 cum=False, 

305 pdos=False, 

306 orbital_list=None, 

307 atom_index_list=None, 

308 spins=('up', 'down'), 

309 fermi_level=True, 

310 spin_polarization=False, 

311 erange=(-25, 20), 

312 atoms=None, 

313 method='Tetrahedron', 

314 file_format=None, 

315 ): 

316 """ 

317 Generates a graphical figure containing possible subplots of different 

318 PDOSs of different atoms, orbitals and spin state combinations. 

319 

320 Parameters 

321 ---------- 

322 density : bool, default: True 

323 If True, density of states will be plotted. 

324 cum : bool, default: False 

325 If True, cumulative density of states will be plotted. 

326 pdos : bool, default: False 

327 If True, pseudo-density of states will be plotted for 

328 given atoms and orbitals. 

329 atom_index_list: list[int] | None, default: None 

330 If ``pdos`` is True, PDOS is plotted for the specified atoms. 

331 orbital_list : list[str] | None, default: None 

332 If ``pdos`` is True, PDOS is plotted for the specified orbitals. 

333 spins : tuple[Literal['', 'up', 'down'], ...], default: ('up', 'down') 

334 If '' in spins, density of states for both spin states 

335 will be combined into one graph. If 'up' or 'down' in spins, 

336 a given spin state's PDOS graph will be plotted. 

337 spin_polarization : bool, default: False 

338 If False, spin states will not be separated in different PDOS's. 

339 erange : tuple[int, int], default: (-25, 20) 

340 Range of energies to view DOS. 

341 

342 Returns 

343 ------- 

344 tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] 

345 

346 """ 

347 import matplotlib.pyplot as plt 

348 from matplotlib.lines import Line2D 

349 

350 if not spin_polarization: 

351 spins = [''] 

352 number_of_spins = len(spins) 

353 if orbital_list is None: 

354 orbital_list = [''] 

355 number_of_atoms = 1 

356 number_of_orbitals = 1 

357 p = '' 

358 if pdos: 

359 p = 'P' 

360 if atom_index_list is None: 

361 atom_index_list = [i + 1 for i in range(len(atoms))] 

362 number_of_atoms = len(atom_index_list) 

363 number_of_orbitals = len(orbital_list) 

364 figure, axes = plt.subplots( 

365 number_of_orbitals * number_of_spins, 

366 number_of_atoms, 

367 sharex=True, 

368 sharey=False, 

369 squeeze=False, 

370 ) 

371 for i in range(number_of_orbitals): 

372 for s in range(number_of_spins): 

373 row_index = i * number_of_spins + s 

374 for j in range(number_of_atoms): 

375 self.subplot_dos( 

376 fermi_level=fermi_level, 

377 density=density, 

378 axis=axes[row_index][j], 

379 erange=erange, 

380 atom_index=atom_index_list[j], 

381 pdos=pdos, 

382 orbital=orbital_list[i], 

383 spin=spins[s], 

384 cum=cum, 

385 ) 

386 if j == 0 and pdos: 

387 orbital = orbital_list[i] 

388 if orbital == '': 

389 orbital = 'All' 

390 if spins[s]: 

391 orbital += ' ' + spins[s] 

392 axes[row_index][j].set_ylabel(orbital) 

393 if row_index == 0 and pdos: 

394 atom_symbol = '' 

395 if atoms: 

396 atom_symbol = ( 

397 ' (' + atoms[atom_index_list[j]].symbol + ')' 

398 ) 

399 axes[row_index][j].set_title( 

400 'Atom ' + str(atom_index_list[j]) + atom_symbol 

401 ) 

402 if row_index == number_of_orbitals * number_of_spins - 1: 

403 axes[row_index][j].set_xlabel( 

404 'Energy above Fermi Level (eV)' 

405 ) 

406 plt.xlim(xmin=erange[0], xmax=erange[1]) 

407 if density and cum: 

408 figure.suptitle(self.calc.label) 

409 xdata = (0.0, 1.0) 

410 ydata = (0.0, 0.0) 

411 key_tuple = ( 

412 Line2D(color='r', xdata=xdata, ydata=ydata), 

413 Line2D(color='b', xdata=xdata, ydata=ydata), 

414 ) 

415 if spin_polarization: 

416 key_tuple = ( 

417 Line2D(color='r', xdata=xdata, ydata=ydata), 

418 Line2D(color='b', xdata=xdata, ydata=ydata), 

419 Line2D(color='c', xdata=xdata, ydata=ydata), 

420 Line2D(color='m', xdata=xdata, ydata=ydata), 

421 ) 

422 title_tuple = (p + 'DOS (eV^-1)', 'Number of States per Unit Cell') 

423 if spin_polarization: 

424 title_tuple = ( 

425 p + 'DOS (eV^-1), spin up', 

426 'Number of States per Unit Cell, spin up', 

427 p + 'DOS (eV^-1), spin down', 

428 'Number of States per Unit Cell, spin down', 

429 ) 

430 figure.legend(key_tuple, title_tuple, 'lower center') 

431 elif density: 

432 figure.suptitle(self.calc.prefix + ': ' + p + 'DOS (eV^-1)') 

433 elif cum: 

434 figure.suptitle(self.calc.prefix + ': Number of States') 

435 extra_margin = 0 

436 if density and cum and spin_polarization: 

437 extra_margin = 0.1 

438 plt.subplots_adjust( 

439 hspace=0.0, 

440 bottom=0.2 + extra_margin, 

441 wspace=0.29, 

442 left=0.09, 

443 right=0.95, 

444 ) 

445 if file_format: 

446 orbitals = '' 

447 if pdos: 

448 atom_index_list = map(str, atom_index_list) 

449 atoms = '&'.join(atom_index_list) 

450 if '' in orbital_list: 

451 all_index = orbital_list.index('') 

452 orbital_list.remove('') 

453 orbital_list.insert(all_index, 'all') 

454 orbitals = ''.join(orbital_list) 

455 plt.savefig( 

456 filename=self.calc.label 

457 + '.' 

458 + p 

459 + 'DOS.' 

460 + method 

461 + '.atoms' 

462 + atoms 

463 + '.' 

464 + orbitals 

465 + '.' 

466 + file_format 

467 ) 

468 if not file_format: 

469 plt.show() 

470 return figure, axes 

471 

472 def calc_dos( 

473 self, 

474 method='Tetrahedron', 

475 pdos=False, 

476 gaussian_width=0.1, 

477 atom_index_list=None, 

478 ): 

479 """ 

480 Python interface for DosMain (OpenMX's density of states calculator). 

481 Can automate the density of states 

482 calculations used in OpenMX by processing .Dos.val and .Dos.vec files. 

483 

484 Parameters 

485 ---------- 

486 method : Literal['Tetrahedron', 'Gaussian'], default: 'Tetrahedron' 

487 Method to be used to calculate the density of states from 

488 eigenvalues and eigenvectors. 

489 pdos : bool, default: False 

490 If True, the pseudo-density of states is calculated for a given 

491 list of atoms for each orbital. If the system is spin polarized, 

492 then each up and down state is also calculated. 

493 gaussian_width: float, default: 0.1 

494 If ``method`` is 'Gaussian' then gaussian_width is required (eV). 

495 atom_index_list : list[int] | None, default: None 

496 If ``pdos`` is True, a list of atom indices are required to 

497 generate the pdos of each of those specified atoms. 

498 

499 """ 

500 method_code = '2\n' 

501 if method == 'Tetrahedron': 

502 method_code = '1\n' 

503 pdos_code = '1\n' 

504 if pdos: 

505 pdos_code = '2\n' 

506 with open(os.path.join(self.calc.directory, 'std_dos.in'), 'w') as fd: 

507 fd.write(method_code) 

508 if method == 'Gaussian': 

509 fd.write(str(gaussian_width) + '\n') 

510 fd.write(pdos_code) 

511 if pdos: 

512 atoms_code = '' 

513 if atom_index_list is None: 

514 for i in range(len(self.calc.atoms)): 

515 atoms_code += str(i + 1) + ' ' 

516 else: 

517 for i in atom_index_list: 

518 atoms_code += str(i) + ' ' 

519 atoms_code += '\n' 

520 fd.write(atoms_code) 

521 fd.close() 

522 executable_name = 'DosMain' 

523 input_files = ( 

524 self.calc.label + '.Dos.val', 

525 self.calc.label + '.Dos.vec', 

526 os.path.join(self.calc.directory, 'std_dos.in'), 

527 ) 

528 argument_format = '%s %s < %s' 

529 input_command(self.calc, executable_name, input_files, argument_format) 

530 

531 def get_dos( 

532 self, 

533 atom_index_list=None, 

534 method='Tetrahedron', 

535 gaussian_width=0.1, 

536 pdos=False, 

537 orbital_list=None, 

538 spin_polarization=None, 

539 density=True, 

540 cum=False, 

541 erange=(-25, 20), 

542 file_format=None, 

543 atoms=None, 

544 fermi_level=True, 

545 ): 

546 """ 

547 Wraps all the density of states processing functions. Can go from 

548 .Dos.val and .Dos.vec files to a graphical figure showing many 

549 different PDOS plots against energy in one step. 

550 

551 Parameters 

552 ---------- 

553 atom_index_list : list[int] | None, default: None 

554 If ``pdos`` is True, a list of atom indices are required to 

555 generate the pdos of each of those specified atoms. 

556 method : Literal['Tetrahedron', 'Gaussian'], default: 'Tetrahedron' 

557 Method to be used to calculate the density of states from 

558 eigenvalues and eigenvectors. 

559 gaussian_width : float, default: 0.1 

560 If ``method`` is 'Gaussian' then gaussian_width is required (eV). 

561 pdos : bool, default: False 

562 If True, the pseudo-density of states is calculated for a given 

563 list of atoms for each orbital. If the system is spin polarized, 

564 then each up and down state is also calculated. 

565 orbital_list : list[str] | None, default: None 

566 If ``pdos`` is True, a list of orbital symbols are required to 

567 generate the PDOS of each of those specified atoms. 

568 spin_polarization : bool | None, default: None 

569 If False, spin states will not be separated in different PDOS's. 

570 density : bool, default: True 

571 If True, density of states will be plotted. 

572 cum : bool, default: False 

573 If True, cumulative density of states will be plotted. 

574 erange : tuple[int, int], default: (-25, 20) 

575 Range of energies to view the DOS. 

576 file_format : str | None, default: None 

577 If not None, a file will be saved automatically in that format 

578 ('pdf', 'png', 'jpeg' etc.) 

579 

580 Returns 

581 ------- 

582 matplotlib.figure.Figure 

583 

584 """ 

585 if spin_polarization is None: 

586 spin_polarization = bool(self.calc['initial_magnetic_moments']) 

587 if spin_polarization and not self.calc['initial_magnetic_moments']: 

588 warnings.warn('No spin polarization calculations provided') 

589 spin_polarization = False 

590 if atom_index_list is None: 

591 atom_index_list = [1] 

592 if method == 'Tetrahedron' and self.calc['dos_kgrid'] == (1, 1, 1): 

593 raise ValueError('Not enough k-space grid points.') 

594 self.calc_dos( 

595 atom_index_list=atom_index_list, 

596 pdos=pdos, 

597 method=method, 

598 gaussian_width=gaussian_width, 

599 ) 

600 if pdos: 

601 if orbital_list is None: 

602 orbital_list = [''] 

603 orbital_list = list(orbital_list) 

604 if 's' in orbital_list: 

605 s_index = orbital_list.index('s') 

606 orbital_list.remove('s') 

607 orbital_list.insert(s_index, 's1') 

608 if 'p' in orbital_list: 

609 p_index = orbital_list.index('p') 

610 orbital_list.remove('p') 

611 orbital_list.insert(p_index, 'p3') 

612 orbital_list.insert(p_index, 'p2') 

613 orbital_list.insert(p_index, 'p1') 

614 if 'd' in orbital_list: 

615 d_index = orbital_list.index('d') 

616 orbital_list.remove('d') 

617 orbital_list.insert(d_index, 'd5') 

618 orbital_list.insert(d_index, 'd4') 

619 orbital_list.insert(d_index, 'd3') 

620 orbital_list.insert(d_index, 'd2') 

621 orbital_list.insert(d_index, 'd1') 

622 if 'f' in orbital_list: 

623 f_index = orbital_list.index('f') 

624 orbital_list.remove('f') 

625 orbital_list.insert(f_index, 'f7') 

626 orbital_list.insert(f_index, 'f6') 

627 orbital_list.insert(f_index, 'f5') 

628 orbital_list.insert(f_index, 'f4') 

629 orbital_list.insert(f_index, 'f3') 

630 orbital_list.insert(f_index, 'f2') 

631 orbital_list.insert(f_index, 'f1') 

632 

633 for atom_index in atom_index_list: 

634 for orbital in orbital_list: 

635 self.read_dos( 

636 method=method, 

637 atom_index=atom_index, 

638 pdos=pdos, 

639 orbital=orbital, 

640 spin_polarization=spin_polarization, 

641 ) 

642 else: 

643 self.read_dos(method=method, spin_polarization=spin_polarization) 

644 return self.plot_dos( 

645 density=density, 

646 cum=cum, 

647 atoms=atoms, 

648 atom_index_list=atom_index_list, 

649 pdos=pdos, 

650 orbital_list=orbital_list, 

651 erange=erange, 

652 spin_polarization=spin_polarization, 

653 file_format=file_format, 

654 method=method, 

655 fermi_level=fermi_level, 

656 )