From "A Commentary on Canon Law":
The commission of certain very grave crimes has the effect of expelling the culpable religious ipso facto, that is, the religious is dismissed by the law itself. The terms of this canon are to be interpreted strictly, that is, all the conditions laid down must be actually present before such a grave penalty can be said to be incurred. A crime of this type would be A religious who has publicly apostized from the Catholic faith (c. 646, §1, 1°): Apostasy is defined in canon 1325, §2, as the complete abandonment of the Christian faith. The apostasy from the Catholic faith must be public, which means according to canon 2197, 1°, that either the fact is already known by a large number of people, or that the circuмstances of the apostasy are such that one must prudently judge that it will easily become known.
Regarding Holy Orders, an irregularity by delict is one which is incurred by reason of certain specified personal, grievous, external consummated sins committed after baptism, which sins render the person unworthy of the clerical state or of exercising orders already received. The first two of seven such delicts are 1. Apostates from the faith, heretics, and schismatics (c. 985, 1°), and 2. Those who, except in case of extreme necessity, have allowed themselves to be baptized by non-Catholics (meaning here heretics or schismatics, not infidels) in any manner whatsoever (c. 985, 2°)
Irregularities by delict, however, are not incurred unless the delict is a grave external sin, public or occult, committed after baptism except in the case of c. 985, 2° (c. 986).
It is illicit for Catholics in any way to assist actively or take part in sacred worship of non-Catholics (c. 1258, §1). Passive or merely material presence, for the sake of civil courtesy, duty, or respect, for a grave reason which in case of doubt should have the approval of the Bishop may be tolerated, at the funerals, weddings, and other such celebrations of non-Catholics, provided there is no danger of perversion or of scandal (c. 1258, §2).
Our Lord Jesus Christ entrusted the deposit of faith to the Church, that under the constant guidance and assistance of the Holy Spirit, she might sacredly guard and faithfully explain this divine revelation. The Church has therefore the right and the duty, independently of any civil power, to teach all nations the full evangelical doctrine; and all men are bound by the law of God to learn this doctrine properly and to embrace the true Church of God (c. 1322).
The Church guards and explains this deposit of faith. She does not add to it, for it was completed and closed with the death of the last Apostle, Saint John. To guard means to keep and defend; in doing this the Church must sometimes declare truths which are not contained in revelation but which are necessary to keep revealed truth. To explain means to make clear what is obscure. The so-called developments of doctrine through dogmatic definitions may be compared to the sharpening of the focus on a film which is projected on a screen. The details which become discernible with clear focus are not new; they were all in the original picture, but they are now brought out more clearly.
All those truths must be believed fide divina et catholica, which are contained in the written word of God or in tradition and which the Church proposes for acceptance as revealed by God, either by solemn definition or through her ordinary and universal teaching. To pronounce a solemn definition is the part of an Ecuмenical Council or of the Roman Pontiff speaking ex cathedra. No doctrine is to be considered as dogmatically defined unless this is evidently proved (c. 1323).
It is not enough to avoid heresy, but one must also carefully shun all errors which more or less approach it; hence all must observe the constitutions and decrees by which the Holy See has proscribed and forbidden opinions of that sort (c. 1324).
The faithful are bound to profess their faith openly whenever under the circuмstances silence, evasion, or their manner of acting would otherwise implicitly amount to a denial of the faith, or would involve contempt of religion, an offense to God, or scandal to the neighbor (c. 1325, §1).
One who after baptism, while remaining nominally a Christian, pertinaciously (that is, with conscious and intentional resistance to the authority of God and the Church) denies or doubts any one of the truths which must be believed de fide divina et catholica, is a heretic; if he falls away entirely from the Christian faith, he is an apostate; finally if he rejects the authority of the Supreme Pontiff or refuses communion with the members of the Church who are subject to him, he is a schismatic (c. 1325, §2).
Catholics are to avoid disputations or conferences about matters of faith with non-Catholics, especially in public, unless the Holy See, or in case of emergency the Ordinary of the place, has given permission (c. 1325, §3).
The character of a moral act which makes it attributable to a certain person is called imputability. The imputability of a crime depends on the malice (dolus) of the culprit or on his culpability (culpa) in being ignorant of the law or in failing to use due diligence; hence all causes which increase, diminish, or excuse from malice or culpability, automatically increase, diminish, or excuse from the imputability of a crime (c. 2199).
Malice here means the deliberate will to violate the law; opposed to it on the part of the mind is want of knowledge, on the part of the will, want of freedom (c. 2200, §1). When an external violation of the law has been committed, malice is presumed in the external forum until the contrary is proved (c. 2200, §2).
Persons who conspire to commit a crime and physically concur in it are all held equally guilty, unless circuмstances increase or diminish the guilt of some or one of them (c. 2209, §1). In a crime which by its nature requires an accomplice, each party has the same guilt unless the contrary is clear from the circuмstances (c. 2209, §2). Not only the one who commands a crime and who is thus the principal culprit, but also those who induce the commission of the crime or concur in it in any way, incur no less guilt, other things being equal, than the one who perpetrated it, if without their help the crime would not have been committed (c. 2209, §3). But if their co-operation only made easier a crime which would have been committed even without their concurrence, it is less guilty (c. 2209, §4). One who by timely retraction completely withdrew his influence toward the commission of the crime is freed from all imputability, even though the perpetrator neverless completed the crime for reasons of his own; if he did not completely withdraw his influence, the retraction diminishes but does not entirely remove culpability (c. 2209, §5). One who concurs in a crime only by neglecting his duty incurs imputability proportionate to the obligation which he had to prevent the crime by doing his duty (c. 2209, §6). Praise of the crime after its commission, sharing in its fruits, concealing and harboring the culprit, or other acts subsequent to the completion of the crime, may constitute new crimes, namely, if they are punished by a penalty in the law; but, unless before the crime there was an agreement with the criminal to perform those acts, they do not entail imputability for the crime (c. 2209, §7).
Excommunication is a censure by which one is excluded from the communion of the faithful, with the consequences which are enumerated in the following canons, and which cannot be separated (c. 2257, §1). It is also called anathema, especially if it is inflicted with the solemnities described in the Roman Pontifical (c. 2257, §2).
Some excommunicated persons are vitandi, others tolerati (c. 2258, §1). No one is vitandus unless he has been excommunicated by name by the Holy See, and the excommunication has been publicly announced, and it is expressly stated in the decree or sentence that he is to be avoided, without prejudice to canon 2343, §1, 1° (c. 2258, §2). The canon cited declares anyone who lays violent hands on the Supreme Pontiff ipso facto vitandus.
An excommunicated person is forbidden licitly to consecrate or administer sacraments and sacramentals, except as follows (c. 2261, §1). Except as provided in §3, the faithful can for any just cause ask for sacraments or sacramentals of one who is excommunicated, especially if there is no one else to give them; and in such cases the excommunicated person so asked may administer them, and is not obliged to ask the reason for the request (c. 2261, §2). But from an excommunicated vitandus or one against whom there is a declaratory or condemnatory sentence, the faithful may only in danger of death ask for sacramental absolution according to canons 882, 2252, and also for other sacraments and sacramentals in case there is no one else to administer them (c. 2261, §3).
An excommunicated person who still holds an office to which ordinary jurisdiction is attached, acts illicitly but validly until a condemnatory or declaratory judgment has been passed upon him; thereafter he acts invalidly (c. 2264).
A person who is suspended from jurisdiction similarly, acts illicitly but validly before, and invalidly after a condemnatory or declaratory judgment. (c. 2284).
All apostates from the Christian faith, and all heretics and schismatics: (1) are ipso facto excommunicated; (2) if after due warning they fail to amend, they are to be deprived of any benefice, dignity, pension, office, or other position which they may have in the Church, they are to be declared infamous, and clerics after a reception of the warning are to be deposed; (3) if they have joined a non-Catholic sect or publicly adhered to it, they are ipso facto infamous, and clerics, in addition to being considered to have tacitly renounced any office they may hold, according to canon 188, 4°, are, if previous warning proves fruitless, to be degraded (c. 2314, §1). The abjuration [from crimes] is regarded as legally made when it is made before the Ordinary of the place or his delegate and at least two witnesses (c. 2314, §2).
One who is suspected of heresy, and who after warning fails to remove the cause of suspicion, shall be barred from legitimate acts, and if he is a cleric he shall moreover, after a repetition of the warning has proved fruitless, be suspended a divinis; if one who is suspected of heresy does not amend his life within six full months from the time when the penalty was incurred, he shall be considered a heretic and be subject to the penalties for heresy (c. 2315).
One who spontaneously and with full knowledge helps in any way in the propagation of heresy, or who co-operates in divinis with heretics contrary to the provision of canon 1258, is suspected of heresy (c. 2316).
Those who obstinately teach or defend, either publicly or privately, a doctrine which has been condemned, though not as formally heretical, by the Holy See or by a General Council, are to be excluded from the ministry of preaching the word of God or of hearing sacramental confessions, and from teaching in any capacity, in addition to any other penalties which the condemnatory sentence may inflict or which the Ordinary, after due warning, may deem necessary to repair the scandal (c. 2317).
Those who join a Masonic sect or other societies of the same sort, which plot against the Church or legitimate civil authority, incur ipso facto an excommunication simply reserved to the Holy See (c. 2335).