-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for triplet excitation operator
- Loading branch information
1 parent
60d2b55
commit ad699d0
Showing
4 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
export τ | ||
|
||
""" | ||
SingletExcitationOperator | ||
The T_pq type operator. | ||
""" | ||
struct TripletExcitationOperator <: Operator | ||
p::Int | ||
q::Int | ||
end | ||
|
||
function Base.show(io::IO, | ||
( | ||
e, constraints, translation | ||
)::Tuple{TripletExcitationOperator,Constraints,IndexTranslation}) | ||
print(io, "T_") | ||
print_mo_index(io, constraints, translation, e.p, e.q) | ||
end | ||
|
||
function exchange_indices(e::TripletExcitationOperator, mapping) | ||
TripletExcitationOperator( | ||
exchange_index(e.p, mapping), | ||
exchange_index(e.q, mapping) | ||
) | ||
end | ||
|
||
function get_all_indices(e::TripletExcitationOperator) | ||
(e.p, e.q) | ||
end | ||
|
||
function Base.:(==)(a::TripletExcitationOperator, b::TripletExcitationOperator) | ||
(a.p, a.q) == (b.p, b.q) | ||
end | ||
|
||
function Base.isless(a::TripletExcitationOperator, b::TripletExcitationOperator) | ||
(a.p, a.q) < (b.p, b.q) | ||
end | ||
|
||
""" | ||
τ(p, q) | ||
Constructs an expression containing a single triplet excitation operator. | ||
""" | ||
τ(p, q) = Expression(TripletExcitationOperator(p, q)) | ||
|
||
function convert_to_elementary_operators(o::TripletExcitationOperator) | ||
Expression( | ||
[ | ||
(fermiondag(o.p, α)*fermion(o.q, α))[1] | ||
-(fermiondag(o.p, β)*fermion(o.q, β))[1] | ||
] | ||
) | ||
end | ||
|
||
function act_on_ket(op::TripletExcitationOperator) | ||
p = op.p | ||
q = op.q | ||
τ(p, q) * virtual(p) * occupied(q) | ||
end | ||
|
||
function Base.adjoint(op::TripletExcitationOperator) | ||
TripletExcitationOperator(op.q, op.p) | ||
end |