23 #ifndef COM_DAFER45_TBTK_PROPERTY_ENERGY_RESOLVED_PROPERTY
24 #define COM_DAFER45_TBTK_PROPERTY_ENERGY_RESOLVED_PROPERTY
26 #include "TBTK/Property/AbstractProperty.h"
82 template<
typename DataType>
101 unsigned int resolution
116 unsigned int resolution,
132 const std::vector<int> &ranges,
135 unsigned int resolution
152 const std::vector<int> &ranges,
155 unsigned int resolution,
173 unsigned int resolution
193 unsigned int resolution,
210 int lowerMatsubaraEnergyIndex,
211 int upperMatsubaraEnergtIndex,
212 double fundamentalMatsubaraEnergy
231 int lowerMatsubaraEnergyIndex,
232 int upperMatsubaraEnergtIndex,
233 double fundamentalMatsubaraEnergy,
243 const std::string &serialization,
340 double precision = 1e-1
370 unsigned int resolution;
373 class MatsubaraEnergy{
376 int lowerMatsubaraEnergyIndex;
379 int numMatsubaraEnergies;
382 double fundamentalMatsubaraEnergy;
386 union EnergyDescriptor{
387 RealEnergy realEnergy;
388 MatsubaraEnergy matsubaraEnergy;
392 EnergyDescriptor descriptor;
395 template<
typename DataType>
399 template<
typename DataType>
403 unsigned int resolution
408 lowerBound <= upperBound,
409 "EnergyResolvedProperty::EnergyResolvedProperty()",
410 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
411 " must be less or equal to the 'upperBound=" << upperBound
417 "EnergyResolvedProperty::EnergyResolvedProperty()",
418 "The 'resolution' must be larger than 0.",
422 energyType = EnergyType::Real;
423 descriptor.realEnergy.lowerBound = lowerBound;
424 descriptor.realEnergy.upperBound = upperBound;
425 descriptor.realEnergy.resolution = resolution;
428 template<
typename DataType>
432 unsigned int resolution,
438 lowerBound <= upperBound,
439 "EnergyResolvedProperty::EnergyResolvedProperty()",
440 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
441 " must be less or equal to the 'upperBound=" << upperBound
447 "EnergyResolvedProperty::EnergyResolvedProperty()",
448 "The 'resolution' must be larger than 0.",
452 energyType = EnergyType::Real;
453 descriptor.realEnergy.lowerBound = lowerBound;
454 descriptor.realEnergy.upperBound = upperBound;
455 descriptor.realEnergy.resolution = resolution;
458 template<
typename DataType>
460 const std::vector<int> &ranges,
463 unsigned int resolution
468 lowerBound <= upperBound,
469 "EnergyResolvedProperty::EnergyResolvedProperty()",
470 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
471 " must be less or equal to the 'upperBound=" << upperBound
477 "EnergyResolvedProperty::EnergyResolvedProperty()",
478 "The 'resolution' must be larger than 0.",
482 energyType = EnergyType::Real;
483 descriptor.realEnergy.lowerBound = lowerBound;
484 descriptor.realEnergy.upperBound = upperBound;
485 descriptor.realEnergy.resolution = resolution;
488 template<
typename DataType>
490 const std::vector<int> &ranges,
493 unsigned int resolution,
499 lowerBound <= upperBound,
500 "EnergyResolvedProperty::EnergyResolvedProperty()",
501 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
502 " must be less or equal to the 'upperBound=" << upperBound
508 "EnergyResolvedProperty::EnergyResolvedProperty()",
509 "The 'resolution' must be larger than 0.",
513 energyType = EnergyType::Real;
514 descriptor.realEnergy.lowerBound = lowerBound;
515 descriptor.realEnergy.upperBound = upperBound;
516 descriptor.realEnergy.resolution = resolution;
519 template<
typename DataType>
524 unsigned int resolution
529 lowerBound <= upperBound,
530 "EnergyResolvedProperty::EnergyResolvedProperty()",
531 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
532 " must be less or equal to the 'upperBound=" << upperBound
538 "EnergyResolvedProperty::EnergyResolvedProperty()",
539 "The 'resolution' must be larger than 0.",
543 energyType = EnergyType::Real;
544 descriptor.realEnergy.lowerBound = lowerBound;
545 descriptor.realEnergy.upperBound = upperBound;
546 descriptor.realEnergy.resolution = resolution;
549 template<
typename DataType>
554 unsigned int resolution,
560 lowerBound < upperBound,
561 "EnergyResolvedProperty::EnergyResolvedProperty()",
562 "Invalid energy bounds. The 'lowerBound=" << lowerBound <<
"'"
563 " must be smaller than the 'upperBound=" << upperBound <<
"'.",
568 "EnergyResolvedProperty::EnergyResolvedProperty()",
569 "The 'resolution' must be larger than 0.",
573 energyType = EnergyType::Real;
574 descriptor.realEnergy.lowerBound = lowerBound;
575 descriptor.realEnergy.upperBound = upperBound;
576 descriptor.realEnergy.resolution = resolution;
579 template<
typename DataType>
581 EnergyType energyType,
583 int lowerMatsubaraEnergyIndex,
584 int upperMatsubaraEnergyIndex,
585 double fundamentalMatsubaraEnergy
589 (upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2 + 1
593 lowerMatsubaraEnergyIndex <= upperMatsubaraEnergyIndex,
594 "EnergyResolvedProperty::EnergyResolvedProperty()",
595 "Invalid Matsubara energy bounds. The"
596 " 'lowerMatsubaraEnergyIndex=" << lowerMatsubaraEnergyIndex
597 <<
"' must be less or equal to the 'upperMatsubaraEnergyIndex="
598 << upperMatsubaraEnergyIndex <<
"'.",
602 fundamentalMatsubaraEnergy > 0,
603 "EnergyResolvedProperty::energyResolvedProperty()",
604 "The 'fundamentalMatsubaraEnergy' must be larger than 0.",
609 case EnergyType::FermionicMatsubara:
611 abs(lowerMatsubaraEnergyIndex%2) == 1,
612 "EnergyResolvedProperty::EnergyResolvedProperty()",
613 "The 'lowerMatsubaraEnergyIndex="
614 << lowerMatsubaraEnergyIndex <<
"' must be odd for"
615 <<
" EnergyType::FermionicMatsubara.",
619 abs(upperMatsubaraEnergyIndex%2) == 1,
620 "EnergyResolvedProperty::EnergyResolvedProperty()",
621 "The 'upperMatsubaraEnergyIndex="
622 << upperMatsubaraEnergyIndex <<
"' must be odd for"
623 <<
" EnergyType::FermionicMatsubara.",
627 this->energyType = energyType;
628 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
629 = lowerMatsubaraEnergyIndex;
630 descriptor.matsubaraEnergy.numMatsubaraEnergies = (
631 upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2
633 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
634 = fundamentalMatsubaraEnergy;
637 case EnergyType::BosonicMatsubara:
639 lowerMatsubaraEnergyIndex%2 == 0,
640 "EnergyResolvedProperty::EnergyResolvedProperty()",
641 "The 'lowerMatsubaraEnergyIndex="
642 << lowerMatsubaraEnergyIndex <<
"' must be even for"
643 <<
" EnergyType::BosonicMatsubara.",
647 upperMatsubaraEnergyIndex%2 == 0,
648 "EnergyResolvedProperty::EnergyResolvedProperty()",
649 "The 'upperMatsubaraEnergyIndex="
650 << upperMatsubaraEnergyIndex <<
"' must be even for"
651 <<
" EnergyType::BosonicMatsubara.",
655 this->energyType = energyType;
656 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
657 = lowerMatsubaraEnergyIndex;
658 descriptor.matsubaraEnergy.numMatsubaraEnergies = (
659 upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2
661 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
662 = fundamentalMatsubaraEnergy;
667 "EnergyResolvedProperty::EnergyResolvedProperty()",
668 "The 'energyType' must be"
669 " EnergyType::FermionicMatsubara or"
670 " EnergyType::BosonicMatsubara.",
676 template<
typename DataType>
678 EnergyType energyType,
680 int lowerMatsubaraEnergyIndex,
681 int upperMatsubaraEnergyIndex,
682 double fundamentalMatsubaraEnergy,
687 (upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2 + 1,
692 lowerMatsubaraEnergyIndex <= upperMatsubaraEnergyIndex,
693 "EnergyResolvedProperty::EnergyResolvedProperty()",
694 "Invalid Matsubara energy bounds. The"
695 " 'lowerMatsubaraEnergyIndex=" << lowerMatsubaraEnergyIndex
696 <<
"' must be less or equal to the 'upperMatsubaraEnergyIndex="
697 << upperMatsubaraEnergyIndex <<
"'.",
701 fundamentalMatsubaraEnergy > 0,
702 "EnergyResolvedProperty::energyResolvedProperty()",
703 "The 'fundamentalMatsubaraEnergy' must be larger than 0.",
708 case EnergyType::FermionicMatsubara:
710 abs(lowerMatsubaraEnergyIndex%2) == 1,
711 "EnergyResolvedProperty::EnergyResolvedProperty()",
712 "The 'lowerMatsubaraEnergyIndex="
713 << lowerMatsubaraEnergyIndex <<
"' must be odd for"
714 <<
" EnergyType::FermionicMatsubara.",
718 abs(upperMatsubaraEnergyIndex%2) == 1,
719 "EnergyResolvedProperty::EnergyResolvedProperty()",
720 "The 'uppererMatsubaraEnergyIndex="
721 << upperMatsubaraEnergyIndex <<
"' must be odd for"
722 <<
" EnergyType::FermionicMatsubara.",
726 this->energyType = energyType;
727 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
728 = lowerMatsubaraEnergyIndex;
729 descriptor.matsubaraEnergy.numMatsubaraEnergies = (
730 upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2
732 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
733 = fundamentalMatsubaraEnergy;
736 case EnergyType::BosonicMatsubara:
738 lowerMatsubaraEnergyIndex%2 == 0,
739 "EnergyResolvedProperty::EnergyResolvedProperty()",
740 "The 'lowerMatsubaraEnergyIndex="
741 << lowerMatsubaraEnergyIndex <<
"' must be even for"
742 <<
" EnergyType::BosonicMatsubara.",
746 upperMatsubaraEnergyIndex%2 == 0,
747 "EnergyResolvedProperty::EnergyResolvedProperty()",
748 "The 'uppererMatsubaraEnergyIndex="
749 << upperMatsubaraEnergyIndex <<
"' must be even for"
750 <<
" EnergyType::BosonicMatsubara.",
754 this->energyType = energyType;
755 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
756 = lowerMatsubaraEnergyIndex;
757 descriptor.matsubaraEnergy.numMatsubaraEnergies = (
758 upperMatsubaraEnergyIndex-lowerMatsubaraEnergyIndex)/2
760 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
761 = fundamentalMatsubaraEnergy;
766 "EnergyResolvedProperty::EnergyResolvedProperty()",
767 "The 'energyType' must be"
768 " EnergyType::FermionicMatsubara or"
769 " EnergyType::BosonicMatsubara.",
775 template<
typename DataType>
777 const std::string &serialization,
790 Serializable::validate(serialization,
"EnergyResolvedProperty", mode),
791 "Property::EnergyResolvedProperty::EnergyResolvedProperty()",
792 "Unable to parse string as EnergyResolvedProperty '"
793 << serialization <<
"'.",
798 case Serializable::Mode::JSON:
800 nlohmann::json j = nlohmann::json::parse(serialization);
801 std::string et = j.at(
"energyType").get<std::string>();
802 if(et.compare(
"Real") == 0){
803 energyType = EnergyType::Real;
804 descriptor.realEnergy.lowerBound
805 = j.at(
"lowerBound").get<
double>();
806 descriptor.realEnergy.upperBound
807 = j.at(
"upperBound").get<
double>();
808 descriptor.realEnergy.resolution
809 = j.at(
"resolution").get<
double>();
811 else if(et.compare(
"FermionicMatsubara") == 0){
812 energyType = EnergyType::FermionicMatsubara;
813 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
814 = j.at(
"lowerMatsubaraEnergyIndex");
815 descriptor.matsubaraEnergy.numMatsubaraEnergies
816 = j.at(
"numMatsubaraEnergies");
817 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
818 = j.at(
"fundamentalMatsubaraEnergy");
820 else if(et.compare(
"BosonicMatsubara") == 0){
821 energyType = EnergyType::BosonicMatsubara;
822 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
823 = j.at(
"lowerMatsubaraEnergyIndex");
824 descriptor.matsubaraEnergy.numMatsubaraEnergies
825 = j.at(
"numMatsubaraEnergies");
826 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
827 = j.at(
"fundamentalMatsubaraEnergy");
830 catch(nlohmann::json::exception &e){
832 "Proerty::EnergyResolvedProperty::EnergyResolvedProperty()",
833 "Unable to parse string as"
834 <<
" EnergyResolvedProperty '" << serialization
843 "Property::EnergyResolvedProperty::EnergyResolvedProperty()",
844 "Only Serializable::Mode::JSON is supported yet.",
850 template<
typename DataType>
856 template<
typename DataType>
859 energyType == EnergyType::Real,
860 "EnergyResolvedProperty::getLowerBound()",
861 "The Property is not of the type EnergyType::Real.",
865 return descriptor.realEnergy.lowerBound;
868 template<
typename DataType>
871 energyType == EnergyType::Real,
872 "EnergyResolvedProperty::getUpperBound()",
873 "The Property is not of the type EnergyType::Real.",
877 return descriptor.realEnergy.upperBound;
880 template<
typename DataType>
883 energyType == EnergyType::Real,
884 "EnergyResolvedProperty::getResolution()",
885 "The Property is not of the type EnergyType::Real.",
889 return descriptor.realEnergy.resolution;
892 template<
typename DataType>
895 energyType == EnergyType::Real,
896 "EnergyResolvedProperty::getDeltaE()",
897 "The Property is not of the type EnergyType::Real.",
902 if(descriptor.realEnergy.resolution == 1)
906 descriptor.realEnergy.upperBound
907 - descriptor.realEnergy.lowerBound
908 )/(descriptor.realEnergy.resolution - 1);
913 template<
typename DataType>
918 energyType == EnergyType::Real,
919 "EnergyResolvedProperty::getEnergy()",
920 "The Property is not of the type EnergyType::Real.",
924 return descriptor.realEnergy.lowerBound + ((int)n)*getDeltaE();
927 template<
typename DataType>
931 energyType == EnergyType::FermionicMatsubara
932 || energyType == EnergyType::BosonicMatsubara,
933 "EnergyResolvedProperty::getLowerMatsubaraEnergyIndex()",
934 "The Property is not of the type"
935 <<
" EnergyType::FermionicMatsubara or"
936 <<
" EnergyType::BosonicMatsubara.",
940 return descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex;
943 template<
typename DataType>
947 energyType == EnergyType::FermionicMatsubara
948 || energyType == EnergyType::BosonicMatsubara,
949 "EnergyResolvedProperty::getUpperMatsubaraEnergyIndex()",
950 "The Property is not of the type"
951 <<
" EnergyType::FermionicMatsubara or"
952 <<
" EnergyType::BosonicMatsubara.",
956 return descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
957 + 2*(descriptor.matsubaraEnergy.numMatsubaraEnergies - 1);
960 template<
typename DataType>
963 energyType == EnergyType::FermionicMatsubara
964 || energyType == EnergyType::BosonicMatsubara,
965 "EnergyResolvedProperty::getNumMatsubaraEnergies()",
966 "The Property is not of the type"
967 <<
" EnergyType::FermionicMatsubara or"
968 <<
" EnergyType::BosonicMatsubara.",
972 return descriptor.matsubaraEnergy.numMatsubaraEnergies;
975 template<
typename DataType>
978 >::getFundamentalMatsubaraEnergy()
const{
980 energyType == EnergyType::FermionicMatsubara
981 || energyType == EnergyType::BosonicMatsubara,
982 "EnergyResolvedProperty::getFundamentalMatsubaraEnergy()",
983 "The Property is not of the type"
984 <<
" EnergyType::FermionicMatsubara or"
985 <<
" EnergyType::BosonicMatsubara.",
989 return descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy;
992 template<
typename DataType>
996 energyType == EnergyType::FermionicMatsubara
997 || energyType == EnergyType::BosonicMatsubara,
998 "EnergyResolvedProperty::getLowerMatsubaraEnergy()",
999 "The Property is not of the type"
1000 <<
" EnergyType::FermionicMatsubara or"
1001 <<
" EnergyType::BosonicMatsubara.",
1005 return descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1006 *descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy;
1009 template<
typename DataType>
1013 energyType == EnergyType::FermionicMatsubara
1014 || energyType == EnergyType::BosonicMatsubara,
1015 "EnergyResolvedProperty::getUpperMatsubaraEnergyIndex()",
1016 "The Property is not of the type"
1017 <<
" EnergyType::FermionicMatsubara or"
1018 <<
" EnergyType::BosonicMatsubara.",
1023 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1024 + 2*(descriptor.matsubaraEnergy.numMatsubaraEnergies-1)
1025 )*descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy;
1028 template<
typename DataType>
1031 >::getMatsubaraEnergy(
1035 energyType == EnergyType::FermionicMatsubara
1036 || energyType == EnergyType::BosonicMatsubara,
1037 "EnergyResolvedProperty::getMatsubaraEnergy()",
1038 "The Property is not of the type"
1039 <<
" EnergyType::FermionicMatsubara or"
1040 <<
" EnergyType::BosonicMatsubara.",
1044 return std::complex<double>(
1046 (descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex + 2*(
int)n)
1047 *descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1051 template<
typename DataType>
1054 case EnergyType::Real:
1055 return getResolution();
1056 case EnergyType::FermionicMatsubara:
1057 case EnergyType::BosonicMatsubara:
1058 return getNumMatsubaraEnergies();
1061 "Property::EnergyResolvedProperty::getNumEnergies()",
1062 "Unknown energy type.",
1063 "This should never happen, contact the developer."
1068 template<
typename DataType>
1073 if(energyType != energyResolvedProperty.energyType)
1080 case EnergyType::Real:
1082 double lowerBound0 = getLowerBound();
1083 double upperBound0 = getUpperBound();
1084 double lowerBound1 = energyResolvedProperty.
getLowerBound();
1085 double upperBound1 = energyResolvedProperty.
getUpperBound();
1086 double dE = getDeltaE();
1088 if(std::abs(lowerBound0 - lowerBound1) > precision*dE)
1090 if(std::abs(upperBound0 - upperBound1) > precision*dE)
1095 case EnergyType::FermionicMatsubara:
1096 case EnergyType::BosonicMatsubara:
1098 double lowerMatsubaraEnergy0 = getLowerMatsubaraEnergy();
1099 double upperMatsubaraEnergy0 = getUpperMatsubaraEnergy();
1100 double lowerMatsubaraEnergy1
1102 double upperMatsubaraEnergy1
1105 if(getNumEnergies() > 1)
1106 dE = imag(getMatsubaraEnergy(1) - getMatsubaraEnergy(0));
1111 std::abs(lowerMatsubaraEnergy0 - lowerMatsubaraEnergy1)
1117 std::abs(upperMatsubaraEnergy0 - upperMatsubaraEnergy1)
1127 "Property::EnergyResolvedProperty::energyWindowsAreEqual()",
1128 "Unknown energy type.",
1129 "This should never happen, contact the developer."
1134 template<
typename DataType>
1139 case Serializable::Mode::JSON:
1142 j[
"id"] =
"EnergyResolvedProperty";
1144 case EnergyType::Real:
1145 j[
"energyType"] =
"Real";
1146 j[
"lowerBound"] = descriptor.realEnergy.lowerBound;
1147 j[
"upperBound"] = descriptor.realEnergy.upperBound;
1148 j[
"resolution"] = descriptor.realEnergy.resolution;
1151 case EnergyType::FermionicMatsubara:
1152 j[
"energyType"] =
"FermionicMatsubara";
1153 j[
"lowerMatsubaraEnergyIndex"]
1154 = descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex;
1155 j[
"numMatsubaraEnergies"]
1156 = descriptor.matsubaraEnergy.numMatsubaraEnergies;
1157 j[
"fundamentalMatsubaraEnergy"]
1158 = descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy;
1161 case EnergyType::BosonicMatsubara:
1162 j[
"energyType"] =
"BosonicMatsubara";
1163 j[
"lowerMatsubaraEnergyIndex"]
1164 = descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex;
1165 j[
"numMatsubaraEnergies"]
1166 = descriptor.matsubaraEnergy.numMatsubaraEnergies;
1167 j[
"fundamentalMatsubaraEnergy"]
1168 = descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy;
1173 "Property::EnergyResolvedProperty::serialize()",
1174 "Unknown EnergyType.",
1175 "This should never happen, contact the developer."
1178 j[
"abstractProperty"] = nlohmann::json::parse(
1186 "Property::EnergyResolvedProperty::serialize()",
1187 "Only Serializable::Mode::JSON is supported yet.",
1193 template<
typename DataType>
1199 energyType == rhs.energyType,
1200 "Property::EnergyResolvedProperty::operator+=()",
1201 "Incompatible energy types.",
1206 case EnergyType::Real:
1208 descriptor.realEnergy.lowerBound
1209 == rhs.descriptor.realEnergy.lowerBound,
1210 "Property::EnergyResolvedProperty::operator+=()",
1211 "Incompatible energy bounds. The left hand side has"
1212 <<
" lower bound '" << descriptor.realEnergy.lowerBound
1213 <<
"', while the right hand side has lower bound '"
1214 << rhs.descriptor.realEnergy.lowerBound <<
"'.",
1218 descriptor.realEnergy.upperBound
1219 == rhs.descriptor.realEnergy.upperBound,
1220 "Property::EnergyResolvedProperty::operator+=()",
1221 "Incompatible energy bounds. The left hand side has"
1222 <<
" upper bound '" << descriptor.realEnergy.upperBound
1223 <<
"', while the right hand side has upper bound '"
1224 << rhs.descriptor.realEnergy.upperBound <<
"'.",
1228 descriptor.realEnergy.resolution
1229 == rhs.descriptor.realEnergy.resolution,
1230 "Property::EnergyResolvedProperty::operator+=()",
1231 "Incompatible energy resolution. The left hand side"
1232 <<
" has resolution '"
1233 << descriptor.realEnergy.resolution <<
"', while the"
1234 <<
" right hand side has resolution '"
1235 << rhs.descriptor.realEnergy.resolution <<
"'.",
1238 case EnergyType::FermionicMatsubara:
1239 case EnergyType::BosonicMatsubara:
1241 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1242 == rhs.descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex,
1243 "Property::EnergyResolvedProperty::operator+=()",
1244 "Incompatible Matsubara energies. The left hand side"
1245 <<
" has lower Matsubara energy index '"
1246 << descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1247 <<
"', while the right hand side has lower Matsubara"
1248 <<
" energy index '"
1249 << rhs.descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex <<
"'.",
1253 descriptor.matsubaraEnergy.numMatsubaraEnergies
1254 == rhs.descriptor.matsubaraEnergy.numMatsubaraEnergies,
1255 "Property::EnergyResolvedProperty::operator+=()",
1256 "Incompatible Matsubara energies. The left hand side"
1258 << descriptor.matsubaraEnergy.numMatsubaraEnergies
1259 <<
"' number of Matsubara energies, while the right"
1260 <<
" hand side has '"
1261 << rhs.descriptor.matsubaraEnergy.numMatsubaraEnergies
1262 <<
"' number of Matsubara energies.",
1266 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1267 == rhs.descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy,
1268 "Property::EnergyResolvedProperty::operator+=()",
1269 "Incompatible Matsubara energies. The left hand side"
1270 <<
" has fundamental Matsubara energy '"
1271 << descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1272 <<
"', while the right hand side has fundamental Matsubara"
1274 << rhs.descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1285 template<
typename DataType>
1291 energyType == rhs.energyType,
1292 "Property::EnergyResolvedProperty::operator-=()",
1293 "Incompatible energy types.",
1298 case EnergyType::Real:
1300 descriptor.realEnergy.lowerBound
1301 == rhs.descriptor.realEnergy.lowerBound,
1302 "Property::EnergyResolvedProperty::operator-=()",
1303 "Incompatible energy bounds. The left hand side has"
1304 <<
" lower bound '" << descriptor.realEnergy.lowerBound
1305 <<
"', while the right hand side has lower bound '"
1306 << rhs.descriptor.realEnergy.lowerBound <<
"'.",
1310 descriptor.realEnergy.upperBound
1311 == rhs.descriptor.realEnergy.upperBound,
1312 "Property::EnergyResolvedProperty::operator-=()",
1313 "Incompatible energy bounds. The left hand side has"
1314 <<
" upper bound '" << descriptor.realEnergy.upperBound
1315 <<
"', while the right hand side has upper bound '"
1316 << rhs.descriptor.realEnergy.upperBound <<
"'.",
1320 descriptor.realEnergy.resolution
1321 == rhs.descriptor.realEnergy.resolution,
1322 "Property::EnergyResolvedProperty::operator-=()",
1323 "Incompatible energy resolution. The left hand side"
1324 <<
" has resolution '"
1325 << descriptor.realEnergy.resolution <<
"', while the"
1326 <<
" right hand side has resolution '"
1327 << rhs.descriptor.realEnergy.resolution <<
"'.",
1330 case EnergyType::FermionicMatsubara:
1331 case EnergyType::BosonicMatsubara:
1333 descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1334 == rhs.descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex,
1335 "Property::EnergyResolvedProperty::operator-=()",
1336 "Incompatible Matsubara energies. The left hand side"
1337 <<
" has lower Matsubara energy index '"
1338 << descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex
1339 <<
"', while the right hand side has lower Matsubara"
1340 <<
" energy index '"
1341 << rhs.descriptor.matsubaraEnergy.lowerMatsubaraEnergyIndex <<
"'.",
1345 descriptor.matsubaraEnergy.numMatsubaraEnergies
1346 == rhs.descriptor.matsubaraEnergy.numMatsubaraEnergies,
1347 "Property::EnergyResolvedProperty::operator-=()",
1348 "Incompatible Matsubara energies. The left hand side"
1350 << descriptor.matsubaraEnergy.numMatsubaraEnergies
1351 <<
"' number of Matsubara energies, while the right"
1352 <<
" hand side has '"
1353 << rhs.descriptor.matsubaraEnergy.numMatsubaraEnergies
1354 <<
"' number of Matsubara energies.",
1358 descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1359 == rhs.descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy,
1360 "Property::EnergyResolvedProperty::operator-=()",
1361 "Incompatible Matsubara energies. The left hand side"
1362 <<
" has fundamental Matsubara energy '"
1363 << descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1364 <<
"', while the right hand side has fundamental Matsubara"
1366 << rhs.descriptor.matsubaraEnergy.fundamentalMatsubaraEnergy
1377 template<
typename DataType>
1387 template<
typename DataType>