API Documentation
Source code in qcmanybody/manybody.py
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 |
|
format_calc_plan
Formulate per-modelchem and per-body job count data and summary text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sset |
str
|
Among {"all", "nocp", "cp", "vmfc_compute"}, which data structure to return. |
'all'
|
Returns:
Type | Description |
---|---|
info
|
A text summary with per- model chemistry and per- n-body-level job counts. |
Dict[str, Dict[int, int]]
|
Data structure with outer key mc-label, inner key 1-indexed n-body, value job count. |
Source code in qcmanybody/manybody.py
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 |
|
iterate_molecules
Iterate over all the molecules needed for the computation.
Yields model chemistry, label, and molecule.
Source code in qcmanybody/manybody.py
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 |
|
analyze
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_results |
Dict[str, Dict[str, Union[float, ndarray]]]
|
Nested dictionary with results from all individual molecular system calculations, including all subsystem/basis combinations, all model chemistries, and all properties (e.g., e/g/h). For example, the below is the format for a nocp gradient run on a
helium dimer with 1-body at CCSD and 2-body at MP2. The outer string
key can be generated with the {'["ccsd", [1], [1]]': {'energy': -2.87, 'gradient': array([[0., 0., 0.]])}, '["ccsd", [2], [2]]': {'energy': -2.87, 'gradient': array([[0., 0., 0.]])}, '["mp2", [1], [1]]': {'energy': -2.86, 'gradient': array([[0., 0., 0.]])}, '["mp2", [2], [2]]': {'energy': -2.86, 'gradient': array([[0., 0., 0.]])}, '["mp2", [1, 2], [1, 2]]': {'energy': -5.73, 'gradient': array([[ 0., 0., 0.0053], [ 0., 0., -0.0053]])}, } |
required |
Return
Source code in qcmanybody/manybody.py
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 |
|
qcmanybody.computer.ManyBodyComputer
Bases: BaseComputerQCNG
input_data
class-attribute
instance-attribute
input_data: ManyBodyInput = Field(..., description='Input schema containing the relevant settings for performing the many body expansion. This is entirely redundant with the piecemeal assembly of this Computer class and is only stored to be available for error handling and exact reconstruction of ManyBodyResult.')
bsse_type
class-attribute
instance-attribute
molecule
class-attribute
instance-attribute
molecule: Molecule = Field(..., description='Target molecule for many body expansion (MBE) or interaction energy (IE) analysis. Fragmentation should already be defined in `fragments` and related fields.')
driver
class-attribute
instance-attribute
driver: DriverEnum = Field(..., description='The computation driver; i.e., energy, gradient, hessian. In case of ambiguity (e.g., MBE gradient through finite difference energies or MBE energy through composite method), this field refers to the *target* derivative, not any *means* specification.')
embedding_charges
class-attribute
instance-attribute
embedding_charges: Optional[Dict[int, List[float]]] = Field(None, description="Atom-centered point charges to be used to speed up nbody-level convergence. Charges are placed on molecule fragments whose basis sets are not included in the computation. (An implication is that charges aren't invoked for bsse_type=cp.) Keys: 1-based index of fragment. Values: list of atom charges for that fragment.", json_schema_extra={'shape': ['nfr', '<varies: nat in ifr>']})
return_total_data
class-attribute
instance-attribute
levels
class-attribute
instance-attribute
levels: Optional[Dict[Union[int, Literal['supersystem']], str]] = Field(None, validate_default=True, description=description + "Examples above are processed in the ManyBodyComputer, and once processed, only the values should be used. The keys turn into nbodies_per_mc_level, as notated below. * {1: 'ccsd(t)', 2: 'mp2', 'supersystem': 'scf'} -> nbodies_per_mc_level=[[1], [2], ['supersystem']] * {2: 'ccsd(t)/cc-pvdz', 3: 'mp2'} -> nbodies_per_mc_level=[[1, 2], [3]] ")
max_nbody
class-attribute
instance-attribute
supersystem_ie_only
class-attribute
instance-attribute
qcmb_calculator
class-attribute
instance-attribute
Config
set_bsse_type
classmethod
Source code in qcmanybody/computer.py
207 208 209 210 211 212 213 214 215 216 217 |
|
set_embedding_charges
classmethod
set_embedding_charges(v, values)
Source code in qcmanybody/computer.py
220 221 222 223 224 225 226 227 228 229 230 231 |
|
set_return_total_data
classmethod
Source code in qcmanybody/computer.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
set_levels
classmethod
Source code in qcmanybody/computer.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
set_max_nbody
classmethod
Source code in qcmanybody/computer.py
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 |
|
set_supersystem_ie_only
classmethod
Source code in qcmanybody/computer.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
from_manybodyinput
classmethod
from_manybodyinput(input_model: ManyBodyInput, build_tasks: bool = True)
Source code in qcmanybody/computer.py
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 |
|
plan
plan()
Source code in qcmanybody/computer.py
460 461 462 |
|
compute
compute(client: Optional[FractalClient] = None) -> None
Run quantum chemistry.
NOTE: client logic removed (compared to psi4.driver.ManyBodyComputer)
Source code in qcmanybody/computer.py
464 465 466 467 468 469 470 |
|
get_results
get_results(external_results: Dict, component_results: Dict, client: Optional[FractalClient] = None) -> ManyBodyResult
Return results as ManyBody-flavored QCSchema.
Source code in qcmanybody/computer.py
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 |
|
ManyBodyComputer
key | type | required | description | default |
---|---|---|---|---|
input_data | True | Input schema containing the relevant settings for performing the many body expansion. This is entirely redundant with the piecemeal assembly of this Computer class and is only stored to be available for error handling and exact reconstruction of ManyBodyResult. | None | |
bsse_type | False | Requested BSSE treatments. First in list determines which interaction or total energy/gradient/Hessian returned. | [ |
|
molecule | True | Target molecule for many body expansion (MBE) or interaction energy (IE) analysis. Fragmentation should already be defined in fragments and related fields. |
None | |
driver | True | The computation driver; i.e., energy, gradient, hessian. In case of ambiguity (e.g., MBE gradient through finite difference energies or MBE energy through composite method), this field refers to the target derivative, not any means specification. | None | |
embedding_charges | typing.List[float] | False | Atom-centered point charges to be used to speed up nbody-level convergence. Charges are placed on molecule fragments whose basis sets are not included in the computation. (An implication is that charges aren't invoked for bsse_type=cp.) Keys: 1-based index of fragment. Values: list of atom charges for that fragment. | None |
return_total_data | False | When True, returns the total data (energy/gradient/Hessian) of the system, otherwise returns interaction data. Default is False for energies, True for gradients and Hessians. Note that the calculation of counterpoise corrected total energies implies the calculation of the energies of monomers in the monomer basis, hence specifying return_total_data = True may carry out more computations than return_total_data = False . For gradients and Hessians, return_total_data = False is rarely useful. |
None | |
levels | False | Dictionary of different levels of theory for different levels of expansion. Note that the primary method_string is not used when this keyword is given. supersystem computes all higher order n-body effects up to the number of fragments; this higher-order correction uses the nocp basis, regardless of bsse_type. A method fills in for any lower unlisted nbody levels. Note that if both this and max_nbody are provided, they must be consistent. Examples: SUPERSYSTEM definition suspect* {1: 'ccsd(t)', 2: 'mp2', 'supersystem': 'scf'} * {2: 'ccsd(t)/cc-pvdz', 3: 'mp2'} * Now invalid: {1: 2, 2: 'ccsd(t)/cc-pvdz', 3: 'mp2'} Examples above are processed in the ManyBodyComputer, and once processed, only the values should be used. The keys turn into nbodies_per_mc_level, as notated below. * {1: 'ccsd(t)', 2: 'mp2', 'supersystem': 'scf'} -> nbodies_per_mc_level=[[1], [2], ['supersystem']] * {2: 'ccsd(t)/cc-pvdz', 3: 'mp2'} -> nbodies_per_mc_level=[[1, 2], [3]] |
None | |
max_nbody | False | Maximum number of bodies to include in the many-body treatment. Possible: max_nbody <= nfragments. Default: max_nbody = nfragments. | None | |
supersystem_ie_only | False | Target the supersystem total/interaction energy (IE) data over the many-body expansion (MBE) analysis, thereby omitting intermediate-body calculations. When False (default), compute each n-body level in the MBE up through max_nbody . When True (only allowed for max_nbody = nfragments ), only compute enough for the overall interaction/total energy: max_nbody-body and 1-body. When True, properties INTERACTION {driver} THROUGH {max_nbody}-BODY will always be available; TOTAL {driver} THROUGH {max_nbody}-BODY will be available depending on return_total_data ; and {max_nbody}-BODY CONTRIBUTION TO {driver} won't be available (except for dimers). This keyword produces no savings for a two-fragment molecule. But for the interaction energy of a three-fragment molecule, for example, 2-body subsystems can be skipped with supersystem_ie_only=True . Do not use with vmfc in bsse_type as it cannot produce savings. |
False | |
task_list | typing.Any | False | {} | |
qcmb_calculator | typing.Any | False | Low-level interface | None |